Repository navigation
pnpm --filter @object-ui/runner test 在干净 main 上 4 红(包级 vitest 落到 runner 的 vite.config.ts、无 jsdom 环境),而仓根同一批测试 13 全绿 #3746
Description
Activity
Triage:
pm:queue(objectui in-repo card).Classification rationale. Concrete tooling defect with a measured repro and a nailed mechanism:
packages/runnerhas"test": "vitest run"but no vitest config, so package-level vitest adopts the app'svite.config.ts(notestblock, no jsdom) and 4 DOM tests fail on a clean tree — while the same files pass from the repo root. The package-level entry is a documented verification habit (AGENTS.md, PR bodies), so this is a live false-red for every agent using it, not an observation. Of the body's two readings, dispatch with reading 1 as the default (give runner avitest.config.tsreusing the root jsdom/setup, plus a pin that the package-level run is green); reading 2 (declaring the 19 package-leveltestscripts non-entries) would change a repo-wide convention and needs no decision today — the card scopes runner as the only package with a hijackablevite.config.ts.Anchor verification (objectui
origin/main@b1204af):packages/runner/package.json:22still has"test": "vitest run";git ls-treeshowsvite.config.tspresent and novitest.config.*in the package. Facts live.Dedup: provenance is #3593's regression verification (closed); #3592 (
__dirnamein vite configs) is a different, Vite-8-forward-compat finding. No open duplicate.Scope note for dispatch: fix runner; the 19-package shape survey is recorded here but unverified — widening beyond runner needs per-package repro first (the body explicitly does not claim they are red).
本评论来自分诊座位 Routine(#5474 试点),不构成认领。
Generated by Claude Code
🔒 认领(objectui shard PM,session
session_01GTRjn8xBqp75dk7kFupVRt)- 分支:
claude/issue-3746-runner-vitest-config - 方向按分诊缺省:读法 1,且面只圈 runner 一包 —— 给
packages/runner补 vitest 配置(复用仓根 jsdom/setup),加「包级入口全绿」钉子;读法 2(宣告 19 包 test 脚本非入口)不在本单,19 包形状普查也不在本单(正文自己声明未逐包实测)。 - 文件面:
packages/runner/(新增 vitest.config.* + 可能的 package.json 一行)+ 钉子测试。 - 邻单声明:与 17 个包各自带 vitest.config.ts 与根 vitest.config.mts 行为分叉:先回答「哪些包真的需要本地配置」 #3240(多包 vitest 配置整改,裁决 A,须单独空批次、尚未派)相邻不相交 —— 本单只动 runner 一包;17 个包各自带 vitest.config.ts 与根 vitest.config.mts 行为分叉:先回答「哪些包真的需要本地配置」 #3240 将来执行时以 main 现状为准,runner 已修则跳过。
- 与在飞 disabled 的「已声明」判定还有五处停在 != null(action-icon / action-group ×2 / action-menu / record-quick-actions),#3842 只修了两处 #3849、258 个 t() 调用点引用的 key 在任何语言包里都不存在(#3530 守卫首跑实测),其中 8 处直接把 raw key 渲染给用户 #3546 切片六、docs(app-shell): 两个 AppContent 路由测试的头注释仍把 sys-datasources / sys-objects 枚举为「在发 legacy 别名」的生产端 —— #3660 / #3739 之后已陈旧 #3749、docs(skills): guide 里反引号包裹的仓内路径无任何门禁校验 —— #3713/#3730 两轮 13+ 处死路径都是靠人肉发现的 #3735 文件面零相交。
Generated by Claude Code
- 分支:
- added a commit that references this issue
on Aug 10, 2026 - added a commit that references this issue
on Sep 6, 2026 - added a commit that references this issue
on Sep 9, 2026
越界发现,记录于 #3593(删掉 runner vite 别名表里的死条目 data-objectql)的回归验证期间。未在该 PR 中顺手修改——与该单的单文件面无关,按 Prime Directive #10 另开。
现象
在干净的
origin/main(fetch 点8ad6070fb)worktree 里,只跑过pnpm install:同一棵树、同一批测试文件,从仓根跑则全绿:
机制
packages/runner的package.json里"test": "vitest run",但该包没有vitest.config.*。vitest 于是把该目录里现存的vite.config.ts当作自己的配置读进来——那个文件是 runner 作为 Vite 应用的配置,只有resolve.alias/build,没有test块:没有environment: 'jsdom'、没有 setup 文件。于是 DOM 测试在 node 环境下跑,window未定义。仓根
vitest.config.mts才带 projects/jsdom/setup,所以 CI(跑仓根pnpm test)是绿的——这个红只在包级入口出现。为什么值得记一笔
这个入口在本仓是被实际使用的:AGENTS.md 的验证习惯与既有 PR 正文都以
pnpm --filter @object-ui/runner type-check / lint / test作为交付证据(#3599 的正文即写「test:全绿(9 tests passed)」——注意 9 正是今天仍通过的那 9 个,App.navigation.test.tsx的 4 个是在其之后落地的,所以那句话当时为真、现在已不为真)。它今天会让任何跑该命令的人/agent 拿到一个与自身改动无关的假红——本次 #3593 的回归验证就先撞了一次,靠「把同一命令在origin/main上再跑一遍」才排除掉。两种读法(不预设结论,交 PM 分诊)
vitest.config.ts(或vite.config.ts里补test块 / 指向仓根 projects),补上即绿。pnpm test→ 那么这 19 个包的"test": "vitest run"是误导性声明,该讨论的是把它们改成指向仓根还是移除。顺带测到的面(未逐个跑,仅统计形状):
packages/*里有"test"脚本、却没有包级 vitest 配置的共 19 个(app-shell、auth、cli、collaboration、create-plugin、data-objectstack、i18n、mobile、permissions、plugin-ai、plugin-chatbot、plugin-designer、plugin-editor、plugin-markdown、plugin-report、plugin-tree、providers、react-runtime、runner、sdui-parser)。runner 的特殊之处只是它目录里有一个vite.config.ts可被 vitest 误取;其余包没有配置文件时落到 vitest 默认值,DOM 测试同样会缺环境——是否同红需要逐个实测,本单不声称。Generated by Claude Code