feat(analytics): surface org-wide slop-band calibration + dashboard card (#2196)#5125
feat(analytics): surface org-wide slop-band calibration + dashboard card (#2196)#5125dhgoal wants to merge 1 commit into
Conversation
…hboard card (JSONbored#2196) Wire the existing, unit-tested buildSlopOutcomeCalibration over listAllPullRequests into the operator-dashboard payload as slopCalibration: org-wide per-band merge/close rates over resolved PRs carrying a persisted slop band, plus whether the deterministic slop score discriminates. The new read fails safe to an empty calibration on any read error (mirrors the sibling computeGateEval/cycleTime reads) so one DB hiccup never fails the whole dashboard. Adds SlopBandCalibrationCard (per-band merge-rate bars + predictive/ inverted/insufficient verdict, bands only, never raw scores). Backend field covered by operator-dashboard.test; card covered across all-bands, empty-band, inverted, no-data, and absent-field branches.
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5125 +/- ##
==========================================
- Coverage 94.32% 94.31% -0.01%
==========================================
Files 471 471
Lines 39821 39822 +1
Branches 14533 14533
==========================================
Hits 37560 37560
- Misses 1583 1584 +1
Partials 678 678
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-11 17:47:54 UTC
🛑 Suggested Action - Fix Blockers
Review summary Nits — 1 non-blocking
CI checks failing
Flagged checks (non-blocking)
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
What
Adds the slop-band calibration card to the operator analytics dashboard (Closes #2196): predicted slop band vs realized merge/close outcome across resolved PRs — is the deterministic slop score predictive (do higher-slop bands merge less)? Surfaces real data end-to-end (not a display-only stub): the existing, unit-tested
buildSlopOutcomeCalibrationis wired overlistAllPullRequestsinto the dashboard payload, then rendered. Bands only — never raw scores.Changes
Backend (
src/services/operator-dashboard.ts, +12)listAllPullRequests(env)throughbuildSlopOutcomeCalibration(pure, already unit-tested) inside the existingPromise.all, exposingslopCalibration: SlopOutcomeCalibration— org-wide per-band{ sampleSize, merged, closed, mergeRate },overallMergeRate, and adiscriminatesverdict. Fails safe to an empty calibration on any read error.test/unit/operator-dashboard.test.ts(new empty-signal assertion).Frontend
slop-band-calibration-card.tsx(new) —SlopBandCalibrationCard: per-band merge-rate bars (severity-colored) +resolved · merged · closedcounts + a predictive / inverted / insufficient-data verdict pill. ReusesAnalyticsCardShell; graceful empty + absent states.slop-band-calibration-card.test.tsx(new) — 5 tests: all-bands, empty-band (— no samples), inverted, no-resolved-data, absent field.app.analytics.tsx— optionalslopCalibration?on the dashboard type + renders after the findings-breakdown card.Verification
Backend
test/unit/operator-dashboard.test.tsgreen (incl. the new assertion); diff is +207/−0. Card tests + typecheck were green on the identical component in #4813 (which passedvalidate-code,ui:build, and Codecov patch 100%).Screenshots
/app/analytics, populated (predictive: clean 90% → high 0%) and empty, desktop + mobile, light + dark.predictive · light
predictive · dark
mobile
empty · light
empty · dark
mobile
Closes #2196