Skip to content

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

Merged
bokelley merged 1 commit into
mainfrom
feat/hold-ranking-8086
Oct 17, 2026
Merged

bokelley merged 1 commit into
mainfrom
feat/hold-ranking-8086

Conversation

@bokelley

@bokelley bokelley commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

WG decision brief (3.3): hold ranking, advisory readback (#8086 item 2)

Agenda status: consent round. This covers item 2 of #8086 only. Item 1 (extend_hold) shipped in #8097. Item 3 (per-installment holds[]) is #8257, stacked on this PR. The WG chose Option A from the #8086 decision memo: advisory readback, with no right-of-first-refusal enforcement, no respond_by deadline, and no proposal.rank_changed webhook.

Experimental: feature id media_buy.hold_ranking, changeset minor. Single adopter: Availnet, a creator marketplace. Like the other hold slices, it merges as experimental for the 3.3 beta. The WG reviews it end to end with #8140, #8097, and the training agent (#8181).

Recommended shape

  • hold_policy.rankable (boolean, default false, forbidden when available is false). This is the room RFC: disclose proposal hold policy before finalization #7661 reserved. Without it, available: true keeps the meaning feat(media-buy): experimental hold_policy on products and proposals #8140 gave it: an exclusive, first-position hold, so the seller either places a first-position hold or returns hold_unavailable. With rankable: true, finalize may succeed with the hold queued behind holds that could prevent it from booking. The two differ only at placement. A rank-1 ranked hold has the same guarantee as an exclusive one. A draft is rankable if any allocated product is, because the proposal is accepted as a whole.

  • hold_rank on the committed canonical proposal (integer ≥ 1). It is required when hold_policy has available and rankable set to true, and forbidden otherwise and on drafts. 1 is first position, and n means n - 1 holds are ahead. Only holds whose booking could prevent this one count, so non-competing holds on capacity inventory don't inflate it. When the hold covers inventory at several positions, it is the worst of them.

    { "proposal_status": "committed", "hold_policy": { "available": true, "rankable": true }, "hold_placed_at": "2027-01-16T17:00:00Z", "hold_rank": 2 }
  • Acceptance. A hold at rank 1 keeps the existing acceptance guarantee. A hold behind first position does not. While a hold ahead of it is live or has been accepted, the seller MAY decline accept_proposal with PRODUCT_UNAVAILABLE, which is the error terms_only already uses, or MAY return submitted while it settles the holds ahead with their holders outside the protocol. It never reprices or substitutes, and the proposal stays committed. A challenge to a hold ahead ("confirm or release") cannot shorten that hold's expires_at. The descriptions of PRODUCT_UNAVAILABLE and committed now say this, so an agent doesn't drop a live hold on that error.

  • Freshness. The proposal is immutable, so hold_rank is a snapshot taken at hold_placed_at, or at the extension for an extend_hold successor. It is never updated, and an exact retry replays it. Sellers MUST NOT move a live hold to a worse position: no later hold or booking stands ahead of it, and commitments such as an incumbent's renewal rights count at placement. The snapshot is therefore an upper bound, and the buyer's real position can only improve. A buyer gets a fresher reading from an extend_hold successor, or learns whether it can book by calling accept_proposal. AdCP has no read task for a committed proposal, and this slice does not add one.

  • Privacy. hold_rank reveals only how many holds are ahead. Sellers return it only on the buyer's own proposals. They MUST NOT disclose another buyer's identity or terms through any field. They MUST NOT disclose another hold's expiry either, except through expected_confirmation_at on a submitted acceptance. The existing per-buyer cap on concurrent holds limits probing.

  • Version gate. Callers below 3.3 never receive hold_policy or hold_rank, and they read committed as an exclusive hold. For them, the seller treats rankable as false.

Compliance: 8 new vectors in test-vectors/hold-policy under a new ranking case, covering the finalize, draft, and extend lists. The grader adds hold_rank_worsened, rankable-draft derivation (reusing draft_exceeds_product_policy), and feature declaration.

Questions (yes / no)

  1. Is ranking declared by a separate hold_policy.rankable flag, so that available: true without it stays an exclusive, first-position hold? Recommend yes. feat(media-buy): experimental hold_policy on products and proposals #8140 promised that available would not be reinterpreted, and buyers that read only available keep a correct picture.
  2. Is hold_rank an immutable snapshot whose position never worsens (sellers MUST NOT move a live hold to a worse position), with no read task and no webhook in 3.3? Recommend yes. The no-worsening rule makes a stale snapshot safe to rely on. It matches first-come hold queues (first and second holds, "pencils"), where a later hold queues behind. If the WG rejects the rule, the snapshot is only informational and a read surface becomes necessary.
  3. Below first position, may the seller decline accept_proposal with PRODUCT_UNAVAILABLE or return submitted while it settles the holds ahead bilaterally, with no protocol-defined deadline? Recommend yes. This is Option A. Option B's respond_by and rank_changed remain possible later as additive fields.
  4. Does a proposal report one hold_rank, the worst position across its inventory, rather than a rank per product? Recommend yes. Acceptance is all or none, so the worst position is the one that decides. Per-installment positions come with holds[] in feat(media-buy): experimental per-installment hold readback (holds) #8257.
  5. Should rankable be the seller's call alone, with no finalize-time opt-in from the buyer? Recommend yes for 3.3. The draft's rankable is binding and visible before finalize, a 3.3 buyer that relies on a reservation MUST read it, and a buyer that doesn't want a ranked hold can let it lapse or decline it. A request flag such as require_first_position, defaulting to off, is the additive fix if adopters get surprised. The expert review raised it as the main residual risk.
  6. Disclose the exact number of holds ahead, and allow expected_confirmation_at on a submitted acceptance to reflect when a hold ahead resolves? Recommend yes. Broadcast sellers routinely tell a second-hold buyer when the first hold expires. A coarser value can be added if sellers object to revealing queue depth.

Default if no objection: the recommendation as drafted.

Verification

All of these pass locally: build:schemas, test:schemas (including hold-policy and hold-policy-vectors, with 94 hold tests), test:json-schema, test:examples, test:mcp-schema-projection, build:compliance -- --check, typecheck, the changeset scope check and changeset status, and json-schema-validation --file on each touched doc. test:server-unit passes in all three shards: 4,612, 3,311 (31 skipped), and 4,687 tests.

Size limits:

  • PARITY_COMPILE_LIMIT rises from 1,265,000 to 1,268,000. The comply_test_controller request measured 1,264,154 bytes on main and 1,266,010 on this branch.
  • The whole projection measures 21,146,328 bytes, under the 22 MiB cap (main: 21,112,592), so the cap is unchanged.
  • The tool listing is unchanged, because only response schemas changed.

docs/snippets/compliance-error-codes.mdx is regenerated from the PRODUCT_UNAVAILABLE description.

Refs #8086, #7661, #8140, #8097.

🤖 Generated with Claude Code

…ank)

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]>

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

