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.

apps/console/vitest.config.ts is type-checked by nothing, and tsconfig.node.json's include lists a file that doesn't exist #3476

Closed

Description

@yinlianghui

Observation-class finding, tripped over while working #3384. Nothing a user hits today — recording it so it doesn't stay invisible.

1. apps/console/vitest.config.ts is in zero tsc programs

#3305 wired apps/console/tsconfig.node.json so the console's build config gets type-checked. vitest.config.ts sits right next to it and was not picked up by either console tsconfig:

  • apps/console/tsconfig.json → include: ["src", "dev", "objectstack.config.ts"]
  • apps/console/tsconfig.node.json → include: ["vite.config.ts", "vitest.setup.ts"]

type-check is turbo run type-check, i.e. per package — the root tsconfig.json (whose include does list apps) is the editor config and is not what CI runs. So no program contains the file. Measured on origin/main @ 2a9513d:

$ cd apps/console
$ ../../node_modules/.bin/tsc --noEmit --listFilesOnly | grep -c 'apps/console/vitest.config.ts'
0
$ ../../node_modules/.bin/tsc -p tsconfig.node.json --noEmit --listFilesOnly | grep -c 'apps/console/vitest.config.ts'
0

This is the same shape scripts/check-type-check-coverage.mjs was written to prevent one level up: the guard asks "does every package have a type-check script", not "does every checked-in .ts land in some program", so a config file adjacent to a covered one is a blind spot.

Impact today: nil — the file is 16 lines. The cost is that it is the one console config an agent can break without any gate noticing, and it merges two configs (rootConfig and viteConfig) whose shapes are exactly what a type-checker would catch drift in.

2. tsconfig.node.json includes vitest.setup.ts, which does not exist

$ ls apps/console/vitest.setup.ts
ls: cannot access 'vitest.setup.ts': No such file or directory

A literal (glob-less) include entry that matches nothing is silently ignored by TypeScript, so this is inert — but it reads as coverage that isn't there. Likely the intended file is the repo-root vitest.setup.dom.tsx that vitest.config.ts actually references.

Note for whoever picks this up

Adding vitest.config.ts to a checked program is not free: it imports ../../vitest.config.mts, and (once #3384 lands) ./vite.config.ts with an explicit extension, so the host tsconfig needs allowImportingTsExtensions plus one of noEmit / emitDeclarationOnly / rewriteRelativeImportExtensions. See PR #3475 for the measured details on that interaction.

Related: #3305 (wired the gate), #3384 / PR #3475 (found this). Not blocked by either — the gap is independent of how #3384 is resolved.

Activity

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

    @yinlianghui
    ContributorAuthor

    认领(PM 分诊晋级)— 会话 session_01GTRjn8xBqp75dk7kFupVRt,分支 claude/issue-3476-console-vitest-tsc。

    分诊结论:两点都修 —— (1) 把 apps/console/vitest.config.ts 纳入 tsconfig.node.json 的程序,按 issue 备注与 PR #3475 的实测处理 allowImportingTsExtensions 组合;(2) 幽灵条目 vitest.setup.ts 改指真实存在的 setup 文件或删除(以 vitest.config.ts 实际引用为准)。验证:--listFilesOnly 前后对照(0→1)+ console 包 type-check 通过。

    文件面:apps/console/tsconfig.node.json,必要时 apps/console/vitest.config.ts(仅为类型可检所需的最小改动)。越界即停。


    Generated by Claude Code

  3. yinlianghui commented on Aug 7, 2026

    @yinlianghui
    ContributorAuthor

    验收:ACCEPT — PR #3513(含 A 裁定的 turbo.json 一行)。

    核过 GitHub 实物:恰 2 文件 —— apps/console/tsconfig.node.json(include 收口 + 把"为什么列这些、为什么删幽灵条目、allowJs 的 TS2578 地雷"写成了约束文档级的注释)、turbo.json(与既有 scripts/vite-*.ts 条目对称的一行)。裁定要点:

    1. 双向 A/B 缓存实测:新 inputs 下种错 → cache miss + 红(hash 648e8a06);回滚旧 inputs → cache hit 重放绿盖红(hash 4214aa6a,与首次测量逐字节一致,交叉验证成立)。这是"半武装门禁"风险的完整证明,不是推断。
    2. 幽灵条目删除的决策有测量支撑:repoint 实测 5 个错误(TS6307+4×TS2882),且结构性理由成立(setupFiles 是运行期路径串,本程序无类型边);"零编译器选项改动"是量出来的,不是照抄 fix(console): make vite/vitest configs loadable by configLoader: 'native' #3475。
    3. branch 更新后 17/17 全绿,Type Check 真正跑过本 PR 自己的门禁(console hash cc69fdffa 本地/CI 逐字节一致),早前"CI 未覆盖本门禁"的披露正式退役。
    4. 新证据:turbo 缓存经 git common dir 落在共享主 checkout 的 .turbo,跨并行 agent 的 worktree 共享 —— stale green 不止跨 CI run 存活,还会在同容器的 agent 之间传播。已由 PM 记入 guard: turbo type-check 的手维护 inputs 名单已两次因"包程序越出包目录"失真 —— 评估从 tsconfig include 派生或加钉扎测试 #3514 作为 option C 的加重理由。

    PR 转 ready + auto-merge。#3514 保持 open,承载 C 方向(派生/钉住 inputs)。


    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

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions