Commit aa910a6
feat(scripts): census — do package-root Markdown TS blocks compile? (#18751)
Part of #18715 — this PR answers the card's own "⛔ Not measured"
question with a number. It deliberately does **not** close the blind
spot: nothing here gates anything, so the half left open is the wiring
decision, which is a new required gate and therefore the maintainer's
floor (live precedent: the PR parked in the decision box for that
reason, referenced in the dispatch). #18715 stays open on merge.
Clause-②: no
## What landed
One file: `scripts/measure-markdown-ts-blocks.mjs`, 1086 lines, a member
of the existing `scripts/measure-*.mjs` family (8 prior members). It is
a measurement instrument, not a gate:
- it exits 0 on **every** census outcome;
- it is wired into no CI job, no `package.json` script, no package
`test`/`lint` chain;
- it exits non-zero for exactly one reason — **the instrument itself
could not run**. "Could not run" is a failure, not a skip.
Usage: `node scripts/measure-markdown-ts-blocks.mjs` (census, 12s on a
warm build) · `--json` · `--only PATH` · `--controls-only` ·
`--self-test` (30 batteries, no build needed).
## The census
Population: `*.md` at the root of every directory under `packages/` that
carries a `package.json` — 76 package roots, 141 Markdown files, **1002
fenced `ts`/`typescript`/`tsx` blocks**. `content/docs/**` is a
different population with its own gates and is out of scope.
Three numbers, because two would hide the answer inside the convention
(see below). RAW counts a block failing on any diagnostic; TOLERANT
counts it failing on any diagnostic **outside** the forgiven set;
WELL-FORMED AND WRONG counts blocks that parse as a TypeScript module
and still fail — the class the repaired `kernel.logger` block belonged
to.
| stratum | files | blocks | RAW | TOLERANT | WELL-FORMED AND WRONG |
|:--|--:|--:|--:|--:|--:|
| **HAND-WRITTEN** (repairable by an author) | 54 | 282 | **195**
(69.1%) | **76** (27.0%) | **58** (20.6%) |
| **CHANGELOG.md** (release-owned history) | 46 | 720 | 646 (89.7%) |
356 (49.4%) | 109 (15.1%) |
| sub-stratum: the literal `packages/*/*.md` glob the card names | 42 |
654 | 574 (87.8%) | 314 (48.0%) | 131 (20.0%) |
RAW is an **upper bound** — it counts fragments that were never meant to
stand alone. TOLERANT is a **lower bound**, and that is the direction
that matters: a forgiven "cannot find name" leaves that name typed
`any`, so every downstream use of it goes unchecked. Real defects hide
behind an elision; they never appear because of one. The honest sentence
is "between TOLERANT and RAW".
1 parent 95b21b3 commit aa910a6
1 file changed
Lines changed: 1086 additions & 0 deletions
0 commit comments