Skip to content

Commit 509289c

Browse files
chore(governance): the guard scripts join the governed register, .claude/** lands by declared rule-change, a declared narrowing waits for the maintainer (#35610)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu72Wnwx2ESew3k8vGRt7jiX)_ Fixes #35321 Clause-②: no Metadata-protocol: none Rule-change: yes Branch note for the Duplicate Fix Guard: `claude/project-thread-ndkip6` is the branch the card thread's harness assigns, and the claim comment on the card names it; it carries no issue number by construction. ## 维护者速读 - 用户能看到什么变化:用户无感。车队内部:改动「判定谁能合并」的那几件工具本身、改动车队规则条文,今后都要等你亲手批准;只改措辞和流程的车队文档仍由席位凭复核落地,但提交时必须声明「没有改规则」,复核记录也要确认这一点;会让现有应用报错的规范收紧,入队前同样要等你批准。 - 为什么做:属于「评审分工」这一轮整理,把你今天上午确认的几点落成机器检查——今天改守门工具本身可以绕开所有拦截。 - 出错会怎样:声明或复核记录缺失时,相关改动会被合并队列拦下等你批,不会误放行;本 PR 合并后有七个在途改动会先被拦下(明细见下文英文部分),补上声明或由你批准即可放行;拦错了你批准一次即可放行,整个改动可以一次撤回。 - 要你做什么:审阅并批准本 PR(它自己就改了规则条文和守门工具)。 ## Source The card's source line, the maintainer (Warren), 2026-11-19, review-split discussion thread, verbatim and untranslated: > 03:16Z 「以上都同意」 > 03:17Z 「北极星、AGENTS.md、改车队规则的技能条文(谁能做什么、怎么定级、怎么合并)也需要fable 吧」 > 03:17Z 「spec:收紧作者能写的东西(会让现有应用报错),也需要fable 吧?」 > 04:24Z 「1+2+4」 > 04:30Z 「「已裁定的照抄只核对、不再审」 同意」 Point 1 of 「1+2+4」 returns fleet rule text to the maintainer and overrides the 2026-09-18 ruling where that ruling handed all of `.claude/**` to the seats on a contract review. Rule text is: what an agent may do without him (merge, bypass checks, change repository settings); what gets done and in what order (grading, dispatch, scope); what must go to him (decisions, maintainer actions). Process steps, scripts, wording, slimming and file moves stay with the reviewer. ## What changes The card's five items, in its order, then the authors' side added in the patch round. 1. **The guard instruments are register rows, Tier H, scoped to objectstack.** Four exact rows join `GOVERNED_SURFACES`: `scripts/pm/check-governed-merges.mjs`, `scripts/pm/check-governed-queue-guard.mjs`, `scripts/pm/record-recognisers.mjs`, `scripts/pm/dispatch-gates.mjs`. The card's conditional was measured before the edit: `readWorkflowDiff` could read an edit to the guard's own workflow file as Tier S, so `.github/workflows/governed-surface-guard.yml` joins `WORKFLOW_TIER_H_FILES` (seven always-H workflow files now). `.github/CODEOWNERS` mirrors the four rows, which `codeownersMirrorVerdict` demands. 2. **`.claude/**` splits by declaration.** The row keeps `tier: S` and gains `ruleChange`; `applyRuleChangeSplit` runs last in the tier chain and answers Tier H unless the PR body carries one bare line-start declaration of `none` (or of `ruled` together with one bare line-start ruling reference) and the PASS record on the current head carries `Rule-change-verified:` with the same value. A missing line, a `yes`, a quoted, fenced or doubled line, or a record that does not verify is Tier H. `.claude/settings*.json` and everything under `.claude/hooks/` are Tier H by path whatever is declared, and CODEOWNERS now carries a line for each. `ui/.claude/**` and every other repository's `.claude/**` stay Tier H. - Path-only callers of `governedTierFor` and `testVerdict` (`--test`, `--branch`) now answer Tier H for `.claude/**`: a path list cannot say what a body declares. - At the queue the body is read on the pull read the head already costs. The declaration alone gives Tier S there, and the record leg then requires stands, PASS and the verified line (`ruleChangeRecordVerdict`); a record carried across a head move must not have crossed a `.claude/**` hunk. - `--pr` stages the record read the way the low-risk arm does (pending, read, asked again). 3. **A declared narrowing lands like Tier H.** A new leg of the queue guard, `merge_group` only, reads every queued pull's body and every changeset its commit carries, line by line with the fleet's two readers. A declared narrowing (the narrowed value of the metadata-protocol line, or the narrowing arm on either value of the clause line) is refused on exit 10 until both halves are on record: an authorized APPROVED review, and a PASS contract review that stands on the current head. `added`, `semantic`, `none` and a bare clause line cost one already-memoized pull read and change nothing. Unreadable inputs refuse on exit 11. Exit precedence is governed, then size, then narrowed. - Measuring the PR template for item 6 found a defect in this leg as first pushed: the template's unfilled menu line (the metadata-protocol key followed by its four kinds joined by bars) was read as a declared narrowing, and the changeset check passes such a body when the line is moot, so a pull that left the template untouched would have been refused at the queue. Now exactly that menu, as the template spells it, declares nothing (`UNFILLED_PROTOCOL_MENU`, built from the reader's own kind list); a partial menu that still spells the narrowed kind counts as before. The pin reads the template file from disk. 4. **The `workflows` row adds `hotcrm`**, as the audit mirror: a merged hotcrm workflow change now produces a row in the sweep. `objectos` and `mobile` stay out. 5. **Prose.** `AGENTS.md` Prime Directive #14 names the four instruments and states the split in one sentence; the pm-dispatch path-fork region names the same surfaces, the split and the declared-narrowing landing; `references/contract-review.md` names the record's `Rule-change-verified:` line, and `record-recognisers.mjs --template` and `--brief-template` print it (shipped as `yes`, so an unedited paste lands nothing) with one duty wording both share. 6. **Authors are told to write the declaration.** Two files, added on the file surface the claim was widened to: - The developer agent's instruction file (`.claude/agents/os-dev.md`), in its definition of done: a diff that touches the root `.claude/**` tree owes the PR body one line-start declaration, judged from the diff. It gives the three values (`none`: no fleet rule changed, with the three kinds of rule named; `yes`: one changed; `ruled`: the text copies a ruling already made), says `ruled` owes a second line-start line quoting the maintainer with source and time and says a missing line lands as Tier H like `yes`. - The claim template in the pm-dispatch skill file carries no clause for it. One was added in the first patch round and taken back out at head `9a1758ee`, when `main` began to count the skill files in bytes with no headroom (the deletions are listed under Acceptance notes). The developer is taught by the agent file, and the seat by the Tier S line of the path-fork region. - `.github/PULL_REQUEST_TEMPLATE.md`: an italic note under the two declaration lines, asking for the line only when the pull changes a file under `.claude/`. The template carries no fillable line for it, so an unfilled template still reads as `missing`, as it did before. Measured before choosing the wording: no script or workflow reads the template file, the two existing line readers answer the same on the new template as on the old one, and the key is read only by the register's tier reading and only for a pull that hits the `.claude/**` row. No guard starts requiring the line on other pulls. Line budget: 1,751 changed lines (+1,602 / -149) over 9 files, against the 3,000-line human-merge line. ## Landing impact From the merge of this PR on, every open pull whose diff touches the root `.claude/**` tree lands as Tier H until its body carries the line-start declaration and the PASS record on its current head carries the verified line. `.claude/settings*.json` and `.claude/hooks/**` are Tier H whatever is declared. Read again at head `9a1758ee`, over all 52 open pulls (this one included), each pull's full file list: - #35443 (ready for review; `.claude/settings.json` only). Tier S today. Tier H by path after the merge, whatever it declares. Its body carries no declaration line. No other open pull touches the root `.claude/**` tree, the four instrument files, the guard's workflow file or `ui/.claude/**`. Item 3 changes a second set of open pulls, whatever paths they touch: from the merge on, a pull whose body or changeset declares a narrowing is refused at the queue until an authorized approval (or the authorized account's own enqueue) and a standing PASS contract review are on its head. Read at the same pass, by running this head's own reader, `narrowingDeclarationsIn`, over every open pull body: - #35604, #34738, #34223, #35664, #35697 and #35718 (all drafts): each body carries a clause line with the narrowing arm. Only pull bodies were read for this list. A narrowing declared in a changeset alone is read by the leg at the queue and is not listed here. The seat sends a notice to the owning seats of the pulls named in this section before this PR lands. The notices are sent: PR comment 7019977853 records those for #35443, #35604, #34738 and #34223, and the seat's notices for #35664, #35697 and #35718 are comments 7030716558, 7030722099 and 7030728219. ## Tests Head `9a1758ee`, which has `main` at `a457b515` merged in. Every exit code below was captured before any pipe. - `node scripts/pm/check-governed-merges.mjs --self-test`: exit 0, 959 assertions. New battery of 40 cases pins item 1 and item 2: each guard file is H in objectstack and ungoverned elsewhere; a `.claude/` wording path with both lines is S; a missing line, `yes`, an unverified record, a quoted, fenced or doubled line are H; settings and hooks are H by path with both lines on record; hotcrm workflows are governed. - `node scripts/pm/check-governed-queue-guard.mjs --self-test`: exit 0, 637 cases. Two new batteries (26 and 24 cases): the same branches driven end to end at the queue, the CODEOWNERS mirror, and the narrowed leg (declared without approval is refused on 10; `added` is unchanged on one pull read; both halves clear; each half alone refuses and names the missing half; unreadable inputs refuse on 11; the PR template left unfilled declares no narrowing, a partial menu still does; the narrowed kind on a runtime-only path, in five body shapes, is refused on a default-tier record and cleared on an at-tier one). - `node scripts/pm/record-recognisers.mjs --self-test`: exit 0, 456 cases. The template the tool prints is driven through the queue guard: with the reviewer's own `none` it clears, pasted unedited it does not. - `pnpm check:pm-governed-prose`: exit 0, both regions name all 17 rows that govern objectstack. `pnpm check:pm-skill-ratchet`: exit 0, counted in bytes since `main` at `a457b515`, with `AGENTS.md` at 78,011 of 78,106, the skill file at 33,872 of 33,872, the developer agent file at 38,846 of 38,848 and the review reference at 6,416 of 6,419. This PR edits no ceiling row. `pnpm check:pm-skill-id-lint`: exit 0. <details> <summary>One-time ablations (not kept as tests): three mutations, each red, each restored</summary> A1 to A3 ran at the earlier head `cd8dab31`; the patch round changed one tested behaviour (the unfilled-menu exemption), ablated at `eb947a21` as A4; the second patch round changed one more (the record half holds the narrowing face), ablated at `eb455747` as A5. Head `9a1758ee` changes prose only and no tested behaviour. All ran through `scripts/ablation-replace.mjs` in wrap mode on committed code; after each, the tool printed the restored blob equal to HEAD and an empty `git diff HEAD`. Expected direction was red in every leg but one, noted below. - A1, a `yes` declaration no longer refused (one line in `ruleChangeVerdict`): register self-test exit 1 with 4 failures; queue-guard self-test exit 1, failing `Rule-change-yes-is-Tier-H-refused-whatever-the-record-says`. - A2, the `guard-queue` row's exact path changed: register self-test exit 1 with 2 failures; queue-guard self-test exit 1 on four CODEOWNERS mirror pins. The prose gate stayed green on this mutation: it reads the row's `glob`, which the mutation left alone, so that leg measured nothing about the prose gate. - A3, the human half of the narrowed leg no longer required: queue-guard self-test exit 1, failing `narrowed-declaration-without-approval-is-REFUSED-on-its-own-code` and three sibling pins. - A4, at `eb947a21`, the unfilled-menu exemption removed from `narrowingDeclarationsIn`: queue-guard self-test exit 1, 1 of 636 cases failed, the pin `the-pull-request-template-left-UNFILLED-declares-no-narrowing-and-a-partial-menu-still-does`. A first attempt with an empty replacement was refused by the tool before the command ran and measured nothing; the run quoted is the second. - A5, at `eb455747`, the hold removed from `recordVerdict`: queue-guard self-test exit 1, 1 of 637 cases failed, the pin `the-narrowed-kind-on-a-runtime-only-path-holds-the-narrowing-faces-tier-a-default-tier-record-is-REFUSED-an-at-tier-one-CLEARS`, with the default-tier record clearing and the at-tier record refused in three of its shapes, which is what the same pin read on the code before the change. </details> ## Acceptance notes Deliberate choices a reviewer should see, and what is left outside this PR. - The record half of the narrowed leg holds the narrowing face's tier whichever line carries the declaration (the clause line's arm or the metadata-protocol line's narrowed kind), so a default-tier record does not clear it and an at-tier record does; a schema or governed path still decides first. - **The human half of the narrowed leg also counts the maintainer's own enqueue.** The card says an authorized APPROVED review; the 2026-10-26 ruling made an enqueue from an authorized account the same act for every landing the guard judges, so the leg accepts either and still requires the PASS record. Dropping the enqueue arm is a one-line change if the approver wants the approval alone; the question was put to the coordinator, who left it here for the approver. - **Two readers do not chain the split and still read the raw row's Tier S**: the relay's review-request plan and the patrol's landing row, both outside this card's file surface. Neither decides a landing; the queue guard does. Effect: a pull that declares a rule change is refused at the queue but is not auto-routed to the maintainer by the relay. CODEOWNERS routes the settings and hooks paths. A follow-up card for the two readers is filed by the card thread, not in this PR. - **The PR template gets a note, not a fillable line.** A fillable line would sit in every pull's body and be read as a declaration on pulls it does not concern; the note keeps the unfilled reading at `missing`. - **The early-warning (`pull_request`) leg reads no body**, so it names a `.claude/**` diff as Tier H until the body is read, and never reddens. - **The post-merge sweep has no audit leg for the split**; it lists the merge with its approver and merger as before. - **hotcrm's own half** (its instruction file listing workflows as governed) is a separate PR in that repository. - **Not on the register**: the readers the guard imports (the clause-line readers, the patrol module, the relay op table, the tier data file) and the `ui/` copy of the queue guard, which belongs to its own card. - **A near-arm spelling counts as a declared narrowing** (fail closed); a narrowing nobody declared stays the contract review's finding. - **The narrowed rule's prose home is one clause in the path-fork region**; Prime Directive #14 is about governed paths and was left to items 1 and 2. - **The refusal string of the narrowed leg cites its ruling by date**; the quotation lives in the script header. - **Content deleted to stay at the ceilings** (no ceiling moved; the first two rounds paid in lines, and head `9a1758ee` pays in bytes). `AGENTS.md` #14: the parenthetical after `.claude/**`, the sentence describing when the prose gate reds (shortened), the comment id after `pr_dequeue`, the rationale clause after the no-approving-review rule, the sentence about CODEOWNERS and the relay routing, the restated "tiered by the register" clause, and one repeated "on a PR whose diff touches a governed surface". Path-fork region: the restated "split before acting" clause, the bullet restating the developer agent's own rule for the reader summary, and the "(该面独占)" restatement. Review reference: the words saying who reads the security line, which the template legend carries. Developer agent file (three lines added, three paid, at the earlier heads): the bullet restating that one foreground blocking wait is the only wait shape, and the bullet restating that no lock, sibling build or watcher wakes the agent, both already said by the resource rules above them; two pointer lines to the body-sanitizer rule in `AGENTS.md` merged into one. At head `9a1758ee`, after the merge of `main` left the skill file 377 bytes and the developer agent file 38 bytes over their new byte ceilings: the claim-template clause added in the first patch round is taken back out; in the path-fork region the three lines that list the governed surfaces become one list line, with the `GOVERNED_REPOS` sentence on a line of its own, the two guard lines become one, and the tag 「(本仓)」 and one word of the skills-lane exception are dropped; in the developer agent file the three declaration lines become two, and the note that no other line may lead with the key is dropped (a second such line reads as Tier H at the guard, which prints the reason). - **Local narrowing of verification**: `pnpm check:i18n-coverage` answered exit 3, prerequisite not met (it needs the CLI and example builds); NOT MEASURED locally, left to CI. The diff touches no package, so there is no build closure and no package test owed. ## Verification Read first, by risk: 1. `scripts/pm/check-governed-merges.mjs`: the `ruleChangeVerdict` function and the register rows. Risk hunk: the order of its four checks, since Tier S is returned only with zero reasons. 2. `scripts/pm/check-governed-queue-guard.mjs`: `ruleChangeRecordVerdict`, `narrowedReading` and `narrowingDeclarationsIn`. Risk hunks: the queue leg defers the record to its own record leg, so the verified line is enforced there and nowhere earlier; the unfilled-menu exemption must stay an exact match. 3. `AGENTS.md` Prime Directive #14 and the two added lines in `.claude/agents/os-dev.md`: the new sentences, and the deletions listed above. Two-minute check: run `node scripts/pm/check-governed-merges.mjs --test scripts/pm/dispatch-gates.mjs`. Expected: exit 3, `landing tier: H`, the row named `the dispatch gates and the contract-review tier they declare`. On `main` the same command answers 0 hits. <details> <summary>Derived gate union</summary> At head `eb455747`: `node scripts/pm/dispatch-gates.mjs --commands` derived 78 commands from the 9 changed paths, one more than at the head before it (`pnpm check:agent-model-declared`, which reads the agent files). All 78 ran at that head, exit code recorded per command: 77 exit 0, 1 exit 3 (`pnpm check:i18n-coverage`, prerequisite not met). Nothing was carried from an earlier head. `--ran` reconciliation: `78 derived famil(ies) accounted for — 77 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)`. `pnpm check:nul-bytes` and `pnpm check:pm-dispatch-gates` are among the 77. The derivation printed a stale-tree note (12 commits behind `origin/main`, one derivation input changed there); the branch was not merged with `origin/main` at that head. At head `9a1758ee`: `main` at `a457b515` is merged in (no conflict), and one commit edits two files, the pm-dispatch skill file and the developer agent file. `node scripts/pm/dispatch-gates.mjs --paths` over those two files derived 26 commands; all 26 ran at this head and exited 0, the three self-tests and the prose, ratchet and id-lint gates quoted under Tests among them. The other 52 commands are carried from `eb455747` and left to CI on this head. `node scripts/pm/overlap-check.mjs` at this head: clean against `origin/main` and the one open pull that shares a file (#35582, `AGENTS.md`). </details> ## Human Minimum - [x] 1. No schema touched. - [x] 2. New names follow the casing of their kind. - [x] 3. No formatter ran. `pnpm lint` is CI's run on this PR and was not run locally. - [x] 4. One issue, one branch off `main`, one pull request. - [x] 5. Nothing published is touched, so no changeset; both declaration lines are filled in above. - [x] 6. `packages/spec` not touched. - [x] 7. No hand edits to generated references, changelogs or release notes. - [x] 8. Title, body and comments are in English, with the reader summary in Chinese as the template asks. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgVaDMEnj7SrgKsMrWN)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgVaDMEnj7SrgKsMrWN <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgVaDMEnj7SrgKsMrWN --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 06faee5 commit 509289c

9 files changed

Lines changed: 1602 additions & 149 deletions

File tree

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ model: opus
276276
- 认领的 `Clause-②:`、`Metadata-protocol:` 两行照抄进 PR 正文行首;无则零写,⛔ 不自造。
277277
- 两行同抄进 changeset 正文行首;`Check Changeset` 读 PR 正文:kind 即 `minor`,`none` 即 `patch`。
278278
- 种类非 `none` 或带 `(narrowing)` ⇒ 按 diff 加写 `Skills-docs:` 行;拼法与分工住认领模板。
279+
- diff 触根 `.claude/**` ⇒ PR 正文写行首 `Rule-change:` 行,按 diff 自判。
280+
- `none` 未改车队规则(agent 不经维护者可做什么、做什么与先后、什么须交他);`yes` 改了;`ruled` 照抄已裁条文,写行首 `Ruling-ref:` 引维护者原话、出处、时间。缺行同 `yes`:Tier H。
279281
- ⛔ 永不 `Fixes` 一张还在决策箱的卡:合并会静默关掉它,而收件箱过滤只读 open。
280282
- ⛔ 不写否定式的关单句,它照样关掉点名的卡:解析器无视否定,只匹配关键词 + `#<n>`。
281283
- 关键词是 `fix/fixes/fixed/close/closes/closed` 与 `resolve/resolves/resolved`;让它们远离其它卡号。
@@ -340,11 +342,9 @@ model: opus
340342
- 两条合法出路:在轮内同步等它(资源纪律的排队条款:限时获取 ⇒ 无锁工作 ⇒ 再取)。
341343
- 或者收窄这次检查的范围并在报告里申报:已申报的收窄是被接受的偏差,CI 跑满农场。
342344
- PM L1 审核的是 CI 收敛,不是你本地的覆盖面;未申报的收窄不在此列,那是漏跑。
343-
- 唯一同时反轮询又不停轮的形状是一次前台阻塞等待:前台跑完,或 `tail --pid` 等它退出。
344345
- 比回合长的门禁在写报告那一刻读日志(重定向目标);未完成的记 NOT MEASURED 并写原因。
345346
- 自检是机械的,不看你怎么形容这次等待:终消息只能是报告 JSON 或 `blocked` 报告。
346347
- 结束一轮之前自检:最后一条消息是否在描述你不拥有的进程给你的唤醒?
347-
- 排队的锁、别的 agent 的 build、脱管的 watcher 都不会来;保持这一轮活着,自己收退出码。
348348

349349
## 何时停手不写码
350350

@@ -397,8 +397,7 @@ model: opus
397397
- 不是 NUL 的控制字节也不是把门禁命中读成误报的理由。
398398
- 危害的论证在 `scripts/check-nul-bytes.mjs` 头部,引用它,别重推;push 前跑它。
399399
- 改动只要提到控制字符,就在门禁之外自扫:`grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]' <files>`。
400-
- GitHub 正文 sanitizer 是同一纪律的另一半:形状、触发条件与作者纪律归 AGENTS.md。
401-
- 归属条款是 AGENTS.md 的 GitHub mutates body BYTES 条;署名页脚两形如下。
400+
- GitHub 正文 sanitizer 的作者纪律归 AGENTS.md 的 GitHub mutates body BYTES 条;署名页脚两形如下。
402401

403402
```text
404403
--- ← 规则线,前留一空行;平台只认整块

‎.claude/skills/pm-dispatch/SKILL.md‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,28 +187,26 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 →
187187

188188
## 路径分叉
189189

190-
- **ACCEPT 之后的路径分叉**:翻 ready / 挂 auto-merge / 入队前先取一次 PR 的路径面。
191-
- 路径面用 `get_files` 取,⛔ 不看报告自述;动手之前先分,不是事后对照。
192-
- governed 面(定 Tier,非车道):`docs/adr/**`+`.claude/**`+`skills/**`+`docs/NORTH-STAR.md`+`.github/workflows/**`。
193-
- governed 面同含 `AGENTS.md`+`CLAUDE.md`;`GOVERNED_REPOS` 同治理、行可限仓,执行席恒随落地仓车道。
194-
- 另含 `ui/docs/adr/**`+`ui/.claude/**`+`ui/skills/**`+`ui/AGENTS.md`+`ui/CLAUDE.md`+`ui/.github/workflows/**`。
190+
- **ACCEPT 之后的路径分叉**:翻 ready/挂 auto-merge/入队前 `get_files` 取路径面,⛔ 不看报告自述。
191+
- governed 面(定 Tier,非车道):`docs/adr/**`+`.claude/**`+`skills/**`+`docs/NORTH-STAR.md`+`.github/workflows/**`+`AGENTS.md`+`CLAUDE.md`+`ui/docs/adr/**`+`ui/.claude/**`+`ui/skills/**`+`ui/AGENTS.md`+`ui/CLAUDE.md`+`ui/.github/workflows/**`。
192+
- `GOVERNED_REPOS` 同治理、行可限仓,执行席恒随落地仓车道。
193+
- 恒 H:守卫仪器 `scripts/pm/check-governed-merges.mjs`+`scripts/pm/check-governed-queue-guard.mjs`+`scripts/pm/record-recognisers.mjs`+`scripts/pm/dispatch-gates.mjs`+守卫 workflow+settings+hooks。
195194
- 定档 Tier H ⇒ ACCEPT 换终局四件套,混合 diff ⛔ 不按比例判;要拆让 dev 单独开 PR。
196-
- 改动 >3000 行(含生成物)同换终局四件套含③请审,⛔ 无 Tier S 例外;读数=PR additions+deletions。
195+
- >3000 行(含生成物,additions+deletions)或申报收窄同换终局四件套含③请审,⛔ 无 Tier S 例外。
197196
- ① 席位记录落 PR 先于 `pr_ready`/入队且钉 head:速读四行+席位意见,其下 `## 席位核对`。
198197
- ② PR 悬着等人批,同笔挂 `pm:awaiting-merge`;人工直合即审核记录,授权批准 ⇒ 席位落地。
199198
- 指针 `ACCEPT → PR #n comment <id>`;受管/spec 面欠 ①–④,席只达档补审现 head 记录未盖处。
200199
- 核对六项:形态/前提实测/门禁 check-runs/接受的偏差/范围外去向+`Skills-docs:`/落地条款。
201-
- 草稿归 dev:PR 正文带 `## 维护者速读` 四行(见 os-dev.md),中文业务话,不写席位意见。
202-
- 终稿 = 席位对照自己读的 diff 校正四行、加席位意见行,置顶席位记录;维护者只读评论。
200+
- 终稿 = 席位照自己读的 diff 校正 dev 草稿、加席位意见行,置顶席位记录;维护者只读评论。
203201
- `pm:awaiting-merge` 只挂 PR、不入六态,与请审同为等人批清单,随获批或撤回判决离开。
204202
- 批准后再推亦不过期;席位落地 = 过落地前检、清标、ready、auto-merge,踢出/变基同法。
205203
- ③ 请审 = 席位交棒:ACCEPT 与现 head 同形 PASS 俱在案,同轮中继 `pr_request_reviewers` 请审批人。
206204
- 作者是审批人 ⇒ `assign` 它、请其余(请它必 422);⛔ 永不请席位自身账号;Tier S 不交人。
207205
- `pr_create` 派不请;`pr_ready` 只补交棒漏;非例外 head 移 ⇒ 撤挂回等;脱中继 PR 自读请/派。
208206
- 速读「要你做什么」求批点名 PASS 评论 id+`Head-sha`;无 PASS ⇒ 写 contract review owed 不求批。
209207
- ④ 轮报单列 awaiting a human merge 并现读请审人;⛔ 未请审不在 chat 报「等你批」,先补请。
210-
- skills 车道自有 PR:纯代码面如 `scripts/pm/` 由本席自读(清单不减)后落地。
211-
- 受管面两层:Tier S = `.claude/**`+下行 S 面(该面独占),余皆 Tier H;S 经达档 PASS 后 ready→入队。
208+
- skills 车道自有 PR:纯代码面如 `scripts/pm/` 由本席自读(清单不减)后落地,守卫除外。
209+
- Tier S = `Rule-change: none`/`ruled` 记录核过的 `.claude/**`+下行面,余皆 H;达档 PASS 后 ready→入队。
212210
- 本仓 workflows 读 `readWorkflowDiff`(发布面/C2/拒读⇒H),技能与只增 ADR `lowRiskArmVerdict`,未读⇒H。
213211
- 入队资格:每 check 绿或预期 skip,⛔ 非必查子集;名单 check-expected-skips.mjs 只判 objectstack。
214212
- 非必查红是真缺陷或坏门,归 PM 入队前处置;第三种按设计而红,三条全立才可带红入队:

‎.claude/skills/pm-dispatch/references/contract-review.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
- 另记作者:PR `user.login` 非 `objectstack-fleet[bot]` ⇒ ③ 注点名该 login(脱中继写),落地前读。
4343
- ③ 恒查(席位自读同):SQL 可下推处新增 id 物化或应用内 join 而无因由 ⇒ 记发现(AGENTS.md)。
4444
- 简报从 `record-recognisers.mjs --brief-template` 起稿:只读条款与输入集内建,⛔ 不删 ⛔ 行。
45-
- 独立性对与低风险臂读的 `Security-touching:` 行,取值同见 `--template`;子代理记采纳它的席位。
45+
- 独立性对、`Security-touching:`、`Rule-change-verified:` 行取值见 `--template`;子代理记采纳席位。
4646
- ④ 恒由起草者之外的 agent 达档跑,起草已达档不免;喂入同上,⛔ 不喂起草者的结论。
4747
- 卡线程隔离子代理照上落现 head 记录并贴简报 ⇒ 席核简报、`Scope:` 与独立性对后采纳,
4848
ACCEPT 点名其评论 id;`Scope:` 窄于 `hits` 不采纳;席的补缺记录只管缺口,⛔ 不单充 head 记录。

‎.github/CODEOWNERS‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
# `node scripts/pm/check-governed-queue-guard.mjs --self-test` reads this file
2020
# (`codeownersMirrorVerdict`) and reds when a Tier H row has no line here, when
2121
# any line names fewer or other owners than that constant, or when a Tier S row
22-
# (`.claude/**`, which lands on a seat's review of record) is routed here. A
22+
# (`.claude/**`, which lands on a seat's review of record) is routed here. That
23+
# row splits by declaration since 2026-11-19, and the two paths under it that
24+
# no declaration moves to a seat — the hooks and the settings files — each
25+
# carry a line of their own, which the same self-test demands. A
2326
# Tier H row carrying the register's low-risk arm (`lowRisk`: the two skills
2427
# catalogs and the root ADR tree) has NO line here and reds if one is added:
2528
# the relay's per-pull review plan reads the arm and decides who is asked
@@ -48,14 +51,25 @@
4851
# The enforcement chain is routed the same way, deliberately: a PR that edits
4952
# the audit script, the approver constant or this file is a governance change —
5053
# without these entries the rule could be lifted by editing the enforcers
51-
# instead of the surfaces.
54+
# instead of the surfaces. Since 2026-11-19 the four guard scripts are register
55+
# rows themselves (Tier H) and sit with the surfaces below; this file is the one
56+
# enforcer still routed as a chain row.
5257

5358
# Tier H governed surfaces — the register's rows with tier H, less the
5459
# low-risk arm's `/docs/adr/` and `/skills/` rows (see the header)
5560
/AGENTS.md @os-zhuang
5661
/CLAUDE.md @os-zhuang
5762
/docs/NORTH-STAR.md @os-zhuang
5863
/.github/workflows/ @os-zhuang
64+
/scripts/pm/check-governed-merges.mjs @os-zhuang
65+
/scripts/pm/check-governed-queue-guard.mjs @os-zhuang
66+
/scripts/pm/record-recognisers.mjs @os-zhuang
67+
/scripts/pm/dispatch-gates.mjs @os-zhuang
68+
69+
# Always Tier H under the root `.claude/` row, whatever a pull declares — the
70+
# row itself has no line, since its other paths can land on a seat's record
71+
/.claude/hooks/ @os-zhuang
72+
/.claude/settings*.json @os-zhuang
5973

6074
# Tier H governed surfaces of the nested `ui/` workspace (#25712) — the same
6175
# register rows, under `ui/`; `ui/.claude/` is Tier H, unlike the root tree;
@@ -68,5 +82,3 @@
6882

6983
# The enforcement chain
7084
/.github/CODEOWNERS @os-zhuang
71-
/scripts/pm/check-governed-merges.mjs @os-zhuang
72-
/scripts/pm/check-governed-queue-guard.mjs @os-zhuang

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ _Keep one value on each of the two lines above, each line starting with its key.
1313
[Human Minimum](https://github.com/objectstack-ai/objectstack/blob/main/CONTRIBUTING.md#human-minimum)
1414
item 5 says what they mean._
1515

16+
_Only when this pull request changes a file under `.claude/`: add one more line there. It starts with the key
17+
word `Rule-change` and a colon, then `none` (no fleet rule changes), `yes` (one does) or `ruled` (it copies a
18+
maintainer ruling, quoted on a second line that starts with `Ruling-ref` and a colon). Every other pull request
19+
leaves it out._
20+
1621
## Human Minimum
1722

1823
Each item is one rule from

‎AGENTS.md‎

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -273,40 +273,40 @@ See `ui/AGENTS.md` for the app-id / localStorage / auth gotchas.
273273
14. **⛔ A governed surface lands only the way its tier allows — Tier H by the maintainer's hand (merge or enqueue)
274274
or an authorized approval, Tier S by the owning seat on a contract-tier review of record; before that record no AI
275275
seat merges, queues, or arms auto-merge on a PR whose diff touches one.** The governed surfaces are `docs/adr/**`,
276-
`docs/NORTH-STAR.md`, `.claude/**` (agents, hooks and settings — not only skills), `skills/**`, `AGENTS.md`,
277-
`CLAUDE.md` and `.github/workflows/**`, and under `ui/` `ui/docs/adr/**`, `ui/.claude/**`, `ui/skills/**`,
278-
`ui/AGENTS.md`, `ui/CLAUDE.md` and `ui/.github/workflows/**`. The register is `GOVERNED_SURFACES` in
279-
`scripts/pm/check-governed-merges.mjs`, each row carrying its tier; adding a surface is an edit *there*, never here,
280-
and `pnpm check:pm-governed-prose` reds per-PR when this paragraph names fewer surfaces than the register — or
281-
more. A fork PR (head repo ≠ base repo) is a proposal, never a delivery, whatever its paths: no AI seat readies,
276+
`docs/NORTH-STAR.md`, `.claude/**`, `skills/**`, `AGENTS.md`, `CLAUDE.md`, `.github/workflows/**`, under `ui/`
277+
`ui/docs/adr/**`, `ui/.claude/**`, `ui/skills/**`, `ui/AGENTS.md`, `ui/CLAUDE.md` and `ui/.github/workflows/**`, and
278+
the guard itself: `scripts/pm/check-governed-queue-guard.mjs`, `scripts/pm/record-recognisers.mjs`,
279+
`scripts/pm/dispatch-gates.mjs` and the register, `GOVERNED_SURFACES` in `scripts/pm/check-governed-merges.mjs`,
280+
each row carrying its tier; adding a surface is an edit *there*, never here (`pnpm check:pm-governed-prose` pins the
281+
list). A fork PR (head repo ≠ base repo) is a proposal, never a delivery, whatever its paths: no AI seat readies,
282282
queues, arms auto-merge on or approves it; the owning seat adopts the diff onto an internal branch and lands that.
283283

284284
**Authoring stays open to every seat** — drafting, pushing, opening and revising the PR. What is reserved is the
285-
**landing**: on a PR whose diff touches a governed surface ⛔ never merge, ⛔ never queue, ⛔ never arm
286-
auto-merge, ⛔ never flip it out of draft to make any of those possible — judged on the PR's **file list**, not
287-
its description; a **mixed diff is not a proportion question**, one path hit is enough; to land the rest, split off
288-
the governed files. **The landing is tiered by the register; one Tier H path makes the whole PR Tier H.** **Tier H**
289-
(人合: every row outside Tier S): those four lift only for an authorized APPROVED review by an account in
290-
`GOVERNED_APPROVERS`, on ANY commit and not dismissed; that word is spent once per PR — the OWNING seat then lands
291-
it, later pushes included; the click stays the maintainer's. **Tier S** (席内达档 L2 审核落地: `.claude/**`,
292-
objectstack workflow edits (`readWorkflowDiff`), skills-only wording and add-only ADR notes (`lowRiskArmVerdict`, on
293-
a `Security-touching: no` record, no named card ever labelled `security`; the seat labels unnamed security teaching)
294-
read as S): those four lift once the PR thread or its card carries a PASS `## Contract review` record for the PR's
295-
current head with `Served-tier: CONTRACT_REVIEW_TIER` and every check is green — the owning seat queues it. A PR
296-
whose only governed paths are register rows the queue leg regenerates byte-exact clears with zero approvals — an
297-
uncertified recompute, drift or a hand-authored sibling keeps it governed. ⛔ **No agent seat submits an approving
298-
review on a governed-surface PR, under any account** — an authorized account is agent-operated too; "CI is green"
299-
says nothing about a governance change. An authorized account's enqueue is a review record too: ⛔ never a seat's.
285+
**landing**: on such a PR ⛔ never merge, ⛔ never queue, ⛔ never arm auto-merge, ⛔ never flip it out of draft
286+
to make any of those possible — judged on the PR's **file list**, not its description; a **mixed diff is not a
287+
proportion question**, one path hit is enough; to land the rest, split off the governed files. **One Tier H path
288+
makes the whole PR Tier H.** **Tier H** (人合: every row outside Tier S): those four lift only for an authorized
289+
APPROVED review by an account in `GOVERNED_APPROVERS`, on ANY commit and not dismissed; that word is spent once per
290+
PR — the OWNING seat then lands it, later pushes included; the click stays the maintainer's. **Tier S**
291+
(席内达档 L2 审核落地: `.claude/**`, objectstack workflow edits (`readWorkflowDiff`), skills-only wording
292+
and add-only ADR notes (`lowRiskArmVerdict`, on a `Security-touching: no` record, no named card ever labelled
293+
`security`; the seat labels unnamed security teaching) read as S): those four lift once the PR thread or its card
294+
carries a PASS `## Contract review` record for the PR's current head with `Served-tier: CONTRACT_REVIEW_TIER` and
295+
every check is green — the owning seat queues it. `.claude/**` is S only on a line-start `Rule-change: none` in
296+
the PR body (or `ruled` with a `Ruling-ref:` line quoting the maintainer) repeated on the record's
297+
`Rule-change-verified:` line; no line, `yes`, settings and hooks are Tier H. A PR whose only governed paths are
298+
register rows the queue leg regenerates byte-exact clears with zero approvals — an uncertified recompute, drift or
299+
a hand-authored sibling keeps it governed. ⛔ **No agent seat submits an approving review on a governed-surface PR,
300+
under any account**. An authorized account's enqueue is a review record too: ⛔ never a seat's.
300301

301302
**Already armed or queued when you read this?** Disable auto-merge AND convert it back to **draft**, which disarms
302-
an unqueued PR; a queued one's landing seat sends the relay's `pr_dequeue` (measured live, comment 6902190812); any
303-
other seat, or a stroke that does not land, asks the maintainer at once — then confirm from the remote that it is
304-
in neither the queue nor `origin/main`. **Draft is no barrier by itself — the barrier is this directive**, and a
305-
spent approval or a standing record IS the review record, ⛔ not a relaxation. Behind it: the queue guard refuses a
306-
governed diff without its tier's record; CODEOWNERS routes every Tier H surface but the low-risk arm's rows to the
307-
approvers, the relay asks per pull on drafts (no barrier); the post-merge audit (`check-governed-merges.mjs`) lists
308-
every governed-surface merge with its approver and merger — a merger the maintainer does not recognise, any agent
309-
approval, or a Tier S merge without a PASS record is a seat violation, filed and rolled back. No seat judges this.
303+
an unqueued PR; a queued one's landing seat sends the relay's `pr_dequeue`; any other seat, or a stroke that does
304+
not land, asks the maintainer at once — then confirm from the remote that it is in neither the queue nor
305+
`origin/main`. **Draft is no barrier by itself — the barrier is this directive**, and a spent approval or a
306+
standing record IS the review record, ⛔ not a relaxation. Behind it: the queue guard refuses a governed diff
307+
without its tier's record; the post-merge audit (`check-governed-merges.mjs`) lists every governed-surface merge
308+
with its approver and merger — a merger the maintainer does not recognise, any agent approval, or a Tier S merge
309+
without a PASS record is a seat violation, filed and rolled back. No seat judges this.
310310

311311
15. **⛔ A version release is performed by the maintainer, by hand — no AI seat publishes, tags, cuts a Release, or
312312
triggers a release, and none merges the Version Packages PR.** A rule that binds every seat lives here,

0 commit comments

Comments
 (0)