Skip to content

docs(examples): expand hello_seller.py to full 9-method sales-non-guaranteed surface#531

Merged
bokelley merged 4 commits into
mainfrom
claude/issue-515-hello-seller-9-method-surface
May 4, 2026
Merged

docs(examples): expand hello_seller.py to full 9-method sales-non-guaranteed surface#531
bokelley merged 4 commits into
mainfrom
claude/issue-515-hello-seller-9-method-surface

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 4, 2026

Closes #515

Summary

hello_seller.py implemented only the five hard-required sales-non-guaranteed methods, causing validate_platform to 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_SPECIALISM on an explicit promotion path to REQUIRED_METHODS_PER_SPECIALISM; the example should reflect the full required shape that adopters will need.

Changes:

  • Add stub implementations for all four soft-required methods, each returning the minimal valid wire shape with clear docstrings directing adopters to wire production systems
  • Update module and class docstrings: correct "five required" → "nine required", add hard/soft distinction ("soft-required", pointer to RECOMMENDED_METHODS_PER_SPECIALISM), fix stale "3 implemented" → "9 seller methods" in list-tools walkthrough
  • Add dispatch-path smoke tests for all four new stubs + a validate_platform assertion confirming HelloSeller passes with zero soft-warns

What tested

  • pytest tests/test_hello_seller_integration.py — 12 passed (7 pre-existing + 5 new)
  • Full suite: 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 methods
  • python -c "import ast; ast.parse(open('examples/hello_seller.py').read())" — syntax OK

Pre-PR review

  • code-reviewer: approved — no blockers after second pass. Found and fixed: stale "3 implemented" count, D1 projection signatures verified correct (all four use standard (req, ctx)), test coverage gap → addressed with 5 new tests.
  • dx-expert: approved direction — stubs clearly annotated as wiring targets, section comment uses "recommended (rc.1+ staging)" language consistent with RECOMMENDED_METHODS_PER_SPECIALISM naming.
  • docs-expert: approved — module docstring correctly distinguishes hard/soft with "hard-fail for the five, soft-warn for the four"; section comment updated to "recommended" to match map name; ADCP_DECISIONING_STRICT_VALIDATE_PLATFORM=1 CI guidance added.

Nits surfaced (not fixed — PR scope):

  • sales.py per-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.

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_01SQEG3PCARK4eKHBbqu4fTS


Generated by Claude Code

claude added 3 commits May 4, 2026 01:14
…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
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>
@bokelley bokelley marked this pull request as ready for review May 4, 2026 02:07
…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>
@bokelley bokelley force-pushed the claude/issue-515-hello-seller-9-method-surface branch from 217ee0c to cdfec5a Compare May 4, 2026 02:12
@bokelley bokelley merged commit 7d21302 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

decisioning: align hello_seller.py with validate_platform soft-warn surface

2 participants