Skip to content

🐛 fix: never-policy 072 row stops promising adoption it can't back - #15717

Closed
onkar717 wants to merge 1 commit into
hivecommons:v5from
onkar717:fix/maintainer-policy-never-adopt-text
Closed

onkar717 wants to merge 1 commit into
hivecommons:v5from
onkar717:fix/maintainer-policy-never-adopt-text

Conversation

@onkar717

@onkar717 onkar717 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #15692.

  • adoptContributorPR only reads a contributor's repository permission once adoption is due (maintainerHoldsAdoption is gated behind the due check in automerge_contributor_adopt.go), so a stage/072 row under maintainer_policy: never has no AdoptionBlocked record before that moment — nothing in the dashboard's own data tells it apart from a row the hive will truly auto-adopt.
  • The tracker's 072 pill read … — hive adopts it in Nm right up to the due moment for a maintainer's own PR, then flipped to … — not adopted: maintainer_policy is never the instant due fired — a confident claim that turned out false.
  • stageTrackerAdoptionText now names the exception for the never policy's auto-adopt countdown instead of promising an outcome it can't back for every author: … unless the author maintains this repository. The adopt (default) and ask policies are unaffected — under those the hive genuinely does adopt on the next sweep, or at worst offers the person an explicit Adopt? decision instead of silently flipping.
  • Added TestStageTrackerAdoptionNeverHedgesBeforeDue covering both the fired (AutoDue) and pending (AutoAdoptAt) countdown text before any AdoptionBlocked record exists, and updated src/docs/labels-and-control-signals.md to document the never-policy carve-out.

I considered instead moving the maintainer-permission check earlier in the sweep engine (so the record exists before due), but rec.AdoptionBlocked() != "" also feeds Takeover.GraceElapsed, stageTrackerContributorGraceElapsed (WaitingOnYou) and the delegated-decision input's AdoptionGraceElapsed — recording the hold ahead of the real grace window would make those report "grace elapsed" far too early for a maintainer-authored row. The text-only fix in the dashboard avoids that ripple entirely while still never asserting a false outcome.

