feat(signals): add contributor intake score breakdown with weighted deductions and top lever - #2122
feat(signals): add contributor intake score breakdown with weighted deductions and top lever#2122GildardoDev wants to merge 1 commit into
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-01 18:52:29 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2122 +/- ##
=======================================
Coverage 95.73% 95.73%
=======================================
Files 223 224 +1
Lines 24741 24779 +38
Branches 8969 8986 +17
=======================================
+ Hits 23685 23723 +38
Misses 433 433
Partials 623 623
🚀 New features to boost your workflow:
|
2c9ec91 to
c937ca8
Compare
c937ca8 to
4ba1837
Compare
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
4ba1837 to
7a85ffb
Compare
…eductions and top lever
7a85ffb to
dc9a988
Compare
JSONbored
left a comment
There was a problem hiding this comment.
Some issues:
The main rough edges are polish and maintainability: the output exposes internal component ids in user-facing reason/summary strings, and the test file has a small unused type import.
What
A new pure service,
explainContributorIntake, that decomposes the contributor-intakescorecarried on a computedContributorIntakeHealthinto the weighted deductions that lowered it from a perfect 100, and names the single highest-leverage lever a maintainer can pull to make the repo more attractive to contributors. It is a sibling ofqueue-burden-breakdown.tsandscore-breakdown.tsin the same explanation-service family.No linked issue
no issue because: this is net-new analytical work that fills a real gap, and there is no open issue for it. The engine computes the intake
scoreinbuildContributorIntakeHealthbut nothing explains how it breaks down, so a maintainer sees a single opaque number and its band with no view of which factor (queue burden, duplicate clusters, or config quality) is dragging intake down or which lever helps most. This adds that explanation without changing the score.Data source
Pure compute over an already-computed
ContributorIntakeHealthobject. No network, no GitHub fetch, no I/O, no database access. Every deduction is derived from fields already present on the object:queueHealth.burdenScore,duplicateClusters, andconfigLevel.Behavior
The intake score is a base of 100 minus three weighted deductions, mirroring
buildContributorIntakeHealth: queue burden times 0.55, duplicate clusters times 8, and a fixed config-quality penalty by band (fragile 30, needs_attention 18, good 6, else 0). Each factor is reported with its observable driver, the points it removed, its share of the total deduction, a band (none, low, moderate, high), and a specific lever, plus the single highest-leverage lever. When nothing is deducted the lever is an explicit no-op rather than an arbitrary factor, and aclampedflag marks when the deductions exceeded 100 and the engine floored the score at 0. The weights mirror the engine, and a drift-guard test rebuilds aContributorIntakeHealththroughbuildContributorIntakeHealthand asserts this module recomposes the exact same score, so an engine weight change fails the suite instead of silently producing a wrong breakdown. Public-safe by construction: it reports the same observable drivers the intake summary already prints (queue burden out of 100, duplicate-cluster count, config band) and routes every rendered string throughsanitizePublicComment.Tests
Vitest cases cover a perfect-intake no-deduction case with an honest no-op lever, a dominant high-band drag with a small low-band factor, a moderate top drag with the largest-remaining lever, each config band mapping to its fixed penalty, the deductions-exceed-100 clamp, repo and timestamp passthrough, a public-safe check that no rendered string leaks reward or private terminology, and the engine-parity drift guard that recomposes the exact score from
buildContributorIntakeHealth. Branch coverage on the new file is 100 percent.Validation
npm run test:coveragefor the new file: 100 percent branch coverage (35/35).npm run typecheck: no errors introduced by these files.