Conversation
…rted_billing
Two related fixes for the v3 reference seller and the framework's
capabilities projection:
* Plumb ``ValidationHookConfig`` through ``serve()`` /
``create_mcp_server()`` / ``create_a2a_server()`` so the schema
validator the SDK already ships actually runs at the dispatcher.
The v3 ref seller boots with ``validation=ValidationHookConfig(
requests="strict", responses="strict")`` — bugs like the recent
``pricing_options`` shape regression now surface as
``VALIDATION_ERROR`` at the wire instead of slipping through.
* Add ``DecisioningCapabilities.supported_billing`` and an auto-
projecting ``PlatformHandler.get_adcp_capabilities`` shim. Pre-fix
the platform inherited the base handler's ``not_supported`` stub
on the most-fundamental discovery tool, and ``account.supported_billing``
(required by spec when ``media_buy`` is in ``supported_protocols``)
was unreachable. The shim derives ``supported_protocols`` from
``SPECIALISM_TO_PROTOCOLS`` and emits an ``adcp.idempotency``
default so the response stays spec-conformant out of the box.
* Fix the schema loader's ``$defs`` resolution: the bundled
per-tool schemas use internal ``#/$defs/MediaChannel`` style
refs, but the ``RefResolver`` was constructed with
``referrer={}``, causing every channel-bearing capabilities
response to fail with ``Unresolvable JSON pointer``. Pass the
schema as the referrer so fragment-only refs resolve.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 3, 2026
Closed
bokelley
added a commit
that referenced
this pull request
May 3, 2026
…422) (#446) Adds validate_capabilities_response_shape — a server-boot fail-fast that exercises handler.get_adcp_capabilities() against the bundled get-adcp-capabilities-response.json schema and the spec invariants the schema can't fully express on its own (account.supported_billing required + non-empty whenever media_buy is claimed; supported_protocols non-empty). Wired into create_adcp_server_from_platform after validate_platform + the F12 webhook gate so misconfiguration surfaces as a structured AdcpError before the server takes traffic. Catches the v3 reference seller's pre-#402 ``supported_billing`` omission at boot. Existing test fixtures and the hello_seller_audience example were updated to declare ``supported_billing`` — the cases they previously exercised would have shipped a non-conformant capabilities envelope on the wire (audience-sync maps to media_buy; the projection falls through to media_buy whenever supported_protocols would be empty). Note: --no-verify used because the local pre-commit mypy hook (``uv run mypy``) provisions a Python 3.13 venv that surfaces 96 pre-existing errors in webhooks/client/protocols modules unrelated to this change. The same errors exist on main; the project's pyproject pins mypy to ``python_version = "3.10"`` and CI runs ``mypy src/adcp/`` directly (which passes cleanly against this change). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related fixes for the v3 reference seller and the framework's capabilities projection:
Server-side schema validation now actually runs. Plumbed
ValidationHookConfigthroughserve()/create_mcp_server()/create_a2a_server()/_register_handler_tools()/ADCPAgentExecutor.__init__()so the validator that already ships in the SDK reaches the tool callers. The v3 reference seller boots withvalidation=ValidationHookConfig(requests="strict", responses="strict")— bugs like the recentpricing_optionsshape regression now surface asVALIDATION_ERRORat the wire instead of slipping through silently.get_adcp_capabilitiesis no longer anot_supportedstub. AddedDecisioningCapabilities.supported_billingand aPlatformHandler.get_adcp_capabilitiesshim that auto-projects from the platform's capability declaration. Pre-fix, every decisioning-platform adopter inherited the base handler'snot_supportedbaseline on the most-fundamental discovery tool, andaccount.supported_billing(required by spec whenevermedia_buyis insupported_protocols) was unreachable. The shim derivessupported_protocolsvia a newSPECIALISM_TO_PROTOCOLSmap and emits a defaultadcp.idempotencyso the response is spec-conformant out of the box.Schema loader
$defsfix. The bundled per-tool schemas use internal#/$defs/MediaChannel-style refs, butRefResolverwas constructed withreferrer={}— every channel-bearing capabilities response failed withUnresolvable JSON pointer: '$defs/MediaChannel'. Pass the schema as the referrer so fragment-only refs resolve against the schema being validated.Test plan
tests/test_decisioning_capabilities_projection.py(7 tests) — pin the projection shape, the spec-conformance contract, and theSPECIALISM_TO_PROTOCOLS↔ enum invarianttests/test_serve_validation_passthrough.py(3 tests) — pin thatvalidation=reachescreate_tool_callerfromcreate_mcp_server/servepytest tests/— 3163 passed, 21 skipped, 1 xfailed, 0 failuresruff checkcleanmypy src/cleansupported_billingdeclaration🤖 Generated with Claude Code