Skip to content

refactor(identity, payment): flatten LoadUCPSigningKeyOptions + drop dead CreateX402ServerOptions - #39

Merged
vvillait88 merged 1 commit into
mainfrom
feat/303-load-ucp-signing-key-flatten
May 14, 2026
Merged

refactor(identity, payment): flatten LoadUCPSigningKeyOptions + drop dead CreateX402ServerOptions#39
vvillait88 merged 1 commit into
mainfrom
feat/303-load-ucp-signing-key-flatten

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

  • load_ucp_signing_key_from_env now takes the 5 fields (env_jwk_var, env_kid_var, env_alg_var, default_kid, default_alg) as kwargs; deletes the LoadUCPSigningKeyOptions dataclass.
  • During audit: CreateX402ServerOptions surfaced as a dead wrapper (create_x402_server was already kwarg-shaped). Deleted with its barrel export.
  • Merchant migration path: pin module-level kwargs as a dict + spread (load_ucp_signing_key_from_env(**_OPTS)).
  • examples/signed_ucp_merchant.py migrated to the dict-spread pattern as the canonical recipe.

After this PR every public callable in the SDK is fully flat — no wrapper dataclasses on any input surface.

Test plan

  • uv run pytest tests/ -q → 1034 passed, 95.02% coverage
  • uv run ruff check → all checks passed
  • uv run ty check agentscore_commerce/ → all checks passed
  • uv run vulture on touched files → no findings
  • Locked behavior contract for load_ucp_signing_key_from_env preserved (env precedence, kid precedence, sanitized errors, cache + lock semantics)

🤖 Generated with Claude Code

…e dead CreateX402ServerOptions

Last remaining wrapper dataclass in the SDK. load_ucp_signing_key_from_env
now takes the 5 fields directly as kwargs; the env-var-name overrides remain
on the public surface so multi-env-namespace merchants still pin once via
a module-level dict + spread.

While auditing, CreateX402ServerOptions surfaced as a leftover wrapper that
no longer matched its function (create_x402_server was already kwarg-shaped);
deleted along with its barrel export.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit 8826f73 into main May 14, 2026
7 checks passed
@vvillait88
vvillait88 deleted the feat/303-load-ucp-signing-key-flatten branch May 14, 2026 19:12
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