feat(scoring): surface branch eligibility in the score breakdown#1899
feat(scoring): surface branch eligibility in the score breakdown#1899andriypolanski wants to merge 4 commits into
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-06-30 22:24:26 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 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.
|
JSONbored
left a comment
There was a problem hiding this comment.
Moving forward, please fix your PR titles to follow this repos conventional commit naming scheme.
733af24 to
5bf6499
Compare
Hi, @JSONbored |
JSONbored
left a comment
There was a problem hiding this comment.
Review mentions a small blocker:
the main maintainability cost is the duplicated user-supplied branch in the nested summary expression.
Summary
explainScoreBreakdownexplains linked-issue multiplier eligibility viaissueMultiplierBreakdown, but branch eligibility — a separate upstream gate modeled insrc/scoring/preview.ts(BranchEligibilityResult, #90 / #178) — can block the standard linked-issue multiplier even when issue metadata looks plausible. Today that shows up only inblockedBy,gateDeltas, and free-textrecommendation.actions, not as a dedicated component miners can scan ingittensory_explain_score_breakdown.Contributors targeting issue-solving PRs on protected default branches routinely hit invisible branch/base mismatches; this closes the last major eligibility dimension missing from the breakdown surface (after #1453 open-issue, #1801 merged-history, #1874 issue-discovery, #1877 time-decay).
What this adds
A
branchEligibilityBreakdowncomponent keyed offpreview.branchEligibility:not_required(no linked-issue mode that requires branch proof).requiredand status iseligiblewith fresh, verified evidence.ineligible— lever mirrors existing recommendation copy (use an eligible branch or drop linked-issue assumptions).unknown, evidence ismissing, metadata isstale, or source isuser_supplied— each branch gets distinct summary/lever text matchingbranchEligibilityFailureReasonsemantics inpreview.ts.Purely additive explanation; no scoring behavior change.
Files touched (estimated)
src/services/score-breakdown.tsbranchEligibilityBreakdown, wire intoexplainScoreBreakdowntest/unit/score-breakdown.test.ts~70–100 lines total (size S).
Validation
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'Safety
sanitizePublicComment; do not leak raw branch names that contain forbidden terms (use existing sanitizer boundaries).