Skip to content

packages/cli typecheck compiles none of the 112 test files under test/include: ["src"] makes the green verdict empty for half the suite #14710

Description

@os-trump

Filed while verifying #14554; unrelated to that card's change and deliberately not repaired there.

The measurement

packages/cli/package.json declares "typecheck": "tsc --noEmit", and
packages/cli/tsconfig.json declares "include": ["src"]. Measured on
d29fbf2a78 with tsc -p packages/cli/tsconfig.json --noEmit --listFiles:

population on disk in the tsc program
test files under packages/cli/src/ 118 118
test files under packages/cli/test/ 112 0
package-root harness modules (vitest.config.ts, vitest-tiers.ts, vitest-tiers.fixtures.ts) 3 0

pnpm --filter @objectstack/cli typecheck exits 0. That verdict is true and it
is empty for 112 test files — just under half the package's 230.

Why this is the shape AGENTS.md already names

AGENTS.md, under the type-check ratchet:

Never exclude *.test.ts / *.spec.ts from a package's tsconfig.jsontsc --noEmit reads that config, so the exclusion hides the tests from the very check the typecheck script advertises (a green gate over source nothing read).

This package reaches the same end state by the other spelling: not an exclude
of the test globs, but an include narrowed to src, which omits the entire
test/ directory by construction. The consequence is identical — and so is the
corollary AGENTS.md draws next: a @ts-expect-error in any of those 112 files
is a phantom check that evaluates never and can be deleted with every gate
still green.

The ratchet does not catch it. pnpm check:type-check-coverage asks whether a
package declares a typecheck script; this one does, so the package is
covered on paper. Nine packages (client, lint, objectql, rest, spec,
plugin-auth, plugin-approvals, plugin-sharing, knowledge-ragflow) carry
the second-layer ledger — a check:test-typecheck script plus a shrink-only
test-typecheck-debt.json. packages/cli carries neither, while holding one of
the largest test populations in the repo.

Decision this needs, rather than a patch

The mechanism is already in the tree and AGENTS.md says to onboard by wiring,
never by copying
: a sibling tsconfig.test.json naming test, wired into the
typecheck script, plus scripts/check-test-typecheck.mts --package packages/cli
and a generated test-typecheck-debt.json.

What is not mine to decide is the size of the debt that first measurement will
record. 112 previously unchecked files may produce a large initial ledger entry,
and AGENTS.md is explicit that such an entry's note is load-bearing rather
than decorative. Someone should measure it before choosing between onboarding
with a ledger and widening include outright.

Not in scope for the card that found it

#14554 concerns the merge-queue ejection caused by a hand-maintained tier list;
its diff adds two of the three unchecked package-root modules listed above, and
that PR records the gap as NOT MEASURED rather than claiming coverage it does
not have. This issue is the separate one.

Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions