Skip to content

Commit a103ce2

Browse files
committed
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
1 parent fcc821f commit a103ce2

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

scripts/check-type-check-coverage.mjs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,6 +2493,17 @@ function skippedClauses(packages) {
24932493
.filter((row) => row.skipped.length > 0);
24942494
}
24952495

2496+
// The one population this line CANNOT speak for, said out loud rather than left
2497+
// to the word "every" (#15483). `evaluate` asks the per-package invariants
2498+
// inside a loop over the enumerated packages, and the workspace ROOT is not one
2499+
// of them -- `observed()` builds it from its manifest alone, with none of the
2500+
// four observation fields -- so TESTS_COVERED, SOURCES_COVERED, PINS_CHECKED
2501+
// and GENERATED_COVERED are never asked of it, while this file's own header
2502+
// says the root is included "like any other package's". A self-report that
2503+
// silently inherited that boundary would be the very defect it reports on.
2504+
const SCOPE_LINE_BOUNDARY = ' ⚠️ Counted over the enumerated workspace packages: the ROOT package is not '
2505+
+ 'one of them, and four per-package clauses are never asked of it (#15483).';
2506+
24962507
/**
24972508
* That report as the line the green verdict prints.
24982509
*
@@ -2508,7 +2519,7 @@ function skippedClauses(packages) {
25082519
function clauseScopeLine(rows, total, limit = 6) {
25092520
if (rows.length === 0) {
25102521
return `\n clause scope: every per-package invariant was asked of all ${total} package(s) -- `
2511-
+ 'no clause went quiet about a population this run (#14918).';
2522+
+ `no clause went quiet about a population this run (#14918).${SCOPE_LINE_BOUNDARY}`;
25122523
}
25132524
const named = rows.map(({ clause, why, skipped }) => {
25142525
const shown = skipped.slice(0, limit).join(', ');
@@ -2517,7 +2528,7 @@ function clauseScopeLine(rows, total, limit = 6) {
25172528
});
25182529
return `\n clause scope: ${named.join('; ')}. Every other per-package invariant was asked of all `
25192530
+ `${total}. ⭐ This line exists because SOURCES_COVERED was scoped exactly like that and said so `
2520-
+ 'nowhere (#14918).';
2531+
+ `nowhere (#14918).${SCOPE_LINE_BOUNDARY}`;
25212532
}
25222533

25232534
/**
@@ -5039,13 +5050,13 @@ function selfTest() {
50395050
label: 'no skipped population still PRINTS a sentence -- silence is what this line replaces',
50405051
rows: [],
50415052
total: 79,
5042-
expect: /every per-package invariant was asked of all 79 package\(s\) -- no clause went quiet/,
5053+
expect: /every per-package invariant was asked of all 79 package\(s\) -- no clause went quiet[\s\S]*ROOT package is not one of them[\s\S]*#15483/,
50435054
},
50445055
{
50455056
label: 'a skipped population is named, counted, and carries its reason',
50465057
rows: [{ clause: 'GENERATED_COVERED', why: 'they declare no `typecheck` script', skipped: ['a', 'b'] }],
50475058
total: 5,
5048-
expect: /GENERATED_COVERED was NOT asked of 2 of them \(a, b\) -- they declare no `typecheck` script\. Every other per-package invariant was asked of all 5\./,
5059+
expect: /GENERATED_COVERED was NOT asked of 2 of them \(a, b\) -- they declare no `typecheck` script\. Every other per-package invariant was asked of all 5\.[\s\S]*ROOT package is not one of them[\s\S]*#15483/,
50495060
},
50505061
{
50515062
label: 'a long list is truncated with a remainder, never silently cut',

0 commit comments

Comments
 (0)