Skip to content

fix(orb): publish decision-grounded accuracy instead of the reversal rate - #8822

Merged
JSONbored merged 1 commit into
mainfrom
fix/decision-grounded-accuracy
Jul 26, 2026
Merged

fix(orb): publish decision-grounded accuracy instead of the reversal rate#8822
JSONbored merged 1 commit into
mainfrom
fix/decision-grounded-accuracy

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

Makes the homepage "Decision accuracy" tile measure what its label claims. Advances #8820.

Why — the number was structurally inflated, not just missing data

The tile published 1 − reversalRate. That formula overstates the gate's accuracy two independent ways:

  1. The denominator counts hold verdicts. A hold is a deferral to a human — not a decision that can be right or wrong. On the live fleet 2,234 of 6,277 signals (~36%) are holds, dragging the reversal rate toward zero and the published accuracy toward 100 regardless of how the gate actually performed.
  2. The numerator counts only explicit reversal markers. An outright misprediction never registered at all. On the live fleet that hid 213 PRs where the gate said merge and the PR ended up closed, plus 21 where it said close and the PR merged — 234 wrong calls, entirely invisible.

Measured on the real fleet confusion matrix (all three repos ORB runs on):

verdict outcome reversal n
merge merged none 2,580
hold merged none 1,770
close closed none 1,203
hold closed none 464
merge closed none 213
close closed superseded 26
close merged none 21
  • Real decisions (merge/close verdicts): 4,043 — holds excluded
  • Confirmed by outcome: 3,783
  • True decision accuracy: 93.6% — where the retired formula published 99.6%

That ~6-point gap is real errors, not rounding, and it matches the maintainer's direct experience of reversing decisions that the metric never reflected.

How

  • analytics.ts: InstanceMetrics/FleetAnalytics gain decisionAccuracy = (mergeConfirmed + closeConfirmed) / (merge + close verdicts); null for a holds-only instance (a genuine "no signal yet"). The fleet value is the median, matching every other fleet aggregate. reversalRate is kept — the anti-farming detector legitimately uses it — with its doc corrected to say it spans all signals including holds.
  • public-stats.ts: publish decisionAccuracy as fleetAccuracy.accuracyPct. Null still falls back to the own-ledger number exactly as before.
  • UI: the hint now says "merge/close calls confirmed by outcome · N self-hosted instances" instead of naming the retired reversal-grounded formula.

No schema or export change — this is a scoring fix over data already collected.

Verification

  • TSC clean; 63 backend tests + 10 UI tests green.
  • New regression tests assert the exact failure mode: an instance with marker-less mispredictions plus a dominating block of holds scores 80% / 75% on decisionAccuracy where 1 − reversalRate would report a flat 100%.
  • Changed-line coverage: 0 uncovered statements/branches.

Follow-up (not in this PR)

pr_outcome is missing for 40 of 66 PRs carrying a reversal_superseded marker — those PRs are bot-closed on GitHub but never got an outcome row, so they're excluded from the fleet export entirely (inner join). Fixing that will lower the published number further toward its true value. Filing separately.

…rate

The homepage 'Decision accuracy' tile published 1 - reversalRate, which
overstates the gate's real accuracy two independent ways:

  1. DENOMINATOR: reversalRate divides by every fleet signal including
     'hold' verdicts. A hold is a deferral to a human, not a decision
     that can be right or wrong. Holds were ~36% of live fleet signals,
     dragging the rate toward zero and the published number toward 100
     regardless of how the gate actually performed.
  2. NUMERATOR: it counted only explicit reversal markers, so outright
     mispredictions never registered at all -- on the live fleet, 213
     PRs where the gate said merge and the PR ended up closed, plus 21
     where it said close and the PR merged, were entirely invisible.

Measured on live fleet data the two differ by ~6 points: the retired
formula published 99.6% where the gate's real decision accuracy is
93.6% (3,783 of 4,043 merge/close calls confirmed by outcome).

Advances #8820.

