feat(scoring): surface the review-collateral multiplier in the score breakdown - #1879
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-06-30 19:14:47 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 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.
|
Summary
explainScoreBreakdown(src/services/score-breakdown.ts) explains the review penalty multiplier (reviewPenaltyMultiplier) but silently omits the sibling review-collateral multiplier (gates.reviewCollateralMultiplier/gates.collateralFraction), even though upstream models it separately insrc/scoring/preview.ts(#916) and it directly affects how much token score is reserved as open-PR collateral when a contributor hasCHANGES_REQUESTEDreviews on other open PRs.Miners juggling concurrent work see open-PR pressure explained via
openPrMultiplier, yet get no plain-English lever for why their collateral fraction is elevated above the baseOPEN_PR_COLLATERAL_PERCENT.What this adds
A
reviewCollateralBreakdowncomponent mirroring the existingreviewPenaltyBreakdownand sibling gate explainers (#1453, #1801):reviewCollateralMultiplieris at the baseline (no elevated collateral from review churn on open PRs).collateralFraction) and ties it to priorCHANGES_REQUESTEDreview churn on open PRs.Purely additive explanation over already-computed gate fields; no scoring behavior change.
Files touched (estimated)
src/services/score-breakdown.tsreviewCollateralBreakdown, wire intoexplainScoreBreakdowntest/unit/score-breakdown.test.tsValidation
git diff --checknpm run actionlintnpm run typechecknpm run test:coverage— aim for 100% statements/branches on changed lines insrc/services/score-breakdown.tsnpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateTargeted test run:
npx vitest run test/unit/score-breakdown.test.ts --coverage --coverage.include='src/services/score-breakdown.ts'Notes
Analogues to imitate end-to-end:
reviewPenaltyBreakdownandopenPrBreakdowninsrc/services/score-breakdown.ts, plus the merged-history floor tests intest/unit/score-breakdown.test.ts.