Skip to content

fix: gate MERGED solving PRs missing merged_at in mirror issue discovery - #920

Closed
Daedalus-Icarus wants to merge 1 commit into
entrius:testfrom
Daedalus-Icarus:fix/timeline-cross-reference-pagination
Closed

fix: gate MERGED solving PRs missing merged_at in mirror issue discovery#920
Daedalus-Icarus wants to merge 1 commit into
entrius:testfrom
Daedalus-Icarus:fix/timeline-cross-reference-pagination

Conversation

@Daedalus-Icarus

@Daedalus-Icarus Daedalus-Icarus commented May 1, 2026

Copy link
Copy Markdown
Contributor

Summary

A solving PR with state == 'MERGED' but merged_at is None is structurally unscoreable (time decay needs merged_at). _mirror_issue_for_scoring already drops it, but only after total_solved_issues and total_valid_solved_issues have been incremented. One corrupted record could push a miner past MIN_VALID_SOLVED_ISSUES, flipping eligibility and producing a non-zero discovery score from the other valid issues.

This PR adds the missing gate in _classify_issue so the corrupted record buckets as not-solved-closed before the counters bump — matching the defensive gate already present on the OSS mirror scoring path.

Changes

  • gittensor/validator/issue_discovery/mirror_scan.py: reject MERGED solving PRs with merged_at is None in _classify_issue; document the gate in the module docstring.
  • tests/validator/issue_discovery/test_mirror_scan.py: unit test on _classify_issue and a regression test verifying the counters stay at zero.

Close #919

Test plan

  • pytest tests/validator/issue_discovery/test_mirror_scan.py
  • Verify no behavior change for clean records (existing tests still green)

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 1, 2026
@Daedalus-Icarus
Daedalus-Icarus force-pushed the fix/timeline-cross-reference-pagination branch from 049f3e8 to 7a3fbfb Compare May 2, 2026 18:14
@Daedalus-Icarus
Daedalus-Icarus force-pushed the fix/timeline-cross-reference-pagination branch from d4d2de0 to 86a4617 Compare May 2, 2026 18:22
@Daedalus-Icarus
Daedalus-Icarus force-pushed the fix/timeline-cross-reference-pagination branch from a2e0c57 to 523a2e2 Compare May 2, 2026 18:39
@Daedalus-Icarus Daedalus-Icarus changed the title fix: paginate issue cross-reference timeline lookup fix: gate MERGED solving PRs missing merged_at in mirror issue discovery May 2, 2026
@xiao-xiao-mao xiao-xiao-mao Bot added drift and removed bug Something isn't working labels May 2, 2026
@xiao-xiao-mao

xiao-xiao-mao Bot commented May 2, 2026

Copy link
Copy Markdown

DRIFT detected — original PR premise tackled paginating issue cross-reference timeline events in _PR_TIMELINE_QUERY, the current state may not align. Flagging for maintainer review.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Mirror issue discovery: MERGED solving PR with null merged_at inflates eligibility counters

1 participant