Repository navigation
Commit b60484d
pm: the low-risk arm lands an add-only ADR note as Tier S; any other ADR change stays H (#33975)
Fixes #33539
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9DhBTDykFH6f9bchWYkPpus)_
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:低风险 Tier H 臂多认一族路径 `docs/adr/**`,只放行“只增注释”:每个 hunk 只加不删、不加 Status
行、不在 Decision/Status 节下加行、不新建/改名/删除 ADR 文件。本 PR 同时删掉
`.github/CODEOWNERS` 的 `/docs/adr/` 行(main 的 #33948 规定带臂的行不得有 CODEOWNERS
行;`/ui/docs/adr/` 保留),头注释里逐字引的裁决「adr 只能由维护者自己确认,人工合并,ai
不得擅自合并。」原样保留,其下加一行:该裁决因此收窄到“只增注释以外”的 ADR 改动。
- 为什么改:卡 #33539,席位要能按 #33501 同一裁决自行落地 ADR 补注,而不必每次等两位 approver。
- 风险与回滚:只读器全部 fail-closed(读不出就是 H);回滚即 revert 本 PR,`adr` 行回到普通 Tier H。
删掉 `/docs/adr/` 的 CODEOWNERS 行后,根 ADR 的 PR 若以 ready 状态打开(或手动转
ready),GitHub 不再自动发 code-owner 审查请求;对“只增注释以外”的 ADR 改动,裁决改由队列守卫(无
GOVERNED_APPROVERS 批准即拒)和中继逐 PR 请求两位批准人来守住。
- 先看:`scripts/pm/check-governed-merges.mjs` 的 `addOnlyNoteReasons` 与
`lowRiskArmVerdict` 改动,再看队列守卫 `catalogFilesOf`。
- 两分钟验证:`node scripts/pm/check-governed-merges.mjs --self-test` 与 `node
scripts/pm/check-governed-queue-guard.mjs --self-test`,看 ADR 两组电池。
- 需要你做的:本 PR 动 governed 面,请按 GOVERNED_APPROVERS 审批。批准新 head 即是确认上面那条 ADR
裁决收窄到“只增注释以外”(只增注释走低风险臂,Ruling-ref Leehom「同意 把低风险的 Tier H 放权给座位」)。
## What changes
- **Register** (`scripts/pm/check-governed-merges.mjs`): the `adr` row
(`docs/adr/**`, Tier H) gains `lowRisk: { repos: ['objectstack'],
addOnly: true }`. It is one more path family under the same low-risk arm
(#33501 ruling), not a new arm: the arm's conditions stay as they are
(no contract, no security label or name, no fork, same-head PASS
record).
- **The add-only reading** (`addOnlyNoteReasons`), from a full-context
diff of merge base to head (`addOnlyDiffArgv`: `--no-renames
--no-ext-diff --no-textconv --unified=1000000`, literal pathspec). A
modified `docs/adr/NNNN-*.md` reads S only when:
- the single hunk starts at line 1/1, adds lines and removes none, and
its counts match its header;
- every added non-blank line is on an **allowlist**: a plain ATX heading
(`#`…`######`, one space, plain text of ASCII letters and digits, Han
characters and plain punctuation: no other script, emphasis, code, link,
HTML, `#` or `\`), or plain prose at column 0, optionally `> `-quoted
and behind one list marker, starting on a letter, digit, opening quote
or bracket. No `<` (raw HTML, autolinks), fence marker, tab or character
reference anywhere. Anything else reads H;
- no added line is a status line: any line starting with a status word
after markup and opening punctuation are stripped (`Status (date): …`,
`(Status): …`, `Superseded by`, `Deprecated:`, `**状态**:…`), or carrying
`… status:` / `…状态:` anywhere;
- the ruled words are also read with spaces and punctuation squeezed out
(`D e c i s i o n`, `S.t.a.t.u.s`) — a reading used only to refuse,
never to decide that a record names a ruled heading, and no added line
sits directly above an existing setext heading (it would join that
heading's text);
- no added line sits under a heading that names the decision or the
status (`Decision`, `Status`, `Decided`, `Ruling`, `Resolution`,
决策/决定/裁决/状态 and the traditional 決策/決定/裁決/狀態), and no added heading names
one;
- every existing line keeps its heading and section (old and new sides
are both rebuilt from the hunk and their heading readings compared), so
an added heading, fence, frontmatter or setext underline cannot re-scope
existing text;
- a run inside a ruled section opens with a bare ATX heading at that
section's level or above, with a blank line above it;
- no added line carries a default-ignorable character or a Latin word
mixed with Greek/Cyrillic letters;
- the existing record carries no shape the heading reader does not model
(a list-borne or indented fence, a raw HTML block outside a fence); a
fence opened in a block quote ends with the quote;
- the record has a ruled heading at all (a record with none always reads
H), and the run is below the header block.
- An ADR file created, renamed, deleted, re-moded or not Markdown reads
H through the arm's existing mode checks plus a new "not Markdown"
reason. An ADR-only change owes no changeset; a skills path beside it
still does.
- **Queue guard** (`scripts/pm/check-governed-queue-guard.mjs`):
`catalogFilesOf` reads each queued ADR file's commit diff with the same
argv (`diff-tree -p -m --first-parent`), so the merge_group leg passes
such a PR on the same rule and its PASS record carries over as before.
- **Relay / `--pr` / post-merge sweep**: all read through
`pullCatalogReading`, which now attaches the ADR patch; no second
reader, and `scripts/pm/fleet-write/execute.mjs` logic is untouched.
- **`.github/CODEOWNERS`** (claim amendment 6898158057): the
`/docs/adr/` line is deleted, because main's mirror (#33948, ruling
record 6891850019) reds a CODEOWNERS line on a Tier H row carrying the
low-risk arm; `/ui/docs/adr/` keeps its line. The verbatim maintainer
ruling in the header stays, with one line under it: it holds for every
ADR change except an add-only note. The guard self-test's expected
pattern lists and its one-approver fixture (now on `/ui/docs/adr/`)
follow.
- **AGENTS.md PD14 and pm-dispatch** name the ADR leg
(`lowRiskArmVerdict`). Line counts unchanged (AGENTS.md 1050,
pm-dispatch 320).
## Why
Card #33539: a seat should be able to land an add-only ADR note on the
low-risk arm's Tier S path, while any change to an ADR's ruling or
status stays Tier H.
## Verification
- Self-test rows, both directions. The card's six
(`check-governed-merges`, battery "⚖️ #33539 …", 52 cases, pinned at
52):
- add-only passes (S);
- removed line, changed Status, line under Decision, new ADR file,
rename: each H.
- Plus review rows: re-scoping headings, fences, frontmatter, bare CR,
Chinese headings, status spellings, README/subfolder, hunk not at 1,
phantom setext, raw HTML, link definitions,
zero-width/homoglyph/inline-markup/entity/soft-hyphen Decision headings,
an opener with no blank line; a real-git fixture; the
`pullCatalogReading` path.
- Contract review round 4 (comment 6896800633): one row per probe
string, M1 (quoted fence), M2 (list-borne headings), M3 (empty link /
empty HTML element in a heading), S1 (inline HTML), S2 (Chinese and
dated status), N1 (list-borne link definition), each H; plus a row that
plain notes (quoted, listed, emphasised, linked, Chinese) still pass.
Round 5 (comment 6897145164): S3 (a line joined onto a setext heading),
S4 (look-alike and letter-spaced ruled headings) and N3 (status words
behind punctuation or after a word) each have an H row; round 6 (comment
6897472749) adds S5 (traditional Chinese ruled words) and S6 (`## Stat
usage` names no ruled heading); the ADR battery is pinned at 52. Probe
over the 155 shipped records: an appended plain note reads S on 149; the
6 others name no decision or status heading, so they read H.
- Queue guard battery "⚖️ the ADR leg at the queue …" (12 cases).
- Relay row: a `docs/adr/**` + `packages/core/**` diff reads the arm
(timeline GET), still plans Tier H and requests both approvers.
- `node scripts/pm/dispatch-gates.mjs --commands` on the final head:
every listed command run and reconciled with `--ran`; plus the importer
self-tests.
- Independent review: three rounds; the last one passed with no
must-fix. Its should-fix and nits were fixed in 1d110f5. The at-tier
contract review then failed round 4. The reader moved from a denylist to
the allowlist above in d038e0d; the delta round passed, and its two
should-fixes and N3 are closed in 8850e1f, and round 6's S5 and S6 in
9a9d920.
- Forced self-test edits in my own rows: a balanced code block added in
Context and a `## **Notes**` heading now read H (they read S before the
allowlist).
### Forced test edits (named)
- `scripts/pm/fleet-write/execute.mjs` (self-test only, surface added by
the seat's claim amendment): the Tier H fixture `tierHFiles` and the
`twoPages` fixture used `docs/adr/**`, which now reads the arm. Both
move to `docs/NORTH-STAR.md` (still Tier H, no arm); the three expected
strings follow. One new row pins the ADR + core behaviour above.
- `check-governed-merges` existing arm tests: the arm-rows test now
expects `adr,skills-catalog,ui-skills-catalog`, with `addOnly` only on
`adr`; the `lowRiskRowHit` test follows.
- Battery floors: merges `SELF_TEST_BATTERY_FLOOR` 39 → 40 after the
merge of main (main's #33814 took 38 → 39; the ADR battery itself pinned
at 52), guard 31 → 32.
### Notes for the reviewer
- **AGENTS.md PD14** paid its added words by deleting "; the post-merge
audit is the compensating control". Its surviving home is the same PD14
paragraph ("Behind it: … the post-merge audit … lists every
governed-surface merge … a Tier S merge without a PASS record is a seat
violation").
- **pm-dispatch**: "`.github/workflows/**`" became "本仓 workflows" (the
glob survives at the register line, L184), and "(技能独占)" became "(该面独占)".
- The arm's security-name test also runs on ADR file names, so an ADR
whose name carries a security word stays H (fail-closed, left as is).
- Left fail-closed by design: a git read with trimmed output gives a
false H (the count check guards it); anything off the allowlist (any
`<`, fences, tables, nested lists, headings with markup) reads H;
records with no ruled heading always read H.
- `ui/docs/adr/**` is not on the arm and stays H.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [ ] 3. No formatter ran; `pnpm lint` passes. (no formatter ran; `pnpm
lint` was not run here, since no package source changed: the derived
gate list and the script self-tests ran instead)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset. (nothing
publishes: `skip-changeset`)
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English. (except the required
维护者速读 block)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmRrk1KF2ZJk57PwVU9
<!-- signed: domain:skills#1 · os-steve ·
session_01ADHkmRrk1KF2ZJk57PwVU9 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 64911c6 commit b60484d
6 files changed
Lines changed: 668 additions & 49 deletions
File tree
- .claude/skills/pm-dispatch
- .github
- scripts/pm
- fleet-write
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
| 203 | + | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
0 commit comments