Skip to content

ci: add webhooks guide consistency guard - #56

Closed
a-essawy wants to merge 1 commit into
mainfrom
claude/webhooks-guide-guard-r95c4f
Closed

ci: add webhooks guide consistency guard#56
a-essawy wants to merge 1 commit into
mainfrom
claude/webhooks-guide-guard-r95c4f

Conversation

@a-essawy

Copy link
Copy Markdown
Contributor

What

Adds a small guard, scripts/check-webhooks-guide.mjs, that asserts guides/webhooks.mdx still matches the canonical webhook contract, and wires it into the validate workflow + package.json alongside the existing frontmatter / nav / plan-limit guards.

Why

The webhooks guide was just rewritten to remove stale content (for example a del_ delivery-id example that should be whd_, and a fictitious extract.metadata job). This guard keeps it from silently drifting again.

What it checks (36 assertions)

  • Every event in the catalog is documented, and no event outside it is (catches renamed/removed events)
  • All five X-Rendobar-* delivery headers are present
  • Delivery id uses whd_, and the old del_ never comes back
  • Envelope fields (version, event, deliveryId, timestamp, orgId, data)
  • Retry backoff numbers (10 / 20 / 40 / 80 / 160 s)
  • Verification leads with verifyWebhook() from @rendobar/sdk/webhooks, and documents the {timestamp}.{body} signed string
  • SDK methods the guide shows (rotateSecret, retryDelivery) plus the dashboard Send Test action
  • The 10-endpoint limit and the dashboard link
  • No em-dash / en-dash in prose (writing-style rule), code samples excluded

The contract values are embedded in the script (the docs repo does not vendor the monorepo), with the monorepo source files named in the header so they are updated together.

Run

npm run validate:webhooks
# 36/36 checks passed.
# ✓ webhooks guide matches the webhook contract.

Passes locally against current main, as does the full existing validator suite.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ajz7odbJunsbosNj81M2Pi


Generated by Claude Code

Adds scripts/check-webhooks-guide.mjs, which asserts guides/webhooks.mdx still
matches the canonical webhook contract (event catalog, delivery headers, whd_
delivery id, envelope fields, retry backoff, verifyWebhook usage, SDK methods,
endpoint limit). Wired into the validate workflow and package.json alongside the
existing frontmatter/nav/plan-limit guards so the guide can't silently drift.
@a-essawy a-essawy closed this Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant