fix(examples): fix 6 storyboard compliance gaps in seller_agent.py#308
Closed
fix(examples): fix 6 storyboard compliance gaps in seller_agent.py#308
Conversation
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
Contributor
Author
|
Superseded by #310 — same 6-item fix but with cleaner field-order priority ( |
Contributor
Author
|
Acknowledged — #310 supersedes this PR with the Generated by Claude Code |
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.
Refs #304
Fixes items 1–6 from the issue punch list. Item 7 (
seed_productcontroller stub) is deferred pending #296, which adds theseed_*dispatcher toTestControllerStore. Thecontroller_detected: truetarget also depends on #282 landing.What changed in
examples/seller_agent.py:adcp.idempotencyis required by the capabilities schema; addedidempotency={"supported": False}tocapabilities_response(). Without it the runner silently downgrades to v2 mode.get_media_buysmissingtotal_budget— schemarequired: ["total_budget"]; added sum of package budgets (or 0 for flat-rate packages).create_media_buystatus lifecycle — returnpending_creativeswhen no per-packagecreativesorcreative_assignmentsare supplied at create time;activeotherwise. Checks both creative-attachment paths on the input request packages.list_creative_formatsrenders schema —roleis required;width/heightmust be nested underdimensions. Changed bare{"width": W, "height": H}to{"role": "primary", "dimensions": {"width": W, "height": H}}.list_creative_formatsfilter ignored — honorformat_idsrequest parameter; filter on compound(agent_url, id)key performat-id.jsonschema; absent means return all.update_media_buymissingPACKAGE_NOT_FOUND— validatepackage_idexistence when apackagesupdate is requested; returnPACKAGE_NOT_FOUNDfor unknown IDs (pererror-code.jsoncanonical 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/integration— 2132 passed, 0 failures (no tests touchexamples/, suite clean)python -c "import ast; ast.parse(open('examples/seller_agent.py').read())"— syntax OKexamples/is excluded fromruffandmypyperpyproject.tomlPre-PR review
PACKAGE_NOT_FOUNDto avoid user-data in LLM-visible error context peradcp_errordocstring;.get()informat_idsfilter to avoidKeyErroron malformed input)creative_assignmentspath now covered alongsidecreativesinhas_creativescheck; confirmed exhaustive perpackage-request.jsonschema)Nits surfaced (not fixed — follow-up candidates)
update_media_buysilently accepts validpackagesupdate payloads but discards the field writes; a production seller should mergepkg_updatefields back into stored packages (comment added in-code)total_budget: 0.0is schema-valid (minimum: 0) for flat-rate-only catalogs but may surprise implementors — inline comment addedSession: https://claude.ai/code/session_01GDFGtecoKD34z3KmZ4GuML
Generated by Claude Code