Skip to content

feat(media-buy): experimental hold_policy on products and proposals - #8140

Merged
bokelley merged 14 commits into
mainfrom
bokelley/7661-hold-policy
Oct 14, 2026
Merged

bokelley merged 14 commits into
mainfrom
bokelley/7661-hold-policy

Conversation

@bokelley

@bokelley bokelley commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Consent round for AdCP 3.3: objections by Fri 2026-10-16 23:59 UTC.

Closes #7661 (as widened in the 3.3 comment). Stacked on #7954: review only the commits above it; this retargets to main when #7954 merges.

What

A new experimental hold_policy object (core/hold-policy.json, feature id media_buy.hold_policy), plus hold_placed_at on committed proposals:

  • product.hold_policy (product, canonical-product): a planning hint. It says what finalizing a proposal that allocates this product generally gets, so buyers can plan before request_proposals. It binds nothing.
  • proposal.hold_policy (canonical-proposal only): binding on a draft. The seller derives it from the allocated products, and the committed successor carries it forward unchanged. Legacy core/proposal.json no longer carries it, because the legacy refinement envelope can't express hold_unavailable or batch_aborted.
  • hold_placed_at (canonical-proposal): when the hold was placed. Required on a committed proposal whose hold_policy.available is true, and forbidden on drafts and when available is false.
Field Meaning
available (required) Whether finalize places an exclusive, first-position inventory hold
min_duration Promised minimum hold
max_duration Longest initial hold
extendable Whether the seller accepts extension requests (default false)
max_total_duration Ceiling across the whole extension chain from the original hold_placed_at (only when extendable is true)

Rules

  • Bounds are measured from hold_placed_at. hold_placed_at + min_duration ≤ expires_at ≤ hold_placed_at + max_duration. hold_placed_at lies between request receipt and the synchronous response or submitted completion. If the minimum can't be met, the entry returns hold_unavailable and its siblings return batch_aborted. An exact retry returns the original hold_placed_at and expires_at, so it never restarts the clock.
  • submitted finalize. The clock starts at completion, and nothing protects the slot while the task is pending. The buyer's usable window is shorter than min_duration by the notification delay.
  • Installment deadlines. A hold never runs past the earliest installment booking_deadline or change_cutoff. If the minimum doesn't fit before it, the entry returns hold_unavailable.
  • Drafts bind; products plan. A draft has available: false if any allocated product is non-holdable. Its min_duration and max_duration are ≤ every declared product max_duration, and its max_total_duration is ≤ every declared product max_total_duration. It is extendable only if every product is. The immutable draft governs finalize even if a product's policy changes.
  • Presence. A seller listing media_buy.hold_policy MUST emit hold_policy on every draft and committed proposal for 3.3+ callers. 3.3+ buyers that rely on a reservation MUST read the committed hold_policy.available; when it's absent, the agent's hold_semantics default applies.
  • Per-entry terms_only. feat(media-buy): delegated composition bootstrap — exclusive product universe and terms-only finalize #7954's rules now apply to each finalize entry according to its effective policy. A terms-only entry never returns hold_unavailable. In an all-or-none batch where a holdable sibling returns hold_unavailable, the terms-only entry returns batch_aborted. The 3.3 rule refusing terms-only committed proposals to older callers applies per entry. Declaring available: false doesn't require listing media_buy.delegated_composition.
  • hold_semantics becomes a default for products and drafts without hold_policy. A terms_only agent can hold specific products, and an inventory_hold agent can mark products non-holdable.
  • Version gating. hold_policy and hold_placed_at are 3.3 fields, and strict 3.2 canonical schemas reject unknown properties. Sellers omit both for callers below 3.3 (following serving an older pin) and otherwise apply the rules unchanged.
  • Durations are strictly positive ISO 8601 values in days, hours, minutes and seconds. A day is exactly 24 hours on the UTC instant, so DST doesn't affect it, and durations compare after normalizing (P1D = PT24H). The schema enforces "no durations or extendable when available is false" and "max_total_duration only with extendable: true". Runners check the ordering min ≤ max ≤ total.
  • Extension is specified in feat(media-buy): experimental extend_hold action for refine_proposals #8097: successors carry hold_policy and hold_placed_at forward, and max_total_duration counts across the chain. Hold ranking will be a separate field (RFC: Hold extension, hold ranking, and holds on specific installments #8086); available won't be reinterpreted for it.

Answers to the RFC's decision list

  1. available: false is kept. It's what lets one seller sell holdable and non-holdable products.
  2. min_duration is a promised minimum, and max_duration bounds the initial hold.
  3. The extension mechanism stays in feat(media-buy): experimental extend_hold action for refine_proposals #8097. This PR only adds the limits (extendable, max_total_duration).
  4. Seller-level planning is per product rather than a capability-level default/min/max.
  5. The clock starts at hold placement, which is now on the wire as hold_placed_at.

Compliance vectors

static/compliance/source/test-vectors/hold-policy/ has 40 finalize and 12 draft vectors, replayed by the reference grader tests/hold-policy-vectors.test.cjs. Hold placement is read from the committed hold_placed_at, which must fall inside the observed request window. Window grading with indeterminate bounds remains only for callers below 3.3, which get no hold_placed_at. The vectors cover bounds (including DST), submitted finalizes, presence and carry-forward, per-entry terms-only and batch_aborted, hold_semantics defaults, the version gate and below-3.3 omission, draft derivation from products, duration ordering, and schema rejections (missing hold_placed_at, max_total_duration without extendable).

Composition with #8097 (extend_hold)

When #8097 restacks, its "limits are seller policy until hold_policy (#7661)" text, in the docs and in the hold_extension capability description, should point at extendable and max_total_duration. This PR already states that an extended successor carries hold_policy and hold_placed_at forward and that max_total_duration counts from the original hold_placed_at. Expect merge conflicts in refine_proposals.mdx, proposal-negotiation.mdx, experimental-status.mdx and the capabilities schema.

Not in this PR

  • Storyboards for the acceptance scenarios. Forcing "cannot satisfy minimum" needs a comply_test_controller scenario.
  • Vectors for exact-retry replay, installment deadlines, and extension.
  • rankable and per-allocation hold readback (RFC: Hold extension, hold ranking, and holds on specific installments #8086 items 2 and 3). Both fit this shape without changes.
  • terms_digest doesn't cover hold_policy (it isn't a commercial term), so "carried forward unchanged" is a seller MUST that can't be verified at acceptance.

Verification

  • Passed: build:schemas, test:schemas (including tests/hold-policy.test.cjs, 10 tests, and tests/hold-policy-vectors.test.cjs, 60 tests), test:json-schema (324/0), test:examples, test:mcp-schema-projection (36/0), build:compliance -- --check, typecheck, test:unit, and the changeset scope check. Per-doc JSON schema validation shows 0 failures on every touched doc.
  • Hooks: committed with --no-verify after running the hook's fast steps (test:unit, dynamic-import, format-identity, callapi, typecheck) by hand. The full server unit suite (about 17 minutes) was skipped; earlier commits on this branch saw it fail in this sandbox for unrelated reasons. Pushed with ADCP_SKIP_STORYBOARD_MATRIX=1, so CI's storyboard workflow is the gate.

Adopter: Availnet (a creator marketplace), which holds each creator's upcoming-video slot while the creator confirms.

🤖 Generated with Claude Code


Open workspace in Conductor

bokelley and others added 7 commits October 6, 2026 09:52
…universe and terms-only finalize

Builds on the closed #7109 prototype (2543f52 / 92f5a95) for items 1 and 2 of #7107.

- criteria.product_ids_exclusive: product_ids becomes the complete composable
  universe for a request and its refinement lineage; signals are fenced to the
  listed products' signal_targeting_options; refinements may only narrow.
  Capability-gated by media_buy.supports_exclusive_product_ids.
