Skip to content

fix: exclude auto-close event from post-merge edit detection in issue discovery scoring#444

Closed
spider-yamet wants to merge 3 commits intoentrius:testfrom
spider-yamet:fix/penalty-rule
Closed

fix: exclude auto-close event from post-merge edit detection in issue discovery scoring#444
spider-yamet wants to merge 3 commits intoentrius:testfrom
spider-yamet:fix/penalty-rule

Conversation

@spider-yamet
Copy link
Copy Markdown
Contributor

@spider-yamet spider-yamet commented Apr 15, 2026

Summary

Fix a false positive in the post-merge edit detection for issue discovery scoring. When a PR merge auto-closes a linked issue, GitHub sets the issue's updated_at to the close timestamp, which is always slightly after merged_at. The existing check treated this as a post-merge content edit, incorrectly flipping the issue from "solved" to "closed" — reducing the discoverer's solved_count, inflating closed_count, and dropping their credibility.

The fix adds a guard that compares updated_at against closed_at. The penalty now only fires when the issue was genuinely edited after the close event, not when the update was the close event itself.

Related Issues

Fixes #443

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Manual testing performed:

  • Verified that an issue auto-closed by a merged PR (where updated_at == closed_at) is correctly classified as "solved"
  • Verified that an issue with updated_at > closed_at (genuine post-close edit) still triggers the penalty
  • Verified that an issue with closed_at = None conservatively triggers the penalty

Checklist

  • Code follows project style guidelines
  • Self-review completed

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 15, 2026

Closing in favor of #434 which replaces the updated_at check entirely with precise body/title edit detection via GraphQL timeline events. That fix covers this case and all other false positives (bot comments, labels, reactions).

@anderdc anderdc closed this Apr 15, 2026
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.

Post-merge edit detection incorrectly penalises issues auto-closed by merged PRs

2 participants