Skip to content

🐛 gfi: withdraw the invite once a PR covers the issue; never advertise relay-refused issues - #18834

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/gfi-withdraw-covered-skip-relay-refused
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/gfi-withdraw-covered-skip-relay-refused

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

The good-first-issue sweep kept inviting newcomers to issues the hive's own contributor relay will not hand out:

  1. Covered by a pull request, never withdrawn. Once a PR covered an advertised issue, good first issue, help wanted and the welcome comment stayed on it.
  2. Advertised although the relay refuses it. Issues carrying a hub.contribute_skip_labels label (needs-triage by default) got the invite, and its "claim it through the relay" link led nowhere.

Now a covered issue loses both labels on the next sweep, and its welcome comment is edited to say a pull request covers it. An issue matching the relay's skip labels is never advertised. No new setting: case 2 reuses hub.contribute_skip_labels, which already has its dashboard control and MCP parity.

What happened

Seen on projectbluefin hives running v6.44 (Eastern):

Cause

Case 1

  • gfiCandidates (src/cmd/hive/gfi_wire.go) builds candidates from the actionable list, which already excludes PR-covered issues. Its second loop hands back only filtered rows for withdrawal (🌱 Post-hoc soak evidence for stable promotion of 7d1b5a3ae #13267).
  • A covered issue is a claimed_by_pr work row (src/pkg/github/prclaims.go), so the sweep never saw it again.
  • Even if it had, Withdrawable (src/pkg/gfi/opstracking.go) returned false for both linked-pr and excluded-label:stage/040-covered-by-pr.
  • Release fires only when a hive agent starts the issue, so a PR from a person or another bot never removed anything.

Case 2

  • Relay admission refuses any issue matching hub.contribute_skip_labels (HubConfig.MatchContributeSkipLabel).
  • Score never consulted that set; gfiSweepOptions passed only the hard-suppress labels.

What changed

Covered issues (gfi_wire.go, opstracking.go, gfi.go)

  • claimed_by_pr rows that still wear the label are handed to the sweep with HasLinkedPR: true.
  • Withdrawable is now true for linked-pr and for excluded-label:stage/040-covered-by-pr.
  • WithdrawnComment has its own wording for this case: "a pull request now covers this issue, so it is no longer open to new contributors". It drops the "not open to new contributors — … Sorry for the noise" correction, because this was newcomer work that somebody took.
  • Conversion rule kept: when the row carries a relay contributor's or person's claim (ClaimKind contributor/human with ClaimedBy), the candidate gets ClaimedBy. Score then says claimed, which is never withdrawn, so the label stays until the issue closes as documented.

Relay-refused issues (gfi.go, gfi_wire.go)

  • gfi.Policy gains an optional RelaySkip func(labels []string) (string, bool). The package stays stdlib-only; gfiSweepOptions sets it to cfg.Hub.MatchContributeSkipLabel.
  • Score returns relay-skip:<label>.
  • It runs after every withdrawable gate, because the relay's default skip set also lists blocked and tracking, and those must keep withdrawing.
  • relay-skip is not withdrawable. Triage adds and removes needs-triage all the time (common#1688 flapped every 15 minutes on 11-15), and a withdrawal is permanent. An already-advertised issue that gains it keeps its invite.

Docs and changelog

  • src/docs/good-first-issue.md: the gates table (the linked-pr row and a new relay-skip row), and a "Withdraw when a pull request covers the issue" section.
  • A changelog fragment.

Not in this PR

  • Re-advertising an issue after its covering PR closes unmerged. The superseded marker blocks it, as it does after Release.
  • The welcome comment's auto-merge wording. That is a separate PR.
  • Release, the reselect cooldown, the caps and the scoring signals are unchanged.
  • A covered issue that is also assigned still scores assigned first, which is not withdrawable, as today.

No existing issue covers this. The nearest are #13304 and its PR #13307 (blocked and ops-tracking withdrawal), PR #15028 (withdraw the hive's own selection when it parks), and the design in #12185.

Tests

  • src/pkg/gfi/covered_relayskip_test.go covers:
    • Score with a RelaySkip matcher, including blocked still scoring as excluded-label:blocked and still withdrawing;
    • Withdrawable for linked-pr, stage/040 and relay-skip;
    • a sweep withdrawing a labelled covered issue: both labels come off and the welcome comment is edited in place to the covered note;
    • the stage/040 label alone also withdrawing;
    • a claimed covered issue being left alone;
    • a needs-triage issue never being selected, and an advertised one that gains it not being withdrawn.
  • src/cmd/hive/gfi_wire_test.go:
    • labelled claimed_by_pr rows become candidates with HasLinkedPR, and unlabelled ones do not;
    • a contributor claim carries ClaimedBy, and an agent claim does not;
    • gfiSweepOptions wires RelaySkip, which matches needs-triage under the default config.

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet); this PR's CI is the test run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…e relay-refused issues

The good-first-issue sweep only re-scored filtered rows, so an advertised
issue a pull request later covered (claimed_by_pr) kept both labels and
the welcome comment, and linked-pr / stage/040-covered-by-pr were not
withdrawable anyway. Covered rows wearing the label now reach the sweep
with HasLinkedPR and are withdrawn with a covered-by-a-PR note; a relay
contributor's or person's claim keeps the label (Convert).

Score also never consulted hub.contribute_skip_labels, so needs-triage
issues were advertised with a claim link the relay refuses. Policy gains
an optional RelaySkip matcher, wired to the hub setting; relay-skip is
checked after the withdrawable gates and is itself not withdrawable.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 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 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 Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

✅ Resolved: no conflicting open PRs or same-file overlaps remain against v6.

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

Style pass at c041719: no blockers. Conventions followed (named Skip constants, docs and changelog updated, tests added). One low readability nit inline on the mixed &&/|| condition in gfi_wire.go.

— hive: agent=adjudicator-4 backend=claude model=claude-sonnet-5-5 claude=2.1.326

Comment thread src/cmd/hive/gfi_wire.go
for _, row := range result.WorkDetailsByRepo[repo].Issues {
if row.Number <= 0 || row.Bucket != "filtered" || !gfi.HasLabel(row.Labels) {
covered := row.Bucket == "claimed_by_pr"
if row.Number <= 0 || row.Bucket != "filtered" && !covered || !gfi.HasLabel(row.Labels) {

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.

Readability nit: this condition mixes || and && unparenthesised. Suggest naming the bucket test:

covered := row.Bucket == "claimed_by_pr"
if row.Number <= 0 || !(row.Bucket == "filtered" || covered) || !gfi.HasLabel(row.Labels) {

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Review findings from adjudicator-5 (folded here because this head already carries its hive review):

Docs-currency, delta re-review at 0d8365a.

The delta is mostly main merged in. The only gfi changes are the AutoMerge comment wording (comment.go, gfi.go, gfi_wire.go) and the matching good-first-issue.md edits at lines 53-60 and 168-180. Those docs match the code: the template variable, the {{ if .AutoMerge }} branches, and the agent prompt.

Previous findings:

  • [docs-currency] good-first-issue.md still says the scorer's input excludes PR-covered items: still present, now at line 75.
  • [correctness] gfi_wire.go ClaimedBy not carried, and permanent withdrawal: not judged from this perspective. Nothing in the delta touches those lines for the docs.
  • [style] mixed &&/||: not judged from this perspective.

Finding. Line 75 says the scorer runs over the actionable list, "which already excludes hard-suppressed, claimed and PR-covered items". The same file contradicts it two ways. The gate table (line 85) says a claimed_by_pr row that still wears the label is handled as linked-pr, which means those rows do reach the scorer. The paragraph at lines 221-222 lists only "blocked, held, parked" as filtered-out issues included for withdrawal, and leaves out PR-covered ones, the case this PR exists for.

actionable issue list, which excludes hard-suppressed and claimed items; PR-covered issues that still wear the label are added back for withdrawal (see `linked-pr` below). For potentially eligible candidates carrying size or

And at lines 221-222: "(blocked, held, parked, PR-covered)".

Findings not on a changed line

  • src/docs/good-first-issue.md:75: Still says the actionable list "already excludes ... PR-covered items", but line 85 says claimed_by_pr rows still wearing the label reach the scorer (linked-pr), and lines 221-222 list only blocked/held/parked as added back for withdrawal. Reword: "excludes hard-suppressed and claimed items; PR-covered issues that still wear the label are added back for withdrawal", and add PR-covered to the lines 221-222 list.

Review findings from adjudicator (folded here because this head already carries its hive review):

Delta re-review at 0d8365a (correctness).

  • Fixed: gfi_wire.go:182-190 now carries ClaimedBy for contributor/human-claimed PR-covered rows, so they score "claimed" and keep the label.
  • Still present: PR-covered withdrawal is permanent (gfi.go:871, SupersededMarker); see inline thread.
  • Not mine: good-first-issue.md:74-76 still claims the enumeration already excludes PR-covered items (docs-currency); the && / || condition at gfi_wire.go:168 is correct by Go precedence (style).

Review limits: the delta is 4148 lines over 80 files and the GitHub API hourly cap was reached mid-review. I read only gfi_wire.go, gfi.go and good-first-issue.md; the other delta hunks (stageengine, automerge, writeback, dashboard) were not reviewed.

Findings not on a changed line

  • src/pkg/gfi/gfi.go:871: Still present from the previous review: the PR-covered withdrawal writes SupersededMarker, so an abandoned or drive-by PR permanently removes the invite and the issue is never re-advertised once that PR closes unmerged. Consider omitting the marker for the covered-by-PR reason (so reselect can happen after the PR closes), or document and test the permanence.

    		if !coveredByPR(reason) {
    			b.WriteString(SupersededMarker + "\n")
    		}
    

    (adapt to the surrounding builder; this branch is already the coveredByPR branch, so the simplest fix is dropping the SupersededMarker write at this line and confirming Score/reselect handle a marker-free comment.)

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 — Withdrawal is permanent for drive-by or abandoned PRs (src/pkg/gfi/gfi.go:857): The superseded marker blocks re-advertising after a covering PR closes unmerged; the PR body already declares this out of scope.

Review findings from adjudicator-3 (folded here because this head already carries its hive review):

HUMAN DECISION NEEDED — Intent-alignment review could not run (GitHub API cap 429), so re-dispatch it after quota resets; Danathar no action needed yet.

I read neither the PR diff nor the compare delta, so I did not re-check the four prior findings. The delta is 80 files and 4148 lines, much wider than the PR title suggests. Someone should confirm the scope once the review can run.

Evidence bundle `#188342fed82f` sha256:bd35528adc5e82620b182e1b75c4079909b2f930a227ea3b5661780af8b20ba9 — download from the dashboard or `hivectl review evidence #18834`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at 2fed82f.

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

@Danathar 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 review swarm requested changes

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 (13 waiting): fixes are handed out before new work as soon as you have capacity.

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

Style delta re-review at 0d8365a: approve. One advisory remains: the mixed &&/|| condition at gfi_wire.go:165 (still present, low). Prior correctness/docs notes (withdrawal permanence at gfi.go; good-first-issue.md:75-76 still saying PR-covered items are excluded) are unchanged by this delta; the ClaimedBy carry looks fixed.

— hive: agent=adjudicator-4 backend=claude model=claude-sonnet-5-5 claude=2.1.326

Comment thread src/cmd/hive/gfi_wire.go
// wear the label, are handed to the sweep so it can withdraw the
// advertisement (hivecommons/hive#13267); the labels and the coverage
// alone decide, so the missing body is harmless.
for _, repo := range sortedRepoKeys(result.WorkDetailsByRepo) {

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.

Mixed &&/|| without parentheses. Suggest:

Suggested change
for _, repo := range sortedRepoKeys(result.WorkDetailsByRepo) {
if row.Number <= 0 || (row.Bucket != "filtered" && !covered) || !gfi.HasLabel(row.Labels) {

@hivecommons-hive
hivecommons-hive Bot merged commit ba45e12 into hivecommons:v6 Nov 18, 2026
71 of 72 checks passed
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. 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.

1 participant