From 25d1dc81d0ef51f701180149c6f6f4f2e8fc58e6 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 4 Sep 2026 02:19:24 +0000 Subject: [PATCH] docs(scripts): name the `rootDir` widening in TESTS_COVERED's remedy (#14943) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk --- scripts/check-type-check-coverage.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/check-type-check-coverage.mjs b/scripts/check-type-check-coverage.mjs index 46e198d986..9ad94a3262 100644 --- a/scripts/check-type-check-coverage.mjs +++ b/scripts/check-type-check-coverage.mjs @@ -590,6 +590,12 @@ const PIN_ISSUE = 'https://github.com/objectstack-ai/objectstack/issues/5286'; // finding later used ("the directory was never INCLUDED by anything"), which is // why the remedy names a file rather than describing a shape (#10756). const SPEC_SCRIPTS_PRECEDENT = 'packages/spec/tsconfig.scripts.json'; +// The in-tree precedents TESTS_COVERED's remedy points at for the `rootDir` +// half of the sibling-config route. Both put a test tree that sits outside the +// build config's `rootDir` into a program, and both had to widen `rootDir` to +// the repo root to do it -- the step the remedy named no way to discover until +// #14943, measured on #14835 at 116 x TS6059 inherited and 3 more at `"."`. +const TEST_ROOTDIR_PRECEDENT = '`packages/client/tsconfig.test.json` and `packages/cli/tsconfig.test.json`'; const GENERATED_INCLUDE_ISSUE = 'https://github.com/objectstack-ai/objectstack/issues/10880'; // A path in the root program whose edits move the `@objectstack/spec-monorepo` @@ -2004,7 +2010,13 @@ function evaluate(packages, root, state) { `the check reports green over source it never read (${TRACKING_ISSUE}). Drop the ` + `\`*.test.ts\`/\`*.spec.ts\` entry from \`exclude\`, widen \`include\` to reach the test tree, add a ` + `sibling \`tsconfig.test.json\` and name it in the \`typecheck\` script (the #5286 route, when the ` + - `build config must keep the exclusion), or measure what surfaces and add a TEST_DEBT entry in ${SELF}.`, + `build config must keep the exclusion), or measure what surfaces and add a TEST_DEBT entry in ${SELF}. ` + + `⚠️ The sibling route usually needs \`rootDir\` widened as well, and leaving it inherited is the ` + + `way that route fails: test files outside the build config's \`rootDir\` report one TS6059 each -- ` + + `116 of them in one measured onboarding of a sibling \`test/\` tree under \`rootDir: "src"\`, and ` + + `\`"."\` still left 3 where tests read fixtures from another package. ${TEST_ROOTDIR_PRECEDENT} ` + + `widen it to \`"../.."\` (the repo root) for exactly this reason; \`rootDir\` steers emit layout ` + + `only and these programs emit nothing, so it widens the ROOT and never the strictness.`, ); } else { const entry = state.testDebt[pkg.name];