Skip to content

feat(creative): add validated reference preview utilities - #2601

Merged
bokelley merged 2 commits into
mainfrom
feat/reference-renderer-carousel-validation
Aug 18, 2026
Merged

feat(creative): add validated reference preview utilities#2601
bokelley merged 2 commits into
mainfrom
feat/reference-renderer-carousel-validation

Conversation

@bokelley

@bokelley bokelley commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • extend the dependency-free, Apache-2.0 @adcp/reference-renderers package with strict structured preparation and rendering for canonical image and image_carousel manifests
  • expand only explicitly declared preview macros, expose the exact media/navigation network plan, reject unsafe URLs and contract mismatches, and mount complete inert documents in a capability-minimal iframe
  • label every package rendering as a non-authoritative community reference presentation
  • preserve renderer provenance through SDK preview normalization and add a pure SDK helper implementing the seller → publisher provider → publisher presentation → community reference → manifest authority order

Protocol relationship

This complements adcontextprotocol/adcp#6653. The registry remains metadata-only: it points at exact package versions/exports and never serves executable renderer code. This package does not fetch a registry, dynamically load code, or execute creative-provided scripts.

Protocol-generated preview metadata and discovery types should be synced in the normal SDK schema update after #6653 merges and is published; this PR deliberately does not hand-edit generated types.

Validation

  • npm run build
  • npm run typecheck
  • SDK authority, compatibility, and complete Zod schema tests: 248 passed
  • npm run check --workspace=@adcp/reference-renderers: 18 passed; strict publint passed
  • focused Prettier check
  • npx changeset status --since=origin/main
  • repository pre-push validation

This opens the contribution for review only. It does not publish a package, merge a release, or make the separate community announcement owed by the release.

Comment thread packages/reference-renderers/structured.js
aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Aug 18, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — additive PR extending @adcp/reference-renderers with structured image/image_carousel validation + rendering, a capability-minimal iframe mount helper, and a pure SDK preview-authority selector plus renderer-provenance passthrough.

Checked:

  • Fail-closed design (declared-macro-only substitution, HTTPS-only URLs, empty-sandbox iframe) — consistent with witness-not-translator posture.
  • Two correct minor changesets present for the src/lib/** and package changes; type matches wire impact.
  • Well-tested new branches; validation plan was actually run.

Medium findings (1):

  • packages/reference-renderers/structured.js:589 — Retina carousel card images rejected: card media validated with empty params, over-rejecting valid retina (pixel_ratio) card images. A real edge case worth fixing, but a single medium finding with no blocking trigger.

Decision path: no critical/high findings (row 1 n/a); gated_paths false (row 2 n/a); high_risk false (rows 3/5 n/a); the sole medium is a rendering edge case, not data-loss/schema/infra (row 4 n/a); no prior escalation (row 6 n/a); no no-auto-approve team match (row 7 n/a); only 1 medium finding, below the 3-medium threshold (row 8 n/a). Falls through to row 9 → approve.

Note: review_decision is REVIEW_REQUIRED but gated_paths is false, so the hard approval gate (row 2) does not apply.

Medium findings

  • packages/reference-renderers/structured.js:589 — Retina carousel card images rejected: card media validated with empty params

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — follow-up pass on the reference-renderers carousel/image work.

The prior medium finding (structured.js:589 — Retina carousel card images rejected because card media was validated with empty params) is resolved: imageDimensions now accepts a useAssetPixelRatio option that honors the asset's own pixel_ratio and skips the empty-params CONSTRAINT_VIOLATION, while negative pixel_ratio and card aspect-ratio conformance stay enforced. New tests cover Retina density, non-square dimensions, landing-page navigation fallback, and with-copy layout; navigation fallback is consistent across index.js and structured.js. Changesets present for the src/lib and reference-renderers changes.

No new findings in this run. No blocking findings, no escalation triggers (gated_paths false, high_risk false, no team gate), and fewer than three medium findings. Net improvement over the prior approve — falls through to row 9.

@bokelley
bokelley merged commit 0de0f08 into main Aug 18, 2026
47 of 49 checks passed
@bokelley
bokelley deleted the feat/reference-renderer-carousel-validation branch August 18, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant