Skip to content

Commit b78b14c

Browse files
fix(pm): the relay review plan, H43 and the early-warning leg chain the .claude/** declaration split, and the split reads the queue's record leg (#35612) (#36215)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_ Part of #35612 — this PR carries every work item but the post-merge sweep's split leg (item 4), which is measured below and left for its own card. Clause-②: no Metadata-protocol: none Rule-change: none ## 维护者速读 - 用户能看到什么变化:用户无感。车队内部:改车队规则文件的拉取请求若声明改了规则、或没写声明,在标记就绪时会自动请你审,每日巡查也会把它列为等你批准;声明未改规则且审核记录核过的,不再打扰你。 - 为什么做:上一轮让「改规则的车队文档要你批」在合并队列生效,但自动请审、每日巡查和几处只读提示还按旧办法读,这次把它们和合并队列对齐。 - 出错会怎样:最多多请你审一次或漏请一次,合并队列那道拦截不变;改动只在车队工具里,可整体撤回。 - 要你做什么:批准这个拉取请求——它改了守卫仪器文件,只能由你批准合并。 ## What changes The `.claude/**` declaration split (`applyRuleChangeSplit`, landed with #35610) is now CHAINED by every reader that had been reading the raw row's Tier S. No reader re-derives it, and no gate, derivation row or constant is added. - **The relay's review plan** (`governedReviewPlan`, `scripts/pm/fleet-write/execute.mjs`). The plan chains the split last, on the same reading the low-risk arm takes, so a `.claude/**` pull read on its path list alone is Tier H. At `pr_ready` the follow-up then reads the body off the pull answer. When the body declares `none` (or `ruled` with its `Ruling-ref:`), it also reads the record stage through the queue guard's own `readLowRiskRecordStage` (card labels left unread). It requests nobody only when the record on the head verifies the declared value. A `yes`, a missing line, a settings or hooks path, a mixed pull, or a record that is absent, unread or not verifying all request the approvers, and the verdict row names the reason. - ⚠️ Premise correction: the card's done-when says "at `pr_create`". The relay summons nobody at `pr_create` by ruled design (the header section "The governed-review follow-up — after `pr_ready`, never after `pr_create`"; the seat's hand-off is `pr_request_reviewers`). The request is pinned at `pr_ready`, the one follow-up the relay has. - **H43 and H48** (`scripts/pm/check-half-states.mjs`). The sweep's governed slice is the split's reading: the body off the PR list row, then, for a body that declares a seat value, the record on the head off the PR thread (H48's fetch class, cached; H48 buys that thread anyway while the PR reads Tier H). A `yes`, no line or a hooks path is listed as Tier H. A `none` stands down only on a trusted PASS on the head whose `Rule-change-verified:` line matches. The register loader exports `applyRuleChangeSplit` and `readRuleChangeVerified` beside the matcher. - **N1: one record leg everywhere** (`check-governed-merges.mjs`, `check-governed-queue-guard.mjs`). The split's record stage now carries the queue's own record-leg verdict on the same comment (`recordVerdict`, then `recordPassVerdict`) as `recordLeg`, and `ruleChangeRecordReasons` holds the conjunct only where it `stands`. A FAIL, a below-tier record, or a leg that was not read keeps the split at Tier H. So `--pr` and the relay can no longer print Tier S over a record the queue refuses. The queue leg's own call hands in the leg it has already judged. - **The queue guard's early-warning leg** (item 3, measured true at `cbd582f4`: the `pull_request` leg read no body although the event payload carries one). `resolveEventContext` keeps `pull_request.body`, and `runGuard` re-reads the split off it (`readPayloadDeclaration`). On a `.claude/**` pull, `yes` is now Tier H on the body. A declared `none` prints "Tier H UNTIL its record is read", naming the value, because this leg reads no record. A payload with no body still prints "Tier H UNTIL the PR body is read". The body is the one at the event; the workflow's `types:` list has no `edited`, so the next push or the queue leg reads a later edit. - **N4** (`scripts/pm/check-owed-reviews.mjs`). `owedFace` finds a narrowing the way the queue's narrowed leg does (`narrowingDeclarationsIn`, imported). When it finds one, it reads the face with `NARROWING_FACE_LINE` handed in first. A narrowing declared on the protocol line alone, on a diff with no schema or governed path, is now listed at the narrowing face's tier. Its control is the same body declaring `none`. - **hotcrm on the `workflows` row** (item 5). Pinned: a hotcrm workflow pull is Tier H and outside `split.repos`, so `pr_ready` requests the approvers at the hotcrm pull. The row names `split.repos`, and no compare is read. The control is an ungoverned hotcrm path, which plans nobody. - **N5, N6 (prose)**. `.claude/agents/os-dev.md` says exactly one line-start declaration line again (net −1 byte; ceiling 38848, now 38845). `.claude/skills/pm-dispatch/SKILL.md`'s skills-lane exception says 守卫仪器 like the 恒 H line (+6 bytes; ceiling 33872, now 33869). No ceiling row is touched. - Header prose in the register, the queue guard and the relay now says the readers chain the split. The register's "two readers do NOT chain" paragraph is replaced. ### Not done here: item 4, the post-merge sweep (measured) Measured at `cbd582f4`: `classifyCommit` calls `testVerdict` with no reading, so every merged `.claude/**` pull reads Tier H and is listed among the maintainer's merges. No landing is hidden. A seat landing on a verified `none` is listed as a maintainer merge, and one whose record did not verify is not told apart from it. To list the split's seat landings apart and judge each on its record as landed, the sweep needs a leg like `readArmLanding`: approval and enqueue legs before `merged_at`, as-landed comments, and the carry rule. That is a new audit leg of about arm-leg size, not a reader chaining an existing split. It is left for its own card, and the report names it. ## Tests Each new pin carries its negative control one step away: - `check-governed-merges --self-test`: the split battery's floor goes from 40 to 44. It adds a FAIL record, a below-tier record and an unread leg, each Tier H whatever the verified line says, plus the words. - `check-governed-queue-guard --self-test`: arm battery 84 → 85 (the stage carries the leg: FAIL and below-tier read H on the split, a clean PASS reads S). Early-warning battery 6 → 9 (a payload body with `none` waits on its record, with `yes` it is H on the body, with no body it still waits on the body, and an entry with no split row is untouched). - `fleet-write/execute --self-test`: governed-review battery 52 → 62. Plan cases: `none` over a verifying record plans nobody, and its path-only control plans both. Eight Tier H variants each plan both: `yes`, no line, a settings path, a hooks path, an unread record, a record verifying `yes`, a FAIL, and AGENTS.md beside the wording. Also the readable gate, the words, four `pr_ready` runs (`none`+verified sends nothing, with `yes`, `none`+`yes`-record and `none`+no-record as controls), and hotcrm's plan and run. The three existing pins that encoded the raw Tier S are re-pinned to the split. - `check-half-states --self-test`: H43 battery 103 → 109 (stood down on a verified `none`, listed on `yes`, six Tier H shapes, the pending stage, the thread's record reading, an unloaded register, the loader's two exports). - `check-owed-reviews --self-test`: owed-face battery 9 → 11. Readings are in the Verification section below. ## Acceptance notes - H43's record reading has two stated bounds, both toward under-reporting (standing down where the queue would not), never asking early. Only the PR thread is read, so a record on the card alone reads absent and the PR stays Tier H. The record's `Served-tier:` line and its signature are not read there; H43 reads the verdict word through the guard's author binding, as its hand-off already does. - The relay hands `readLowRiskRecordStage` no checkout, so a record carried from an older head is refused there, and the relay requests the approvers. That is fail closed, at the cost of one extra request. - `owedFace` reads the body alone. The queue's narrowed leg also reads the changesets the commits touch, so a narrowing declared only in a changeset is still not listed. This bound is stated in the function's docblock. - The low-risk arm's record stage has the same N1 shape for its `Security-touching:` line: `--pr` reads the line without the record leg's verdict. The queue's record leg still refuses there, and this PR does not change it (it is outside this card). ## Verification Read first, by risk: 1. `scripts/pm/check-governed-queue-guard.mjs`: `lowRiskRecordStage` (the new `recordLeg`, built by the queue's own `recordVerdict` and `recordPassVerdict`), `ruleChangeRecordVerdict` and `readPayloadDeclaration`. 2. `scripts/pm/fleet-write/execute.mjs`: `governedReviewPlan`'s chain, `ruleChangeReadable` and `ruleChangeReadingFor`, plus their wiring in `requestGovernedReview`. 3. `scripts/pm/check-half-states.mjs`: `h43RuleChangeSlice` and `h43RuleChangeRecord`, plus the sweep's pending-thread pass before `shortOfCoverage`. Two-minute check: `node scripts/pm/fleet-write/execute.mjs --self-test`. Expect `✓ fleet-write/execute self-test: 443 cases pass across 30 batteries`, with the `⭐ pr_ready on a .claude/** pull declaring Rule-change: none` case and its `Rule-change: yes` control both green. <details><summary>Readings at head 101fd54 (local, derived subset; every CI family is the PR's own check-runs)</summary> - The five touched instruments' self-tests: `check-governed-merges` ✓ 963 assertions · `check-governed-queue-guard` ✓ 641 cases · `fleet-write/execute` ✓ 443 cases across 30 batteries · `check-half-states` ✓ 5389 cases · `check-owed-reviews` ✓ 96 cases in 10 batteries — each exit 0, captured before any pipe. - `node scripts/pm/dispatch-gates.mjs --commands` (no paths, merge-base derived): 78 families. All 78 were run; 77 exit 0. `pnpm check:i18n-coverage` is NOT MEASURED: PREREQUISITE NOT MET (exit 3) because the workspace CLI and the example configs are not built; the diff touches no package, and CI runs it. `check:doc-formula-expressions` first exited 3 (formula not built), then 0 after `turbo run build --filter=@objectstack/formula --filter=@objectstack/lint` under the verify lock. - `--ran` reconciliation: `✓ dispatch-gates --ran: 78 derived famil(ies) accounted for — 77 run, 1 NOT-MEASURED`. - `pnpm check:skill-frame-freshness` (local-only family): exit 0. - `node scripts/pm/overlap-check.mjs --branch=claude/issue-35612-rule-change-split-readers`: `VERDICT clean exit 0` before every push. - `origin/main` moved 36 files past the base `cbd582f4`, none under `scripts/pm/`, `.claude/` or `package.json`, so it is not merged here. - Byte ceilings (`check-skill-line-ratchet.mjs`): `.claude/agents/os-dev.md` is at 38845 of 38848, `.claude/skills/pm-dispatch/SKILL.md` at 33869 of 33872. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1cd4762 commit b78b14c

7 files changed

Lines changed: 420 additions & 44 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ 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 自判。
279+
- diff 触根 `.claude/**` ⇒ PR 正文恰一行首 `Rule-change:`,按 diff 自判。
280280
- `none` 未改车队规则(agent 不经维护者可做什么、做什么与先后、什么须交他);`yes` 改了;`ruled` 照抄已裁条文,写行首 `Ruling-ref:` 引维护者原话、出处、时间。缺行同 `yes`:Tier H。
281281
- ⛔ 永不 `Fixes` 一张还在决策箱的卡:合并会静默关掉它,而收件箱过滤只读 open。
282282
- ⛔ 不写否定式的关单句,它照样关掉点名的卡:解析器无视否定,只匹配关键词 + `#<n>`。

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 →
205205
- `pr_create` 派不请;`pr_ready` 只补交棒漏;非例外 head 移 ⇒ 撤挂回等;脱中继 PR 自读请/派。
206206
- 速读「要你做什么」求批点名 PASS 评论 id+`Head-sha`;无 PASS ⇒ 写 contract review owed 不求批。
207207
- ④ 轮报单列 awaiting a human merge 并现读请审人;⛔ 未请审不在 chat 报「等你批」,先补请。
208-
- skills 车道自有 PR:纯代码面如 `scripts/pm/` 由本席自读(清单不减)后落地,守卫除外。
208+
- skills 车道自有 PR:纯代码面如 `scripts/pm/` 由本席自读(清单不减)后落地,守卫仪器除外。
209209
- Tier S = `Rule-change: none`/`ruled` 记录核过的 `.claude/**`+下行面,余皆 H;达档 PASS 后 ready→入队。
210210
- 本仓 workflows 读 `readWorkflowDiff`(发布面/C2/拒读⇒H),技能与只增 ADR `lowRiskArmVerdict`,未读⇒H。
211211
- 入队资格:每 check 绿或预期 skip,⛔ 非必查子集;名单 check-expected-skips.mjs 只判 objectstack。

‎scripts/pm/check-governed-merges.mjs‎

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,14 @@
502502
* enforces 3 there. `ui/.claude/**` and every other repository's `.claude/**`
503503
* are Tier H as before.
504504
*
505-
* ⛔ Two readers do NOT chain the split and still read the raw row's Tier S:
506-
* the relay's review-request plan (`fleet-write/execute.mjs`) and the
507-
* half-states patrol's landing row, both through `landingTierOf` on the
508-
* matched slice. Neither decides a landing — the queue guard does — so a
509-
* `Rule-change: yes` pull is refused at the queue but is not auto-routed to
510-
* the maintainer by the relay; CODEOWNERS routes the settings and hooks paths.
505+
* The two readers that decide no landing chain the split too, on the same
506+
* reading: the relay's review-request plan (`governedReviewPlan`,
507+
* `fleet-write/execute.mjs`) requests the approvers for a `.claude/**` pull
508+
* the split reads Tier H, and the half-states patrol's landing row H43 lists
509+
* it. The record conjunct holds only where the queue's record leg would
510+
* clear the same comment — it stands at its face's tier and reads a clean
511+
* PASS (`recordLeg`, `ruleChangeRecordReasons`) — so no reader prints Tier S
512+
* over a record the queue refuses.
511513
*
512514
* Published `skills/**` stays a Tier H ROW: the 2026-09-18 seat did not propose
513515
* moving it, and no row moved since. What moved on 2026-11-14 is a READING on
@@ -1258,7 +1260,9 @@ const SELF_TEST_BATTERIES = Object.freeze({
12581260
'⚖️ #33603: the sweep lists a low-risk arm landing APART and judges it on a same-head at-tier PASS record': 71,
12591261
'⭐ the weekly audit card: every reading the job files on, both ways (#33814)': 54,
12601262
'⚖️ #33539: the ADR leg of the low-risk arm — an add-only note lands Tier S, any other ADR change stays H': 52,
1261-
'⚖️ #35321: the guard instruments are Tier H, and `.claude/**` splits by declaration': 40,
1263+
// 40 → 44 (#35612, N1 of #35610): a record the queue's record leg refuses — a FAIL, below its tier, or a leg not
1264+
// read — keeps the split at Tier H however its `Rule-change-verified:` line reads; one case pins the words.
1265+
'⚖️ #35321: the guard instruments are Tier H, and `.claude/**` splits by declaration': 44,
12621266
});
12631267

12641268
// DELETING an entry silences that battery's floor exactly as effectively as
@@ -3175,11 +3179,13 @@ export const RULE_CHANGE_RECORD_STAGE_PENDING_REASON =
31753179
* Why the record keeps the split at Tier H, or [] — the split's last conjunct. Pure.
31763180
*
31773181
* `record` is the reading the low-risk arm's record stage already takes (`lowRiskRecordStage`, the queue guard),
3178-
* with two keys of this split's own: `ruleChangeVerified` (`readRuleChangeVerified` of the located comment) and
3182+
* with three keys of this split's own: `ruleChangeVerified` (`readRuleChangeVerified` of the located comment),
31793183
* `ruleChangeCarried` (`null`, or `{ from, ok, reason }` for a record carried from an older head — it stands only
3180-
* when the hops moved nothing under the split row). The conjunct holds only for a record FOUND on this head whose
3181-
* line was READ and reads the value the body `declared`: missing, unreadable, `yes`, or the other seat value are
3182-
* each a reason, as is a record that is absent, unsigned or unread.
3184+
* when the hops moved nothing under the split row) and `recordLeg` (`{ state, reason }`: the queue's own record leg
3185+
* on the same comment, `recordVerdict` then `recordPassVerdict` — `stands` only at its face's tier and on a clean
3186+
* PASS). The conjunct holds only for a record FOUND on this head that the record leg clears and whose line was READ
3187+
* and reads the value the body `declared`: missing, unreadable, `yes`, or the other seat value are each a reason,
3188+
* as is a record that is absent, unsigned, unread, below its tier, not a clean PASS, or whose leg was not read.
31833189
*/
31843190
export function ruleChangeRecordReasons(record, declared) {
31853191
const want = `${RULE_CHANGE_VERIFIED_KEY}: ${declared}`;
@@ -3195,6 +3201,15 @@ export function ruleChangeRecordReasons(record, declared) {
31953201
const which = `its contract-review record (${record.where ?? 'a'} comment ${record.id ?? '(no id)'})`;
31963202
const carried = record.ruleChangeCarried;
31973203
if (carried && carried.ok !== true) reasons.push(`${which} ${carried.reason ?? 'was carried from an older head over hops that could not be read'}`);
3204+
// The queue's record leg on the same comment: ⛔ a caller that hands no leg reading gets no Tier S (N1 of #35610).
3205+
const leg = record.recordLeg;
3206+
if (leg?.state !== 'stands') {
3207+
const said = leg?.reason ? `: ${leg.reason}` : '';
3208+
if (!leg) reasons.push(`${which} was not read by the queue's record leg, so whether it stands at its tier and reads a clean PASS is unknown`);
3209+
else if (leg.state === 'not-pass') reasons.push(`${which} does not read a clean PASS${said}`);
3210+
else if (leg.state === 'below-tier') reasons.push(`${which} does not stand at its face's tier (its \`Served-tier:\` line)${said}`);
3211+
else reasons.push(`${which} does not stand on the queue's record leg (${leg.state})${said}`);
3212+
}
31983213
const line = record.ruleChangeVerified;
31993214
if (!line || line.state === 'missing') reasons.push(`${which} carries no \`${RULE_CHANGE_VERIFIED_KEY}:\` line`);
32003215
else if (line.state !== 'read') reasons.push(`the \`${RULE_CHANGE_VERIFIED_KEY}:\` line of ${which} is unreadable: ${line.reason ?? 'no reason recorded'}`);
@@ -7420,7 +7435,7 @@ async function selfTest() {
74207435
const REPO = SELF_REPO_ID;
74217436
// The reading the `.claude/**` declaration split (2026-11-19) lands Tier S on: the body's one bare line, and a
74227437
// record FOUND on this head whose own line verifies it. `ruleReading` moves one half at a time for the controls.
7423-
const ruleRecord = (value = 'none', over = {}) => ({ measured: true, reason: null, located: 'found', where: 'PR', id: 7, carried: null, ruleChangeCarried: null, ruleChangeVerified: value === null ? { state: 'missing' } : { state: 'read', value }, ...over });
7438+
const ruleRecord = (value = 'none', over = {}) => ({ measured: true, reason: null, located: 'found', where: 'PR', id: 7, carried: null, ruleChangeCarried: null, ruleChangeVerified: value === null ? { state: 'missing' } : { state: 'read', value }, recordLeg: { state: 'stands', reason: null }, ...over });
74247439
const ruleReading = (body = 'Rule-change: none', record = ruleRecord()) => ({ measured: true, reason: null, body, ...(record === null ? {} : { record }) });
74257440
const RULE_NONE = ruleReading();
74267441
// Report fixtures take a REAL window from the real resolver, never a
@@ -8243,10 +8258,20 @@ async function selfTest() {
82438258
'an unsigned record': ruleRecord('none', { located: 'unsigned' }),
82448259
'a record that was not read': { measured: false, reason: 'the PR thread answered 502' },
82458260
'a record carried over a hop that moved the tree': ruleRecord('none', { ruleChangeCarried: { from: 'a'.repeat(40), ok: false, reason: 'was carried over hops that moved .claude/x.md' } }),
8261+
// N1 of #35610: the record leg the queue reads on the same comment — the verified line alone is not enough.
8262+
'a record that reads FAIL': ruleRecord('none', { recordLeg: { state: 'not-pass', reason: 'it reads FAIL' } }),
8263+
'a record below its tier': ruleRecord('none', { recordLeg: { state: 'below-tier', reason: null } }),
8264+
'a record whose leg was not read': ruleRecord('none', { recordLeg: undefined }),
82468265
};
82478266
for (const [name, record] of Object.entries(unverified)) {
82488267
assert(`⛔ unverified-is-Tier-H: ${name}`, tier([WORDING], ruleReading('Rule-change: none', record)) === GOVERNED_TIER_H && split([WORDING], ruleReading('Rule-change: none', record)).reasons.length === 1, why([WORDING], ruleReading('Rule-change: none', record)));
82498268
}
8269+
assert('⛔ N1: the-record-legs-words-name-why-and-the-same-record-with-a-standing-leg-verifies',
8270+
/does not read a clean PASS: it reads FAIL/.test(why([WORDING], ruleReading('Rule-change: none', unverified['a record that reads FAIL']))) &&
8271+
/does not stand at its face's tier/.test(why([WORDING], ruleReading('Rule-change: none', unverified['a record below its tier']))) &&
8272+
/was not read by the queue's record leg/.test(why([WORDING], ruleReading('Rule-change: none', unverified['a record whose leg was not read']))) &&
8273+
tier([WORDING], ruleReading('Rule-change: none', ruleRecord('none'))) === GOVERNED_TIER_S,
8274+
why([WORDING], ruleReading('Rule-change: none', unverified['a record that reads FAIL'])));
82508275
assert('control-a-carried-record-whose-hops-moved-nothing-under-the-row-still-verifies',
82518276
tier([WORDING], ruleReading('Rule-change: none', ruleRecord('none', { ruleChangeCarried: { from: 'a'.repeat(40), ok: true, reason: null } }))) === GOVERNED_TIER_S);
82528277
assert('⛔ the-record-not-handed-in-is-PENDING-Tier-H-never-none',

0 commit comments

Comments
 (0)