Repository navigation
Description
π§ DO NOT TRIAGE β owned by @bokelley. Bundles 5 small follow-ups deferred from #484 expert review. None are blockers; bundling so they can land in one polish PR.
Context
#484 (capabilities projection) merged with two expert reviews (code-reviewer + ad-tech-protocol-expert) flagging items as deferred polish β none wire-incorrect, but worth tightening before downstream adopters lean heavily on the new declaration shape.
Items
P1 β Re-export gaps (code-reviewer finding)
Features2 and ContentStandards not in adcp.decisioning.capabilities.__all__.
Features2is the type ofSignals.features(generated_poc/bundled/protocol/get_adcp_capabilities_response.py:349)ContentStandardsis the type ofMediaBuy.content_standards(:1240)- Adopters declaring
Signals(features=Features2(...))orMediaBuy(content_standards=ContentStandards(...))have to dig intogenerated_pocdirectly. Same fix as the 12 re-exports added in feat(decisioning): project full get_adcp_capabilities response schema into DecisioningCapabilitiesΒ #484 commit 7.
Files: src/adcp/types/capabilities.py, src/adcp/decisioning/capabilities.py, tests/test_decisioning_capabilities_submodule.py
P2 β Deprecation warning stacklevel (code-reviewer finding)
src/adcp/decisioning/handler.py:992,1008,1027 β DeprecationWarning fires at stacklevel=2, which points to the caller of get_adcp_capabilities (the MCP dispatcher), not the adopter's DecisioningCapabilities(...) declaration site. Move the warnings into __post_init__ so stacklevel=2 lands on the adopter's declaration.
Trade-off documented: warning fires at construction whether or not projection runs (the right behavior β declaration mistakes shouldn't hide until first buyer query).
P3 β Hoist import warnings (code-reviewer nit)
Three local import warnings in get_adcp_capabilities. Hoist to module top.
P4 β Auto-derive direction warning (protocol-expert finding)
Auto-deriving supported_protocols from specialisms is semantically backwards per spec β specialisms roll up TO protocols, not the other way. Add a warn-on-derive emit when projection takes the derive path (no explicit supported_protocols set), pointing adopters at the override path. Doc note in docs/decisioning-capabilities.md.
P5 β Compliance-testing footgun (protocol-expert finding)
When caps.compliance_testing is not None and the platform doesn't expose a comply_test_controller method, the seller advertises a capability it can't honor β buyers will fail when they try to drive scenarios. Add boot-time hasattr(platform, "comply_test_controller") check; warn if missing.
Out of scope (separate issues if/when needed)
- Top-level forward-compat fields (
extensions_supported,experimental_features,last_updated,errors,context,ext) β adopters have no projection path. Defer until requested by a real adopter; opening this seam early risks shipping the wrong abstraction. - Empty
supported_billinglist ships invalid when adopter setsAccount(supported_billing=[])directly. Pydantic enforcesmin_length=1on the wire model so construction fails β the issue only arises if adopters circumvent typed construction. Document, don't add a runtime guard.
Acceptance criteria
-
Features2andContentStandardsre-exported fromadcp.types.capabilitiesandadcp.decisioning.capabilities - DeprecationWarnings emitted from
__post_init__(or otherwise pointing at adopter declaration site) -
import warningshoisted to module top - Auto-derive of
supported_protocolsemits a warning + doc note -
compliance_testing-without-method firesUserWarningat boot viavalidate_platform -
tests/test_decisioning_capabilities_submodule.pyregression coverage for each item
Activity
fix(decisioning): mock target Python 3.10 import-resolution compat
fix(decisioning): apply 3.10 mock-target fix to second compliance_tesβ¦
Merge pull request #486 from adcontextprotocol/bokelley/capabilities-β¦
feat(decisioning): re-export SignalsFeatures + ContentStandards capabβ¦
fix(decisioning): fire legacy-field DeprecationWarnings at construction
feat(decisioning): warn when supported_protocols is auto-derived fromβ¦
feat(decisioning): warn when compliance_testing capability is declareβ¦