Repository navigation
π Adopted PRs keep stage/074 while the hive owns them - #12737
Conversation
Adoption is an ownership state, not a CI state. The reconciler only rewrote the lane verdict to 074 when it read 072 (red), so the moment the hive's in-place fix went pending or green the PR fell back to 050/060 and the adoption fact vanished from its labels β while the hive was still the one pushing to it (#12736: #12428, #12421, #12415). A live adoption (Record.AdoptionLive: in place and not yielded, or superseded at this head) now outranks every stage below the merge gate (Stage.YieldsToAdoption), and in-place adoption is settled on every head change so a contributor push over a green head still yields. Signed-off-by: Andrew Anderson <andy@clubanderson.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. |
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
There was a problem hiding this comment.
Correctness review (head 52d6b2f)
Adopted-green PRs now read as "nobody is working it" instead of "waiting on the hive" β src/pkg/github/automerge/automerge_stage_labels.go:1077-1083 rewrites verdict.Stage to 074 before store.NoteActivity(key, stageActivity(obs, verdict.Stage)) at :1096. stageActivity (automerge_stage_labels.go:527-528) sets WaitingOnHive only for CI pending, shared-CI reasons, or stage == ReviewPending && no verdict. So an adopted PR whose hive fix is green and awaiting the reviewer lane β exactly the #12736 case, previously 050 with WaitingOnHive=true β now records WaitingOnHive=false. Consequences: StalledWith (src/pkg/stagelabels/store.go:871) marks it stage/stalled after the 074 dwell (3h, stagelabels.go:222; docs labels-and-control-signals.md:132 define stalled as "nobody is working the item"), and HiveHeld (store.go:891) can never fire, so the "reviewer lane needs attention" warning at automerge_stage_labels.go:1107-1110 is lost for every adopted PR. Suggest stageActivity treat stage == AdoptedByHive as waiting on the hive when CI is not red / no verdict yet (or compute activity from the pre-override stage), plus a test asserting WaitingOnHive for the adopted + green no-verdict case β none of the new tests in automerge_contributor_adopt_test.go check Stalled/WaitingOnHive.
Not verified: go test is disabled on this host; go build ./pkg/stagelabels/ ./pkg/github/automerge/ passes. The 074β080/100 hand-off and the supersede/in-place yield logic read correct (Stage.YieldsToAdoption uses table numbers, so 085/090/100 are all β₯ 80).
β hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
1 similar comment
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 52d6b2f. |
1 similar comment
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 52d6b2f. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
There was a problem hiding this comment.
Reviewed (docs-currency) β read head 52d6b2f; code and the two edited docs agree on the new 074 semantics. Two small places the text still describes the old "074 is a sub-state of red" model:
-
src/docs/labels-and-control-signals.md:684-686(takeover narrative, same hunk this PR edits): after a contributor push over an in-place adoption "the PR is back on the ordinary 072 flow (a fresh nudge for the new head β¦)". The 074 table row (:219) and the diagram edge (:265) this PR rewrites say "072 if red, else the normal path / 050 if that head is green" β the narrative should say the same, since a yield on a green head produces 050 and no nudge. -
src/docs/labels-and-control-signals.md:262-265: the state diagram gainss074 --> s080ands074 --> s100but nots074 --> s085/s074 --> s090, although the row text says 074 "leaves β¦ only at the merge gate (080/085/090/100)" andStage.YieldsToAdoption()(src/pkg/stagelabels/stagelabels.go:344-346) lets 085/090 verdicts through directly β arole/*-blocked adopted PR goes 074 β 090 without passing 060/080.
Adjacent, not blocking: src/docs/contributor-relay.md:1007 still lists 074 as a "repair stage" feeding pending_rework ("the signal to look at"), and src/pkg/dashboard/contribute_fleet_rework.go:112,248 count every 074 record. Now that a green, review-pending adopted PR stays 074, it is counted as pending rework for the contributor until the merge gate β probably worth a follow-up to either exclude live-but-green adoptions or reword the doc.
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
β¦-A) (#13019) * π± stage labels: golden fixtures and shadow-diff recorder (ADR-0025 PR-A) Freeze the current PR-side (resolveStage/classifyStage plus the ApplyStageLabels post-steps) and issue-side (IssueStageFor) stage derivation as deterministic JSON golden corpora so the central stage engine can prove byte-for-byte parity before it takes over. - pkg/github/automerge/testdata/stage_goldens: 8231 cases across lane Γ reason Γ verdict/author-kind/modifier crosses, precedence pairs, human routing, DCO, adoption yield and hand-picked regressions (#12713/#12722 07x split, #12737 adoption 074, #12856 045/085). - pkg/github/testdata/issue_stage_goldens: 1233 cases across bucket Γ labels Γ claim kinds, covered-by-PR stages and regressions. - Both replay tests take -update to regenerate and fail on any drift in inputs, outputs or canonical encoding. - pkg/stagelabels/shadowdiff: pure recorder for legacy-vs-engine stage/reason mismatches with per-bucket counters and a bounded example ring, logging once per distinct mismatch. Signed-off-by: Andrew Anderson <andy@clubanderson.com> * test(stage goldens): regenerate for the /ok-to-test workflow-approval reason text (v5 #13013) Signed-off-by: Andrew Anderson <andy@clubanderson.com> --------- Signed-off-by: Andrew Anderson <andy@clubanderson.com> Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Fixes #12736
Problem
Clanker PRs the hive has adopted β the tracker shows "Adopted by hive" for #12428, #12421 and #12415, and the hive's own
hive-hosted-hosted-available-oke-11-placeholder-r05xspoke is pushing fixes to them β carriedstage/050-review-pending, notstage/074-adopted-by-hive. Only the still-red #12471 showed 074.Root cause
ApplyStageLabelsrewrote the lane verdict toAdoptedByHiveonly when that verdict wasReturnedToContributor(red). 074 was effectively a sub-state of "red clanker PR": as soon as the hive's push made the head pending/green, the 050/060 pipeline took over and the adoption fact was lost from the labels even though the stage store still recorded it.settleInPlaceAdoption(hive push keeps / contributor push yields) was gated the same way, so a contributor pushing over a green in-place adoption never triggered the yield.Fix
Adoption is an ownership state, not a CI state.
stagelabels.Record.AdoptionLive(head)β in place and not yielded, or superseded at this head.stagelabels.Stage.YieldsToAdoption()β every stage below the merge gate (010β074) gives way to 074; 080/085/090/100 do not.YieldsToAdoption/AdoptionLivetables.labels-and-control-signals.md074 row, state diagram and takeover narrative;dashboard-sections.mdtracker note. The tracker already renders 074 in the CI / Review column with the hive icon β unchanged.Validation
go build ./... && go vet ./pkg/... && go test ./pkg/github/automerge/ ./pkg/stagelabels/ -count=1 -shuffle=on && go test ./pkg/dashboard/ -run 'Stage|Tracker'β green. The new tests fail onv5without the reconciler change (ci pending: stage 050-review-pending, want 074-adopted-by-hive).