From fa55c9d0ad6d5cb0dd1510b7b787d82c910a8a0b Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 17 Sep 2026 16:41:55 +0000 Subject: [PATCH] docs(agents,dogfood): point both ablation instruction surfaces at scripts/ablation-replace.mjs beside its sibling preflight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_01Gqi43smmqjJ5sUrhfoPeKu --- .claude/agents/os-dev.md | 2 +- packages/qa/dogfood/README.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index eea00036194..f36bc04a85d 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -251,6 +251,7 @@ model: opus - 那份绿给一条可能永远失败不了的断言背书,对 CI 永久隐形(CI 构建正确,那边永远绿)。 - 消融本就为证明新门禁能失败时,这份假绿读作门禁没触发,于是有人去弱化一条好门禁。 - 每一腿(变异与还原)都是:改动 → 证明它真落到了磁盘 → `pnpm --filter build`。 +- 落盘走 `node scripts/ablation-replace.mjs`,不走 `-i` 家族:锚点必须命中,写入与还原按磁盘核验。 - 再证明它到达了 `dist/`,才读运行结果:`node scripts/ablation-dist-preflight.mjs ''`。 - 删守卫的消融以及每个还原腿,用 `--absent`。 - ⛔ 还原腿不可跳过:留在 `dist/` 里的 marker 会让变异代码对该树之后的每次运行继续生效。 @@ -316,7 +317,6 @@ model: opus ## 干净收尾 —— 报告是你的终局动作 -- 报告落两次,GitHub 优先:卡片评论在前,终报消息在后。 - 终报消息之前,把同一段 JSON 发成 issue 评论,首行单独一行、就是字面纯文本 `os-dev-report`。 - 全文 ⛔ 不出现 HTML 注释:sanitizer 落库后吃短尖括号片段,连反引号里的也吃。 - 被吃掉标记的评论对 PM 扫描不可见;HTML 注释形不是等价写法,是坏写法。 diff --git a/packages/qa/dogfood/README.md b/packages/qa/dogfood/README.md index e0216f6a193..317f9a7a45e 100644 --- a/packages/qa/dogfood/README.md +++ b/packages/qa/dogfood/README.md @@ -46,7 +46,11 @@ the generic verifier cannot auto-derive. green-on-the-bug test is not a gate — and an ablation run against a stale `dist/` is exactly that, silently: it certifies an assertion that may never be able to fail, and no later CI run can expose it (CI builds correctly, so it stays green - there forever). Prove the mutation actually reached the built artifact before + there forever). Make the revert itself through + `node scripts/ablation-replace.mjs --file --anchor --replacement -- ` + rather than `sed -i` / `perl -i`: the anchor must hit, the write and the restore are + verified against the disk, and a mutation that did not land exits non-zero instead of + handing you a green run. Prove the mutation actually reached the built artifact before trusting the colour: `node scripts/ablation-dist-preflight.mjs ''` (`--absent` when the revert deletes a guard rather than adding something identifiable) exits non-zero unless it does.