fix(examples/multi_platform_seller): list_creatives populates query_summary#521
Merged
Conversation
…ummary (closes #510) Both MockGuaranteedPlatform and MockNonGuaranteedPlatform were missing list_creatives entirely. The storyboard step ``creative_fate_after_cancellation/list_creatives_before_cancel`` fails for both tenants on the post-#508 artifact because the wire contract requires query_summary on every list_creatives response. Fix: each mock now persists creatives at sync_creatives time into an in-memory library keyed by creative_id, and list_creatives returns them with the required ``query_summary`` (total_matching, returned) and ``pagination`` (has_more=False, total_count) blocks. Per-item Creative shape projects to the schemas/3.0.6/creative/list-creatives-response.json contract: {creative_id, name, format_id, status: "approved", created_date, updated_date}. Auto-approval mirrors the existing sync_creatives policy on both mocks. Pagination is intentionally trivial (returns the full library) — the storyboard catalog is small and modeling cursor-based paging adds noise without illustrating new platform-shape concerns. Validated: ListCreativesResponse.model_validate accepts the output on both mocks; full pytest suite stays green (3760 passed). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Closes #510. Surfaced by PR #508's storyboard artifact: post-#508, both tenants still fail one storyboard step —
creative_fate_after_cancellation/list_creatives_before_cancel— because the mocks didn't implementlist_creativesat all, and the wire contract requiresquery_summaryon every response.This PR adds
list_creativesto bothMockGuaranteedPlatformandMockNonGuaranteedPlatform. Each mock now:sync_creativestime into an in-memory library (_creatives: dict[str, dict]keyed bycreative_id)list_creativeswith the requiredquery_summaryblock (total_matching,returned) andpaginationblock (has_more=False,total_count)schemas/3.0.6/creative/list-creatives-response.jsonCreative shape:{creative_id, name, format_id, status: "approved", created_date, updated_date}Auto-approval (
status: "approved") mirrors the existingsync_creativespolicy on both mocks. Pagination is intentionally trivial — the storyboard catalog is small and modeling cursor-based paging would add noise without illustrating a new platform-shape concern.Expected delta
Per-tenant pass count should go up by 1 (one storyboard step now passes per tenant). The remaining 3 failures per tenant are blocked on #509 (MCP error projection), per the issue.
Test plan
ruff check examples/multi_platform_seller/— cleanmypy src/adcp/— clean (777 source files)pytest tests/ -x -q— 3760 passed, 32 skipped, 1 xfailedListCreativesResponse.model_validate(...)accepts the output on both mocks across empty-library and populated-library caseslist_creatives_before_cancelnow passesRefs
🤖 Generated with Claude Code