Repository navigation
feat(media-buy): declare delivery modes and grade guaranteed-only sellers on a matching baseline - #7973
Draft
bokelley wants to merge 8 commits into
Draft
feat(media-buy): declare delivery modes and grade guaranteed-only sellers on a matching baseline#7973bokelley wants to merge 8 commits into
bokelley wants to merge 8 commits into
Conversation
…s (adcp#7852 experiment) Test-only, env-driven (TRAINING_SALES_DELIVERY_MODES / TRAINING_SALES_SEED_POLICY). Default is unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…lers on a matching baseline Adds media_buy.supported_delivery_types (default both), gates the non-guaranteed baseline and inherited scenarios on it, adds the media_buy_seller_guaranteed sibling baseline, aligns the seam and drifted comments on UNSUPPORTED_FEATURE, and adds lint, gate and end-to-end tests. Refs #7852. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…in the guaranteed baseline Tags every gate TEMPORARY(adcp#7852), adds a no-media_buy-block gate test and a schema-default lint, moves comply_test_controller to step-level requires_tool, adds discovery checks for the declared mode, and documents the reduced-coverage profile and fail-closed precondition. Refs #7852. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…-requires lint and gate new scenarios Adds requires: [controller] to the guaranteed baseline, gates the two new property delivery scenarios, and distinguishes supported_delivery_types from buying_modes in the docs. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…conformance Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Oct 16, 2026
Contributor
Author
|
Status: HELD for 3.4. Per WG Session B (2026-10-19) and the release coordination decision, this PR does not ship in 3.3. It stays open as a draft and is the 3.4 candidate: the optional |
This branch has not been deployed
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.
Draft for WG review. Refs #7852. Not a patch-eligible change (see Backport note).
Status: HOLDS to 3.4. This draft stays open as the 3.4 candidate; it is not for 3.3. No guaranteed-only adopter has reported a failing run. 3.3 gets the docs note only (already in the compliance catalog). The WG should still weigh the open questions below before 3.4.
Risk if shipped (blocking): the gates fail closed for any seller whose capabilities response has no
media_buyobject, or whose grader loads a schema root without the new field's default. See "Fail-closed hazard" below and open question 3.Problem
A seller that sells only guaranteed inventory cannot get a complete grade on the
media_buy_sellerbaseline. The baseline's follow-on checks need amedia_buy_idissued in the create response, and a guaranteed buy returns asubmittedtask whosemedia_buy_idarrives only on completion. Evidence from the training seller made faithfully guaranteed-only (get_products lists only guaranteed products, every guaranteed create returnssubmitted, non-guaranteed buys are rejected, seeded non-guaranteed fixtures stay unsellable): 16 of 56 base storyboards fail, 23 failed steps. The adopter run in #7852 passed 51/51 core scenarios because that seller sells whatever the runner seeds: with the seam'ssellseed policy (seeded fixtures sold as seeded) the same training seller clears three of the ten failing scenarios sampled (delivery_reporting,dependency_impairment_audience,external_audience_source_binding) and still fails five that need an immediatemedia_buy_id. So 51/51 is consistent with a seller that sells the seeded fixtures (and likely completes buys synchronously), not with a faithful guaranteed-only seller. This is inferred, not confirmed with the adopter.create_buy(thencheck_buy_status,delivery_monitoringskip, 8 steps),dependency_impairment_audience,external_audience_source_binding,total_budget_redistributionsubmitted, nomedia_buy_id, dependents cascadedelivery_reporting,dependency_impairment,dependency_impairment_cardinality,creative_fate_after_cancellation,inline_creatives_without_sync,invalid_transitionsacceptance_policy_discovery,advanced_delivery_reporting,collection_selection,product_filter_behavior,targeting_aware_discovery,owner_sold_channel_carriageNone of the failing steps carries a delivery-mode
requires_capabilitygate; the workflows are ungated hard-coded fixtures and$context.media_buy_iddependencies.What this adds
media_buy.supported_delivery_types(optional; items$refenums/delivery-type.json,minItems: 1,uniqueItems, schema default["guaranteed","non_guaranteed"]). Absent means both, so existing sellers are unchanged. A seller that declares a subset MUST NOT list products of the other mode and MUST reject a create for one withUNSUPPORTED_FEATURE.media_buy_sellerand 37 inherited scenarios (every one that creates buys without a guaranteed fixture, plusacceptance_policy_discoveryandproduct_filter_behavior, which failed on discovery) carry aTEMPORARY(adcp#7852)-taggedrequires_capability: { path: media_buy.supported_delivery_types, contains: non_guaranteed }, or an added entry inrequires_all_capabilitieswhere the scenario already had a gate. Scenario bodies and fixtures are untouched. The base is gated at storyboard level because phase-level gates take one predicate and the base phases already carry theaccount.timezonegate. The base is minor-bumped to 1.1.0; each gated scenario has its version incremented.media_buy_seller_guaranteed(new sibling file inprotocols/media-buy/, 11 steps), gatednot_contains: non_guaranteed, so only a seller that declares a set withoutnon_guaranteedruns it. It reuses the provensales_guaranteedsteps: guaranteed discovery,force_create_media_buy_arm, asubmittedcreate,force_task_completion,get_task_statuspolling (no webhook),get_media_buysreadback of the issued ID, delivery reporting. It also asserts the listing half of the declaration: an unfilteredget_productsleads with a guaranteed product, and adelivery_type: non_guaranteedfilter returns an empty list. Rejecting a create on an undeclared mode is attestation-only: asserting it needs a non-guaranteed product, and a seller that sells none cannot be required to seed one.comply_test_controlleris not inrequired_tools(that would grade the whole storyboardmissing_tool); the forced steps keep a step-levelrequires_toolas a backstop. The storyboard declaresrequires: [controller](the new controller-requires lint onmaindemands it forcontroller_seedingstoryboards), so a seller with no test controller gets a single storyboard-levelmissing_test_controllerskip; the run does not fail but is not a complete grade (covered by a test).DELIVERY_MODE_NOT_SUPPORTED, which is not inerror-code.json. They now citeUNSUPPORTED_FEATURE(an undeclared capability, correctable viaget_adcp_capabilities), the code the seam and the new capability text use. No new error code is added.get_adcp_capabilities, compliance catalog (the guaranteed-only<Note>now states the rule),DR-XXXX(proposed), changeset (minor).The training agent gains a test-only, default-off seam (
TRAINING_SALES_DELIVERY_MODES,TRAINING_SALES_SEED_POLICY) so the real SDK runner can grade a faithful single-mode seller. With the env unset the tenant is unchanged.Results
Training
salestenant, real SDK runner, current compiled source (ADCP_COMPLIANCE_DIR=dist/compliance/latest), 57 storyboards:media_buy_seller, its 54requires_scenarios,media_buy_seller_guaranteed, andsales_guaranteed.["guaranteed"])not_applicable(42 skipped steps, allcapability_unsupported).media_buy_seller_guaranteedpasses with 0 skipped (the figures here are from the first version; the end-to-end test re-ran the baseline with the two added discovery steps and it passes).sales_guaranteed15/15 pass. Before this change the same seller: 23 failed, 189 passed, 126 skipped on the 56 pre-existing storyboards.media_buy_seller_guaranteedis not selected (onecapability_unsupportedskip).sales_guaranteedclean.["non_guaranteed"])media_buy_seller_guaranteednot selected. The 14 are artifacts of the seam hiding the seeded guaranteed fixtures and the training catalog subset lacking fixed-price and format fields (for exampleaudience_activation_discoveryseeds guaranteed fixtures), not of the gates. Mirror gating for non-guaranteed-only sellers is not part of this slice.The price of gating is coverage: for the guaranteed-only seller the 106 passing steps in inherited scenarios (down from 189) are no longer exercised. The sibling baseline restores a guaranteed flow; the rest returns only with Option B.
Fail-closed hazard and gate semantics
media_buyblock. The runner applies the schema default for an absent capability only when the parentmedia_buyobject exists in the response and the schema root carries the field. A seller advertisingsupported_protocols: [media_buy]with nomedia_buyblock gradesnot_applicableon the base, on the 37 gated scenarios, and onmedia_buy_seller_guaranteed: no baseline grades it. Reproduced and pinned by a test (no media_buy block: fail-closed); withmedia_buy: {}and the 3.3 schema root it resolves to both modes. No gate formulation avoids this without an SDK change (presentignores defaults, and one predicate cannot express "undeclared or contains non_guaranteed"). Mitigations: sellers MUST emit amedia_buyblock (stated in the field description, docs and DR); a new test asserts that every value gate whose path has a source-schema default finds the same default in the built schema, so a bundle cannot ship against a schema root that lacks it. The SDK fix (apply defaults when the parent is absent) is tracked separately.requires_capability(fail-open when raw capabilities are missing) torequires_all_capabilities(fail-closed in that case) because a gate takes one predicate. This only differs when the capabilities response is unavailable. Not cheap to avoid.not_applicableis no coverage and is not a pass. A guaranteed-only seller is graded on the 11-step guaranteed baseline, the ungated inherited scenarios andsales_guaranteed; 37 inherited scenarios are N/A.["guaranteed"]to skip the 37 gated scenarios. The guaranteed baseline's listing checks only catch a seller that still lists non-guaranteed products; the create-side MUST is attestation-only. The field description calls this a misdeclaration.delivery-type.json: guaranteed is a reserved delivery commitment (programmatic guaranteed, IO-approved reserved buys); auction, PMP and preferred deals arenon_guaranteedunless the seller commits delivery.If the hold is overridden
Follow-ups a release manager would require before shipping this in 3.3. None is implemented here.
media_buy.supported_delivery_typesx-status: experimentaland add a registry rowmedia_buy.delivery_mode_declaration.media_buyblock" precondition (field description inget-adcp-capabilities-response.json, and the Precondition inget_adcp_capabilities.mdx) in favour of the SDK default fix (apply defaults when the parent object is absent).requires_scenarioslists: six gated scenarios are also required bysales_guaranteed,sales_broadcast_tvand the deprecatedsales_proposal_mode(delivery_reporting,measurement_terms_accepted,pending_creatives_to_start,inventory_list_targeting,inventory_list_no_match,invalid_transitions). For a seller that declares["guaranteed"]and claims one of those specialisms they gradenot_applicable, so that specialism loses required coverage; for an undeclared seller nothing changes. Three of them (delivery_reporting,pending_creatives_to_start,invalid_transitions) are also required bysales_catalog_driven,sales_dooh,sales_exchange,sales_retail_mediaandsales_streaming_tv, and five bysales_non_guaranteed, where a guaranteed-only declaration would be a misdeclaration. Options: exclude those six from the gate list, or add guaranteed-fixture variants to the guaranteed baseline's coverage.Alternatives NOT picked
media_buy_seller. The runner selects one baseline per protocol, so a guaranteed-only seller would still be graded on the base. Hence the declaration plus gates.$context.media_buy_idreferences plus 4 inindex.yaml). The complete fix and a guaranteed-only seller then keeps coverage of those scenarios, but it rewrites existing step logic. Deferred to 3.4/4.0.incompleteskip reason for a missing approval controller. That is a runner-output-contract and SDK change. Deferred to 3.4; the existingmissing_test_controllerreason is used.Open questions for the WG
UNSUPPORTED_FEATURE(picked, no new code, matches the precedent in feat(media-buy): gate seller-optimized package controls behind their own capabilities #7752) or a dedicated code, sincePRODUCT_UNAVAILABLE("sold out") is the wrong meaning and nothing delivery-mode specific exists. Recommendation: keepUNSUPPORTED_FEATURE.media_buyblock or without the new schema root. Options: (a) ship only with the SDK fix that applies defaults when the parent is absent; (b) require sellers to emit amedia_buyblock and ship bundle and schema together (what this PR documents and tests); (c) require the field to be declared explicitly, which breaks every existing seller. Recommendation: (a), otherwise (b); this is the main reason to hold.sales_guaranteeddoes, instead of async_accountsphase. Add one? Recommendation: no, account lifecycle is graded by the account scenarios.Out of scope
Adapting scenario bodies and fixtures; a new
incompleteskip reason; polling budgets; a dedicated error code; any change to thesales-guaranteedorsales-non-guaranteedspecialism claims.Backport note
A new schema field plus a new normative requirement (reject undeclared modes) is not patch-eligible under the playbook's "Patch eligibility", so this does not go to 3.1.x or 3.2.x. The only patch-eligible piece is a docs-only grading note, which the compliance catalog already had. The new baseline file is additive conformance-harness content, but it is selected by the new field, so it travels with the schema.
Verification
Run from the repo root with
ADCP_COMPLIANCE_DIR=$PWD/dist/compliance/latestand a snapshot ofdist/schemas/latestasADCP_SCHEMA_ROOT, the same asscripts/run-storyboards-matrix.sh.npm run build:schemas,npm run build:compliance(storyboard lints run inside it),npm run test:compliance-snippets(build:compliance -- --check).test:storyboard-*lints,test:compliance-packaged-refs,test:compliance-source-authority,test:run-storyboards-schema-root,test:storyboard-doc-parity,test:doc-compliance-drift,test:error-codes,test:schemas,test:json-schema,test:example-validation,test:docs-nav,test:contracts,test:mcp-schema-projection,test:test-coverage,typecheck: pass.npm run test:delivery-mode-baseline(schema shape, gate shape, the create-without-guaranteed-fixture lint with its allowlist, TEMPORARY tags, the schema-default lint, a missing-controller test, and gate evaluation by the SDK runner for undeclared, both, non-guaranteed-only, guaranteed-only and no-media_buy-block sellers) andnpm run test:delivery-mode-e2e(vitest, 3 tests, the three-seller table above for a storyboard subset; 100 to 330 s depending on machine load). Both are innpm test.sdk-runner-capability-gates,seller-optimized-package-controls,timezone-resolution-storyboards), and runner-driven ones now declare both modes inraw_capabilities.check-changeset-protocol-scope.cjs origin/mainpasses;changeset status --since=origin/mainreports one minor.media_buyblock, or graded without the schema root, gradesnot_applicable(fail closed: "agent declared no value"); withmedia_buy: {}and the root it is selected. See "Fail-closed hazard" and open question 3.origin/mainthree times; the latest merge brought a controller-requires lint that maderequires: [controller]mandatory for the guaranteed baseline.npm test, the server unit suite, and the CI storyboard matrix floors (the workflow is the authority). The three-seller runs used 4 shards per mode because one process runs out of memory around 50 storyboards.DR-XXXX is a placeholder: the number is assigned at merge.
🤖 Generated with Claude Code
Draft disposition — 2026-10-09
This draft is retained for the stated workstream. Continue on this existing branch; no parallel PR is needed. This disposition does not waive CI, review, migration, or release gates.