Skip to content

fix(bounties): use close events for solver attribution#1305

Open
JSONbored wants to merge 1 commit into
entrius:testfrom
JSONbored:codex/bounty-authoritative-closer
Open

fix(bounties): use close events for solver attribution#1305
JSONbored wants to merge 1 commit into
entrius:testfrom
JSONbored:codex/bounty-authoritative-closer

Conversation

@JSONbored
Copy link
Copy Markdown

Summary

  • Resolve issue-bounty solvers from GitHub's current ClosedEvent.closer instead of inferring attribution from PR cross-reference candidates.
  • Require the close event to match the issue's current closedAt value and only attribute merged PR closers targeting the same repository.
  • Keep PR cross-reference discovery available for issue-submission/PR-listing flows while removing it from bounty solver attribution.

What changed

  • Added a GraphQL closure query for CLOSED_EVENT timeline entries and the associated PR closer fields.
  • Updated bounty solver lookup to return a solver only from the authoritative current close event.
  • Expanded GitHub API tests for non-PR closures, stale close events, missing closedAt, non-completed events, wrong-repo PR closers, and the check_github_issue_closed integration path.

Why

Cross-reference entries describe PR text references, not necessarily the PR that caused the issue's current closure. Bounty voting should follow GitHub's close-event source of truth so validators do not attribute a completed bounty to stale or unrelated closing references.

Validation

  • uv run pytest tests/utils/test_github_api_tools.py tests/validator/test_issue_competitions_forward.py -q
  • uv run ruff check gittensor/utils/github_api_tools.py tests/utils/test_github_api_tools.py
  • uv run ruff format --check gittensor/utils/github_api_tools.py tests/utils/test_github_api_tools.py
  • uv run pyright gittensor/utils/github_api_tools.py tests/utils/test_github_api_tools.py
  • Verified a live closed upstream issue resolves through the close-event path with solver_lookup_failed=False.
  • CodeRabbit CLI review completed and raised 0 issues.

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 19, 2026
@JSONbored JSONbored marked this pull request as ready for review May 19, 2026 00:55
@JSONbored JSONbored marked this pull request as draft May 19, 2026 01:26
@JSONbored JSONbored marked this pull request as ready for review May 19, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant