Skip to content

🐛 fix: exclude relay-refused contributor PRs from merge-eligible - #15129

Merged
hivecommons-hive[bot] merged 4 commits into
v5from
scanner/fix-15093
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
v5from
scanner/fix-15093

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #15093

The kick's merge-eligible list was built by classifyMergeEligibility, which never applies the contributor-lane tier gate that the merge relay applies. Every PR by an untrusted-tier author was therefore listed and then refused at hive-merge.

Evidence (2026-10-28T21:45Z): the governor's kick listed hive#15086, #15090, #15029 and hotshot#317 as MERGE-ELIGIBLE. hive-merge on each was refused, e.g. "contributor-lane policy refuses the merge relay for @Karibhou's PR: contributor-lane:claim-tier-untrusted (author tier "newcomer", require_tiers merger, trusted)" and "contributor-lane:author-association (author tier "newcomer", require_tiers merger, trusted)".

Fix: writeMergeEligible now asks the relay's own gate (Engine.RelayMergeRefusal, installed alongside the relay in boot) for each eligible non-hive-authored PR. A refused PR is dropped from merge-eligible and its verdict carries the refusal reason. The rule is not duplicated. If the gate cannot evaluate a PR, the PR stays listed and the relay re-checks it at merge time.

Test: TestWriteMergeEligible_ExcludesPRsTheRelayLaneRefuses (not run locally; CI is the verdict).

Base v5: the relay gate lives there.

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

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 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 clubanderson 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 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

@github-actions

github-actions Bot commented Oct 28, 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
#15149 ✨ feat(automerge): pick one merge-train front per group of file-overlapping approved PRs same files src/cmd/hive/main.go
#15122 🐛 Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/cmd/hive/main.go
#15085 ✨ Activity Monitor: Adopt now and Reroute to another clanker for PRs waiting on a contributor's clanker same files src/cmd/hive/main.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
#15105 ✨ feat(hub): surface "Pause hive" in the hub spoke dropdown menu same files src/cmd/hive/main.go

Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR 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 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read writeMergeEligible and the new relayLaneRefusal against automerge.Engine.RelayMergeRefusal (src/pkg/github/automerge/automerge_relay_gate.go:54-93) and the relay wiring in boot_agents_deps.go. The logic is correct: the classifier now asks the same gate the merge relay runs, hive-authored PRs bypass it (merge_eligibility.go:421, same hiveAuthoredPR predicate), and a gate error leaves the PR listed. The body matches the diff.

One defect, and it is why changelog-fragment-guard is red:

  • changelog.d/fixed-merge-eligible-lane-gate.md:1 starts with prose, not a - bullet. changelog.d/README.md ("a fragment must start with a '- ' entry bullet … it IS the entry") is what the guard enforces. The bot-generated changelog.d/fixed-15129.md already carries a valid bullet for this PR, so the fix is to delete the slug file (or prefix its line with - and drop the bot one — one fragment per PR).

Observation, not a defect: relayLaneRefusal runs the full lane evaluation (evaluateContributorLanePR: PR fetch, reviews, mergeable state, check runs, head-pushed-at) sequentially for every eligible non-hive PR, with a 30s timeout each, on every kick's writeMergeEligible (main.go:7298). On a queue with ~30 contributor PRs that is a noticeable per-kick REST cost. Fine for now; worth a cache keyed on (repo, number, head_sha) if kick latency becomes visible.

Sign-off survives the squash is CANCELLED, not failed — infra, not this diff.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The wiring is sound and does what the body says; one CI-blocking fragment and one cost question.

Blocking — changelog-fragment-guard fails on this diff's own file. changelog.d/fixed-merge-eligible-lane-gate.md:1 is a bare sentence; the guard (job 123132194548) rejects it with a fragment must start with a '- ' entry bullet. changelog.d/fixed-15129.md already carries the bulleted entry, so the simplest fix is to delete the second fragment (or prefix it with - ).

Verified correct

  • merge_eligibility.go:1082-1087: the gate only runs after classifyMergeEligibility returned mergeBucketEligible, and relayLaneRefusal (:417-437) short-circuits on hiveAuthoredPR and on a nil gate, so hive-authored PRs and pre-relay boot keep today's behaviour.
  • main.go:2574-2575 installs relayLanePolicyGate(autoMergeOpts)(client) — the same Engine.RelayMergeRefusal the relay uses (automerge_relay_gate.go:54), so there is one policy, not two.
  • Gate error → logged and PR stays listed (:428-431); relay still fails closed at merge time. Matches the body.

