Skip to content

[finding] 54 package-root tool configs (vitest.config.ts, tsup.config.ts, …) are TypeScript no tsc program reads — SOURCES_COVERED deliberately does not govern them #10870

Description

@os-zhuang

Filed by the #10756 census so the scoping decision it forced is recorded and ruled on by
a maintainer, rather than settled by whoever happened to be holding that card.

The measurement

SOURCES_COVERED (scripts/check-type-check-coverage.mjs, added in #10756) asks, per
package the coverage headline calls covered: is there a non-test .ts source file
that no tsc program accounting for the package reads? On main @ 5886ee6d22 the honest
answer over all 64 covered packages is 65 files across 42 packages, and it splits
cleanly in two:

groupfilespackages
package-root tool configs5442
files in a source directory1111

The 54 are vitest.config.ts x32, tsup.config.ts x16, objectstack.config.ts x5 and
vitest.integration.config.ts x1.

SOURCES_COVERED governs the second group only — its observation half takes files at
depth > 0 (i.e. in a subdirectory), and the 11 are seeded into
UNCHECKED_SOURCE_DEBT. This card is about the first group.

The argument on both sides, as the gate's own header records it

For leaving them out. They are one repo-wide convention, not 42 independent
decisions: every package's include is src/**/*, and a tool config sits at the package
root because that is where its tool looks for it. It is loaded by that tool (vitest,
tsup), not imported by the package. Ledgering them would seed 42 entries all stating the
same sentence, and a ledger whose every line is identical is one nobody reads — the
failure mode #4311's own header warns about ("a ledger that can only accrete rots into a
list nobody trusts").

Against. A vitest.config.ts is unchecked TypeScript exactly as much as
packages/objectql/scripts/dry-run-hash-compat.ts was, and #4311's founding premise is
that a green suite no tsc has read is not evidence of a contract. Worse, the
depth > 0 line can be walked around: moving a file up into the package root takes
it out of the invariant's scope. That hole is left open knowingly.

What deciding it would look like

  1. Leave as-is, and record the exclusion in the gate's header (it already is).
  2. Bring them into a program — one shared tsconfig.tools.json pattern named in
    each typecheck script. Closes the class; costs 42 manifests plus whatever errors
    surface (unmeasured — the census counted files, not errors, for this group).
  3. Govern them with a separate, deliberately coarse invariant (e.g. "every package's
    root tool configs are read by some program, or the package is listed") — which is
    option 2 with a ledger for the stragglers.

No recommendation attached: this is a convention question across 42 packages and the
startup-scope axis cuts against expanding gate surface without a pull. Filed as
finding, not queued.

Dedupe

search_issues for the tool-config paths, vitest.config.ts type checking, and the
SOURCES_COVERED scope returns nothing; #10756 is the parent measurement and names this
split in its own report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions