Precision and performance
How often CodeVeto's rules fire on real code, how many of those findings are right, and how fast the rules run.
How it is measured
Before the 0.1.0 rule set was called stable, every rule ran over 20.7 million lines of real code that was already on the build machine: the Python standard library, this repository's Python dependencies, the website's node_modules, the Go standard library and module cache, Cargo crates, older review code, and the last 150 commits of this repository. Most of it was reviewed as if every file were newly added, the worst case for rules that only look at changed lines. The commit history was reviewed commit by commit through the real Git pipeline.
Every error-level finding was checked by hand. False positives were fixed in the rule and pinned with a regression example; rules that were noisy but right were tightened or lowered to a warning, with the reason in the rule's rationale. The full write-up, with per-rule numbers and every triaged error, is in docs/precision.md in the repository.
Results
| Corpus | Changed lines | Errors before | Errors after |
|---|---|---|---|
| Python standard library | 1.19 M | 168 | 143 |
| Python dependencies | 0.23 M | 4,116 | 11 |
Website node_modules |
1.98 M | 125 | 39 |
| Go standard library | 3.15 M | 41 | 23 |
| Go module cache | 13.7 M | 9,468 | 8,266 |
| Cargo crates | 0.37 M | 44 | 9 |
| Older review code | 0.02 M | 1 | 0 |
| Repository history (150 commits) | 0.04 M | 3 | 1 |
Every remaining error was triaged as a true positive. Most of the Go module cache's errors are compiled .wasm files committed as test data, which CodeVeto reports as native binaries by design. No rule failed and no time budget was spent on any corpus.
Run time
On Apple silicon with Python 3.14, CodeVeto reviewed between about 8,000 and 39,000 changed lines per second depending on the language mix. The slowest single rule in any one review took 3.4 seconds against its 10-second budget; the slowest whole review (2,000 files of the Python standard library, all lines changed) took 40 seconds against the 120-second budget. A typical pull request reviews in well under a second.
The audit also reviewed the worst input the intake limits allow, about 30 MiB of string-dense JSON. Two agent rules ran out of time on it, so the rules gained a cheap prefilter. The same review now finishes in 22 seconds with no budget event, and an 8 MiB version of it is part of the benchmark suite.
Guarantees that the tests enforce
- Error rules stay quiet on clean code. Every rule runs over CodeVeto's corpus of realistic clean code in every supported language, and no finding may have error severity.
- Every rule ships examples. At least two bad examples must produce exactly the expected findings, and at least two good examples must produce none.
- Bounded run time. Rules use bounded regular expressions on single lines or bounded statements, long lines are scanned in overlapping windows, and each rule and the whole run have a time budget. A review that runs over is
incomplete, never silently clear. - Bounded input. A review reads at most 2,000 files, 1 MiB per file and 32 MiB in total. See limits.
Rerunning it
uv run python scripts/precision.py added /path/to/code --name mycode --out-dir precision
uv run python scripts/precision.py history /path/to/repo --commits 150 --name myrepo --out-dir precision
uv run python scripts/bench.py syntheticThe scripts and their options are described at the end of docs/precision.md.