Quality system
Executable guards encode conventions that matter: reference integrity, naming rules, schema truthfulness, and site link integrity. Recurring authoring mistakes become named anti-patterns, mechanical guards, and baselines that ratchet toward zero.
For contributors. Guards live in scripts/ as npm run check:*; tests run under Vitest in tests/.
The guard suite
Guards are TypeScript scripts under scripts/ that walk the workflows worktree or this site's HTML and report violations. Each convention named in a specification or architecture page has a matching check — the spec defines the rule; the guard enforces it mechanically. Run them with npm run check:<name>; a clean tree always yields the same result.
workflows branch; Vitest mirrors key corpus checks so regressions fail npm test; the verify workflow walks the whole registry on every pull request, and deploy-docs rebuilds the generated regions and checks them for drift.Most guards are hard-zero — any finding fails the run. Where a guard measures debt the corpus already carries, every finding is triaged once by hand in a committed file that records a verdict and a named rationale against each one: harmless by design, a real seam accepted for now, or a live bug that keeps the guard red until it is fixed. There is no re-snapshot flag, because classifying a finding is a judgement rather than a regeneration — and an entry that stops matching anything is reported too, so a seam cannot leave the ledger by going quiet. The full command list is in package.json.
The test architecture
The Vitest suite (thirty-plus files) is organized around what could break:
- Unit coverage of the machinery — schema validation and generation, every loader, and the session store's sharp edges: HMAC sealing, index derivation, collision handling, legacy-folder migration.
- Fidelity behaviour — the runtime validators, binding provenance, fetch observability (including
technique_bundledcoverage), reference-not-repeat delivery, and trace-token signing, each tested as an observable contract rather than an implementation detail. - End-to-end execution —
mcp-server.test.tsdrives real tool calls; a deterministic walker (tests/e2e/walker.ts) enumerates every reachable path through every workflow definition and executes each one against the live server, so an unreachable activity or an impossible transition in content fails the server's test suite. - Documentation —
site.test.tsruns the two site guards and the drift check described below, making stale documentation a red build. - Agent smoke runs —
scripts/smoke/drives a real agent through a workflow for the behaviour no deterministic walk can check: whether the instructions actually steer a model.
Generated, then guarded
Two artifacts are machine-derived from the source, and both are guarded against drift rather than trusted to stay fresh. The documentation site itself follows the same pattern — hand-authored pages with generated API regions — and check:site / check:svg keep links and diagrams honest:
The same discipline extends to deployment: the GitHub Pages workflow rebuilds the generated regions and fails if the committed pages have drifted, so the deployed site is exactly the checked, committed one. The guards themselves run in the verify workflow, which has no path filter — every pull request gets the whole suite, so a site check cannot be skipped by a change that looks unrelated.
Next
Where this machinery lives in the server is server anatomy; how runs are kept on-script at runtime is workflow fidelity.