From 342ca3d3cbce895b7cdece7fbea3d464ebae6450 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 01:59:20 +0000 Subject: [PATCH 1/2] ci(console): put vitest.config.ts in a tsc program and drop the ghost include entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `apps/console/vitest.config.ts` was in ZERO tsc programs. CI runs `turbo run type-check` — per package — and neither console tsconfig reached the file: `tsconfig.json` includes only `src`/`dev`/ `objectstack.config.ts`, and `tsconfig.node.json` listed only `vite.config.ts` and a `vitest.setup.ts` that does not exist. Add `vitest.config.ts` to `tsconfig.node.json`'s include. Its import of `../../vitest.config.mts` has to be listed too — a composite project must list every file in its program (TS6307) — which incidentally gives the root Vitest config the gate it also lacked. Drop the `vitest.setup.ts` entry rather than repoint it. A literal, glob-less include entry matching nothing is silently ignored by tsc, so it read as coverage that was never there. The setup file `vitest.config.ts` really uses (repo-root `vitest.setup.dom.tsx`) is passed to Vitest as a runtime path string, never imported, so this program has no type edge to it; naming it here was measured red (one TS6307 + four TS2882). No flag changes were needed: `allowImportingTsExtensions` + `emitDeclarationOnly` from #3475 already cover the `.ts`/`.mts` spellings. Refs #3476 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt --- apps/console/tsconfig.node.json | 40 +++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/apps/console/tsconfig.node.json b/apps/console/tsconfig.node.json index d4517d7bd..709cdf237 100644 --- a/apps/console/tsconfig.node.json +++ b/apps/console/tsconfig.node.json @@ -34,6 +34,42 @@ /* `../../scripts/vite-*.ts` are the repo-level Vite plugins vite.config.ts imports. They must be listed here or each one is a TS6307 ("not listed within the file list of project") — the error that kept this project red, - and therefore ungated. */ - "include": ["vite.config.ts", "vitest.setup.ts", "../../scripts/vite-*.ts"] + and therefore ungated. + + `vitest.config.ts` is listed for the same reason `vite.config.ts` is, and + until objectui#3476 it was in ZERO tsc programs. CI runs + `turbo run type-check`, i.e. per PACKAGE; the root `tsconfig.json` does + list `apps` in its `include`, but no script ever runs it — it is the + editor config. So the one console config that merges two config objects + (`rootConfig` and `viteConfig`), which is precisely the shape a + type-checker catches drift in, was the one an agent could break with no + gate noticing. + + `../../vitest.config.mts` follows it in by necessity, not by wish: + `vitest.config.ts` imports it, and a composite project must list every + file in its program or that import is a TS6307 as well. Covering the + importer is impossible without it — and it is a bonus, since the root + Vitest config was in no gated program either. One caveat that comes with + it: its `@ts-expect-error` on the plain-JS `vitest-invocation-guard.mjs` + import stays CORRECT here only because this project leaves `allowJs` at + its default `false`. Turning `allowJs` on would make that directive unused + and this project red with TS2578 — see `tsconfig.scripts.json`, which + chose `allowJs: true` for `scripts/` and deliberately paid that price. + + There is deliberately NO `vitest.setup.ts` entry. No such file has ever + existed in this directory, and a literal, glob-less `include` entry that + matches nothing is silently ignored by TypeScript — so it read as coverage + that was never there (objectui#3476). Repointing it at the setup file + `vitest.config.ts` actually uses (the repo-root `vitest.setup.dom.tsx`) + was measured and rejected: that file is handed to Vitest as a RUNTIME PATH + STRING, never imported, so this program has no type edge to it, and naming + it here drags `vitest.setup.base.ts` plus four `@object-ui` side-effect + imports into a Node build-config project that cannot resolve them + (one TS6307 + four TS2882). It belongs to a test-oriented program. */ + "include": [ + "vite.config.ts", + "vitest.config.ts", + "../../vitest.config.mts", + "../../scripts/vite-*.ts" + ] } From b040f911e52e01e96957db491246c41cf5315814 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 02:16:58 +0000 Subject: [PATCH 2/2] ci(turbo): hash the root vitest config into the type-check cache key The previous commit makes apps/console's type-check program span a second repo-root file (`vitest.config.mts`, pulled in because `apps/console/vitest.config.ts` imports it and a composite project must list every file in its program). turbo's `type-check` inputs did not hash it: `$TURBO_DEFAULT$` only covers files inside the package directory, and `globalDependencies` is unset. Measured A/B on this branch, same tree, same plant (a real type error in the root `vitest.config.mts`): old inputs -> cache hit, replaying logs 4214aa6ab3df0f18 -> exit 0 (a green replayed over a program that does not compile) new inputs -> cache miss, executing 648e8a0633f2bff7 -> exit 1 ../../vitest.config.mts(114,5): error TS2769 Not local-only: ci.yml persists .turbo/cache via actions/cache, and in this container turbo resolves its cache to the shared checkout's .turbo, so a stale green survives across worktrees too. Symmetric with the `$TURBO_ROOT$/scripts/vite-*.ts` entry already present, which exists for exactly this reason for the other root-level file in the same program. Refs #3476, #3514 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt --- turbo.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index e33441983..61c94c0f1 100644 --- a/turbo.json +++ b/turbo.json @@ -44,7 +44,8 @@ "cache": true, "inputs": [ "$TURBO_DEFAULT$", - "$TURBO_ROOT$/scripts/vite-*.ts" + "$TURBO_ROOT$/scripts/vite-*.ts", + "$TURBO_ROOT$/vitest.config.mts" ] }, "clean": {