Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions MIGRATION_v9_to_v10.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ existed in the 10.0 prereleases, the entries listed under 10.0.0-beta.0 that

| Change | Update your integration |
| --- | --- |
| The wire pin is AdCP `3.3.0` | `get_adcp_version()` returns `3.3.0`; the SDK speaks `adcp_version: "3.3"` by default and advertises `3.0`, `3.1`, `3.2`, `3.3` and the `3.2-rc.7` alias. `10.0.0-beta.0` and `10.0.0-beta.1` pinned `3.3.0-beta.0`, `10.0.0-beta.2` pinned `3.3.0-beta.1`, `10.0.0-beta.3` pinned `3.3.0-beta.2`, `10.0.0-beta.4` through `10.0.0-beta.11` pinned `3.3.0-beta.3`, `10.0.0-beta.12` pinned `3.3.0-beta.4`, `10.0.0-beta.13` through `10.0.0-beta.16` pinned `3.3.0-beta.5`, `10.0.0-beta.17` through `10.0.0-beta.19` pinned `3.3.0-beta.6`, `10.0.0-beta.20` through `10.0.0-beta.22` pinned `3.3.0-rc.0`, and `10.0.0-beta.23` through `10.0.0-rc.9` pinned `3.3.0-rc.3`; none of those prereleases is advertised or accepted as an `adcp_version` pin any more (`ConfigurationError`), and a `3.3-beta.0`, `3.3-beta.1`, `3.3-beta.2`, `3.3-beta.3`, `3.3-beta.4`, `3.3-beta.5`, `3.3-beta.6`, `3.3-rc.0` or `3.3-rc.3` peer is negotiated like any other unserved prerelease (down to `3.2`). There is no `3.3-rc.3` alias: 3.3.0 bounds fields rc.3 left unbounded, so an rc.3 payload is not always a valid 3.3.0 payload. Re-pin to `3.3`, or omit the pin. Pin `adcp_version="3.2"` on a server whose handlers must keep running on the 3.2 contract (see "A server pin governs its handlers" below). On a client, `adcp_version` is a negotiation ceiling; its application models remain current. Generated types, bundled schemas and the versioned validators follow the 3.3 bundle. |
| The wire pin is AdCP `3.3.0` | `get_adcp_version()` returns `3.3.0`; the SDK speaks `adcp_version: "3.3"` by default and advertises `3.0`, `3.1`, `3.2`, `3.3` and the `3.2-rc.7` and `3.3-rc.3` aliases (`3.3-rc.3` was added after 10.0.0). `10.0.0-beta.0` and `10.0.0-beta.1` pinned `3.3.0-beta.0`, `10.0.0-beta.2` pinned `3.3.0-beta.1`, `10.0.0-beta.3` pinned `3.3.0-beta.2`, `10.0.0-beta.4` through `10.0.0-beta.11` pinned `3.3.0-beta.3`, `10.0.0-beta.12` pinned `3.3.0-beta.4`, `10.0.0-beta.13` through `10.0.0-beta.16` pinned `3.3.0-beta.5`, `10.0.0-beta.17` through `10.0.0-beta.19` pinned `3.3.0-beta.6`, `10.0.0-beta.20` through `10.0.0-beta.22` pinned `3.3.0-rc.0`, and `10.0.0-beta.23` through `10.0.0-rc.9` pinned `3.3.0-rc.3`. Except `3.3-rc.3`, none of those prereleases is advertised or accepted as an `adcp_version` pin any more (`ConfigurationError`), and a `3.3-beta.0`, `3.3-beta.1`, `3.3-beta.2`, `3.3-beta.3`, `3.3-beta.4`, `3.3-beta.5`, `3.3-beta.6` or `3.3-rc.0` peer is negotiated like any other unserved prerelease (down to `3.2`). `3.3-rc.3` is a deprecated compatibility alias of `3.3`, like `3.2-rc.7` of `3.2`, removed in 11.0 (adcontextprotocol/adcp#9223): the rc.3 to 3.3.0 schema delta only adds `maxItems`/`maxLength` bounds, so an rc.3 claim is served and validated as 3.3, and an rc.3 payload over a new bound fails validation. 10.0.0 refused it. A seller without `supported_versions` now accepts and advertises `3.3-rc.3` by default; to refuse it, pass an explicit `supported_versions` that omits it. A seller still running a request rewrite for it can drop that, or serve other wire versions with `serve(version_aliases=...)`. On a client, a seller that advertises `3.3-rc.3` is negotiated as `3.3-rc.3` and spoken to as 3.3, and its responses are validated against the 3.3.0 schemas, including the new bounds (strict by default, warn under `ADCP_ENV=production`). Re-pin to `3.3`, or omit the pin. Pin `adcp_version="3.2"` on a server whose handlers must keep running on the 3.2 contract (see "A server pin governs its handlers" below). On a client, `adcp_version` is a negotiation ceiling; its application models remain current. Generated types, bundled schemas and the versioned validators follow the 3.3 bundle. |
| AdCP 3.3.0-beta.1 adds account requests, media-buy issues and reporting subscriptions | New tasks are wired through `ADCPClient` / `ADCPMultiAgentClient`, `ADCPHandler` (each returns `not_supported()` until overridden), the MCP and A2A adapters, the MCP tool list and the CLI: `request_account` (experimental `account.requests`; it opens, matches or, with `account_id`, changes an account, guarded by `revision`), `report_media_buy_issue` and `get_media_buy_issue`. `RequestAccountRequest` / `Response`, `ReportMediaBuyIssueRequest` / `Response` and `GetMediaBuyIssueRequest` / `Response` are exported from `adcp.types`. `list_accounts` gains `include_requests`, `request_ids` and `requests_pagination`, returning `account_requests[]` and `account_requests_pagination`. Experimental principal-level `reporting_subscriptions` land on `sync_principal` / `get_principal`, with `subscription_coverage[]` on `get_reporting_status`, `configuration_tasks[]` on `media_buy.reporting_delivery`, the `ReportingDimension` enum and the `principal.changed` reason `reporting_subscription_changed`. `sync_accounts` is unchanged and stays supported. Generated class names that the generator numbers can renumber with the bundle; import the semantic names from `adcp.types` rather than a numbered class from a domain module. |
| AdCP 3.3.0-beta.2 withdraws definition pins, purchase rights and installment selection | adcontextprotocol/adcp#8537 moves all three to 4.0, so their generated types leave `adcp.types.domains.*`, `adcp.types._generated` and `adcp.types.error_details`: `DefinitionPin*`, `DefinitionPinReferenceKind`, `ReferenceDefinitionChangedDetails` (and `ErrorCode.REFERENCE_DEFINITION_CHANGED`), `DriftedPin`, `RightsScope`, `InstallmentChangeSet`, `commercial_terms.definition_pins`, `purchases[].rights` / `installments`, `installment_changes` and the `definition_changed` refinement reason. `TestControllerStore.definition_pin_probe` and the `definition_pin_probe` controller scenario are removed. Delete code that builds or reads them; a seller stops listing `media_buy.purchase_rights` and `media_buy.installment_selection` in `experimental_features`. |
| AdCP 3.3.0-beta.2 adds separate-account outcomes, seller offers and measurement provenance | `RequestAccountRequest.allow_separate_account` (default `false`) lets a change request resolve as `created` (a new account carrying the change) or `matched` (an account the caller already holds), and the new correctable error code `ACCOUNT_CHANGE_REQUIRES_NEW_ACCOUNT` reports a change the seller would take only on a new account. Experimental seller offers add `proposal_initiator`, `offer_reason` on `list_proposals` rows and the `proposal.offered` notification (`ProposalOfferedWebhook`); experimental measurement provenance adds `CollectionMechanism`, `counting_mechanisms` and `vendor_metric_provenance[]` (`VendorMetricProvenance`). The reporting-subscription fields settled after beta.1 (`standard_dimensions`, `unmapped_dimensions`, `inactive_intervals`, `prior_versions[].configuration`, per-offering `offering_id`, `previous_timezone`) are now generated. `principal_kind` and `expected_principal_kind` are deprecated. `NotificationConfig.product_payload_view` loses its schema default: it is `None` when unset, and a product subscription's dump no longer adds `product_payload_view: "legacy"` (absent means legacy); read `config.product_payload_view or "legacy"`. These are generated types, imported from their domain packages (for example `adcp.types.domains.core.ProposalOfferedWebhook`); no task was added. |
Expand Down Expand Up @@ -142,8 +142,9 @@ These APIs did not exist in 9.6.x, so they affect only code written against a
- **Experimental agent identity and Web Bot Auth**: the experimental API was
reshaped to the final AdCP 3.3 profile during the prereleases; see
[the identity migration notes](docs/agent-identity-3-3-migration.md#breaking-changes-to-the-experimental-api).
- **Prerelease wire pins**: every `3.3-beta.N`, `3.3-rc.0` and `3.3-rc.3` pin
is refused; see the first row of the table.
- **Prerelease wire pins**: every `3.3-beta.N` and `3.3-rc.0` pin is refused;
`3.3-rc.3` is served as a deprecated alias of `3.3` until 11.0. See the
first row of the table.

## Listed under 10.0.0-beta.0, already in 9.x

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,11 @@ Guides: [seller](docs/reporting-subscriptions-seller.md) · [buyer](docs/reporti
SDK 10 is built against **AdCP 3.3.0**, the AdCP 3.3 general-availability
release, and keeps canonical creatives the primary Python contract. It
negotiates AdCP 3.0, 3.1, 3.2 and 3.3. On the wire, 3.3 is `"3.3"`, because
`adcp_version` carries release precision only. The 3.3 release candidates
(`"3.3-rc.3"` and earlier) are not accepted pins; a peer that advertises only
one of them negotiates down to `"3.2"`. AdCP 3.2.0 was withdrawn and is not a
`adcp_version` carries release precision only. `"3.3-rc.3"`, the last 3.3 release
candidate, is a deprecated alias of `"3.3"` (removed in 11.0), like
`"3.2-rc.7"` of `"3.2"`: it is accepted, advertised by default, and served as
3.3. Earlier release candidates are not accepted pins; a peer that advertises
only one of them negotiates down to `"3.2"`. AdCP 3.2.0 was withdrawn and is not a
supported target. The SDK package version and protocol version are
intentionally independent:

Expand Down
2 changes: 1 addition & 1 deletion docs/adcp-3.3-sdk-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ adcontextprotocol/adcp#8913 (PR #8951), #8625 (PR #8876), #8512, #8956,

| Item | Detail | SDK status |
| --- | --- | --- |
| Wire pin | `3.3.0` / `3.3`; bundle key `3.3`. `3.3-rc.3` is no longer advertised or accepted as a pin and gets no alias, because 3.3.0 bounds fields rc.3 left unbounded. Its cache and compliance trees stay in the source tree and leave the wheel. | done |
| Wire pin | `3.3.0` / `3.3`; bundle key `3.3`. `3.3-rc.3` is served as a deprecated alias of `3.3` until 11.0 (adcontextprotocol/adcp#9223): the rc.3 to 3.3.0 delta only adds bounds, so an rc.3 payload over one fails validation. Its cache and compliance trees stay in the source tree and leave the wheel. | done |
| Bounds on new and experimental fields (#8512) | 657 `maxItems` / `maxLength` keywords on 158 schemas, only on fields absent from 3.2.12 or experimental; `get_adcp_capabilities` and stable fields are untouched. This includes the TMP `targeting_kvs` `key` and `value` (255 characters). | generated: the models enforce the bounds, and constrained string items are `ScalarStr` subclasses (still `str`). No carve-out: the SDK ships no TMP router, so the `targeting_kvs` bounds only reach the generated `TargetingKv` model. `core.reporting_subscription.AccountId7` is folded into `AccountId` |
| Operator is a registrable domain (#8913) | `operator` in `account-ref`, `canonical-account-ref`, `sync_accounts`, `request_account`, brand.json `authorized_operator.domain`, `operator-identity` and the SI `paying_principal` is the eTLD+1 of the operating organization; a seller MAY refuse a subdomain. The patterns are unchanged. | descriptions regenerated; the SDK does not refuse a subdomain operator |
| Repeated `format_kind` needs `format_option_ref` (#8625) | A seller MUST reject a manifest without `format_option_ref` when two or more `format_options` share its `format_kind`, and MUST NOT infer the option. The `canonical_formats` storyboard (1.2.0) checks it for sellers with `inline_creative_management`. | `find_declaration_by_kind` raises `FormatOptionRefRequiredError` (`VALIDATION_ERROR` on `format_option_ref`) instead of returning the first match. The legacy `format_id` projection already sets `format_option_ref` |
Expand Down
57 changes: 57 additions & 0 deletions docs/handler-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,63 @@ Independent servers can select different subsets without mutating their shared
handler. A custom external A2A `request_handler` owns dispatch, so its factory
rejects an explicit SDK selection rather than advertising unenforced versions.

### Serve extra wire versions

`version_aliases` serves another wire version as one of the server's releases,
for buyers built against a prerelease whose contract the release still
accepts:

```python
serve(MySeller(), version_aliases={"3.3-rc.2": "3.3"})
```

`serve`, `ServeConfig`, `create_mcp_server`, `create_a2a_server`,
`adcp.decisioning.serve`, `MCPToolSet`, `create_tool_caller` and the testing
helpers accept it. A request claiming an alias is accepted on every tool and
transport, task polling (`get_task_status`, `list_tasks`) and
`comply_test_controller` included. It is validated, converted and handled as
its target: `ToolContext.resolved_adcp_version` is the target, never the alias.
`get_adcp_capabilities` advertises each alias in `adcp.supported_versions`
while it advertises the target (after the `response_enhancer` runs, so an
enhancer cannot drop it), `VERSION_UNSUPPORTED` lists it in
`details.supported_versions`, and responses echo it where the target's response
schema admits `adcp_version` (see "Response `adcp_version`" in
`docs/validation-contract.md`).

Each key must be a release-precision prerelease of its target's own release
line that the SDK does not serve natively: `3.3-rc.2` for `3.3` is accepted,
while a stable key (`3.4` for `3.3`) or another line's prerelease
(`3.3-beta.1` for `3.2`) is refused, since it would advertise a release the
server does not serve and break the spec's downshift rule. Targets must be
native releases the server serves (in `supported_versions`, when given). Configuration errors raise
`ConfigurationError` at construction. With `supported_versions`, the aliases
follow the selection: `supported_versions=["3.3"], version_aliases={"3.3-rc.2":
"3.3"}` serves `["3.3", "3.3-rc.2"]`.

The built-in aliases need no entry: `3.2-rc.7` (served as `3.2`) and
`3.3-rc.3` (served as `3.3`; the rc.3 to 3.3.0 schema delta only adds
`maxItems`/`maxLength` bounds, adcontextprotocol/adcp#9223). The `3.3-rc.3`
alias is deprecated and is removed in SDK 11.0; a seller that still needs it
then passes `version_aliases={"3.3-rc.3": "3.3"}`. An explicit
`supported_versions` list must name a built-in alias (or restate it in
`version_aliases`) to serve it.

### Pre-validation hooks and middleware

`pre_validation_hooks` maps a tool name to a hook or an ordered list of hooks.
The `"*"` key (`adcp.server.GLOBAL_PRE_VALIDATION_HOOK_KEY`) runs for every
tool, before that tool's own hooks, so a cross-cutting hook covers tools added
later. `"*"` hooks never apply to `comply_test_controller`, and the SDK's
managed controller (`test_controller=`) runs no pre-validation hooks at all.

`SkillMiddleware` runs before hooks: the middleware chain wraps the tool
caller, so each middleware receives the caller's raw request. Each hook
receives a shallow copy of the args, so a hook that sets top-level keys or
returns a new dict never changes what middleware holds, before or after
`call_next()`. Middleware can therefore pair the original request with the
response. Nested values are shared; a hook must copy one before mutating it in
place.

### HTTP Host and Origin policy

`serve`, `ServeConfig`, `create_mcp_server`, `create_a2a_server` and
Expand Down
39 changes: 37 additions & 2 deletions docs/validation-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,17 @@ with the issue that tracks it, and the list only shrinks:
- Validation selects the schema bundle matching the negotiated wire version,
so strict current-version behavior does not tighten legacy 2.5, 3.0, or 3.1
traffic against the 3.2 schema.
- `"3.2-rc.7"` is an explicit wire compatibility alias for `"3.2"`, validated
against the stable bundle. Direct schema-loader calls using full historical
- `"3.2-rc.7"` and `"3.3-rc.3"` are explicit wire compatibility aliases for
`"3.2"` and `"3.3"`, validated against the stable bundle (`"3.3-rc.3"` is
deprecated and removed in SDK 11.0). Both are on by default: a server
without `supported_versions` accepts and advertises `3.3-rc.3`; pass an
explicit `supported_versions` (for example `["3.0", "3.1", "3.2", "3.3"]`)
to refuse it. A client that negotiates with a seller advertising
`3.3-rc.3` speaks 3.3 to it under that alias and validates its responses
against the 3.3.0 schemas, including bounds rc.3 lacked (strict by default,
warn under `ADCP_ENV=production`). A server adds its own aliases with
`serve(version_aliases=...)`; see "Serve extra wire versions" in
`docs/handler-authoring.md`. Direct schema-loader calls using full historical
identifiers such as `"3.2.0-rc.7"` retain exact bundle lookup.
- Missing validators for an explicit native-tool version produce
`VERSION_UNSUPPORTED`, with `field="adcp_version"` and `supported_versions`
Expand All @@ -153,6 +162,32 @@ with the issue that tracks it, and the list only shrinks:
- Pre-validation hooks can raise `AdcpError` or `ADCPTaskError` to deliberately
reject a request. The dispatcher preserves their structured fields; other
hook exceptions produce `INVALID_REQUEST` with the failing hook's name.
- The dispatcher's own `VERSION_UNSUPPORTED` lists the server's effective served
versions in `details.supported_versions`: its `supported_versions` selection
(or every version the SDK serves), followed by its `version_aliases`.

### Response `adcp_version`

The server adds `adcp_version` to a response in two cases, and only where the
schema of the release it served admits a top-level `adcp_version` for that
response variant:

1. **Version conversion.** When the caller's release differs from the release
the handler runs on, the converted response carries the served release.
2. **Alias echo.** When the caller claimed an alias (built-in, or from
`version_aliases`), the response carries the caller's alias, so clients
built against that prerelease can select their response validator. The
claim is read from the caller's raw request, before pre-validation hooks;
when the caller sent none, a version a hook supplied counts as the claim.

Otherwise the SDK adds nothing (a handler or `response_enhancer` may set the
field itself). A schema that is closed (`additionalProperties: false`) without
declaring `adcp_version` never gets it: the compact AdCP 3.2 roots of
`list_products`, `buy_products`, `control_media_buy`, `accept_proposal` and
`decline_proposals` are answered without it, even to a `3.2-rc.7` caller. The
check is conservative: any composed object schema that forbids the field
suppresses the echo. Whether every response should carry the served version is
an open spec question (adcontextprotocol/adcp#9370).

### Payload size

Expand Down
Loading