realism-gate reads exploit proof-of-concept tests without running them and reports patterns that make a PoC prove less than it claims. In the last post I fixed three false positives and found a false negative while writing it up. That raised the obvious question: what else is wrong that nobody has looked for?
So I spent two rounds on the tool itself, not on its rules: more adversarial tests, mutation testing of the code, end-to-end runs over pinned public corpora, and a first attempt at measuring recall. I used an AI coding agent for the implementation and reviewed every merged change myself. Across both rounds, 14 pull requests (#66–#79) were merged; in the second round alone, main went from 696 to 728 passing tests, with fmt, clippy (-D warnings) and the hygiene check green.
This post is what that found, including the parts that did not work.
Status (updated 4 December 2026). Every fix in this post is released. The RG09 snapshot fix, the catch-branch fix and the RG08 fix for top-level scripts shipped in 1.5.7. The policy-path hardening (symlinks, junctions, .., file-system case probing) shipped in 1.5.8, together with a corrected recall harness. The recall table discussed under "The recall number that wasn't" is superseded by the corrected measurement in the updates at the end of this post.
In 1.5.4 I taught RG09 ("this assertion cannot fail") to look through a local: if a local is assigned an expression and the assertion compares it with the same expression, that is x == x. On one public Solana repository, the end-to-end run produced 669 RG09 findings, out of 693 RG09 findings on the whole 45-source Solana corpus. A count like that is a lead, not a number.
Here is one of them, reduced:
let market_before = env.svm.get_account(&env.market).unwrap();
let result = env.send(ProgInstruction::Deposit { amount: 100 }, accounts, &[&owner]);
assert!(result.is_err(), "deposit must fail when the token CPI cannot debit the source account");
assert_eq!(env.svm.get_account(&env.market).unwrap(), market_before);
RG09 said: "This assertion cannot fail: both sides are env.svm.get_account(&env.market).unwrap()." It can fail. market_before is a snapshot taken before a transaction, and the assertion checks that the rejected deposit left the market untouched. That is exactly the kind of assertion a good PoC should have.
The substitution ignored time. The fix substitutes a local only when its initializer is a constant, or when no call other than the initializer's own and the assertion's own sits between the binding and the assertion. When the binding cannot be found, it does not substitute. A missed tautology is cheaper than telling someone their correct check is meaningless.
Tests: bad fixtures that must still fire (let a = 1; assert_eq!(a, 1)), good fixtures for the snapshot shape in Rust, TypeScript and Solidity, and property tests that insert a state-changing call between the binding and the assertion and require RG09 to go silent. On the Solana corpus, RG09 went from 693 findings to 20.
It is not the last RG09 false positive. This one survives the fix:
let failed;
try {
await program.methods.withdraw(new BN(100)).accounts({ recipient: attacker.publicKey }).signers([attacker]).rpc();
} catch (e) {
failed = true;
}
assert.isTrue(failed); // reported: "`failed` is a constant"
The intermediate representation flattens the try/catch, so failed has one assignment and looks constant. It fails whenever the call succeeds. With let failed = false; the rule is correctly silent, because there are two assignments. This one is open; it needs the frontend to keep the branch.
realism-gate refuses a --declaration or --config file that lives inside the repository being checked: a pull request should not be able to ship the policy that judges it. The check compared the file's path with the checkout's path using Rust's Path::starts_with, which is case-sensitive.
On Windows, git rev-parse --show-toplevel reports the on-disk casing, while the process's current directory can be spelled differently (desktop vs Desktop). With the two spellings differing, a policy file inside the repo was accepted. It surfaced as a golden-test failure on my machine, not as a security finding, which is a reason to read every unexplained test failure.
The fix compares case-insensitively on Windows, normalizes separators, and keeps a sibling with the same prefix (RepoX vs Repo) outside. Two things are still open: macOS file systems are case-insensitive by default too, and the comparison does not resolve symlinks or junctions. Both are next.
The adversarial suite had two cases marked #[ignore = "bug: ..."] since November: a privileged prank whose address round-trips through abi.encode/abi.decode, and a privileged prank inside a helper contract the test defines in the same file. Both only raised "no assertion". Both now raise RG02 (privileged step in the exploit), and both tests run. I count these as fixed known bugs, not as new findings. Telling those apart matters when you judge how much a round of testing actually discovered.
Coverage tells you which lines ran. It does not tell you whether a test would notice if a line were wrong. Mutation testing does: change the code (flip a comparison, return a default, delete a statement) and see whether any test fails. A mutant no test catches is behaviour nobody pins.
Baseline with cargo-mutants, run by the agent (I have not re-run it; a full run takes hours). Mutation score is caught / (caught + missed), with timeouts and unviable mutants excluded:
Crate | Mutants | Caught | Missed | Score |
|---|---|---|---|---|
| 47 | 4 | 42 | 9% |
| 47 | 42 | 4 | 91% (1 equivalent) |
| 46 | 31 | 4 | 89% |
| 472 | 298 | 144 | 67% |
| 136 | 72 | 38 | 65% (16 timeouts) |
| 148 | 90 | 55 | 62% |
| 375 | 155 | 212 | 42% |
| 1,246 | not run |
rg-ir went from 4 caught to 42 with 18 new unit tests. The rest is the honest picture: the model, which decides setup versus exploit and who the attacker is, has the weakest score of what was measured, and the rules crate was not measured at all. Line and branch coverage could not be measured on this Windows host, according to the agent's run; that moves to Linux CI.
Precision asks how often a flag is right. Recall asks how many real problems the tool misses, and realism-gate has never had a recall number. The plan was mutation recall: take real, sound PoCs from the pinned corpora, inject exactly the defect a rule claims to catch (delete the assertion, make it tautological, remove the before-value, unpin the fork), and count how many the tool flags. Sources were split into tuning and held-out by a committed seed, and the pre-registration was merged before any result existed.
The first table said RG10 (impact measured without a before-value) caught 0 of 8 held-out Rust mutants, and the report called it the strongest false-negative lead of the round. I read all eight. None of them was a missing before-value. The operator is a regular expression that deletes "a local the asserted value is computed from", and on Rust it picked admin, attacker, user_idx, pnl, dest and product, then replaced their use with 0:
let lamports_after = env.svm.get_account(&0.pubkey()).unwrap().lamports;
That does not compile, and it has nothing to do with a baseline. In every one of the eight mutants the deleted name still appeared 8 to 43 times, mostly as references to a variable that no longer existed. The 0/8 measured the generator.
Other cells had other problems:
RG08 Rust (7/12 held-out). Four of the five "misses" were not tests: three were program source files (
processor.rs) and one was a shared test-helper module. The eligibility rule was "the tool raises no finding for this rule on the base file", and a file with no tests trivially qualifies. RG08 staying silent on a processor is correct. The fifth was a library's own unit tests, not an exploit PoC.RG09 Rust (8/12 held-out). All four "misses" were the same non-test files. On the mutants that were actually tests, RG09 caught every one.
RG10 Solidity (7/12 held-out). Most mutants were valid: a
*Beforevariable removed and nothing left behind. But of the misses I read, one test still had a second assertion with a baseline, and RG10 is documented to stay silent once any assertion in the test has one. Another fixed the attacker's starting balance withvm.deal(ATTACKER, 0), which makes an absolute read after the attack a difference, and RG10 has recognised that since 0.2.0. Those are the rule working as designed, counted as misses.
So the table cannot be published as recall. What it does show is what a mutation-recall harness needs before its numbers mean anything:
An operator that works on syntax, not text. realism-gate already parses all four languages; the mutants should be built from its own frontends, not from regular expressions.
A validity oracle per operator: the mutant compiles (or at least resolves every name), and it contains the defect as the rule defines it, including the rule's documented exceptions.
Eligibility that requires a test: the base file must contain at least one test the tool recognises.
A hand-read sample per operator before any number is reported. Reading eight mutants took minutes and invalidated the headline.
The pre-registration did its job in one respect: the report recommended changing RG10's model to close the "gap", and because rule changes needed explicit approval, it was not changed. A rule rewritten to chase a broken measurement would have been worse than no measurement.
An earlier attempt to use my own rejected submissions as an outcome dataset attributed findings to the wrong PoCs: most reports share a folder with other reports, and the findings were the union over the folder. Those numbers are withdrawn in the M1 report, and the redo stopped at its checkpoint for lack of a clean PoC-to-report attribution. A synthetic 14-case suite that an earlier report called "100% recall" is now labelled what it is: a regression suite.
Corpus anomalies are the cheapest bug finder I have. One rule producing 61% of a corpus's findings, almost all from one repository, was a shipped false positive. That check is now a standing step in my plan for every corpus run.
"Known bug, now fixed" and "new bug, found" are different results. Counting them together overstates how much a round discovered.
A measurement needs its own tests. The recall harness had none, and its most confident number was its least true one.
Mutation score is a better question than coverage: not "did this line run" but "would anyone notice if it were wrong". For the model crate, today, often no one would.
The fixes are on main and ship as 1.5.7. Next is a mutation-recall harness built on the tool's own parsers, the rest of the mutation baseline, and the two RG09 and path-check follow-ups above.
cargo binstall realism-gate
Changelog: https://github.com/KhomDev/realism-gate/blob/main/CHANGELOG.md
Three of the four follow-ups named in the post are done, and one of them changed my mind. The fourth, the rest of the mutation baseline, is not: rg-model and rg-program still have no complete workspace-level mutation run.
The path check now canonicalizes both paths (symlinks and junctions resolved,
.and..removed) and ignores case exactly when the file system holding the checkout is probed to be case-insensitive. Each bypass shape (symlinked file and directory, Windows junction,..both ways, a same-prefix sibling, a casing variant) has a test. Released in 1.5.8.The RG09 catch-branch false positive (
let failed; try {...} catch { failed = true }) is fixed in 1.5.7: a local is a constant only when its value is the declaration's initializer.The mutation-recall harness was rebuilt on the tool's own parsers, then corrected a second time after I read its misses. On the frozen 1.5.7 binary it finds every planted defect in every measured cell: RG08 77/77, RG09 77/77, RG11 147/147. That number is conditional on the tool reading the test: 339 TypeScript tests are read only as setup, and with that refusal turned off RG09 on TypeScript is 45/72. The obvious fix for that refusal is measured but not shipped yet; a follow-up post will cover both corrections and why.
Releases now check themselves: a crate whose source changed under an unchanged version fails the release (
rg-frontend-rusthad stayed at 1.5.0 through the syn 3 change; 1.5.8 republishes it as 1.5.1), and the 1.5.8 archives were rebuilt independently and reportedreproducible: YES.
Skipped tests are now reported, not dropped in silence. check prints a note-level skipped line per test the rules do not read, with the reason, and counts them in the summary and in the JSON (skipped, skipped_tests). It changes no finding and no exit status. A run on a PoC that the setup gate misreads as setup now says so instead of showing "0 findings". The gate itself is unchanged in 1.5.9.
Pull requests: #80, #81, #82, #84, #85 (skipped tests), #86 (
mutate --no-gate).Measurement files in the repository:
eval/recall/results-r4.md,eval/recall/results-r4-ungated.md,eval/recall/R4-FINDINGS.md,eval/recall/AMENDMENT-R4-2026-12-02.md.Reproduce:
python eval/recall/run.py --binary <v1.5.7 build> --generator <build> --out eval/recall/results-r4.json --md eval/recall/results-r4.md --checkand the same with--no-gatefor the ungated table; both exit 0.