Open question (not a defect) — per-cycle API cost. writeMergeEligible runs inside runEvalCycle (main.go:7298), and RelayMergeRefusal does PullRequests.Get (automerge_relay_gate.go:60) and then evaluateContributorLanePR (automerge_contributor_lane.go:1180, a second Get plus checks/reviews/commits reads) for every eligible non-hive PR — including trusted humans, whose short-circuit at :67 comes after the first fetch. Serial, 30 s timeout each (merge_eligibility.go:425). With today's queue that is a handful of PRs; under GitHub degradation it can add up to 30 s × N to the eval cycle. Worth a sentence in the body on whether that is acceptable, or a cheap pre-filter (skip the gate when pr.Author already holds the trusted role) if not.

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

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added the stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it label Oct 28, 2026
The guard requires a fragment to start with a '- ' bullet; the prose-only
fixed-merge-eligible-lane-gate.md failed it. Merge both fragments into
changelog.d/fixed-15129.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 28, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

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=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

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 hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed (correctness, delta c2fc2f8…53ce6bf) — previous blockers resolved.

  • Fixed: changelog.d/fixed-15129.md:1 now has the - bullet and issue/PR refs; the duplicate fixed-merge-eligible-lane-gate.md is removed.
  • Still present, advisory only: src/cmd/hive/merge_eligibility.go:417-432 — relayLaneRefusal calls Engine.RelayMergeRefusal serially (PR Get + evaluateContributorLanePR, automerge_relay_gate.go:57-84) with a 30s ceiling each. It runs only for PRs already in mergeBucketEligible and non-hive-authored (merge_eligibility.go:~90 in diff), so the cost is bounded by that small set; worth a bounded concurrency or cache later if the eligible set grows.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

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=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read the diff against v5 at 53ce6bf plus the relay side it mirrors. Looks correct to me.

What I verified

  • src/cmd/hive/merge_eligibility.go:1082-1087 only consults the gate when classifyMergeEligibility already returned mergeBucketEligible, so refused PRs keep their existing blocked/outstanding verdicts and only the eligible→skip transition is new.
  • The gate is literally the relay's: relayLanePolicyGate(autoMergeOpts)(client) in src/cmd/hive/main.go:2574 is the same constructor boot_agents_deps.go:102 installs via SetMergeRequestPolicyGate, so the two paths cannot drift. Engine.RelayMergeRefusal → evaluateContributorLanePR(..., relay=true) is read-only (automerge_contributor_lane.go:1176-1179: no branch update, no effects claim), so calling it from the classifier every cycle has no GitHub write side effects.
  • nil gate (relays not yet up) and err != nil both return "" and leave the PR listed; merge_request_watcher.go:433-447 still re-checks at merge time, so this is strictly a subset filter, never a widening.
  • TestWriteMergeEligible_ExcludesPRsTheRelayLaneRefuses fails without the writeMergeEligible hunk (the fake gate is never consulted).

One low note, not blocking
relayLaneRefusal bypasses the gate on hiveAuthoredPR(pr) (merge_eligibility.go:790-796), which is true for HiveAttributed/HiveAgent — i.e. a body trailer. RelayMergeRefusal (automerge_relay_gate.go:61-64) bypasses only on sweepLaneForAuthor(author). A fork contributor whose PR body carries a — hive: agent=… trailer therefore still gets listed merge-eligible and refused at hive-merge — the exact symptom #15093 describes, for that narrower population. If that case matters, gating on pr.AppAuthored || strings.HasPrefix(author, "app/") here would match the relay exactly; the gate itself already returns "" for hive-authored logins, so the skip is only an optimisation.

Cost is bounded: one RelayMergeRefusal (PR get + lane evidence) per non-hive eligible PR per cycle, 30s cap each.

@hivecommons-hive
hivecommons-hive Bot merged commit 9ccfcc0 into v5 Oct 28, 2026
75 of 77 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15093 branch October 28, 2026 22:54
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#1512953ce6bf` sha256:273a04761646286b340cf439be2b90503b7d439675ffd6257c74542852477152 — download from the dashboard or `hivectl review evidence #15129`.

@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 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] Merge-eligible list includes PRs the contributor-lane tier gate refuses (newcomer author) — every kick re-fails the same merges

0 participants