Repository navigation
feat(schema): add shared MediaBuy name to buy_products/accept_proposal - #7608
sujanchalla0510 wants to merge 2 commits into
Conversation
Closes adcontextprotocol#7536. PR adcontextprotocol#6573 added an optional `name` (human-readable trafficking-UI display label, MUST-persist/MUST-echo) to create_media_buy, update_media_buy, core/media-buy.json, and their response surfaces, one day after the 3.2 compact lifecycle (adcontextprotocol#6115) merged — the compact tools were never touched by adcontextprotocol#6573 and have carried no way to set the label since. A buyer on the compact create path (buy_products, accept_proposal) had exactly one way to set it: a follow-up control_media_buy revision, costing a revision bump for a label create_media_buy sets inline. Adds optional `name` to buy-products-request.json and accept-proposal-request.json with the same constraints (minLength: 1, maxLength: 255, pattern: \S) and MUST-persist/MUST-echo wording as create-media-buy-request.json, and to the shared media-buy-commitment-response.json's "Committed Media Buy" branch, placed outside accepted_proposal — operational metadata, not a covered component of the accepted terms or terms_digest, mirroring how control_media_buy already frames name. accept_proposal's name additionally states precedence per the issue's suggested resolution: a request value wins; when absent, sellers MAY seed the MediaBuy name from the accepted proposal's own name (bounded to 255 characters, proposal.name allows up to 500) and MUST then report it on read surfaces like any persisted name. proposal.name is seller-authored and describes the plan under negotiation, not the buy that was booked, so it is a fallback default, not a substitute. Extended tests/media-buy-name-contract.test.cjs to guard all three new surfaces under the same shared-contract assertions the existing six surfaces already use (255-char bound, MUST-persist obligation, "not an identifier or financial reference" framing), plus a dedicated test for accept_proposal's terms-digest exclusion and proposal-seeding precedence language. Updated buy_products.mdx, accept_proposal.mdx, and media-buy/lifecycle.mdx (making explicit that `name` is not in the documented lossy-on-compact-path list, closing the ambiguity the issue raised). Verification: - node tests/media-buy-name-contract.test.cjs and the full node tests/composed-schema-validation.test.cjs (466/466) pass. - Revert-and-reconfirm: reverting only the three schema files (keeping the test changes) makes the three new/extended assertions fail with `Cannot read properties of undefined (reading 'description')` and a regex-match failure; restoring the fix makes all pass. - npm run test:schemas and npm run test:json-schema (281/281 $schema-tagged doc examples, including the two updated docs snippets) both pass. - npm run typecheck clean. - node scripts/check-changeset-protocol-scope.cjs origin/main passed. - npm run lint:schema-links clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
npm run build:compliance auto-links bare task-name mentions in doc prose to their own reference pages (get_media_buys here). Ran it after the fact and committed the result, closing the "compliance symbol links are stale" failure the second build pass caught. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated schema paths require human/CODEOWNERS approval.
This PR adds an optional MediaBuy name field to the buy_products and accept_proposal requests and the shared media-buy-commitment-response success branch. The reviewer found no Critical/High/Medium issues: schema constraints (minLength 1 / maxLength 255 / pattern \S) match the six pre-existing name surfaces, docs are coherent with the schema change, the minor changeset is correctly scoped, no new undiscriminated oneOf is introduced, and the contract test guards all three new surfaces.
Despite the clean diff, this PR modifies files under static/schemas/source/**, which are under a hard, deterministic approval gate (gated_paths: true) and review_decision is REVIEW_REQUIRED — not APPROVED. Per decision rule row 2, the gate is not satisfied, so the outcome must be escalate until a human/CODEOWNERS approval lands.
Gated files requiring human/CODEOWNERS review:
- static/schemas/source/media-buy/accept-proposal-request.json
- static/schemas/source/media-buy/buy-products-request.json
- static/schemas/source/media-buy/media-buy-commitment-response.json
No blocking findings exist; once review_decision becomes APPROVED, this can fall through to a normal approve.
Why human review
- Gated paths touched (static/schemas/source/**) with review_decision=REVIEW_REQUIRED — human/CODEOWNERS approval required before merge: accept-proposal-request.json, buy-products-request.json, media-buy-commitment-response.json
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/media-buy/accept-proposal-request.json (modified) matches
static/schemas/source/**; static/schemas/source/media-buy/buy-products-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/media-buy-commitment-response.json (modified) matchesstatic/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.
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated path touched without required approval.
This PR modifies files under static/schemas/source/**, which fall under a hard, path-based approval gate (gated_paths: true). The current GitHub review decision is REVIEW_REQUIRED, not APPROVED, so decision-table row 2 fires: the gate cannot be lifted until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.
The reviewer returned a clean pass with no findings — the schema delta adds optional name fields with matching docs, a correct minor changeset, no new oneOf, no dist/ artifact mutation, and contract test coverage. This is a net-clean diff, but the gated-path rule is non-overridable.
Gated files requiring human/CODEOWNERS approval:
- static/schemas/source/media-buy/accept-proposal-request.json
- static/schemas/source/media-buy/buy-products-request.json
- static/schemas/source/media-buy/media-buy-commitment-response.json
No blocking findings; the escalation is purely the approval gate. Once review_decision becomes APPROVED, this can fall through to a normal approval.
Why human review
- Touches gated paths under static/schemas/source/** with review_decision=REVIEW_REQUIRED — human/CODEOWNERS approval required before merge: accept-proposal-request.json, buy-products-request.json, media-buy-commitment-response.json
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/media-buy/accept-proposal-request.json (modified) matches
static/schemas/source/**; static/schemas/source/media-buy/buy-products-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/media-buy-commitment-response.json (modified) matchesstatic/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.
Summary
buy_productsandaccept_proposal(the 3.2 compact create path) had no way to set the shared human-readablenamedisplay label thatcreate_media_buy/update_media_buyalready accept and persist — the compact lifecycle (feat(media-buy): add compact AdCP 3.2 lifecycle #6115) merged one day beforenamewas added to the orchestrated tools (feat(media-buy): add shared media buy name #6573) and was never updated to match. A buyer on the compact path had exactly one way to set the label: a follow-upcontrol_media_buyrevision, costing a revision bump for somethingcreate_media_buysets inline.nametobuy-products-request.jsonandaccept-proposal-request.jsonwith the same constraints (minLength: 1,maxLength: 255,pattern: "\S") and MUST-persist/MUST-echo wording ascreate-media-buy-request.json, and to the sharedmedia-buy-commitment-response.json'sCommitted Media Buybranch — placed outsideaccepted_proposal, matching howcontrol_media_buyalready framesnameas operational metadata, not a covered component of the accepted terms orterms_digest.accept_proposal'snameadditionally states precedence per the issue's suggested resolution: a request value wins; when absent, sellers MAY seed the MediaBuy name from the accepted proposal's ownname(bounded to 255 characters —proposal.nameallows up to 500) and MUST then report it on read surfaces like any persisted name.proposal.nameis seller-authored and describes the plan under negotiation, not the buy that was booked, so it's a fallback default, not a substitute.tests/media-buy-name-contract.test.cjsto guard all three new surfaces under the same shared-contract assertions the existing six surfaces already use (255-char bound, MUST-persist obligation, "not an identifier or financial reference" framing), plus a dedicated test foraccept_proposal's terms-digest exclusion and proposal-seeding precedence language.buy_products.mdx,accept_proposal.mdx, andmedia-buy/lifecycle.mdx— making explicit thatnameis not in the documented lossy-on-compact-path list, closing the ambiguity the issue raised.Implements the maintainer-approved (
bokelley, "Status: ready-to-implement") scope from the issue's own triage comment.Closes #7536.
Verification
node tests/media-buy-name-contract.test.cjsand the fullnode tests/composed-schema-validation.test.cjs(466/466) pass.Cannot read properties of undefined (reading 'description')and a regex-match failure; restoring the fix makes all pass.npm run test:schemasandnpm run test:json-schema(281/281$schema-tagged doc examples, including the two updated docs snippets) both pass.npm run typecheckclean.node scripts/check-changeset-protocol-scope.cjs origin/mainpassed.npm run lint:schema-linksclean.npm run precommit(10800+ unit/schema/storyboard tests + typecheck) passed clean.🤖 Generated with Claude Code