docs(examples): expand hello_seller.py to full 9-method sales-non-guaranteed surface#531
Merged
Merged
Conversation
…ranteed surface The canonical example tripped validate_platform soft-warns for four SalesPlatform Protocol methods required in v6.0 rc.1+: get_media_buys, list_creative_formats, list_creatives, provide_performance_feedback. A "hello world" example that emits warnings at boot teaches adopters to ignore validator signal — the opposite of the fail-fast contract. Add minimal stub implementations for all four methods, each clearly annotated to wire to the adopter's inventory/analytics system in production. Update module and class docstrings to correctly state the 9-method required surface rather than the stale "five required methods" count. validate_platform now passes clean with zero soft-warns. Closes #515 https://claude.ai/code/session_01SQEG3PCARK4eKHBbqu4fTS
…docstrings Address pre-PR review findings: module docstring said '3 implemented' (stale after expanding to 9 methods) and described the four rc.1+ methods as simply 'required' without the hard/soft qualifier. Fix both: update list-tools bullet to '9 seller methods', add 'soft-required' language with pointer to RECOMMENDED_METHODS_PER_SPECIALISM, and update the section comment to use 'recommended' terminology consistent with the map name and env-var guidance. https://claude.ai/code/session_01SQEG3PCARK4eKHBbqu4fTS
Add dispatch-path smoke tests for get_media_buys, list_creative_formats, list_creatives, and provide_performance_feedback, plus a validate_platform assertion that HelloSeller passes with zero soft-warns. Addresses pre-PR code-reviewer finding: zero coverage for the new stubs left regression paths silent. Also align class docstring to say 'soft-required' consistently with the module docstring and section comment. https://claude.ai/code/session_01SQEG3PCARK4eKHBbqu4fTS
2 tasks
bokelley
added a commit
that referenced
this pull request
May 4, 2026
…ate tests Per review on #531: - list_creatives stub returned {"creatives": []} which is missing the spec-required query_summary and pagination fields. A buyer hitting the running example would get a non-conformant ListCreativesResponse. Now returns a minimal valid envelope with an explanatory docstring pointing adopters at the post-filter count and cursor state. - Smoke tests now run ``Response.model_validate(resp)`` against the canonical Pydantic model so spec drift fails the test, not just dict-key presence. - Class docstring lede: "all nine required methods" → "all nine methods" (four are soft-required, distinction is two lines below). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e tests Per review on #531: - list_creatives stub returned {"creatives": []} which is missing the spec-required query_summary and pagination fields. A buyer hitting the running example would get a non-conformant ListCreativesResponse. Now returns a minimal valid envelope with an explanatory docstring pointing adopters at the post-filter count and cursor state. - Smoke tests now run ``Response.model_validate(resp)`` against the canonical Pydantic model so spec drift fails the test, not just dict-key presence. - Class docstring lede: "all nine required methods" -> "all nine methods" (four are soft-required, distinction is two lines below). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
217ee0c to
cdfec5a
Compare
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.
Closes #515
Summary
hello_seller.pyimplemented only the five hard-requiredsales-non-guaranteedmethods, causingvalidate_platformto soft-warn about four additional SalesPlatform Protocol methods staged for hard-required status at v6.0 rc.1 GA (get_media_buys,list_creative_formats,list_creatives,provide_performance_feedback). A canonical example that emits warnings at boot teaches adopters to ignore validator signal — the opposite of the fail-fast contract.Decision: Expand the example (option 1 from the issue). The four methods are in
RECOMMENDED_METHODS_PER_SPECIALISMon an explicit promotion path toREQUIRED_METHODS_PER_SPECIALISM; the example should reflect the full required shape that adopters will need.Changes:
RECOMMENDED_METHODS_PER_SPECIALISM), fix stale "3 implemented" → "9 seller methods" in list-tools walkthroughvalidate_platformassertion confirming HelloSeller passes with zero soft-warnsWhat tested
pytest tests/test_hello_seller_integration.py— 12 passed (7 pre-existing + 5 new)pytest tests/ -m "not integration"— 3759 passed, 0 regressions (1 pre-existing TLS environment failure unrelated to this change:test_real_tls_handshake_still_validates_hostname)validate_platform(HelloSeller())— zero soft-warns for the four recommended methodspython -c "import ast; ast.parse(open('examples/hello_seller.py').read())"— syntax OKPre-PR review
(req, ctx)), test coverage gap → addressed with 5 new tests.RECOMMENDED_METHODS_PER_SPECIALISMnaming.ADCP_DECISIONING_STRICT_VALIDATE_PLATFORM=1CI guidance added.Nits surfaced (not fixed — PR scope):
sales.pyper-method docstrings for the four methods still say "Required … validate_platform fails server boot" (hard-required language). These live in the Protocol file, not the example. Separate cleanup issue warranted.Session: https://claude.ai/code/session_01SQEG3PCARK4eKHBbqu4fTS
Generated by Claude Code