Repository navigation
Commit 25c1d3c
fix(pm): the queue guard refuses a same-head PASS record that names an open must-fix or should-fix (#33736)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XLnqJDfSWuHodQt1yWeTRqD)_
Fixes #33604
domain:skills#1 · os-project-manager · session_01FEkQ5pJkb8Rbcrj6yEXfiA
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:合并队列守卫对 Tier S 的复核记录多读三件事:记录虽写 PASS 但同时列着未结的 must-fix 或
should-fix,不放行;记录别处(任一标题、小写/列表/表格/标题里的 verdict 行、单独一行 FAIL)写着
FAIL,不放行;题头之上的 `VERDICT:` 行也计数。同一 head 上后一条把它们关掉的 delta
记录才放行(引用前一条记录的等级、写明 closed 的不算未结)。规则文字的一句(contract-review.md ①)由 #33731
带,本 PR 不碰该文件。
- **为什么改**:规则说 should-fix 要先做 delta 复核再落地,守卫却只认 PASS 这个词,带着未结 should-fix
的 PASS 记录能直接入队(卡 #33604,加上 #33687 复核记录 6890532571 的 N2、N3)。
- **风险与回滚**:只收紧放行面,不放宽:原来清不了的照样清不了。读不懂的等级一律不放行(fail closed),复核者要按 `S1
(should-fix)` 或 `No must-fix, no should-fix.` 的写法落记录,简报模板已同步写明。回滚即
revert。
- **先看**:`scripts/pm/check-half-states.mjs` 的
`contractReviewRecordReading`(唯一读法);`scripts/pm/check-governed-queue-guard.mjs`
的 `recordPassVerdict`;`record-recognisers.mjs` 的
`BRIEF_GRADE_LINES`(教复核者的写法)。
- **两分钟验证**:`node scripts/pm/check-governed-queue-guard.mjs --self-test
&& node scripts/pm/check-half-states.mjs --self-test && node
scripts/pm/record-recognisers.mjs --self-test`,预期三个全绿(526 / 5268 / 389
例)。
- **需要你做的**:无,席位落地(非受管面)。
## What changes
1. **One reader, `contractReviewRecordReading`**
(`scripts/pm/check-half-states.mjs`, beside
`contractReviewVerdictLines`, on the same regexes; ⛔ no second parser).
For a comment with a `## Contract review` heading it returns:
- `verdicts`: every explicit `VERDICT:` line's word, over the WHOLE
comment (N3: lines above the heading count).
`contractReviewVerdictLines` is now a view of this.
- `failSpellings`: lines that read FAIL outside the explicit form (N2),
in every verdict-bearing shape measured: a caps FAIL anywhere in any `##
Contract review` heading's tail; a `verdict` key in any case under a
heading mark, quote, bullet or emphasis, after up to two words (`Overall
verdict:`), with a parenthetical (`Verdict (delta):`), with `:`, a dash,
`=` or `is`, reading FAIL, FAILED or FAILS; a table row with a verdict
cell and a FAIL cell in either order; a bare `FAIL` line followed only
by a separator, a full stop or `!`. Prose that merely mentions FAIL (`-
Newest FAIL over an older PASS`, `FAIL, none or two refuse`) is not one.
- `findings`: per mention of the hyphenated grade word: `open` (named
with its grade at the line's lead: `**S1 (should-fix) — …**`, `- **S2
(should-fix) — …**`, `M1 (must-fix, …)`, `- should-fix: …`); `closed` (a
named finding whose line goes on to say closed and ENDS there: only
closing emphasis, `.`, `;` or `on this head` / `at this head` / `here`
may follow, and a full stop that closes the bold title may lead a new
sentence: `- **S1 (should-fix): closed.**`); `none` (`must-fix: none`,
same terms); a title that merely opens with either word (`closed in
part`, `Closed PRs …`, `none of …`) stays OPEN; `cited` (inside `(record
ID: …)`, the measured delta preamble); negated (`No must-fix, no
should-fix.`, `No new should-fix.`, `Neither must-fix nor should-fix.`,
`0 must-fix`, a second grade carried by `or` or `/`; after a comma or
`and` the second grade needs its own `no`); or `unreadable` (any other
mention, e.g. `Two should-fix, both …` or `No must-fix, should-fix S1
and S2 below.`).
2. **The guard decides** (`recordPassVerdict`, every Tier S leg
including the low-risk arm): after the existing one-PASS-line rule, a
record also refuses (`not-pass`, naming the comment id) when it carries
a FAIL spelling, names an open must-fix or should-fix, has an
unattributable grade, or its reading lacks the grade fields (fail
closed). The recogniser loader now requires `reading` (re-exported by
`record-recognisers.mjs`) in place of `verdictLines`. A later same-head
delta record that cites the prior record's grades, names what it closes
(`S1: closed`, `S1 (should-fix): closed`) and raises nothing new clears,
because the locator already reads the newest same-head record. The
unattributable refusal names the shapes the reader takes; it never asks
for a sentence the record may already carry.
3. **The brief teaches the grammar** (`record-recognisers.mjs`
`BRIEF_GRADE_LINES`, +3 lines): spell a finding `S1 (should-fix) — …`, a
clean round `No must-fix, no should-fix.`, and close by id alone.
## Acceptance notes
- **Round 3 (review 6892305129, S1 and N2).** S1: the round-2
closed/none reading took the first word after the grade, so `S1
(should-fix): closed in part, still open for X`, `**S2 (should-fix) —
Closed PRs are still read as merged…**`, `- **S2 (should-fix) — none of
the three ablations ran…**`, `S1 (should-fix) — closed on the prior
head, reopened by this delta` and `- should-fix: none of S1, S2 is
fixed` cleared; the state word must now end the finding, and each of
those six refuses again (pinned, with a control that `closed here.`, a
closed bold title followed by a sentence, and `closed;` still clear). N2
(cheap ones taken): `Verdict: FAILED`, `Verdict is FAIL`, `Verdict
(delta): FAIL`, `| FAIL | Verdict |`, `FAIL!` and a late FAIL in a
heading tail (`— PASS withdrawn, FAIL`) now refuse. Not taken: a verdict
column carried by a header row (needs table state). Accepted nits N1,
N3, N4 unchanged; N3's `- Leg verdict: fail-closed …` refusal stands
(fail closed).
- **Round 2 (review 6891926185, S1 and S2).** S1: the clean delta
6891542450 (#33711's final record, nits only) was refused for its
preamble `(record 6891274033: PASS, should-fix S3, nits N7 and N8)`;
citations, named-and-closed lines and `No new should-fix.` now read
clean, pinned on the measured preamble. S2: `### VERDICT: FAIL`, `##
Verdict: FAIL`, `| Verdict | FAIL |`, `Overall verdict: FAIL`, `Verdict
— FAIL`, `FAIL.` and `**FAIL.**` now refuse beside one PASS line, and
`No must-fix, should-fix S1 and S2 below.` is unreadable (fail closed),
one pin each. Nits taken: N1 (`Neither … nor`, `0 must-fix`, `must-fix:
none`, `- should-fix: none` read clean), N3 (every heading's tail is
read). Not taken: N2 (the grade is read off the hyphenated word only;
the brief spells it and every measured record uses it), N4 (a prose
bullet opening `- FAIL — …` refuses; fail closed, a repost cures it).
- **Grammar measured, not assumed.** Read on the real records of PRs
#33686 (6890432656), #33687 (6890532571), #33688 (6890622635 round 1,
6890939010 delta) and #33711 (6890932729) with the new reader, plus the
review's own measurement of #33711's deltas 6891274033 and 6891542450,
#33720 (6891083453) and #33726 (6891576194):
- #33686, #33687: one PASS, no FAIL spelling, no open grade, nothing
unreadable → still clear.
- #33688 round 1: S1, S2 should-fix open → refused (correct: they earned
a delta).
- #33688 delta 6890939010: S1, S2, N1 closed (`- **S1: closed.**`, no
grade word), but it raises **S3 (should-fix, the seat's, no head
change)** on the PR body → refused. If #33688 is still queued when this
lands, it needs a later same-head record closing S3.
- #33711 round 1: S1, S2 should-fix open plus the count line `No
must-fix. Two should-fix, both …` (unreadable) → refused; delta
6891274033 raises S3 → refused; delta 6891542450 (cites the prior
grades, closes S3, `No must-fix. No should-fix.`) → clears.
- #33720, #33726: nits only → clear.
- **Rule sentence owed, carried by PR #33731.** The seat moved
`contract-review.md` to #33718 (PR #33731) mid-round, so this PR leaves
it untouched. The sentence the rule owes, measured to fit line 51 in
place (63/63 lines, 119/120 bytes, paid by dropping 「两条」 and the second
「Tier」): `- 请审/求批与落地前检,过则 Tier S 入队、H 等人批:① 现 head 同形达档 PASS 在案,无前两级。`
(前两级 = must-fix/should-fix, the term line 45 already uses).
`check-skill-line-ratchet` was green with it on an earlier head
(148b0ce6, dropped).
- **Fail closed costs a wording rule.** A record that quotes the grade
word in prose (`the should-fix rule says …`) is refused as unreadable.
The brief now names the two shapes the reader accepts; a seat can always
repost a clean record.
- **Not changed:** the H43 patrol (`contractReviewVerdictOf`, first
match under the heading) and `check-owed-reviews.mjs` still read no
grades; that is follow-up F1 of record 6890532571, not this card.
- Ablation, round 3 (on 38cc292, guard self-test, restored, `git diff
HEAD` empty): the state-word tail reverted to `(closed|none)\b` → the r3
titled-open row red (all six CLEARED); the heading-tail caps FAIL
deleted → the r3 N2 row red.
- Ablation, round 2 (each reader branch mutated on 7c2fb52, guard
self-test run, restored, `git diff HEAD` empty): citation off → the
measured-delta row red; closed/none state off → 2 rows red; table-cell
regex off → the S2 FAIL-forms row red; comma carrying the denial → the
S2 comma row red.
- Ablation, round 1 (each guard branch mutated with
`scripts/ablation-replace.mjs`, run, restored; `git diff HEAD` empty
after each): open-grade branch off → 3 #33604 rows red; FAIL-spelling
branch off → 2 N2 rows red; unattributable branch off → 1 row red;
reading below the heading only → the N3 row red.
## Verification
- `dispatch-gates --tier`: no path-derived model mandate (floor sonnet,
default opus); built on the claim's default.
- `check-governed-merges --branch claude/project-thread-78jrbs`: **NOT
governed** (0 of 3 paths on the register; `scripts/pm/**` is not a row);
190 changed lines, under 3000. Ordinary queue landing.
- Self-tests on the final head 38cc292: `check-governed-queue-guard
--self-test` 526 pass; `check-half-states --self-test` 5268 pass (11 new
H43 rows); `record-recognisers --self-test` 389 pass (1 new cross-tool
pin: the brief's shapes are the guard's).
<details><summary>Derived gate list on head 38cc292: 49 derived, 49 run
green, 0 NOT MEASURED</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` on head 38cc292 (round 3, after merging
`origin/main` again at 34c6eec; main's nine new commits touch none of
the three files), each exit captured before any pipe; `--ran`
reconciliation: "49 derived famil(ies) accounted for — 49 run, 0
NOT-MEASURED". `check:doc-formula-expressions` ran after `pnpm --filter
"@objectstack/lint..." build` under the verify lock. The two
`check-closing-keyword-parity` runs overlapped a five-second ablation
window of the reader, a file they do not read; both were re-run on the
restored tree, exit 0.
```text
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-platform-checklist-watchdog.mjs :: exit 0
node scripts/check-platform-checklist-watchdog.mjs --self-test :: exit 0
node scripts/check-release-section-coverage.mjs :: exit 0
node scripts/check-release-section-coverage.mjs --strict :: exit 0
node scripts/check-self-test-wired.mjs :: exit 0
node scripts/check-self-test-wired.mjs --self-test :: exit 0
node scripts/check-self-test-workflow-commands.mjs :: exit 0
node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0
node scripts/check-whole-set-label-write.mjs :: exit 0
node scripts/check-whole-set-label-write.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/scheduled-full-run.mjs --self-test :: exit 0
node scripts/pm/bare-root-worklist.mjs --self-test :: exit 0
node scripts/pm/board-snapshot.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/sweep-closed-cards.mjs --self-test :: exit 0
node scripts/render-release-coverage-anchor.mjs --self-test :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:bash32-floor :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:closing-target-claim :: exit 0
pnpm check:commit-card-trailers :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:entry-guard :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:parse-guard :: exit 0
pnpm check:partof-closing-keyword :: exit 0
pnpm check:platform-checklist :: exit 0
pnpm check:pm-dispatch-gates :: exit 0
pnpm check:pm-half-states :: exit 0
pnpm check:pm-post-stamped :: exit 0
pnpm check:pm-record-recognisers :: exit 0
pnpm check:pnpm-filter-targets :: exit 0
pnpm check:pnpm-flag-spellings :: exit 0
pnpm check:ratchet-remedy-authority :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:scripts-symbol-anchors :: exit 0
pnpm check:single-claim-paths :: exit 0
pnpm check:watch-hint-literal :: exit 0
```
- Rounds 1 and 2 ran the same 49 on bbe4fba and 7c2fb52, all green; an
earlier pass on 148b0ce6 (with the `contract-review.md` line, since
dropped) was stopped at 41 of 55, all green.
</details>
- Every family CI runs beyond the derived list: read off this PR's
check-runs.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5pJkb8Rbcrj6yEXfiA)_
<!-- signed: domain:skills#1 · os-project-manager ·
session_01FEkQ5pJkb8Rbcrj6yEXfiA -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ab343d5 commit 25c1d3c
3 files changed
Lines changed: 236 additions & 20 deletions
0 commit comments