Skip to content

feat(media-buy): gate seller-optimized package controls behind their own capabilities - #7752

Merged
bokelley merged 3 commits into
mainfrom
feat/seller-optimized-package-controls
Sep 29, 2026
Merged

bokelley merged 3 commits into
mainfrom
feat/seller-optimized-package-controls

Conversation

@bokelley

@bokelley bokelley commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pre-GA 3.2 exception to the freeze, approved by the maintainer. It adds optional capability fields and narrows the not-yet-stable seller_optimized_budget flag.

Problem. media_buy.features.seller_optimized_budget required sellers to enforce "the aggregate budget and package constraints". That implicitly bundled three package controls, none of which had its own gate:

  • package budget caps
  • min_spend_target
  • package pacing

A shared-budget platform that supports only the core contract could not declare the flag honestly.

Capability split

  • seller_optimized_budget is now the core contract:
    • one hard total_budget
    • seller allocation across packages against budget_allocation.optimization_goals
    • media-buy-level pacing (see below)
    • allocation echo on read surfaces
  • Three new flat sibling booleans, in both core/media-buy-features.json and core/canonical-media-buy-features.json:
    • seller_optimized_package_budgets: package budget caps and proposal max_spend_percentage
    • seller_optimized_min_spend_targets: package min_spend_target and proposal min_spend_target_percentage, including their over-subscription validation
    • seller_optimized_package_pacing: package pacing that differs from media-buy pacing, and proposal allocation pacing
  • Dependency on the parent. get-adcp-capabilities-response.json enforces sub-capability true ⇒ seller_optimized_budget: true with an if/then, mirroring catalog_item_availability_updates ⇒ catalog_management. Buyer required_features filters may request a sub-capability alone.
  • Field descriptions name their gate, mirroring daily_budget_cap. This covers package-request, package-update, product-purchase (buy_products), package-control (control_media_buy), product-allocation, proposal, and the budget_allocation/pacing fields on create_media_buy, update_media_buy, buy_products and control_media_buy.

Error ordering

  1. An undeclared package control in a seller-optimized buy is rejected with UNSUPPORTED_FEATURE before any over-subscription validation or provider mutation. It is never silently dropped or coerced.
  2. Over-subscription INVALID_REQUEST checks run only for declared controls:
    • minimums summing above total_budget need seller_optimized_min_spend_targets
    • a min_spend_target above its own package budget needs both seller_optimized_min_spend_targets and seller_optimized_package_budgets
  3. So a core-only seller that receives an over-subscribed min_spend_target returns UNSUPPORTED_FEATURE.

Core media-buy pacing

On seller-optimized buys, a seller declaring seller_optimized_budget:

  • MUST accept omitted media-buy pacing (defaults to even when total_budget is present) and pacing: "even"
  • MAY reject asap or front_loaded with UNSUPPORTED_FEATURE (error.field: pacing) before any provider mutation
  • MUST NOT silently coerce them to even

This applies to create_media_buy, update_media_buy (including a switch that would keep such pacing), buy_products, and control_media_buy. Fixed-allocation pacing is unchanged. Pacing carried by the seller's own committed proposal is exempt.

Package pacing equal to the media-buy pacing adds no subordinate constraint and is not gated. This leaves a way to switch a fixed-mode buy that has package pacing.

Discoverable pacing modes are deferred to 3.3 in #7760.

Buyer guidance

Omitting budget_allocation still means fixed, which keeps legacy buyers compatible. Buyer agents SHOULD send budget_allocation explicitly ({mode: "fixed"} or seller_optimized). When the principal's instruction does not settle whether the budget is one shared pool across packages or split per package, the buyer agent SHOULD ask the principal rather than guess.

This is in the budget_allocation descriptions in create-media-buy-request.json and core/budget-allocation.json, and in a "Choosing an allocation mode" note in create_media_buy. No buyer-track learning page covers budget allocation, so none was edited.

Docs

Updated get_adcp_capabilities (features table and layering rule), create_media_buy, update_media_buy, get_products, media-products (proposal constraint mapping), and a one-line mention in whats-new-in-3-2.

The migration guide is untouched because #7725 (which edits it heavily) is still open. A line about the sub-capabilities should go there after it lands.

Conformance

  • media_buy_seller/seller_optimized_budget (bumped to v1.1.0):
    • Core create, readback, currency, cost-cap and proposal phases use only omitted or even media-buy pacing and no package controls.
    • Each package control gets a positive phase gated equals: true.
    • Each also gets explicit-false and absent negative phases (equals: false / present: false, following budget_cap_timezone_override_rejected). Exactly one runs per seller.
    • The negative requests are deliberately over-subscribed, so requiring UNSUPPORTED_FEATURE proves the ordering above.
    • The aggregate over-subscription check is gated on seller_optimized_min_spend_targets.
    • asap/front_loaded media-buy pacing is not graded: the runner cannot pass a step on either success or rejection.
  • New media_buy_seller/seller_optimized_proposal_package_pacing: proposal-derived package pacing, gated with requires_all_capabilities on the parent + package pacing + supports_proposals.
  • New media_buy_seller/seller_optimized_min_spend_target_exceeds_package_cap: a minimum above its own cap returns INVALID_REQUEST, gated with requires_all_capabilities on the parent + package budgets + minimum-spend targets.
  • New tests/seller-optimized-package-controls.test.cjs (9 tests), wired into test:schemas. It covers the schema dependency, filter shapes, gating and ordering text, pacing and buyer-guidance text, storyboard structure, and a runStoryboard applicability check.

