Skip to content

[scanner] Keep the contributor claim when their PR covers the issue instead of releasing it on lease revoke #17300

Closed

Description

@hivecommons-hive

Part of #17292

Failure evidence. Contributor Karibhou claimed #17243 at 15:11:02 and opened covering PR #17248 at 15:26:10 (issue at 040 from 15:26:49). At 15:27:45 the ledger recorded the contributor lease released with reason lease revoked, 40 s after coverage. From then on, anything that consults only the claim ledger read #17243 as unclaimed.

Code locations

  • src/pkg/dashboard/contribute_leases.go: (*ContributeWSHub).revokeLease. On task completion/abandon/expiry it calls integrationRelease(..., "lease revoked") and releaseClaimForLease(identity, key, "lease revoked"). It does not check whether the released item now has the same contributor's open PR covering it.
  • src/pkg/dashboard/claims_api.go: (*ContributeWSHub).releaseClaimForLease → src/pkg/claims/claims.go (*Ledger).ReleaseByHolderID, which deletes the claim outright.
  • src/pkg/github/stage_facts_sink.go: ledgerCoveringPR documents the symptom ("the ClaimReleased fact that followed (lease revoked once the PR covered the work) … re-derived 010") and patches it only for the stage deriver. Ledger-only readers still see no claim.

Expected behaviour
When a contributor's PR covers the issue they hold a claim on, finishing the lease does not drop the claim. The claim is either kept or converted into a PR-held claim (PRStarted, PRRepo/PRNumber set) naming the same principal, until that PR merges or closes. Every ledger reader, including dispatch, the PR-request gate and the claim listing, keeps seeing the issue as taken by that contributor.

Acceptance criteria

  • revokeLease / releaseClaimForLease convert rather than release when an open PR by the lease holder closes or covers the leased issue. A real abandon/expiry with no covering PR still releases.
  • The converted claim is released when the covering PR merges or closes.
  • Tests in src/pkg/dashboard and src/pkg/claims: lease completes with a covering PR → ledger still shows a claim held by the same principal with PR evidence; lease abandoned without a PR → claim released.

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

Activity

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

    @hivecommons-hive
    ContributorAuthor

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

    Claim history
    • 2026-11-08 21:42 UTC — claimed by scanner (agent on hive hosted-available-oke-11-placeholder-r05x)
    • 2026-11-08 22:08 UTC — released by scanner (agent; holding agent relaunched)
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

    agent/scannerCreated or modified by the scanner agenthas-open-prhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions