Skip to content

fix(examples/multi_platform_seller): list_creatives populates query_summary#521

Merged
bokelley merged 1 commit into
mainfrom
bokelley/fix-mock-query-summary
May 4, 2026
Merged

fix(examples/multi_platform_seller): list_creatives populates query_summary#521
bokelley merged 1 commit into
mainfrom
bokelley/fix-mock-query-summary

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 4, 2026

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 implement list_creatives at all, and the wire contract requires query_summary on every response.

This PR adds list_creatives to both MockGuaranteedPlatform and MockNonGuaranteedPlatform. Each mock now:

  • Persists creatives at sync_creatives time into an in-memory library (_creatives: dict[str, dict] keyed by creative_id)
  • Returns the full library on list_creatives with the required query_summary block (total_matching, returned) and pagination block (has_more=False, total_count)
  • Projects each item to the schemas/3.0.6/creative/list-creatives-response.json Creative shape: {creative_id, name, format_id, status: "approved", created_date, updated_date}

Auto-approval (status: "approved") mirrors the existing sync_creatives policy 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/ — clean
  • mypy src/adcp/ — clean (777 source files)
  • pytest tests/ -x -q — 3760 passed, 32 skipped, 1 xfailed
  • Functional sanity: ListCreativesResponse.model_validate(...) accepts the output on both mocks across empty-library and populated-library cases
  • CI storyboard run on tenant-a + tenant-b — verifies list_creatives_before_cancel now passes

Refs

🤖 Generated with Claude Code

…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>
@bokelley bokelley merged commit c7cfe6f into main May 4, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(examples/multi_platform_seller): list_creatives response missing required query_summary

1 participant