Repository navigation
fix(media-buy): close canonical Product gaps for targeting resolution, collections, and reporting offerings - #7813
Conversation
…, collections, and reporting offerings The compact Product (core/canonical-product.json, additionalProperties: false) returned by list_products and the proposal lifecycle could not carry fields the compact lifecycle already relies on: - targeting_resolution: #6115 created the canonical Product, then #6203 added targeting_resolution to the legacy Product only. The discovery criteria, request_proposals response, and list_products/request_proposals docs direct sellers to disclose overlay changes through Product.targeting_resolution.modifications, which was schema-invalid on canonical. Added with the legacy $ref; a draft-07 dependencies rule requires expires_at (the legacy if/then also requires is_custom, which canonical does not have). - reporting_capabilities.reporting_delivery_offering_ids: reporting delivery applicability resolves through every selected product's offering IDs and absence MUST NOT be inferred from the seller-wide list, so a compact buyer could never prove an offering applies. Added with the legacy semantics. - collections and collection_targeting_allowed: canonical already assumed them (supports_collection_breakdown, collection-selection partial selection). Added mirroring legacy, including the rule that overlay_support.collection_list requires collection_targeting_allowed: true. product-fields.json gains the three new product fields and states that targeting_resolution/expires_at (with modifications) and collection_targeting_allowed (with overlay_support.collection_list) override projection. The names move out of get_products' legacy-only enum, which still accepts them through the shared $ref. is_custom stays deliberately absent from canonical: docs for list_products, request_proposals, product discovery, and the targeting-aware discovery migration now say expires_at marks request-specific configured offers on the compact lifecycle; get_products docs are unchanged. Per-product audience_activation (with an audience_activation_methods filter) and canonical installments are deferred to 3.3 in Known Limitations. Training agent: the list_products projection now emits collections, collection_targeting_allowed, targeting_resolution, and reporting_delivery_offering_ids, and no longer emits is_custom (including with a targeting_overlay). get_products output is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated schema paths require human/CODEOWNERS approval.
This PR modifies published protocol source under static/schemas/source/**, which sits behind a hard, path-based approval gate (gated_paths: true). The current review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied and the PR cannot auto-approve (decision rule row 2).
The reviewer's findings are clean: this is an additive, coherence-restoring change closing four canonical Product gaps (targeting_resolution, collections/collection_targeting_allowed, reporting_delivery_offering_ids) with correct minor+patch changesets, verified schema↔docs coherence, unchanged get_products acceptance, and legacy parity in tests. No Critical/High/Medium findings. Absent the gate this would fall through to approve — but the gate stands until a human/CODEOWNERS approval is recorded.
Escalation reasons
- Touches gated schema source requiring human/CODEOWNERS review:
static/schemas/source/core/canonical-product.json,static/schemas/source/core/canonical-reporting-capabilities.json,static/schemas/source/media-buy/get-products-request.json,static/schemas/source/media-buy/product-fields.json.review_decisionisREVIEW_REQUIRED— a real approval is required before merge.
Why human review
- Gated paths touched (static/schemas/source/**) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge for: canonical-product.json, canonical-reporting-capabilities.json, get-products-request.json, product-fields.json
- 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-reporting-capabilities.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/get-products-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/product-fields.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.
The Python SDK export consolidation rejected a new name collision: ReportingDeliveryOfferingId was defined in both core.reporting_capabilities and core.canonical_reporting_capabilities, because both carried the same inline item schema. Move the item to core/reporting-delivery-offering-id.json (same minLength, maxLength, pattern, and x-entity) and reference it from both, so the generator emits the type once. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated paths touched and review not yet approved.
This PR modifies files under static/schemas/source/**, which is a hard, non-overridable approval gate (gated_paths: true), and the current review_decision is REVIEW_REQUIRED, not APPROVED. Per decision table row 2, the outcome must be escalate (no blocking findings exist to make it request-changes).
Escalation reasons
static/schemas/source/core/canonical-product.json,canonical-reporting-capabilities.json,reporting-capabilities.json,reporting-delivery-offering-id.json,get-products-request.json,product-fields.json— protocol schema source under a hard approval gate; human/CODEOWNERS approval required before merge.
Findings
Reviewer reported a clean delta pass: the reporting_delivery_offering_ids item shape was extracted into a shared core/reporting-delivery-offering-id.json referenced by $ref, preserving string constraints verbatim (minLength 1, maxLength 128, pattern, x-entity). Validation-equivalent, no wire change, no oneOf regression, no docs drift, changeset present. No critical/high/medium findings.
The diff is mechanically clean, but the gate is deterministic and only lifts once review_decision becomes APPROVED. Prior decision was also escalate for the same gated-path reason; the escalation stands until a human/CODEOWNERS review is recorded.
Why human review
- Gated paths touched (static/schemas/source/**) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge for: canonical-product.json, canonical-reporting-capabilities.json, reporting-capabilities.json, reporting-delivery-offering-id.json, get-products-request.json, product-fields.json
- 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-reporting-capabilities.json (modified) matchesstatic/schemas/source/**; static/schemas/source/core/reporting-capabilities.json (modified) matchesstatic/schemas/source/**; static/schemas/source/core/reporting-delivery-offering-id.json (added) matchesstatic/schemas/source/**; static/schemas/source/media-buy/get-products-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/product-fields.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.
Problem
core/canonical-product.jsonis the closed (additionalProperties: false) Product returned bylist_productsand the proposal lifecycle. #7805 made the training agent drop legacy-only keys so itslist_productsoutput validates. A review of that PR found four canonical gaps that were not deliberate:targeting_resolutionwas lost between two merges. feat(media-buy): add compact AdCP 3.2 lifecycle #6115 created the canonical Product; feat(media-buy): add targeting-aware product discovery #6203 then addedtargeting_resolutionto the legacycore/product.jsononly. The compact lifecycle still tells sellers to disclose overlay changes throughProduct.targeting_resolution.modifications: theproduct-discovery-criteria.jsontargeting_overlaydescription,request-proposals-response.json("remain on Product.targeting_resolution"),list_products.mdx, andrequest_proposals.mdx. Because canonical couldn't carry the field, a seller that changed the overlay had no schema-valid way to say so.reporting_capabilities.reporting_delivery_offering_ids(feat(reporting): add managed reporting status schemas #6953) existed on legacycore/reporting-capabilities.jsononly.core/reporting-delivery-config.jsonresolves applicability through "every selected product'sreporting_capabilities.reporting_delivery_offering_ids", and absence MUST NOT be inferred from the seller-wide list. A compact-only buyer could therefore never prove that an offering applies.collections/collection_targeting_allowed. Canonical already assumed both:canonical-reporting-capabilitieshassupports_collection_breakdown, andcollection-selection.jsonsays partial selection requirescollection_targeting_allowed: true. Without them, a compact buyer couldn't see a product's collections or build aselected-modecollection_selectiononbuy_products.is_customis deliberately absent from canonical: feat(media-buy): add targeting-aware product discovery #6203 moved request-specific offers to opaque expiring IDs, and canonical hasexpires_at. Several compact-lifecycle docs, and the training agent'slist_productswith atargeting_overlay, still used it.Changes
Schemas
core/canonical-product.json:targeting_resolution($ref: /schemas/core/product-targeting-resolution.json), with a compact-lifecycle description;expires_atwhenevertargeting_resolutionis present. Legacy expresses this as anallOfif/then that also requiresis_custom: true. The schemas are draft-07, which has nodependentRequired, so this uses draft-07dependencies(already used bylist-products-request.jsonandfrequency-cap.json, which the SDK generators already consume);collections(collection-selector.json+ requiredcollection_ids,minItems: 1, identical items to legacy) andcollection_targeting_allowed(boolean, defaultfalse);overlay_support.collection_listrequirescollection_targeting_allowed: true;expires_ata description saying it is what marks a canonical offer as request-specific.core/canonical-reporting-capabilities.json: adds the optionalreporting_delivery_offering_idsarray, identical to legacy (same pattern andx-entity; an empty array means no managed offering; absence means unknown and MUST NOT be inferred from the seller-wide list).core/reporting-delivery-offering-id.json(new): holds the offering-ID item shape, and both reporting-capabilities schemas$refit. The constraints andx-entityare unchanged. The first push failed the Python SDK job's collision guard becauseReportingDeliveryOfferingIdwas defined in bothcore.reporting_capabilitiesandcore.canonical_reporting_capabilities. This follows feat(media-buy): add a cost target to criteria.outcome_target #7778's fix: give the shape its own schema file.media-buy/product-fields.json(thelist_productsfieldsenum):targeting_resolution,collections, andcollection_targeting_allowed;targeting_resolution/expires_atwhenever the seller returns modifications, andcollection_targeting_allowedwhenever returnedoverlay_supportdeclarescollection_list. The second is needed so a narrow projection stays schema-valid.media-buy/get-products-request.json: removes those three names from the legacy-onlyfieldsbranch.get_productsstill accepts them through the sharedproduct-fields.json#/items$ref, so the accepted set is unchanged.Docs (
is_customclarification)list_products.mdx,request_proposals.mdx, andproduct-discovery/index.mdx: on the compact lifecycle,expires_atmarks request-specific configured products, and compact products have nois_custom.reference/migration/targeting-aware-discovery.mdx:is_custom: truetoget_products;list_productsand the proposal lifecycle carry nois_custom;expires_atidentifies request-specific configured offers."get_products/media-productsdocs keepis_custom.Deferred to 3.3 (new "Compact product lifecycle" section in
docs/reference/known-limitations.mdx):audience_activationon canonical, together with a matchingaudience_activation_methodsoffer filter. Neither exists on the compact lifecycle; the seller-wideget_adcp_capabilities.media_buy.audience_targeting.supported_activation_methodsremains;installments.installment.jsonstill carries the deprecatedcollection_idshorthand and should be reshaped tocollection_ref-only first.Training agent (
server/src/training-agent/task-handlers.ts)COMPACT_PRODUCT_FIELDSnow includescollectionsandcollection_targeting_allowedand dropsis_custom.targeting_resolution(always withexpires_at) andreporting_capabilities.reporting_delivery_offering_idsnow validate and flow through. The reporting projection already reads the canonical schema's property list.targeting_overlayno longer forcesis_custominto the projection.overlay_support.collection_listpullscollection_targeting_allowedinto a narrowerfieldsprojection.get_productsoutput is unchanged.Tests
training-agent-list-products-canonical.test.ts, extended. It now checks that:collections,collection_targeting_allowed, andreporting_delivery_offering_idsmatchget_productsfor every default-catalog product that has them;fieldsprojection still carries them;is_customnever appears onlist_products, with or without atargeting_overlayorfields;targeting_resolutionwithexpires_at;training-agent.test.ts: the targetedlist_productstest now asserts nois_customand canonical validity. The collection projection test is restored to expect collections onlist_products, and it still asserts thatinstallmentsstays out.targeting-aware-discovery.test.cjs: canonicaltargeting_resolutionrequiresexpires_atand rejectsis_custom; parity with legacy for the$refandreporting_delivery_offering_ids.collection-selection-echo.test.cjs: canonical collections require explicitcollection_ids; thecollection_list→collection_targeting_allowed: truerule; parity with legacy.Verification
test:schemas,test:examples,test:composed,test:json-schema,test:oneof-discriminators,test:mcp-schema-projection,lint:schema-links,docs:json-field-audit(0 new findings),test:targeting-aware-discovery,test:collection-selection-echo, andtest:canonical-reference-resolver.audio-radio-formats,execution-requirements,identity-absence-coherence, andseller-governance-policy-surfaces.node --test tests/test-coverage-registration.test.cjsandnpm run typecheckpass.list_productsgrew, by 68 bytes.npm run build:compliance, then the storyboards onsales, before (origin/main) and after:compact_product_lifecycleavailability_windowsproduct_coverage_filterscompact_direct_buy_lifecycleoutcome_target_list_products_inerttargeting_aware_discoverycollection_selectionowner_sold_channel_carriageAll runs were clean, with 0 failed, skipped, or not applicable. The collection storyboards (
collection_selection,owner_sold_channel_carriage) andtargeting_aware_discoveryexerciseget_products, whose output is unchanged. The canonicallist_productschanges are covered by the compact storyboards and the extended vitest suite.Notes for the maintainer
collection_list→collection_targeting_allowed: truerule rejects a canonical product that declaresoverlay_support.collection_listwithout the flag. Before this PR, canonical couldn't carry the flag at all, so such a product was already incoherent undercollection-selection.json.request_proposalsstill returns supporting products as{ product_id, name }only, so it doesn't surfacetargeting_resolutionthere even though the schema now allows it.🤖 Generated with Claude Code