Skip to content

fix: apply fixed_base_score repo override on issue-discovery cache-miss path (#1172)#1173

Merged
anderdc merged 3 commits into
entrius:testfrom
alpurkan17:fix/1172-fixed-base-score-cache-miss
May 14, 2026
Merged

fix: apply fixed_base_score repo override on issue-discovery cache-miss path (#1172)#1173
anderdc merged 3 commits into
entrius:testfrom
alpurkan17:fix/1172-fixed-base-score-cache-miss

Conversation

@alpurkan17
Copy link
Copy Markdown
Contributor

Summary

PR #1115 introduced RepositoryConfig.fixed_base_score to decouple PR base scoring from token math for configured repos. The override is applied correctly in OSS scoring (score_mirror_pr) but was missing on the issue-discovery cache-miss path (_resolve_solving_pr_score).

On a cache miss (typical when the solver is a non-miner contributor), the solving PR's base_score was computed purely from tokenized files, ignoring repo_config.fixed_base_score. This meant two miners filing equivalent issues in the same fixed_base_score repo could receive different discovery base scores depending on whether their issue was solved by a registered miner (cache hit → override applied) or an outside contributor (cache miss → override skipped).

This fix threads mirror_repos into _resolve_solving_pr_score and applies the same fixed_base_score override that OSS scoring uses, so discovery_base_score is consistent regardless of solver identity.

Validation

  • mirror_repos (already available in the caller _score_miner_mirror_issues) is passed to _resolve_solving_pr_score as a new parameter
  • After token computation in the cache-miss path, repo_config.fixed_base_score is applied if present (matching score_mirror_pr at scoring.py L164–L167)
  • Token fields remain token-derived (unchanged behavior, matching the legacy-parity comment)
  • ruff check + ruff format pass

Closes #1172

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 12, 2026
@alpurkan17 alpurkan17 force-pushed the fix/1172-fixed-base-score-cache-miss branch 2 times, most recently from a7ff4d6 to aafebea Compare May 12, 2026 20:50
Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tighten the signature — the function only ever looks one repo up, so passing the whole dict is more than it needs.

Change _resolve_solving_pr_score to take repo_config: Optional[RepositoryConfig] (or just fixed_base_score: Optional[float]) instead of mirror_repos: Dict[str, RepositoryConfig]. The caller _score_miner_mirror_issues already resolves repo_config = mirror_repos.get(issue.repo_full_name) at scan.py:419 — hoist that lookup above the call and pass the resolved value. The override branch inside the function then just checks the passed-in config directly.

Behavior is correct as-is; this is purely a signature cleanup so the helper stops knowing about the full config map.

@alpurkan17
Copy link
Copy Markdown
Contributor Author

Fixed per review: hoisted repo_config lookup to caller, signature now takes repo_config: Optional[RepositoryConfig] instead of the full mirror_repos dict.

@alpurkan17 alpurkan17 force-pushed the fix/1172-fixed-base-score-cache-miss branch from e32b996 to d9e94a1 Compare May 13, 2026 22:24
@anderdc anderdc merged commit d6cfec1 into entrius:test May 14, 2026
3 checks passed
@alpurkan17
Copy link
Copy Markdown
Contributor Author

Thank you for the review @anderdc! Glad to contribute. 🚀

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.

[Bug] fixed_base_score repo override skipped on issue-discovery cache-miss path - same-repo discovery rewards diverge by solver identity

2 participants