Filed from a low-severity (P3) correctness finding in the Hive review backlog (originally surfaced reviewing #15662, which has since merged).

Test plan

  • CI (go test, gofmt, changelog-fragment guard, docs-citations guard)
  • gofmt -l on all changed files (clean)
  • Manual trace of adoptContributorPR / stageTrackerAdoption / stageTrackerAdoptionText confirming the new branches only fire when Policy == never and no block is yet recorded, and don't touch GraceElapsed/WaitingOnYou/decision logic

— hive: backend=claude model=claude-sonnet-5-5 effort=medium

The engine only reads a contributor's repository permission once
adoption is due (adoptContributorPR gates maintainerHoldsAdoption
behind the due check), so a stage/072 row under
maintainer_policy: never had no AdoptionBlocked record before that
moment and nothing to tell it apart, in the dashboard's own data,
from a row the hive will truly auto-adopt. The tracker read "hive
adopts it in Nm" right up to the due moment for a maintainer's own
PR, then flipped to "not adopted: maintainer_policy is never".

stageTrackerAdoptionText now names the exception for the never
policy's auto-adopt countdown instead of promising an outcome it
cannot back for every author: "… unless the author maintains this
repository".

Hive-Run: hivecommons#15692
Hive-Plan: review-backlog-correctness
Hive-Spec: issue-15692#stage_tracker_adoption_never_policy_text
Signed-off-by: onkar717 <shelkeonka@gmail.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 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 nicholasjackson 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

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

This PR conflicts with v5 itself. Rebase it first: until it merges cleanly into the base, conflicts with other open PRs cannot be told apart from base drift, so only same-file overlaps are listed.

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
#15308 ✨ feature: enqueue eligible PRs into GitHub native merge queues same files src/docs/labels-and-control-signals.md

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 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 this against the tree at ea23fb2b, not just the diff — looks correct to me.

  • src/pkg/dashboard/stage_tracker_adoption.go:217-224: the two new never cases sit after Action/BlockedBy and before the generic AutoDue/AutoAdoptAt arms, so a maintainer-approved head or an explicit blocker still wins, and the non-never wording is unchanged. Policy is populated at all three constructor sites (:120, :134, :151) and config.AdoptionMaintainerPolicyNever is the existing constant (config.go:3012).
  • The claim in the comment — that the engine only reads the author's permission once due — matches why the pill cannot promise adoption here; the row names the exception instead of asserting the outcome.
  • stage_tracker_adoption_test.go pins both captions (due, and 2m countdown) under never, and src/docs/labels-and-control-signals.md:1934-1938 carries the operator-facing wording.

One heads-up for whoever merges: #15704 also edits stage_tracker_adoption.go (3 lines, a different case) — not a duplicate, but whichever lands second will need a trivial rebase.

— hive: agent=reviewer 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.

Read this at head ea23fb2 against the engine and the tracker; it looks correct to me.

  • Premise verified in the engine: src/pkg/github/automerge/automerge_contributor_adopt.go:640-642 returns before anything else when !due, and maintainerHoldsAdoption / NoteAdoptionBlocked(…, AdoptBlockedAuthorMaintainer, …) only run at :661-664, after the due gate. So a never-policy row genuinely has no AdoptionBlocked record until due fires, and the pre-fix countdown text was indeed a promise the engine would then refuse for a maintainer's head.
  • Case ordering is right: the two new case a.Policy == never && … arms in stage_tracker_adoption.go:217-224 come after every a.BlockedBy arm, so the moment the engine records the block the row still reads not adopted: maintainer_policy is never (the :211-212 arm wins), and the hedge only shows in the window before that. adopt/ask fall through to the unchanged :225-228 arms.
  • TestStageTrackerAdoptionNeverHedgesBeforeDue pins both the fired (AutoDue) and pending (AutoAdoptAt) texts with no AdoptionBlocked record present, which is exactly the window this fixes.
  • Docs and changelog fragment (fixed-15692-…) are updated consistently with the new wording.

On the conflicts-with-open-pr label: the overlap is with #15704, which also edits stage_tracker_adoption.go, but at a different function (stageTrackerAdoption, hunk at :128) plus an import line; this PR touches only the switch in stageTrackerAdoptionText. Whichever lands second should rebase mechanically — no semantic conflict that I can see.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Ready for a human merge: verdict approved @ea23fb2, 58/58 checks green, DCO yes, soak 30m0s elapsed. Blocked only by role/newcomer (below require_tiers).

The hive never approves on your behalf: /lgtm /approve (or merge) if you accept it.

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@onkar717 this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson asked the hive to adopt this pull request now, without waiting for its author's hive. The hive opens its own PR carrying the author's commits and sign-off unchanged on the pass now running; this PR closes when that copy merges.

@hivecommons-hive hivecommons-hive Bot added the adoption/supersede Owner-delegate request: adopt now in supersede mode label Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Supersede failed: the hive could not open a fresh PR with these commits. Merging v5 into the copy branch hive/adopt-15717 (at ea23fb2b95f6) stopped on a git conflict, so no superseding PR was opened and this PR stays open.

Files changed on both sides:

  • src/docs/labels-and-control-signals.md
  • src/pkg/dashboard/stage_tracker_adoption.go

Rebase this branch onto v5 (or push a merge of it) and the lane re-evaluates the new head; a new adoption/supersede label then retries the supersede. Reason: supersede-conflict.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Superseded by hive: re-authored as #15738 with the same commits and sign-off because an operator asked for it. This PR is closed; if #15738 fails, hive reopens it.

@hivecommons-hive hivecommons-hive Bot added the hive/superseded Closed by Hive: a different merged PR already landed this change label Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot closed this Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot removed the adoption/supersede Owner-delegate request: adopt now in supersede mode label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. hive/superseded Closed by Hive: a different merged PR already landed this change size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (correctness): maintainer_policy=never rows read 'hive adopts it in Nm' until the due moment

1 participant