Training agent

Not declared. The sales tenant persists and echoes budget_allocation and min_spend_target, but lacks:

  • validation
  • UNSUPPORTED_FEATURE gating
  • seller-optimized proposals

Declaring the capability would misrepresent it, so all three scenarios grade not_applicable there. Follow-up: #7753.

Testing

  • npm run build:schemas and npm run build:compliance (compliance symbol links regenerated)
  • Passing:
    • npm run test:schemas (includes the new 9-test file)
    • test:json-schema, test:compliance-snippets, test:doc-compliance-drift, test:schema-utf8
    • tests/composed-schema-validation.test.cjs and tests/sdk-runner-capability-gates.test.cjs
    • all 20 test:storyboard-* and test:compliance-* lint suites
  • json-schema-validation --file and snippet-validation --file pass on every changed MDX, with one exception. The pre-existing Python snippets in get_products.mdx fail locally only because the adcp Python package is not installed in this sandbox.
  • No TypeScript changed, so tsc is not applicable.
  • Two review passes (code and protocol). Their Must and Should findings are addressed except:
    • Deferred: update_media_buy negative phases, absence checks on proposals, and gating text on media-buy-valid-action.
  • CI on the first push: 64 passing, 1 skipped.

Committed and pushed with HUSKY=0: dist/node_modules in this worktree are symlinks into a shared checkout, so the hooks aren't reliable here. The hook-equivalent checks were run manually (changeset scope + changesets status, version sync, PR title).

🤖 Generated with Claude Code

…own capabilities

Narrow media_buy.features.seller_optimized_budget to the core shared-budget
contract (shared total_budget, seller allocation, media-buy pacing,
allocation echo, over-subscription INVALID_REQUEST validation) and add
three optional sub-capabilities for package controls inside
seller-optimized buys: seller_optimized_package_budgets,
seller_optimized_min_spend_targets, seller_optimized_package_pacing.

Sellers declaring the parent without a sub-capability reject that
control with UNSUPPORTED_FEATURE before mutation. The capabilities
response schema requires the parent whenever a sub-capability is true.
Restructure the seller_optimized_budget storyboard so core phases carry
no package controls, add gated positive plus explicit-false/absent
negative phases per control, and add a compound-gated
seller_optimized_proposal_package_pacing scenario.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

Copy link
Copy Markdown
Contributor Author

Training-agent follow-up: #7753 (the reference agent does not yet enforce the seller-optimized contract, so it does not declare the capability; both scenarios grade not_applicable against it).

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated schema paths require human/CODEOWNERS review, and this is a semantic narrowing of the protocol surface.

This PR narrows seller_optimized_budget to the core shared-budget contract and gates package budgets, min-spend targets, and package pacing behind three new sub-capabilities. The reviewer found a clean diff: additive schema with correct sub-capability⇒parent if/then blocks, schema↔docs coherence across all six task/reference pages, correct positive/negative gating in both compliance scenarios, a scoped changeset, and no oneOf or dist-immutability regressions. No Critical/High/Medium findings were reported.

However, two independent gates force escalation:

  1. Gated paths (row 2): 12 files under static/schemas/source/** are modified and review_decision is REVIEW_REQUIRED, not APPROVED. The hard approval gate on the protocol source of truth is not satisfied, so this cannot be auto-approved regardless of how clean the diff is.

  2. Breaking-class governance gate (prose): The change narrows/repartitions the seller_optimized_budget contract — a semantic-narrowing classification the reviewer explicitly deferred to the arbiter. Per the repo's "Breaking-class changes are never auto-approved" hard gate, ratification is a human act and must escalate unless review_decision is APPROVED. It is not.

No blocking code findings exist — the escalation is governance-based, not defect-based. A human/CODEOWNERS reviewer must approve the schema source changes and ratify the contract narrowing before merge.

Escalation reasons

  • Modifies 12 files under static/schemas/source/** (gated protocol source) while review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval required.
  • Semantic narrowing of the seller_optimized_budget protocol contract is a breaking-class change requiring human ratification per the constitution's hard gate.

Why human review

  • Modifies 12 files under static/schemas/source/** (gated protocol source) while review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval required before merge.
  • Narrows the seller_optimized_budget protocol contract (gating package budgets, min-spend, and package pacing behind new sub-capabilities) — a breaking-class/semantic-narrowing change that requires human ratification per the constitution's never-auto-approve gate; review_decision is not APPROVED.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/budget-allocation.json (modified) matches static/schemas/source/**; static/schemas/source/core/canonical-media-buy-features.json (modified) matches static/schemas/source/**; static/schemas/source/core/media-buy-features.json (modified) matches static/schemas/source/**; static/schemas/source/core/product-allocation.json (modified) matches static/schemas/source/**; static/schemas/source/core/proposal.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/create-media-buy-request.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/package-control.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/package-request.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/package-update.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/product-purchase.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/update-media-buy-request.json (modified) matches static/schemas/source/**; static/schemas/source/protocol/get-adcp-capabilities-response.json (modified) matches static/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Sep 29, 2026
bokelley and others added 2 commits September 29, 2026 17:20
…ription checks

UNSUPPORTED_FEATURE for an undeclared seller-optimized package control now
takes precedence over over-subscription validation, and INVALID_REQUEST
over-subscription checks apply only to declared controls: the aggregate
minimum-spend check requires seller_optimized_min_spend_targets, and the
minimum-above-cap check requires both minimum-spend targets and package
budgets. A core-only seller receiving an over-subscribed min_spend_target
returns UNSUPPORTED_FEATURE.

Gate the aggregate storyboard phase on seller_optimized_min_spend_targets,
move the minimum-above-cap check into a compound-gated
seller_optimized_min_spend_target_exceeds_package_cap scenario, and make
the negative sub-capability requests over-subscribed so they prove the
precedence.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…allocation guidance

A seller declaring seller_optimized_budget MUST accept omitted or even
media-buy pacing on seller-optimized buys, MAY reject asap or front_loaded
with UNSUPPORTED_FEATURE (error.field pacing) before provider mutation, and
MUST NOT coerce them to even. Applied to create_media_buy, update_media_buy,
buy_products, and control_media_buy; fixed-mode pacing is unchanged.

Omitting budget_allocation still means fixed, but buyer agents SHOULD send
it explicitly and SHOULD ask the principal when the instruction does not
settle shared-pool versus per-package budgets.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated protocol source touched; human/CODEOWNERS approval required.

This PR modifies 14 files under static/schemas/source/**, which is a hard, deterministic approval gate (gated_paths: true). The current GitHub review decision is REVIEW_REQUIRED, not APPROVED. Per decision-table row 2, the outcome must be escalate until a human/CODEOWNERS approval is recorded — regardless of how clean the diff is.

The reviewer's delta pass found no Critical/High/Medium findings and confirmed schema↔docs coherence, pacing MUST/MAY rules, disjoint negative-phase gating, and matching test assertions. The prior blocking gate remains solely because the required review status has not yet flipped to APPROVED.

Escalation reasons

  • Modifies 14 files under static/schemas/source/** (gated protocol source) while review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval required before merge.
  • The seller_optimized_budget capability split narrows the protocol contract (gating package budgets, min-spend, and package pacing behind new sub-capabilities), a semantic/breaking-class change that requires human ratification per the constitution's never-auto-approve gate; review_decision is not APPROVED.

Once review_decision becomes APPROVED, this clean diff can fall through to the normal decision table.

Why human review

  • Modifies 14 files under static/schemas/source/** (gated protocol source) while review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval required before merge (gated_paths hard gate).
  • The seller_optimized_budget capability split narrows the protocol contract (gating package budgets, min-spend, and package pacing behind new sub-capabilities) — a breaking-class/semantic-narrowing change that requires human ratification per the constitution's never-auto-approve gate; review_decision is not APPROVED.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/budget-allocation.json (modified) matches static/schemas/source/**; static/schemas/source/core/canonical-media-buy-features.json (modified) matches static/schemas/source/**; static/schemas/source/core/media-buy-features.json (modified) matches static/schemas/source/**; static/schemas/source/core/product-allocation.json (modified) matches static/schemas/source/**; static/schemas/source/core/proposal.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/buy-products-request.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/control-media-buy-request.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/create-media-buy-request.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/package-control.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/package-request.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/package-update.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/product-purchase.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/update-media-buy-request.json (modified) matches static/schemas/source/**; static/schemas/source/protocol/get-adcp-capabilities-response.json (modified) matches static/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

Copy link
Copy Markdown
Contributor Author

Maintainer-approved design (precedence, core pacing rule, buyer guidance). Merging with admin privileges on the maintainer's explicit sign-off, because the PR is under the maintainer's own account and their GitHub approval can't count.

@bokelley
bokelley merged commit 7fa4829 into main Sep 29, 2026
64 checks passed
@bokelley
bokelley deleted the feat/seller-optimized-package-controls branch September 29, 2026 20:26
bokelley added a commit that referenced this pull request Sep 30, 2026
…g before GA (#7784)

Remove two archived changesets that describe training-agent and local
tooling work, and bring two archived entries in line with what ships in
3.2.1: the account change feed is experimental (#7727), and seller-optimized
package controls are gated on their own capabilities (#7752).

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant