Skip to content

πŸ› Adopted PRs keep stage/074 while the hive owns them - #12737

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/adopted-stage-persists
Oct 17, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/adopted-stage-persists

Conversation

@clubanderson

Copy link
Copy Markdown
Member

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-r05x spoke is pushing fixes to them β€” carried stage/050-review-pending, not stage/074-adopted-by-hive. Only the still-red #12471 showed 074.

Root cause

ApplyStageLabels rewrote the lane verdict to AdoptedByHive only when that verdict was ReturnedToContributor (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.
  • Reconciler: settle in-place adoption on every head change; apply the 074 override whenever the adoption is live and the verdict yields to it. A drifted 050 is healed back to 074 (050 removed).
  • Tests: adopted + CI pending β†’ 074; adopted + green no-verdict β†’ 074; adopted + approved + CI pending β†’ 074 (not 060); adopted + red β†’ 074 (not 072, no nudge); label drifted to 050 β†’ reconciler adds 074 / removes 050; approved + soaking β†’ 100 (074 removed, adoption record kept); contributor push on a green head β†’ yield, 050; supersede mode bound to the adopted head. YieldsToAdoption / AdoptionLive tables.
  • Docs: labels-and-control-signals.md 074 row, state diagram and takeover narrative; dashboard-sections.md tracker 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 on v5 without the reconciler change (ci pending: stage 050-review-pending, want 074-adopted-by-hive).

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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed dco-signoff: yes Indicates the PR's author has signed the DCO. labels Oct 17, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed β€” no findings from this perspective.

β€” hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed β€” no findings from this perspective.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 7cb1dae into v5 Oct 17, 2026
73 of 74 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/adopted-stage-persists branch October 17, 2026 13:37
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#1273752d6b2f` sha256:7c95c2cd8e1441a37384777d85b1451dadb6a60f0e61275307af8767f0f18e70 β€” download from the dashboard or `hivectl review evidence #12737`.

1 similar comment
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#1273752d6b2f` sha256:7c95c2cd8e1441a37384777d85b1451dadb6a60f0e61275307af8767f0f18e70 β€” download from the dashboard or `hivectl review evidence #12737`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 52d6b2f.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 17, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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.

  2. src/docs/labels-and-control-signals.md:262-265: the state diagram gains s074 --> s080 and s074 --> s100 but not s074 --> s085 / s074 --> s090, although the row text says 074 "leaves … only at the merge gate (080/085/090/100)" and Stage.YieldsToAdoption() (src/pkg/stagelabels/stagelabels.go:344-346) lets 085/090 verdicts through directly β€” a role/*-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

hivecommons-hive Bot added a commit that referenced this pull request Oct 19, 2026
…-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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› Adopted clanker PRs fall back to stage/050-review-pending once the hive's fix goes green

1 participant