Repository navigation
π fix(blocked): turn a hive-applied marker-less blocked into a needs-human ask on old and unlabelled issues too - #17991
Conversation
β¦s-human ask on old and unlabelled issues too A contributor relay's blocked verdict that names nothing leaves a `blocked` label applied by the hive's own bot, with no marker, so nothing can lift it. The blocked sweep turns that into a needs-human ask, but it asked the write-back gate as gate_comment, and the gate refused on every sweep for an issue created before the hive could write to the repository (backfill off) and for one without the review opt-in label. Those issues stayed blocked, out of every agent's reach and in no inbox. The hive has already written to such an issue: it applied the label being repaired. So the repair gets its own write-back kind, blocked_repair, and the sweep passes the fact it already established from the timeline (Item.HiveAppliedBlock). With the kind and the fact, the gate skips the backfill guard and the opt-in label and allows with reason hive-applied-block. A pause, the repo mode (off, issues-only, labels-only), project membership, own_only and the kind's minimum level still refuse it, and the content dedupe and burst hold apply as they did under gate_comment. Without the fact the kind is gated like any other, and the fact does nothing for other kinds. Default policy is min_level 1 with require_label: the relay's label write is gated by no level, so the floor is the lowest one, and require_label only matters for a call that does not state the fact. A held repair is now logged once per issue and reason, again when the reason changes or the issue is held anew, instead of on every sweep. The gate keeps that memory (held.go), since it is shared across clients. The dashboard kind matrix and the admin MCP writeback.kind_policy both build from the gate's kind list, so the new kind shows in each. Co-Authored-By: Claude <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 No conflicting open PRs or same-file overlaps were found. |
Review follow-ups (below
|
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the hive may post a needs-human note (via the new blocked_repair kind, default L1) on an issue that predates the hive's write access or carries no opt-in label, on the sole ground that a contributor relay earlier applied blocked to it under the hive bot identity.
The code does what the body says, and I found no defect in it. I am routing this to a maintainer because it is a deliberate widening of the write-back containment policy, which is a trust call rather than a code call.
What I verified (v6 tree + diff):
src/pkg/writeback/gate.godecideLocked: the newhiveBlockbypass sits after the pause,per_repomode (off/issues-only/labels-only),HiveAuthored,RepoListedandown_onlychecks, and after thelevel <= 0refusal, so everything the body lists as "still stops the repair" does. Only the backfill guard and the opt-in-label branch are skipped, and only whenkind == KindBlockedRepair && item.HiveAppliedBlock.src/pkg/github/issue_blocked.goaskHumanBlockedMarkerless:HiveAppliedBlockis set only afterblockedLabelActorreturns an own-bot or hive-author login, and after thereviewBacklog/openBlockedBy > 0early returns β unchanged guards, so a person'sblockednever reaches the gate with the fact set.KindBlockedRepairis neither a label kind nor an issue-file kind (kinds.go:193β203), solabels-onlystill refuses it;dedupe.gokeeps it content-deduped so the burst hold still paces a repo. The dashboard matrix readscfg.Writeback.EffectiveKinds()(pkg/dashboard/api_governor_features_platform.go:432), so the Settings claim in the changelog holds without a separate registration.held.go:NoteHeld/ForgetHeld/RetainHeldare nil-safe and all mutate underg.mu;RetainHelddeletes during range, which is safe in Go.retainBlockedRepairHeldscopes forgetting to the repos actually listed this sweep, so a partial sweep does not drop other repos' memory.
The question for a human. The backfill guard exists so the hive never writes unsolicited to issues created before it was installed, and the opt-in label exists so a repo chooses to receive hive comments. This PR's argument is that the hive "already wrote" to these issues β but per the body, the blocked label was placed by a contributor's agent through the relay's hub-minted token, not by anything the repo's maintainers configured. So the effect is: any contributor agent that labels an old, un-opted-in issue blocked without a marker causes the hive bot to post a <!-- hive:unblocked --> comment there a few sweeps later, at L1. That may well be the right trade (the alternative is the issue sitting invisible for days, which the log evidence shows), but it is a policy choice about when the hive speaks on repos that never asked it to, and the default of L1 means it is on everywhere the hive can see. I cannot settle that; a Maintainer Committee member should.
If the answer is yes, I have nothing further on the code. If the preferred shape is narrower (e.g. default min_level above 1, or honouring the backfill guard but not the label), that is a one-line change in DefaultKinds() / decideLocked.
Refs #16832 is non-closing per the body, which is right: #16832 introduced the ask; this fixes its gating.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @30efc35, 58/60 checks green, 2 pending, 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-12 21:18 UTC. |
β¦ than the backfill cutoff (#18848) * π writeback: let the hive move a stage label it applied on a PR older 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 (#17991) and hive-applied-park (#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 * docs: re-cite RankActionableIssues after the client.go insert 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
Summary
When a contributor's agent reports an issue "blocked" without naming what it waits on, the hive's own bot ends up as the one that applied the
blockedlabel, and nothing can ever lift it. The blocked sweep is meant to turn that into aneeds-humanask so the issue lands in a maintainer's inbox. The write-back gate was refusing that repair on every sweep for two kinds of issue: ones created before the hive could write to the repository, and ones without the review opt-in label. Those issues stayedblocked, hidden from every agent and from every inbox, for days.This PR gives the repair its own write-back kind,
blocked_repair. The hive already wrote to these issues (it applied the label being repaired), so the two checks that exist to keep the hive off items nobody asked it to touch no longer apply to it. Everything else still does.What went wrong
Seen in a running hive's log, repeated about every 5 minutes:
blocked sweep: needs-human ask held by writeback gate reason=backfill-offon 8 issues across 4 repositories ("#N was created β¦, before hive could write to β¦; writeback.unsolicited.backfill is off").reason=needs-opt-in-labelon 1 issue ("#N carries none of hive-review; gate_comment needs the label at L5").The sweep asked the gate as
gate_comment(L5 plus the opt-in label, and subject to the backfill guard). Both refusals are right for a first, unsolicited comment on someone's issue. They are wrong here: the hive's label is already on the issue, put there with no opt-in and regardless of the issue's age, and the hive is only replacing its own label with a question for a maintainer.Refs #16832, which introduced the needs-human ask.
What changes
blocked_repair, used by the blocked sweep in place ofgate_commentfor this one repair (addneeds-human, removeblocked, post one note).blocked. It now passes that as a fact on the item (Item.HiveAppliedBlock). Forblocked_repairwith that fact set, the gate skips the backfill guard and the opt-in label requirement and allows the write with the new reasonhive-applied-block.blocked_repairwithout it is gated like any other kind (refused by backfill and by the missing label, exactly asgate_commentis for the same issue), and the fact does nothing for any other kind. A person'sblockednever reaches the gate at all, as before.Default policy for the new kind
{min_level: 1, require_label: true}.gh issue edit --add-label blocked). That write is not gated by ACMM level or by any write-back kind, so a marker-less hiveblockedcan exist at any level. The repair's floor should not sit above the level at which the label can land, so it is the lowest one. An unset level still refuses (level-unknown). An operator can raise it withwriteback.kinds.blocked_repair.min_level, andwriteback.unsolicited.min_levelraises it like every other kind.require_label: trueonly governs a call that does not state the fact. No caller does that today; it is there so a caller that forgets the fact is held, not let through.What still stops the repair
In the same order as before: a paused repository,
writeback.per_repomodeoff,issues-only, andlabels-only, a repository outsideproject.repos,own_onlyif an operator sets it, an unset level, and the kind's minimum level. After that, the content layer applies as it did undergate_comment: a duplicate on the same issue, the burst hold (so a repository with several such issues gets them over a few sweeps, not all at once) and the hourly cap.labels-onlyrefuses it on purpose. The repair posts a note, and the note is what tells the maintainer whyneeds-humanappeared and what the two ways out are. A label swap with no explanation would be a worse ask, andlabels-onlyis an operator saying "no comments here". Making it a label kind would also have taken it out of the burst hold.Dashboard and admin MCP
No hard-coded kind list had to change. Both sides build from the gate's own kind list, so the new kind appears in each without further code:
blocked_repairrow with the same four controls as every other row (minimum level, opt-in label, level without the label, hive-authored only). The row is rendered fromwritebackKindMatrix, which the API fills from the gate's resolved matrix, and the save path accepts any known kind.writeback.kind_policylistsblocked_repairin its input schema, accepts it, and previews its override and effective policy before and after, the same as for any other kind.One thing to know: the matrix shows
blocked_repairas "opt-in label" scope, because that is its stored policy. In practice the label is not needed for a hive-applied block, which is the only case the sweep uses the kind for. This is the same shape ascontributor_adoptand its superseded-agent-PR exception. The docs say so; the dashboard row does not.Files
src/pkg/writeback/kinds.go,gate.go,dedupe.go: the kind, its default, the item fact, the allow reason, and the content-dedupe entry.src/pkg/writeback/held.go(new): the gate remembers the last reason it refused an item for, so a writer that asks every sweep can report a hold once. It lives on the gate because the gate is the one object shared across GitHub clients, and tests build their own.src/pkg/github/issue_blocked.go,issue_blocked_repair_held.go(new): the sweep asks asblocked_repairwith the fact, logs a hold once, and forgets it when the issue stops being a repair candidate.blockedsection of the labels reference, the kind matrix inacmm-policy-matrix.md, and the write-back table and dedupe kind list inoperator-reference/sweeps-and-operations.md.changelog.d/fixed-blocked-repair-writeback-gate.md.Tests
None were run locally (repository rule); CI is the verdict.
New,
src/pkg/github/issue_blocked_repair_test.go, through a real gate:TestBlockedRepairConvertsHiveBlockTheGateUsedToHold: a hive-applied marker-lessblockedis converted on an issue older than the hive's write access with backfill off, and on an issue without the opt-in label. Each case first showsgate_commentis refused for that same issue, which is why these fail on the old code.TestBlockedRepairLeavesAPersonsBlockAlone: a person's marker-lessblockedon the same old issue gets no write and the gate is not asked.TestBlockedRepairStillRefusedByPauseModeAndLevel: paused repository, repo mode off, below the kind's minimum level, unset level.TestBlockedRepairHoldLoggedOncePerIssueAndReasonandTestBlockedRepairHoldKeptAcrossSweepOfOtherRepos: the log line appears once for repeated sweeps, again on a changed reason, and again after each way an issue can stop being a candidate. On the old code the line repeats every sweep.New,
src/pkg/writeback/blocked_repair_test.go: the kind's defaults and listing; with and without the fact againstgate_commentfor the same item; every check that still applies; that an allowed repair is not counted as a backfill skip; duplicate and burst holds; the held memory.No existing test was changed.
TestSweepBlockedAskHeldByGateLogs(which asserts the held line withissue=80) is untouched.Not in this PR
blocked.π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1