Repository navigation
docs(contributing): worked-example-first for new specialisms + three-gate test contract - #1394
Merged
Merged
Conversation
…gate test contract Two doc gaps surfaced from the PR #1373 lineage. Closes #1389. ## CONTRIBUTING.md — "Adding a new specialism" Reverses the obvious order on purpose: skill prose written before a worked example tends to drift as the spec evolves; pattern-from-example doesn't, because the test gates fail. The order: 1. Mock-server with deterministic-seeded fixtures (fictional brand names — `acme-outdoor.example`, NOT real walled-garden brands). 2. `examples/hello_<role>_adapter_<specialism>.ts` worked adapter with `// SWAP:` markers + a `FORK CHECKLIST` header. 3. `test/examples/hello-<role>-adapter-<specialism>.test.js` using `runHelloAdapterGates()` — three gates per the test contract. 4. Skill update — fork-target pointer, NOT inline pattern teaching. 5. Add to fork-target map + composition guide. 6. Optional: hello-cluster aspirational entrypoint. The order matters: building the worked example surfaced ~12 distinct adapter-author bugs (#1324, #1325, #1327, #1337, #1338, #1341, plus 7 more) that would have been caught by the blind-LLM matrix eventually but weren't. Worked-example-first compresses that loop. ## docs/guides/EXAMPLE-TEST-CONTRACT.md (new) Documents the three-gate CI test contract enforced by `runHelloAdapterGates()`: Gate 1 — Strict tsc (`--strict --noUncheckedIndexedAccess --exactOptionalPropertyTypes --noPropertyAccessFromIndexSignature` + 2 hardening flags). Catches type-level mistakes at authorship. Gate 2 — Storyboard runner. Catches AdCP wire-shape regressions. Gate 3 — Façade gate (`/_debug/traffic` shows ≥1 hit per expected upstream route). Catches "wired the AdCP surface but didn't call upstream" — invisible to gates 1 and 2. Includes the adversarial-sabotage validation pattern (sabotage one upstream call, confirm the right gate fails — confirms each gate is independently load-bearing) and guidance on when to add a fourth gate (adapter-specific invariants like the BuyerAgentRegistry auth ordering check in signal-marketplace's test). ## Helper JSDoc `runHelloAdapterGates.js` JSDoc now references the contract guide so contributors land on the right doc when reading the helper before adding a new adapter. Test plan: - [x] `npm run format:check` clean - [x] No code-path changes; doc-only + JSDoc. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 3, 2026
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.
Summary
Closes #1389. Two contributor-facing doc gaps from the PR #1373 lineage:
CONTRIBUTING.md— "Adding a new specialism": a 6-step process putting the worked example before skill prose. Reverses the obvious order on purpose — building the worked examples in examples: hello_seller_adapter_signal_marketplace — worked passing reference #1274 + feat(examples): hello_{creative,seller,signals}_adapter_* — complete the worked-reference family #1373 surfaced ~12 adapter-author bugs that skill-prose-first would have missed for longer.docs/guides/EXAMPLE-TEST-CONTRACT.md(new): documents the three-gate CI test contract (strict tsc / storyboard / façade) implemented byrunHelloAdapterGates(). Covers what each gate catches, the adversarial-sabotage validation pattern (which proves each gate is independently load-bearing), and when to add a fourth gate (adapter-specific invariants like the BuyerAgentRegistry auth-ordering check in signal-marketplace's test).runHelloAdapterGates.jsJSDoc updated to point at the new guide.Test plan
Refs
🤖 Generated with Claude Code