Repository navigation
π fix(adoption): keep a fork PR the hive cannot push to with its author until the 072 dwell - #15018
Merged
hivecommons-hive[bot] merged 1 commit intoOct 28, 2026
Conversation
β¦or until the 072 dwell A fork PR is never superseded or re-homed into the base repository (hivecommons#14306), so adopting one the hive cannot push to only parked it at stage/085 on the next pass, 15 minutes after the author's relay went offline. Decline that adoption instead: the PR stays at 072 with its nudge and the relay's fix-pr task, and escalateUnadoptableFork parks it at 085 with the same maintainer ask once the head has waited the 072 dwell since the nudge. The stage engine reads the new pass fact ForkEscalationReason so enforce-mode derives the same stage. In-place fork adoption, same-repository adoption and explicit owner-delegated adoption are unchanged. 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>
Contributor
|
[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 |
Contributor
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a contributor's relay goes offline, the hive adopts its red PR after
governor.labels.stage.adoption.after_offline(15m by default). For a fork PR whose branch the hive cannot push to, adoption has nothing to do.supersedeAdoptedPRcorrectly refuses to move fork code into the base repository (#14306), so the next pass parks the PR atstage/085-needs-decisionasadoption-stalled:fork-rehome-refused. A maintainer is asked to rebase someone else's fork minutes after its author went quiet, before the author's relay has had any chance to pick up its queuedfix-prtask.This PR stops adopting such PRs. A fork PR the hive cannot finish on the fork's own branch now:
stage/072-returned-to-contributor, with the nudge and the relay's queuedfix-prtask;adoption-stalled:fork-rehome-refusedreason and maintainer ask, only once its head has waited the 072 dwell (24h) since the nudge.Evidence
From projectbluefin/utah#919 on 2026-10-27/28 (UTC), a fork PR from
arteeh/utah:f0b5e2f.adoption-stalled:fork-rehome-refused, saying the head "has not moved for 1m". The PR was parked at 085.Unchanged
kylerankin/testsuite, was adopted in place at 02:14Z on 2026-10-28. The hive pushed two fixes to the fork and the contributor lane merged it at 03:59Z.after_offline.adopt-supersede). It is one recorded attempt, so it still goes through the supersede path and parks at once, and its label clears.TestAdoptedLostPushAccessOnForkIsRefusedImmediately).Owner context
#14306 introduced the fork refusal and kept in-place fork adoption on purpose. In #14466, @clubanderson called the 085 park "the designed outcome" and named the WARN-level log as the defect (fixed in #14481). This PR keeps the park and its maintainer ask; it only stops reaching it through an adoption that can do nothing, 15 minutes in.
Change
adoptContributorPR(pkg/github/automerge/automerge_contributor_adopt.go): for a fork PR it cannot finish in place (in-place adoption off, no push access, or a DCO re-home needed), the hive records the decline on the head (MarkForkRehomeRefused), records no adoption, and returns. A declined head is not re-checked on later sweeps, so there is noGETor compare call per sweep. A new head re-arms the check.escalateUnadoptableFork(new): it runs on a 072 PR whose head was declined. Oncenow β NudgeStart β₯ Dwell(072), it marks the escalation and posts oneForkNotAdoptedCommentper head. The comment uses the sameadoption-stalledmarker and the fork ask, now shared viaforkRehomeBlockerText. A zero 072 dwell override (never stalled) never escalates.ApplyStageLabelscalls it after the 074 block and moves the verdict to 085.PRPassFacts.ForkEscalationReason, andpassDecisionapplies it to a 072 verdict, so the enforce-mode derivation writes the same stage. The mutation check below shows the live sweep depends on it.labels-and-control-signals.md(the 074 row, and the adoption rules list afterreason=grace-elapsed),hive-merge.md(the adoption section) andrunning-at-level-6.md(the behind/conflicting fork PR row).changelog.d/fixed-fork-pr-not-adopted-without-push.md.Testing
From
src/under/var/tmp,TZ=UTC,-count=1:go test ./pkg/github/automerge/... ./pkg/stageengine/... ./pkg/stagelabels/...: allok.go vetis clean on both packages, andgofmtis clean.check-docs-links.py,check-docs-citations.pyandcheck-changelog-fragment.sh v6pass.TestAdoptionForkWithoutPushStaysWithAuthorUntilDwell(replacesTestAdoptionForkWithoutPushIsNotSuperseded)conflicting, relay offline. 30m in, it is still 072: no adoption, no 074, no note, no ref or PR. At 23h it is still 072. At 24h it is at 085 with the reason and one note naming the wait, the lane reason, the fork and the ask. The next pass holds 085 with no second note. A new head returns it to 072.TestDelegatedAdoptionOfForkWithoutPushIsRecordedAndParked(new)adopt-supersederequest on the same PR is recorded as an attempt and parks at once, as before.TestPRDeriverPassCarriesForkEscalation(new)ForkEscalationReason, and 072 without it.TestAdoptionForkWithPushStaysInPlace,TestAdoptedLostPushAccessOnForkIsRefusedImmediately,TestAlreadyAdoptedInPlaceForkDCOFailureIsNotRehomedMutation checks
Each part was broken in turn and restored from a backup copy:
ForkEscalationReason: both the deriver test and the dwell test fail.Not verified
contributor_grace_online(2h) and then parked, so it reaches a person later than before.Contributor checklist
changelog.d/fixed-fork-pr-not-adopted-without-push.md.v6.src/docs/labels-and-control-signals.md,src/docs/hive-merge.md,src/docs/running-at-level-6.md).π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1