Repository navigation
✨ automerge: route self-merge sweep, lgtm queue and hive-merge relay through the serialized lane; skip native merge-queue branches #10889
Description
Part of #10884
Make all three merge paths consult the serialized lane gate for hive-serialized repositories, and leave branches that have GitHub's native merge queue alone. For direct repositories the paths take exactly today's code path, decided from configuration alone.
Requirements (parent Proposed design, Current behavior #1–3, Interaction with GitHub native Merge Queue → MVP, The spec R3, R7, R22)
- R7. No Hive merge into a
hive-serializedrepo unless the PR is at the front and passed the final re-check — whichever path asks: the App's self-merge sweep (trySweepSelfAuthoredPR), the human-approvedlgtmqueue sweep (trySweepQueuedPR), and thehive-mergerelay. Any other request is deferred with reason "not at the front of the lane". Each path keeps every gate it applies today (authorization, trusted merger, intent tier, approval desk, merge-eligible list, required review approval,min_head_age, the relay's positive-evidence CI gate); the lane only adds. Each path supplies its own "authorization still holds" callback for the final re-check (e.g.lgtmapproval still matches the head). - The sweep's
auto_merge.max_mergesloop (parent Current behavior ✨ Add macOS/launchd support, hybrid scanner pattern, and KubeStellar case study #3) must not merge two PRs into the same lane branch in one pass from one validation (Inv. 7). - R3 / AC4. Strategy never enables merging: auto-merge off, paused, below Level 6, or held ⇒ no merge from any path.
- R22 / AC26. If the target branch has GitHub's native merge queue (detector from ✨ github: lane-only branch-rules reader (ruleset required checks, up-to-date enforcement, native merge-queue detection) #10887), the lane does not run for it and Hive makes no direct merge into that branch; the refusal reason says why (shown in the dashboard by the lane-view child).
- Agents gain no new way to merge; the lane runs inside the Hive process.
Acceptance criteria (from parent)
- AC1. No strategy set anywhere ⇒ two green PRs into one branch behave exactly as today.
- AC2. In the existing sweep /
lgtmqueue / relay tests, adirectrepo produces the same GitHub calls, same order, same parameters; decidingdirectneeds no GitHub call. - AC4. As above.
- AC6. Two green eligible PRs into one branch: ≤1 in final validation; the second merges only after the first merged and the second was updated and re-passed on the new tip.
- AC7. For a non-front PR: sweep makes no merge call; relay request and
lgtmPR are deferred with "not at the front of the lane". - AC26. Merge-queue branch: no direct merge, reason recorded.
Code locations (parent Current behavior table / Likely code areas)
pkg/github/automerge/automerge_sweep.go:1097,:1365,:182,:705-792,:1097-1100,:1519pkg/github/merge_request_watcher.go:346,pkg/github/merge_ci_gate.go,pkg/github/pullrequest.go:273cmd/hive/merge_eligibility.go:107-113; wiring incmd/hive/main.go(sweep start, run-loop queued sweep)policies/scanner-automerge.md(tell the scanner a deferred "not at the front of the lane" is expected, not an error)
Blocked by #10888 (lane core).
Definition of Done
- Single
strategy == hive-serializedbranch point per path, before any lane-specific GitHub call. - Sweep,
lgtmsweep and relay route through the lane gate; non-front requests deferred with the stated reason. - Native-merge-queue branches refused with reason.
- New scenario tests for AC6, AC7, AC26, AC4; existing path tests pass unchanged (AC1/AC2).
Non-negotiable invariant
Nothing changes for organization repositories or repositories left on direct. Every merge path decides and merges exactly as today, makes the same GitHub calls (same order, same parameters) and gives the same refusal reasons; deciding a repository is direct needs no GitHub call (parent AC1, AC2, Constraints). Existing tests for the self-merge sweep, the lgtm queue, the merge-request relay, merge eligibility and required checks must pass unchanged. No existing gate is weakened on any path. The lane must never be called a "merge queue" in code, config, dashboard or docs.
Out of scope
Fixing items 4–7 of the parent's Current behavior table on the direct paths (stale behind detection, ruleset checks on default paths, live labels in the sweep's last re-check, unpinned branch updates) — the parent's MVP → Deferred and Decisions already made #9 keep those as separate issues. Also deferred: auto/native, merging through GitHub's queue, synthetic merge refs, batching, per-branch strategy, rebase updates, automatic revert, two hives on one repository.
Target branch: v6. Paths are under src/.
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
hivecommons-hive commentedon Oct 6, 2026
🔒 Claimed by @mendezr (contributor on hive hosted-available-oke-11-placeholder-r05x) until 2026-10-06 18:01 UTC. Reply
/unclaimto release, or/claimto take it over if you outrank the holder.mendezr commentedon Oct 6, 2026
This assignment explicitly requires base
v5, but this issue specifiesv6and its prerequisites shipped only there: #10893 (merge_strategy config, merged to v6 at 3eba58c) and #10894 (lane-only branch rules, merged to v6 at 009369a). The fetched upstream/v5 has no serialized-lane strategy or lane core; #10888 remains open with no linked implementation PR found. Wiring these paths on v5 now would require independently implementing/backporting the prerequisite features rather than this wiring child.Maintainer decision needed: retarget this contributor assignment to v6 after #10888 lands, or explicitly approve and arrange the prerequisites/backport onto v5. No implementation PR opened, and no existing merge gates changed.
— hive: backend=pi model=openai-codex/gpt-6.1-sol
🐝 Hive Agent:
contributor| SHA:unknownhivecommons-hive commentedon Oct 6, 2026
What to reply
/hive approve: go with the recommendation/hive decision <your instructions>: go ahead, following your instructions/hive help: show these againIf this issue is waiting only for reporter confirmation after a merged fix, the reporter or a maintainer can reply
/fixedinstead.Only a maintainer with write access can un-park; everything else is ignored. Full command reference: https://github.com/hivecommons/hive/blob/v5/src/docs/maintainer-commands.md.
✨ feat: query viewer branch-update capability for fork PRs (#10896)
Danathar commentedon Oct 6, 2026
/hive decision this is a v6 feature
hivecommons-hive commentedon Oct 6, 2026
Un-parked by @Danathar. Decision: this is a v6 feature
needs-human,needs-decisionandneeds-directionare cleared when present andapproved-directionis applied; anyholdlabel is left exactly as it was.hivecommons-hive commentedon Oct 6, 2026
🔒 Claimed by agent
scanner(agent on hive hosted-available-oke-11-placeholder-r05x) until 2026-10-06 21:10 UTC. Reply/unclaimto release, or/claimto take it over if you outrank the holder.✨ feat(automerge): route sweep, lgtm queue and hive-merge relay throu…
github-actions commentedon Oct 6, 2026
Closed by #10905 (merged to
v6).✨ merge-lane: fork PR handling — capability + base-sync gated update,…