Skip to content

docs(examples): webhook wiring recipe — handler-authoring section + expanded hello_seller + new with_webhooks example#551

Merged
bokelley merged 2 commits intomainfrom
claude/issue-546-webhook-wiring-docs
May 4, 2026
Merged

docs(examples): webhook wiring recipe — handler-authoring section + expanded hello_seller + new with_webhooks example#551
bokelley merged 2 commits intomainfrom
claude/issue-546-webhook-wiring-docs

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 4, 2026

Closes #546

Summary

Three non-breaking documentation and examples changes that together close the silent-no-op trap for first-time DecisioningPlatform adopters:

  • docs/handler-authoring.md: adds a new ## Webhooks section covering the three sender constructors (comparison table), the sender-vs-supervisor distinction, a wiring snippet, and cross-links to the migration guide and the new example. The section makes docs/handler-authoring.md#webhooks a live anchor (previously the issue proposed linking there but the section didn't exist).
  • examples/hello_seller.py: expands the three-line "wire webhook_sender= in production" note into a full three-constructor menu with import lines, a JWK field reminder, and a link to docs/handler-authoring.md#webhooks.
  • examples/hello_seller_with_webhooks.py (new): ~57-LOC runnable wiring example using WebhookSender.from_bearer_token + InMemoryWebhookDeliverySupervisor, the first copy-paste-ready path from bare handler to production-grade webhooks.

Note: the boot-time fail-fast (validate_webhook_sender_for_platform) was already shipping as a hard AdcpError raise — this PR closes the documentation gap that let adopters reach that error without knowing how to resolve it.

What was tested

  • pytest (3866 passed, 32 skipped, 1 pre-existing network test failure on signing/test_ip_pinned_transport.py::test_real_tls_handshake_still_validates_hostname — unrelated to this PR, pre-exists on main)
  • mypy src/adcp/ — 878 errors, identical to main (no source files changed)
  • ruff check src/ — all checks passed

Pre-PR review

Two expert passes were run (blockers fixed before final sign-off):

  • code-reviewer: approved — prior blocker (silent dev-fixture-token fallback) resolved with warnings.warn; 1 nit noted in PR body
  • dx-expert: approved — prior blocker (from_jwk kwargs mismatch) resolved; kid/alg/adcp_use now correctly documented as JWK dict fields

Nits surfaced (not fixed):

  • examples/README.md does not list hello_seller_with_webhooks.py — consistent with how other hello_seller_*.py variants are handled (none appear to be individually listed); can be addressed in a follow-on README update pass.

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_01Ay2SJvRpBg8EP9nG9DgQMy


Generated by Claude Code

claude added 2 commits May 3, 2026 22:45
…ller + new with_webhooks example

Closes #546

Three changes to eliminate the silent-no-op trap for first-time
DecisioningPlatform adopters:

1. docs/handler-authoring.md: adds a ## Webhooks section (sender
   constructors table, sender-vs-supervisor explanation, wiring snippet,
   link to migration guide) so the doc anchor used in example comments
   actually exists.

2. examples/hello_seller.py: expands the bare "wire webhook_sender= in
   production" note into a full three-constructor menu with import lines
   and a link to docs/handler-authoring.md#webhooks.

3. examples/hello_seller_with_webhooks.py: new ~40-LOC example showing
   the canonical bearer-token + InMemoryWebhookDeliverySupervisor wiring
   pattern — the first copy-paste-ready path to production webhooks.

The boot-time fail-fast (validate_webhook_sender_for_platform) was already
shipping as a hard raise; this PR closes the documentation gap that let
adopters reach that error without knowing how to resolve it.

https://claude.ai/code/session_01Ay2SJvRpBg8EP9nG9DgQMy
…OOK_BEARER_TOKEN

Pre-PR review blockers:
- from_jwk takes a JWK dict; kid/alg/adcp_use live inside the dict, not as
  separate kwargs. Fix the doc table and hello_seller.py comment accordingly.
- hello_seller_with_webhooks.py now warns (instead of silently continuing)
  when WEBHOOK_BEARER_TOKEN is unset, so developers discover the dev-fixture
  default rather than running a production server with it.

https://claude.ai/code/session_01Ay2SJvRpBg8EP9nG9DgQMy
@bokelley bokelley force-pushed the claude/issue-546-webhook-wiring-docs branch from de6d17a to ba38f21 Compare May 4, 2026 02:46
@bokelley bokelley marked this pull request as ready for review May 4, 2026 02:46
@bokelley bokelley merged commit 6cf71cb 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.

Webhook wiring: boot-time fail-fast + brighter docs when auto_emit_completion_webhooks is on without a sender

2 participants