feat: add reference_assets to product_card_detailed - #5583
feat: add reference_assets to product_card_detailed#5583garvitkaushik-123 wants to merge 3 commits into
Conversation
Adds a typed `reference_assets` array to `product_card_detailed` so sellers can surface coverage maps, sample renders, environment photos, and media kits through a recognized schema slot rather than opaque extension fields. New schema: core/product-card-reference-asset.json - role enum: coverage_map, sample_render, environment_photo, media_kit, logo, other - asset: discriminated union over image, video, markdown, url assets - role_label: required when role is "other" Non-breaking: all fields optional, existing consumers unaffected. Closes adcontextprotocol#5539 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
The automated review encountered an issue (possibly reached max turns, timed out, or failed to post the final gh pr review). A human reviewer should take this PR.
This is an automated message from the Argus AI review workflow.
| }, | ||
| "role_label": { | ||
| "type": "string", | ||
| "description": "Human-readable label for the asset role. Required when role is 'other'; optional otherwise." |
There was a problem hiding this comment.
Medium: The description claims role_label is "Required when role is 'other'", but the schema does not encode that — no if/then, and role_label is absent from required. A seller emitting {"role": "other"} with no label validates clean, and buyer agents get an unlabeled other slot. The stated contract and the enforced contract diverge. Encode it: "if": {"properties": {"role": {"const": "other"}}}, "then": {"required": ["role_label"]}. Otherwise soften the prose to "SHOULD provide."
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated schema path requires human/CODEOWNERS review.
This PR is additive: it adds an optional reference_assets array to product_card_detailed and introduces a new core/product-card-reference-asset.json schema for typed seller collateral. The changeset is present and correctly minor; schema↔docs are coherent (roles table matches the enum, example matches the field shape); the asset oneOf is discriminated via asset_type const on all four referenced asset schemas, so the oneOf audit does not regress; no released dist/** artifact is touched.
There is one Medium finding (below), but that is not the blocker. The blocker is the hard approval gate: this PR modifies static/schemas/source/** (gated_paths: true) and review_decision is REVIEW_REQUIRED, not APPROVED. Per decision-table row 2, the outcome must be escalate — human/CODEOWNERS review of the schema change is required before merge.
Medium findings
- static/schemas/source/core/product-card-reference-asset.json:22 —
role_labelis documented as required-when-otherbut that conditional is not encoded in the schema.
Escalation reasons
- Touches gated path
static/schemas/source/core/product-card-reference-asset.jsonandstatic/schemas/source/core/product.json;review_decisionis REVIEW_REQUIRED, so a human/CODEOWNERS approval is required before this can merge.
Medium findings
- static/schemas/source/core/product-card-reference-asset.json:22 — role_label 'required when other' is stated but not encoded
Why human review
- Gated path: static/schemas/source/core/product-card-reference-asset.json (added) and static/schemas/source/core/product.json (modified) are under a hard approval gate; review_decision is REVIEW_REQUIRED (not APPROVED), so human/CODEOWNERS review is required before merge.
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/product-card-reference-asset.json (added) matches
static/schemas/source/**; static/schemas/source/core/product.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 schema paths require human/CODEOWNERS approval.
This PR adds static/schemas/source/core/product-card-reference-asset.json and modifies static/schemas/source/core/product.json, both under a hard, non-overridable approval gate (static/schemas/source/**). gated_paths is true and review_decision is not APPROVED (unknown/none), so Row 2 of the decision table forces escalation regardless of how clean the diff is.
Iteration credit: The prior run's single medium finding — role_label 'required when other' stated but not encoded (product-card-reference-asset.json:22) — has been resolved. The delta adds an allOf/if/then that encodes the constraint: the if branch requires role and matches const other (so an absent role is fail-safe and does not trigger), and the then branch requires role_label. The reviewer surfaced no new findings in this pass. This is a net improvement over the prior review.
There are no critical/high/medium findings blocking on the merits — the only barrier is the deterministic approval gate. Once a human/CODEOWNERS approval is recorded (review_decision: APPROVED), this can proceed normally.
Escalation reasons:
static/schemas/source/core/product-card-reference-asset.json(added) andstatic/schemas/source/core/product.json(modified) are under a hard approval gate (static/schemas/source/**);review_decisionis not APPROVED, so human/CODEOWNERS review is required before merge.
Why human review
- Gated path: static/schemas/source/core/product-card-reference-asset.json (added) and static/schemas/source/core/product.json (modified) are under a hard approval gate (static/schemas/source/**); review_decision is not APPROVED, so human/CODEOWNERS review is required before merge.
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/product-card-reference-asset.json (added) matches
static/schemas/source/**; static/schemas/source/core/product.json (modified) matchesstatic/schemas/source/**) and the current GitHub review decision is 'unknown', 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
reference_assets[]toproduct_card_detailedfor typed seller collateral (coverage maps, sample renders, environment photos, media kits)core/product-card-reference-asset.jsonwith closedroleenum (coverage_map,sample_render,environment_photo,media_kit,logo,other) androle_labelescape hatch forotherimage-asset,video-asset,markdown-asset,url-asset— reuses canonical asset primitives without pulling in the fullasset-union.json(which includes serving/tracking types inappropriate for product-card collateral)media-products.mdxwith reference assets section and examplePer @bokelley's direction: nested inside
product_card_detailed(Option B), not a new top-level field.Non-breaking: all fields optional, existing consumers unaffected.
Closes #5539
Test plan
npm run buildpasses (validates$refchains)minor(new optional array field)🤖 Generated with Claude Code