From 392aa3661dfd2962e8c41fdd1929531e1dc4b37e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 4 Sep 2026 12:28:38 +0000 Subject: [PATCH] docs(agents): state the hidden-tests rule as the invariant the gate enforces `AGENTS.md`'s hidden-tests bullet was exclude-shaped, but `check:type-check-coverage` enforces the invariant per file and spelling-agnostically: a test named by an `exclude` OR never reached by any `include` is hidden from the typecheck. The prose declared a narrower rule than the tree enforces, so an author who obeyed it to the letter could still hide a whole test tree by never including it. Restate the bullet as the invariant, name both spellings that break it, and name `check:type-check-coverage` as the enforcing instrument. Rewritten inside its existing 6 lines at the existing wrap width (widest line 87B before and after), so the ratcheted file line count is unchanged at 1161. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox --- AGENTS.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 0705a5c9b4..64fe9b5dbc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -72,12 +72,12 @@ graduated" to the next author. Three principles the ratchet's invariants encode, worth knowing before you fight them: -- **Never `exclude` `*.test.ts` / `*.spec.ts` from a package's `tsconfig.json`** — - `tsc --noEmit` reads that config, so the exclusion hides the tests from the very - check the `typecheck` script advertises (a green gate over source nothing read). When - the build config must keep the exclusion, add a sibling `tsconfig.test.json` and name - it in the `typecheck` script (the `packages/spec` pattern); the sibling may carry its - own *module* semantics to match vitest, never its own *strictness*. +- **A package's `tsconfig.json` reaches every `*.test.ts` / `*.spec.ts` in it** — + `tsc --noEmit` reads that config, so a test it misses is hidden from the very check + the `typecheck` script advertises (a green gate over source nothing read). + `check:type-check-coverage` fails both spellings per file: an `exclude` naming it, an + `include` that never does. A sibling `tsconfig.test.json` named in the `typecheck` + script may carry its own *module* semantics for vitest, never its own *strictness*. - **A `@ts-expect-error` in a file no tsc program compiles is a phantom check** — it evaluates never, and deleting it leaves every gate just as green. Before writing one, check the file is compiled. Test-layer residue lives in the per-file,