Repository navigation
Commit 7c0968a
pm: relay pr_dequeue door and the approved large-PR jump; the landing seat watches its queued PR (#33732)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X1zqDA59t8Ny2CrxV1C1hqX)_
Fixes #33647
domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**: 中继新增出队操作 `pr_dequeue`(三因围栏:与基座冲突、自身改动致队列构建红、PR
正文签名尾行所记落地席以签名评论自请;先贴审计评论再出队,回读离队且仍开未合才算落地);`pr_enqueue_front` 对逾 3,000
行 PR 认现 head 上的授权批准,或你点名现 head
的评论承接旧批准(首行是席位签名的评论不算);`landing-operations.md` 写入「谁入队谁看护」;队列席章程放宽到这两扇新门。
- **为什么改**: 你的话「建议有专人来跟进队列吗?这种操作不应该等我」;本卡第二步,出队和大 PR 插队不再等你动手。
- **风险与回滚**: 出队只在中继自己的读数满足三因之一时才写,围栏不过即零写入;批准仍归你,中继只读不给。回滚即 revert。
- **先看**: `scripts/pm/fleet-write/ops.mjs` 的 `pr_dequeue` 一节与
`DEQUEUE_FENCES`;`execute.mjs` 的 `dequeuePreflight` 与 `dequeueAction`。
- **两分钟验证**: `node scripts/pm/fleet-write/execute.mjs --self-test &&
node scripts/pm/fleet-write/validate.mjs --self-test`,预期 415 例与 428 例全过。
- **需要你做的**: 给 `objectstack-fleet` App 开 `Merge queues: write`(见下文 item
5);合并本身是席位落地(Tier S,须现 head 达档复核 PASS)。
## What changes
1. **`pr_dequeue`, a new relay row (`ops.mjs`, `execute.mjs`,
`validate.mjs`).** It sends GraphQL `dequeuePullRequest(input: { id })`
for one pull. The required fields are `pull`, `expected_head_sha`,
`cause` (one of `conflict`, `own-failure`, `seat-asks`) and `reason` (at
most 1,000 bytes). Before any write, the executor reads the pull, its
base's merge queue (with each entry's merge-group check rollup) and, for
`seat-asks` only, the landing seat that the pull body's signed trailer
names and then the pull's comments. It then judges six fences
(`DEQUEUE_FENCES`):
- `open`: the pull is open.
- `head`: the pull's head is still `expected_head_sha`.
- `release`: the pull is not the Version Packages pull.
- `queue`: the base's queue was read whole.
- `queued`: the queue lists the pull.
- `cause`, by the named cause:
- `conflict` needs `mergeable_state` `dirty` (`unknown` is not judged);
- `own-failure` needs the entry to read `UNMERGEABLE`, or its
merge-group rollup to read `FAILURE`/`ERROR` (null is refused);
- `seat-asks` needs the pull body's signed trailer (`<!-- signed: LANE#N
· ACCOUNT · SESSION -->`) to name a seat, and a comment by
`objectstack-fleet[bot]` whose signature line names that same seat and
account under the dispatching session (`signedByLandingSeat`). A body
with no trailer is refused before its comments are read. Another seat's
signed comment (a review record, a triage knock, the queue seat's own
jump comment) and the relay's own audit comments answer nothing.
`payload.session` is still the sender's own word: the fence binds it to
the seat the pull names, but does not prove who typed it.
Any failed fence is refused with zero writes (exit 5). When all hold,
the relay posts ONE audit comment on the pull (session, request, cause,
what the relay read and the seat's reason), and sends the mutation, on
the node id from the preflight's own pull read, only after that comment
answers 201. It then re-reads the queue every 3 s for up to 30 s, and
lands only when the pull is gone AND two reads of its own GET, one poll
interval apart, both read it still open with `merged` false. The queue's
removal and the merge arrive seconds apart in either order
(`platform-readings.md`). A pull that merged or closed inside the window
is FAILED, naming it. If the pull is still listed, the action is FAILED,
UNCONFIRMED; a 200 is never trusted alone. The row mints `merge-queues:
write` for its stroke alone (as the jump does), spends `contents` and
`issues` beside it, and travels alone. Whether WHO failed is a flake is
the three-fact test, which no read can run, so the seat states it in
`reason` and the audit comment carries it. `automerge_disable` is
unchanged.
2. **The size lift on `pr_enqueue_front` (`ops.mjs`, `execute.mjs`).**
The over-3,000-line fence now holds when an authorised approval lifts
it, read only for a pull over the line (`enqueueFrontSizeLift`):
- **On the head.** The latest review by a `GOVERNED_APPROVERS` account
is APPROVED on the current head (the queue guard's own
`authorizedApprovalVerdict`).
- **Carried.** The optional `approval_comment` names a comment on this
pull, by a `GOVERNED_APPROVERS` account, that names the current head (7
or more hex characters). It is read by its own GET, and a comment whose
first non-empty line is a seat signature carries nothing: authorised
accounts are agent-operated too, so a seat's knock or record that quotes
the head is not the maintainer's confirmation.
An approval on another head, by another account, or in a comment on
another pull lifts nothing. The governed fence, the one-jump fence and
the three jump reasons are untouched, and the relay never gives an
approval.
3. **`landing-operations.md`.** The jump's §7 line folds into its
refusal line, and four lines are added:
- the over-3,000-line lift;
- `pr_dequeue`'s three causes, over two lines: (c) is the seat that the
PR body's signed trailer names, asking through a signed comment, and the
dequeue lands only on "out of the queue, still open, unmerged", with the
audit comment first;
- 「谁入队谁看护」: on a conflict or an own-cause ejection, dequeue, fix and
re-queue within one patrol; when another PR's flake ejects it, re-queue
under the four branches.
4. **`lanes/queue.md`.** The charter widens to the two doors:
- the jump line drops its "≤3,000 lines" and gains the lift line, which
takes only a maintainer comment that is not seat-signed;
- `pr_dequeue` on an offline landing seat's behalf for causes (a)(b)
only; for (c) the relay accepts only the seat that the body's signed
trailer names;
- the relay's own audit comment and read-back (still queued or merged ⇒
FAILED, no resend, report to the maintainer).
The "maintainer removes it until the relay op lands" section loses its
dequeue line and keeps the approval itself, governed PRs, Version
Packages, queue config and the App permission.
5. **Carried for #33718 (the seat's request, ruling record 6891082225,
letter B).** In `landing-operations.md`, the retro-review line 「发现立新卡」
becomes 「发现照立卡门入卡」, because B keeps one checklist card per reviewed PR
with later reviews appended. To stay within the 120-byte cap, 「落地后才见」
became 「落地后见」. The line is now exactly 120 bytes, and no lines are
added.
6. **`check-skill-line-ratchet.mjs`: two ceilings raised, both measured
and both quoting the maintainer's words on the card.**
- `landing-operations.md` goes from 108 to 112 (+4), with a matching
`ruledRaises` record on its CROSS_FILE_MOVES entry dated 2026-11-15.
- `lanes/queue.md` goes from 30 to 32 (+2).
Ruling of record for both: card #33647 (filing gate ③),
「建议有专人来跟进队列吗?这种操作不应该等我」. Items 1–3 and the charter widening order this
text, and both stay at headroom 0.
`skip-changeset`: `.claude/**` and `scripts/pm/**` only, published by no
package.
## For the maintainer (item 5, not in this diff)
- **The `objectstack-fleet` App's `Merge queues: write` grant is yours
to give.** This PR changes no workflow and no ruleset. Until the grant
exists, a `pr_dequeue` stroke fails at the token mint with zero writes,
the same as the jump does today.
- **Not measured: the mutation's input and its permission.** Whether
`dequeuePullRequest` needs that grant at all, and whether the input it
accepts is the pull's node id, are read from GitHub's schema
documentation and NOT MEASURED. So is the reading that a queue entry's
`headCommit { statusCheckRollup }` is its merge-group commit's rollup,
which is the second half of the `own-failure` cause. GraphQL is closed
to this container, and no live stroke has run. The first live stroke
measures the mutation and the grant, and a GraphQL error is a FAILED
action that names the grant. The first `own-failure` stroke measures the
rollup, because the audit comment prints the rollup it read.
## Tests
- `node scripts/pm/fleet-write/execute.mjs --self-test`: 415 cases
across 30 batteries pass (floor 28 → 30). There are two new batteries:
- **The SIZE lift.** Under the line with no read, an approval on the
head lifts, an approval on an older head does not, an unauthorised
approver does not, a carried comment naming the head lifts, and a
comment naming another head, by another author, on another pull, or
opening with a seat signature does not; the same approver's comment with
a signature lower down still carries it, and no signature reader carries
nothing. A failed read is refused.
- **`pr_dequeue`.** Every fence is tested both ways, and every cause
holds and fails. The audit comment is posted before the mutation. No
mutation is sent when the comment fails. `seat-asks` refuses each of
these: another seat's signed comment, the queue seat's jump comment, the
landing seat's lane under another account, the relay's own earlier audit
comment, and a body with no trailer (whose comments are never read). A
pull read with no node id writes nothing, and no second pull read sits
between the comment and the mutation. A read-back that still lists the
pull is FAILED, UNCONFIRMED. A pull that merges, or closes, inside the
window is FAILED naming it, including a merge that shows only on the
second pull read, and a `merged_at` beside a false `merged`. A pull that
leaves within the window still open and unmerged lands, including after
a failed pull read. A pin holds `RELAY_COMMENT_AUTHOR` equal to
`check-handover.mjs`'s `FLEET_BOT_LOGIN`.
- `node scripts/pm/fleet-write/validate.mjs --self-test`: 428 cases
across 22 batteries pass (floor 21 → 22). The new `pr_dequeue` battery
covers:
- its closed keys and the cause enum;
- the 1,000-byte reason bound;
- travelling alone;
- the `merge-queues` grant;
- `ALLOWED_MUTATIONS` holding `dequeuePullRequest`.
The table pins (`alsoSpends`, `alone`, the merge-queue rows, and
`pr_enqueue_front`'s optional `approval_comment`) moved with it.
- `node scripts/pm/fleet-write/dispatch.mjs --self-test`: 401 cases
pass.
- `node scripts/pm/check-skill-line-ratchet.mjs` exits 0 with every line
at most 120 bytes, and its `--self-test` passes 164 cases.
## Acceptance notes
- **Review round 1 (record 6891728476, PASS on `e40c1bd6`), fixed at
`febb3a98`:**
- S1: `seat-asks` is bound to the landing seat named by the body's
signed trailer.
- S2: the read-back requires the pull open and unmerged.
- S3: a seat-signed carrying comment is refused.
- N1: the rollup reading joins the NOT MEASURED note.
- N2: the mutation reuses the preflight's node id.
- N3 and N4 are accepted as they stand. The `fleet-write.yml` comment
and the PD#14 sentence go to this PR's follow-up card.
The skill lines change in place, with no line added. In
`landing-operations.md` the carried line reads 「维护者非席位签名评论」, and (c)
reads 「PR 正文签名尾行之席以签名评论自请。审计评论在先,回读离队且仍开未合才落地」. `lanes/queue.md` changes
to match.
- **Review round 2 (delta record on the PR, S1–S3 and N1–N2 closed),
fixed at `0bbf4a3a` (head `94df19bc` after merging `origin/main` with
#33731):**
- D1: the unmerged reading is now two pull reads, one poll interval
apart. The read-back lands only if both read open with `merged` false. A
row pins a merge that shows only on the second read; ablating the second
read reds 4 rows.
- D4 (nit) is not taken. Putting 「旧批准」 back on the
`landing-operations.md` carry line needs 128 bytes against the 120-byte
cap. The shorter spellings would either coin 「席签」, which the skills
never use, or add a line.
- D2 and D3 are accepted as they stand.
- **N2 (a SKILL.md lane-table pointer to `lanes/queue.md`) is not
done.** The pm-dispatch `SKILL.md` lane-table row is 340 bytes against
its 341-byte width pin, and the pointer needs about 360, so it would
need a ruled raise of a row pin. Reported, not raised.
- **N3 is done.** The charter's "opens no PR" stays as worded on main
beside the mailbox, as in `lanes/eval.md`.
- **Read and left alone (`.github/**` is out of scope):**
- `.github/workflows/fleet-write.yml` still calls `pr_enqueue_front` the
ONE consumer of the validate output `permission_merge_queues`.
`pr_dequeue` now consumes it too. The comment is stale and needs no
functional change.
- AGENTS.md PD#14's sentence that no seat act is measured to dequeue
becomes stale once this lands, and it is left for its own card.
- **Two ratchet rows instead of the order's "one line-ratchet row".**
Both files the order names grew, so each needs its own measured ceiling.
- **Tier.** `check-governed-merges.mjs --branch` reads **Tier S**. The
only governed paths are the two `.claude/**` files, and `scripts/pm/**`
is not on the register. The seat lands it after a `## Contract review`
PASS at `CONTRACT_REVIEW_TIER` on the current head. `dispatch-gates
--tier` reads no path-derived mandate.
## Verification
<details><summary>check-governed-merges --branch (head
94df19b)</summary>
```text
governed-surface predicate: 2 of 6 path(s) hit the register (13 surfaces govern objectstack).
GOVERNED — Tier S(席内达档复核落地): every governed path here lies under a Tier S surface, so the OWNING
seat lands this PR through the queue once its thread (or its card) carries a `## Contract review` record
for the CURRENT head — `Served-tier: CONTRACT_REVIEW_TIER`, `**VERDICT: PASS**` — and every
check green (AGENTS.md Prime Directive #14).
Before that record no seat flips it ready, enqueues it, or arms auto-merge; ⛔ no seat approves it either,
and no maintainer click is waited for. One hit governs the whole PR — 「混合 diff 一条命中即整 PR 分叉」;
one Tier H path among the hits and the whole PR would be Tier H.
.claude/** ×2 — the agent instruction tree (skills, agents, hooks, settings)
- .claude/skills/pm-dispatch/references/landing-operations.md
- .claude/skills/pm-dispatch/references/lanes/queue.md
paths not on the register: scripts/pm/check-skill-line-ratchet.mjs, scripts/pm/fleet-write/execute.mjs, scripts/pm/fleet-write/ops.mjs, scripts/pm/fleet-write/validate.mjs
head repo: NOT MEASURED — this verdict cannot tell a fork PR from an internal one; `--pr <n>` reads it.
size: 830 changed line(s) (+784 / -46) ≤ 3000 — under the human-merge threshold (generated files included in the count).
```
</details>
<details><summary>dispatch-gates --tier and --ran (head
94df19b)</summary>
```text
Model tier — no path-derived mandate: the surface hits none of the 4 declared glob(s), derived here, not recalled.
Run reconciliation — 47 derived, 47 run, 0 NOT-MEASURED, 0 UNRUN.
dispatch-gates --ran: 47 derived famil(ies) accounted for — 47 run, 0 NOT-MEASURED (a DERIVED zero — all 47 recorded an exit code and none of them is 3).
```
</details>
<details><summary>Derived gates: 47 of 47 exit 0 (head
94df19b)</summary>
Every command from `dispatch-gates --commands` exited 0, captured before
any pipe: `node scripts/check-closing-keyword-parity.mjs`, `node
scripts/check-closing-keyword-parity.mjs --self-test`, `node
scripts/check-comment-mask-corpus.mjs`, `node
scripts/check-declaration-mirrors.mjs`, `node
scripts/check-declaration-mirrors.mjs --self-test`, `node
scripts/check-self-test-wired.mjs`, `node
scripts/check-self-test-wired.mjs --self-test`, `node
scripts/check-self-test-workflow-commands.mjs`, `node
scripts/check-self-test-workflow-commands.mjs --self-test`, `node
scripts/check-whole-set-label-write.mjs`, `node
scripts/check-whole-set-label-write.mjs --self-test`, `node
scripts/ci/plan-test-core-shards.mjs --self-test`, `node
scripts/pm/bare-root-worklist.mjs --self-test`, `node
scripts/pm/check-harness-current.mjs --self-test`, `pnpm --filter
@objectstack/lint run check:doc-formula-expressions`, `pnpm
check:agent-test-spelling`, `pnpm check:bash32-floor`, `pnpm
check:ci-filter-parity`, `pnpm check:cli-command-ids`, `pnpm
check:cross-package-test-inputs`, `pnpm check:doc-authoring`, `pnpm
check:driver-memory-census`, `pnpm check:entry-guard`, `pnpm
check:gitlink-declared`, `pnpm check:nul-bytes`, `pnpm
check:parse-guard`, `pnpm check:pm-close-cards`, `pnpm
check:pm-dispatch-gates`, `pnpm check:pm-fleet-write-dispatch`, `pnpm
check:pm-fleet-write-execute`, `pnpm check:pm-fleet-write-validate`,
`pnpm check:pm-governed-merges`, `pnpm check:pm-issue-create`, `pnpm
check:pm-issue-transfer`, `pnpm check:pm-label-write`, `pnpm
check:pm-post-stamped`, `pnpm check:pm-record-recognisers`, `pnpm
check:pm-skill-id-lint`, `pnpm check:pm-skill-ratchet`, `pnpm
check:pm-write-pace`, `pnpm check:pnpm-filter-targets`, `pnpm
check:pnpm-flag-spellings`, `pnpm check:ratchet-remedy-authority`, `pnpm
check:refd-timer-probe`, `pnpm check:scripts-symbol-anchors`, `pnpm
check:skill-frame-sync`, `pnpm check:watch-hint-literal`.
Outside the derived list (os-dev.md ⑤, the edited scripts' own suites):
`fleet-write/execute.mjs --self-test`, `fleet-write/validate.mjs
--self-test`, `fleet-write/dispatch.mjs --self-test`,
`check-skill-line-ratchet.mjs --self-test`, each exit 0.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5nn2c5rose69uoEzmE)_
<!-- signed: domain:skills#1 · os-project-manager ·
session_01FEkQ5pjSPT7ui2EUcunaVb -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 06e53a7 commit 7c0968a
6 files changed
Lines changed: 784 additions & 46 deletions
File tree
- .claude/skills/pm-dispatch/references
- lanes
- scripts/pm
- fleet-write
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | | - | |
| 26 | + | |
24 | 27 | | |
25 | | - | |
26 | | - | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1270 | 1270 | | |
1271 | 1271 | | |
1272 | 1272 | | |
1273 | | - | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
1274 | 1282 | | |
1275 | 1283 | | |
1276 | 1284 | | |
| |||
1817 | 1825 | | |
1818 | 1826 | | |
1819 | 1827 | | |
1820 | | - | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
1821 | 1838 | | |
1822 | 1839 | | |
1823 | 1840 | | |
| |||
2515 | 2532 | | |
2516 | 2533 | | |
2517 | 2534 | | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
2518 | 2544 | | |
2519 | 2545 | | |
2520 | 2546 | | |
| |||
0 commit comments