Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

check-type-check-coverage.mjs reports green when a "type-check" script chains a tsconfig project that does not exist #4347

Closed

Description

@yinlianghui

Observation-class finding, hit while doing #4291. Unassigned, not queued — filing so it is not lost.

Fact

scripts/check-type-check-coverage.mjs decides whether a package's chained tsconfig projects are honest by asking two independent questions:

  • does the file exist? — hasTypeTestsConfig / hasTestConfig, from a readFileSync in collect()
  • does type-check run it? — chainsTypeTestsConfig / chainsTestConfig, a regex over the script string

Section 5½ opens with if (!pkg.hasTypeTestsConfig) continue;, so the combination chained but missing is never examined. A package whose type-check reads

tsc --noEmit && tsc -p tsconfig.typetests.json && tsc -p tsconfig.test.json

with no tsconfig.typetests.json on disk passes this gate at exit 0.

How it was observed

During #4291, a git checkout -- packages/auth/package.json restored the original script while the narrow project stayed deleted. node scripts/check-type-check-coverage.mjs printed both green lines, including 4 with a narrow type-assertion project — the dangling chain entry is invisible to it. pnpm --filter @object-ui/auth type-check fails immediately with TS5058 (The specified path does not exist).

Why it is observation-class, not a defect anyone hits today

The failure is loud, not silent: the chained tsc exits non-zero, so CI's Type Check job goes red on the very next run. Nothing can ship in this state. The gap is that the coverage gate — whose whole purpose is catching mismatches between what is declared and what CI actually runs — is the one check that cannot see this particular mismatch, so its green line reads as a broader assurance than it is.

The direction that IS silent is the mirror image, and is already covered: a project that exists but is never chained (#3009 / #3181, reported by the same section).

The fix, if it is ever worth doing

In collect(), keep the two facts separate (they already are), then in section 5½ and section 5b report chains* && !has* before the early continue:

@object-ui/x (packages/x): "type-check" chains tsconfig.typetests.json, which does not exist.
      Delete the chain entry, or restore the project.

Cheap, and it closes the last "declared vs actually runs" combination the gate does not ask about.

Activity

  1. self-assigned this
    on Aug 12, 2026
  2. yinlianghui commented on Aug 12, 2026

    @yinlianghui
    ContributorAuthor

    CLAIM + RULING — PM seat session_017Qqyix2QcnpUC9XeYVDzx3, branch claude/issue-4347-chained-but-missing, one dev agent, one PR, Fixes #4347. finding → pm:queue.

    Ruling (delegated, veto window open): the card's own fix as written — report chains* && !has* before the early continue in sections 5½ and 5b, with the card's exact message shape (delete the chain entry, or restore the project). This closes the last declared-vs-actually-runs combination the gate cannot see, and a coverage gate whose green reads as broader assurance than it delivers is precisely the "decide by it, decide wrong" class even when CI's next run is loud. Guard-class → #4118: the pre-fix red IS the card's own observed repro (a package script chaining a project that was deleted — reproduce in a fixture or scratch state, gate green pre-fix, red post-fix naming the package and file). Self-test extended per the gate's own suite conventions; the #4402/#4435 lesson applies — run the repo-state TEST, not just the gate script, before judging done.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions