Commit 1c009e3
fix(scripts): SOURCES_COVERED asks every package, ledgered or not (#15482)
* fix(scripts): SOURCES_COVERED asks every package, ledgered or not
`check:type-check-coverage` evaluated its SOURCES_COVERED clause only for a
package that DECLARES a `typecheck` script. The argument written beside that
scope was that a DEBT package's answer is already "nothing reads this package",
which its ledger owns. It is not: a DEBT row records an ERROR COUNT taken
through `tsc -p tsconfig.json`, so a source directory OUTSIDE that program is
in neither the count nor any other reading. `packages/core/examples` held 2
non-test source files in no tsc program at all, neither of which had ever
compiled, and they surfaced only when an unrelated PR added a `typecheck`
script — repairing them moved the package 12 -> 29 errors, all of it drift
accumulated while nothing could check the file.
The clause now runs over `accountedPrograms()`, the same set TESTS_COVERED is
decided against: the configs the `typecheck` script invokes, or `tsconfig.json`
for a package with no such script (what `measureDebt` runs). The finding names
the claim it falsifies — a `typecheck` script, a DEBT row, an EXEMPT row, or
nothing accounting for the package at all — rather than assuming a script the
package may not have.
Measured on this tree: the gate stays green (75/79 covered, 4 in DEBT, 1
exempt), so no ledger row and no exclusion was widened to keep it green. Two
legs: with a source file planted in a DEBT package's unread directory the old
gate exits 0 and the new one reports it.
Also adds the gate's report on its own scope. Three axes of this gate's
blindness have each been found by a person tripping over one, and the shape
they share is a clause skipped for a population with the run saying so nowhere.
`SCOPED_CLAUSES` declares every such scope beside its predicate and its reason,
and every green run prints who was left out of what — today that is
GENERATED_COVERED over the 4 packages declaring no `typecheck` script.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
* fix(scripts): the scope line names the population it cannot speak for
`clauseScopeLine` is computed over the enumerated workspace packages, and the
workspace ROOT is not one of them: `observed()` builds the root from its
manifest alone, with none of the four observation fields, so TESTS_COVERED,
SOURCES_COVERED, PINS_CHECKED and GENERATED_COVERED are never asked of it while
this file's header says the root is included "like any other package's". Filed
as #15483 (latent today: the root tsconfig declares no `include`, and the tree
has 0 root-level test files).
A self-report that inherited that boundary silently would be the defect it
reports on, so the line says it. Pinned in both branches of the existing
self-test cases rather than as new ones, so the battery floor is unmoved.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 61821e5 commit 1c009e3
1 file changed
Lines changed: 323 additions & 53 deletions
0 commit comments