feat(signals): add queue burden score breakdown with weighted contributors and top lever#1919
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-01 05:38:20 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.
|
179fe63 to
81efc24
Compare
81efc24 to
213e05c
Compare
f3e4b40 to
b8469d5
Compare
…utors and top lever
b8469d5 to
28ccdd5
Compare
What
A new pure service,
explainQueueBurden, that decomposes the queueburdenScorecarried on a computedQueueHealthinto its weighted, observable contributors and names the single highest-leverage lever a maintainer can pull to bring queue pressure down fastest. It is a sibling ofscore-breakdown.ts,miner-dashboard-recommendations.ts, andagent-action-explanation-card.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
burdenScoreinbuildQueueHealthbut nothing explains how it is composed, so a maintainer sees a single opaque number with no breakdown of which factor is driving queue pressure or which lever helps most. This adds that explanation without changing the score.Data source
Pure compute over an already-computed
QueueHealthobject. No network, no GitHub fetch, no I/O, no database access. Every contribution is derived from the observable signal counts already present on the queue health snapshot.Behavior
Each penalty factor (unlinked PRs, collision clusters, open PRs, stale PRs, PRs aged past 30 days, open issues) is reported with its observable count, its signed per-unit weight, its point contribution, its share of total queue pressure, a band (none, low, moderate, high), and a specific lever. The readily-reviewable PRs are reported as a credit that offsets burden. The module also reports the pre-clamp raw sum and a
clampedflag for when the engine pinned the score to the zero-to-one-hundred band, and it elects the single highest-leverage lever from the dominant penalty. The per-unit weights mirrorbuildQueueHealthinsrc/signals/engine.ts, and a drift-guard test rebuilds aQueueHealththrough that function and 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 observable counts, relative shares, and bands, and routes every rendered string throughsanitizePublicComment.Tests
Vitest cases cover the all-zero no-lever case, a dominant high-band contributor, a moderate band with the largest-remaining lever, both clamp directions (raw sum above one hundred and the reviewable credit driving it below zero), repo and timestamp passthrough, a public-safe check that no rendered string leaks reward or private terminology, and the engine-parity drift guard that pins the weights to
buildQueueHealth. Branch coverage on the new file is 100 percent.Validation
npm run test:coveragefor the new file: 100 percent branch coverage (32/32).npm run typecheck: no errors introduced by these files.