Skip to content

feat(ui): gate-precision analytics card (precision + confusion matrix) #2191

Description

@JSONbored

Add a single self-host maintainer analytics card that renders gate precision and the TP/FP/FN/TN confusion matrix already computed by computeGateEval, wired through the existing maintainer-dashboard fetch. One card, read-only over an existing payload — no new compute.

Deliverables

  • New GatePrecisionCard component under apps/gittensory-ui/src/components/site/app-panels/ (or usage-analytics-panels.tsx sibling) taking the GateEvalReport shape from src/review/parity.ts (GateEvalReport/GateEvalRow at parity.ts:33-56)
  • Render precision as a percentage Stat (reuse Stat from control-primitives.tsx:164) plus a 2x2 confusion-matrix grid (TP/FP/FN/TN)
  • Consume it from apps/gittensory-ui/src/routes/app.analytics.tsx alongside the existing WeeklyValueMetricsPanel section
  • StatusPill (control-primitives.tsx:17) for sample-size sufficiency (grey/warn when below a documented floor)
  • Vitest test covering populated report, empty report, and below-floor states (97% branch coverage; test both arms of any ?? / ternary)

References

  • apps/gittensory-ui/src/routes/app.analytics.tsx
  • apps/gittensory-ui/src/components/site/usage-analytics-panels.tsx:39
  • apps/gittensory-ui/src/components/site/control-primitives.tsx:164
  • src/review/parity.ts:33

Part of #1967.


📸 Required: before/after screenshots (this is a UI change)

Non-negotiable. PRs that change UI must include a before/after screenshot table. PRs without it are automatically closed — no exceptions.

Rules:

  • Show every page/feature you changed — before and after, one row each.
  • Use the markdown table below. Screenshots go inside the table only — no large full-size images pasted elsewhere in the PR.
  • Each cell is a clickable thumbnail (a small image linking to the full-size image) with a one-line caption underneath.
  • Upload screenshots to the PR by drag-and-drop (GitHub hosts them on its CDN). Do NOT commit image files to the repo.

Copy this and fill it in (replace FULL_IMAGE_URL with the URL GitHub gives you after you drop the image in):

| Page / Feature | Before | After |
|---|---|---|
| `/your-route` | [<img src="FULL_IMAGE_URL" width="260">](FULL_IMAGE_URL)<br><sub>before: short caption</sub> | [<img src="FULL_IMAGE_URL" width="260">](FULL_IMAGE_URL)<br><sub>after: short caption</sub> |


size: S · held for later release (gittensor:feature once activated)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.visualUI/web visual work — owner-led, NOT for Gittensor contributors (extensions excepted)

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions