fix: use SOURCE-quality score for eligibility gates - #1024
Closed
bitloi wants to merge 6 commits into
Closed
Conversation
bitloi
marked this pull request as ready for review
May 5, 2026 23:01
Collaborator
|
Maintainer review already rejects test-only PRs, so reaching the failure mode this defends against — five test-only PRs accumulating aggregate token_score ≥ 5 from the 0.05× TEST weight — requires maintainer cooperation that doesn't happen in practice. Not pursuing the fix. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eligibility-style gates were using aggregate
token_score, which includes tree-diff TEST score, even though the base-score threshold already uses SOURCE-only quality. A large test-only PR could therefore get only the intended small contribution bonus, but still count as a valid merged PR, valid solved issue-discovery PR, or pioneer-eligible PR.This change:
source_token_scorefromcalculate_base_score_for_pr_files().token_scoreunchanged for contribution accounting and token totals.token_scorewhensource_token_scoreis absent so older/test objects remain compatible.Related Issues
Fixes #1022.
Related context:
Type of Change
Testing
Commands run:
Results:
68 passed769 passed, 2 warnings0 errors, 0 warningsChecklist