Repository navigation
π writeback: let the hive move a stage label it applied on a PR older than the backfill cutoff - #18848
Merged
hivecommons-hive[bot] merged 2 commits intoNov 17, 2026
Conversation
β¦ than the backfill cutoff The backfill guard refused every stage-label write on a PR created before the repo's cutoff, so a stage label the hive itself had put there froze at a stage the hive no longer believed (projectbluefin/utah-packages#1148 at stage/100-merge-queue while not queued, projectbluefin/utah#1274 at 074 while tracked at 085). The stage labeler now states Item.HiveAppliedStage when every stage/* label on such a PR was last applied by one of the hive's own accounts (one timeline read, only for a PR the guard would hold, memoised per label set). For KindStageLabel the gate then skips the backfill guard and nothing else (reason hive-applied-stage), following the hive-applied-block (hivecommons#17991) and hive-applied-park (hivecommons#18051) exceptions. The 085 escalation note asks with the same fact so it describes the move as it happens. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
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 |
The five lines this branch adds to client.go moved RankActionableIssues from 5588 to 5593; scale-envelope.md now cites 5593-5603 so the docs citation check finds the AgeMinutes anchor again. Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
This was referenced Nov 17, 2026
Contributor
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
This was referenced Nov 17, 2026
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 the write-back gate's backfill guard covers a pull request, it refuses every stage-label write on it, and that includes moving or removing a stage label the hive put there itself. The label then stays at a stage the hive no longer believes, while the hive's own comments and dashboard track another one.
This PR lets the hive keep its own stage label current on such a PR. Only the backfill guard is lifted. The opt-in label, level, pause, repo mode and
own_onlystill apply, and a stage label a person applied is left alone.It follows the two exceptions already merged for the same reason:
blockedinto a needs-human ask on old and unlabelled issues tooΒ #17991:hive-applied-block, the repair of ablockedlabel the hive applied;hive-applied-park, the note on a park the hive applied.What happened
These are on projectbluefin, times Eastern. Each label below was applied by
hivecommons-hive[bot], per the PR timeline.stage/100-merge-queuesince 11-16 12:18 AM. The PR is not in a merge queue. Later writes on it are refusedbackfill-off.stage/074-adopted-by-hivesince 11-16 3:25 AM. At 9:59 AM the hive commented "The hive would move this tostage/085-needs-decision, but the write-back gate keeps its labels off this PR (backfill-off β¦)". The Activity monitor shows 085, but GitHub still shows 074.stage/071-needs-authorsince 11-13. The hive's own comment calls it "Ready for a human merge".Cause
decideLockedapplies the backfill guard tostage_labellike any first write (src/pkg/writeback/gate.go:506on98f201ddd). Its two exceptions are only forblocked_repairandneeds_decision_comment.stage_labelunder the guard so the hive would not start labelling old contributor PRs. This change keeps that: a PR with no stage label, or with a person's, is still refused.What changed
Gate (
writeback/gate.go,writeback/kinds.go)HiveAppliedStage, read only forstage_label.hive-applied-stage. If it refuses, the refusal is the usual one (for exampleneeds-labelwithout the opt-in label).Gate.BackfillHoldsasks the guard's question without recording the item as pre-existing. So asking it, or a write allowed through the fact, does not add to the "N existing PRs were left untouched" banner.Stage labeler (
github/stage_labeler.go, newgithub/stage_label_hive_applied.go)BackfillHolds. Only when the guard would hold the write and the PR carries astage/*label does it read the PR's timeline.labeledevent of everystage/*label on the PR names one of the hive's own accounts: its App bot, an extra hive bot login, orai_author. This is the same identity test the blocked sweep and park re-check use.085 escalation note (
automerge_writeback.go,automerge_contributor_adopt.go)withStageMoveFactasks the gate with the same fact, through an optional transport hook that the client implements.Docs and changelog
docs/operator-reference/sweeps-and-operations.mdnow lists the three hive-applied exceptions.Related
#18846 (prompt 14, also from the projectbluefin follow-up) fixes why projectbluefin's cutoff moved in the first place: a 2xx with no earlier refusal. This PR covers what remains after that fix. A cutoff can still move legitimately, for example when the App loses and regains write access, and a PR the hive labelled before then would freeze the same way. The two PRs don't touch the same code: that one changes
NoteWriteOutcome, this one changes the decision.Not in this PR
needs-humanhand-off). They stay under the guard.Tests
writeback/hive_applied_stage_test.go:stage_labelon an old PR with the fact is allowed ashive-applied-stage; without the fact it is refusedbackfill-off; a comment kind orneeds_decision_commentignores the fact; a new PR is decided as before; the default policy still wants the opt-in label after the guard;own_only, level unset, and below and at the kind's floor;BackfillHoldsrecords nothing and is false for an opted-in item; an allowed move is not counted as a backfill skip, and a refusal still is.github/stage_label_hive_applied_test.goruns the real stage labeler against a fake GitHub and a real gate:backfill-off;automerge_stage_move_suppressed_test.go: on an old PR the note announces the move unchanged when the stage label is the hive's, and keeps thebackfill-offwording when it is a person's. A newer PR does not ask for the fact, and nothing is recorded as suppressed. The existing note tests pass a context.Only
gofmt -lwas run locally (AGENTS.md bans localgo test/go build/go vet); this PR's CI is the test run.π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1