Skip to content

fix(issue-discovery): zero per-repo issue fields for repos absent this round#1640

Open
jaytbarimbao-collab wants to merge 1 commit into
entrius:testfrom
jaytbarimbao-collab:fix/issue-discovery-stale-repo-reset
Open

fix(issue-discovery): zero per-repo issue fields for repos absent this round#1640
jaytbarimbao-collab wants to merge 1 commit into
entrius:testfrom
jaytbarimbao-collab:fix/issue-discovery-stale-repo-reset

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown

Summary

_finalize_repo_issue_scores only rewrote the repos seen this round (sorted(set(repo_acc) | set(open_counts))), but _roll_up_issue_totals sums over all evaluation.repo_evaluations. A repo issue-scored in a prior round that is absent this round — e.g. an evaluation restored from the cache after an OSS PR-fetch failure (store_or_use_cached_evaluation), which carries prior-round repo_evaluations — kept its stale per-repo issue values, and those got summed back into the round-level totals. This inflates total_solved_issues / issue_discovery_score / is_issue_eligible in stored data, CLI miner score, analytics, and the cross-round cache.

The no-issues path (_clear_issue_discovery_fields) already zeroes every repo_evaluation, which is the intended contract; the scoring path had drifted from it. This extracts the per-repo reset into a shared _reset_repo_issue_fields helper and applies it on the scoring path to any repo not seen this round, before the roll-up.

Current-round emission allocation reads the freshly-rebuilt issue_discovery_issues list, so this is a stored-data / reporting correctness fix, not an emissions change.

Related Issues

Fixes #1610

Type of Change

  • Bug fix

Testing

  • Tests added — TestFinalizeStaleRepoReset::test_repo_absent_this_round_is_zeroed_not_summed asserts a repo absent this round is zeroed and not summed into the round totals. Fails on test before the fix (repo stays at 7 solved / 8.12 score, roll-up inherits it), passes after.
  • Full suite green (965 passed), ruff + pyright clean.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

…s round

_finalize_repo_issue_scores only rewrote the repos seen this round
(sorted(set(repo_acc) | set(open_counts))), but _roll_up_issue_totals
sums over ALL evaluation.repo_evaluations. A repo that was issue-scored
in a prior round and is absent this round (e.g. an evaluation restored
from the cache after an OSS PR-fetch failure, which carries prior-round
repo_evaluations) kept its stale per-repo issue values, and those got
summed back into the round-level totals — inflating total_solved_issues
/ issue_discovery_score / is_issue_eligible in stored data, CLI
`miner score`, analytics, and the cross-round cache.

The no-issues path (_clear_issue_discovery_fields) already zeroes every
repo_evaluation, which is the intended contract; the scoring path had
drifted from it. Extract the per-repo reset into a shared
_reset_repo_issue_fields helper and apply it on the scoring path to any
repo not seen this round, before the roll-up.

Add a regression test asserting a repo absent this round is zeroed and
not summed into the round totals.

Fixes entrius#1610
@jaytbarimbao-collab

Copy link
Copy Markdown
Author

@anderdc @LandynDev fixes #1610. _finalize_repo_issue_scores only rewrites repos seen this round, but _roll_up_issue_totals sums all repo_evaluations — so a repo issue-scored in a prior round and restored from the eval cache keeps stale per-repo values that inflate the round totals. The no-issues path (_clear_issue_discovery_fields) already does the full reset; this shares that reset onto the scoring path. Stored-data/reporting correctness, not an emissions change. +regression test.

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jul 16, 2026
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.

Stale per-repo issue-discovery fields survive a successful scoring round and inflate roll-up totals

1 participant