Skip to content

fix: Update UCP conformance repo to UCP 2026-01-23 version#28

Merged
cusell-google merged 5 commits intoUniversal-Commerce-Protocol:mainfrom
cusell-google:main
Apr 21, 2026
Merged

fix: Update UCP conformance repo to UCP 2026-01-23 version#28
cusell-google merged 5 commits intoUniversal-Commerce-Protocol:mainfrom
cusell-google:main

Conversation

@cusell-google
Copy link
Copy Markdown
Contributor

Overview

This PR updates the local simulation server and test harness payload definitions in the conformance repository to align seamlessly with the Universal Commerce Protocol 2026-01-23 SDK release.

A substantial set of data modeling upgrades forced test payloads to drift out-of-sync with the Python SDK, resulting in 422 validations and 500 runtime tracebacks during testing. This pull request resolves all errors while migrating tests directly to the updated data patterns structure.

Detailed Changes

  • Schema Object Mapping: Upgraded checkout_service.py updates to expect and handle a native FulfillmentUpdateRequest. The usage of static Fulfillment objects during fulfillment adjustments has been entirely replaced, which resolves widespread 422 Unprocessable Entity validation failures.
  • Line Item Payloads: Multiple conformance methods were found injecting invalid hardcoded identifiers (e.g. "line_item_123"). Because the server now uses robust dynamic UUID generation for created lines, these strict lookups crashed. Tests across fulfillment_test.py were adjusted to extract and pass generated line items appropriately.
  • Internal Server Resolution: Refactored the models.py representations and update workflows to safely parse and reconstruct models named FulfillmentGroup and FulfillmentOption matching directly with UCP 01-23. Replaced deprecated paths that referenced FulfillmentGroupResponse, repairing NameError exceptions gracefully.
  • SDK Object Dictionary Evaluation Fixes: Test validations were accessing values as dictionaries mapping standard parameters (t['type'], total['amount']). Due to how data parsing is currently evaluated via Pydantic model parsing into properties vs .model_extra, assertions scattered entirely across order_test.py, validation_test.py, and fulfillment_test.py were corrected to target the accurate instance accesses.
  • SDK Extensions Flattening: Redesigned payload creation for the ap2 authentication extension object to correctly inherit from base objects instead of nesting via legacy wrapping wrappers (the old mandate context payloads). Comments have been fully adjusted to explain why flattened objects replace ap2_data requirements.
  • Code Maintenance & Styling: Removed unneeded module aliases causing redundancy in test imports (e.g., stripped out from ucp_sdk... import Payment as Payment).

Test Results

Locally executed using uv run on Python 3.13 against the background Merchant Server simulation environment.

All 59 conformance tests across 13 suites pass successfully without any 422 or 500 errors.
Total tests passed: 59
Exit code: 0


Includes commits ae7b4b8... and prior.

@cusell-google cusell-google changed the title Update UCP conformance repo to UCP 2026-01-23 version test: Update UCP conformance repo to UCP 2026-01-23 version Mar 24, 2026
@cusell-google cusell-google marked this pull request as ready for review March 25, 2026 13:01
@cusell-google cusell-google requested review from a team as code owners March 25, 2026 13:01
@cusell-google cusell-google changed the title test: Update UCP conformance repo to UCP 2026-01-23 version fix: Update UCP conformance repo to UCP 2026-01-23 version Mar 25, 2026
Copy link
Copy Markdown

@jingyli jingyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cusell-google! Seems like there are 2 minor miss in the updates when it comes to complete_checkout's request payload & item representation in requests.

Comment thread ap2_test.py Outdated
# from the completion payload in this release to flatten the schema.

payment_payload = {
"payment_data": payment_data,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 2026-01-23's complete_checkout request payload, we no longer have payment_data as a json key, but rather it is replaced by payment with an instruments array (https://ucp.dev/2026-01-23/specification/checkout/#complete-checkout). We should probably correct the test here?

Also similar comments below where we are testing against complete_checkout.

Comment thread business_logic_test.py Outdated
item_update = item_update_req.ItemUpdateRequest(
item_update = item_update_request.ItemUpdateRequest(
id=checkout_obj.line_items[0].item.id,
title=checkout_obj.line_items[0].item.title,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item no longer accepts any other metadata fields instead of id in the request front (https://github.com/Universal-Commerce-Protocol/ucp/blob/release/2026-01-23/source/schemas/shopping/types/item.json) - so might be good to clean it here.

Similar comments to item_update objects defined below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, kept just the id.

Comment thread fulfillment_test.py Outdated
Comment thread protocol_test.py Outdated
Comment thread shopping-agent-test.json Outdated
@cusell-google cusell-google force-pushed the main branch 3 times, most recently from 1e4bf59 to 5eb8b29 Compare April 17, 2026 13:50
As per PR review feedback, item objects no longer accept other metadata fields instead of id in the request front. This commit removes title from ItemCreateRequest and ItemUpdateRequest instantiations.
Comment thread shopping-agent-test.json Outdated
"name": "dev.ucp.shopping.order",
"version": "2026-01-23",
"spec": "https://ucp.dev/specs/shopping/order",
"schema": "https://ucp.dev/schemas/shopping/order.json",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These schema and spec fields should also be dated.

i.e. spec -> https://ucp.dev/2026-01-23/specification/order/ and schema -> https://ucp.dev/2026-01-23/schemas/shopping/order.json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks for the catch

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.

4 participants