Skip to content

fix(examples): fix 6 storyboard compliance gaps in seller_agent.py#308

Closed
bokelley wants to merge 3 commits intomainfrom
claude/issue-304-seller-agent-storyboard-fixes
Closed

fix(examples): fix 6 storyboard compliance gaps in seller_agent.py#308
bokelley wants to merge 3 commits intomainfrom
claude/issue-304-seller-agent-storyboard-fixes

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Refs #304

Fixes items 1–6 from the issue punch list. Item 7 (seed_product controller stub) is deferred pending #296, which adds the seed_* dispatcher to TestControllerStore. The controller_detected: true target also depends on #282 landing.

What changed in examples/seller_agent.py:

  1. Idempotency capabilityadcp.idempotency is required by the capabilities schema; added idempotency={"supported": False} to capabilities_response(). Without it the runner silently downgrades to v2 mode.
  2. get_media_buys missing total_budget — schema required: ["total_budget"]; added sum of package budgets (or 0 for flat-rate packages).
  3. create_media_buy status lifecycle — return pending_creatives when no per-package creatives or creative_assignments are supplied at create time; active otherwise. Checks both creative-attachment paths on the input request packages.
  4. list_creative_formats renders schemarole is required; width/height must be nested under dimensions. Changed bare {"width": W, "height": H} to {"role": "primary", "dimensions": {"width": W, "height": H}}.
  5. list_creative_formats filter ignored — honor format_ids request parameter; filter on compound (agent_url, id) key per format-id.json schema; absent means return all.
  6. update_media_buy missing PACKAGE_NOT_FOUND — validate package_id existence when a packages update is requested; return PACKAGE_NOT_FOUND for unknown IDs (per error-code.json canonical code). Note: this reference implementation validates but does not apply budget/targeting writes back — a production seller should merge update fields into the stored package.

What was tested

  • pytest tests/ -q --ignore=tests/conformance/signing/test_ip_pinned_transport.py --ignore=tests/integration2132 passed, 0 failures (no tests touch examples/, suite clean)
  • python -c "import ast; ast.parse(open('examples/seller_agent.py').read())" — syntax OK
  • examples/ is excluded from ruff and mypy per pyproject.toml

Pre-PR review

  • code-reviewer: approved — no CI-blocking issues; two fixes applied from review (static error message in PACKAGE_NOT_FOUND to avoid user-data in LLM-visible error context per adcp_error docstring; .get() in format_ids filter to avoid KeyError on malformed input)
  • ad-tech-protocol-expert: approved — all 6 items schema-sound; blocker fixed (creative_assignments path now covered alongside creatives in has_creatives check; confirmed exhaustive per package-request.json schema)

Nits surfaced (not fixed — follow-up candidates)

  • update_media_buy silently accepts valid packages update payloads but discards the field writes; a production seller should merge pkg_update fields back into stored packages (comment added in-code)
  • total_budget: 0.0 is schema-valid (minimum: 0) for flat-rate-only catalogs but may surprise implementors — inline comment added

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_01GDFGtecoKD34z3KmZ4GuML


Generated by Claude Code

claude added 3 commits April 30, 2026 00:16
Addresses items 1–6 from #304. Item 7 (seed_product controller stub)
is deferred pending #296.

- Declare `idempotency: {supported: false}` in capabilities (required
  by spec; runner downgrades to v2 mode without it)
- Add `total_budget` to get_media_buys results (required schema field)
- Return `pending_creatives` from create_media_buy when no per-package
  creatives supplied (AdCP v3 lifecycle)
- Fix list_creative_formats renders: add required `role` field and nest
  width/height under `dimensions` object per 3.0.1 schema
- Honor `format_ids` filter in list_creative_formats using compound
  (agent_url, id) key match
- Return PACKAGE_NOT_FOUND from update_media_buy when packages param
  references unknown package IDs

https://claude.ai/code/session_01GDFGtecoKD34z3KmZ4GuML
…atus

Per protocol expert pre-PR review: `creatives` (raw upload) and
`creative_assignments` (library assign) are both valid at create time.
Only checking `creatives` would incorrectly yield `pending_creatives`
for buyers that pre-attach library creatives via `creative_assignments`.

https://claude.ai/code/session_01GDFGtecoKD34z3KmZ4GuML
- Use static error message in PACKAGE_NOT_FOUND (no user-supplied data
  in adcp_error messages per helpers.py docstring)
- Use .get() in format_ids filter to avoid KeyError on malformed input
- Add comment clarifying pkg validation intentionally omits field writes
- Add comment on has_creatives reading params (not built packages)

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

Superseded by #310 — same 6-item fix but with cleaner field-order priority (creative_assignments or creatives per AdCP v3) and valid_actions populated on pending_creatives responses (caught in triage re-review).

@bokelley bokelley closed this Apr 30, 2026
@bokelley
Copy link
Copy Markdown
Contributor Author

Acknowledged — #310 supersedes this PR with the creative_assignments or creatives field-order fix and valid_actions on pending_creatives responses. No further action needed here.


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.

2 participants