Repository navigation
Commit 26e1453
feat(pm): an enqueue by an authorized account is the human review at the queue (#26230)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ86NgoAHToTmDrgbochfTZyA)_
Fixes #26066
Clause-②: no
Metadata-protocol: none
## What changed
The governed queue guard's `merge_group` leg now passes a governed pull
request when EITHER an account in `GOVERNED_APPROVERS` holds a
latest-decisive APPROVED review (the 2026-09-04 predicate, unchanged and
read first) OR that account put the entry in the queue. The maintainer's
own "Merge when ready" from `os-zhuang` or `hotlong` is the human
review; no separate Approve is owed. The approver set is unchanged and
is still the single constant.
- `scripts/pm/check-governed-queue-guard.mjs`
- `enqueuerFromTimeline` / `authorizedEnqueueVerdict` /
`undeterminedEnqueue` (pure) and `makeTimelineReader` (paged `GET
/issues/N/timeline`, throws on truncation because the newest event is on
the last page).
- `runGuard` reads the enqueuer SECOND, only for an entry the approval
did not satisfy (monotone, free for approved entries), before any Tier S
record read. `entrySatisfied` gains the enqueue limb between the
approval and the record; `satisfiedBy` names the leg.
- Log line (card §3): `✅ enqueued by an authorized account: LOGIN
(added_to_merge_queue at T)`, a third CLEARED wording ("The ENQUEUE leg
satisfied N of them: #N (enqueued by LOGIN)") so the clear never claims
an approval it did not read, and on refusal `⛔ enqueued by LOGIN,
outside GOVERNED_APPROVERS` or `⛔ enqueuer UNDETERMINED — reason`.
- Size limb (card §4): `runSizeGuard` hands the enqueue reading beside
the approval verdict to the sibling's lift; a governed and oversized PR
costs one timeline read, not two. Remedies on both legs name the enqueue
landing; the bypass-rules option stays named.
- Header: a dated section for the 2026-10-26 ruling (verbatim quotes),
the measured reading, why this is not the actor-field attribution #11704
retracted, the accepted cost, and the exit-table rows for 0 / 3 / 8.
- `scripts/pm/check-governed-merges.mjs` (claim amendment, those two
functions and their pins only): `sizeLiftFrom` reads an `authorized`
enqueue as a second lift after the approval lift; `renderLiftApprovals`
renders it; new `SIZE_ENQUEUE_LIFT_RULING`.
- `AGENTS.md`, inside its line ratchet (1,117 lines before and after, no
line over 120 bytes): Prime Directive 14 says Tier H lands "by the
maintainer's hand (merge or enqueue) or an authorized approval"; one
sentence adds "An authorized account's enqueue is a review record too: ⛔
never a seat's."; and Multi-agent §7 (c) says the size line lands by
"the maintainer's merge or enqueue". The details (for that queue entry
only, undetermined never passes) are in the guard header, which is where
the rule's detail lives.
## The enqueuer reading, measured (card §2)
Measured on 2026-10-26 against the live REST API of this repository:
- Newest `added_to_merge_queue` timeline event's `actor.login` answers
both paths. #26154 and #26011: armed through auto-merge, and the add
event's actor is the account that armed it. #26166: direct enqueue, add
event present, and no `auto_merge_enabled` event at all.
- `auto_merge.enabled_by.login` is null on a direct enqueue (#26166
never had one) and on every merged PR read, so it answers only the armed
path. Not used.
- `GET /issues/N/timeline` answers `X-Accepted-GitHub-Permissions:
issues=read; pull_requests=read`. The workflow's existing
`pull-requests: read` covers it, so
`.github/workflows/governed-surface-guard.yml` is untouched.
- Not measured: a `merge_group` run's own token reading the timeline,
and an enqueue armed from an authorized account reaching the queue
(#26138 was armed by `os-zhuang` and not yet queued at read time). The
first live queue build after this lands prints the reading either way,
and an unreadable one is UNDETERMINED, which is today's behaviour.
UNDETERMINED is never a pass: no add event, an actorless add, an
unreadable or truncated timeline, and a newest queue event that is a
removal (the current entry is not on the timeline yet, so the earlier
add belongs to an entry that left) all leave the approval leg to decide
alone, on its own exit code (3, not 4).
## Tests
At head `9e0ae37b` (the last commit touched only `AGENTS.md`; both
self-tests re-run there):
- `node scripts/pm/check-governed-queue-guard.mjs --self-test`: 373
cases pass (was 345). New battery "the 2026-10-26 ENQUEUE leg" with 28
cases, floor 27 to 28. It covers the card's four fixtures (authorized
enqueue with no review passes and names the leg; seat enqueue with no
review is refused on 3 with today's words; seat enqueue with an
authorized approval passes on the review leg and never reads the
timeline; unreadable enqueuer with no review is refused on 3 naming
UNDETERMINED). It also covers a stale add before a removal, no reader,
an unreadable review list beside an authorized or a seat enqueue (0 and
4), the PR leg reading nothing, a Tier S entry clearing without a record
read, the size lift and its refusal, `main()`'s wiring at one timeline
read, and the reader's paging, truncation and non-2xx paths.
- `node scripts/pm/check-governed-merges.mjs --self-test`: 537
assertions pass, including 3 new enqueue-lift pins.
- Ablation 1, enqueue limb of `entrySatisfied` mutated
(`scripts/ablation-replace.mjs`, blob `ecad10abe0f0` to `e05e95b1cbb5`):
5 of 373 cases red (fixture 1, its words, the unreadable-review case,
the Tier S case, the governed-and-oversized case). Restored, blob equals
HEAD, `git diff HEAD` empty.
- Ablation 2, the removal-newest guard in `enqueuerFromTimeline`
mutated: the stale-add case red (1 of 373). Restored, blob equals HEAD.
The first attempt hit an anchor miss (wrong indentation), wrote nothing,
and was re-run on the right anchor.
## Gates
Derived with `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` (no paths; 3 changed paths vs merge base
`fbb75998b`): 42 families.
- At head `9e0ae37b`: 41 of 42 run locally, all exit 0 (exit captured
before any pipe), including `node
scripts/pm/check-governed-queue-guard.mjs --self-test`, `pnpm
check:pm-governed-prose`, `pnpm check:pm-governed-merges`, `pnpm
check:pm-skill-ratchet`, `pnpm check:pm-skill-id-lint`, `pnpm
check:required-contexts`, `pnpm check:nul-bytes`. `--ran`
reconciliation: 42 derived, 41 run, 0 NOT-MEASURED, 1 UNRUN.
- The UNRUN one is `pnpm check:pm-dispatch-gates`. It ran at `8258383f`
(the head before the AGENTS.md-only rewrap commit) and exited 0: fast
tier, 1917 cases, 618 s. It was not re-run on `9e0ae37b`; CI runs it.
- The first run at `8258383f` had one red, `pnpm
check:pm-skill-ratchet`: AGENTS.md was over its 1,117-line ceiling
(1,121) and had two lines over 120 bytes. The sentences were rewritten
to fit the existing lines (no ceiling raised, no unrelated re-wrap). It
is green at `9e0ae37b`.
- ESLint (`pnpm exec eslint --no-inline-config`) on the two changed
scripts: exit 0. Repo-wide `pnpm lint` is left to CI.
## Acceptance notes
- The dispatch order names `pnpm check:governed-queue-guard-self-test`.
No such script exists in `package.json`; the guard's `--self-test` is in
the derived list and was run directly. Repo-wide `pnpm lint` is CI's per
`.claude/agents/os-dev.md`; ESLint ran locally on the two changed
scripts (exit 0).
- An enqueue counts for that queue entry only: a seat's re-enqueue after
an ejection is a new entry by a seat account and is refused without the
approval or another authorized click. That is the card's "newest"
reading; carrying the click across ejections the way ruling C carries an
approval would be a separate maintainer decision.
- Tier H (`AGENTS.md`). This PR stays draft and lands by the
maintainer's hand. Chicken-and-egg: until this change is in `main`, that
hand is an APPROVED review or the bypass-rules merge, not the enqueue.
## 维护者速读(草稿)
**改了什么**:合并队列守卫多认一种"人工审核":PR 若是由授权账号(os-zhuang 或 hotlong)点"Merge when
ready"送进队列的,队列守卫直接放行,不再要求先点 Approve。体积超 3000 行的 PR
同样适用。其他账号(包括车队机器人)入队仍然必须有授权 Approve。
**为什么改**:您在手机上原来要先点核准再点合并;按您的要求("大部分我还是希望入队,但是我想省掉
Approve"),以后直接点合并(入队)即可。
**风险与代价(含回滚)**:守卫读的是 PR 时间线上最新一次"入队"事件的操作账号。① 授权账号若被智能体代操作,入队就等于放行,所以
AGENTS.md 同步写明:任何智能体席位都不得以任何账号在未获批的受管 PR 上入队或开自动合并。②
入队后到落地前再推的提交不会被重新审核,与"批准在任意提交上都算"的代价相同。③ 读不到入队者时不放行,仍按原规则判。回滚:还原本 PR
即可,无数据迁移。
**席位意见**:
**你要做的**:本 PR 改了 AGENTS.md,属 Tier H,需要您亲手落地:点 Approve
后由席位落地,或直接合并。新规则要等本 PR 进 main 后才生效,所以这一次还不能只靠入队。
---
_Generated by [Claude
Code](https://claude.ai/code/session_01XDSBMAmqzG7QYwCD7qAGty)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ab112ea commit 26e1453
3 files changed
Lines changed: 489 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
517 | | - | |
| 516 | + | |
| 517 | + | |
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1709 | 1709 | | |
1710 | 1710 | | |
1711 | 1711 | | |
| 1712 | + | |
| 1713 | + | |
1712 | 1714 | | |
1713 | 1715 | | |
1714 | 1716 | | |
| |||
1718 | 1720 | | |
1719 | 1721 | | |
1720 | 1722 | | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
1721 | 1732 | | |
1722 | 1733 | | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
1729 | 1750 | | |
1730 | 1751 | | |
1731 | 1752 | | |
| |||
1921 | 1942 | | |
1922 | 1943 | | |
1923 | 1944 | | |
1924 | | - | |
| 1945 | + | |
1925 | 1946 | | |
| 1947 | + | |
1926 | 1948 | | |
1927 | 1949 | | |
1928 | 1950 | | |
| |||
6422 | 6444 | | |
6423 | 6445 | | |
6424 | 6446 | | |
| 6447 | + | |
| 6448 | + | |
| 6449 | + | |
| 6450 | + | |
| 6451 | + | |
| 6452 | + | |
| 6453 | + | |
| 6454 | + | |
| 6455 | + | |
| 6456 | + | |
| 6457 | + | |
| 6458 | + | |
| 6459 | + | |
| 6460 | + | |
| 6461 | + | |
| 6462 | + | |
6425 | 6463 | | |
6426 | 6464 | | |
6427 | 6465 | | |
| |||
0 commit comments