Skip to content

πŸ› Withhold the contributor nudge for a head the hive adopts anyway - #18874

Merged
kubestellar-prow[bot] merged 4 commits into
v5from
fix/18872-nudge-then-adopt
Nov 18, 2026
Merged

kubestellar-prow[bot] merged 4 commits into
v5from
fix/18872-nudge-then-adopt

Conversation

@clubanderson

@clubanderson clubanderson commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Fixes #18872

Verification of the analysis (file:line, v5 at 6b79bed)

  • src/pkg/delegatedecision/ladder.go rung 5 does decide "supersede now ... do not wait for the grace deadline" on AdoptionStalled || Conflicting || CIRed() || DCOMissing when the author is not reachable. Correct.
  • But that ladder runs only when an operator presses "Let hive decide" (api_repo_item_decide_delegated.go). The automatic nudge-then-adopt pairs in the issue (contributor-offline, 16-39 min) come from the engine path: nudgeContributor (automerge_contributor_nudge.go) records the nudge, then AutoAdoption (automerge_adoption_clock.go) adopts an offline or unregistered author after adoption.after_offline / after_unregistered (15m). So the nudge asks for work the author is already scheduled to lose, by the engine as much as by rung 5. Both paths key on the same fact: the author is not reachable.

Behavior chosen: the first one (no nudge when the hive adopts anyway)

Docs show the first is the intended direction: "a contributor who has gone quiet is superseded now, not after a deadline" (#13975), and the 15m offline wait is a presence clock, not a chance to respond. The second behavior (delay adoption) would contradict that. Note that adoption requires a recorded nudge as its clock start, so the nudge is still recorded; only the GitHub comment is withheld.

  • adoptionBound (nudge side): policy flag on, adoption enabled, live presence known and the relay not online, no hold label / fork guard / workflow path / recorded block, maintainer_policy: adopt, not a person's PR. Then the comment is withheld, the relay still receives its task, and the adoption note is the one notification.
  • Withheld nudge is posted as soon as it stops being certain (relay reconnects, adoption blocked or held), tracked by NudgeWithheldHead in the stage store.
  • Ladder side: Input.ContributorReachable() (shared by rung 4) and AdoptsImmediately(in); rung 5 never fires for a reachable author, which is exactly when the nudge is kept. Online authors keep the full grace.
  • The engine policy flag NudgeWithholdWhenAdopting is set on in stageLabelPolicyFunc; no new YAML leaf (it would need settings-dialog and golden changes). It is off in the zero policy so existing nudge tests are unchanged.

Tests

  • automerge_nudge_withhold_test.go: the four patterns (contributor-lane, fork-not-editable, check-failing, conflicting) for offline and unregistered authors (no nudge, then one adoption note, no nudge beside it), online authors (nudged, not adopted before the grace), release on reappearance, and the not-certain cases.
  • ladder_nudge_agreement_test.go: rung 5 fires iff the author is unreachable.
  • Existing nudge tests are unaffected: the engine policy field is false in test policies and true in production policy.

Docs (stage-labels.md, operator-reference) and changelog fragment included. No overlap with open PRs (#18870 touches SHA holds, not delegatedecision or the nudge).

πŸ€– Generated with Claude Code

Fixes #18872

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

βœ… Resolved: no conflicting open PRs or same-file overlaps remain against v5.

@hivecommons-hive

hivecommons-hive Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

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

Failing checks:

  • coverage

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.

Review follow-ups: 1 open of 1 (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line, listed here instead of as issues. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 info correctness β€” adoptionBound ignores ReworkPickedUp, unlike ladder ContributorReachable (src/pkg/github/automerge/automerge_contributor_nudge.go:396): ladder.go's ContributorReachable() treats ReworkPickedUp as reachable, but adoptionBound only checks presence.Registered&&Online. An author who picked up rework while offline could have the nudge wit…

…uction

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

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 2 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.

File Line Mutation
src/pkg/github/automerge/automerge_contributor_nudge.go 510 CONDITIONALS_NEGATION
src/pkg/github/automerge/automerge_contributor_nudge.go 510 CONDITIONALS_NEGATION

Verdict: lived (#17349).

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.

Read the nudge path on the PR head (automerge_contributor_nudge.go, nudgeContributor β†’ adoptionBound) and the ladder. The withhold/release logic reads correctly to me: the withheld head is recorded, cleared when a comment is posted or edited, and released with ordinal 0 when adoptionBound turns false. One coupling gap is worth a look before merge.

The "agreement" between the ladder and the nudge is asserted, not enforced. delegatedecision.AdoptsImmediately has no production caller (only ladder_nudge_agreement_test.go), and adoptionBound (automerge_contributor_nudge.go:392) re-derives reachability from presence alone. The comment above it says an author "who has picked the rework up" is treated as reachable, but the function never reads a rework-pickup signal, while the ladder's ContributorReachable() does (ladder.go:255). An offline-but-registered author whose relay already claimed the fix-pr task is therefore treated as unreachable by the nudge (comment withheld) and as reachable by the ladder. Whether AutoAdoption would still adopt such a head is something I did not verify, so this is an open question rather than a defect.

Suggestion: either feed the rework-pickup signal into adoptionBound, or drop the "or who has picked the rework up" wording and the claim that the two functions agree.

β€” hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326

// happening (no presence source, a hold label, a fork guard, a workflow
// path, a person's PR, a maintainer policy other than adopt, a recorded
// block) keeps the nudge, so no author is left with no word at all.
func adoptionBound(rec stagelabels.Record, obs stageObservation, policy StageLabelPolicy, presence ContributorPresence, hasPresence bool) bool {

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.

Open question: the doc comment says reachability includes an author who picked the rework up (as delegatedecision.ContributorReachable does, ladder.go:255), but this function only checks presence.Registered && presence.Online. AdoptsImmediately is called only from its own test, so nothing keeps the two in step. If a claimed fix-pr task keeps AutoAdoption from adopting, that author's nudge is withheld wrongly; if not, drop the wording.

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 18, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

The pull request process is described 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 merged commit 9d2b999 into v5 Nov 18, 2026
94 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/18872-nudge-then-adopt branch November 18, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. 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.

πŸ› Contributor gets a nudge, then the hive adopts the same PR minutes later (ladder rung 5)

1 participant