Skip to content

feat(orb): publish per-arm precision, coverage, and Wilson intervals with the fleet accuracy - #8839

Merged
JSONbored merged 1 commit into
mainfrom
feat/per-arm-accuracy-surface
Jul 26, 2026
Merged

feat(orb): publish per-arm precision, coverage, and Wilson intervals with the fleet accuracy#8839
JSONbored merged 1 commit into
mainfrom
feat/per-arm-accuracy-surface

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

Every published accuracy figure now carries its per-arm split, the coverage it was earned at, its Wilson 95% interval, and the sample size behind it. Closes #8829 (epic #8828, Phase 1 — the measurement layer everything later phases depend on).

Why

Two structural problems with the bare scalar, both flagged in the epic's research basis:

  1. It is gameable. Holds are correctly excluded from the accuracy denominator (they are deferrals, not decisions) — which means raising the hold rate mechanically raises published accuracy without any quality change. The counter is to publish the coverage alongside: "97% at 40% coverage" and "94% at 85% coverage" are different claims, and now they read differently.
  2. It is unverifiable at small samples. At current volumes the interval around the point estimate is wider than the improvement the tuning roadmap is trying to demonstrate. Wilson intervals (never Wald, which claims impossible certainty exactly where a gate metric lives, near p→1) make the uncertainty visible: 4/5 confirmed renders as 80% with a ~36-96 interval, which is the honest statement.

Per-arm separation matters because the cost structure is asymmetric — a wrong merge costs more than a wrong close — so mergePrecision and closePrecision must be separately visible and separately CI'd ahead of the per-arm Neyman-Pearson thresholds (#8835).

How

  • analytics: InstanceMetrics now carries the raw confusion counts — ratios can be neither pooled across instances (Simpson) nor intervalled. fleet.pooled sums them over eligible instances with coverage = verdicts / (verdicts + holds); policy actions (fix(orb): score enforcement closes as their own class, not quality mispredictions #8827) sit outside both sides. wilsonInterval() is the one shared, pure interval primitive, null on zero trials — no data must render as no claim.
  • public-stats: fleetAccuracy gains mergePrecisionPct/CiPct, closePrecisionPct/CiPct, accuracyCiPct, coveragePct, decidedCount. Pooled and median views coincide exactly with today's single registered instance.
  • UI: the hero hint appends "· at N% coverage"; the field is optional-chained so an older backend degrades to the bare figure.
  • OpenAPI regenerated.

Verification

  • TSC clean; 84 tests across public-stats/analytics/mcp-fleet/operator-dashboard plus 38 analytics tests and 10 UI tests, all green.
  • New property tests pin the Wilson edges: 60/60 does not prove p=1, 0/20 does not prove p=0, more trials tighten, zero trials → null.
  • Pooling test: multi-instance sum with holds and policy actions, unregistered instances excluded.
  • Changed-line coverage: 0 uncovered statements/branches.

…with the fleet accuracy

A bare accuracy scalar at unstated coverage is gameable -- because holds
are (correctly) excluded from the denominator, raising the hold rate
mechanically raises the published number -- and at small samples it is
unverifiable: the interval around it is wider than the difference the
tuning work is trying to demonstrate.

Closes #8829. Part of epic #8828 (Phase 1 -- measurement precedes
labels precedes mechanism).

- analytics: InstanceMetrics carries the raw confusion counts (ratios
  cannot be pooled or intervalled); FleetAnalytics.fleet gains counts
  POOLED over eligible instances plus coverage = verdicts /
  (verdicts + holds), with policy actions outside both sides;
  wilsonInterval() as the one shared interval primitive -- Wilson,
  never Wald, which degenerates exactly where a gate metric lives
- public-stats: fleetAccuracy publishes the per-arm split (a wrong
  merge costs more than a wrong close, so the arms must be separable),
  Wilson 95% intervals on all three proportions, coveragePct, and
  decidedCount -- the denominator a reader needs to judge the claim
- UI: the hero hint names the coverage the figure was earned at;
  older backends omit the field and the tile degrades gracefully
- openapi regenerated
@superagent-security

Copy link
Copy Markdown
Contributor

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

1 similar comment
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 745fbf2 Commit Preview URL

Branch Preview URL
Jul 26 2026, 10:48 AM

@JSONbored JSONbored self-assigned this Jul 26, 2026
@JSONbored
JSONbored merged commit cd2258d into main Jul 26, 2026
6 of 7 checks passed
@JSONbored
JSONbored deleted the feat/per-arm-accuracy-surface branch July 26, 2026 10:51
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.29%. Comparing base (ee5e724) to head (745fbf2).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8839      +/-   ##
==========================================
- Coverage   93.83%   92.29%   -1.55%     
==========================================
  Files         800      800              
  Lines       79851    79879      +28     
  Branches    24203    24209       +6     
==========================================
- Hits        74928    73723    -1205     
- Misses       3558     5092    +1534     
+ Partials     1365     1064     -301     
Flag Coverage Δ
backend 92.97% <100.00%> (-2.15%) ⬇️

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

Files with missing lines Coverage Δ
src/openapi/schemas.ts 100.00% <ø> (ø)
src/orb/analytics.ts 100.00% <100.00%> (ø)
src/review/public-stats.ts 98.87% <100.00%> (+0.12%) ⬆️

... and 3 files with indirect coverage changes

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

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metrics: publish per-arm precision, coverage, and Wilson intervals — retire the bare accuracy scalar

1 participant