Repository navigation
π fix(stage): park maintainer-only blockers (hive-caused sign-off attribution, fork guards) at 085, not 072 - #14303
Conversation
Two kinds of PR were returned to their contributor (071/072) and nudged to fix something only a maintainer can clear: - Hive-caused sign-off attribution. The hive pushed its own App-signed fix commit onto a contributor PR (projectbluefin/testsuite#991), and the stage pass sent it back under hive-signoff-attribution, asking the contributor to re-sign a commit they never made. A head the hive caused (mixed authorship, or a head it pushed) now parks at 085 with one maintainer note per head; a trusted merger's approval of the current head lets the lane elect a merge commit, as it already did for role/trusted. The refusal names squash-only before role so the note never asks for an impossible --merge. A head of only App-signed commits the hive never pushed (hivecommons/pluk#315) still goes back to its author. - Fork-publication guards. Forward-port of v5 hivecommons#14282 (88fa705): a fork PR whose only red checks refuse forks parks at 085 with the check named. Adapted to v6, where DecisionComment renders the 085 actions. Adds the two real utah-packages guard wordings to the matcher tests. 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 |
There was a problem hiding this comment.
Correctness review (head 334023f).
1. Stale adoption record can still send a hive-caused head to 072 with the re-sign nudge, for one pass β src/pkg/github/automerge/automerge_stage_labels.go:833-867 vs :879-890.
park := hiveCaused && !(hadPrev && prevRec.AdoptionLive(obs.HeadSHA)) (:860) is evaluated with the prevRec read at :746, before settleInPlaceAdoption (:884) runs. When an in-place adoption is live and the contributor pushes their own commit on top of the hive's App-signed fix (the exact testsuite#991 shape: mixed authorship), settleInPlaceAdoption yields on this same pass (automerge_contributor_adopt.go:862 store.MarkYielded, which clears AdoptedHead so AdoptionLive becomes false, store.go:972). But park was already false, so verdict.Stage stays fixingStage(obs) (:862), the yield check at :891 no longer pins 074, and the PR is written at 071/072 with obs.Reason == LaneReasonHiveSignoffAttribution. The 07x block at :1035-1072 then fires: nudgeContributor for a clanker author, or nudgeSignoffAttribution for a human (automerge_contributor_nudge.go:309-327, "author told to re-sign the head"). Next pass parks it at 085, but the contributor has already received the wrong nudge this PR exists to stop. The new tests do not cover a yield-on-same-pass head.
Fix: settle the in-place adoption before the DCO section so the park sees the post-yield record (the settle only needs prevRec, obs, policy):
@@ func (c *Engine) ApplyStageLabels
dcoRead := false
+ if !verdict.Terminal && hadPrev && prevRec.AdoptedInPlace() {
+ // Settle the in-place adoption first: the sign-off park below
+ // must see a head the contributor just yielded as unadopted.
+ n, err := c.settleInPlaceAdoption(ctx, store, key, obs, prevRec, policy)
+ result.Comments += n
+ if err != nil && firstErr == nil {
+ firstErr = err
+ }
+ prevRec, _ = store.Get(key)
+ }
if !verdict.Terminal && verdict.Stage != stagelabels.None {
@@
} else {
- if hadPrev && prevRec.AdoptedInPlace() {
- // In-place adoption: ...
- n, err := c.settleInPlaceAdoption(ctx, store, key, obs, prevRec, policy)
- result.Comments += n
- if err != nil && firstErr == nil {
- firstErr = err
- }
- prevRec, _ = store.Get(key)
- }
if hadPrev && prevRec.AdoptionLive(obs.HeadSHA) && verdict.Stage.YieldsToAdoption() {Plus a test in automerge_signoff_attribution_085_test.go with a prior record AdoptMode: in-place, AdoptedHead: <old> and a mixed head the hive did not push, asserting 085 and no SignoffAttributionComment/nudge.
2. (low, advisory) signoffHiveCaused (automerge_merge_commit.go:96-105) treats any total > squashUnsafeHive as hive-caused without checking the hive ever pushed. A contributor who made one commit under the App identity (pluk#315 shape) and one normal commit gets parked at 085 and told they "did not make those commits and have nothing to fix" (:160). Requiring rec.HivePushedHead(head) for the mixed case too, when a record exists, would keep the pluk shape author-facing; if the structural signal is intentional as the body says, a note in the comment text that the hive may be wrong about authorship would do.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Summary
The stage pass returns some PRs to their contributor (
stage/071-needs-author/stage/072-returned-to-contributor) and nudges them to fix something only a maintainer can clear. This PR parks those atstage/085-needs-decisionfor a maintainer instead, covering both observed cases.1. Hive-caused sign-off attribution
Evidence: projectbluefin/testsuite#991. j1mc's fork PR is
role/contributorandauthor/clanker.efc0229, signed off as the App.hive-signoff-attribution. Nudges on 2026-10-24 17:42Z and 2026-10-25 18:17Z told j1mc "1 commit is signed off as the hive App instead of you β¦ setgit config user.emailβ¦".4c8c0e1at 20:30Z and merging it with a merge commit,d55a794, at 20:32Z.Cause. In
ApplyStageLabels(automerge_stage_labels.go) andDerivePR(derive_pr.go), any squash-unsafe App-signed commit that did not win the merge-commit election went toFixingStage. The election only acceptedrole/trustedauthors. Nothing asked who made the commit.Change.
signoffHiveCausedcovers mixed authorship (the contributor's own self-signed commits beside App-signed ones) or a head the hive recorded pushing. Such heads go to085underhive-signoff-attribution, with one maintainer note per head,<!-- hive:maintainer-signoff-attribution head=β¦ -->. The note says the contributor has nothing to fix and names what clears the PR. There is no contributor nudge and no adoption.mergeCommitElectionaccepts an APPROVED review on exactly the current head as an alternative torole/trusted, then elects a merge commit (merge-method/merge) exactly as it already did for trusted PRs. The stage pass reads that approval itself, once, only when it is the missing piece: a hive-caused head, a trusted-merger list configured, and human reviews not known to be zero.--merge.mergeCommitRefusalText, shared with the adoption-stall note, no longer ends with "otherwise @author re-authors the hive's commits".2. Fork-publication guards (forward-port of v5 #14282)
Evidence: projectbluefin/utah-packages#609 to projectbluefin/utah-packages#618 (utah-packages numbers) are fork PRs by mendezr and kylerankin. Their required
Canarycheck fails with "a fork pull request cannot publish the canary imageβ¦", and the hive sent them to 072, then adoption.#14282 fixed this on v5 (
88fa705) but has not reached v6; the last v5βv6 sync was 2026-10-23. This cherry-picks it:ForkGuardChecksForandForkGuardStageβ085, reasonfork-guard:<checks>.decisionActions;DecisionCommentrenders 085 actions there, and the RouteHuman reason already names the maintainer action.stagelabels.Evidencekeeps bothManualMergeandForkGuard.fetchFailureExcerptdoes. I also added fix: honor the decision against bulk font additionsΒ projectbluefin/utah-packages#610's case: a manually dispatched Canary on the same commit left only "Process completed with exit code 1.", which correctly does not match.Design choices
Related issues
Testing
go test ./pkg/github/automerge/... ./pkg/stagelabels/... ./pkg/stageengine/... ./pkg/github/ ./pkg/dashboard/... ./cmd/hive/... -count=1(run fromsrc/): allok:pkg/github/automerge1.0s,pkg/stagelabels,pkg/stageengine(+prstage,stageenginetest),pkg/github50.1s,pkg/dashboard107.4s (+collect,theme,webstatic),cmd/hive8.0s.New tests in
automerge_signoff_attribution_085_test.go, driving the realApplyStageLabelsagainst a fake GitHub API:TestHiveCausedSignoffAttributionParksForMaintainergh pr merge 991 --merge; no nudge or re-sign ask; nothing re-posted on the next sweepTestHiveCausedSignoffAttributionSquashOnlyParksNamingPolicyauto_merge.squash_onlyand does not suggest--mergeTestHiveCausedSignoffAttributionApprovedHeadElectsMergeCommitmerge-method/mergeand the merge-commit note; not 085 or 072TestHiveCausedSignoffAttributionStaleApprovalStillParksTestContributorFixableFailureStillReturnsToContributorcheck-failing:unitTestAuthorsOwnAppSignedCommitStillReturnsToAuthorhive-signoff-attribution, with no maintainer noteOther test changes:
TestMergeCommitElectiongains approved-head, approved-but-squash-only, approved-but-hive-only, and contributor-in-squash-only (refusal names the policy) cases.TestForkGuardChecksFor(plus the real-text cases above),TestClassifyStageForkGuardParksForMaintainer,TestForkGuardChecksRoundTripFacts,TestRouteHumanForkGuard, and the dashboard reason text.stageengine/stage_goldens_test.gomodels the hive-caused park and adds asquash-unsafe-hive-onlyshape. Regenerateddco.json: mixed-authorship cases move from 07x to085(36 cases), the hive-only shape stays at 07x, and drafts are unchanged. I reverted an unrelated note-capitalisation drift that-updatealso rewrote inregressions.json.Validated against real data, outside the committed tests:
dcoCommitStatsDetailedForAuthorβsignoffHiveCausedβmergeCommitElection, gives total 2 with 1 hive commit (the merge-from-base commit is skipped), hive-caused. Without approval it is refused on role, so it parks at 085; with the approval on4c8c0e1it elects the merge commit, which is how it was actually resolved.Guards and checks:
BASE_REF=v6 bash src/scripts/check-changelog-fragment.sh: OK.bash src/scripts/check-api-reference-citations.sh: all verified.gofmtis clean on the touched files, andgo vetpasses on the touched packages.Contributor checklist
changelog.d/fixed-hive-caused-signoff-attribution-085.md, plus the forward-portedchangelog.d/fixed-fork-publication-guard-stage.md.v6: v6 is the line the reporting hive runs; the fork-guard half is already on v5.src/docs/labels-and-control-signals.md(attribution routing, and the fork-guard row from π fix(stageengine): park fork PRs failing a fork-publication guard for a maintainerΒ #14282) andsrc/docs/operator-reference.md(auto_merge.squash_only).π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1