Skip to content

πŸ› Never adopt a person's PR: owner/human-authored PRs return to their author instead of the contributor-offline lane - #15240

Merged
clubanderson merged 2 commits into
v5from
fix/human-author-pr-never-adopted
Oct 29, 2026
Merged

clubanderson merged 2 commits into
v5from
fix/human-author-pr-never-adopted

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Closes #15202

What happened

#15157 β€” pushed by @clubanderson, an owner of this hive (dashboard.authorized_users, label author/human) β€” got a reviewer verdict of requires_human on a CONFLICTING head. The engine staged it 085-needs-decision (contributor-lane:decision-requested); the owner clicked Let hive decide; the delegate applied adoption/supersede; the engine's label-adoption path ran adoptContributorPR regardless of author kind, adoptionDue answered "contributor offline (registered=false online=false)", and the owner's own PR was adopted into #15192 / 074-adopted-by-hive with a toast about "the author's hive".

Fixes

  1. Owners / maintainers / any author/human PR are never subject to the contributor-offline rule. delegatedecision gates the stalled-adoption path on !in.PersonAuthored() (new HumanAuthor/OwnerAuthor inputs, filled by the dashboard from the author-kind label and dashboard.authorized_users) and Rails.PersonAuthored refuses any adopt-supersede verdict (RefusalAdoptPersonAuthored), including LLM verdicts. The engine's adoption/supersede label path (adoptContributorPR) now refuses a person's PR β€” personAuthored(obs, policy) via authorkind plus the new StageLabelPolicy.OwnerAuthor hook wired from cmd/hive β€” records AdoptBlockedAuthorPerson on the tracker row, logs the reason, and consumes the request label so it is not retried. The dashboard executor refuses ActionAdoptSupersede for person-authored input too.
  2. requires_human / changes-requested on a human-authored PR routes to 071 Needs author, never 085. stagelabels.RouteHuman: the fix list (changes requested, red CI, DCO, conflict) comes first β†’ 071; then HumanAuthorOwesAnswer β†’ 071 with reviewer-verdict:requires_human and the reviewer's question/summary as route reasons. Hive-authored, clanker, self-authored, held, sentinel and lane-rule cases keep 085. The 071 note (TrustedHuman071Comment) now tells the author "the reviewer asked you: …" and, when conflicting, "the branch conflicts with the base and needs a rebase" β€” and is posted for any human author on this route, not just trusted ones, since the 085 entry comment they used to get is gone. For AuthorKind=Human the lane's original conflicting reason counts as conflict even when the decision-requested verdict took the stage reason (hive/clanker behaviour from πŸ› stage labels: requires_human + decision_requested masked by conflicting β†’ PR shown as 070-fixing with no fixer kickΒ #14607 unchanged).
  3. Let hive decide on a human-authored PR may only approve-admit, return to author, or hold. New RuleReturnToAuthor / VerdictDirection decision (glossary + index.html entry return-to-author) tells @author what to fix (rebase / DCO / CI) and/or the reviewer's question. πŸ› fix(dashboard): let hive decide approves a green, reviewed 090 PR instead of refusingΒ #15181's 090 delegatedHumanMergeDecision (delegated_decision_human_merge.go) now returns a person's conflicting/red/unsigned PR to its author instead of adopting; a clean head still approve-admits (πŸ› Activity Monitor: an owner's Approve admits the untrusted-author PR head β€” no adoption, merge as-is; DCO warned before actingΒ #15156 path). Stage tracker rows show "@author pushed this PR themselves β€” not adopted: the hive asks them, not adopts" with no Adopt offer; the βœ“ hover reads "hive decided: return to author Β· why".

Composes with #15181, #15127 and #15156 (all merged); #15192 is untouched.

#15191 vs #15181

#15191 (fix/delegate-human-merge-approves) duplicates merged #15181 in substance (approve-admit on good review + green CI; adopt on red CI / conflicting / review not passed; βœ“ hover path). The only functional extra was a DCO-missing β†’ adopt branch at 090 for clanker PRs; it is folded in here as human-merge-adopt-dco ("adopt Β· DCO sign-off missing"), which for a person's PR becomes return-to-author ("add the DCO sign-off"). Its pkg/delegatedecision/human_merge.go, extra glossary/docs and JS test are superseded by #15181's and this PR's implementation. #15191 can be closed.

Tests

  • delegatedecision: person_author_test.go (contributor-offline gating, rails refusal, return-to-author text), glossary.
  • stagelabels: TestRouteHumanAuthorOwesAnswer table (human/owner/hive/clanker/self/hold/sentinel/lane-rule Γ— question/summary/conflict).
  • stageengine goldens: two πŸ› Owner/human-authored PR was adopt-superseded by hive after Let hive decide (contributor-offline rule)Β #15202 regressions (conflicting β†’ 071 conflicting; green β†’ 071 with the question).
  • automerge: TestDelegatedSupersedeRefusesPersonAuthoredPR, TestRequiresHumanOnPersonPRRoutesToAuthor (contributor + owner get the 071 note once per head; hive-authored keeps 085). Existing 085 entry-comment tests now use clanker PRs (attribution trailer) since a person's requires_human no longer lands there.
  • dashboard: TestStageTrackerAdoptionPersonAuthoredSaysNotAdopted, TestDelegatedHumanMergeDecisionPersonAuthoredNeverAdopts (owner/human Γ— conflicting/red/DCO β†’ return-to-author; clean β†’ approve; clanker DCO β†’ adopt).

go build ./..., go vet, full suites for the touched packages, webstatic style ratchet and check-api-reference-citations.sh pass.

@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 kellyaa 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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@github-actions

github-actions Bot commented Oct 29, 2026 •

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.

PR Title Relation Files
#15256 πŸ› clanker PRs with a human changes-requested review show Returned to contributor, not Sentinel alert same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_adoption_test.go
src/pkg/dashboard/static/index.html
src/pkg/github/automerge/automerge_stage_human.go
src/pkg/github/automerge/automerge_stage_labels.go
src/pkg/stagelabels/human.go
src/pkg/stagelabels/human_test.go
#15186 πŸ› Activity Monitor: one coherent post-decision state for Let hive decide rows; 060 reviewed in CI / Review same files src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_adoption.go
src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
src/pkg/delegatedecision/decision_glossary_test.go
#15267 πŸ› tracker: closed superseded PRs no longer render as rows same files src/pkg/dashboard/delegated_pr_context.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_adoption.go
src/pkg/dashboard/static/index.html
#15122 πŸ› Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html
#15134 πŸ› Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/server.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
src/pkg/delegatedecision/decision_glossary_test.go
#15236 πŸ› Prefer covering PR progress in Activity Monitor messages same files src/pkg/dashboard/stage_tracker.go
#15253 πŸ› decision toast: issue decisions no longer read as 'approved for merge' same files src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
src/pkg/delegatedecision/decision_glossary_test.go
#15219 πŸ› fix: preserve human and owner PRs during delegated decisions same files src/cmd/hive/merge_eligibility.go
src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/delegated_decision_human_merge.go
src/pkg/dashboard/delegated_decision_human_merge_test.go
src/pkg/dashboard/delegated_pr_context.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_adoption.go
src/pkg/dashboard/stage_tracker_adoption_test.go
src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
src/pkg/delegatedecision/llm.go
src/pkg/delegatedecision/policy.go
src/pkg/github/automerge/automerge_contributor_adopt.go
src/pkg/github/automerge/automerge_contributor_adopt_test.go
src/pkg/github/automerge/automerge_contributor_nudge.go
src/pkg/github/automerge/automerge_stage_human_test.go
src/pkg/github/automerge/automerge_stage_labels.go
src/pkg/github/automerge/automerge_stage_labels_test.go
src/pkg/stageengine/testdata/stage_goldens/human-route.json
src/pkg/stageengine/testdata/stage_goldens/regressions.json
src/pkg/stagelabels/human.go
src/pkg/stagelabels/human_test.go
src/pkg/stagelabels/store.go
#15104 πŸ› Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/cmd/hive/merge_eligibility.go
src/pkg/dashboard/server.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15270 πŸ› fix(kick-logs): archive kick log when the turn ends, not only at the next rotation point same files src/pkg/dashboard/static/index.html

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@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 labels Oct 29, 2026
@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot added stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Why:

  • the branch conflicts with the base and needs a rebase

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@clubanderson clubanderson reopened this Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Why:

  • the branch conflicts with the base and needs a rebase

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

… their author

An owner's PR with a requires_human verdict on a conflicting head was
staged 085, and "Let hive decide" adopted it through the contributor-lane
"contributor offline" rule, which only makes sense for clanker PRs.

- The contributor-offline rule and every adopt-supersede verdict are
  gated on the author not being a person (author/human label or a
  dashboard.authorized_users owner); the engine's adoption/supersede
  label path, the delegate executor and the 090 ready-for-human-merge
  decider refuse a person's PR with a logged, tracker-visible reason.
- requires_human / changes-requested on a human-authored PR routes to
  071 Needs author with the reviewer's question (or "needs rebase"),
  and the author is told once per head whatever their role.
- Let hive decide on a person's PR can only approve-admit, return to
  author (new return-to-author rule) or hold.
- Folded from #15191: a DCO-less clanker head at 090 adopts.

Closes #15202

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…ind (import ratchet)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

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

Decision needed: @clubanderson should decide whether this PR or #15219 is the fix for #15202 that lands; they make the same change and conflict in 13 files, so only one can merge.

This PR and #15219 both fix #15202 with the same semantic change, and they conflict. A maintainer has to pick one; I have not closed anything.

What I verified by reading both diffs in full:

  • Both add StageLabelPolicy.OwnerAuthor func(login string) bool (src/pkg/github/automerge/automerge_stage_labels.go).
  • Both refuse adoption of an author/human or owner-authored PR inside adoptContributorPR and record a new AdoptBlocked* reason so the adoption/supersede request is consumed rather than re-asked every sweep (here AdoptBlockedAuthorPerson, automerge_contributor_adopt.go:617; in #15219 AdoptBlockedHumanAuthor / AdoptBlockedOwnerAuthor, store.go).
  • Both route a requires_human verdict on a human-authored PR to 071 with reviewer question: … / reviewer summary: … reasons in stagelabels.RouteHuman, and both teach nudgeDiagnosis / nudgeDiagnosisRouted those prefixes.
  • Both widen the noteTrustedHuman071 condition so a non-trusted human author is still told.
  • git merge-tree --write-tree pr15219 pr15240 conflicts in 13 files, including automerge_stage_labels.go, delegatedecision/policy.go, stage_tracker_adoption.go, merge_eligibility.go and both stage goldens.

The one substantive difference I found: #15219 puts its guard inside supersedeAdoptedPR itself, so it also covers the re-home paths that run on records adopted before the fix β€” settleAdoption (automerge_contributor_adopt.go:1193, DCO re-home), escapeStalledAdoption (:1855) and recoverOrphanedAdoption (automerge_adoption_orphan.go:205). This PR guards only the entry point. For a PR such as #15157 that was already adopted when this lands, that is the difference between the existing adoption continuing to be superseded or not. This PR's upside is the broader surface (glossary, tracker hover, LaneReasonReviewerQuestion, merge-eligibility) and the clear requires_human β†’ author routing rule in HumanAuthorOwesAnswer.

Open question for whichever survives: should the person-author guard also sit in supersedeAdoptedPR so pre-existing adoptions are released?

Also: this head conflicts with v5 in delegatedecision/policy.go and automerge_contributor_adopt.go (needs-rebase label is accurate).

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

@clubanderson
clubanderson force-pushed the fix/human-author-pr-never-adopted branch from 7173352 to 2ee56f3 Compare October 29, 2026 02:56
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2026
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 29, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 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.

Read the engine and routing half of this change against v5 at the merge-base, then the body. What I read matches what the body claims, and I found no defect in it.

Verified:

  • Adoption refusal is in front of every bypass. adoptContributorPR checks personAuthored(obs, policy) (src/pkg/github/automerge/automerge_contributor_adopt.go:644-652) before the forced branch and before adoptionRefusedByAdmission, so an operator-forced adoption of a person's PR is refused too β€” the code comment says that is deliberate. personAuthored (:1401-1406) answers true for authorkind.Human or policy.OwnerAuthor(login), and OwnerAuthor is nil-safe.
  • The request label is consumed, not retried. delegatedAdoptionAttempted (:769-773) treats AdoptBlockedBy == AdoptBlockedAuthorPerson as terminal; its caller at automerge_stage_labels.go:1203 then removes adoption/supersede. Note this is not head-gated (unlike AdoptionRequestConsumed(obs.HeadSHA) beside it) β€” fine here, since person-authorship does not change between heads.
  • HumanAuthorOwesAnswer can actually fire. humanEvidence populates Evidence.AuthorKind and SelfAuthored (automerge_stage_human.go:111-112), and RouteHuman (src/pkg/stagelabels/human.go:281-296) places the new branch after the fix list and before the fresh-head wait, so changes-requested / red CI / conflict still win and route to 071 with their own reasons. Hold, sentinel, fork-guard, trusted approval and a lane-rule CauseReason all return false and keep 085.
  • Conflict on a human PR still counts when the decision verdict took the stage reason. humanConflict (automerge_stage_human.go:92-95) reads obs.LaneReason, which automerge_stage_labels.go:867 seeds from obs.Reason before the route overrides it β€” matching the #14607 carve-out described in the body.
  • go build of pkg/github/automerge, pkg/stagelabels, pkg/delegatedecision, pkg/dashboard, cmd/hive at 2ee56f3 passes. The only non-green checks are three CANCELLED "Sign-off survives the squash" runs (superseded re-runs), which is what makes the merge state UNSTABLE.

Not read: pkg/delegatedecision/policy.go (Rails.PersonAuthored / RefusalAdoptPersonAuthored), api_repo_item_decide_delegated.go, and delegated_decision_human_merge.go. I make no claim about those paths.

Looks correct to me on the parts I read. Not approving (human signature).

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

@hivecommons-hive hivecommons-hive Bot added stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 095-pre-merge-soak β†’ 060-reviewed: required-check-pending:Sign-off survives the squash

@hivecommons-hive hivecommons-hive Bot added stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 29, 2026
@clubanderson
clubanderson merged commit 25de3ba into v5 Oct 29, 2026
87 of 94 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/human-author-pr-never-adopted branch October 29, 2026 03:28
@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/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted labels Oct 29, 2026
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 dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› Owner/human-authored PR was adopt-superseded by hive after Let hive decide (contributor-offline rule)

1 participant