Skip to content

[Decision] 新增任何手写文档页都必须改一个 .claude/ 生成物,于是每张文档卡都变成人工合并 —— 这一条要不要开机械化例外 #10277

Description

@os-elon

Surfaced while reviewing #10211 / PR #10273 (epic #10206). Measured, not suspected.

The collision

scripts/docs-audit/check-audit-scope.mjs keeps ALL_HANDWRITTEN — the docs-accuracy-audit's scope list — inline inside .claude/workflows/docs-accuracy-audit.js, and it has to: a workflow script runs in a node:vm with codeGeneration disabled and no filesystem, so it cannot enumerate content/docs/** itself and cannot read a JSON artifact either (the file's own docblock says so, citing #4851). The scope is exactly content/docs/**/*.mdx minus references/**, and the gate fails in both directions the moment the list and the tree disagree.

check:docs-audit-scope is on the gate list for any content/docs card. So:

adding a hand-written docs page ⇒ regenerating a .claude/ file ⇒ the PR's path surface hits the governed surface ⇒ human-merge-only.

The two acts cannot be split into separate PRs: split them and the docs half is red.

Blast radius, counted

PR #10273 is the first instance. Seven more are already queued or in flight under #10206#10210, #10213, #10215, #10216, #10218, #10222, #10237 — every one of which adds at least one page. #10209 escaped only because it adds a nav line and no .mdx. Beyond this epic it applies to every future docs page the project ever adds.

The governed-merge discipline exists so an agent cannot quietly rewrite its own instructions. What is actually landing in these diffs is a machine-regenerated sorted list of doc paths inside a block that is itself labelled // GENERATED — do not hand-edit. That is not the risk the rule was written for — but the rule is deliberately non-proportional ("一条命中就分叉, ⛔ 不按比例判"), and I am not going to reinterpret it myself.

  • 项目长远合理性:现状让「治理面」和「派生产物」共用一个路径谓词。每加一页文档就要人工合并一次,久了必然出现两种坏结果之一——要么维护者被无意义的合并请求淹没而开始盲签(治理形同虚设),要么文档页因为等不到人而积压。把判据从「路径命中」收窄到「这个 diff 是不是纯粹的生成块重算」是缩小特例、不是增生特例。
  • 实际业务拉动:今天就撞上了,不是假想。PR docs(automation): add scheduled jobs and email templates guides #10273 已经在等人工合并,同一 epic 下还有 7 张卡会依次撞上同一堵墙;这是本轮唯一一个会阻塞交付的结构性问题。
  • 防 AI 犯错:选项 C 比现状能防错,因为它把「只许重算、不许手改」变成机器判据:闸门验证该文件的 diff 只落在 GENERATED 块内、且与 --write 的输出逐字节一致,任何真正改 workflow 行为的编辑照旧落进人工合并。现状是「一律人工」,靠人眼在 439 行 diff 里认出那 2 行是不是生成的——这恰恰是响亮拒绝优于人工容忍的场景。
  • 创业阶段不扩散:选项 C 是给已有闸门加一个可判定的谓词,不新增能力面、不新增标签、不新增流程;选项 B 要重构 workflow 的取值通道,那才是扩散。

推荐:C。 把 governed 判据从「文件 .claude/workflows/docs-accuracy-audit.js 被碰到」收窄为「该文件被碰到, diff 不完全等于 node scripts/docs-audit/check-audit-scope.mjs --write 的输出」。纯重算放行进队列,任何其它编辑照旧人工合并。这是机械可判的,不依赖任何人的判断。

选项

本分析看不见什么:我没有量过维护者实际的合并延迟——如果你本来就每天扫一遍 Review-requested 队列,A 的代价可能比我估计的小得多,那 C 就只是省事而不是必要。我也没有验证 --write 的输出在所有情况下都是确定性的(排序稳定、无时间戳);C 的闸门依赖这一点,落地前必须先测。

Routing

domain:skills — the governed-surface definition lives in .claude/skills/pm-dispatch/ and AGENTS.md, and any change to it is skills-class. Filed by a maintainer-directed PM session under the standing direct-dispatch channel; not auto-adjudicated: it sits on the human floor twice over (governed-surface definition = ADR/skills class, and any gate-weakening reading is a 门禁削弱 decision).

Meanwhile PR #10273 is parked correctly — draft, review requested from os-zhuang, not queued. No work is lost either way you rule.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions