Skip to content

[stage] issue sweep never writes stage/040-covered-by-pr: second annotateIssueWithClaim pass resets CoveredLabelSynthesized #14397

Closed

Description

@clubanderson

Observation (hivecommons/hive issue list, 2026-10-26 ~18:30Z)

Issue Stage label Covering PR PR body ref GitHub closing link (closingIssuesReferences) Verdict
#14372 stage/010-actionable #14375 (open, base v5, human) Fixes #14372 ✅ linked hive missed 040
#14371 stage/010-actionable #14374 (open, base v5, human) Fixes #14371 ✅ linked hive missed 040
#14360 stage/040-covered-by-pr #14363 (open, base v5, human) Refs #14360 ❌ not linked by design: hive's Reference tier counts a Refs PR as cover (#8876/#12144) and deliberately does not add a closing link for it (would arm auto-close the author declined)
#14364 stage/040-covered-by-pr #14365 (open, base v5, human) Fixes #14364 ✅ linked consistent (040 landed 12 min after the human-claim release)
#14346 stage/040-covered-by-pr #14347 (open, base v5, human) Fixes #14346 ✅ linked consistent (040 landed 4 min after release)

Repo default branch is v5 (gh repo view --json defaultBranchRef), so base ≠ default is not a factor here. Hive-authored fix PRs already get Fixes #N retrofitted / a closing link made by EnsureIssueStagePRLink / EnsureClosingIssueLink (#11888, #12144); the non-default-base case already posts the explanatory stage comment.

Root cause (A: Fixes PR open, issue stuck at 010)

Timeline for #14372: human claim (hive/claimed-by-human, 020) → PR #14375 opened 17:35Z with Fixes #14372 → claim released 17:37Z → stage/010-actionable. The next enumeration pass (pod logs 18:18Z) did see the cover:

"msg":"suppressing issue: open external PR covers it","issue":14372,"claimed_by_pr":14375,"pr_author":"thatguywob"

but issue stage labels applied items=29 writes=4 wrote nothing for it. The sweep's input labels already "had" stage/040-covered-by-pr:

  1. SyncIssuePRClaimLabels calls annotateIssueWithClaim → forge lacks 040 → adds it in-memory and marks ClaimContext.CoveredLabelSynthesized=true (the 🐛 issue stage sweep never writes stage/040-covered-by-pr: synthetic in-memory label hides the gap #13316/🐛 fix(stage): write stage/040 when the forge lacks it despite the in-memory covered label #13318 fix).
  2. FilterClaimedIssues calls annotateIssueWithClaim again on the same payload → now issueHasLabel(labels, 040) is true → synthesized=false, and it replaces ClaimContext with a fresh one.
  3. IssueStageInputs → forgeIssueLabels sees CoveredLabelSynthesized=false, keeps the 040 label → stagelabels.Plan says "stage already right" → no write.

So the sweep path to 040 has been dead since #13318 shipped; 040 only lands via the out-of-cycle facts (clearInProgressForPR for relay-opened hive PRs, the contribute hub's verdict settle for hub-claimed humans — which is how #14346/#14364/#14360 got theirs). A human PR opened outside the hub, or any issue whose fact write was lost (the 17:37Z release write for #14372 logged effect outcome uncertain… context deadline exceeded; the pod has restarted twice today), never converges. GitHub 502/504s + the sweep's budget (issueStageSyncTimeout) made the single pass since the restart write only 4 of 29 items, which compounds it but is not the cause.

Root cause (B: 040 label, no GitHub link)

#14360: the covering PR uses Refs #14360. Hive's claim scan grades that as a Reference-tier cover → 040 (so dispatch does not re-offer the issue while the PR is open), and SyncIssuePRClaimLabels intentionally does not create a closing link for Reference claims (a closing link would make GitHub close the issue on merge, which the author declined; #12144 even retracts hive-made ones). GitHub's linked-PR icon only renders for closing keywords, so label and icon legitimately disagree for Refs covers. Not a bug; documenting here so the mismatch is understood. #14364/#14346 do carry GitHub links.

Fix

  • annotateIssueWithClaim keeps CoveredLabelSynthesized across re-annotation (synthesized = !hasLabel || prevCtx.CoveredLabelSynthesized), so the sweep plans against the forge labels and writes 040 for every cover tier (external/hive closing, branch-name, Reference) and reverts to 010 when the claim lapses (existing Uncovered path).
  • Table-driven test replaying the production order (SyncIssuePRClaimLabels → FilterClaimedIssues → IssueStageInputs → sweep) per claim tier, plus an idempotency test for the annotation.

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 26, 2026
  2. hivecommons-hive commented on Oct 26, 2026

    @hivecommons-hive
    Contributor

    🔒 Claimed by @Karibhou (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.

  3. Karibhou commented on Oct 26, 2026

    @Karibhou
    Contributor

    Already covered by the open, ready-for-review PR #14398, targeting v5 with Fixes #14397 in its body. I checked the diff: it preserves CoveredLabelSynthesized across repeated annotations, adds table-driven coverage replaying SyncIssuePRClaimLabels → FilterClaimedIssues → stage inputs/sweep (external closing, hive closing, Reference, and a real forge label), tests annotation idempotency, and includes a changelog fragment. The existing uncovered path remains in place. CI and review are still pending; this is existing implementation coverage, not a claim that the fix has merged or deployed. No duplicate PR is needed.

    — hive: backend=codex

  4. hivecommons-hive commented on Oct 26, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by @Karibhou released (lease revoked).

  5. github-actions commented on Oct 26, 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.

  6. added a commit that references this issue on Oct 26, 2026
    a15d662
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.kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions