Repository navigation
Commit b78b14c
<!-- 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
- skills/pm-dispatch
- scripts/pm
- fleet-write
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
511 | 513 | | |
512 | 514 | | |
513 | 515 | | |
| |||
1258 | 1260 | | |
1259 | 1261 | | |
1260 | 1262 | | |
1261 | | - | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
1262 | 1266 | | |
1263 | 1267 | | |
1264 | 1268 | | |
| |||
3175 | 3179 | | |
3176 | 3180 | | |
3177 | 3181 | | |
3178 | | - | |
| 3182 | + | |
3179 | 3183 | | |
3180 | | - | |
3181 | | - | |
3182 | | - | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
3183 | 3189 | | |
3184 | 3190 | | |
3185 | 3191 | | |
| |||
3195 | 3201 | | |
3196 | 3202 | | |
3197 | 3203 | | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
3198 | 3213 | | |
3199 | 3214 | | |
3200 | 3215 | | |
| |||
7420 | 7435 | | |
7421 | 7436 | | |
7422 | 7437 | | |
7423 | | - | |
| 7438 | + | |
7424 | 7439 | | |
7425 | 7440 | | |
7426 | 7441 | | |
| |||
8243 | 8258 | | |
8244 | 8259 | | |
8245 | 8260 | | |
| 8261 | + | |
| 8262 | + | |
| 8263 | + | |
| 8264 | + | |
8246 | 8265 | | |
8247 | 8266 | | |
8248 | 8267 | | |
8249 | 8268 | | |
| 8269 | + | |
| 8270 | + | |
| 8271 | + | |
| 8272 | + | |
| 8273 | + | |
| 8274 | + | |
8250 | 8275 | | |
8251 | 8276 | | |
8252 | 8277 | | |
| |||
0 commit comments