feat(scoring): sync dropped upstream constants and cap non-code token contribution (#809) - #991
Conversation
… contribution (JSONbored#809) The knownOnly constants parser dropped MAX_OPEN_PR_REVIEW_COLLATERAL_MULTIPLIER, MAX_LINES_SCORED_FOR_NON_CODE_EXT, and DEFAULT_ISSUE_DISCOVERY_SHARE (absent from SCORING_CONSTANT_NAMES), so they never synced from upstream and surfaced as unmodeled drift. Add all three to DEFAULT_SCORING_CONSTANTS so they sync. Model the non-code line cap in preview.ts: a PR's non-code token contribution is now capped at MAX_LINES_SCORED_FOR_NON_CODE_EXT before it feeds the component total, so a large generated/non-code file cannot inflate the contribution-bonus ramp (an explicit caller total is still honoured as-is). DEFAULT_ISSUE_DISCOVERY_SHARE is already applied as the upstream default in registry/normalize.ts; the review-collateral multiplier now syncs and can be modeled in a follow-up. Tests: the three constants are modeled + no longer flagged as drift, and the non-code cap clamps the component total (500 and 300 yield the same contribution bonus; 100 is lower).
|
🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 ⛔ Maintainer review — Blockers foundReviewed 3 changed file(s) — two independent AI reviewers, synthesized.
Merge readiness: ❌ CI is red — approval withheld until it's green. Failing: see the checks tab. Summary The changes correctly add missing upstream scoring constants, update the parser to handle numeric literals with underscores and exponents, and cap non‑code token contributions per upstream spec. Tests verify the new constants and the capping behavior. No obvious security issues or correctness bugs are introduced. However, CI reports failing validation and test coverage checks (codecov thresholds not met), indicating the change is not yet ready for merge. 🛑 Hard blockers — must fix before merge
💡 Nits — non-blocking, optional
This repo uses one-shot review: a rejected PR is closed, not iterated in place. Address the above and open a new focused PR. |
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #991 +/- ##
===========================================
- Coverage 96.61% 70.01% -26.60%
===========================================
Files 110 110
Lines 15079 15080 +1
Branches 5451 5451
===========================================
- Hits 14569 10559 -4010
- Misses 106 3231 +3125
- Partials 404 1290 +886 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Addresses #809. The
knownOnlyconstants parser droppedMAX_OPEN_PR_REVIEW_COLLATERAL_MULTIPLIER,MAX_LINES_SCORED_FOR_NON_CODE_EXT, andDEFAULT_ISSUE_DISCOVERY_SHARE(absent fromSCORING_CONSTANT_NAMES), so they never synced from upstream and surfaced as unmodeled drift. Add all three toDEFAULT_SCORING_CONSTANTSso they sync.Model the non-code line cap in
preview.ts: a PR's non-code token contribution is now capped atMAX_LINES_SCORED_FOR_NON_CODE_EXTbefore it feeds the component total, so a large generated/non-code file cannot inflate the contribution-bonus ramp (an explicit callertotalTokenScoreis still honoured as-is).Scope:
DEFAULT_ISSUE_DISCOVERY_SHAREis already applied as the upstream default inregistry/normalize.ts:62; the review-collateral multiplier now syncs and can be modeled in a focused follow-up.Tests
The three constants are modeled + no longer flagged as drift; the non-code cap clamps the component total (nonCode 500 and 300 yield the same contribution bonus, 100 is lower).
npx vitest run test/unit/scoring.test.ts→ 44 passed ·npx tsc --noEmit→ clean ·git diff --check→ clean · full unit suite ripple-checked.Closes #809.