- analytics: InstanceMetrics/FleetAnalytics gain decisionAccuracy =
  (mergeConfirmed + closeConfirmed) / (merge + close verdicts), null
  for a holds-only instance; fleet value is the median, matching every
  other fleet aggregate
- public-stats: publish it as fleetAccuracy.accuracyPct
- UI: the hint states what the number measures rather than naming the
  retired formula
@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 7df6643 Commit Preview URL

Branch Preview URL
Jul 26 2026, 09:51 AM

@JSONbored JSONbored self-assigned this Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 35 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
loopover-ui 7.42MB 35 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: loopover-ui

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/add-scalar-classes-9v029Iq-.js (New) 2.17MB 2.17MB 100.0% 🚀
assets/tanstack-vendor-5v1hIzNd.js (New) 801.04kB 801.04kB 100.0% 🚀
assets/docs.fumadocs-spike-api-reference-COTXKAhV.js (New) 442.88kB 442.88kB 100.0% 🚀
assets/AgentScalarChatInterface.vue-CY9TCHde.js (New) 201.71kB 201.71kB 100.0% 🚀
assets/modal-D_FClJNp.js (New) 184.39kB 184.39kB 100.0% 🚀
assets/client-DBRwPBNS.js (New) 146.06kB 146.06kB 100.0% 🚀
assets/maintainer-panel-Bqj8waCF.js (New) 79.0kB 79.0kB 100.0% 🚀
assets/routes-DjcAF0hy.js (New) 35.01kB 35.01kB 100.0% 🚀
assets/owner-panel-sSlItfCN.js (New) 27.46kB 27.46kB 100.0% 🚀
assets/app-CdAtRqPZ.js (New) 25.78kB 25.78kB 100.0% 🚀
assets/ui-vendor-B7IsF9b0.js (New) 22.28kB 22.28kB 100.0% 🚀
assets/miner-panel-4gsR2oTm.js (New) 20.24kB 20.24kB 100.0% 🚀
assets/app.runs-qBHnmQ-G.js (New) 20.22kB 20.22kB 100.0% 🚀
assets/api._op-D0LAItI-.js (New) 17.57kB 17.57kB 100.0% 🚀
assets/self-hosting-docs-audit-BC515Ukn.js (New) 16.6kB 16.6kB 100.0% 🚀
assets/docs._slug-BnD8xXTM.js (New) 15.37kB 15.37kB 100.0% 🚀
assets/playground-panel-DnBTkLda.js (New) 14.43kB 14.43kB 100.0% 🚀
assets/fairness-lYXSmp8h.js (New) 10.6kB 10.6kB 100.0% 🚀
assets/app.audit-BhlqqP5E.js (New) 10.08kB 10.08kB 100.0% 🚀
assets/app.config-generator-CxT03cvG.js (New) 10.06kB 10.06kB 100.0% 🚀
assets/maintainers-DHmCPlLj.js (New) 8.06kB 8.06kB 100.0% 🚀
assets/miners-DJ9X9aHW.js (New) 7.91kB 7.91kB 100.0% 🚀
assets/agents-C9m4ngwV.js (New) 7.74kB 7.74kB 100.0% 🚀
assets/commands-panel-DViKp3Ax.js (New) 6.65kB 6.65kB 100.0% 🚀
assets/maintainer-workflow-5wSeuGAR.js (New) 6.52kB 6.52kB 100.0% 🚀
assets/digest-panel-C_t_F4sl.js (New) 6.15kB 6.15kB 100.0% 🚀
assets/repos._owner._repo.quality-CybLu4E_.js (New) 6.14kB 6.14kB 100.0% 🚀
assets/docs-nav-Cuu_osWp.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/docs.index-BBNA--De.js (New) 5.95kB 5.95kB 100.0% 🚀
assets/api.index-DGCKj6bA.js (New) 4.7kB 4.7kB 100.0% 🚀
assets/docs-DE9DVEA6.js (New) 2.7kB 2.7kB 100.0% 🚀
assets/api-CpTYVRIa.js (New) 2.69kB 2.69kB 100.0% 🚀
assets/docs-page-B6YITT9D.js (New) 2.1kB 2.1kB 100.0% 🚀
assets/table-DBlzg3iM.js (New) 1.75kB 1.75kB 100.0% 🚀
assets/app.workbench-BNFBHI8E.js (New) 1.58kB 1.58kB 100.0% 🚀
assets/tabs-nQkRDW0D.js (New) 1.39kB 1.39kB 100.0% 🚀
assets/app.repos-BzPAA0QV.js (New) 1.07kB 1.07kB 100.0% 🚀
assets/input-DocgUPyO.js (New) 796 bytes 796 bytes 100.0% 🚀
assets/file-cog-Ch__qhYD.js (New) 758 bytes 758 bytes 100.0% 🚀
assets/app.maintainer-Ds0MoqX6.js (New) 502 bytes 502 bytes 100.0% 🚀
assets/app.owner-DjIk7bb1.js (New) 474 bytes 474 bytes 100.0% 🚀
assets/app.commands-UKQQjdTD.js (New) 455 bytes 455 bytes 100.0% 🚀
assets/app.playground-CszAlFoq.js (New) 442 bytes 442 bytes 100.0% 🚀
assets/index-DsrosCTu.js (New) 438 bytes 438 bytes 100.0% 🚀
assets/app.digest-uWvPe71B.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/eye-off-BmU7Te_I.js (New) 430 bytes 430 bytes 100.0% 🚀
assets/app.miner-Bk9lybwz.js (New) 422 bytes 422 bytes 100.0% 🚀
assets/key-round-b2QxGj_x.js (New) 355 bytes 355 bytes 100.0% 🚀
assets/bot-BB933jel.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/trash-2-BGhxcGc8.js (New) 328 bytes 328 bytes 100.0% 🚀
assets/save-ADxDA_Pq.js (New) 327 bytes 327 bytes 100.0% 🚀
assets/git-pull-request-arrow-Cs6eu-JT.js (New) 321 bytes 321 bytes 100.0% 🚀
assets/list-checks-DSRSUa4O.js (New) 279 bytes 279 bytes 100.0% 🚀
assets/compass-BaXk_V0D.js (New) 251 bytes 251 bytes 100.0% 🚀
assets/history-uW9L2sjT.js (New) 237 bytes 237 bytes 100.0% 🚀
assets/message-square-CEQlEFKJ.js (New) 233 bytes 233 bytes 100.0% 🚀
assets/lock-BRqjseaE.js (New) 206 bytes 206 bytes 100.0% 🚀
assets/rotate-cw-BvClLJAC.js (New) 201 bytes 201 bytes 100.0% 🚀
assets/play-DuphvmFm.js (New) 190 bytes 190 bytes 100.0% 🚀
assets/circle-check-CebWLXf-.js (New) 178 bytes 178 bytes 100.0% 🚀
assets/search-Dhv5M6_9.js (New) 174 bytes 174 bytes 100.0% 🚀
assets/add-scalar-classes-qxEJdb3r.js (Deleted) -2.17MB 0 bytes -100.0% 🗑️
assets/tanstack-vendor-Va8bb9fc.js (Deleted) -801.04kB 0 bytes -100.0% 🗑️
assets/docs.fumadocs-spike-api-reference-B_7ZaDUQ.js (Deleted) -442.88kB 0 bytes -100.0% 🗑️
assets/AgentScalarChatInterface.vue-BVR1N0ux.js (Deleted) -201.71kB 0 bytes -100.0% 🗑️
assets/modal-BMDOWcHN.js (Deleted) -184.39kB 0 bytes -100.0% 🗑️
assets/client-CvW-R3v3.js (Deleted) -146.06kB 0 bytes -100.0% 🗑️
assets/maintainer-panel-CtJ1cqHW.js (Deleted) -79.0kB 0 bytes -100.0% 🗑️
assets/routes-CQZp8yFh.js (Deleted) -34.98kB 0 bytes -100.0% 🗑️
assets/owner-panel-CzLH4yEg.js (Deleted) -27.46kB 0 bytes -100.0% 🗑️
assets/app-BfFNSFtF.js (Deleted) -25.78kB 0 bytes -100.0% 🗑️
assets/ui-vendor-C2brpUR-.js (Deleted) -22.28kB 0 bytes -100.0% 🗑️
assets/miner-panel-Bf_ZCwIs.js (Deleted) -20.24kB 0 bytes -100.0% 🗑️
assets/app.runs-C5YEarEs.js (Deleted) -20.22kB 0 bytes -100.0% 🗑️
assets/api._op-BxMIBcp5.js (Deleted) -17.57kB 0 bytes -100.0% 🗑️
assets/self-hosting-docs-audit-Cao8xq9Y.js (Deleted) -16.6kB 0 bytes -100.0% 🗑️
assets/docs._slug-KCmxeUrY.js (Deleted) -15.37kB 0 bytes -100.0% 🗑️
assets/playground-panel-DUrODfMs.js (Deleted) -14.43kB 0 bytes -100.0% 🗑️
assets/fairness-Djlgk-WX.js (Deleted) -10.6kB 0 bytes -100.0% 🗑️
assets/app.audit-BgvlQ_gU.js (Deleted) -10.08kB 0 bytes -100.0% 🗑️
assets/app.config-generator-B2Ow2GEL.js (Deleted) -10.06kB 0 bytes -100.0% 🗑️
assets/maintainers-Dl0NXTej.js (Deleted) -8.06kB 0 bytes -100.0% 🗑️
assets/miners-DZCX7-vS.js (Deleted) -7.91kB 0 bytes -100.0% 🗑️
assets/agents-QMsOsnkP.js (Deleted) -7.74kB 0 bytes -100.0% 🗑️
assets/commands-panel-DslTZca6.js (Deleted) -6.65kB 0 bytes -100.0% 🗑️
assets/maintainer-workflow-DQ0Vxbs4.js (Deleted) -6.52kB 0 bytes -100.0% 🗑️
assets/digest-panel-CbDH2AC-.js (Deleted) -6.15kB 0 bytes -100.0% 🗑️
assets/repos._owner._repo.quality-UpmnptL2.js (Deleted) -6.14kB 0 bytes -100.0% 🗑️
assets/docs-nav-D3oJKviA.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/docs.index-Bh5z_KoU.js (Deleted) -5.95kB 0 bytes -100.0% 🗑️
assets/api.index-CuaRzald.js (Deleted) -4.7kB 0 bytes -100.0% 🗑️
assets/docs-CfRG9Rlo.js (Deleted) -2.7kB 0 bytes -100.0% 🗑️
assets/api-CTgljJ-o.js (Deleted) -2.69kB 0 bytes -100.0% 🗑️
assets/docs-page-BzIDqFMz.js (Deleted) -2.1kB 0 bytes -100.0% 🗑️
assets/table-DJ1wUX_y.js (Deleted) -1.75kB 0 bytes -100.0% 🗑️
assets/app.workbench-kLTCQWl-.js (Deleted) -1.58kB 0 bytes -100.0% 🗑️
assets/tabs-owhVuLpJ.js (Deleted) -1.39kB 0 bytes -100.0% 🗑️
assets/app.repos-C0ZGMW93.js (Deleted) -1.07kB 0 bytes -100.0% 🗑️
assets/input-Bnr2Vt3Y.js (Deleted) -796 bytes 0 bytes -100.0% 🗑️
assets/file-cog-B81Y0tKr.js (Deleted) -758 bytes 0 bytes -100.0% 🗑️
assets/app.maintainer-BJqc_i2E.js (Deleted) -502 bytes 0 bytes -100.0% 🗑️
assets/app.owner-uJYvmNLY.js (Deleted) -474 bytes 0 bytes -100.0% 🗑️
assets/app.commands-BP7nLFNM.js (Deleted) -455 bytes 0 bytes -100.0% 🗑️
assets/app.playground-DNkVHmZI.js (Deleted) -442 bytes 0 bytes -100.0% 🗑️
assets/index-C0m_WekU.js (Deleted) -438 bytes 0 bytes -100.0% 🗑️
assets/app.digest-CltxMIkk.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/eye-off-rqvu6b_D.js (Deleted) -430 bytes 0 bytes -100.0% 🗑️
assets/app.miner-2BfT9kXx.js (Deleted) -422 bytes 0 bytes -100.0% 🗑️
assets/key-round-qNjCNgoW.js (Deleted) -355 bytes 0 bytes -100.0% 🗑️
assets/bot-BOf6qWqW.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/trash-2-Clv5AXmR.js (Deleted) -328 bytes 0 bytes -100.0% 🗑️
assets/save-BRRvARCk.js (Deleted) -327 bytes 0 bytes -100.0% 🗑️
assets/git-pull-request-arrow-ZtQ2Y4eL.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/list-checks-BD5NOSxz.js (Deleted) -279 bytes 0 bytes -100.0% 🗑️
assets/compass-BPohPsHn.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/history-C16AJsCN.js (Deleted) -237 bytes 0 bytes -100.0% 🗑️
assets/message-square-Pfmt0v-9.js (Deleted) -233 bytes 0 bytes -100.0% 🗑️
assets/lock-DTCDrcpY.js (Deleted) -206 bytes 0 bytes -100.0% 🗑️
assets/rotate-cw-C9G4o8kY.js (Deleted) -201 bytes 0 bytes -100.0% 🗑️
assets/play-Dehp-zBF.js (Deleted) -190 bytes 0 bytes -100.0% 🗑️
assets/circle-check-DpnnsGe2.js (Deleted) -178 bytes 0 bytes -100.0% 🗑️
assets/search-MlO75wtO.js (Deleted) -174 bytes 0 bytes -100.0% 🗑️

@JSONbored

Copy link
Copy Markdown
Owner Author

Correction to the 93.6% figure in this PR's description.

The scoring fix here is right and stands — accuracy must score merge/close decisions confirmed by outcome, not 1 − reversalRate. But the number 93.6% is itself distorted, in the opposite direction, by a second instrumentation bug found afterward (#8825).

The merge → closed class (213) is not all real false positives. The recorded gate_decision can contradict the action the bot actually took: on #5861 the bot closed for "CI is failing" at 20:23:31, then wrote a gate_decision of merge at 20:23:44 — 13 seconds after the close. Calibration reads the latest verdict, so it scores that PR as a merge prediction that ended closed, when the gate actually decided close and was right.

Measured across that class (n=210): 84 were bot-closed, 59 have their verdict timestamped after the close. The remaining 126 were human-closed despite a merge verdict — those are genuine disagreements and a real signal.

So the honest reading today is a range, roughly 93.6%–95.6%, with 93.6% as the lower bound. A single trustworthy figure needs #8823 (reversals under-counted → biases up) and #8825 (contradictory verdicts → bias down) both fixed. This PR remains the correct denominator/numerator definition; the value it reports gets trustworthy once those land.

@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.28%. Comparing base (f84ab1d) to head (7df6643).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8822      +/-   ##
==========================================
- Coverage   93.83%   92.28%   -1.55%     
==========================================
  Files         800      800              
  Lines       79831    79832       +1     
  Branches    24196    24197       +1     
==========================================
- Hits        74908    73676    -1232     
- Misses       3558     5092    +1534     
+ Partials     1365     1064     -301     
Flag Coverage Δ
backend 92.96% <100.00%> (-2.16%) ⬇️

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

Files with missing lines Coverage Δ
src/orb/analytics.ts 100.00% <100.00%> (ø)
src/review/public-stats.ts 98.75% <100.00%> (-0.04%) ⬇️

... and 3 files with indirect coverage changes

@JSONbored
JSONbored merged commit 4d6584d into main Jul 26, 2026
11 checks passed
@JSONbored
JSONbored deleted the fix/decision-grounded-accuracy branch July 26, 2026 10:04
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 26, 2026
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.

1 participant