Skip to content

ci: run tests and drift for js-sdk#73 - #1

Closed
vishkaty wants to merge 1 commit into
mainfrom
fix/discovery-profile-registry-shape
Closed

ci: run tests and drift for js-sdk#73#1
vishkaty wants to merge 1 commit into
mainfrom
fix/discovery-profile-registry-shape

Conversation

@vishkaty

Copy link
Copy Markdown
Owner

CI vehicle only. This runs the Tests and Lint workflows on the fork for the exact
commit proposed upstream in Universal-Commerce-Protocol#73, because
workflow runs on that pull request are held behind the maintainer approval gate.

Not for merge.

…chema

UcpDiscoveryProfileSchema.ucp (UcpSchema) was a hand written projection
node carrying the withdrawn 2026-01-11 discovery shape: capabilities as a
flat array and required, services as a record of single objects, and no
payment_handlers. ucp.json#/$defs/base declares every registry as an
object keyed by reverse domain name whose values are entity arrays and
requires only version; #/$defs/business_schema additionally requires
services and payment_handlers and adds supported_versions. The published
package therefore rejected the business profile example that the
specification publishes (overview/index.md, def=business_schema) on both
capabilities and services, while UcpProfileDocumentSchema in the same
file, which is derived from the schema, accepted it.

Derive the node from business_schema the same way the response envelope
is derived, through buildResponseEnvelopeSchema plus the required list
and properties of the overlay. Registry items use the per entity response
compat shape, as the envelope does. No title is set so the type keeps its
property derived name and the UcpSchema export is unchanged.

Two properties were being widened past what the schema declares, and both
are corrected here. The envelope builder collapsed the map_order $ref to
a string, which rejected the second business profile example in the
overview (the block with map_order.payment_handlers); map_order is now a
record of string arrays per ucp.json#/$defs/map_order, so
UcpResponseSchema and UcpCheckoutResponseSchema change on that one line
as well. supported_versions was typed as a record of any and accepted a
number where the overlay declares a profile URI; its values are now
typed as strings.

Compile time breaking for consumers of the discovery type: Ucp.capabilities
changes from CapabilityDiscovery[] to Record<string, CapabilityResponse[]>
and Ucp.services from Record<string, UcpService> to
Record<string, ServiceResponse[]>. No exported name is added or removed.

Tests: tests/discovery-profile-shape.test.js parses the business profile
example from release/2026-08-25 (tests/fixtures/business_profile_2026-08-25.json)
through UcpDiscoveryProfileSchema, and pins the record shape of
capabilities and services, the presence of payment_handlers, the base
and business_schema required sets, the map_order shape, and the
supported_versions value type. The two existing tests that used the empty
legacy fixture now use the spec shape.
@vishkaty

Copy link
Copy Markdown
Owner Author

Closing: this existed only to run the workflows for the commit proposed in Universal-Commerce-Protocol#73. Both runs are green and linked from that pull request.

@vishkaty vishkaty closed this Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants