Skip to content

πŸ› fix(automerge): a contributor-lane PR on a hive with the review swarm off parks for a person instead of waiting at review-pending forever - #17080

Merged
hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/contributor-review-dispatch
Nov 7, 2026

Conversation

@Danathar

@Danathar Danathar commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

On a hive whose review swarm is off, a contributor-lane PR waited at 050-review-pending forever. The lane wanted a reviewer verdict because a reviewer agent existed, but the review planner only asks reviewers when review.require_approval and review.fan_out are both on. Nothing was dispatched, and the Activity Monitor kept saying "Review swarm requested" and "Review 0/5 Β· in progress". Now such a head skips as contributor-lane:review-off and parks at 085-needs-decision with a cause that names the settings. The Review track says a person must review instead of "in progress".

What went wrong

On Doug's self-hosted Podman spoke (hive-wild-mole, build 3f3d48b), 12 docs-only PRs opened under the owner's account on 2026-11-07 went into the contributor lane, for example Danathar/sensi#681 and Danathar/appbox#77. All had green CI. Each sat at 050, reason contributor-lane:no-verdict, with "Review 0/5 Β· in progress" from 18:01Z on. The reviewer agent was idle, and the audit showed no review dispatch at all. Hive-lane PRs on the same spoke (arch-bootc#652, aurora-zfs-simple#458) merged within 15 minutes without a verdict. That is what you see when review.require_approval is off.

Two gates disagree about whether a review is coming:

  • The planner. planReviewDispatchWith runs on every eval cycle, so no webhook is needed. With require_approval or fan_out off, though, it plans only maintainer-answered heads (answeredOnly). PlanDispatch then returns before it would dispatch anything, and writes no pending or wait row.
  • The contributor-lane gate. contributorLaneVerdictFunc reports Configured: true whenever a review-capable agent is enabled. It never looks at whether the swarm is on. So require_reviewer_verdict (default on) holds every unreviewed head at no-verdict. A trusted person's approval cannot release it either, because that release only answers a requires_human verdict, and there is none.

The stage engine maps no-verdict to 050. At 050, with no dispatch row, the tracker turned "unknown" into "Review 0/5 Β· in progress" (#16599). From the outside, the PR looked like it was under review.

What changes

  • The verdict function marks a head with no aggregate as ReviewOff when the swarm is off. It uses the planner's own rule: both review.require_approval and review.fan_out must be on.
  • In that case the contributor lane returns contributor-lane:review-off instead of no-verdict. A recorded verdict (such as changes requested) still wins. With require_reviewer_verdict: false the lane merges exactly as before.
  • The stage engine treats review-off as a person's call (085), like no-reviewer. The 085 cause and the dashboard words name the settings: turn the swarm on, turn the verdict requirement off, or merge it by hand.
  • On a hive that dispatches no reviewer, the Activity Monitor's 050 Review track no longer claims "in progress" with nothing in flight. It falls through to the existing statement, "Review Β· not started Β· needs reviewer". With the swarm on, the ✨ Activity Monitor chevrons: active-with-text / icon-only spec, CI and review ring glyph, workflow-approval stall captionΒ #16599 behaviour is unchanged.

No new GitHub write sites and no new config keys.

Files

  • cmd/hive/merge_eligibility.go: contributorLaneReviewDispatched and ReviewOff in contributorLaneVerdictFunc
  • pkg/stageengine/prstage/{reasons,types,causes}.go: new reason, verdict field and 085 cause
  • pkg/github/automerge/automerge_contributor_lane.go, automerge_stage_human.go: lane reason and 085 cause
  • pkg/stageengine/derive_pr_classify.go: review-off routes to 085
  • pkg/dashboard/stage_tracker_{activity,build,caption,decision_lanes,review_fallback}.go: honest Review track and words
  • Docs: hive-merge.md, operator-reference/README.md, stage-labels.md, activity-monitor.md, plus two line citations moved by the edit; changelog.d/fixed-contributor-lane-review-off.md

Tests

  • TestStageTrackerReviewPendingSwarmOffIsNotInProgress (dashboard) builds the tracker for a green 050 contributor PR with the swarm off. It fails on v6 tip with state "reviewing" caption "Review 0/5 Β· in progress", the reported status, and passes with the fix. With the swarm on, it still reads "0/5 Β· in progress".
  • TestContributorLaneVerdictFuncReviewSwarmOff (cmd/hive) checks ReviewOff for each require_approval / fan_out combination, and that a recorded verdict clears it.
  • TestTrySweepContributorLanePRSkipReasons has three new cases: swarm off names the stall, swarm off with the verdict not required still merges, and a recorded changes request still wins.
  • TestContributorLaneReviewOffParksOnAPerson and the extended TestContributorLaneCIReviewNeverParksOnAHuman (stageengine) cover the stage side, and TestStageTrackerReviewPendingState gains rows for the no-reviewer-lane case.
  • The tests that use the new field and reason do not compile on tip.
  • Full packages: ./pkg/stageengine/..., ./pkg/github/automerge/, ./pkg/dashboard/, ./pkg/writeback/, ./cmd/hive/. go vet is clean on the changed packages, and the docs citation and link checks pass.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

… off parks for a person instead of waiting at 050 forever

auto_merge.contributor_lane.require_reviewer_verdict held every unreviewed
contributor-lane head at contributor-lane:no-verdict whenever a reviewer
agent existed, but the review planner only asks reviewers when
review.require_approval and review.fan_out are both on. On hive-wild-mole
twelve green docs PRs sat at 050 "Review swarm requested" with the Review
track at "0/5 Β· in progress" and nothing dispatched.

The verdict function now marks such a head ReviewOff; the lane returns
contributor-lane:review-off, which the stage engine routes to
085-needs-decision with a cause naming the settings. On a hive that
dispatches no reviewer the Activity Monitor's 050 Review track no longer
claims "in progress"; it says a person must review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 7, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 7, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • check-failure

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#17025 🌱 Forward-merge v5 into v6 (1 commits) same files src/docs/operator-reference/README.md

@hivecommons-hive

hivecommons-hive Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

Evidence bundle `#17080fbac25c` sha256:660203818175e141dfe191d31fc3e07f34e07148bcd5a46d153dc35b25a5bb3e β€” download from the dashboard or `hivectl review evidence #17080`.

Review findings from adjudicator-2 (folded here because this head already carries its hive review):

Style/maintainability review of head fbac25c (the queue handed me a4b7e7d; the PR moved on, so this is against the current head).

1. The "review swarm is on" rule now exists in three places with two nil-semantics. src/cmd/hive/main_sweeps.go:2492 computes answeredOnly := !cfg.Review.RequireApproval || !cfg.Review.FanOut inline; this PR adds contributorLaneReviewDispatched (src/cmd/hive/merge_eligibility.go:220, nil cfg β†’ false) and stageTrackerReviewDispatched (src/pkg/dashboard/stage_tracker_activity.go:461, nil cfg β†’ true), each with a comment saying it "mirrors planReviewDispatchWith's answeredOnly rule". The repo already keeps derived review predicates as methods on ReviewConfig in src/pkg/config/review_dispatch.go β€” ReviewEventDrivenEnabled at lines 32–33 encodes this exact !RequireApproval || !FanOut test. Three hand-mirrored copies will drift the next time the planner's gate changes. Suggest one method and have all three sites call it (the two nil-handling wrappers can stay as one-liners if you want to keep the differing defaults explicit):

--- a/src/pkg/config/review_dispatch.go
+++ b/src/pkg/config/review_dispatch.go
@@
+// DispatchesSwarm reports whether the review planner asks reviewers for new
+// heads at all: review.require_approval and review.fan_out both on. This is
+// planReviewDispatchWith's answeredOnly rule, inverted.
+func (r ReviewConfig) DispatchesSwarm() bool {
+	return r.RequireApproval && r.FanOut
+}
+
 func (r ReviewConfig) ReviewEventDrivenEnabled(webhooksConfigured bool) bool {
-	if !r.RequireApproval || !r.FanOut {
+	if !r.DispatchesSwarm() {
 		return false
 	}
--- a/src/cmd/hive/main_sweeps.go
+++ b/src/cmd/hive/main_sweeps.go
@@ -2492 +2492 @@
-	answeredOnly := !cfg.Review.RequireApproval || !cfg.Review.FanOut
+	answeredOnly := !cfg.Review.DispatchesSwarm()
--- a/src/cmd/hive/merge_eligibility.go
+++ b/src/cmd/hive/merge_eligibility.go
@@
 func contributorLaneReviewDispatched(cfg *config.Config) bool {
-	return cfg != nil && cfg.Review.RequireApproval && cfg.Review.FanOut
+	return cfg != nil && cfg.Review.DispatchesSwarm()
 }
--- a/src/pkg/dashboard/stage_tracker_activity.go
+++ b/src/pkg/dashboard/stage_tracker_activity.go
@@
 func stageTrackerReviewDispatched(cfg *config.Config) bool {
-	return cfg == nil || (cfg.Review.RequireApproval && cfg.Review.FanOut)
+	return cfg == nil || cfg.Review.DispatchesSwarm()
 }

2. The new reason is missing from the stage golden corpus. src/pkg/stageengine/derive_pr_classify.go:289 adds contributor-lane:review-off to stageNeedsHumanReasons, and automerge_stage_human.go:649 gives it a cause. src/pkg/stageengine/stage_goldens_test.go says stageGoldenReasons is "every lane reason ClassifyStage distinguishes" (line 375), yet the new reason is absent from the needs-human row (line 390), from humanReasons (line 598) and from the decisionCause mirror (line 1097) β€” the sibling contributorLaneReasonReporterTrustHold appears in all three. Without it the parity goldens never exercise the 085 routing this PR introduces. Suggest adding it alongside NoReviewer in each list, a case reason == contributorLaneReasonReviewOff: return prstage.CauseReviewOff branch in decisionCause, and regenerating with go test ./pkg/stageengine -run TestStageGoldens -update.

Both are mechanical; the behavioural change itself reads consistently with the existing no-reviewer path.

@hivecommons-hive
hivecommons-hive Bot merged commit e67dfae into hivecommons:v6 Nov 7, 2026
68 of 69 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @Danathar holds role owner and GitHub permission maintain on repo; CI green at fbac25c.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intent alignment (read at head fbac25c): the diff does what the body says. contributorLaneReviewDispatched (src/cmd/hive/merge_eligibility.go:220) mirrors the planner's rule verbatim (answeredOnly := !cfg.Review.RequireApproval || !cfg.Review.FanOut, src/cmd/hive/main_sweeps.go:2492), the ReviewOff branch sits after verdictBlocks and inside !humanApproved (automerge_contributor_lane.go:1601-1608), so a recorded verdict or a trusted approval still wins, and review-off is routed to 085 via stageNeedsHumanReasons (derive_pr_classify.go:289) with a cause (automerge_stage_human.go:649). No scope creep.

One advisory, in-scope:

  • src/pkg/stageengine/stage_goldens_test.go:375-378 says stageGoldenReasons is "every lane reason ClassifyStage distinguishes", and the human-route golden (testdata/stage_goldens/human-route.json) is built from it. contributorLaneReasonReviewOff is not added, so the new 085 routing has only the hand-written TestContributorLaneReviewOffParksOnAPerson and no golden coverage. Suggested fix (then go test ./pkg/stageengine -run TestStageGoldens -update and commit the regenerated goldens):
	contributorLaneReasonWorkflowPath, contributorLaneReasonTestsRemoved, contributorLaneReasonNoReviewer, contributorLaneReasonReviewOff, contributorLaneReasonReporterTrustHold,

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

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

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant