Repository navigation
fix(reporting): serve 1.2 report definitions to AdCP 3.3 callers only - #3802
Conversation
Callers pinned below AdCP 3.3 accept only 1.0 and 1.1 report definitions, so a seller must serve them only offerings whose definition is 1.0 or 1.1 (core/reporting-report-definition.json package_dimension, adcontextprotocol/adcp#8983). The SDK could not tell a 1.2 offering apart and advertised and accepted it for every caller. createReliableReportingService takes reportDefinitionVersions, keyed by report_definition_sha256, and undeclaredReportDefinitions (assume_pre_1_2 by default, with a construction warning, or withhold_from_pre_3_3), and publishes the 3.3-only offerings as platform.reporting.adcp33OnlyOfferingIds. createAdcpServerFromPlatform drops them from get_adcp_capabilities for pre-3.3 callers, refuses those callers' sync_accounts reporting_delivery_configs naming them per account entry with UNSUPPORTED_FEATURE, and refuses to start a server pinned below 3.3 that has one. installConfiguration takes an optional servedAdcpVersion for handlers outside accounts.upsert. The production service in @adcp/reporting-storage forwards the platform field. Same behavior as the Python SDK (adcp-client-python#1906). Closes #3709 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…es tools Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Treat an unparseable served release as older, as the Python SDK and the existing reporting gates do, so a garbage pin fails safe. Publish the 3.3-only offerings with their reason (platform.reporting.adcp33OnlyOfferings, '1.2' or 'undeclared') so the refusal says the contract_version is undeclared for an undeclared offering under withhold_from_pre_3_3, with the same message as Python. Match reportDefinitionVersions keys case-insensitively and refuse a key declared twice with different versions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-only offering Refusing just the offending account entry was unsafe. Dropping it from the roster made a delete_missing sync delete that account, and an entry keyed only by account_id has no failed row a 3.2 caller accepts, so it already fell back to an operation error. A pre-3.3 caller whose reporting_delivery_configs name a 3.3-only offering now fails the request before accounts.upsert runs, with the first offending config in details, as the Python SDK's production path does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ned contract Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — additive AdCP 3.3 report-definition-1.2 gating for Reliable Reporting.
Checked:
- Pathway-back (DR-0033): verified for every pre-3.3 caller — droppable via the get_adcp_capabilities offering filter (create-adcp-server.ts:10229-10240), refused in sync_accounts (fails whole-request before upsert, from-platform.ts:9523-9540), installConfiguration gate, and boot refusal.
acceptsReportDefinition12fails closed on unparseable/older releases. - Witness-not-translator: no fabrication or silent re-shaping; drops/refusals are reported end-to-end.
- Changesets: two patch changesets present, appropriate for a purely additive surface.
- Tests: 612-line suite covers all four source paths including delete_missing non-shortening (test:1108).
No critical, high, or medium findings. One minor, non-blocking observation noted by the reviewer: the || reporting.offerings?.length === 0 clause at create-adcp-server.ts:10241 also drops reporting_delivery for a pre-3.3 caller in the unlikely empty-offerings-with-configuration_task case. This is a low-severity edge case, not blocking.
Decision table: no findings at critical/high (row 1 no), gated_paths false (row 2 no), high_risk false (rows 3/5 no), no medium findings (rows 4/8 no), no prior escalation (row 6 no), no team gate (row 7 no) → row 9 approve. Note: gated_paths is false, so the REVIEW_REQUIRED status does not force a gate.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean delta, no blocking findings.
This is a subsequent push following a prior approve (head a120a26). The reviewer reports a clean pass with no critical/high/medium findings.
What was checked:
- Reshapes the unreleased
adcp33OnlyOfferingIds(string array) intoadcp33OnlyOfferings(offering-id → reason map), with case-insensitive SHA matching and same-key/different-version conflict detection (service/index.ts:160,170-174). - Flips
acceptsReportDefinition12to fail-closed on an unparseable version (reporting-definition-release.ts:474) — correct conservative default. - Converts the sync_accounts gate from per-entry drop to whole-request refusal before accounts.upsert (from-platform.ts:9523-9543) — refuse-not-drop, aligned with the witness rule; dropping an entry would have shortened a delete_missing roster. Exercised by the delete_missing and account_id-keyed tests.
- Throw placement follows in-file precedent; null-config access short-circuited by optional chaining.
- Changesets present for both @adcp/sdk and @adcp/reporting-storage; repo in beta pre-mode.
Gate checks: no no-auto-approve team match; gated_paths false; high_risk false. review_decision is REVIEW_REQUIRED but gated_paths is false, so row 2 does not fire. No findings trigger rows 1–8; falls through to row 9 → approve.
…fusal details The 1.2 offering refusal echoed the buyer's delivery_config_id into error details, which reach the caller's model context. Details now carry only offering_id, the seller's own id (matched exactly before the refusal is raised). Code, field, recovery and message are unchanged. This matches adcp-client-python#1959 (head 422dc3b6c). Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Delta pass over 6 files since the prior approve (head 34a955a). The only substantive change: reportingOfferingRequiresAdcp33Error now drops the buyer-supplied delivery_config_id from the UNSUPPORTED_FEATURE error details, keeping only the seller's own offering_id. Helper signature, both call sites (service/index.ts:1417, from-platform.ts:9531), docs, changeset, and tests all move in lockstep; the test adds a positive assertion that the buyer id never appears in the serialized error. This is a clean fail-closed tightening consistent with CTX-METADATA-SAFETY (no request text echoed back) — not fabrication or wire re-shaping.
No critical/high/medium findings in this run. No author team gate, gated_paths is false, high_risk is false. No escalation triggers fire. Rows 1-8 do not match → row 9 approve.
Closes #3709.
Problem
AdCP 3.3 adds report-definition
contract_version1.2 (adcontextprotocol/adcp#8983). The spec restricts which callers get it, incore/reporting-report-definition.jsonx-adcp-validation.package_dimension:An offering pins its definition only by
report_definition_uriandreport_definition_sha256, so SDK-hosted sellers could not tell a 1.2 offering apart. They behaved as follows for callers pinned to 3.2:get_adcp_capabilities, on any server whosemedia_buyprotocol is available at 3.2 (any seller with sales tools).sync_accountsreporting_delivery_configsthat named it.Change
Declaring versions (
@adcp/sdk).createReliableReportingServicetakes two new options:reportDefinitionVersions: hexreport_definition_sha256(matched case-insensitively) →'1.0' | '1.1' | '1.2'. It is keyed by the content address, so a declaration cannot drift from the definition the offering pins. A bad key or value, or one SHA declared twice with different versions, is a constructionTypeError.undeclaredReportDefinitions:'assume_pre_1_2'(the default) or'withhold_from_pre_3_3'.The 3.3-only offerings are published as
platform.reporting.adcp33OnlyOfferings, mapping offering id to'1.2'or'undeclared'.createAdcpServerFromPlatformthen:get_adcp_capabilitiesmedia_buy.reporting_delivery.offerings. When none is left,reporting_deliveryand themedia_buy.reporting_deliveryfeature id are dropped. This uses the newcapabilities.reportingAdcp33OnlyOfferingIds, whichcreateAdcpServeralso accepts directly.sync_accountsreporting_delivery_configsaccounts.upsertruns. The error isUNSUPPORTED_FEATUREwithrecovery: "correctable",field: "reporting_delivery_configs"anddetails: { offering_id }for the first offending config.offering_idis the seller's own id. The buyer'sdelivery_config_idis request text and is not echoed, because error details reach the caller's model context. No entry is applied. Per-entry refusal would shorten adelete_missingroster (deleting the account), and an entry keyed byaccount_idhas no failed row a 3.2 caller accepts.PlatformConfigErrorwhen any 1.2 offering (or undeclared offering underwithhold_from_pre_3_3) is installed, because it could be served to no one.installConfigurationservedAdcpVersion(passctx.servedAdcpVersion), so async_accountshandler supplied outsideaccounts.upsertgets the same refusal."Pinned below 3.3" compares
MAJOR.MINOR, so every 3.3 prerelease counts as 3.3. A request with no served release counts as the SDK's pinned release, and one the SDK can't parse counts as older, which fails safe.The refusal message names the reason:
…its report definition is at contract_version 1.2…;…its report definition's contract_version is undeclared….Production service (
@adcp/reporting-storage).createPostgresReliableReportingProductionServiceinherits the two options and forwardsadcp33OnlyOfferingson itsplatform, the object a seller mounts asplatform.reporting.Intentionally unchanged:
get_reporting_statusand the account readback ofreporting_delivery_configs. The spec rule covers serving offerings, not reporting the state of a configuration the buyer already holds. Hiding a buyer's own obligations would tell it nothing is owed. On a 3.3 server,get_reporting_statusis also bound to the server's exact pin, so pre-3.3 callers cannot call it.get_productsreporting_capabilities.reporting_delivery_offering_ids. Products are the seller's own catalog, so the option doc anddocs/guides/REPORTING-LEDGER.mdtell sellers to filter 1.2 ids for pre-3.3 callers themselves.Parity with the Python SDK
This matches adcp-client-python#1959 (for #1906), agreed point by point with its implementer:
MAJOR.MINORcomparison, with an unparseable version counted as older;details(offering_idonly, as of Python head 422dc3b6c);sync_accountspath, and per call oninstallConfiguration(Python's coreconfigure);One difference: Python also derives a version from definition bytes it already holds and verifies against the SHA-256 (its production verifier registry), and treats a conflicting declaration as a boot error. The TS SDK holds definition bytes only at delivery time (the GCS contract reader), never at boot, so TS is declaration-only.
Tests
test/lib/reporting-definition-version-gate.test.js(37 tests):adcp33OnlyOfferings(with reasons) under both modes;installConfigurationrefusal matrix (3.2, 3.2.10 and unparseable refused; 3.3, 3.3.0-rc.3, 3.3.0-beta.1 and absent allowed; a 1.1 offering allowed at 3.2) and both exact messages;get_adcp_capabilitiesper caller pin on a seller with a 3.2-available sales tool: 1.1 only for 3.2, both for 3.3 and unpinned, the block and feature id dropped when only 1.2 remains, nothing dropped for a 1.1-only service;sync_accountsoperation-level refusal: the first offending config'soffering_idindetailsand itsdelivery_config_idnowhere in the error,upsertnever called, adelete_missingregression that keeps the refused account, anaccount_id-keyed settings-update regression, and pass-through for a 3.3 caller.The existing
test/lib/reliable-reporting-service.test.jsstill passes (112/112).🤖 Generated with Claude Code