Skip to content

feat(analytics): surface org-wide slop-band calibration + dashboard card (#2196)#5125

Closed
dhgoal wants to merge 1 commit into
JSONbored:mainfrom
dhgoal:feat/analytics-slop-band-v2
Closed

feat(analytics): surface org-wide slop-band calibration + dashboard card (#2196)#5125
dhgoal wants to merge 1 commit into
JSONbored:mainfrom
dhgoal:feat/analytics-slop-band-v2

Conversation

@dhgoal

@dhgoal dhgoal commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

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 buildSlopOutcomeCalibration is wired over listAllPullRequests into the dashboard payload, then rendered. Bands only — never raw scores.

Reworked from #4813 with its review feedback fully addressed:

  • Diff-tight backend — the operator-dashboard.ts change is now +12/−0 (no whole-file reformatting churn); only the real feature lines.
  • Fail-safe on read error — the new read .catch(() => buildSlopOutcomeCalibration([])), mirroring the sibling computeGateEval/cycleTime reads, so one DB hiccup can never fail the whole dashboard.

Changes

Backend (src/services/operator-dashboard.ts, +12)

  • Fold listAllPullRequests(env) through buildSlopOutcomeCalibration (pure, already unit-tested) inside the existing Promise.all, exposing slopCalibration: SlopOutcomeCalibration — org-wide per-band { sampleSize, merged, closed, mergeRate }, overallMergeRate, and a discriminates verdict. Fails safe to an empty calibration on any read error.
  • Covered by 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 · closed counts + a predictive / inverted / insufficient-data verdict pill. Reuses AnalyticsCardShell; 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 — optional slopCalibration? on the dashboard type + renders after the findings-breakdown card.

Verification

Backend test/unit/operator-dashboard.test.ts green (incl. the new assertion); diff is +207/−0. Card tests + typecheck were green on the identical component in #4813 (which passed validate-code, ui:build, and Codecov patch 100%).

Screenshots

/app/analytics, populated (predictive: clean 90% → high 0%) and empty, desktop + mobile, light + dark.

State Desktop (light) Desktop (dark) Mobile
Populated
predictive · light

predictive · dark

mobile
Empty
empty · light

empty · dark

mobile

Closes #2196

…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.
@dhgoal dhgoal requested a review from JSONbored as a code owner July 11, 2026 17:42
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 11, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.31%. Comparing base (a416632) to head (75b3184).

Files with missing lines Patch % Lines
src/services/operator-dashboard.ts 0.00% 1 Missing ⚠️
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              
Flag Coverage Δ
shard-1 46.34% <0.00%> (-0.01%) ⬇️
shard-2 34.40% <0.00%> (-0.26%) ⬇️
shard-3 31.27% <0.00%> (+0.28%) ⬆️
shard-4 32.74% <0.00%> (-0.14%) ⬇️
shard-5 33.42% <0.00%> (-0.23%) ⬇️
shard-6 45.18% <0.00%> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/services/operator-dashboard.ts 96.15% <0.00%> (-3.85%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gittensory-orb gittensory-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 11, 2026
@gittensory-orb

gittensory-orb Bot commented Jul 11, 2026

Copy link
Copy Markdown

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-11 17:47:54 UTC

5 files · no blockers · readiness 100/100 · CI failing · unstable

🛑 Suggested Action - Fix Blockers

  • AI review already in progress for this PR head: Another Gittensory pass is already running the AI review for this exact PR head. This pass is skipping to avoid a duplicate LLM call.

Review summary
AI review is already running for this PR head in another Gittensory pass. Gittensory is holding this PR for manual review until that pass completes.

Nits — 1 non-blocking
  • AI review already in progress for this PR head — The gate is held for a human reviewer rather than passed automatically; it re-evaluates once the in-flight review completes or on the next update.

CI checks failing

  • codecov/patch — 0.00% of diff hit (target 99.00%)
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review
Signal Result Evidence
Code review ✅ No blockers No AI review summary
Linked issue ✅ Linked #2196
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 101 registered-repo PR(s), 62 merged, 14 issue(s).
Contributor context ✅ Confirmed Gittensor contributor dhgoal; Gittensor profile; 101 PR(s), 14 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: dhgoal
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 101 PR(s), 14 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask 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.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/app/analytics desktop before /app/analytics after /app/analytics
/app/analytics mobile before /app/analytics (mobile) after /app/analytics (mobile)

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.

  • Re-run Gittensory review

@gittensory-orb

Copy link
Copy Markdown

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.

@gittensory-orb gittensory-orb Bot closed this Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ui): slop-band calibration card on the analytics dashboard

1 participant