Skip to content

fix: use last_edited_at instead of updated_at for post-merge edit detection#373

Closed
Grizouforever wants to merge 1 commit intoentrius:mainfrom
Grizouforever:fix/issue-discovery-use-last-edited-at
Closed

fix: use last_edited_at instead of updated_at for post-merge edit detection#373
Grizouforever wants to merge 1 commit intoentrius:mainfrom
Grizouforever:fix/issue-discovery-use-last-edited-at

Conversation

@Grizouforever
Copy link
Copy Markdown

Summary

Fixes #372

The anti-gaming post-merge edit detection in issue discovery scoring uses issue.updated_at > pr.merged_at. However, GitHub's updatedAt reflects any activity on the issue (comments, label changes, and the closing event itself), not just content edits. Since closing an issue always updates updatedAt to >= merged_at, this check incorrectly penalizes nearly all legitimately solved issues by reclassifying them from solved_count to closed_count.

Changes

gittensor/validator/issue_discovery/scoring.py: Replace issue.updated_at with issue.last_edited_at in the post-merge edit check (line 240). The Issue class already has last_edited_at populated from GitHub's lastEditedAt GraphQL field, which specifically tracks body/title edits by the author.

Impact

Prevents legitimate issue discoveries from being incorrectly penalized. Without this fix, the anti-gaming check fires on nearly every solved issue because the closing event updates updatedAt.

…ection

The anti-gaming check uses issue.updated_at > pr.merged_at to detect
edits after merge. However, GitHub's updatedAt reflects any activity
(comments, labels, closing event), not just content edits. Since the
closing event always updates updatedAt to >= merged_at, this check
incorrectly penalizes nearly all legitimately solved issues.

Use issue.last_edited_at (from GitHub's lastEditedAt field) which
specifically tracks body/title edits. The Issue class already has
this field populated.

Fixes entrius#372
ClawdiaHedgehog pushed a commit to ClawdiaHedgehog/gittensor that referenced this pull request Apr 11, 2026
…ection

Bug: Issue discovery was penalizing nearly all legitimately solved issues
because GitHub's updatedAt field is updated by ANY issue activity (including
the closing event itself), not just body/title edits.

Fix:
- Added last_edited_at field to Issue class (populated from GitHub's lastEditedAt)
- Added lastEditedAt to _PR_TIMELINE_QUERY GraphQL query
- Updated _search_issue_referencing_prs_graphql to capture and return lastEditedAt
- Updated find_solver_from_cross_references to return last_edited_at as 3rd value
- Updated repo_scan.py to pass last_edited_at to Issue objects
- Updated scoring.py anti-gaming check to use last_edited_at (with updated_at fallback)

Now the anti-gaming check correctly identifies actual post-merge body/title
edits rather than conflating them with the issue closing event.

Fixes entrius#372
Fixes entrius#373
@Grizouforever
Copy link
Copy Markdown
Author

Hi! This PR is ready for review — 259 tests pass locally. Happy to make any changes if needed. Thanks!

@Grizouforever
Copy link
Copy Markdown
Author

Closing — duplicate of #375. Apologies for the overlap.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant