Skip to content

docs(scripts): name the rootDir widening in TESTS_COVERED's remedy - #15129

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14943-tests-covered-rootdir-remedy
Sep 4, 2026
Merged

docs(scripts): name the rootDir widening in TESTS_COVERED's remedy#15129
baozhoutao merged 1 commit into
mainfrom
claude/issue-14943-tests-covered-rootdir-remedy

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes #14943

The defect

check:type-check-coverage's TESTS_COVERED failure text tells an author how to fix a hidden-tests package by naming the sibling tsconfig.test.json route — but never names the rootDir widening that route can require. The remedy was therefore incomplete for exactly the packages that need it most.

Measured on #14835: the include-narrowing shape puts tests outside the build config's rootDir, and onboarding one that way cost 116 x TS6059 with rootDir inherited; even rootDir: "." still cost 3 (three packages/cli tests read fixtures from examples/app-showcase/src/**). PR #14833 resolved it with rootDir: "../.." — the shape packages/client/tsconfig.test.json already used — and no author could reach that precedent from the gate's message.

What this changes — remedy PROSE only

  • The TESTS_COVERED message gains a sentence naming the rootDir consideration beside the sibling-config route, the two measured costs (116, and 3 at "."), the "../.." shape, and why the widening is safe (these programs emit nothing, so it widens the ROOT and never the strictness).
  • One new constant, TEST_ROOTDIR_PRECEDENT, names the two in-tree precedents (packages/client/tsconfig.test.json, packages/cli/tsconfig.test.json) — the shape SPEC_SCRIPTS_PRECEDENT beside it already uses for SOURCES_COVERED's remedy.

The predicate is UNCHANGED — shown two ways

Structurally: the diff touches one string literal inside the existing if (!inTestDebt) branch, plus a new const. Not one condition, threshold, ledger entry or observation function is edited — 13 insertions, 1 deletion, and the deleted line is the previous last segment of that same template string.

Behaviourally: a throwaway workspace package reproducing this card's own subject — the include-narrowing shape (include: ["src"], rootDir: "src", one test in a sibling test/ tree, no exclude at all) — was run through the gate before the edit and again after it, the second time in a separate worktree at this branch's head. Identical classification both times: the same package flagged under TESTS_COVERED, the same 1 of its test file(s), the same 1 problem(s), the same exit 1. Strip the appended sentence from the "after" output and diff against the "before" output exits 0 — the two runs differ in that sentence and in nothing else.

The gate's own --self-test reports the same case counts before and after (48 semantic + 68 observation + 45 re-measure + 28 built-closure + 19 auto-lowering + 18 exit-code), and the live run's verdict line is byte-identical. check:ratchet-remedy-authority reports the same census before and after (12 mark / 6 refuse / 168 none, 27 hand-classified control), so this file's marked classification did not move either.

Verification

Every command's exit code was captured before any pipe; the verdict lines are quoted in the report comment on #14943. Run here: the gate's --self-test and live run (before and after), check:ratchet-remedy-authority (self-test + run), check:pm-dispatch-gates (1338 cases), check:nul-bytes, and check:type-check-debt over a freshly built closure.

skip-changeset: this PR publishes nothing from any package — it edits one gate script's author-facing text.

🤖 Generated with Claude Code

https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk


Generated by Claude Code

…14943)

`check:type-check-coverage`'s TESTS_COVERED failure text names the sibling
`tsconfig.test.json` route but not the `rootDir` widening that route can
require, so the remedy is incomplete for exactly the packages that need it.
Measured on #14835: with `rootDir` inherited the honest program reported
116 x TS6059, and `"."` still left 3. PR #14833 resolved it with
`rootDir: "../.."`, the shape `packages/client`'s test config already used —
a precedent no author could reach from the gate's message.

Remedy prose only: the predicate is untouched, and what the gate accepts
does not move.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
@github-actions github-actions Bot added the size/s label Sep 4, 2026
@baozhoutao baozhoutao added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 4, 2026 — with Claude
@baozhoutao
baozhoutao marked this pull request as ready for review September 4, 2026 02:40
@baozhoutao
baozhoutao enabled auto-merge September 4, 2026 02:40
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 0faf2bd Sep 4, 2026
35 of 36 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-14943-tests-covered-rootdir-remedy branch September 4, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check:type-check-coverage's TESTS_COVERED remedy names the tsconfig.test.json route without the rootDir widening that route can require

2 participants