Skip to content

Commit 7087f99

Browse files
claude[bot]claude
andauthored
docs(agents): owe the unit vitest tier locally on packages/cli cards, declare integration to CI (#15551)
* docs(agents): owe the `unit` vitest tier locally on `packages/cli` cards, declare `integration` to CI The dev-agent Definition of done told every card to run the affected package's `pnpm test`; for `packages/cli` that is the whole two-tier suite. The 测试 bullet now carries the `packages/cli` clause: the local step is `--project unit`; `--project integration` runs locally only when the diff touches that tier, a spawn entry or a driver/kernel boot path, and is otherwise declared to CI, where `pnpm test` runs both tiers; a new spawning or booting test lands in the integration tier by the config's own predicate, and the partition pin reds when a file is in neither or both. The earlier same-meaning step in 本地验证范围 carries a one-line qualifier pointing at that bullet, so the two never disagree. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox * docs(agents): never end a turn to wait — block in the foreground on the lock, a gate batch or any slow step Rule 7 of 资源纪律 (排队不是停摆) gains its missing half: waiting on the verification lock, a gate batch or any slow step is a foreground block inside the turn (the lock script waits by itself; Monitor only in its blocking until-loop form), never a reason to end the turn. A turn has two legal endings, the final report JSON or a blocked/needs_decision report; "I will continue once X finishes" is a stall, not an ending. The criterion is shared by the report's writer and its reader: a last sentence that is an intention rather than a result means the dev has stalled, not completed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox * docs(agents): derive the local suite list from `turbo ls --affected` against the merge base, not from "the packages I changed" Step ② of 本地验证范围 now says what the affected-package list IS: the population CI will test, read from `TURBO_SCM_BASE="$BASE" pnpm exec turbo ls --affected` (the same merge-base reading CI takes), never guessed as "the packages I changed" — a package that consumes the changed module by an ordinary import is in that list and owes its run. Paid inside the file's ceiling by tightening filler in the same paragraph (an incident aside, a stale count, connective words); every prohibition and every command in the paragraph is kept. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 88bc10e commit 7087f99

1 file changed

Lines changed: 26 additions & 16 deletions

File tree

.claude/agents/os-dev.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ model: opus
113113
不回已丢的那个。**排队 ~20 分钟无进展 ⇒ 先看这次检查能否收窄到不必持锁(收窄
114114
要申报,见「干净收尾」);收窄不了就停下报 `blocked` 并点名持锁者** —— `os-verify-lock.sh
115115
--status` 打印持锁者、已持时长与队列;一动不动的持锁者本身就是真发现。沉默是唯一错
116-
误答案。
116+
误答案。**等锁、门禁批或任何慢步骤,一律在本轮内前台阻塞**:锁脚本自己会等,Monitor
117+
只配 until 循环的阻塞用法;⛔ 永不为了等而结束回合。回合只有两种合法收尾:终报
118+
JSON,或 `blocked` / `needs_decision` 报告;「我会在 X 完成后继续」不是收尾,是停摆。判据,写
119+
与读报告同一条:最后一句是意图而不是结果 ⇒ 该 dev 已停摆,不是已完成。
117120

118121
## Toolchain traps(每条都至少让一个 agent 白跑一轮)
119122

@@ -143,20 +146,21 @@ model: opus
143146

144147
## 本地验证范围 —— 本地只跑定向门禁,全农场归 CI
145148

146-
**不要**把 lint workflow 里的 `check:*` 全枚举出来本地跑 55+ 个 —— 无论如何 CI 都会把农场恰
147-
好跑一遍。你的本地清单:① 先 build 依赖闭包(`pnpm --filter '<pkg>^...' build` —— 新 worktree 的
148-
第一条命令);② 受影响包自己的 `pnpm test` / `pnpm typecheck`,用 `--filter` 圈定;③ 派发词点名的
149-
门禁族,加上你看得出被牵连的(新 fake engine ⇒ `check:engine-double-contract`;新错误码 ⇒
150-
`check:error-code-casing`; `.claude/agents/**``check:agent-model-declared`;任何编辑 ⇒ `check:nul-bytes`);④
151-
派发词的门禁清单是**线索不是规格** —— 哪怕当天仔细取的清单也会漏族,点名的跑绿之
152-
后,对你 **实际**改动的路径重新推导 —— **`node scripts/pm/dispatch-gates.mjs` 不传路径**,脚本自
153-
己从 merge-base 取变更集(含未提交与未跟踪);⛔ 别自己 `git diff` 出一份清单喂它:两点
154-
`origin/main..HEAD`**此刻**的 origin/main 求值,分支切出后落地的姊妹 PR 文件会算到你头上(实
155-
测一次三个),而它**退出码 0**、门禁只多不少,于是全绿、无人察觉,只有报告里那
156-
份「我跑了哪些门禁」悄悄变成假的。浅检出上脚本会**响亮拒绝**而不是给错清单 —— 照
157-
它说的加深即可。补跑它新增而你的 diff 确实触及的,并在报告里点名新增项。代价是偶尔
158-
一轮 push-fix;安全的另一半归 PM,在你报告之后读真实门禁 job 结论。⛔ 这不是跳过点名族的
159-
许可 —— 它们是你仍然欠的便宜一半;你不再欠的是报告前等 CI。
149+
**不要**把 lint workflow 的 `check:*` 全枚举本地跑 —— CI 会把农场跑满。你的本地清单:① 先
150+
build 依赖闭包(`pnpm --filter '<pkg>^...' build` —— 新 worktree 的第一条命令);② 受影响包自己的
151+
`pnpm test` / `pnpm typecheck`,用 `--filter` 圈定,受影响包 = CI 会测的包,清单读
152+
`TURBO_SCM_BASE="$BASE" pnpm exec turbo ls --affected`,⛔ 不按「我改了哪些包」猜:普通 import 被改模
153+
块的包也在清单里,欠它们的测试;`packages/cli` 只欠 `unit` 层(见「Definition of done」测试条);③
154+
派发词点名的门禁族,加上你看得出被牵连的(新 fake engine ⇒ `check:engine-double-contract`;新错
155+
误码 ⇒ `check:error-code-casing`; `.claude/agents/**``check:agent-model-declared`;任何编辑 ⇒
156+
`check:nul-bytes`);④ 派发词的门禁清单是**线索不是规格**,当天取的也会漏族,点名的跑绿
157+
后,对你**实际**改动的路径重新推导 —— **`node scripts/pm/dispatch-gates.mjs` 不传路径**,脚本
158+
自己从 merge-base 取变更集(含未提交与未跟踪);⛔ 别自己 `git diff` 出一份清单喂它:两点
159+
`origin/main..HEAD`**此刻**的 origin/main 求值,分支切出后落地的姊妹 PR 文件算到你头上,而
160+
**退出码 0**、门禁只多不少,全绿无人察觉,报告里那份「我跑了哪些门禁」却是假的。
161+
浅检出上脚本**响亮拒绝**而非给错清单,照它说的加深。补跑它新增而你的 diff 触及的,报
162+
告里点名新增项。代价是偶尔一轮 push-fix;另一半归 PM,在你报告后读真实门禁结论。⛔ 这
163+
不是跳过点名族的许可 —— 它们仍是你欠的便宜一半;你不再欠的是报告前等 CI。
160164
⑤ diff 编辑了门禁/工具脚本 ⇒ 该脚本**自己的**测试套件是不可省的一步,在派生族之外另
161165
欠 —— 派生答「哪些门禁读你改的文件」,不含「哪些测试测这个脚本」:跑同目录点名它
162166
`*.test.ts`,加同包 tests 下 `git grep` 该脚本文件名的全部命中(实测:一次门禁脚本编辑,派生
@@ -308,7 +312,13 @@ dispatch prompt 只携带每单增量(裁决引文、裁决 / PM-机制假设分
308312

309313
- 实现满足 issue 的验收判据。
310314
- 测试:新增/更新覆盖;跑受影响包的 `pnpm test` / `pnpm typecheck`,为报告留真实输出 (范围
311-
按「本地验证范围」圈定)。
315+
按「本地验证范围」圈定)。**`packages/cli` 的卡本地只欠 `unit`**:
316+
`pnpm --filter @objectstack/cli exec vitest run --project unit`;`integration` 层声明给 CI(`pnpm test`
317+
在那里跑两层)。只有 diff 碰到 integration 层文件、spawn 入口(`bin/`
318+
`test/helpers/serve-process.ts`)或 driver/kernel 启动路径时才本地跑 `--project integration`,并在报告里
319+
说明;否则报告写「integration 层已声明给 CI」。层是测出来的,不是列出来的:新增会 spawn
320+
CLI 或启动 driver 的测试,按 `packages/cli/vitest-tiers.ts` 的判据自动落 integration 层;分区 pin
321+
`test/vitest-tiers-partition.test.ts` 在某个测试文件两层皆无或皆有时变红。
312322
-`git push -u origin claude/issue-<n>-<slug>` 推上去(网络失败退避重试)。
313323
- **Draft** PR 指向 `main`,正文首行 `Fixes #<n>` —— **合并不应关卡时用 `Part of #<n>`**(你只实现
314324
了可执行的那一半;说明留下的是哪一半)。⛔ 永不 `Fixes` 一张还在决策箱的卡 —— 合并

0 commit comments

Comments
 (0)