Repository navigation
π stageengine: classify repo-auto-merge-disabled from head evidence instead of handing off - #17568
Conversation
β¦17565) Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Correctness perspective β read head 2b33dc9 (diff + Low (in-scope, advisory): body claim vs. recorded reason on the human-approved 090 path. The PR body says a trusted human's approval of a Out-of-scope (pre-existing): |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Read the classifier and goldens against the v6 tree; this looks correct to me.
stageHandoffReasonshas a single consumer (derive_pr_classify.go:390), so droppingrepo-auto-merge-disabledfrom it only lets control reach the new branch β nothing else keyed on the map.- The new branch's precedence (needs-rebase β
HumanChangeRequestStageβVerdictBlocksβRequiresHumanStageβ decision-requested βSharedCIDeferredStageβBaseBranchRedStageβForkGuardStageβRedCheckβ sentinel/hold β 050/090) is the same order the generic path uses atderive_pr_classify.go:536-595, and the structure matches the siblingautoMergeReasonHumanMergeRequiredbranch directly above it. - The test's "recorded reason falls back to the lane reason when the verdict's is empty" assumption is what production does:
derive_pr.go:241-244setsobs.Reason = verdict.Reasononly when non-empty, so the approve+green 090 row recordsrepo-auto-merge-disabledandprstage.HumanMergeReason(prstage/reasons.go:246) maps it toauto-merge-off.
One note on the body, not a defect: "a trusted human's approval of a requires_human head β 090 recorded under the lane reason" is half right. The golden row */repo-auto-merge-disabled/verdict=requires_human-human-approved records reviewer-verdict:requires_human:human-approved@clubanderson, because WithHumanApprovalReason (derive_pr_classify.go:238) fills Reason with the approval reason; HumanMergeReason of that string is not auto-merge-off. That is identical to how the autoMergeReasonHumanMergeRequired branch behaves, so I would leave the code alone β just flagging that the 090 "auto-merge off" rule only reads back for the plain-approve path.
No findings. CI test shards are green on this head, so the hand-edited goldens match the engine's output.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Review follow-ups (below
|
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #17565
Part of #17552 (lane half remains in #17566)
Why
ClassifyStagelistedrepo-auto-merge-disabledinstageHandoffReasons. That meant "not this lane's PR", so any observation with that reason produced the zero verdict and was thrown away.prstage.HumanMergeReasonalready maps the reason to the 090 Β· auto-merge off code, but no classification could ever reach it. This PR, the engine half, changes the classifier first. The lane child (#17566) can then start producing these observations, and the goldens only change once.Change (
src/pkg/stageengine/derive_pr_classify.go)repo-auto-merge-disabledis no longer a hand-off. It is now classified from the head's evidence, reusing the same helpers as the rest of the classifier:needs-rebaselabel, a human change request, a blocking verdict (changes_requested/reject), or a red check β the author's fixing stage (070/071/072).SharedCIDeferredStage,BaseBranchRedStageandForkGuardStagekeep their usual priority.requires_human(RequiresHumanStage), a decision-requested verdict with no human approval on the head, a sentinel alert (Detail.SentinelAlert), or a hold label (stagelabels.Holds) β 085.requires_humanhead) and green β 090 owned, recorded under the lane reason, soHumanMergeReasonreturnsauto-merge-off.The
lane-reason-{authorkind,modifier,verdict}.jsongoldens were edited by hand, and only therepo-auto-merge-disabledrows changed. Each new row was derived from the existing row of an equivalent path (something-unmapped,contributor-lane:no-verdict,held/needs-rebase, an admission reason's approve route) and checked against it. Theerrrows are unchanged, and no other reason's rows changed.Test
TestClassifyStageRepoAutoMergeDisabledFromHeadEvidence(derive_pr_repo_automerge_off_test.go) covers 9 cases Γ 3 lanes: no verdict, approve+green, approve+red, changes_requested, requires_human, decision requested, needs-rebase label, sentinel, and hold. It also checks that the 090 case's human-merge reason isauto-merge-off. Every case fails without the fix, because the tip returns the zero verdict for this reason. Per AGENTS.md, CI is the only verdict; nothing was run locally.β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@Danathar