Repository navigation
π fix(stage): a stage label the write-back gate refused still drives band and your-turn - #16818
Conversation
β¦band and your-turn The gate kept every 072/074/085 label off 24 projectbluefin contributor and fork PRs (opt-in label missing or backfill guard). The stage engine recorded the stage, but bands and ownership read labels, so a PR parked at 085 was "blocked" with no reason and in nobody's inbox, while the escalation note said "Moving to stage/085-needs-decision" (projectbluefin/fsdk-containers#491). - Record the gate's reason (Outcome.SuppressedReason, LabelsSuppressedReason). - attachSuppressedStages stamps the recorded stage on snapshot PRs; frontendPullRequest hands band/ownership the PR with that stage in place of its stage labels; the published labels stay GitHub's. - Inbox reason and Activity Monitor tooltip say the label is not on GitHub. - Escalation notes ask the gate (new Gate.Decide, no suppression record) and say the hive would move the PR and why it did not. - The backfill guard still applies to stage_label (see docs). 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
|
There was a problem hiding this comment.
Read the gate/store/reconciler/writer changes, withStageMoveFact in automerge_contributor_adopt.go, and pr_suppressed_stage.go at head c589285. The core change looks correct to me.
Verified:
writeback.Gate.Decide(gate.go:400) is genuinely side-effect-free: it takes the lock and calls onlydecideLocked, which reads pause/config/opt-in/backfill state and never writes. The recording happens inAllowedPreview:430-432(suppressLocked), whichDecideskips β so the 085 note no longer counts as a second refusal while the stage writer still records its own.NoteLabelsSuppressed(stagelabels/store.go:2722-2735) clears the reason whensuppressed=falseand only dirties the store when either field changes;stage_writer.go:42copiesl.reason, whichstage_labeler.go:66-70now sets to reason + detail. The reconciler is the only caller and was updated.suppressedStageMovereplaces the literal"Moving to"once; every escalation note I checked still ends with that exact phrase, so the rewrite applies. If a future note phrases it differently the body is just left intact, which is the safe failure.
One small thing (low, style): the new Decide was inserted between Allowed's doc comment and Allowed (writeback/gate.go:395-411). The paragraph "Allowed is the gate. repo is "owner/name" β¦" now attaches to Decide in godoc, and Allowed is left undocumented. Moving Decide and its comment below Allowed fixes it.
β hive: agent=reviewer-2 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 gate, stage writer/labeler, reconciler, store and the adoption-note rewrite at head Verified
Low (style) β // Allowed is the gate. repo is "owner/name" (any case); item describes the
// target; kind names the write. ...
// Decide is what Allowed would answer, without recording a refusal: ...
func (g *Gate) Decide(repo string, item Item, kind Kind) Decision {
...
func (g *Gate) Allowed(repo string, item Item, kind Kind) Decision {godoc now attaches the "Allowed is the gateβ¦" paragraph to Nothing else found. Not approving (human signature). Evidence bundle `#16818c589285` sha256:60e30be781ddfa605bb023aa8a1f3f2fe88da1d72cfca015e9d55cdffa5f5c7a β download from the dashboard or `hivectl review evidence #16818`. |
Executive summary
When the write-back gate keeps a stage label off a contributor or fork PR, the stage engine still records the stage, but the Overview bands and the your-turn inbox read labels. On projectbluefin the gate refused every 072/074/085 label on 24 PRs from 10-30 on. A PR the hive parked at 085 showed as "blocked" with no reason and sat in nobody's inbox, while the hive's own note said "Moving to
stage/085-needs-decisionso a person sees it".This PR makes the recorded stage stand in for the label it could not write:
What
your_turn=false, reason ""stage/085-needs-decisionso a person sees it."stage/085-needs-decision, but the write-back gate keeps its labels off this PR (needs-opt-in-label β β¦), so no label changes here. The hive tracks it atstage/085-needs-decisionand lists it on the dashboard so a person sees it."Why
Write-back containment (#15122) gates
stage_labelon PRs the hive did not open. It needs the opt-in label (hive-review) and applies the backfill guard (stage_labeler.gowriteAllowed,writeback/gate.godecideLocked).stageWriter.Applythen reportsSuppressed, and the reconciler marks the recordlabels_suppressed. The stage tracker already honoured that mark (#15541). Nothing else did:prBandanddecidePROwnershipGated/prGateLabelOwnershipreadpr.Labels.postAdoptionEscalationNoteposted "Moving tostage/085β¦" without asking whether the label could land.Checked live on GitHub:
stage/stalled,stage/074-adopted-by-hive, β¦stage/050-review-pending, β¦stage/085-needs-decision(after the operator'srequire_label=false)How
stagelabels.Outcome.SuppressedReasoncarries the gate's reason (stage_labeler.gokeeps reason + detail).Store.NoteLabelsSuppressed(key, suppressed, reason)stores it asLabelsSuppressedReason, cleared when a write lands.attachSuppressedStagesruns inUpdateStatusIfFreshand stampsFrontendPR.SuppressedStage/SuppressedStageReasonfrom the record. The published labels stay GitHub's.frontendPullRequest(the decoder every band, ownership and Overview path uses) returns the PR with itsstage/*labels replaced by the suppressed stage, soprBandand the ownership rules see what a written label would give.frontendPR.wirekeeps the published form for/api/overview/status.withSuppressedStageNoteappends the "not on GitHub" clause to a your-turn reason.StageTrackerItem.LabelsSuppressedcarries the reason;stageTrackerLabelsSuppressedTextadds the tooltip line.postAdoptionEscalationNoteruns every escalation note (adoption stalled, workflow refused, fork not adopted) throughwithStageMoveFact. That asks the gate with the newwriteback.Gate.Decide, which isAllowedwithout recording a suppression, since the stage writer records its own. On a refusal it rewrites "Moving toβ¦".stage_labelstays under the backfill guard. The guard exists so the hive does not start labelling items nobody asked it about. With the stage tracked internally, those PRs now reach the inbox anyway, so exempting the kind would only add labels to old contributor PRs. The 6 backfill-blocked projectbluefin PRs become your-turn without a config change.Files
src/pkg/stagelabels/enforce.go,store.goSuppressedReason,LabelsSuppressedReason, reason-awareNoteLabelsSuppressedsrc/pkg/stageengine/reconciler.go,src/pkg/github/stage_writer.go,stage_labeler.gosrc/pkg/writeback/gate.goGate.Decide(no suppression record)src/pkg/dashboard/pr_suppressed_stage.go(new),status_builder.go,server.gosrc/pkg/dashboard/overview_export.go,overview_status.go,ownership.gosrc/pkg/dashboard/stage_tracker*.go,static-src/js/tracker-*.js,static/index.htmlsrc/pkg/github/automerge/automerge_contributor_adopt.gosrc/docs/acmm-policy-matrix.md,changelog.d/β¦Tests
TestSuppressedStageDrivesBandAndOwnershipparked_needs_decision, bandwaiting; reason names the label; stalestage/074replaced; landed write β no overlayTestStageTrackerRowNamesSuppressedLabelslabels_suppressed; JS tooltip lineTestEscalationNoteSaysWhenTheStageLabelIsRefused,TestPostedEscalationNoteβ¦TestDecideAnswersLikeAllowedWithoutRecordingDecide=Allowed, records nothingTestReconcileRecordsSuppressedLabels(extended),TestNoteLabelsSuppressedKeepsReasonOnlyWhileSuppressedgo testwriteback, stagelabels, stageengine, github/..., dashboard/..., cmd/hive; node 332;dashboard-gen-checkcheck-docs-citations.py src/docsNotes
bands.go/ownership_gates.go. This PR adds no logic there; it only changes whatfrontendPullRequesthands them.hive:stage-needs-decisionentry comment (needs_decision_commentkind) has its own gate check and does not claim a label move, so it is unchanged.π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1