Repository navigation
fix(adapters): declare output slot in creative formats per creative-manifest.json:14 - #1511
Conversation
…anifest.json:14 Both worked creative adapters were keying their build_creative output against asset_ids that weren't declared in the format. Per creative-manifest.json:14: "Each key MUST match an asset_id from the format's assets array." Caught by PE in two rounds of expert review on PR #1508. - hello_creative_adapter_template.ts — new `outputSlot(t)` helper returns the right FormatAsset.{html,javascript,vast,audio}({ asset_id: 'serving_tag', required: false }) based on template.output_kind. templateToFormat appends it to format.assets[] alongside the input slots. Tightened the projectRenderToManifest doc-comment now that serving_tag IS declared. - hello_creative_adapter_ad_server.ts — projectFormat declares FormatAsset.html({ asset_id: 'tag', required: false }) on every format (ad-server always emits HTML serving tags in this worked example). buildCreative response's `tag` key now matches a declared slot. - skills/build-creative-agent/SKILL.md — audio adopter checklist gains a step 2 covering the outputSlot extension. Pure additive at the wire — formats grow by one `required: false` slot; input requests don't change shape. Adopters forking either adapter now inherit a spec-aligned declaration. Validated: fork-matrix 23/23, typecheck + format clean. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ss gate Two single-reviewer findings from the round-1 expert review: PE: align ad-server's `tag` asset_id with template's `serving_tag` so adopters across both worked examples see the same contract. The asset_id is declared by the format, not platform-flavored — divergent names teach the wrong story. Renamed in projectFormat (output slot declaration), buildCreative response (`assets['serving_tag']`), and the doc-comment. CR: outputSlot(t) switch over output_kind had no default. TypeScript exhaustiveness holds today (closed union of four literals), but adopters extending the upstream type per the SWAP comment will get a function that returns undefined and silently push undefined into format.assets[]. Added an assertNever-style default arm so the next output_kind extension fails compile, not runtime. Filed adcontextprotocol/adcp#4021 for the upstream spec gap PE flagged: format.assets[] doesn't currently distinguish input slots (buyer-provided) from output-only slots (build_creative-produced). `required: false` is the closest legal expression today but understates the constraint. When the spec lands an `output_only` flag or `produced_by` enum, both adapters will adopt it. Validated: fork-matrix 23/23, typecheck + format clean. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Expert review summary (one round, two reviewers)Per No convergent blockers. Two single-reviewer fixes worth doing, both addressed in commit
Upstream spec issue filed: adcontextprotocol/adcp#4021 — PE caught that Final state
|
|
Acknowledged — review summary noted. Both reviewers converged, blockers addressed in Generated by Claude Code |
|
Acknowledged — noted, no action taken. Generated by Claude Code |
Pulls in 2 commits: - fix(testing/storyboard): symmetric account resolution on update_media_buy enricher (closes #1505) (#1509) - fix(adapters): declare output slot in creative formats per creative-manifest.json:14 (#1511) Conflict resolution: - test/examples/hello-seller-adapter-guaranteed.test.js: main re-added a #1417 entry. 3.0.6 closes #1417 from the fixture side (adcp#3990) and the storyboard runs unfiltered against 3.0.6, so the post-bump state remains EXPECTED_FAILURES = []. - test/examples/hello-seller-adapter-non-guaranteed.test.js: kept the longer-form `reason` text on the #1416 entry — explains both the SDK helper status (shipped in #1427) and the non-guaranteed adopter gap (not yet wired) so the next reader knows where the work belongs. Verified post-merge: - npm run build clean - npm run test:lib — 6027/6027 pass - 6/6 hello-adapter tests for the modified files green - npm run format:check clean Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Closes the asset-key spec-drift PE flagged in two rounds of expert review on PR #1508.
Per
schemas/cache/3.0.5/core/creative-manifest.json:14:Both worked creative adapters were violating this:
hello_creative_adapter_template.ts— declared input slots (image,headline,script,click_through), then keyedbuild_creativeoutput asassets['serving_tag']— never declared.hello_creative_adapter_ad_server.ts— declared zero asset slots in the format, then keyed output asassets['tag']— also never declared.Adopters forking either pattern would inherit non-spec-conformant manifests. The previous PR (#1508) added a doc-comment acknowledging the drift; this PR closes it.
Changes
examples/hello_creative_adapter_template.tsoutputSlot(t)helper. Returns the rightFormatAsset.{html,javascript,vast,audio}({ asset_id: 'serving_tag', required: false })based ontemplate.output_kind.templateToFormatappends it toformat.assets[]alongside input slots.projectRenderToManifesttightened —serving_tagis now a declared slot, no longer "adopter-defined."examples/hello_creative_adapter_ad_server.tsFormatAssetfrom@adcp/sdk.projectFormatdeclaresFormatAsset.html({ asset_id: 'tag', required: false })on every format. The ad-server adapter always renders to HTML serving tags in this worked example; video/CTV adopters emitting VAST swap inFormatAsset.vast(...).buildCreativenotes thetagkey matches the declared slot.skills/build-creative-agent/SKILL.mdoutputSlotextension. Each step now cites why it's required.Adopter impact
Pure additive at the wire — formats grow by one
required: falseslot. Existing input requests don't change shape. Buyers readingget_formatsee the output slot they didn't see before, which is an improvement (now they can resolve the rendered output'sasset_typefrom the format).Test plan
npm run compliance:fork-matrix— 23/23 in ~10snpm run typecheckcleannpm run format:checkclean🤖 Generated with Claude Code