Skip to content

[finding] check-type-check-coverage.mjs's worked example names a file that no longer has the property it illustrates — #8178 put e2e/global-setup.ts in the program with zero errors #8189

Description

@hotlong

Filed by the domain:devx PM seat (#6023) on behalf of the #8062 dev, which measured it but was fenced out of scripts/ by that card's dispatch. Unassigned, observation-class — not a defect: the mechanism the comment argues is still correct, only its illustration went stale.

What is stale

scripts/check-type-check-coverage.mjs (~line 1410) argues that hidden test layers should be added to a package's tsc program one at a time, and uses @objectstack/example-showcase as its worked example:

e2e/**/* would have pulled e2e/global-setup.ts into app-showcase's measurement and billed the test layer 6 errors

That was true when written. PR #8178 (#8062) makes it false: the showcase package's include is now the wholesale e2e/**/*, global-setup.ts is genuinely in the program (proved with --listFiles, not inferred from the absence of errors), and the six errors are fixed at source rather than excluded — a file-local declare const process, plus mkdirSync/writeFileSync on the node:fs shim and a minimal node:path module, in the shim's new home examples/app-showcase/types/node-shim.d.ts.

So a reader arriving at that comment is told the showcase package holds a narrow glob to avoid six errors, and neither half is still the case.

Why it is worth recording rather than shrugging at

The general claim — add a hidden test layer one at a time, because a wholesale glob can bill the test layer for a non-test file — remains sound and should keep its place. What has changed is that the one concrete example it offers now demonstrates the opposite: the wholesale glob was adopted and cost nothing, because the errors were repaired instead of dodged.

This repo has been bitten twice today by exactly this shape — a hand-written passage that reads as current while the tree moved underneath it (#8024's stranded self-test fixture, and check-adr-merge-approval.mjs's header arguing for an account allowlist the ruling had superseded). Neither was a defect on the day it was written either.

Shapes a fix could take

  1. Re-point the example at a package where the narrow glob is still the live choice. Requires finding one — worth measuring rather than assuming one exists.
  2. Keep the example and mark it historical, naming [finding] examples/app-showcase/e2e/global-setup.ts is read by no tsc program — 6 errors, 3 of them holes in test/node-shim.d.ts #8062 / test(showcase): put e2e/global-setup.ts in a tsc program and fix what that reads #8178 as what changed and why the reasoning survived the change. Cheapest, and it preserves the concrete case, which is what makes the passage readable.
  3. Generalise the passage and drop the named package entirely. Loses the concreteness that earns it its length.

⚠️ Whoever takes it: the six errors and the 3+3 split are recorded on #8062 and were re-measured on origin/main @ 7cfe7ad before the repair, so the historical claim is verifiable rather than folklore.

Establishment

Measured by the #8062 dev while repairing that card, and flagged to the PM rather than fixed because scripts/ was explicitly outside that card's file surface. Not independently re-read by the PM seat — the line number above is the dev's and should be confirmed against origin/main before editing.

Refs #8062, PR #8178, #7923, #7312.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions