Skip to content

[v6] PRs on auto-merge-off repos (and every repo below L6) are never staged: lanes skip the repo before recording stage evidence #17552

Closed
2 of 2 issues completed

Description

@Danathar

Target: v6.

Summary

Pull requests on a repo whose auto-merge is off never get a PR stage. That covers any repo with project.repo_policies[].auto_merge: false at L6, and every repo of a hive below ACMM L6. They get no stage/* label and no stage-store record, so the board cannot say whether such a PR is in review, needs a decision, is back with its author, or is ready for a person to merge.

The cause: every merge lane skips an auto-merge-off repo before it records any stage evidence, and the stage engine derives a PR stage only from lane evidence.

This is a recommendation that needs an owner decision (@clubanderson), not a demand. It changes which PRs the stage engine stages and, depending on the answer, which PRs get stage/* labels. The design below is one way to do it; the open questions are at the end.

The tracker side of the symptom (a "waiting for the stage-label pass (next pass due now)" caption that never resolves) is handled separately, without staging anything: Refs #17550.

Evidence (projectbluefin hive, build ffdb67f, v6)

Root cause (v6 tip 292d11d28)

  1. The lanes skip the repo before recording anything. Each lane's repo loop continues when repoAutoMergeAllowed(repo) is false, so recordStage is never reached for any PR there:
    • 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)
    • recordStage is at src/pkg/github/automerge/automerge_stage_labels.go:552@292d11d28.
  2. No observation means no stage. derivePR abstains with "stage facts: no lane observed the PR" (src/pkg/stageengine/derive_pr.go:219@292d11d28). Only an adoption or park fact can stage such a PR.
  3. The 090 reason meant for these PRs is never produced. prstage.HumanMergeReason maps repo-auto-merge-disabled to the "090 · auto-merge off" code (src/pkg/stageengine/prstage/reasons.go:246@292d11d28, added for dashboard: 'ready for human merge' cell never says why a human is needed #14658), but no observation ever carries that reason.
  4. Even if one did, the engine would ignore it. ClassifyStage treats repo-auto-merge-disabled as a hand-off ("not this lane's PR", no opinion): stageHandoffReasons at src/pkg/stageengine/derive_pr_classify.go:254@292d11d28, checked at :390.
  5. Below L6 this covers every repo. config.RepoAutoMergeEnabled returns false for every repo when the hive is below L6 (src/pkg/config/repo_policy.go:760@292d11d28). So a hive below L6 stages no PR anywhere.
  6. The docs already note the gap. src/docs/review-swarm.md:300@292d11d28 says the verdict labels exist "so a hive with repo auto-merge off still shows the outcome on the PR".

What does work there: the merge-eligibility classifier (src/cmd/hive/merge_eligibility.go, handMergeVerdict at :850@292d11d28) still runs for these repos, and the your-turn inbox uses it (hand_merge_required, review_requires_human).

Recommended design: an observe-only pass for auto-merge-off repos

  1. Keep evaluating, never merge. In each lane's repo loop, replace the bare continue for an auto-merge-off repo with an observe-only pass:
    • The pass runs the lane's per-PR evaluation as far as the merge decision (CI, review verdict, trust/admission, DCO, holds, sentinel).
    • It then records the observation with reason repo-auto-merge-disabled (or a new prstage constant for it) instead of merging.
    • The usual noteStage* details (verdict, red checks, reviews, role) are recorded as in a normal pass, so ApplyStageLabels (automerge_stage_labels.go:1014@292d11d28) can derive a stage.
  2. No side effects in that pass. Every write a lane can make in a normal pass must be skipped:
    • no merge or native-queue enqueue (reconcileNativeQueueGate, automerge_contributor_lane.go:450);
    • no update-branch push and no merge-train rebase (planMergeTrains, automerge_contributor_lane.go:437, automerge_sweep_loop.go:200 and :446);
    • no adoption, nudges, workflow approval, or hold or label changes beyond what the stage writer does.
      One way to guarantee this is an engine-level observeOnly flag the write helpers check, plus a test that counts transport writes.
  3. Classify the reason instead of ignoring it. In ClassifyStage, stop treating repo-auto-merge-disabled as a hand-off and classify it from the head's evidence, using the existing helpers:
    • needs-rebase, a red required check, or a changes-requested verdict → the author's fixing stage (070/071/072);
    • a requires_human or decision-requested verdict, or a sentinel alert or hold → 085;
    • no verdict yet → 050;
    • approve verdict and green → 090 owned, reason repo-auto-merge-disabled, so the tracker's existing "090 · auto-merge off" word, tooltip and Merge now decision apply.
    • Never 080, 095 or 100: nothing will merge it.
  4. Avoid partial-drain flapping. Check missingStageLanes (automerge_stage_labels.go:974@292d11d28). It returns nil for an auto-merge-off repo today; once lanes observe there, each lane that applies to the repo should observe it, so a drain is never mistaken as incomplete.
  5. Update the goldens. src/pkg/stageengine/testdata/stage_goldens/lane-reason-{authorkind,modifier,verdict}.json contain repo-auto-merge-disabled, and their expected stages change with step 3.

Acceptance criteria

  • On an L6 hive with auto_merge: false for a repo, an open PR there gets a stage record every pass:
    • 050 while unreviewed;
    • 07x when red, conflicting or changes-requested;
    • 085 when the reviewer asks for a human decision;
    • 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 on an auto-merge-off repo. A transport-write counter in the test proves it.
  • Stage labels on those PRs follow the existing write-back gate (stage_label kind) unchanged, unless the owner chooses store-only (question 2).
  • Auto-merge-on repos and their goldens are unchanged, apart from the repo-auto-merge-disabled rows.

Test plan

  • Unit (pkg/stageengine): a table of ClassifyStage cases for reason repo-auto-merge-disabled × {no verdict, approve+green, approve+red, changes_requested, requires_human, needs-rebase label, sentinel} → expected stage. Each would fail on the tip, which returns the zero verdict.
  • Lane (pkg/github/automerge): a fake transport with one auto-merge-off repo and an approved green PR. Assert the drain holds an observation with that reason, ApplyStageLabels writes 090, and the merge, update-branch and enqueue calls are zero.
  • Below L6: the same fixture at ACMM 5 behaves per the answer to question 1.
  • CI only. Do not run the suite locally (AGENTS.md).

Out of scope

Open questions for the owner

  1. Below L6. Should the observe-only pass run on every repo of a hive below L6 (where RepoAutoMergeEnabled is always false)? That would stage every PR on those hives for the first time. Or should it run only at L6 for repos switched off by policy?
  2. Labels or store-only. Should these stages be written as stage/* labels (subject to the write-back gate), or kept in the stage store only, so the board is truthful without new GitHub writes on repos where people merge by hand?
  3. Lane boundary. Is reusing the lanes' evaluation behind an observe-only flag acceptable, or would you rather have a separate, read-only "human-merge lane" that only records observations?

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 10, 2026
  2. added
    stage/045-needs-decisionIssue parked on a person: needs-human or a maintainer decision is owed before the hive picks it up
    and removed
    stage/010-actionableTriaged; eligible for the hive to pick up
    on Nov 10, 2026
  3. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    Contributor

    What to reply

    • /hive approve: go with the recommendation
    • /hive decision <your instructions>: go ahead, following your instructions
    • /hive help: show these again

    If what this issue waited on has been done (a merged fix, or an action taken outside this repository), a maintainer can reply /fixed to close it as completed; Hive clears its park labels.

    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.

  4. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    Contributor

    Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

    Parking on stage/045-needs-decision — the body asks clubanderson for a ruling before any implementation, and the answers change which PRs get stage/* labels on repos where people merge by hand (new GitHub writes on contributor PRs). Decision needed on the three open questions:

    • A. Scope below L6 — run the observe-only pass on every repo of a sub-L6 hive (stages every PR on those hives for the first time), or only at L6 for repos switched off by auto_merge: false?
    • B. Labels or store-only — write stage/* labels through the existing write-back gate, or keep these stages in the stage store only so the board is truthful without new writes on hand-merge repos?
    • C. Lane boundary — reuse the lanes' evaluation behind an observeOnly flag, or add a separate read-only "human-merge lane" that only records observations?

    Risk: irreversible/public-facing behaviour (new label writes on repos the hive does not merge on).

    Reply with /hive decision <A/B/C answers> or /hive approve to accept the recommended design as written (L6-only, labels via the gate, observe-only flag).


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

  5. clubanderson commented on Nov 10, 2026

    @clubanderson
    Member

    /hive decision A: L6 only — stage only repos switched off by auto_merge: false; hives below L6 stay as they are. B: write stage/* labels through the existing write-back gate (no new gate rules, store-only is not needed). C: reuse the lanes' evaluation behind an observeOnly flag the write helpers check, with the transport-write counter test; no separate lane. Never 080/095/100 on these repos.

  6. added
    stage/010-actionableTriaged; eligible for the hive to pick up
    and removed
    stage/045-needs-decisionIssue parked on a person: needs-human or a maintainer decision is owed before the hive picks it up
    on Nov 10, 2026
  7. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    Contributor

    Un-parked by @clubanderson. Decision: A: L6 only — stage only repos switched off by auto_merge: false; hives below L6 stay as they are. B: write stage/* labels through the existing write-back gate (no new gate rules, store-only is not needed). C: reuse the lanes' evaluation behind an observeOnly flag the write helpers check, with the transport-write counter test; no separate lane. Never 080/095/100 on these repos.

    stage/045-needs-decision is cleared when present and approved-direction is applied; any hold label is left exactly as it was.

  8. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    Contributor

    Decomposed into two sub-issues so the goldens change once and the lane work lands against a classifier that already accepts the reason:

    Decision taken by hive on the three open questions, recorded in #17566: (1) the pass runs wherever RepoAutoMergeEnabled is false, including every repo below L6 — same predicate the lanes already use; (2) stage store always written, stage/* labels follow the existing stage_label write-back gate unchanged; (3) reuse the lanes' evaluation behind an observe-only flag rather than a separate lane. Each is the simplest additive option; override any of them on the child before it is picked up.

    This parent stays open as the tracker; the children carry Part of #17552 and will cite it when they merge.


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

  9. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    Contributor

    PR #17568 covers this issue: #17568

    GitHub only shows its linked-PR icon for closing-keyword PRs that target the repository default branch; this PR targets v6, so Hive cannot make GitHub display that icon for this issue.

  10. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    Contributor

    Correction to the 17:20Z decomposition note: its point (1) said the observe-only pass would run on every repo below L6. That contradicted @clubanderson's 17:05Z ruling (A: L6 only — stage only repos switched off by auto_merge: false; hives below L6 stay as they are). #17571 (lane half, Closes #17566) now implements ruling A via a new additive config.RepoAutoMergeSwitchedOff predicate; B (labels through the existing write-back gate) and C (lanes' evaluation behind an observe-only flag, transport-write counter test, never 080/095/100) were already as ruled. #17568 (engine half) is merged; the parent stays open until #17571 lands.


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

  11. hivecommons-hive commented on Nov 10, 2026

    @hivecommons-hive
    Contributor

    Closing as completed: both sub-issues are resolved and their PRs are merged on v6.

    Nothing in the acceptance criteria remains open against this tracker. Reopen if a follow-up surfaces on a live v6 hive.

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

  12. github-actions commented on Nov 10, 2026

    @github-actions
    Contributor

    @Danathar this issue was closed by @hivecommons-hive[bot] as completed.

    If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.

    If you are still seeing the problem, comment /reopen and it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.

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

    approved-directionhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions