You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(ui): document the backtest/calibration system as a fumadocs page (#8114) (#8153)
#8138 (threshold backtest, shipped ORB-native in #8142) and #8139 (logic
backtest CI check, shipped in #8147) are exactly the #3047 failure shape --
new CLI flags, a new CI check with its own trigger/comment behavior, a
gate-adjacent pending policy decision (#8105) -- with no docs. Adds
content/docs/backtest-calibration.mdx (corpus model, the two backtest
mechanisms and why they run where they run, how to read the Pareto-floor
comparison, secret_leak's permanent exclusion, the track-record/corpus-export
CLIs, and the advisory-only guarantee with #8105 noted as pending) plus the
thin route, nav/command-palette entries, and the regenerated route tree.
The two pinned docs-route-count tests move 48 -> 49.
description: How LoopOver measures whether its own review rules are right — and backtests threshold and logic changes against real history before they ship.
4
+
---
5
+
6
+
## What this is
7
+
8
+
Every time a configured gate blocker fires, LoopOver records it. Every time a human later
9
+
overrides that call (or confirms it), LoopOver records that too. Paired together, the two
10
+
histories become a labeled corpus: _this rule fired against this PR, and a person later said it
11
+
was right ("confirmed") or wrong ("reversed")_.
12
+
13
+
That corpus makes a rule change **testable before it merges**. A PR that tunes a confidence
14
+
threshold or rewrites detection logic gets scored against the real recorded history — the same
15
+
targets, the same raw inputs — instead of being eyeballed.
16
+
17
+
<Calloutvariant="note">
18
+
Everything on this page is advisory-only today. A backtest verdict — even a regression — never
19
+
blocks a merge. Whether a REGRESSED verdict should ever gate merges is a tracked, deliberately
20
+
separate decision that waits for real production track-record data.
21
+
</Callout>
22
+
23
+
## The corpus
24
+
25
+
-**Fired events** — recorded when a configured blocker actually carries gate authority, with
26
+
bounded raw context: the issue text, PR title/body, and diff the rule evaluated, and (for the
27
+
AI-judgment rule `linked_issue_scope_mismatch`) the model's own raw response text.
28
+
-**Override events** — recorded when a human reverses an automated call, or confirms one (for
29
+
example, an owner closing a PR that was held for low AI confidence confirms the hold).
30
+
-**`secret_leak` is permanently excluded from raw-context capture.** Storing the diff that
31
+
triggered a leaked-credential finding would store the credential itself in the audit trail.
32
+
This rule can therefore never be logic-backtested — by design, not omission.
33
+
34
+
## Two backtests, two mechanisms
35
+
36
+
**Threshold changes** run inside LoopOver's own review pass. When a PR's diff changes a known
37
+
confidence-threshold constant, the old and new values are replayed as classifiers over the
38
+
rule's recorded history, and the comparison is rendered directly into the unified review
39
+
comment. No code from the PR is ever executed — a threshold is just a number.
40
+
41
+
**Logic/regex changes** run in a dedicated CI workflow instead, because honestly verifying a
42
+
rewritten detection function requires _executing the PR's own code_ against history — something
43
+
the production review service must never do. The workflow checks out both the PR's head and its
44
+
base, replays each recorded case's captured raw context through both versions of the detection
45
+
function, and posts its own clearly-labeled **"Logic backtest"** PR comment, separate from the
46
+
unified review comment. It triggers only for PRs touching the watched detection-logic paths,
47
+
skips drafts and forks (fork runs get no secrets), and fails open: an infrastructure problem
48
+
produces a skip notice, never a red check.
49
+
50
+
## Reading the comparison
51
+
52
+
Both backtests score the same way:
53
+
54
+
-**"Reversed" is the positive class.** A classifier predicting "reversed" is saying the rule's
55
+
original firing was wrong. Precision and recall are computed against the human labels, and
56
+
stay `N/A` when there is not enough decided data — unknown is never coerced to zero.
57
+
-**The Pareto floor decides the verdict.** A candidate that regresses on _any_ axis is
58
+
**REGRESSED**, even if the other axis improved. Trading precision for recall is a regression,
59
+
not a net win. Otherwise the verdict is _improved_ (some axis moved up) or _unchanged_.
60
+
- Cases recorded before raw-context capture existed are skipped and counted in the comment —
61
+
replaying them against empty inputs would bias both sides, so they are never scored.
62
+
63
+
## The track record
64
+
65
+
Every backtest run persists its comparison as structured audit data. The accumulated record —
66
+
how often runs regress, per rule — is the evidence base for the pending merge-gating decision,
"How LoopOver measures whether its own review rules are right, and backtests threshold and logic changes against real recorded history before they ship.",
"How LoopOver measures whether its own review rules are right, and backtests threshold and logic changes against real recorded history before they ship.",
0 commit comments