fix(review): split unrecognized human-override verdicts out of confirmed - #9916
Conversation
Both loadPublicRulePrecision (the public /v1/public/stats surface) and loadOverrideDayRows (the operator calibration trend) folded any override row whose $.verdict was missing, malformed, or any string other than 'reversed' into the confirmation side: the public reader took decided as COUNT(*) and derived confirmed = decided - reversed, and the trend reader's CASE only distinguished 'reversed' from everything-else. A schema-drifted or corrupt row therefore inflated the published precision toward 100% while also padding decided past the publication sample floor -- exactly backwards for the one surface whose job is to state how often the gate's rules are right. loadBacktestRunDayRows in the same trend file already handles this shape for backtest verdicts, with an explicit third CASE bucket and a comment stating the rule: a row with a missing/unrecognized verdict must stay visible rather than vanish into whichever bucket is convenient. Mirror that pattern for override rows in both readers: classify confirmed/reversed/unrecognized as three separate SQL sums, derive decided as confirmed + reversed only, and add a required unrecognized count to PublicRulePrecisionRow and CalibrationRuleTrendWeek so a malformed row shows up as a data-quality signal instead of being silently absorbed. Regenerated the shared contract schema and the UI's openapi.json for the new field. buildEvalScoreRecordsFromRulePrecision keeps reading decided/confirmed unchanged and does not gain an unrecognized field, per JSONbored#9215's fixed record shape. Named regression tests pin the previously-wrong numbers on both surfaces: 9 confirmed + 1 reversed + 5 unrecognized-verdict rows now reports decided: 10, confirmed: 9, unrecognized: 5, precision: 0.9 (was decided: 15, confirmed: 14, precision: 0.933) on the public surface, and the equivalent split on the weekly trend.
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-29 22:49:11 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9916 +/- ##
==========================================
+ Coverage 79.52% 79.54% +0.02%
==========================================
Files 281 284 +3
Lines 58577 58660 +83
Branches 6833 6845 +12
==========================================
+ Hits 46581 46664 +83
Misses 11706 11706
Partials 290 290
Flags with carried forward coverage won't be shown. Click here to find out more.
|


fix(review): split unrecognized human-override verdicts out of confirmed
Both loadPublicRulePrecision (the public /v1/public/stats surface) and
loadOverrideDayRows (the operator calibration trend) folded any override row
whose $.verdict was missing, malformed, or any string other than 'reversed'
into the confirmation side: the public reader took decided as COUNT(*) and
derived confirmed = decided - reversed, and the trend reader's CASE only
distinguished 'reversed' from everything-else. A schema-drifted or corrupt
row therefore inflated the published precision toward 100% while also
padding decided past the publication sample floor -- exactly backwards for
the one surface whose job is to state how often the gate's rules are right.
loadBacktestRunDayRows in the same trend file already handles this shape for
backtest verdicts, with an explicit third CASE bucket and a comment stating
the rule: a row with a missing/unrecognized verdict must stay visible rather
than vanish into whichever bucket is convenient. Mirror that pattern for
override rows in both readers: classify confirmed/reversed/unrecognized as
three separate SQL sums, derive decided as confirmed + reversed only, and
add a required unrecognized count to PublicRulePrecisionRow and
CalibrationRuleTrendWeek so a malformed row shows up as a data-quality
signal instead of being silently absorbed.
Regenerated the shared contract schema and the UI's openapi.json for the new
field. buildEvalScoreRecordsFromRulePrecision keeps reading decided/confirmed
unchanged and does not gain an unrecognized field, per #9215's fixed record
shape.
Named regression tests pin the previously-wrong numbers on both surfaces:
9 confirmed + 1 reversed + 5 unrecognized-verdict rows now reports
decided: 10, confirmed: 9, unrecognized: 5, precision: 0.9 (was decided: 15,
confirmed: 14, precision: 0.933) on the public surface, and the equivalent
split on the weekly trend.
Closes #9640
Validation
Verified locally on this branch before opening:
npm run typechecknpx turbo run build:tsc build:verifynpm run test:coverage— patch coverage 100.0% of changed lines