feat: sync rc.4 schemas + wire update_rights task#199
Merged
Conversation
Closes #185. ## Schema sync Resynced against `adcp-latest`: 564 files updated, 1 removed (`enums/budget-authority-level.json`). The rc.4 spec drops ``Budget.authority_level`` (enum: agent_full/agent_limited/human_required) in favor of two orthogonal fields on ``plan.budget``: - ``reallocation_threshold: number ≥ 0`` — budget-reallocation autonomy denominated in ``budget.currency`` - ``reallocation_unlimited: true`` — explicit full-autonomy sentinel, mutually exclusive with ``reallocation_threshold`` (enforced via ``oneOf`` in the schema) Plus a new ``plan.human_review_required`` flag that governs decisions affecting data subjects (targeting, creative, delivery) under GDPR Art 22 / EU AI Act Annex III — distinct from budget reallocation autonomy. No hand-written SDK code referenced the old ``authority_level`` / ``BudgetAuthorityLevel`` type, so codegen picks up the new shape automatically. ## New task: update_rights The rc.4 schema index added a ``update_rights`` task (partner to ``acquire_rights``). Lets buyers modify an existing rights acquisition — typically extend ``end_date``, raise ``impression_cap``, pause/unpause via ``paused``, or swap to a compatible ``pricing_option_id``. Wired at the 6 spec-coverage sites: - ``ADCPClient.update_rights`` (src/adcp/client.py) - ``ADCPHandler.update_rights`` default stub (src/adcp/server/base.py) - ``ProtocolAdapter.update_rights`` abstract + concrete A2A/MCP impls (src/adcp/protocols/{base,a2a,mcp}.py) - CLI dispatch table (src/adcp/__main__.py) - MCP tool definition + BrandHandler tool-filter set + TypeAdapter registration (src/adcp/server/mcp_tools.py) - ``adcp.types`` public re-exports for ``UpdateRightsRequest`` / ``UpdateRightsResponse`` Also registered ``update_rights`` in ``TASK_FEATURE_MAP`` (capabilities.py) and ``HANDLER_TO_DOMAIN`` (builder.py) so the client-side feature gate enforces it and decorator-style servers auto-advertise the ``brand`` domain. Added ``test_feature_and_domain_maps_cover_brand_tasks`` regression test to prevent silent fail-open for future brand tasks. ## Round-trip coverage New ``tests/test_update_rights_roundtrip.py`` (4 tests): - A2A partial update reaches the wire with only mutated fields - A2A response parses through the ``UpdateRightsResponse1 | 2`` Union - MCP ``call_tool`` receives the right tool name + params - Default ``ADCPHandler.update_rights`` returns ``NotImplementedResponse`` ## Validation - 1504 tests passing (includes the 4 new round-trip tests + 1 new regression test) - mypy clean across 659 source files - ruff clean on changed files ## Out of scope - Release cut to PyPI (4.0.0b2) — separate concern tracked elsewhere. - PgBackend implementation for ``IdempotencyStore`` — deferred per the post-#196 plan. BREAKING CHANGE: ``Budget.authority_level`` is removed. Migrate to ``reallocation_threshold`` / ``reallocation_unlimited`` on ``plan.budget``, and set ``plan.human_review_required`` for decisions affecting data subjects. See the rc.4 migration section in README.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c8de568 to
6c0e0e9
Compare
8 tasks
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.
Closes #185.
Schema sync
Resynced against `adcp-latest`: 564 files updated, 1 removed (`enums/budget-authority-level.json`). The rc.4 spec drops `Budget.authority_level` (enum: agent_full/agent_limited/human_required) in favor of two orthogonal fields on `plan.budget`:
Plus new `plan.human_review_required` — governs decisions affecting data subjects (targeting, creative, delivery) under GDPR Art 22 / EU AI Act Annex III. Distinct from budget reallocation autonomy.
No hand-written SDK code referenced `authority_level` / `BudgetAuthorityLevel`, so codegen picks up the new shape cleanly.
New task: update_rights
The rc.4 index added `update_rights` (partner to `acquire_rights`). Lets buyers modify an existing rights acquisition — typically extend `end_date`, raise `impression_cap`, pause/unpause, or swap to a compatible `pricing_option_id`. Wired at all 6 spec-coverage sites:
All 7 `tests/test_spec_coverage.py` assertions now pass — they were red on main post-sync.
Validation
Out of scope (explicit)
Test plan
🤖 Generated with Claude Code