Skip to content

feat(models): update Python SDK schemas for UCP release 2026-08-25 - #87

Open
segiodongo wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
segiodongo:feat/v825-upgrade
Open

feat(models): update Python SDK schemas for UCP release 2026-08-25#87
segiodongo wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
segiodongo:feat/v825-upgrade

Conversation

@segiodongo

Copy link
Copy Markdown
Contributor

Description

This PR updates the Python SDK to be fully compatible with the UCP 2026-08-25 specification release.

Key Changes

  1. Schema Preprocessing & Codegen Pipeline:

    • Added list/dict type-safety guards to preprocess_schemas.py for allOf, anyOf, and oneOf merging.
    • Updated normalize_metadata_schemas to dynamically detect and include all UCP metadata response envelopes (including response_catalog_schema and response_location_schema).
    • Extended per-file-ignores in pyproject.toml for generated schemas, preprocessing/postprocessing scripts, and test suites.
  2. Model Regeneration & Reorganization:

    • Regenerated all Pydantic v2 models using ./generate_models.sh 2026-08-25.
    • Common Vertical (ucp_sdk.models.schemas.common): Added models for Location Search & Lookup (location_search.py, location_lookup.py), Loyalty, Payment Terms, AP2 Mandates, Split Payments, and Request Constraints.
    • Shared Primitives (ucp_sdk.models.schemas.common.types): Relocated shared types (amounts, prices, totals, postal address, signals, error/warning messages, pagination, time interval, unit price) from shopping into the common namespace.
    • Shopping Vertical (ucp_sdk.models.schemas.shopping): Updated Cart, Checkout, Order, Catalog Search/Lookup, Buyer Consent, and Permalinks to reference the reorganized common types and new fulfillment destinations.
    • Transports (ucp_sdk.models.schemas.transports): Generated transport bindings for REST, MCP tool calls, JSON-RPC, and embedded/A2A messaging.
    • Service & Profile (ucp_sdk.models.schemas): Added profile.py and updated capability/service definitions.
  3. Documentation & Versioning:

    • Bumped package version to 0.5.0 in pyproject.toml and src/ucp_sdk/__init__.py.
    • Updated README.md package reference table and codegen instructions.
    • Configured .gitignore to ignore temporary codegen artifacts (ucp/, uv.lock).

Verification

  • Linting & Formatting: uv run ruff format and uv run ruff check passed cleanly (0 errors).
  • Unit Tests: uv run python -m unittest discover tests/ passed (88 tests passed, 0 failures).
  • Module Import Health: Dynamically imported all 226 generated model submodules with 0 import errors.

@carolinerg1

Copy link
Copy Markdown

Hi @segiodongo,

Thanks for submitting this PR! Looks like it's failing backward compatibility when regenerating models for 2026-04-08 and Lint - though I see in your description that you ran Lint check (potentially not across all updated files ?). Could you please take a look at these 2 issues. Thanks!

@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Aug 25, 2026
@segiodongo
segiodongo force-pushed the feat/v825-upgrade branch 2 times, most recently from b74d02c to c218949 Compare August 25, 2026 20:24
- Update schema preprocessing pipeline for v2026-08-25 response definitions
- Regenerate Pydantic models from UCP release/2026-08-25 JSON schemas
- Restructure models into common, shopping, and transport verticals
- Add Location Search/Lookup, Loyalty, Request Constraints, Permalinks, and Actions models
- Move shared primitives and payment extensions to common namespace
- Bump package version to 0.5.0 in pyproject.toml and update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs-triage Signal that the PR is ready for human triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants