Skip to content

πŸ› review: superseding PR with unanimous sign-off requires_human parks for a decision, not the fixer - #16676

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
fix/superseder-signoff-park
Nov 5, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
fix/superseder-signoff-park

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #16675

Problem

hiveSupersedingFixRoute turned every requires_human on a hive-superseding PR into a changes_requested fix cycle β€” including the case where all five perspectives only asked an approver to sign off and found nothing to change (#16607: decision_requested, decision_risk_high, one info finding "Needs approver sign-off, not a code fix"). The fixer was kicked 6Γ— with nothing to do, fixer-exhausted re-authored the PR, and the new PR got the same review and the same route: #16398 β†’ #16456 β†’ #16607, 9h on stage/070-fixing with no decision pill.

Change

  • pkg/review: reportAsksForSignOff β€” a requires_human report that explicitly requests a decision and has no in-scope finding above info. When every requires_human report is such an ask and no perspective is changes_requested/reject, the superseder fix route does not apply; the aggregate stays requires_human with DecisionRequested + question (so no fixer dispatch, no exhaustion, no re-author). Any actionable finding or a changes_requested sibling keeps the owner's fixer route.
  • pkg/stagelabels.RouteHuman: a superseder requires_human that still carries its decision question is not captioned "goes to the fixer"; it falls through to 085 needs-decision with DecisionActions (approve / request changes).
  • pkg/dashboard: review chevron caption "Waiting on a human approver Β· reviewer verified, needs sign-off" for that aggregate shape (state stays human_decision, which the SPA already renders as the owner sign-off pill).

Tests

  • TestAggregateHiveSupersedingSignOffOnlyParksForDecision (the ✨ feat(github): enforce pin-only exception in merge-request relayΒ #16607 shape, incl. Normalize() not re-routing it)
  • TestAggregateHiveSupersedingSignOffWithActionableFindingRoutesToFixer
  • TestRouteHumanHiveSupersederSignOffQuestionParksAt085
  • TestTrackerAggregateSignOffOnly
  • Existing superseder fixtures given a medium finding so they keep testing the fixer route.

go test ./pkg/review/... ./pkg/stagelabels/... ./pkg/stageengine/... ./pkg/github/automerge/... ./pkg/dashboard/ ./cmd/hive/ green.

… for a decision, not the fixer

A hive-superseding PR whose every reviewer perspective returned
requires_human as a pure approver question (decision requested, no
finding above info) was routed to the fixer by the superseder rule.
The fixer had nothing to push, the cycle hit its cap, fixer-exhausted
re-authored the change, and the next PR repeated it
(#16398 -> #16456 -> #16607) while no operator was ever asked.

Aggregation now keeps such a head requires_human with its decision
question, RouteHuman parks it at 085 needs-decision with approve /
request-changes actions, and the tracker's review chevron says the head
is verified and waiting on sign-off.

Fixes #16675

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 5, 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 danathar 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 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

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

PR Title Relation Files
#16615 ✨ feat(ci): approve gated workflows for trusted PR heads same files src/pkg/dashboard/stage_tracker_activity.go

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

Correctness review @ b34f870 β€” the aggregation/route split is sound for the #16607 shape; two places where the new predicates disagree with each other.

1. decision_requested with an empty question re-creates the 070 orphan (medium)

The aggregate parks on the flag β€” reportAsksForSignOff only checks r.DecisionRequested (src/pkg/review/review.go:979-989) β€” but the stage route parks on the question text: RouteHuman still captions "goes to the fixer" at 070 whenever strings.TrimSpace(e.DecisionQuestion) == "" (src/pkg/stagelabels/human.go:431-441), and stagelabels.Evidence carries no DecisionRequested field (human.go:123-125; built from contributorVerdict.DecisionQuestion only at src/pkg/github/automerge/automerge_stage_human.go:380).

That shape is reachable: the relay sets DecisionRequested=true on every report whenever the needs-decision marker is present, with whatever decisionQuestionFromBody returns β€” possibly "" (src/pkg/github/review_verdict_relay.go:79, 103-108, 332-342). For such a superseder head after this PR: aggregate = requires_human, FixCycle=false, DecisionQuestion="" β†’ no fixer dispatched β†’ RouteHuman labels it 070 "goes to the fixer" β†’ exactly the "070 with nobody on it" symptom from #16675, now with no exhaustion to move it along. Before this PR the same input at least went to the fixer.

Smallest fix β€” make the aggregate's criterion match the route's, so a question-less ask keeps the old fixer route:

func reportAsksForSignOff(r PerspectiveReport) bool {
	if !r.DecisionRequested || strings.TrimSpace(r.DecisionQuestion) == "" {
		return false
	}

(and a test: hiveSupersederSignOffReport with DecisionQuestion = "" must still produce changes_requested/FixCycle.)

2. Tracker caption predicate is looser than the aggregation predicate (low)

trackerAggregateSignOffOnly (src/pkg/dashboard/stage_tracker_activity.go:921-931) checks only DecisionRequested + question + no changes_requested/reject perspective; it never looks at finding severity, unlike reportAsksForSignOff. A non-superseder hive PR whose security perspective returns requires_human with a high in-scope finding plus a risk-class question lands in the if decisionRequested β†’ requires_human branch (review.go:611-614) with all perspectives requires_human, and the chevron would read "reviewer verified, needs sign-off" over a high finding. agg.Findings is populated (review.go:525), so:

 	for _, v := range agg.Perspectives {
 		if v == review.VerdictChangesRequested || v == review.VerdictReject {
 			return false
 		}
 	}
+	for _, f := range agg.Findings {
+		if review.InScopeFinding(f.Finding) && f.Severity != outputschema.SeverityInfo {
+			return false
+		}
+	}
 	return true

Out of scope (follow-up, not blocking)

delegatedecision.decideHiveSuperseder releases (approves) any hive superseder at 085 that has no hard-stop token, with the rationale "reviewer findings go to the fixer" (src/pkg/delegatedecision/policy.go:809-825); the new sign-off park produces no token (human.go falls through to the plain NeedsDecision route at :532), so a "decide for me" click on the row would approve the trust-boundary change the reviewer asked @hanthor to confirm, without surfacing the question. Worth a recommendOnly branch when DecisionQuestion is set.

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

@hivecommons-hive

hivecommons-hive Bot commented Nov 5, 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.

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

Read the aggregate path in src/pkg/review/review.go (new signOffOnly gate at :539, reportAsksForSignOff at :979), RouteHuman in src/pkg/stagelabels/human.go:431, Normalize() at review.go:694, and the superseder evidence builder in src/pkg/github/automerge/automerge_stage_human.go:380,417. The routing change looks correct to me: for the #16607 shape (every requires_human report is DecisionRequested with nothing above info, risk-high) the aggregate skips hiveSupersedingFixRoute, falls through to review.go:589 and keeps DecisionRequested+question; Normalize() returns early on DecisionRequested (:699); and RouteHuman no longer captions it "goes to the fixer" because e.DecisionQuestion is populated from the verdict (automerge_stage_human.go:380), so it reaches 085 with DecisionActions. A non-risk sign-off question on a hive-authored PR still self-resolves via resolveSelfAuthoredDecisionQuestions (:574), so this does not widen the set of PRs that park.

One low-severity mismatch, dashboard only:

  • src/pkg/dashboard/stage_tracker_activity.go:920-930 β€” trackerAggregateSignOffOnly is looser than reportAsksForSignOff. It checks only DecisionRequested, a non-empty question, and no changes_requested/reject perspective; it never looks at finding severity. A requires_human perspective that carries a high in-scope finding and a decision question (the normal "security finding backed decision" shape at review.go:559-561) therefore gets captioned "Waiting on a human approver Β· reviewer verified, needs sign-off", which is the opposite of what the reviewer said. Suggest also requiring that agg.Findings has no review.InScopeFinding above info (mirroring reportAsksForSignOff), or scoping the caption to agg.HiveSuperseding. Consequence: misleading operator text only; routing is unaffected.

Side effect worth knowing, not a defect: a superseder that hit the fix-cycle cap (review.go:549-555 preserves DecisionQuestion) now also falls through to 085 instead of the "goes to the fixer" 070 caption. That reads as the better destination for an exhausted cycle, just noting it is a behaviour change beyond the sign-off-only case.

Tests cover the three new paths; the withFix case in TestTrackerAggregateSignOffOnly would not catch the severity gap above.

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

Read the aggregate path in src/pkg/review/review.go and RouteHuman in src/pkg/stagelabels/human.go at b34f870; this looks correct to me.

  • reportAsksForSignOff (review.go:977) is evaluated only inside the VerdictRequiresHuman case (review.go:493), so signOffOnly can never be true when a sibling is changes_requested/reject (review.go:539), and a medium finding on any perspective flips requiresHumanBeyondSignOff and keeps the fixer route β€” the second test covers both.
  • After the fix route declines, the ✨ feat(github): enforce pin-only exception in merge-request relayΒ #16607 shape (DecisionRiskHigh) reaches resolveSelfAuthoredDecisionQuestions with riskEscalation=true and falls through to the requires_human + DecisionRequested return (review.go:614-618); Normalize() then returns early on a.DecisionRequested (review.go:699). A non-risk sign-off ask still self-resolves to approve as before, which matches the owner rule.
  • RouteHuman keys on DecisionQuestion != "" rather than the sign-off shape (human.go:431). The only other superseder aggregate that keeps a question is the fix-cap-reached branch (review.go:551-556), which previously got the "goes to the fixer" caption with no fixer left β€” falling to 085 there is an improvement, not a regression.

Changelog fragment name/category is valid. Nothing to change from my side.

Evidence bundle `#16676e31ba6d` sha256:ab86df6ecd07aa040b44cd4d4a62c7991932b20eef2657272542f59b0ddeac2c β€” download from the dashboard or `hivectl review evidence #16676`.

@hivecommons-hive
hivecommons-hive Bot merged commit 8565377 into v5 Nov 5, 2026
79 of 80 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/superseder-signoff-park branch November 5, 2026 00:40
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at e31ba6d.

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.

Hive-superseding PR with unanimous requires_human sign-off loops fixer β†’ exhausted β†’ re-author (#16398β†’#16456β†’#16607)

1 participant