Skip to content

Commit fa55c9d

Browse files
committed
docs(agents,dogfood): point both ablation instruction surfaces at scripts/ablation-replace.mjs beside its sibling preflight
The two documents that route an agent to `scripts/ablation-dist-preflight.mjs` now also route it to `scripts/ablation-replace.mjs`, in the order an ablation runs them: mutate on disk through the anchor-verifying helper, then prove the mutation reached `dist/` with the preflight, then read the run. `.claude/agents/os-dev.md` stays line-neutral (403 / 403): the new pointer sits under the mutate-then-build line of the ablation step; it is paid for by deleting the 干净收尾 opener that restated the header's two-delivery rule and the following bullet's ordering. `packages/qa/dogfood/README.md` gains one sentence in step 4 of "Adding a golden test", beside the existing preflight sentence. Adoption-style pointer only: not a mandatory path, no gate, no migration of existing ablation scripts. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gqi43smmqjJ5sUrhfoPeKu
1 parent f6189a4 commit fa55c9d

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎.claude/agents/os-dev.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ model: opus
251251
- 那份绿给一条可能永远失败不了的断言背书,对 CI 永久隐形(CI 构建正确,那边永远绿)。
252252
- 消融本就为证明新门禁能失败时,这份假绿读作门禁没触发,于是有人去弱化一条好门禁。
253253
- 每一腿(变异与还原)都是:改动 → 证明它真落到了磁盘 → `pnpm --filter <pkg> build`。
254+
- 落盘走 `node scripts/ablation-replace.mjs`,不走 `-i` 家族:锚点必须命中,写入与还原按磁盘核验。
254255
- 再证明它到达了 `dist/`,才读运行结果:`node scripts/ablation-dist-preflight.mjs <pkg> '<marker>'`。
255256
- 删守卫的消融以及每个还原腿,用 `--absent`。
256257
- ⛔ 还原腿不可跳过:留在 `dist/` 里的 marker 会让变异代码对该树之后的每次运行继续生效。
@@ -316,7 +317,6 @@ model: opus
316317

317318
## 干净收尾 —— 报告是你的终局动作
318319

319-
- 报告落两次,GitHub 优先:卡片评论在前,终报消息在后。
320320
- 终报消息之前,把同一段 JSON 发成 issue 评论,首行单独一行、就是字面纯文本 `os-dev-report`。
321321
- 全文 ⛔ 不出现 HTML 注释:sanitizer 落库后吃短尖括号片段,连反引号里的也吃。
322322
- 被吃掉标记的评论对 PM 扫描不可见;HTML 注释形不是等价写法,是坏写法。

‎packages/qa/dogfood/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ the generic verifier cannot auto-derive.
4646
green-on-the-bug test is not a gate — and an ablation run against a stale `dist/`
4747
is exactly that, silently: it certifies an assertion that may never be able to
4848
fail, and no later CI run can expose it (CI builds correctly, so it stays green
49-
there forever). Prove the mutation actually reached the built artifact before
49+
there forever). Make the revert itself through
50+
`node scripts/ablation-replace.mjs --file <path> --anchor <text> --replacement <text> -- <cmd>`
51+
rather than `sed -i` / `perl -i`: the anchor must hit, the write and the restore are
52+
verified against the disk, and a mutation that did not land exits non-zero instead of
53+
handing you a green run. Prove the mutation actually reached the built artifact before
5054
trusting the colour: `node scripts/ablation-dist-preflight.mjs <pkg> '<marker>'`
5155
(`--absent` when the revert deletes a guard rather than adding something
5256
identifiable) exits non-zero unless it does.

0 commit comments

Comments
 (0)