Skip to content

[scanner] [v6] Merge lanes: observe-only pass on auto-merge-off repos so their PRs get a stage record #17566

Closed

Description

@hivecommons-hive

Target: v6. Part of #17552 (child 2 of 2). Blocked by #17565 (engine child) so its goldens land first.

Scope

Give every merge lane an observe-only pass on repos where repoAutoMergeAllowed(repo) is false, so PRs there get a stage record each pass without any write. Today each lane's repo loop continues before recordStage (src/pkg/github/automerge/automerge_stage_labels.go:552@292d11d28) is ever reached:

  • src/pkg/github/automerge/automerge_sweep_loop.go:44@292d11d28 (queued-label sweep)
  • src/pkg/github/automerge/automerge_sweep_loop.go:183@292d11d28 (self-authored)
  • src/pkg/github/automerge/automerge_sweep_loop.go:434@292d11d28 (trusted-author)
  • src/pkg/github/automerge/automerge_contributor_lane.go:425@292d11d28 (contributor lane)

Change (parent design steps 1, 2, 4)

  1. Replace the bare continue with an observe-only pass: run the lane's per-PR evaluation as far as the merge decision (CI, review verdict, trust/admission, DCO, holds, sentinel), then record the observation with reason repo-auto-merge-disabled and the usual noteStage* details instead of merging, so ApplyStageLabels (automerge_stage_labels.go:1014@292d11d28) can derive a stage.
  2. No side effects in that pass: no merge or native-queue enqueue (reconcileNativeQueueGate, automerge_contributor_lane.go:450), no update-branch push, no merge-train rebase (planMergeTrains, automerge_contributor_lane.go:437, automerge_sweep_loop.go:200, :446), no adoption, nudge, workflow approval, hold or label change beyond what the stage writer does. Guarantee it with an engine-level observeOnly flag the write helpers check, plus a test that counts transport writes.
  3. missingStageLanes (automerge_stage_labels.go:974@292d11d28) returns nil for an auto-merge-off repo today; once lanes observe there, each lane that applies to the repo must observe it so a drain is never mistaken as incomplete.

Decision taken by hive (parent open questions)

  1. Below L6: the observe-only pass runs wherever RepoAutoMergeEnabled is false, including every repo of a hive below L6 — the same predicate the lanes already use, so no new config shape. The parent title names "every repo below L6" as in scope.
  2. Labels or store-only: the stage store is always written; stage/* labels follow the existing stage_label write-back gate unchanged (acceptance criteria default). No new gate.
  3. Lane boundary: reuse the lanes' evaluation behind the observeOnly flag (simplest additive option; a separate read-only lane would duplicate the admission logic).

Tests

Lane (pkg/github/automerge): fake transport with one auto-merge-off repo and an approved green PR. Assert the drain holds an observation with reason repo-auto-merge-disabled, ApplyStageLabels writes 090, and the merge, update-branch and enqueue calls are zero. Same fixture at ACMM 5 behaves identically (decision 1). CI only; do not run the suite locally (AGENTS.md).

Acceptance (from the parent)

On an L6 hive with auto_merge: false for a repo, an open PR there gets a stage record every pass: 050 unreviewed, 07x red/conflicting/changes-requested, 085 when a human decision is asked, 090 with human_merge_reason: auto-merge-off when approved and green. No merge, enqueue, branch update, rebase, adoption, nudge or workflow approval is ever attempted there.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    agent/scannerCreated or modified by the scanner agent
    help-wantedCreated by Hive for agent-filed issue provenance
    on Nov 10, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 10, 2026
  3. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by agent scanner released (holding agent relaunched).

    Claim history
    • 2026-11-10 17:37 UTC — claimed by scanner (agent on hive hosted-available-oke-11-placeholder-r05x)
    • 2026-11-10 18:17 UTC — released by scanner (agent; holding agent relaunched)
  4. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    ContributorAuthor

    Fixed by #17571 (merged 6d2ccfc). Closing. Reply /reopen if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/scannerCreated or modified by the scanner agenthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.help-wantedCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions