feat(review): per-rule (not just per-project) gate-decision precision tracking - #8099
Conversation
… tracking Closes #7984. computeGateEval (parity.ts) scores prediction-vs-ground-truth AGGREGATED PER PROJECT — one systematically wrong deterministic rule (like the 2026-07-21/22 hotkey/coldkey regex bug, #7981) can sit at effectively 0% precision while hiding inside an otherwise-healthy project-wide close-precision number, diluted by every OTHER correct close reason the same project produces. The precision-over-time circuit breaker (auto-tune.ts) can never isolate and react to a single broken rule this way, even in principle. New src/review/rule-gate-eval.ts adds that missing dimension by RE-AGGREGATING data already recorded — review_audit's gate_decision rows already carry a reason code (`summary`) — no new collection pipeline, no new table. Mirrors contributor-gate-eval.ts's own established "new dimension, same fold" pattern exactly: - computeRuleGateEval: per-(project, ruleCode) rows, so a maintainer can see "rule X: 0/4 correct" on one repo even while that repo's own aggregate still looks healthy. - computeBlendedRuleGateEval: the SAME cells pooled ACROSS every project a rule has fired on, volume-weighted — a rule's trustworthiness is a property of the rule, not of any one repo it happened to trip. This is the report #7986 will read. - rulesBelowClosePrecisionFloor: which blended rows have cleared enough sample (>= AUTOTUNE_MIN_DECIDED) but sit below the SAME AUTOTUNE_CLOSE_PRECISION_FLOOR the project-level breaker uses — the exact lookup #7986 needs, and the exact "rule X: 0/4 correct" signal this issue exists to surface. Wired into operator-dashboard.ts (an existing operator-facing read path, #7984's own stated deliverable) as a new "Rules below close-precision floor" metric card, alongside the existing contributor-fairness tiles. Read/reporting only — no gate/disposition decision changes here; that's #7986's job. Validated against a replay of the incident shape (an isolated 0/12-correct rule on an otherwise-healthy project with 20 correct closes on other reasons) at both the per-rule and dashboard levels.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8099 +/- ##
==========================================
- Coverage 92.01% 89.56% -2.45%
==========================================
Files 754 99 -655
Lines 77188 22689 -54499
Branches 23335 3900 -19435
==========================================
- Hits 71021 20322 -50699
+ Misses 5061 2187 -2874
+ Partials 1106 180 -926
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-22 22:40:11 UTC
Review summary Nits — 6 non-blocking
CI checks failing
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. 🟩 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.
|
Closes #7984.
Summary
computeGateEval(parity.ts) scores prediction-vs-ground-truth AGGREGATED PER PROJECT — one systematically wrong deterministic rule (like the 2026-07-21/22 hotkey/coldkey regex bug, Fix bare-word hotkey/coldkey false positives in containsSecretLikeText + static-message redaction bug #7981) can sit at effectively 0% precision while hiding inside an otherwise-healthy project-wide close-precision number, diluted by every OTHER correct close reason the same project produces. The precision-over-time circuit breaker (auto-tune.ts) can never isolate and react to a single broken rule this way, even in principle.src/review/rule-gate-eval.tsadds that missing dimension by RE-AGGREGATING data already recorded —review_audit'sgate_decisionrows already carry a reason code (summary) — no new collection pipeline, no new table. Mirrorscontributor-gate-eval.ts's own established "new dimension, same fold" pattern exactly:computeRuleGateEval: per-(project, ruleCode)rows, so a maintainer can see "rule X: 0/4 correct" on one repo even while that repo's own aggregate still looks healthy.computeBlendedRuleGateEval: the SAME cells pooled ACROSS every project a rule has fired on, volume-weighted — a rule's trustworthiness is a property of the rule, not of any one repo it happened to trip. This is the report Replace the blanket CONCRETE_EVIDENCE_BLOCKER_CODES breaker exemption with a per-rule track record #7986 will read.rulesBelowClosePrecisionFloor: which blended rows have cleared enough sample (>= AUTOTUNE_MIN_DECIDED) but sit below the SAMEAUTOTUNE_CLOSE_PRECISION_FLOORthe project-level breaker uses — the exact lookup Replace the blanket CONCRETE_EVIDENCE_BLOCKER_CODES breaker exemption with a per-rule track record #7986 needs, and the exact "rule X: 0/4 correct" signal this issue exists to surface.operator-dashboard.ts(an existing operator-facing read path — Per-rule (not just per-project) precision tracking in the gate-eval pipeline #7984's own stated deliverable) as a new "Rules below close-precision floor" metric card, alongside the existing contributor-fairness tiles.Test plan
npm run typechecktest/unit/rule-gate-eval.test.ts(28 cases, 100% statement/line/function coverage — the 2 remaining untested branches mirrorcomputeGateEval's own identical, equally-untested "unmatched truth value" defensive branch): fold correctness, incident replay at both per-rule and blended levels, reversal-discount parity, sort order, source/minerOnly scoping, D1 fail-safe, realreview_auditintegration reads,rulesBelowClosePrecisionFloor's sample/floor gatingoperator-dashboard.test.tscase: end-to-end replay of an isolated 0/12-correct rule on an otherwise-healthy project (20 correct closes on a different reason) surfacing correctly on the new dashboard card, with the healthy rule's code never appearing anywhere in the payloadnpm run test:coverage: 1093/1093 files, 20416 tests, 0 failuresnpm run engine-parity:drift-check: clean, no version bump needed