Skip to content

Supersession sweep flags duplicate PRs but stage tracker shows closed issue → open PR with no superseded signal; 085 park is overwritten by 071/072 #14814

Description

@clubanderson

Summary

The stage tracker shows closed issues whose linked PR is still open, with no indication that the PR was superseded. Four rows on the hive-oke spoke (2026-10-27/28):

Issue (closed) Closed by Open PR Open PR author / size Stage shown
#14789 merge of #14791 (Fixes #14789, trusted-author auto-merge 01:52Z) #14795 thatguywob (clanker), size/L 072 returned-to-contributor + sentinel
#14765 merge of #14772 (Fixes #14765, trusted-author auto-merge 01:13Z) #14779 thatguywob (clanker), size/L 072 returned-to-contributor
#14666 merge of #14688 (hive's own scanner/fix-14666, 21:48Z) #14787 clubanderson (human), size/L — opened 3.5 h after the issue closed 071 needs-author
#14685 merge of #14695 (Fixes #14685, trusted-author auto-merge 21:02Z) #14702 Karibhou (clanker), size/XXL 085 needs-decision

In every case GitHub's closing keyword on a different merged PR closed the issue. Three of the four orphan PRs were opened after the eventual closer already existed (#14795 16 min after #14791; #14779 12 min after #14772; #14702 39 min after #14695) — nothing stopped a second author from opening a duplicate PR on an issue that already had an open PR.

What hive did (correctly, per current design)

