boss-skill icon indicating copy to clipboard operation
boss-skill copied to clipboard

lint: 本地有 .boss/ 工作区时 npm run lint 必然失败(biome 未尊重 .gitignore)

Open echoVic opened this issue 1 month ago • 0 comments

现象

本地在仓库里跑过 boss 流水线(有 .boss/ 工作区)之后,npm run lint 必然失败,报的全是 .boss/** 里生成 JSON 的 format 错误:

.boss/--describe/.meta/execution.json format
.boss/demo-design/ui-design.json format
.boss/events-feature/.meta/execution.json format
.boss/events-feature/.meta/feature-memory.json format

根因

.boss/ 已在 .gitignore 里被忽略,但 biome.json 的 files.includes 只排除了 dist/.git/node_modules/coverage,没有让 biome 尊重 gitignore:

"files": { "includes": ["**", "!**/dist", "!**/.git", "!**/node_modules", "!**/coverage"] }

于是 biome 会把被 gitignore 的本地产物当作源码检查。

影响

  • CI 从干净检出开始跑,且 lint 步骤在会写 .boss/ 的步骤之前,所以 CI 一直绿;
  • 但任何在本仓库里用过 boss 的开发者,本地 npm run lint 永久红 → 这层本地保护实际失效,真回归会被噪音淹没;
  • npm run lint:fix 还会去改写这些生成产物。

复现(干净检出 + 1 个 .boss 文件即可)

git worktree add --detach /tmp/repro origin/main
cd /tmp/repro && npm ci
mkdir -p .boss/test-feature/.meta
printf '{\n  "enabledStages": [\n    1,\n    2\n  ]\n}\n' > .boss/test-feature/.meta/execution.json
npm run lint   # → Found 1 error (.boss/test-feature/.meta/execution.json format),退出码 1

实测:无 .boss/ 时 313 个文件全部通过、退出码 0;放入上述 1 个文件后变 314 个文件 + 1 error、退出码 1。

建议修复(已实测可用)

biome.json 增加:

"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }

实测效果:

  • 本地 .boss/** 被正确忽略,biome ci 退出码 0;
  • .gitignore 中用 ! 重新包含的已提交 fixture 仍被纳入检查(test/evals/fixtures/**/workspace/.boss/、test/harness/scenarios/**/fixture/.boss/,共 26 个文件),检查文件数保持 313 不变。

注意:vcs.enabled: true + clientKind: "git" 必须一起给,只写 useIgnoreFile: true 不生效(实测仍然报错)。

备选方案(不推荐)

在 files.includes 里加 "!**/.boss":改动更小,但会连 26 个已提交的 fixture 一起排除,缩小检查面。

边界

与 #70(依赖升级 / $schema 同步)无关,单独立项;纯粹是本地开发体验与本地 lint 有效性。

echoVic avatar Oct 10 '26 01:10 echoVic