Skip to content

fix(examples/multi_platform_seller): add list_creatives + query_summary to both mock platforms#526

Closed
bokelley wants to merge 1 commit intomainfrom
claude/issue-510-list-creatives-query-summary
Closed

fix(examples/multi_platform_seller): add list_creatives + query_summary to both mock platforms#526
bokelley wants to merge 1 commit intomainfrom
claude/issue-510-list-creatives-query-summary

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 4, 2026

Closes #510

Summary

Both MockGuaranteedPlatform and MockNonGuaranteedPlatform were missing a list_creatives method, causing storyboard validation to fail with 'query_summary' is a required property. The list-creatives-response.json schema requires each creative item to carry creative_id, name, format_id, status, created_date, and updated_date.

Changes:

  • Add self._synced_creatives: dict[str, dict] to both __init__ (keyed by creative_id so idempotency-replay re-syncs upsert rather than accumulate duplicates)
  • Restructure sync_creatives in both mocks to store the creative items (with all required list-response fields) inside the same lock block as buy-status mutation
  • Add list_creatives method to both mocks using list_creatives_response(values, sandbox=False), which auto-fills created_date/updated_date and builds the required query_summary/pagination envelope
  • Non-guaranteed mock preserves its double-transition (pending_creatives → pending_start → active)

What was tested

  • ruff check src/ tests/test_multi_platform_seller.py — clean
  • mypy src/adcp/ — clean (777 source files)
  • pytest tests/ -q --ignore=tests/conformance/signing/test_ip_pinned_transport.py — 3749 passed, 0 new failures (the ignored test is a pre-existing sandbox TLS failure unrelated to this change)
  • 13 new unit tests in tests/test_multi_platform_seller.py covering: empty-list query_summary/pagination shape, synced-creative round-trip, all required fields present, name fallback, dedup on re-sync of same creative_id, sandbox=False in response

Pre-PR review:

  • code-reviewer: approved — blockers (idempotency dedup, sandbox=False) addressed before PR; nits (module-level _DEFAULT_FORMAT_ID constant) noted below
  • dx-expert: approved — pattern (import helper → store in sync → read in list) is the right mental model for adopters; sandbox=False explicit per blocker fix

Known nits (not fixed here to keep scope tight):

  • The format_id fallback dict {"agent_url": "https://creative.adcontextprotocol.org/", "id": "display_300x250"} is inlined in both mock files rather than extracted to a module-level constant. Acceptable for example code; extracting it is a cosmetic follow-up.
  • _synced_creatives is not filtered by account (the storyboard uses single-tenant instances, so cross-contamination can't occur in the current topology; comment noting this added inline)

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_015eWELLixehtjTexkZ3ahvr


Generated by Claude Code

…ry to both mock platforms

Both MockGuaranteedPlatform and MockNonGuaranteedPlatform were missing a
list_creatives method, causing storyboard validation to fail with
'query_summary' is a required property. The JSON schema requires creative
items to carry creative_id, name, format_id, status, created_date, and
updated_date.

- Store approved creatives in _synced_creatives (dict keyed by creative_id)
  inside the same lock block as buy-status mutation in sync_creatives,
  so idempotency replays upsert rather than accumulate duplicates
- list_creatives returns list_creatives_response(values, sandbox=False)
  which fills created_date/updated_date and builds the required
  query_summary and pagination envelope
- 13 new unit tests cover: empty-list schema shape, synced-creative
  round-trip, required-field presence, name fallback, dedup on re-sync,
  and sandbox=False

Fixes #510

https://claude.ai/code/session_015eWELLixehtjTexkZ3ahvr
@bokelley
Copy link
Copy Markdown
Contributor Author

bokelley commented May 4, 2026

Superseded by #521 (fix(examples/multi_platform_seller): list_creatives populates query_summary), already merged to main.

@bokelley bokelley closed this May 4, 2026
@bokelley bokelley deleted the claude/issue-510-list-creatives-query-summary branch May 4, 2026 08:51
@bokelley
Copy link
Copy Markdown
Contributor Author

bokelley commented May 4, 2026

Acknowledged — noted that this PR is superseded by #521, already merged to main.


Generated by Claude Code

@bokelley
Copy link
Copy Markdown
Contributor Author

bokelley commented May 4, 2026

Confirmed — #521 covers the same fix and is already on main. No further action needed here.


Generated by Claude Code


Generated by Claude Code

@bokelley
Copy link
Copy Markdown
Contributor Author

bokelley commented May 4, 2026

Acknowledged — noted that #521 landed the same fix on main. This PR can remain closed.


_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.

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

2 participants