SweepSupersededOpenPRs (pkg/github/pr_supersession_sweep.go, 15-min cadence) detected all four and posted <!-- hive:pr-supersession-sweep --> notices (#14702 21:16Z, #14779 01:38Z, #14787 01:38Z, #14795 01:55Z). Each notice says "Decision needed… touches files the merged PR did not. Recommended: keep open" and parks at stage/085-needs-decision. Spoke config: acmm_level: 6, supersession_sweep.close_contributor_prs: true. Logs: supersession sweep complete seen=30 commented=4 ×2, then commented=0 (notice already present → no-op).

Why the PRs stay open anyway (gaps)

  1. File-name-subset heuristic always says "keep open" for real duplicates. supersessionExtraFiles compares file names; a duplicate implementation of the same fix nearly always adds/touches a different test or doc file, so subset=false → never eligible for auto-close, recommendation is "keep open". Independently, supersessionSizeAllowsAutoClose refuses anything above size/M — all four are L/XXL.
  2. The 085 supersession park is overwritten by the stage reconciler within minutes. needs-rebase → 072 (🐛 fix: show GitHub dependency blockers in stage tracker #14779 at 22:05 local, ✨ review: scale reviewer concurrency up and down with backlog #14702), check-failing → 072/071 (🐛 fix: find default tmux sockets under arbitrary container UIDs #14795 at 21:59, 🐛 dco: re-home unsigned commits on adopted PRs so the gate can clear #14787 at 21:54). The tracker then shows "Returned to contributor / Needs author" and the superseded context is gone; the only trace is a mid-thread comment.
  3. The stage tracker row has no "superseded" signal for a closed-issue → open-PR pair even though the data (closedByPullRequestsReferences, the sweep marker) is already fetched by the sweep.
  4. Owner's /hive decision reject on ✨ review: scale reviewer concurrency up and down with backlog #14702 was refused (pr_unpark_decision.go: "the hive did not open this PR, so it will not push to it") — the decision path only knows "fix it", not "close as superseded by #N", for non-hive-authored PRs. The dashboard has decide:close-superseded but the comment command does not.
  5. Hold labels silence the sweep entirely. trySweepSupersededPR returns before any check if isHeld (incl. the sentinel label) or do-not-merge — 🐛 fix: find default tmux sockets under arbitrary container UIDs #14795 now carries sentinel-alert, so even a future resolution won't be re-evaluated until the label clears.
  6. Upstream: no claim/overlap check stops a second PR being opened against an issue that already has an open PR (or, for 🐛 dco: re-home unsigned commits on adopted PRs so the gate can clear #14787, against an already-closed issue).

Proposed fleet-generic fix

  • Stage tracker: when an item's issue is closed and closedByPullRequestsReferences names a merged PR ≠ this PR, render the row as "Superseded by #N — decide" regardless of 07x stage, and keep the 085 park sticky (reconciler must not downgrade a supersession park to 071/072 on needs-rebase/check-failing, which are moot for a superseded PR).
  • /hive decision reject / close superseded by #N on a non-hive PR should close the PR with a comment (no push required), mirroring decide:close-superseded.
  • Supersession heuristic: treat extra files that are only *_test.go, docs, or changelog fragments as not-blocking, or compare the overlapping files' hunks instead of file names; log the "keep open" reason into the stage-tracker row.
  • Issue-claim gate: when a PR is opened with Fixes #N and #N already has an open PR (or is closed), post the overlap notice immediately and park at 085 instead of letting it ride the normal lane to 072.

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 28, 2026
  2. clubanderson commented on Oct 28, 2026

    @clubanderson
    MemberAuthor

    Follow-up: how each duplicate PR got opened (provenance trace)

    Source: spoke logs (hive-oke, pod window starts 20:34 ET) + 3 GraphQL reads. Times ET.

    Dup PR Author / channel Canonical PR opened Dup task assigned → PR opened Issue closed Was the issue "covered" when assigned?
    #14779 thatguywob via hive contribute (contribute-ws, cli=codex, tier=trusted); task ct-hivecommons/hive-14765-1793149524 #14772 (owner) 20:56:08 21:05:25 assigned by this spoke → PR 21:08 21:13 (merge of #14772) Yes — #14772 with Fixes #14765 had been open 9 min
    #14795 same contributor, task ct-hivecommons/hive-14789-1793151599 #14791 (owner) 21:26:38 21:40:00 assigned → PR 21:42 21:52 (merge of #14791) Yes — #14791 open 13 min. Enumeration at 21:44:11 logged suppressing issue: open external PR covers it issue=14789 claimed_by_pr=14791 — 4 min after the hand-out
    #14702 Karibhou (Claude Code; author/clanker, pre-log-window so channel unconfirmed, likely contribute-ws) #14695 (owner) 16:00 first commit 16:38:51 → PR 16:39 (branch name identical: feat/reviewer-autoscale) 17:02 (merge of #14695) Yes — #14695 open 38 min
    #14787 clubanderson (human, local Claude Code) #14688 (hive scanner) merged 17:48 → issue closed PR 21:24 with Fixes #14666 already closed 3.5 h earlier Issue was closed; no gate exists for a human opening Fixes #closed

    The single mechanism gap

    ContributeWSHub.selectTask (pkg/dashboard/contribute_select.go) offers work from the cached ActionableIssues snapshot. The "open external PR covers this issue" suppression lives in pkg/github/prclaims.go and only runs during a full enumeration pass (observed at 20:38, 21:44, 23:08, 23:20 — ~66 min apart during the incident). Webhook re-reads (eval_cycle_source.go → ApplyWebhookItem) upsert individual issue/PR items but do not re-run the PR→issue claim cross-link, so an owner PR opened with Fixes #N between passes leaves #N offerable. activeIssues/claimedIssueKeys only cover live contributor/worker claims, not external PRs. Result: a contributor was assigned #14765 and #14789 while an open PR already fixed each.

    Fix

    • In selectTask (or ApplyWebhookItem for PR snapshots), run the same claim.ExternalAuthor && !claim.MergedPR suppression against the snapshot's open PRs / closingIssuesReferences before offering an issue; also refuse issues whose state is closed.
    • Webhook pull_request.opened with closing keywords should patch the referenced issue out of ActionableIssues immediately.
    • For human-opened PRs on closed issues (🐛 dco: re-home unsigned commits on adopted PRs so the gate can clear #14787), the supersession sweep is the right backstop — covered by the parent issue.
  3. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  4. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by agent scanner released (holding agent relaunched).

  5. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔒 Claimed by @thatguywob (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  6. hivecommons-hive commented on Oct 28, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by @thatguywob released (lease revoked).

  7. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    @clubanderson this issue was closed by @hivecommons-hive[bot] as completed.

    If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.

    If you are still seeing the problem, comment /reopen and it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/claimed-by-scanner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions