Repository navigation
fix(client): sync_creatives — preserve manifest, strip asset_type - #1174
Conversation
0dab9c2 to
7f9ecc9
Compare
7f9ecc9 to
f07756c
Compare
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]>
f07756c to
e76c8f9
Compare
Admin merge rationaleSame The conformance fixture for sync_creatives keeps its |
|
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 Generated by Claude Code |
|
Noted — tracking acknowledged. No further action needed on this PR. Generated by Claude Code Generated by Claude Code |
Closes #1173
Summary
PR #1118 introduced a flatten step in
adaptSyncCreativesRequestForV2that 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.5creative-asset.jsonschema declaresassetsusingpatternPropertieskeyed 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_typeand siblings.This PR reverts the flatten:
src/lib/utils/sync-creatives-adapter.ts— removesisManifestShape+ the extract-first-role branch +console.warn;assetsnow passes through verbatimsrc/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 fixsrc/lib/adapters/legacy/v2-5/types.ts— removes stale#1116reference in registry commenttest/lib/sync-creatives-adapter.test.js— replaces two "manifest flattening" describe blocks (encoding the wrong contract) with an "assets pass-through" block asserting manifest preservationtest/lib/adapter-v2-5-conformance.test.js— flips thesync_creativesfixture fromexpected_failurespin to a standard passing assertion.changeset/sync-creatives-manifest-flattener.md— corrects the changeset description to describe the revert, not the original flattenNits surfaced by pre-PR review (not fixed — low signal):
sync-creatives-manifest-flattener.md) still implies the flattener, not the revert. Filename is not user-facing; content is accurate.asset-instances.ts).What was tested
npm run format:check— cleannpx tsc --project tsconfig.lib.json— pre-existing TS2688/TS5107 deprecation warnings unchanged from mainnpm run build:lib— cleannode --test test/lib/sync-creatives-adapter.test.js— 19/19 passtest/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 wheresync-schemas:allpopulates the bundlePre-PR review
sync_creatives.tsandtypes.ts) fixed before push; nits noted abovepatternPropertieskeyed-role shape confirmed against generated types insrc/lib/types/v2-5/tools.generated.tslines 2131–2148; non-breaking per specSession: https://claude.ai/code/session_012FDPBrTs3LfmW9MHuJSAYn
Generated by Claude Code