Repository navigation
fix(training-agent): count the product's declarations when routing a manifest - #8991
KonstantinMirin wants to merge 2 commits into
Conversation
The /sales training agent accepted a manifest without format_option_ref on a product that declares its format_kind two or more times. On sync_creatives it created and assigned the manifest. On create_media_buy it counted the package's selection, so a package that selected one option through format_option_refs let an inline or assigned manifest through. Reject that manifest with format_option_ref_required on both paths, counting the target product's format_options. The assignment-operations test creatives now name the catalog display product's 300x250 option, since that product declares several image options. Refs adcontextprotocol#8625
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — training-agent manifest routing fix, app-only change.
Checked:
missingFormatOptionRefViolation(task-handlers.ts:14-27) correctly counts the product's fullformat_optionssourced fromproductMap.get/productValidationMap.get, not the package's frozen selection. Behavior matches the #8625 ruling.validateAssignedCreativeis wired into all five create_media_buy/sync_creatives call sites.- Negative tests each have a ref-only control.
- App-only training-agent change; no
static/schemas/source/**or normative docs touched, so no changeset required and no schema↔docs coherence concern.
No blocking or medium findings. Not a protocol/breaking-class change. gated_paths is false and no author team gate applies — falls through to approve (row 9). Note: review_decision is REVIEW_REQUIRED, but gated_paths is false so the hard approval gate does not apply.
…ormat_option_ref The product-scoped and publisher-scoped paths sent inline creatives with format_kind alone, to a product that can declare several options of that kind. Each creative now carries the captured declaration as its format_option_ref, as the package's format_option_refs already does, with scope injected through context_inputs.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean compliance-scenario change with correct changeset.
The delta touches four files: a patch changeset, server/src/training-agent/task-handlers.ts, an assignment-operations unit test, and the inline_creatives_without_sync.yaml compliance scenario. The scenario adds format_option_ref: "$context.canonical_declaration" to the four product-/publisher-scoped inline-creative phases, each with a matching scope-only context_inputs injection — the documented DSL workaround for lack of object-spread. Placement is correct: refs land only in phases whose skip_if guarantees a routable format_option_id, and the unnamed-option phase is correctly left without one.
No schema change under static/schemas/source/**, so no docs-coherence or oneOf-discriminator exposure. Only static/compliance/source/** is touched (no dist/immutable-artifact mutation). Changeset is present, scoped, and typed as patch for a non-breaking change. No governance-precedent conflict and no breaking-class change.
Gate checks: gated_paths false, high_risk false, no no-auto-approve team match, review_decision REVIEW_REQUIRED (no gate forces escalation here since gated_paths is false). Prior decision was approve; this run adds no critical/high/medium findings. No decision-table row 1–8 fires → row 9 approve.
* Count the product's declarations when routing a manifest The /sales training agent accepted a manifest without format_option_ref on a product that declares its format_kind two or more times. On sync_creatives it created and assigned the manifest. On create_media_buy it counted the package's selection, so a package that selected one option through format_option_refs let an inline or assigned manifest through. Reject that manifest with format_option_ref_required on both paths, counting the target product's format_options. The assignment-operations test creatives now name the catalog display product's 300x250 option, since that product declares several image options. Refs #8625 * fix(compliance): route inline_creatives_without_sync manifests with format_option_ref The product-scoped and publisher-scoped paths sent inline creatives with format_kind alone, to a product that can declare several options of that kind. Each creative now carries the captured declaration as its format_option_ref, as the package's format_option_refs already does, with scope injected through context_inputs. * fix(training-agent): check format_option_ref on update_media_buy update_media_buy now applies the adcp#8625 routing rule that #8991 added to sync_creatives and create_media_buy. When two or more of the target product's format_options share a format_kind, a manifest without format_option_ref or format_id is rejected with format_option_ref_required. Covered: inline creatives and creative_assignments on packages[], and inline creatives and creative_assignments on new_packages[]. Stored assignments on a targeting-only package update are not re-checked. The packages[] assignment check now reads the library as this update leaves it, so an inline re-send that adds format_option_ref is accepted.
|
Closing as superseded: #9005 was built on this branch and merged first, so every code change here is already on main. The only conflict left is the tail of |
Follow-up to #8625, after #8876.
Brian's ruling on #8625: when two or more of the target product's
format_optionsshare aformat_kind, a manifest withoutformat_option_refis rejected, and the count is the product's declarations. The /sales training agent did not follow that in two places:sync_creativescreated and assigned the manifest. It never checked for the missing ref.create_media_buycounted the package's frozen selection. A package that picks one option withformat_option_refskeeps one image declaration, so an inline or assigned manifest without the ref went through.This PR makes both paths count the product's declarations. A manifest with no
format_option_refand no legacyformat_id, whoseformat_kindappears two or more times in the product'sformat_options, getsformat_option_ref_requiredwith the matching option IDs asexpected. Onsync_creativesthat coversassignment_operations, the deprecatedassignmentsshorthand, and the re-sync of an already assigned creative. Oncreate_media_buyit covers inlinecreativesandcreative_assignmentsof library creatives.The training agent, and one storyboard.
inline_creatives_without_syncsent its product-scoped and publisher-scoped inline creatives withoutformat_option_ref, to a product that can declare several options of the sameformat_kind(playfield_standardon /sales declares six image options). Under this rule both its create and update steps would be rejected. All four steps now route the manifest with the captured declaration, the same way the package'sformat_option_refsalready does, withscopeinjected throughcontext_inputs. The steps don't run on /sales today, because the run stops at the skipped legacy step, so CI results don't change. A patch changeset records the storyboard change.The
sync_creatives.mdxsentence is left to Brian. The storyboard step is #8876's (canonical_manifest_routing); this PR adds no storyboard phase. Merge it after #8876.Tests
server/tests/unit/assignment-operations.test.tsseeds a product with two image declarations (300x250 and 728x90) and sends a 300x250 manifest with and withoutformat_option_ref:sync_creatives: the routed manifest is assigned. The unrouted one is rejected with both options on the package and with the package selecting the 300x250 option. The deprecatedassignmentsshorthand reports it as a failed assignment.create_media_buy, with the package selecting the 300x250 option: the routed inline manifest and the routed library creative are accepted. Without the ref, both are rejected.Each negative test has an accepted control that differs only in the ref. On main the five negative tests fail and the rest pass. With only the
sync_creativeschange, the twocreate_media_buynegatives still fail.The existing assignment-operations creatives target the catalog display product, which declares several image options. They now name its 300x250 option in
format_option_ref.Checks
canonical_manifest_routingphase passes against the /sales agent, as it does on docs(creative): require format_option_ref for repeated format_kind #8876 alone. docs(creative): require format_option_ref for repeated format_kind #8876's step sends no package selector, which the agent already rejected. This PR covers the case where the package selects one option.