fix(review): sum per-PR review-effort minutes with fallback in public-stats (#2070) - #4060
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-07 23:04:32 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 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 #4060 +/- ##
=======================================
Coverage 93.59% 93.59%
=======================================
Files 380 380
Lines 35596 35599 +3
Branches 13050 13051 +1
=======================================
+ Hits 33316 33319 +3
Misses 1618 1618
Partials 662 662
🚀 New features to boost your workflow:
|
47fd706 to
d3d8874
Compare
…-stats Closes JSONbored#2070 Replace reviewed * AVG(reviewEffortMinutes) with SUM(COALESCE(minutes, MINUTES_SAVED_PER_PR)) so mixed ledgers credit missing per-PR estimates with the documented flat fallback instead of under-reporting ROI. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Closes #2070
Supersedes closed #4058 (CI was green; auto-closed on Orb/own-ledger interaction feedback — addressed here).
Completes the public-stats ROI fix:
minutesSavednow sums each distinct published PR'sreviewEffortMinuteswithMINUTES_SAVED_PER_PRper-PR fallback for missing metadata. Orb fleet outcomes (no persisted effort metadata) still credit the flat constant separately so the counter scales with fleet growth.Root cause
#1955 persisted per-PR estimates, but
getPublicStatsusedreviewed * AVG(minutes). SQLiteAVGskips NULLs, so mixed ledgers under-reported (e.g. 4 min + missing estimate -> 8 instead of 24).Fix
SUM(COALESCE(minutes, MINUTES_SAVED_PER_PR))at per-PR grainminutesSaved = ownLedgerSum + orb.total * MINUTES_SAVED_PER_PR(own-ledger scoped; Orb flat credit preserved)Test plan
npm run typechecknpx vitest run test/unit/public-stats.test.ts(20/20)