Skip to content

feat: dual-schema support (2026-01-23) + UCP readiness validator CLI#31

Closed
sbeashwar wants to merge 3 commits intoUniversal-Commerce-Protocol:mainfrom
sbeashwar:phase1-pr
Closed

feat: dual-schema support (2026-01-23) + UCP readiness validator CLI#31
sbeashwar wants to merge 3 commits intoUniversal-Commerce-Protocol:mainfrom
sbeashwar:phase1-pr

Conversation

@sbeashwar
Copy link
Copy Markdown

@sbeashwar sbeashwar commented Apr 17, 2026

Superseded by stacked PRs: #32 (SDK migration), #33 (handler validation), #34 (validator tool).

The UCP spec moved from 2026-01-11 to 2026-01-23, changing services
from single UcpService objects to arrays of transport objects, and
capabilities from flat lists to dicts keyed by name. The conformance
tests only supported the old format.

integration_test_utils.py:
- shopping_service_endpoint now handles both formats
- 2026-01-23: iterates transport list to find REST binding
- 2026-01-11: reads single UcpService.rest.endpoint directly

protocol_test.py:
- test_discovery: accepts either version, parses both capability formats
- test_discovery_urls: extracts URLs from both service structures
- test_version_negotiation: discovers endpoint from both formats
- Payment handler assertions made optional (not all profiles declare them)
- Removed buyer_consent from required capabilities set

Addresses Universal-Commerce-Protocol/ucp#142
Standalone CLI tool that validates merchant UCP endpoint readiness by
fetching /.well-known/ucp and running structural checks:

- Discovery profile reachability and JSON/schema validation
- Schema version detection (2026-01-11 / 2026-01-23) with consistency
- Required capability completeness (checkout, order, discount, fulfillment)
- Payment handler declaration and config validation
- Spec/schema URL reachability
- Signing key JWK format validation
- Optional checkout smoke test (--smoke)

Output modes: colored terminal (default) and JSON (--json).
Exit code 0 for READY, 1 for NOT_READY.
Zero new dependencies - reuses httpx and ucp-sdk.

Addresses Universal-Commerce-Protocol/ucp#142
@google-cla
Copy link
Copy Markdown

google-cla bot commented Apr 17, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

…oded list

The test_discovery test had a hardcoded set of expected payment handler
IDs (google_pay, mock_payment_handler, shop_pay) that was specific to
the Flower Shop sample server. This caused failures when running against
any other UCP endpoint.

Replace with structural validation that discovers handlers from the
business profile and validates each handler has:
- Required fields (id, name, version, config)
- Reverse-DNS naming convention for handler name

This makes the conformance test server-agnostic, which is the correct
behavior for a protocol conformance suite.
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.

1 participant