Skip to content

入队后 force-push 会改掉队列里的 sha,缺一条处置口径 #1421

Closed

Description

@Birfy

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):

  1. 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.
  2. 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

  1. added
    area:automationScheduled tasks and automation
    documentationImprovements or additions to documentation
    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)
    on Oct 27, 2026
  2. Birfy commented on Oct 28, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    分诊(api.github.com,2026-10-28T12:42:20Z,main 29989417):park —— 卡在判据 1(设计冲突未闭),状态只留「要人拍板」。

    • 要补的是一条规则,不是一段代码:head 在队列里被 force-push 之后该怎么办,有三种口径可挑 —— ① 自动出队并作废旧结论、按新 tip 重审;② 队列期间禁止 force-push(由检查挡住);③ 允许移动但要求新 tip 重新 PASS 才能再入队。选哪条属于 owner 的决定。
    • 证据仍在(#1395 时间线,本回复现读):2026-10-27T09:51:59Z added_to_merge_queue → 09:55:02Z head_ref_force_pushed(→ f81dacac)→ 09:56:48Z removed_from_merge_queue;之后 10:23:47Z、16:56:18Z 又各强推一次,队列进出了三轮。
    • 缺什么:owner 选定口径;选定后要动的是 docs/autonomous-dev.md 的「Merge plumbing」一节(:294 起,enqueue-guard / 队列判据),以及必要时 enqueue-guard.mjs 的一条检查。本单已带 documentation、area:automation,不需要再加类型/区域。
    • 谁能给:owner(Danyang / Birfy),经 Chief 转。在此之前不动文档、不开 PR。
  3. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 29, 2026
  4. Birfy commented on Oct 29, 2026

    @Birfy
    CollaboratorAuthor

    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 绿。

  5. removed
    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)
    on Oct 29, 2026
  6. Birfy commented on Oct 29, 2026

    @Birfy
    CollaboratorAuthor

    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 绿。

  7. self-assigned this
    on Oct 29, 2026
  8. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 29, 2026
  9. Birfy commented on Oct 29, 2026

    @Birfy
    CollaboratorAuthor

    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).

  10. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 29, 2026
  11. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 29, 2026
  12. added a commit that references this issue on Oct 29, 2026
    efbf831
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions