fix(stats): measure accuracy over auto-actioned PRs, not every reviewed PR - #9793
Conversation
…ed PR Live after both #9718 and #9768 deployed: byProject still published 100% for all three repos, on 2377/602/508 reviewed PRs with zero reversals. Neither earlier fix could have caught it. Both addressed the WINDOW the denominator covers -- #9718 withheld the ratio where a reversal was unobservable, #9768 bounded an immortal denominator to its numerator's retention -- and the defect is WHICH PRs belong in it. A reversal is by definition a human overturning an engine auto-action; recordReversalSignals only records one against a PR the engine merged or closed. The denominator was `github_app.pr_public_surface_published`: every PR that got a review surface, including the many the engine only commented on, held, or advised. None of those could produce a reversal, so each one pushes 1 - reversed/decided toward 100% for reasons unrelated to gate quality. Both surfaces now divide by the distinct PRs this deployment auto-actioned in the window -- same event types, same outcome filter, same dry-run exclusion that loadReversalDayRows already applies when anchoring the numerator, so the two halves of the ratio are finally drawn from one population. The weekly trend had the same mismatch, masked only because its own-ledger series currently reports null for recent weeks; fixing one and not the other would have left two definitions of "decided" on one page. Volume columns are untouched: reviewed/merged/closed keep publishing lifetime and fleet-folded counts, which are measured and correct. Only the ratio's denominator narrows. #9718's observability probe is REMOVED rather than left beside the thing that supersedes it. No auto-actions now means decided is 0 and the answer is null by construction -- a structural guarantee, where the probe was a heuristic that could disagree with the denominator sitting next to it. Six fixtures were made faithful rather than the assertion relaxed: each modelled a decided PR with no auto-action, which is not a reachable state. The clearest is the revert-PR regression, which recorded a reversal_reverted with no agent.action.merge -- a PR cannot be reverted unless the engine merged it. Closes #9792
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-29 10:16:58 UTC
Review summary Nits — 6 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. Decision record
🟩 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 #9793 +/- ##
==========================================
- Coverage 90.30% 89.48% -0.82%
==========================================
Files 913 913
Lines 113595 113587 -8
Branches 26963 26958 -5
==========================================
- Hits 102584 101646 -938
- Misses 9682 10851 +1169
+ Partials 1329 1090 -239
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
Live after both #9718 and #9768 deployed:
Neither earlier fix could have caught this. Both addressed the window the denominator covers — #9718 withheld the ratio where a reversal was unobservable, #9768 bounded an immortal denominator to its numerator's retention. The remaining defect is which PRs belong in it.
A reversal is by definition a human overturning an engine auto-action;
recordReversalSignalsonly ever records one against a PR the engine merged or closed. The denominator wasgithub_app.pr_public_surface_published— every PR that got a review surface, including the many the engine only commented on, held, or advised. None of those could produce a reversal, so each one pushes1 - reversed/decidedtoward 100% for reasons unrelated to gate quality.Closes #9792
The fix
Both surfaces now divide by the distinct PRs this deployment auto-actioned in the window — same event types, same
outcome = 'completed'filter, same dry-run exclusionloadReversalDayRowsalready applies when anchoring the numerator. The two halves of the ratio are finally drawn from one population.The weekly trend had the same mismatch, masked only because its own-ledger series currently reports null for recent weeks. Fixing one and not the other would have left two definitions of "decided" on a single page — the exact thing this surface has been corrected for.
Volume columns are untouched:
reviewed/merged/closedkeep publishing lifetime and fleet-folded counts, which are measured and correct. Only the ratio's denominator narrows.#9718's observability probe is removed, not left beside the thing that supersedes it. No auto-actions now means
decidedis 0 and the answer is null by construction — a structural guarantee, where the probe was a heuristic that could disagree with the denominator sitting next to it.Validation
public-stats.tspublic-accuracy-trend.tstypecheck·ui:typecheck·ui:openapi:check·coverage-boltons·validate:no-hand-written-js·git diff --checkNew regressions pin the live defect directly: a repo with three reviewed-and-merged PRs but no auto-actions now publishes
null, not 100% — withreviewed: 3andmerged: 3still published, since the volume is real. A second pins that a dry-run auto-action never counts, because the numerator's anchor already excludes them and a denominator that didn't would inflate against it.Six fixtures were made faithful rather than the assertion relaxed. Each modelled a decided PR with no auto-action, which is not a reachable state. The clearest is the revert-PR regression: it recorded a
reversal_revertedwith noagent.action.merge, and a PR cannot be reverted unless the engine merged it. The retention-window test from #9768 was also strengthened — its four ancient PRs are now auto-actioned too, so it proves the window excludes them rather than merely that they were never actioned.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.No auth/CORS/session change and no new data in the response —
accuracyPctwas already nullable on the wire, soui:openapi:checkpasses unchanged and an older deployed frontend degrades correctly. No UI file is touched: #9718 already shipped the copy explaining a withheld accuracy, and it now fires for the right reason, hence no UI Evidence table. The queries readaudit_eventsaggregate counts only — no target keys, repos or PR content reach the response, and the existingINVARIANT: the public payload never carries target keys…test still passes.Expected effect in production
The hosted Worker does not execute reviews (#9676), so recent auto-actions are absent or few.
byProjectshould go null or drop to a small honest number instead of asserting 100% across 3,487 PRs. That is the point: an unmeasurable ratio should read as unknown, not as perfect.