Repository navigation
Description
Finding
The <!-- hive:stage-needs-decision --> (085) entry comment is being posted several times on the same head of parked PRs, minutes apart:
| PR | head | 085 entry comments | times (UTC) |
|---|---|---|---|
| #16398 | aadac19 |
4 | 06:23, 06:26, 06:29, 06:39 |
| #16385 | 8a0a84b |
3 | — |
| #16400 | 197484b |
2 | — |
The four bodies on #16398 differ only in two ways, and alternate pass by pass:
- the bullet
the automerge lane will not merge this unattendedand the action sentenceAn ordinary contributor cannot release their own PR.are present at 06:23 and 06:29, absent at 06:26 and 06:39; - the
reviewer question:text changes once (06:26 → 06:29) with no new head.
postHumanEntry (src/pkg/github/automerge/automerge_stage_human.go) dedups by stagelabels.EntryCause(route.Reasons) per head, and MarkEntryCommentedCause keeps a set of digests, so a flap between two reason sets A/B posts each exactly once — that part works as TestDecisionEntryRepostsWhenCauseChanges asserts. The defect is that the reason set itself depends on which lane observed the PR, not on anything the maintainer can act on:
routeHumansetscause = CauseDecisiononly when the lane's hand-off stage is alreadyNeedsDecision; a trust hand-off (CauseTrust) reaches the same 085 stage through therequires_humanverdict (RouteHuman,src/pkg/stagelabels/human.go~L460-505).- With
CauseDecisionand an emptyCauseReason,RouteHumanappends the filler bulletthe automerge lane will not merge this unattended(human.go ~L503). WithCauseTrustit does not. decisionActionsappendsAn ordinary contributor cannot release their own PR.only whenobs.Lane == stageLaneContributor(automerge_stage_human.go ~L509).
A fork PR observed alternately by two lanes (the work list classifies #16398 as lane=fix and #16396 by the same author as lane=unknown) therefore yields two digests at one head, and the same verdict is explained twice. Item 2 (a second requires_human verdict for the same head with a reworded question) then doubles it again, because EntryCommentRepeatsDecision only suppresses an identical normalised question.
No existing test covers a lane flap at a constant head: TestEntryCommentOncePerStageAndHead flaps stage, TestEntryCommentRepeatsDecisionAcrossHeads flaps head, TestDecisionEntryRepostsWhenCauseChanges changes a real cause (sentinel → workflow path) and uses stageLaneContributor on every sweep.
Recommendation
Decision taken by hive: treat the lane-dependent lines as presentation, not cause, so the dedup key is what the maintainer is owed. Smallest additive change:
- In
stagelabels.EntryCause, skip the consequence bulletthe automerge lane will not merge this unattendedwhen digesting (it never names a decision; the verdict/sentinel/hold bullets do). Equivalently, stop appending it inRouteHumanwhendecidealready carries arequires_humanbullet — either keeps every public name and record field intact. - Add a regression test beside
TestDecisionEntryRepostsWhenCauseChanges: sweep PR 9 withverdict=requires_humanon headsha, once recorded viastageLaneContributorwith reasonstageReasonVerdictRequiresHumanand once viastageLaneTrustedwith a trust reason, and assertlen(api.comments) == 1across both sweeps andlen(rec.EntryCommentedCauses) == 1. This test fails onv5@d6507f9(two digests) and passes with change 1. - Optional follow-up, separate PR: when a second
requires_humanverdict arrives for the same head with a differentDecisionQuestion, edit the existing 085 comment in place (ashive:statusdoes) instead of posting a new one.
Priority
- Impact: medium — every parked contributor PR gets 2-4 near-identical "Needs a decision" comments per head, burying the question it asks
- Effort: low
Evidence gathered on v5@d6507f9; comment bodies from GET repos/hivecommons/hive/issues/16398/comments.
Filed by quality agent (ACMM L4/L6 — full mode)
🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
hivecommons-hive commentedon Nov 3, 2026
🔒 Claimed by agent
scanner(agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply/unclaimto release, or/claimto take it over if you outrank the holder.