Repository navigation
π fix(adoption): take a review-asked fix the undo guard refused once the reviewer approves it - #17000
Conversation
β¦the reviewer approves it The undo guard (hivecommons#16816) parks an in-place adopted PR at 085 when a hive push keeps less than half of the PR's changed lines. On projectbluefin/utah-packages#943 the hive adopted the PR for the review swarm's requested changes, and its push dropped the two wontfix entries exactly as the review asked. The guard parked it, and the park held until the head moved, so a later verdict was never read. An in-place adoption now records whether it was taken for the review asks with CI not red (adopted_for_review). For such an adoption a push the guard would refuse is taken once the reviewer's verdict on that exact head is approve: at the push check, in the contributor lane gate, and on each stage pass, which releases a park posted before the verdict arrived. An adoption for red CI (the utah#1091 shape) stays refused even with an approve, and any other verdict keeps the park. 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 |
|
@Danathar this PR is back in your court ( Failing checks:
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 (3 waiting): fixes are handed out before new work as soon as you have capacity. |
|
π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
402272a
βΉοΈ Sentinel notice β informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @Danathar, head
Hive did not add the |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the hive review swarm's own approve (not a human's) may release the fixer-undoes-PR guard on a contributor PR the hive adopted for review asks.
The code does what the body says; the question I cannot settle is a trust-policy one.
Correctness β read against the v6 tree, looks right
automerge_adoption_intent.go:121-125short-circuits the refusal only whenintent.Reverts()andreviewApprovedFixerRevertholds;:165-170requiresAdoptedInPlace() && AdoptedForReview, so a red-CI adoption (utah#1091) can never take this path βMarkAdoptedInPlace(store.go:1620) resets the flag andadoptContributorPR:918-920sets it only whenadoptedForReview(obs)(not red, changes-requested reason).MarkAdoptedHead(store.go:1661-1674) does not touchAdoptedForRevieworAdoptedIntentHead, so the baseline stays the original adopted head and the chain-of-cuts protection from #16816 is intact.- The release is wired on all three readers of the refusal: the push check, the stage pass (
automerge_stage_labels.go:1258) and the lane gate (adoptionIntentGate:230-234), so approve-before-push and approve-after-park both resolve without a second note.go buildpasses; the new test file covers both orderings, the CI-adoption exclusion and non-approve verdicts.
The policy question
reviewApprovedFixerRevert reads contributorLaneVerdictFor(...).Approved (automerge_contributor_lane.go:1319), which is the hive review swarm's verdict, folded with any recorded human decision. In the #943 shape the chain is therefore: hive reviewer requests changes β hive fixer pushes a commit keeping 2 of the contributor's 20 lines β hive reviewer approves β hive merges under the contributor's PR. No person is in that loop, and the existing guard text in stage-labels.md says stale-red recovery "never releases the refusal" precisely because dropping most of a contributor's change was meant to be a human call. If that is acceptable when the adoption was for review asks, this is fine to land as-is. If the intent is that only a human approve releases it, the check should be narrowed to the recorded-decision path (withRecordedDecision) rather than .Approved. I have not closed or blocked anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
β¦doption Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
The hive's GitHub App lacks |
|
Needs a decision, not a merge:
Head: verdict requires_human @007d631, 60/60 checks green, DCO yes, soak 0s of 10m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to Updated 2026-11-07 16:17 UTC. |
β¦ CI incident is withdrawn (#17007) The 072 nudge goes out the moment a contributor PR goes red ("the hive will not merge it until the head changes"). The scanner's [shared-ci] incident marker can land minutes later. The stage pass then moved the PR to 050, but the nudge stayed as posted and the head's nudge count stayed at 1. Seen on hivecommons/hive #16993, #16995, #17000 and #17001: nudged for native-queue-policy about ten minutes before they were deferred to incident #17003. - When the pass reads a nudged head's red as shared-ci-incident:<n> or base-branch-red:<checks>, edit the hive's own nudge comments for that head in place to say it was withdrawn, and forget the nudge (Store.WithdrawNudge), so a genuine return to 072 is nudged afresh. - After an incident closes as completed, keep a PR deferred to it until the rerun sweep stamps hive-shared-ci-rerun-<n> (at most 30 minutes), so the head is not handed back in the gap before the re-run. - Name the head's red checks in the nudge when the CI gate's reason is a bare token such as check-failure (a base with no required checks). Refs #17003, #12606, #12253 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Read the gate and the store code it leans on at 007d631; the change looks correct to me and the two packages build.
What I verified
- The erosion guard from #16816 is intact:
MarkAdoptedHead(stagelabels/store.go:1744-1757) never touchesAdoptedIntentHead, so after an approve-release the next hive push is still judged against the contributor's original head, not the narrowed one. MarkAdoptedForReview(store.go:1713) only sets the flag whenAdoptedIntentHead == headand the adoption is in-place, andMarkAdoptedInPlaceresets it tofalse(store.go:1703); a CI adoption can't inherit it.adoptedForReview(automerge_adoption_intent.go:153) returns false wheneveradoptionWaitFor(obs).red, which is the utah#1091 shape.Approvedisreview.Artifact.HasAggregateApproval(automerge_review_gate.go:50), i.e. every perspective on that exact head, not a single reviewer's object. No verdict β not approved β still parked.releaseApprovedFixerRevertis called every sweep fromApplyStageLabels(automerge_stage_labels.go:1267) right aftersettleInPlaceAdoption, so an approve landing after the park is picked up on the next tick;adoptionIntentGate(:230) covers the lane running before that tick.
One note for the deploy, not a defect: AdoptedForReview is written only inside adoptContributorPR (automerge_contributor_adopt.go:927). Records adopted before this field existed β including projectbluefin/utah-packages#943, the PR this fixes β load with it false, so they stay parked until the adoption is re-taken or the head moves. If you expect #943 itself to release on upgrade, it won't; it will need a re-adoption or a manual decision.
β 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 Read the intent check, the stage pass and the lane gate at
One observation for the record, not a defect: the release trusts the review-swarm's |
Summary
The undo guard from #16816 parks an adopted PR at 085 when a hive push keeps less than half of the PR's changed lines. That is right for a CI fix that "passes" by undoing the PR. It is wrong when the hive adopted the PR for the review's requested changes and the review asked for part of the change to go. Then the push is the fix. With this change, a review-asks adoption whose push the guard refused is released once the reviewer approves that exact head. The approve is read on every sweep, so a park posted before the verdict arrived is lifted when it does. An adoption for red CI never takes this path, approve or not, so the utah#1091 hole stays closed.
What went wrong
On projectbluefin/utah-packages#943 the PR marked two packages wontfix. The review (07:53Z) asked for both to stay pending. CI was not red, so the hive returned the PR for the review asks alone and adopted it in place at 10:04Z. Its push
eed6933dropped both wontfix entries and rewrote the guidance, which left 2 of the PR's 20 changed lines. At 10:14Z the guard posted "Fixing CI would undo this PR's change β¦ The hive will not merge eed6933" and moved the PR tostage/085-needs-decision.Two things combined:
One correction to the original report: the 10:19Z review on
eed6933is not an approve. It marks all three earlier findings fixed ("The earlier objections are resolved"), but it raises one new docs finding (wrong source-package name) and ends "1 perspective requested changes". So #943 itself would still sit at 085 with this change. The change makes the approve count when it comes; it does not treat a change request as an approve.What changes
adopted_for_reviewwhen the PR was returned for the review swarm's requested changes and CI is not red.adopted_for_reviewand whether the reviewer's verdict on that exact head is approve. If both hold, the head is taken as the hive's, with no park and no note.Files
src/pkg/github/automerge/automerge_adoption_intent.go:adoptedForReview,reviewApprovedFixerRevert,releaseApprovedFixerRevert, the push-time check and the lane gate.src/pkg/github/automerge/automerge_contributor_adopt.go: record the review-asks cause at in-place adoption.src/pkg/github/automerge/automerge_stage_labels.go: release check aftersettleInPlaceAdoption.src/pkg/stagelabels/store.go:AdoptedForReviewfield,MarkAdoptedForReview, reset inMarkAdoptedInPlace.src/policies/scanner-automerge.md,src/pkg/policies/defaults/scanner-automerge.md,src/docs/labels-and-control-signals/stage-labels.md,changelog.d/fixed-adopted-review-fix-undo-guard.md.Tests
New in
automerge_adoption_intent_review_test.go, with a #943-shaped diff (2 wontfix lines plus 18 doc lines, then a push that keeps 2 of 20):TestAdoptedReviewFixThatDropsChangeIsReleasedByApproveTestAdoptedReviewFixApprovedBeforeCheckIsNotParkedTestAdoptedReviewFixWithoutApproveStaysParkedTestAdoptedCIFixThatRevertsPRStaysRefusedWhenApprovedTestAdoptedForReviewMutants: dropping the
AdoptedForReviewcondition fails the CI-adoption test, and disabling the stage-pass release fails the release test. The existing #16816 tests all pass unchanged.Full packages run:
pkg/github/automerge,pkg/stagelabels,pkg/policies/...,pkg/writeback,pkg/github,pkg/stageengine/..., plusgo vet, gofmt andcheck-docs-citations.py.Notes
adopted_for_review, so a park already in place (including fix: use SendKick for inception kicks β eliminates 32% failure rateΒ #943) is not released by an approve. Those need a person, as today.Refs #16816
π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1