No blocking (critical/high) or medium findings surfaced. The reviewer confirms a clean, additive experimental change: adds hold_policy.rankable and committed-proposal hold_rank (#8086) as advisory readback, with schema↔docs coherence intact across refine_proposals, get_products, accept_proposal, and get_adcp_capabilities. No oneOf regression (allOf if/then), enum edits are description-only, and the minor additive changeset is correct. Vectors and projection budget bump are conformant.

However, this PR modifies gated protocol-source files under static/schemas/source/** (canonical-proposal.json, hold-policy.json, error-code.json, proposal-status.json) and review_decision is REVIEW_REQUIRED — not APPROVED. Per the hard approval gate (decision rule row 2), the outcome must be escalate until a human/CODEOWNERS approval satisfies the gate. Once review_decision becomes APPROVED, this clean diff can fall through to approve.

Why human review

  • Gated paths touched without approval: static/schemas/source/core/canonical-proposal.json, static/schemas/source/core/hold-policy.json, static/schemas/source/enums/error-code.json, static/schemas/source/enums/proposal-status.json modified while review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/canonical-proposal.json (modified) matches static/schemas/source/**; static/schemas/source/core/hold-policy.json (modified) matches static/schemas/source/**; static/schemas/source/enums/error-code.json (modified) matches static/schemas/source/**; static/schemas/source/enums/proposal-status.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 16, 2026
@bokelley
bokelley merged commit ad0c101 into main Oct 17, 2026
66 checks passed
@bokelley
bokelley deleted the feat/hold-ranking-8086 branch October 17, 2026 11:04
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