Skip to content

Commit 7844272

Browse files
pm: the governed-merges audit reads unread arm inputs as NOT MEASURED and a dismissed approval as it stood, and the verifier refuses skill and connector hand-offs (#33762)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XL2xU3RxQwgawwt8cWF1NtV)_ Fixes #33729 Clause-②: no Metadata-protocol: none domain:skills#1 · os-project-manager · session_01FEkQ5nqeu4RWPfV6S5jfCq ## 维护者速读 - 改了什么:合后审计 `check-governed-merges.mjs` 的 skills arm 一腿收紧 PR #33711 评审留下的六处 nit:arm 需要的 git 读取失败或 fork 判定没测到时记 NOT MEASURED(不再折成 Tier H);合并后才被撤销的授权批准按合并时的状态读;"合并后被编辑"一句挂在每种 BREACH 理由上,且只点名本该被读成记录的那条;没有受信作者名单记 NOT MEASURED,被作者绑定丢掉的评论按守卫原话计数。校验器 `verify-review-tier.mjs` 另拒 `Skill` 和向别的线程、会话、触发器发消息或启动它们的连接器工具。N6 以理由关闭,不改代码。 - 为什么改:卡 #33729 是 #33711 三份复核记录(6890932729、6891274033、6891542450)的 nit 清单,按 #33718 裁决 B 一卡一 PR。 - 风险与回滚:只动两个 `scripts/pm/` 工具文件,不发布。方向全部是收紧:Tier H 可能变 NOT MEASURED(整轮 INCOMPLETE,退出 2);唯一由 BREACH 变 cleared 的是 N8 点名的情形(合并后撤销的授权批准),这是该项本身要的。校验器多拒一类转录。回滚即还原本 PR。 - 先看:`scripts/pm/check-governed-merges.mjs` 的 `readArmLanding`、`armReadsNotMeasured`、`reviewsAsLanded`;`scripts/pm/verify-review-tier.mjs` 的 `SUB_AGENT_TOOL_SHAPES`。 - 两分钟验证:`node scripts/pm/check-governed-merges.mjs --self-test && node scripts/pm/verify-review-tier.mjs --self-test`,预期两行成功判定(741 条断言;30 个用例)。 - 需要你做的:无,席位落地。 ## What changes Card #33729's checklist, item by item. Every reading still goes through the queue guard's exports (`ARM_READER_EXPORTS`, now with `ignoredAuthorLines`); no second parser. | Item | Verdict | Where | |:--|:--|:--| | N3 `SUB_AGENT_TOOLS` is an exact-name list | Fixed. `handsWorkToAnotherAgent` adds `SUB_AGENT_TOOL_SHAPES`: `Skill` (a skill can fork into a sub-agent and reads the same in the file either way), and a connector tool `mcp__SERVER__TOOL` whose tool name starts with `send`, `message`, `start`, `fire`, `spawn`, `dispatch` or `delegate`, or names a trigger. The `mcp__SERVER__TOOL` spelling was measured in a session transcript (`mcp__hearthbot__message_thread`). Fail closed: a read-only connector tool that fits the shape refuses too. | `verify-review-tier.mjs`, 3 pin rows | | N5 a git-side read failing in the arm folds into `tier-h` | Fixed. `readArmLanding` hands the arm a git reader that records every throw; when the arm reads H with a recorded throw, or with the fork predicate not measured, the landing is `not-measured` with the failed read and the arm's reasons (`armReadsNotMeasured`). One exception, read rather than assumed: `git show SHA:PATH` throws for a changeset the commit deleted, and the arm reads that H by itself; an empty `git ls-tree` of that path at that commit proves the deletion, so it stays a measured Tier H. The Tier H cell now says how many reasons it did not print (`(+N more)`). | `check-governed-merges.mjs`, 5 pin rows | | N6 `baseRef` is the first parent, not the merge group's base | Closed with a reason, no code change. `baseRef` is read only by the carry test (`regenCarry` in `record-recognisers.mjs`), through `git merge-base BASE HEAD`. Between the merge group's base and the landed commit's first parent lie only the squash commits of entries ahead in the same group. A head that contains one of those was pushed after that entry landed, which takes it out of the queue, so its next group's base already holds it. Either way `git merge-base` of the two bases with a queued head names the same commit, and the carry reads the same. The reasoning is in `readArmLanding`'s jsdoc. | jsdoc | | N8 an approval dismissed after the landing no longer clears | Fixed. `reviewsAsLanded` puts a review that now reads DISMISSED back in the state the timeline's `review_dismissed` event names (`dismissed_review.state`, matched by `dismissed_review.review_id`) when that event is dated at or after the landing. A dismissal before the landing, with no event, or of a non-approval clears nothing. The event's shape is GitHub's documented timeline shape; no live dismissal was found to measure it on, and a shape that does not match leaves the review DISMISSED (toward BREACH, as today). | `check-governed-merges.mjs`, 2 pin rows | | N9 the edited-after clause rides only `absent` | Fixed. It is appended to every BREACH reason (`absent`, `below-tier`, `unsigned`, `not-pass`). | 1 pin row | | N10 the clause names any trusted comment edited after the landing; "A, B was edited" | Fixed with the guard's own reader, no new recogniser: the record leg runs once more, read-only, on the threads with the edited rows put back (`guard.recordVerdict` on `unedited`), and the clause names the edited row only when that run would have read it as the record. So a claim or report edited after the merge is never named, and the clause names one comment. | 2 pin rows | | N11 no row for unavailable recognisers or a set without `trustedAuthors`; an untrusted PASS reads like no record | Fixed. A recogniser set with no trusted-author list (null or empty) is now `not-measured` before any thread is read, where it read BREACH (every row dropped); both readings fail closed, and a missing reading is NOT MEASURED. The comments the author binding dropped (those existing at the landing) are counted on `pass` and `breach` rows in the guard's own words (`ignoredAuthorLines`). | 3 pin rows | Direction check against the order ("nothing here may make the audit read `pass` where it reads BREACH or NOT MEASURED today unless the item says so"): no state moves to `pass`. N5 and N11 move `tier-h` and `breach` to `not-measured`. N8 moves a `breach` to `cleared` only for an authorized approval dismissed after the landing, which is what N8 asks. ## Tests <details><summary>Self-tests on head 9177c4e</summary> - `node scripts/pm/check-governed-merges.mjs --self-test`: exit 0, `✓ check-governed-merges --self-test: 741 assertions`. The `⚖️ #33603` battery has 51 cases (floor 38 to 51): the 13 new rows above. - `node scripts/pm/verify-review-tier.mjs --self-test`: exit 0, `✓ verify-review-tier self-test: 30 cases pass across 6 batteries` (battery floor 7 to 10). </details> <details><summary>Ablations (each through scripts/ablation-replace.mjs, anchor hit once, restored to the HEAD blob with an empty git diff HEAD)</summary> | Mutation | Red rows | |:--|:--| | `if (false && unread.length > 0)` (N5) | the three N5 NOT MEASURED rows | | delete `if (listed === '') continue;` (N5 deletion probe) | the deleted-changeset control | | `restored.set` removed (N8) | the dismissed-after-landing row | | trusted-author check disabled (N11) | the no-trusted-author-list row | | clause on any edited row (N10) | the edited-claim row | | clause dropped from the reason (N9) | the N9 row, the N10 one-record row and the existing N7 row | | delete the `Skill` shape (N3) | the Skill row | | delete the trigger shape (N3) | the connector-tool row | </details> ## Acceptance notes - N8's restore reads only GitHub-written timeline events, and only to restore a state the queue saw; it never invents an approval. - N3 widens what the verifier refuses, so an honest review run that calls `Skill` now refuses; the remedy is the existing one (review in an agent that calls no other). - Carried elsewhere, unchanged: raw relay comment tier #33715, `contract-review.md` session evidence #33716, weekly audit owner #33717. ## Verification <details><summary>Derived gates on head 9177c4e: 33 of 33 exit 0 (dispatch-gates --ran: 33 derived, 33 run, 0 NOT MEASURED)</summary> ```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-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-skills-token-ratchet.mjs :: exit 0 node scripts/check-skills-token-ratchet.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/pm/bare-root-worklist.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: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:nul-bytes :: exit 0 pnpm check:parse-guard :: exit 0 pnpm check:pm-dispatch-gates :: exit 0 pnpm check:pm-governed-merges :: 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:watch-hint-literal :: exit 0 ``` Also run: both scripts' own `--self-test` (exit 0, outside the derivation), and `ui/scripts/__tests__/check-governed-queue-guard.test.ts`, the one test file naming `check-governed-merges.mjs` (`VERDICT command-exit 0`, 10/10). </details> - `node scripts/pm/dispatch-gates.mjs --tier`: no path-derived mandate (the surface hits none of the 4 declared globs); 205 changed lines, under 3000. - `node scripts/pm/check-governed-merges.mjs --branch claude/project-thread-qz1fgc`: 0 of 2 paths hit the register, NOT governed; size 205 (+183 / −22). - `skip-changeset`: two `scripts/pm/**` tools, nothing published. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5nqeu4RWPfV6S5jfCq)_ <!-- signed: domain:skills#1 · os-project-manager · session_01FEkQ5nqeu4RWPfV6S5jfCq --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 06b5669 commit 7844272

2 files changed

Lines changed: 183 additions & 22 deletions

File tree

0 commit comments

Comments
 (0)