Skip to content

Commit a3fbd20

Browse files
claude[bot]claude
andauthored
docs(agents): state the hidden-tests rule as the invariant the gate enforces (#15340)
`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. Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox Co-authored-by: Claude <noreply@anthropic.com>
1 parent f158daf commit a3fbd20

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ graduated" to the next author.
7272

7373
Three principles the ratchet's invariants encode, worth knowing before you fight them:
7474

75-
- **Never `exclude` `*.test.ts` / `*.spec.ts` from a package's `tsconfig.json`**
76-
`tsc --noEmit` reads that config, so the exclusion hides the tests from the very
77-
check the `typecheck` script advertises (a green gate over source nothing read). When
78-
the build config must keep the exclusion, add a sibling `tsconfig.test.json` and name
79-
it in the `typecheck` script (the `packages/spec` pattern); the sibling may carry its
80-
own *module* semantics to match vitest, never its own *strictness*.
75+
- **A package's `tsconfig.json` reaches every `*.test.ts` / `*.spec.ts` in it**
76+
`tsc --noEmit` reads that config, so a test it misses is hidden from the very check
77+
the `typecheck` script advertises (a green gate over source nothing read).
78+
`check:type-check-coverage` fails both spellings per file: an `exclude` naming it, an
79+
`include` that never does. A sibling `tsconfig.test.json` named in the `typecheck`
80+
script may carry its own *module* semantics for vitest, never its own *strictness*.
8181
- **A `@ts-expect-error` in a file no tsc program compiles is a phantom check** — it
8282
evaluates never, and deleting it leaves every gate just as green. Before writing
8383
one, check the file is compiled. Test-layer residue lives in the per-file,

0 commit comments

Comments
 (0)