feat(compat): v2.5 list_creative_formats + preview_creative adapters; deprecate spec_compat_hooks (stage 5)#667
Merged
Conversation
… deprecate spec_compat_hooks
Stage 5 of the versioned-schema-validation port.
Two more v2.5 adapters, plus the deprecation warning on the legacy hook
factory. The remaining three adapters (``get_products``,
``create_media_buy``, ``update_media_buy``) ship in Stage 5b — they
depend on substantial pricing-adapter and creative-adapter helper
ports that warrant their own audit.
New adapters:
* ``list_creative_formats``: request pass-through; response rewrites
v2.5 top-level ``width``/``height``/``dimensions`` into the v3
``renders: [{render_id, role, dimensions}]`` array.
* ``preview_creative``: request pass-through; response renames
``output_id``/``output_role`` to ``render_id``/``role`` on every
preview render.
Direct ports of ``src/lib/utils/format-renders.ts`` and
``src/lib/utils/preview-normalizer.ts`` in the JS SDK.
``spec_compat_hooks()`` now emits a DeprecationWarning pointing at
``adcp.compat.legacy``. The implementation moved into a private
``_spec_compat_hooks_impl`` so the existing test suite can exercise
the legacy behaviour without poisoning pytest's warning filters.
Removal target: 6.0.
Tests:
* 10 list_creative_formats tests
* 10 preview_creative tests
* 2 deprecation tests
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 5 of the versioned-schema-validation port. Follow-up to #658/#659/#664/#665.
What's in scope
Two more v2.5 adapters + the spec_compat_hooks deprecation warning.
New adapters
list_creative_formats— request pass-through. Response rewrites v2.5 top-levelwidth/height/dimensionsinto the v3renders: [{render_id, role, dimensions}]array. Handles template formats (no dims), bare-array responses, and v3-already-shape (idempotent).preview_creative— request pass-through. Response renames v2.5output_id/output_roleto v3render_id/roleon every preview render. v3 names win when both present (half-migrated servers don't double-translate). Single-response and batch-response shapes both handled.Direct ports of
src/lib/utils/format-renders.tsandsrc/lib/utils/preview-normalizer.tsin the JS SDK.spec_compat_hooks()deprecationCalling
spec_compat_hooks()now emits aDeprecationWarningpointing atadcp.compat.legacy. The implementation moved into a private_spec_compat_hooks_implso the existing test suite can exercise the legacy behaviour without poisoning pytest's warning filters. Removal target: 6.0.Stage 5b will
Port the remaining three v2.5 adapters:
get_products— relies onpricing-adapter.ts(~400 lines in JS, handlesfixed_price↔rate,floor_price↔price_guidance.floor,is_fixeddiscriminator)create_media_buyandupdate_media_buy— sharecreative-adapter.ts(~300 lines in JS, handlescreative_ids↔creative_assignments, null-array coercion, proposal-mode lossy handling)Each deserves its own PR for reviewer audit.
Stage 4b will
Bundle the real v2.5 JSON schemas (pinned GitHub SHA) so the dispatcher can validate buyer input against v2.5 before the adapter runs. Today the dispatcher only validates the adapter output (against v3).
Test plan
pytest tests/ -q --ignore=tests/integration— 4475 passedruff check+mypy src/spec_compat_hooks()calltest_spec_compat_hooks.pymigrated to use_spec_compat_hooks_impl(no warning noise)🤖 Generated with Claude Code