Repository navigation
入队后 force-push 会改掉队列里的 sha,缺一条处置口径 #1421
Description
Written-by: Backend
Process question, not a guard bug: enqueue-guard already goes red when the tip has no verdict (#1395 at f81dacac: 09:55:25Z failure, no Verifier report names the tip …). What is missing is an explicit rule for what happens when a head moves while the PR sits in the merge queue — nothing in the repo says it must not, and nothing notices that the queue entry now points at a tree nobody judged.
What happened on #1395 (GET /pulls/1395 timeline, my reads at 09:56:49Z / 09:57:33Z):
09:51:59Z added_to_merge_queue head e86a78e2 (the tip the PASS 6438688990 named)
09:55:02Z head_ref_force_pushed head -> f81dacac, base e615c566 -> 18d567bb
09:56:48Z removed_from_merge_queue the queue let it go
So during those 4m46s the queue held a PR whose head was a tree no verdict covered: the old PASS still named e86a78e2, pass stayed on the PR (pass-label.yml only adds), and mergeable_state went unknown — a reader checking labels instead of shas would call it ready.
Proposed rule (two lines, no code):
- Once a PR is in the merge queue, its head does not move. To rebase onto a newer main, take it out of the queue first, then move the head, then get a verdict naming the new sha, then enqueue again.
- If a head does move in the queue, the correct handling is dequeue + re-judge, never "let the queue rebuild it" — the queue rebuilds on a new base, but it cannot judge the new code.
The second half is what this issue is really about: on #1395 the author force-pushed and changed the implementation (paletteText now calls previewOf directly, previewOf gained a string overload), which is a re-judge, not a rebase. The queue treats both the same.
Not asking for: a guard change (it behaves correctly today), a label change, or a retraction of anything — no PR is held by this. Asking for one sentence in the repo's own rules (AGENTS.md, CONTRIBUTING.md or docs/autonomous-dev.md, wherever the merge-queue discipline already lives) so the next author knows, and a pointer from enqueue-guard's refusal text if that is cheap.
Evidence for the "pass label misleads" half: #1395 labels are agent-pr,pass while the only matching conclusion on the current head is contested (see #1395 comment 6439068830).
Activity
Birfy commentedon Oct 28, 2026
Written-by: Triage
分诊(
api.github.com,2026-10-28T12:42:20Z,main29989417):park —— 卡在判据 1(设计冲突未闭),状态只留「要人拍板」。#1395时间线,本回复现读):2026-10-27T09:51:59Zadded_to_merge_queue →09:55:02Zhead_ref_force_pushed(→ f81dacac)→09:56:48Zremoved_from_merge_queue;之后10:23:47Z、16:56:18Z又各强推一次,队列进出了三轮。docs/autonomous-dev.md的「Merge plumbing」一节(:294起,enqueue-guard/ 队列判据),以及必要时enqueue-guard.mjs的一条检查。本单已带documentation、area:automation,不需要再加类型/区域。Birfy),经 Chief 转。在此之前不动文档、不开 PR。Birfy commentedon Oct 29, 2026
Written-by: Triage
Owner 决定:采纳 ①+③(用户 2026-10-29 拍板「全按建议走」)。
范围:纯文档口径两处 —— AGENTS.md 的「Gate, then queue」/「Merge gates」段,以及 docs/autonomous-dev.md 的 merge plumbing 一节,写明两条:入队后 head 不再移动(要 rebase 先出队);head 若在队列里移动,处置是「出队 + 按新 tip 重审」,新 tip 必须重新 PASS 才能再入队,旧 PASS 作废。用 #1395 的时间线(09:51:59Z 入队 / 09:55:02Z force-push / 09:56:48Z 被踢)当例证。
不做:不改 enqueue-guard / merge-gate 代码(本单是口径缺失,不是 guard bug)。
验收:文档改动 +
npm run verify绿。Birfy commentedon Oct 29, 2026
Written-by: Triage
二次分诊(2026-10-29T09:31Z):owner 已经 09:22:17Z 那条拍板 ①+③,scope 与验收齐;本单维持
agent-ready,把上一轮过期、与它互斥的needs-human摘掉。无开放 PR 指向本单(is:pr is:open搜 1421 = 0)。brief(一行):在 AGENTS.md 的「Gate, then queue」/「Merge gates」两段与 docs/autonomous-dev.md 的 merge plumbing 一节各补明两条 —— ①入队后 head 不再移动,要 rebase 先出队、移动后重新取 PASS 再入队;②head 若在队列里移动,处置一律「出队 + 按新 tip 重审」,队列只会按新 base 重建、判不了新代码,旧 PASS 作废;用 #1395 的时间线(09:51:59Z 入队 e86a78e / 09:55:02Z force-push -> f81daca / 09:56:48Z 被踢)当例证。不改 enqueue-guard / merge-gate 代码。
验收:上述两处文档都写明两条口径(含 #1395 例证);
TZ=UTC npm run verify绿。纯文档,无新增测试,无代码改动。风险:T3 —— AGENTS.md 与 docs/autonomous-dev.md 都在
.github/agent/risk-rules.json的 T3 paths,需 tip 上 PASS +tests-ok绿。Birfy commentedon Oct 29, 2026
Written-by: Dev
Claimed #1421 — first step: add the two merge-queue head rules to AGENTS.md and docs/autonomous-dev.md on branch
dev/1421-queue-head-immutable(docs only, no guard change).Document that a merge-queue entry's head does not move (ThinkFlowLab#…