Repository navigation
π [v6] stage 085: a workflow PR that touches a human-merge path routes to 090, not "approve and the hive merges" - #17622
Conversation
β¦s to 090, not "approve and the hive merges" With auto_merge.contributor_lane.owner_approval_releases_workflow_fence on, a contributor PR whose workflow edit also matches auto_merge.human_merge_paths was told an owner's Approve review "releases the fence and the hive merges it". The approval only led the lane to the human-merge-path gate, which holds the PR and never merges it. The human routing now treats a head that touches a human-merge path as a person's merge: workflowFenceManual is OR'd with the new humanMergePathFencePersonMerge check, so ApprovalReleasesFence is false, and applyHumanMergePathFenceRoute gives the head the human-merge-path cause and routes it to 090 once reviewed, green and soaked. The hive's own human-merge-path hold routes the same way; a person's hold keeps its route; a pin-only candidate keeps today's route. The match reuses the file list the contributor lane already reads (and the stage pass's cached diff-fence read), so there is no new GitHub call per sweep. 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>
|
[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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
Read the diff against the v6 tree at 64c562d (merge-base) and the callers it wires into. This looks correct to me, and it is strictly more conservative than the tip: every head it reclassifies goes to a person, none to the hive.
What I verified, in the tree rather than from the description:
- The 090 claim holds.
applyHumanMergePathFenceRoute(automerge_human_merge_path_fence.go:168) setsCauseReason=CauseHumanMergePath,ManualMergeRule=trueand flipsCauseDecisionβCauseTrustonly when norequires_humandecision is still owed.stagelabels.RouteHuman(src/pkg/stagelabels/human.go:684) already routesCauseTrust && ManualMergeRule && CauseReason != ""toReadyForHumanMergeoncewaitis empty β the same branch breaking-change PRs use. The unanswered-requires_humancase keepsCauseDecision, sodecideathuman.go:612-625still carries the reviewer's question at 085. - Person's hold is left alone.
automerge_human_merge_path_fence.go:171-174returns before touchingManualMerge/cause whenever any hold-class label is present that the hive's ownhuman-merge-pathprovenance (stagelabels/hold.go:49,60) does not explain; onlyApprovalReleasesFence=falseis applied first, which is the one thing that is wrong for such a head regardless of who holds it. - "No extra GitHub call per sweep" holds in the steady state. The lane records the match from the file list it already has (
automerge_contributor_lane.go:1570).headDiffFence(automerge_stage_human.go:128) now re-reads only when the cached fence entry has no matching human-merge-path record; sincetracker.fences[key]is written at:147only afternoteHumanMergePathFenceHeadat:142, the two records are always set together, so the only re-read trigger is ahuman_merge_paths/pin-only config change β the intended re-judge. The re-read is also gated tostageLaneContributor(:137), and a repo with nohuman_merge_pathsisknown=truewith no read. - Pin-only split is behaviour-preserving.
humanMergePinOnlyExempt(automerge_human_paths.go:93-105) runs the same checks in the same order;humanMergePinOnlyCandidateonly factors out the GitHub-free prefix. headManualMergeRule(automerge_contributor_adopt.go:654-668) agrees withhumanEvidence, soDerivePRand the stage pass route identically.
Tests: TestHumanMergePathFenceEvidenceNeverAsksForApproval asserts ApprovalReleasesFence=false + CauseHumanMergePath under both fence scopes, which is false on the tip β so the regression is covered. Docs/changelog match the implemented behaviour.
One honest open question, not a defect: humanMergePathFenceEntry.config embeds fmt.Sprintf("%+v", policy) of the pin-only exception; if that struct ever gains a field with unstable formatting (a map), every sweep would re-judge. Fine today, worth a note if PinOnlyException grows.
I have not approved or changed anything; patch-coverage and overlayfs-exec-guard were still running when I read it.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Correctness review at 1. Adopted head keeps 085 instead of 090 β (and keep the prefix when rewriting 2. Repeated reads when the head can't be judged β Tests cover both scopes, hive vs person hold, pin-only candidate, config re-judge and the lane record; the adopted-head and incomplete-list paths above are untested. Evidence bundle `#17622429b250` sha256:6bbb602df1994a41bf270aedccd955d9afd35062ba8c3bed4e8d74765380847d β download from the dashboard or `hivectl review evidence #17622`. |
Summary
With
auto_merge.contributor_lane.owner_approval_releases_workflow_fenceon, a contributor PR whose workflow edit also matchesauto_merge.human_merge_pathswas told that an owner's Approve review "releases the fence and the hive merges it". That is false: the approval only takes the lane to the human-merge-path gate, which addsholdand never merges. Underworkflow_fence_scope: human_merge_pathsthat is every fenced PR. This PR makes the stage treat such a head as a person's merge from the start. It never asks for the approval, it names the human-merge path as the cause, and it parks the head atstage/090-ready-for-human-mergeunder the human-merge-path reason once the head is reviewed, green and soaked. It adds no GitHub call per sweep, no comment emitter and no raw write.What happened
Seen on a live v6 hive (build 6246fc6):
holdwith "Hive will not merge this PR: it changes path(s) listed inauto_merge.human_merge_paths⦠A maintainer should review and merge this PR by hand".The maintainer followed the hive's instructions and was left with no next step.
Cause
workflowFenceManual(automerge_stage_human.go) returns true only when the toggle is off or the App was refusedworkflows: write. It never asks whether the head touches a human-merge path. So the cause wasCauseWorkflowPathAwaitingApprovalandApprovalReleasesFencewas true.holda gate riding the head's real stage instead of a forced 085. On the v6 tip the held PR already lands at 090, but as a generic held 090. Its reason islabel:hold, and it tells the person to "lift the hold, then/lgtm/approve", which is wrong for a human-merge-path hold. The 090 route only reaches the manual-merge branch when the evidence carries a manual-merge rule, and nothing on a hold-gate route set one for the human-merge-path provenance.Fix
automerge_human_merge_path_fence.go:humanMergePathFencePersonMergeanswers "is this head a person's merge because ofhuman_merge_paths?". It returns yes for the hive's own human-merge-path hold (provenance from the stage pass's existing hold read), for the lane reasonhuman-merge-path, or when the contributor head's complete file list matcheshuman_merge_paths(withintent.HumanMergePathMatches, the gate's matcher) and the pin-only exception cannot admit the PR.applyHumanMergePathFenceRoutedrops the approval ask. Where the hand-off is about the fence, the human-merge path itself or a gate, it sets the human-merge-path cause as a manual-merge rule with no decision owed.RouteHumanalready sends such evidence to 090 once the head is reviewed, green and soaked (the same path breaking-change PRs use). An unansweredrequires_humanverdict still asks for its decision at 085.humanEvidenceandheadManualMergeRuleOR the check intoworkflowFenceManual.workflowFenceManualitself is unchanged.StageTracker(noteHumanMergePathFenceHead). The stage pass's own cached diff-fence read (headDiffFence) records it the same way when the lane stopped earlier (a label or sentinel), and re-reads only when no record exists for the head under the currenthuman_merge_paths/ pin-only config.adoptionMergeFencenow also returns the PR and files it judged, for that.humanMergePinOnlyExemptis split intohumanMergePinOnlyCandidate(the checks that read nothing from GitHub) plus the existing commit and upstream checks. Its behaviour is unchanged. A PR the candidate check accepts keeps today's route, and the gate still decides.How it fits with #17609
Refs #17609. It merged after this work started, so this branch sits on top of it. The two touch different functions:
This PR reads the provenance #17609 keeps current, so a stale hold never routes as human-merge-path. It has no shared helper and no dedupe to do later.
Parity
The dashboard chip and the admin MCP
stage_tracker_readboth read/api/stage-tracker. Itshuman_merge_reasonis derived server-side from the stored stage reason byprstage.HumanMergeReason, andhuman-merge-pathalready maps tomanual-merge-policy, whichagent-now.jsalready words. Neither side hard-codes the reason, so the engine tests here are enough. No JS changed, andstatic/index.htmlstillcmps equal to thestatic-srcconcatenation.Tests
None of these were run locally: per AGENTS.md, CI is the verdict. Only
gofmt -lwas run, and it is clean. They are inautomerge_human_merge_path_fence_test.go, next to the existing fence tests, which are not edited:TestHumanMergePathFenceEvidenceNeverAsksForApproval: under scopesallandhuman_merge_paths,ApprovalReleasesFenceis false and the cause isCauseHumanMergePath. This fails on the tip, where it is true and the cause is the awaiting-approval text.TestHumanMergePathFenceRoutesTo090AfterVerdictChecksAndSoak: under both scopes the PR goes 050 β 060 (soak) β 090, with the reason mapping tomanual-merge-policy, and no comment asks for an approval. This fails on the tip, which stays at 085.TestHumanMergePathFenceRequiresHumanStaysAManualMergeDecision: an unansweredrequires_humanverdict stays at 085 as a manual merge with no approval ask.TestHumanMergePathFenceLeavesUnlistedWorkflowAwaitingApproval: a workflow file outsidehuman_merge_pathskeeps "awaiting owner approval" (unchanged).TestHumanMergePathFenceHiveHoldRoutesTo090WithTheHumanMergePathReason: the hive's hold, on a workflow path and on a non-workflow path, gives a 090 with the human-merge-path reason and "click Merge". This fails on the tip, which gives a genericlabel:hold090.TestHumanMergePathFencePersonHoldRoutesAsBefore: a person's hold keeps thelabel:hold090 and its text.TestHumanMergePathFenceHeadRecordandTestHumanMergePathFencePinOnlyCandidateRoutesAsBefore: a pin-only candidate keeps today's route, an untrusted author does not, and a config change re-judges the head.TestHumanMergePathFenceLaneRecordsTheHeadsFiles: the lane records the match from the list it already read.Stage goldens: none changed and none added. The golden corpus builds its evidence with its own
goldenHumanEvidence, which models nohuman_merge_pathsconfig and no hold provenance, andRouteHumanis unchanged. A golden case would mean extending the generator, which only-updatecan regenerate.Docs:
hive-merge.md,stage-labels.mdand theowner_approval_releases_workflow_fencerow of the operator reference now say a human-merge-path head is a person's merge either way. Changelog:changelog.d/fixed-085-human-merge-path-fence.md.Out of scope
humanMergePathGate, its hold and its comment).π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1