- media_buy.proposal_refinement.hold_semantics (inventory_hold | terms_only):
  terms_only finalize commits terms without an inventory hold; expires_at is the
  acceptance window; hold_unavailable is excluded; version-gated for callers
  pinned below 3.3.
- docs/protocol/get_adcp_capabilities.mdx documents both capabilities, and a
  delegated-composition bootstrap profile page assembles them. The
  acceptance-only accept_proposal variant (item 3) is deliberately not included.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ition-3.3

# Conflicts:
#	docs/media-buy/task-reference/accept_proposal.mdx
#	static/schemas/source/enums/proposal-refinement-reason.json
…ition-3.3

# Conflicts:
#	docs/media-buy/task-reference/accept_proposal.mdx
Add core/hold-policy.json (feature id media_buy.hold_policy, #7661):
available, min_duration, max_duration, extendable, max_total_duration,
with strictly positive day/hour/minute/second ISO 8601 durations that are
forbidden when available is false. Declare it on product,
canonical-product, proposal, and canonical-proposal. A successful finalize
honors min_duration from when the hold is placed or returns
hold_unavailable; any non-holdable allocated product resolves the whole
proposal to terms-only finalize. hold_semantics becomes the default for
products that do not declare hold_policy.

Stacks on #7954 (terms_only hold semantics).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Add static/compliance/source/test-vectors/hold-policy with 35 finalize
and 6 draft vectors for experimental hold_policy (#7661), each with
expected.violations, across six cases: hold bounds, hold_unavailable in
all-or-none batches, terms-only resolution for non-holdable drafts,
hold_semantics defaults, the 3.3 version gate, and draft-product
consistency.

The vectors use canonical proposals only. A day is 24 hours on the UTC
instant (including a DST vector). Hold placement time is not on the
wire, so the grader uses observation.hold_placed_at only when present
and otherwise grades both bounds against the request/response window,
reporting unsettled bounds as indeterminate. max_total_duration appears
only with extendable true. Product-draft consistency is checked for
presence and the available-false rule only.

tests/hold-policy-vectors.test.cjs holds the reference grader, replays
every vector, and is wired into test:schemas. Storyboards stay deferred:
the training agent serves at most 3.2 and the SDK's 3.2 canonical
proposal schema rejects hold_policy.

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

Apply the expert-review fixes to experimental hold_policy (#7661):

- Add hold_placed_at to canonical-proposal: required on a committed
  proposal whose hold_policy.available is true, forbidden on drafts and
  when available is false. It lies between request receipt and the
  response or submitted completion, and the bounds are
  hold_placed_at + min_duration <= expires_at <= hold_placed_at +
  max_duration. An exact retry never restarts the clock.
- Product hold_policy is a planning hint; only the draft binds. The
  draft derives available, durations and extendable from the allocated
  products and governs finalize even if a product's policy changes.
- A seller that lists media_buy.hold_policy emits hold_policy on every
  draft and committed proposal for 3.3+ callers, and omits hold_policy
  and hold_placed_at for callers below 3.3.
- Scope #7954's terms_only rules per finalize entry. In a mixed batch,
  a terms-only entry returns batch_aborted when a holdable sibling
  returns hold_unavailable.
- Remove hold_policy from legacy core/proposal.json; proposal-level
  policy is compact-lifecycle only.
- Schema: extendable defaults to false; max_total_duration requires
  extendable true. A day is 24 hours on the UTC instant and durations
  compare after normalizing.
- Document submitted-finalize timing, installment deadlines, exclusive
  holds, that available false needs no delegated_composition, and the
  extension chain (#8097).

Vectors: hold placement moves from the grader-side observation block
onto the committed proposal's hold_placed_at, which must lie inside the
observed request window. Window grading with indeterminate bounds
remains only for callers below 3.3, so the four placement-free vectors
become 3.2-caller vectors. New codes: hold_policy_missing (renamed from
draft_hold_policy_missing), hold_placed_at_outside_window,
hold_policy_sent_below_3_3, draft_exceeds_product_policy, and
hold_policy_durations_unordered. Schema vectors cover a missing
hold_placed_at and max_total_duration without extendable. 40 finalize
and 12 draft vectors.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
bokelley added a commit that referenced this pull request Oct 12, 2026
Refs #8086, #7661, #7954. Restacks extend_hold on hold_policy (#8140,
through 81b38ba), itself on terms_only hold semantics (#7954).

- Limits come from hold_policy. extendable defaults to false: when it is
  false or absent the seller declines (hold_unavailable) and buyers
  SHOULD NOT send extend_hold. The successor's expires_at MUST NOT
  exceed the original hold_placed_at plus max_total_duration; a request
  the seller cannot extend at all returns hold_unavailable. Absent
  hold_policy (a seller that does not list media_buy.hold_policy),
  limits stay seller policy. hold_extension: true remains the
  agent-level gate.
- Successors carry hold_policy and hold_placed_at forward unchanged, so
  max_total_duration counts from the root finalize's placement across
  the whole chain of extension successors.
- extend_hold applies only to committed proposals that hold inventory,
  judged per entry. An entry whose effective policy is terms-only
  (hold_policy.available false, or no hold_policy at a terms_only
  agent) fails the request at task level with INVALID_STATE, never
  hold_unavailable, replacing the non-normative terms_only paragraph
  that contradicted #7954 and #8140.
- Nothing relies on hold_policy in legacy core/proposal.json, which
  #8140 removed.
- Vectors: eleven extend_hold vectors in the hold-policy set (case
  extension) with a gradeExtend reference grader: successors within,
  at, and past the total ceiling (including a chain), hold_placed_at
  and hold_policy carried forward, a later expires_at, extendable
  defaulting to false, and INVALID_STATE for a source without a hold.
  Four new violation codes.
- Tests: the training-agent refine_proposals parity test now expects
  the extend_hold action value; the compact discovery tools/list budget
  rises to 155 KiB (+836 bytes) and the media-buy MCP model-context
  budget to 447 KiB (+501 bytes) for the combined stack.

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

Resolve refine_proposals.mdx (keep terms_only finalize paragraph, add
main's expected_confirmation_at paragraph, keep terms_only-aware
definition-pins paragraph) and experimental-status.mdx (keep both the
delegated_composition and trust_json rows).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…into bokelley/7661-hold-policy

Brings in the main merge. Resolve package.json test:schemas (main's list
plus hold-policy.test.cjs and hold-policy-vectors.test.cjs) and
experimental-status.mdx (keep both the hold_policy and trust_json rows).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Base automatically changed from feat/delegated-composition-3.3 to main October 14, 2026 01:29
…licy

# Conflicts:
#	docs/media-buy/product-discovery/delegated-composition.mdx
#	docs/media-buy/task-reference/accept_proposal.mdx
#	docs/media-buy/task-reference/refine_proposals.mdx
#	docs/protocol/get_adcp_capabilities.mdx
#	docs/reference/experimental-status.mdx
#	static/schemas/source/core/canonical-proposal.json
#	static/schemas/source/enums/proposal-refinement-reason.json
#	static/schemas/source/enums/proposal-status.json
#	static/schemas/source/media-buy/refine-proposals-response.json
#	static/schemas/source/protocol/get-adcp-capabilities-response.json
@bokelley
bokelley marked this pull request as ready for review October 14, 2026 01:44

@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 approval.

This PR modifies the published protocol surface under static/schemas/source/** (canonical-product.json, canonical-proposal.json, product.json, proposal-refinement-reason.json, proposal-status.json, refine-proposals-response.json, get-adcp-capabilities-response.json) and adds core/hold-policy.json — all gated paths. gated_paths: true with review_decision: REVIEW_REQUIRED (not APPROVED), so the hard approval gate (decision rule row 2) is not satisfied and auto-approve is forbidden.

The reviewer's substantive assessment is clean: a purely additive, Normative (non-breaking) experimental change (feature id media_buy.hold_policy) with a correct minor changeset, no oneOf discriminator regression, no dist/** mutation, and verified schema↔docs coherence across refine_proposals, get_products, get_adcp_capabilities, accept_proposal, proposal-negotiation, delegated-composition, and experimental-status. positive_duration pattern and allOf conditionals validated; 60+ replayed vectors spot-checked. No Critical/High/Medium findings.

Despite the clean diff, the deterministic gated-paths approval gate means a human/CODEOWNERS approval is required before merge.

Escalation reasons

  • Gated schema files modified/added under static/schemas/source/** while review_decision is REVIEW_REQUIRED (not APPROVED) — human/CODEOWNERS approval required (decision rule row 2).

Why human review

  • Gated paths touched (static/schemas/source/** — canonical-product.json, canonical-proposal.json, product.json, hold-policy.json [added], proposal-refinement-reason.json, proposal-status.json, refine-proposals-response.json, get-adcp-capabilities-response.json) and review_decision is REVIEW_REQUIRED, not APPROVED. Human/CODEOWNERS approval is required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/canonical-product.json (modified) matches static/schemas/source/**; static/schemas/source/core/canonical-proposal.json (modified) matches static/schemas/source/**; static/schemas/source/core/hold-policy.json (added) matches static/schemas/source/**; static/schemas/source/core/product.json (modified) matches static/schemas/source/**; static/schemas/source/enums/proposal-refinement-reason.json (modified) matches static/schemas/source/**; static/schemas/source/enums/proposal-status.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/refine-proposals-response.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 Oct 14, 2026
bokelley and others added 4 commits October 14, 2026 02:46
main already measured 20_945_219 bytes against the 20 MiB sanity cap set
in #6070. Experimental hold_policy is bundled into every product- and
proposal-bearing tool and brings the projection to 21_021_886 bytes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Experimental hold_policy reaches the comply_test_controller request
through the seeded Product and the committed proposal: 1_259_242 bytes
measured on main with response collections and follower counts, bounded
at 1_265_000.

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-path approval gate not yet satisfied.

This PR adds a new hold-policy protocol surface and touches multiple files under static/schemas/source/**, which are under a hard, deterministic approval gate. gated_paths: true and review_decision: REVIEW_REQUIRED (not APPROVED), so row 2 of the decision table forces escalation — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

The reviewer reports a clean pass with no critical/high/medium findings; the delta since the prior (also clean) review is rebase churn, with every hold_policy schema/vector/test file byte-identical to the prior review. Schema↔docs coherence, changeset presence (.changeset/hold-policy.md), and test coverage are all intact. There are no code-correctness blockers.

This is a sticky continuation of the prior escalate, but it rests on a still-active hard gate rather than on findings. Once a human/CODEOWNERS approval moves review_decision to APPROVED, this PR would fall through to a normal approve (subject to breaking-class review of the new hold-policy surface).

Escalation reasons

  • Gated paths touched (static/schemas/source/**: canonical-product.json, canonical-proposal.json, product.json, hold-policy.json [added], proposal-refinement-reason.json, proposal-status.json, refine-proposals-response.json, get-adcp-capabilities-response.json) and review_decision is REVIEW_REQUIRED, not APPROVED. Human/CODEOWNERS approval is required before merge.
  • New protocol surface (hold-policy) — a human must confirm whether this is Normative-nonbreaking vs Breaking-class before merge.

Why human review

  • Gated paths under static/schemas/source/** touched (canonical-product.json, canonical-proposal.json, product.json, hold-policy.json [added], proposal-refinement-reason.json, proposal-status.json, refine-proposals-response.json, get-adcp-capabilities-response.json) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.
  • New hold-policy protocol surface added; a human must confirm the decision class (Normative vs Breaking) before this can merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/canonical-product.json (modified) matches static/schemas/source/**; static/schemas/source/core/canonical-proposal.json (modified) matches static/schemas/source/**; static/schemas/source/core/hold-policy.json (added) matches static/schemas/source/**; static/schemas/source/core/product.json (modified) matches static/schemas/source/**; static/schemas/source/enums/proposal-refinement-reason.json (modified) matches static/schemas/source/**; static/schemas/source/enums/proposal-status.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/refine-proposals-response.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.

@bokelley
bokelley merged commit 68c487e into main Oct 14, 2026
66 checks passed
@bokelley
bokelley deleted the bokelley/7661-hold-policy branch October 14, 2026 03:33
bokelley added a commit that referenced this pull request Oct 14, 2026
…#8097)

* feat(media-buy): delegated composition bootstrap — exclusive product universe and terms-only finalize

Builds on the closed #7109 prototype (2543f52 / 92f5a95) for items 1 and 2 of #7107.

- criteria.product_ids_exclusive: product_ids becomes the complete composable
  universe for a request and its refinement lineage; signals are fenced to the
  listed products' signal_targeting_options; refinements may only narrow.
  Capability-gated by media_buy.supports_exclusive_product_ids.
- media_buy.proposal_refinement.hold_semantics (inventory_hold | terms_only):
  terms_only finalize commits terms without an inventory hold; expires_at is the
  acceptance window; hold_unavailable is excluded; version-gated for callers
  pinned below 3.3.
- docs/protocol/get_adcp_capabilities.mdx documents both capabilities, and a
  delegated-composition bootstrap profile page assembles them. The
  acceptance-only accept_proposal variant (item 3) is deliberately not included.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* feat(media-buy): experimental hold_policy on products and proposals

Add core/hold-policy.json (feature id media_buy.hold_policy, #7661):
available, min_duration, max_duration, extendable, max_total_duration,
with strictly positive day/hour/minute/second ISO 8601 durations that are
forbidden when available is false. Declare it on product,
canonical-product, proposal, and canonical-proposal. A successful finalize
honors min_duration from when the hold is placed or returns
hold_unavailable; any non-holdable allocated product resolves the whole
proposal to terms-only finalize. hold_semantics becomes the default for
products that do not declare hold_policy.

Stacks on #7954 (terms_only hold semantics).

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

* test(compliance): hold_policy reference vectors and grader

Add static/compliance/source/test-vectors/hold-policy with 35 finalize
and 6 draft vectors for experimental hold_policy (#7661), each with
expected.violations, across six cases: hold bounds, hold_unavailable in
all-or-none batches, terms-only resolution for non-holdable drafts,
hold_semantics defaults, the 3.3 version gate, and draft-product
consistency.

The vectors use canonical proposals only. A day is 24 hours on the UTC
instant (including a DST vector). Hold placement time is not on the
wire, so the grader uses observation.hold_placed_at only when present
and otherwise grades both bounds against the request/response window,
reporting unsettled bounds as indeterminate. max_total_duration appears
only with extendable true. Product-draft consistency is checked for
presence and the available-false rule only.

tests/hold-policy-vectors.test.cjs holds the reference grader, replays
every vector, and is wired into test:schemas. Storyboards stay deferred:
the training agent serves at most 3.2 and the SDK's 3.2 canonical
proposal schema rejects hold_policy.

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

* feat(media-buy): hold_placed_at, binding drafts, per-entry terms_only for hold_policy

Apply the expert-review fixes to experimental hold_policy (#7661):

- Add hold_placed_at to canonical-proposal: required on a committed
  proposal whose hold_policy.available is true, forbidden on drafts and
  when available is false. It lies between request receipt and the
  response or submitted completion, and the bounds are
  hold_placed_at + min_duration <= expires_at <= hold_placed_at +
  max_duration. An exact retry never restarts the clock.
- Product hold_policy is a planning hint; only the draft binds. The
  draft derives available, durations and extendable from the allocated
  products and governs finalize even if a product's policy changes.
- A seller that lists media_buy.hold_policy emits hold_policy on every
  draft and committed proposal for 3.3+ callers, and omits hold_policy
  and hold_placed_at for callers below 3.3.
- Scope #7954's terms_only rules per finalize entry. In a mixed batch,
  a terms-only entry returns batch_aborted when a holdable sibling
  returns hold_unavailable.
- Remove hold_policy from legacy core/proposal.json; proposal-level
  policy is compact-lifecycle only.
- Schema: extendable defaults to false; max_total_duration requires
  extendable true. A day is 24 hours on the UTC instant and durations
  compare after normalizing.
- Document submitted-finalize timing, installment deadlines, exclusive
  holds, that available false needs no delegated_composition, and the
  extension chain (#8097).

Vectors: hold placement moves from the grader-side observation block
onto the committed proposal's hold_placed_at, which must lie inside the
observed request window. Window grading with indeterminate bounds
remains only for callers below 3.3, so the four placement-free vectors
become 3.2-caller vectors. New codes: hold_policy_missing (renamed from
draft_hold_policy_missing), hold_placed_at_outside_window,
hold_policy_sent_below_3_3, draft_exceeds_product_policy, and
hold_policy_durations_unordered. Schema vectors cover a missing
hold_placed_at and max_total_duration without extendable. 40 finalize
and 12 draft vectors.

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

* feat(media-buy): experimental extend_hold action for refine_proposals

Refs #8086. Adds action extend_hold (feature id media_buy.hold_extension):
committed, unexpired source -> new committed successor with later
expires_at, hold transfers, source no longer acceptable. Atomic
extend-only batches, reuses the finalized outcome, failures are
hold_unavailable / batch_aborted. Capability
media_buy.proposal_refinement.hold_extension.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs(media-buy): address review of extend_hold (supersession, race, error codes)

Refs #8086.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs(media-buy): name Availnet as the hold_extension adopter

Refs #8086.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs(media-buy): reconcile extend_hold with hold_policy and terms_only

Refs #8086, #7661, #7954. Restacks extend_hold on hold_policy (#8140,
through 81b38ba), itself on terms_only hold semantics (#7954).

- Limits come from hold_policy. extendable defaults to false: when it is
  false or absent the seller declines (hold_unavailable) and buyers
  SHOULD NOT send extend_hold. The successor's expires_at MUST NOT
  exceed the original hold_placed_at plus max_total_duration; a request
  the seller cannot extend at all returns hold_unavailable. Absent
  hold_policy (a seller that does not list media_buy.hold_policy),
  limits stay seller policy. hold_extension: true remains the
  agent-level gate.
- Successors carry hold_policy and hold_placed_at forward unchanged, so
  max_total_duration counts from the root finalize's placement across
  the whole chain of extension successors.
- extend_hold applies only to committed proposals that hold inventory,
  judged per entry. An entry whose effective policy is terms-only
  (hold_policy.available false, or no hold_policy at a terms_only
  agent) fails the request at task level with INVALID_STATE, never
  hold_unavailable, replacing the non-normative terms_only paragraph
  that contradicted #7954 and #8140.
- Nothing relies on hold_policy in legacy core/proposal.json, which
  #8140 removed.
- Vectors: eleven extend_hold vectors in the hold-policy set (case
  extension) with a gradeExtend reference grader: successors within,
  at, and past the total ceiling (including a chain), hold_placed_at
  and hold_policy carried forward, a later expires_at, extendable
  defaulting to false, and INVALID_STATE for a source without a hold.
  Four new violation codes.
- Tests: the training-agent refine_proposals parity test now expects
  the extend_hold action value; the compact discovery tools/list budget
  rises to 155 KiB (+836 bytes) and the media-buy MCP model-context
  budget to 447 KiB (+501 bytes) for the combined stack.

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

* test(schema): raise whole MCP projection cap to 22 MiB for hold_policy

main already measured 20_945_219 bytes against the 20 MiB sanity cap set
in #6070. Experimental hold_policy is bundled into every product- and
proposal-bearing tool and brings the projection to 21_021_886 bytes.

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

* test(schema): raise comply_test_controller parity limit for hold_policy

Experimental hold_policy reaches the comply_test_controller request
through the seeded Product and the committed proposal: 1_259_242 bytes
measured on main with response collections and follower counts, bounded
at 1_265_000.

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

* fix(media-buy): scope max_duration to finalize and grade no-hold extend errors

Review fixes for extend_hold:
- canonical-proposal hold_placed_at: the max_duration bound applies to the
  committed proposal created by finalize. An extend_hold successor carries
  hold_placed_at forward and is bounded by max_total_duration instead, so
  the conformant extend-within-total vector no longer contradicts the
  schema text.
- Reference grader: an extend_hold against a commitment that holds no
  inventory must fail at task level with INVALID_STATE. Any other task
  error code is now the no_hold_wrong_task_error violation, with a new
  extend-terms-only-wrong-task-error vector.

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

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
bokelley added a commit that referenced this pull request Oct 17, 2026
…ank) (#8255)

Item 2 of #8086, Option A (advisory readback). hold_policy gains rankable
(default false, forbidden without a hold); without it, available true keeps
its exclusive, first-position meaning from #8140. Under a rankable policy
the committed canonical proposal reports the buyer's own position in
hold_rank (1 = first; the worst position across the hold), required there
and forbidden otherwise and on drafts.

Rank 1 keeps the acceptance guarantee; behind first position the seller
MAY decline accept_proposal with PRODUCT_UNAVAILABLE or return submitted
while it settles the holds ahead bilaterally. Positions never worsen, so
the immutable snapshot is an upper bound; extend_hold successors report a
fresh, never-worse position. No ROFR deadline, no rank-change webhook, and
nothing disclosed about other buyers beyond the count ahead. Callers below
3.3 never see the fields and get rankable treated as false.

Adds ranking vectors and the hold_rank_worsened grader code, and raises
PARITY_COMPILE_LIMIT to 1_268_000 (1_264_154 -> 1_266_010 bytes measured).

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
bokelley added a commit that referenced this pull request Oct 17, 2026
…8257)

* feat(media-buy): experimental advisory hold ranking (rankable, hold_rank)

Item 2 of #8086, Option A (advisory readback). hold_policy gains rankable
(default false, forbidden without a hold); without it, available true keeps
its exclusive, first-position meaning from #8140. Under a rankable policy
the committed canonical proposal reports the buyer's own position in
hold_rank (1 = first; the worst position across the hold), required there
and forbidden otherwise and on drafts.

Rank 1 keeps the acceptance guarantee; behind first position the seller
MAY decline accept_proposal with PRODUCT_UNAVAILABLE or return submitted
while it settles the holds ahead bilaterally. Positions never worsen, so
the immutable snapshot is an upper bound; extend_hold successors report a
fresh, never-worse position. No ROFR deadline, no rank-change webhook, and
nothing disclosed about other buyers beyond the count ahead. Callers below
3.3 never see the fields and get rankable treated as false.

Adds ranking vectors and the hold_rank_worsened grader code, and raises
PARITY_COMPILE_LIMIT to 1_268_000 (1_264_154 -> 1_266_010 bytes measured).

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

* feat(media-buy): experimental per-installment hold readback (holds)

Item 3 of #8086. A committed canonical proposal whose hold_policy holds
inventory may carry holds[]: product_id plus the canonical installment_ref
for each installment the hold covers, and, under a rankable policy, the
buyer's own hold_rank per installment.

holds[] is readback of the one all-or-none hold finalize placed, keeping
#8140's no-partial-holds rule: entries share hold_placed_at and the
proposal expires_at (no per-entry expiry), lapse, extend, and are accepted
only with the proposal, and no task addresses an entry. Complete when
present, allocated products only, the buyer's own hold only; extend_hold
successors list the same entries at no-worse positions and never pass an
installment booking deadline or change cutoff. Omitted below 3.3.

Adds installment_holds vectors and grader codes. Parity compile size is
unchanged (1_266_010 bytes); the whole projection measures 21_173_544.

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

---------

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.

RFC: disclose proposal hold policy before finalization

1 participant