Skip to content

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

Closed
andriypolanski wants to merge 1 commit into
JSONbored:mainfrom
andriypolanski:feat/ui-slop-band-calibration-card-2196
Closed

feat(ui): slop-band calibration card on the analytics dashboard (#2196)#4719
andriypolanski wants to merge 1 commit into
JSONbored:mainfrom
andriypolanski:feat/ui-slop-band-calibration-card-2196

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Closes #2196

Summary

Adds a read-only Slop-band calibration card to /app/analytics showing predicted slop band vs realized merge/close outcomes from the stats feed. Extends StatsPayload and the operator dashboard with fleet-wide slopBandCalibration aggregates (bands only — never raw slop scores).

Part of #1967.

Changes

Area Change
src/review/stats.ts SlopOutcomeCalibration on StatsPayload; computeSlopBandCalibrationAggregate()
src/services/operator-dashboard.ts Surface slopBandCalibration on operator dashboard payload
apps/gittensory-ui/src/components/site/app-panels/slop-band-calibration-card-model.ts UI types + band label / merge-rate formatters
apps/gittensory-ui/src/components/site/app-panels/slop-band-calibration-card.tsx Per-band Stat rows + MiniSparkbar outcome split
apps/gittensory-ui/src/routes/app.analytics.tsx Wire card beside gate precision / cycle time
Tests slop-band-calibration-card.test.tsx, stats.test.ts, operator-dashboard.test.ts

UI Evidence

Required before opening the PR — upload screenshots via GitHub drag-and-drop (do not commit images):

Page / Feature Before After
/app/analytics image image

Test plan

  • SlopBandCalibrationCard — all bands present
  • SlopBandCalibrationCard — one empty band (em dash)
  • SlopBandCalibrationCard — no-data empty state + discriminates ternary arms
  • computeSlopBandCalibrationAggregate — seeded PR bands + fail-safe empty
  • Operator dashboard payload includes empty slopBandCalibration
  • npm run ui:testslop-band-calibration-card.test.tsx (5/5)
  • npm run ui:typecheck
  • npm run test:unit -- test/unit/stats.test.ts test/unit/operator-dashboard.test.ts (51/51)
  • Manual: sign in as operator, open /app/analytics, confirm card renders with band labels only
  • Before/after screenshots uploaded to PR (required — issue is visual)

Notes

  • Issue is labeled visual (owner-led). Confirm eligibility before opening a contributor PR.
  • Public/private boundary: card shows band labels, counts, and merge rates only — no raw slopRisk or credibility scores.
  • Card uses the same operator-dashboard fetch path as GatePrecisionCard and CycleTimeCard.

@andriypolanski
andriypolanski marked this pull request as draft July 10, 2026 19:54
@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-10 20:44:17 UTC

8 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · dirty

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): src/services/operator-dashboard.ts (matched src/services/**).

Review summary
Adds a fully-wired, read-only slop-band calibration card: schema on StatsPayload, an operator-dashboard aggregate, and a UI card gated behind a hasSamples/discriminates tri-state. Wiring is complete end-to-end (stats.ts → operator-dashboard.ts → app.analytics.tsx, both the Promise.all fetch and the returned payload object are updated in each file), and the fail-safe empty-aggregate pattern mirrors the existing cycle-time aggregate exactly, including matching test coverage for the D1-down and NaN-days paths. The one real design smell is that computeSlopBandCalibrationAggregate loads every fleet PR via listAllPullRequests and filters the date window in JS, unlike every sibling aggregate in this file which pushes the window into SQL.

Nits — 6 non-blocking
  • src/review/stats.ts:308-320 — computeSlopBandCalibrationAggregate pulls the whole fleet's PR history via listAllPullRequests(env) and filters to the window in JS, while every neighboring aggregate (computeCycleTimeAggregate, computeStats' decision/reversal queries) pushes the date filter into SQL; as PR history grows this becomes the most expensive call in the stats/operator-dashboard Promise.all — worth a WHERE-bounded repository query instead.
  • apps/gittensory-ui/src/components/site/app-panels/slop-band-calibration-card.tsx:12-26 — the statusTone/statusLabel derivation is inlined in the component instead of following the formatSlopBandLabel/formatMergeRate pattern already established in slop-band-calibration-card-model.ts; pulling it into the model file would keep the component thin and testable without a DOM render.
  • apps/gittensory-ui/src/components/site/app-panels/slop-band-calibration-card-model.ts:3 — SlopBand ('clean'|'low'|'elevated'|'high') is a hand-maintained UI mirror of the backend SlopOutcomeCalibration bands with no shared source of truth; if the backend adds/renames a band this silently produces an unlabeled row instead of a type error.
  • src/review/stats.ts:326-327 — the 730/90/86_400_000 magic numbers duplicate the same literals already used verbatim in computeCycleTimeAggregate a few lines up; a shared MAX_STATS_WINDOW_DAYS constant would remove the duplication now that there are two copies.
  • Confirm src/services/outcome-calibration.ts's buildSlopOutcomeCalibration only aggregates band-level counts and never threads a raw slopRisk value through to SlopOutcomeCalibration — the PR's core privacy claim ('bands only — never raw slop scores') lives entirely in that file, which isn't part of this diff.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
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: 141 registered-repo PR(s), 90 merged, 25 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 141 PR(s), 25 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: andriypolanski
  • 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: 141 PR(s), 25 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.
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

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.14%. Comparing base (96c158f) to head (8b9ec1e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4719   +/-   ##
=======================================
  Coverage   94.14%   94.14%           
=======================================
  Files         437      437           
  Lines       38561    38574   +13     
  Branches    14058    14063    +5     
=======================================
+ Hits        36304    36317   +13     
  Misses       1599     1599           
  Partials      658      658           
Files with missing lines Coverage Δ
src/review/stats.ts 99.18% <100.00%> (+0.09%) ⬆️
src/services/operator-dashboard.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb

loopover-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR). 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.

@loopover-orb loopover-orb Bot closed this Jul 10, 2026
minion1227 pushed a commit to minion1227/gittensory that referenced this pull request Jul 10, 2026
…#4406)

passedValidationCount previously came only from a PR-body prose match, with
no connection to the PR's real CI results, and no bot-author exemption
existed anywhere in this deterministic gate path — confirmed false positive
on JSONbored/awesome-claude PR JSONbored#4719 (a CI-green, github-actions[bot]
README-regen PR flagged as missing test evidence). Now also consults the
PR's live CI state (a fully-green rollup counts as evidence) and exempts
authors matching review.auto_review.ignore_authors, mirroring the existing
AI-review skip.

Closes JSONbored#4401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

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

2 participants