The root CLAUDE.md lists this under Deferred, deliberately, with the stated trigger: "Add it the next time one of those samples is found to have drifted, the same way this gap itself was found."
That happened twice in PR #49.
1. docs/reference/temporal.md carried TemporalActivities(orderContract)([orderFulfillment]). Once the example contract gained a second workflow, chargeOrder was uncovered and the sample was refused by the very gate the page documents three paragraphs above:
error TS2769: No overload matches this call.
Type 'Provider<PortInstance<"TemporalWorkflowActivities:fulfillOrder", …>>'
is not assignable to type '"UNCOVERED ACTIVITIES"'.
2. docs/how-to/run-a-temporal-worker.md had the same defect, in a different shape — its monolithic-record sample listed only fulfillOrder for a contract that now declares two workflows. Its composition-root sample below it also needed BillingModule, so fixing the first alone would have moved the error down the page.
Three further pages (docs/reference/amqp.md, docs/how-to/consume-amqp-messages.md, docs/how-to/read-the-ambient-unit.md) used a consumer key that a rename had removed — not stale prose, invalid TypeScript.
All five were caught only because each sample was compiled by hand in a scratch file and deleted, per the repo's stated practice. One of them survived a commit literally titled "compile the last broken worker sample". That is the argument for a gate: the practice works exactly as well as the person applying it that day.
packages/core/src/docs-examples.test-d.ts is the shape to copy. The four packages without one are @btravstack/http, @btravstack/temporal, @btravstack/amqp and @btravstack/observability.
Note the constraint that makes this non-trivial: these samples import real example workspaces, so the test file cannot live in the package (that would invert the dependency direction — packages/* must not depend on examples/*). packages/core's version works because its samples are kernel-only. The likely home is a test file inside each matching example workspace, or a workspace of its own that depends on the examples.
Acceptance
- Every TypeScript sample in
docs/reference/{http,temporal,amqp,observability}.md and the matching how-to pages is compiled by a checked-in type test, not by hand.
- The test runs under
pnpm typecheck so a contract change that breaks a sample fails the gate.
- The Deferred, deliberately entry in the root
CLAUDE.md is removed once it lands.
The root
CLAUDE.mdlists this under Deferred, deliberately, with the stated trigger: "Add it the next time one of those samples is found to have drifted, the same way this gap itself was found."That happened twice in PR #49.
1.
docs/reference/temporal.mdcarriedTemporalActivities(orderContract)([orderFulfillment]). Once the example contract gained a second workflow,chargeOrderwas uncovered and the sample was refused by the very gate the page documents three paragraphs above:2.
docs/how-to/run-a-temporal-worker.mdhad the same defect, in a different shape — its monolithic-record sample listed onlyfulfillOrderfor a contract that now declares two workflows. Its composition-root sample below it also neededBillingModule, so fixing the first alone would have moved the error down the page.Three further pages (
docs/reference/amqp.md,docs/how-to/consume-amqp-messages.md,docs/how-to/read-the-ambient-unit.md) used a consumer key that a rename had removed — not stale prose, invalid TypeScript.All five were caught only because each sample was compiled by hand in a scratch file and deleted, per the repo's stated practice. One of them survived a commit literally titled "compile the last broken worker sample". That is the argument for a gate: the practice works exactly as well as the person applying it that day.
packages/core/src/docs-examples.test-d.tsis the shape to copy. The four packages without one are@btravstack/http,@btravstack/temporal,@btravstack/amqpand@btravstack/observability.Note the constraint that makes this non-trivial: these samples import real example workspaces, so the test file cannot live in the package (that would invert the dependency direction —
packages/*must not depend onexamples/*).packages/core's version works because its samples are kernel-only. The likely home is a test file inside each matching example workspace, or a workspace of its own that depends on the examples.Acceptance
docs/reference/{http,temporal,amqp,observability}.mdand the matching how-to pages is compiled by a checked-in type test, not by hand.pnpm typecheckso a contract change that breaks a sample fails the gate.CLAUDE.mdis removed once it lands.