Deterministic Code Auditing for Production-Ready Software (AI-Verify & Fruition Scoring)
December 22, 2025 whitepaper introducing AI-Verify: a 15-language tree-sitter static stub/complexity linter emitting SARIF 2.1.0 in 14.5 ms/file, paired with November 25, 2026 errata on comment non-monotonicity and detector-label circularity.
Part I: Contemporary Historical Summary (As Written in December 2025)
Historical Source Provenance (Original Date: December 22, 2025): David Jean Charlot, PhD · Open Interface Engineering. Preserved from our December 2025
AI-Author / AI-Verify / AI-Compileengineering series (Download Original Dec 2025 PDF).
Motivation: The “Compiles-But-Fakes-It” Failure Mode
By late December 2025, teams deploying coding agents in CI pipelines routinely encountered syntactically valid, compiler-clean stubs: faced with a non-trivial specification, an autoregressive model satisfied the type checker while inserting todo!(), pass # implement later, return Ok(vec![]), fake_token, or an undocumented unsafe pointer cast.
A common late-2025 workaround was “LLM-as-a-Judge”: sending generated files into a second frontier LLM call (35–50 J per file modeled, multi-second latency, and nonzero sampling variance across runs). AI-Verify argued that probabilistic code generators should be gated by deterministic static analyzers rather than probabilistic prompts alone.
Polyglot tree-sitter Architecture & SARIF 2.1.0 Pipeline
AI-Verify parsed source files across 15 tree-sitter grammars—Rust, Python, JavaScript, TypeScript, Go, Java, C, C++, C#, Ruby, PHP, Bash, Haskell, OCaml, and Scala—emitting OASIS SARIF 2.1.0 reports for CI/CD gates and IDE diagnostics:
Source Tree (15 Languages)
│
▼
tree-sitter Incremental CST Parser (zero LLM calls, 45 MB resident RAM)
│
├──► 1. Incomplete Implementation Detector (w_1 = 1.0) : TODO/FIXME, todo!(), unimplemented!(), NotImplementedError, empty catch
├──► 2. Fake / Placeholder Value Detector (w_2 = 0.8) : fake_*, mock_* in non-test paths, dummy literals, stubbed Ok(Default)
├──► 3. Undocumented Unsafe Detector (w_3 = 0.6) : Rust unsafe / C raw casts lacking explicit SAFETY invariant comments
├──► 4. Structural Complexity Analyzer (w_4 = 0.4) : McCabe V(G) = E - N + 2P & nesting-weighted Cognitive Complexity
└──► 5. Unreachable / Dead Branch Detector (w_5 = 0.3) : Post-return statements, shadowed dead arms, unused private bindings
│
▼
Fruition Score F in [0, 100] + Deterministic SARIF 2.1.0 Gate Verdict
The Fruition Score Formula
To provide automated repair loops with a scalar readiness gate alongside itemized SARIF spans, the whitepaper defined the Fruition Score F:
Fruition Score Definition:
F = 100 * ( 1 - ( sum_i w_i * c_i ) / ( sum_i w_i * m_i ) ) clamped to [0, 100]
where:
c_i = capped defect count in category i (0 <= c_i <= m_i)
m_i = normalization ceiling per KLOC for category i
w_i = severity weight (1.0, 0.8, 0.6, 0.4, 0.3)
The December 2025 paper stated two properties over F:
- Bitwise Determinism (
Theorem 1): Identical source byte inputs produce identical CST spans, SARIF fingerprints, and Fruition Scores (Var(F | source) = 0). - Defect-Count Monotonicity (
Theorem 2): Reducing a detected category countc'_i < c_iwith other counts fixed yieldsF(S') >= F(S)(Superseded / corrected — see Nov 25, 2026 Errata below).
December 2025 Audit Across 50,000 Files & 2,000 Labeled Commits
AI-Verify was run across 50,000 open-source files (10.1M LOC across Rust, Python, JavaScript, Go, and Java) and evaluated against a 2,000-file labeled set of AI-assisted commits (Superseded / corrected — see Nov 25, 2026 Errata below):
| Metric | AI-Verify (Deterministic CST) | Frontier LLM Review Baseline (Dec 2025) | Ratio / Delta (vs. LLM Baseline) |
|---|---|---|---|
| Precision (2,000 labeled files) | 94.7% | 86.1% (prompt-sensitive) | +8.6 percentage points |
| Recall | 91.2% | 88.4% | +2.8 percentage points |
| F1 Score | 92.9% | 87.2% | +5.7 percentage points |
| Median Latency per File | 14.5 ms (68 files/s) | 3,200 – 6,500 ms | 220.7 – 448.3x faster (LLM ms / 14.5 ms) |
| Peak Resident Memory | 45 MB | Cloud GPU service | Local single-core process |
| Modeled Energy per File | ~0.05 J (14.5 ms x 3.5 W) | 35 – 50 J | 700 – 1,000x lower (LLM J / 0.05 J) |
November 25, 2026 Errata, Related Work, and Evolution Addendum
Formal & Methodological Limitations Errata (2026-11-25 Audit)
- Non-Monotonicity of Semantic Safety Under Syntactic Comments (
// SAFETY:Gaming):- While
Fdecreases monotonically in the raw syntactic detector countc_i, it is NOT monotonic in actual memory or semantic safety! Specifically, Category 3 (Undocumented Unsafe) checks only whether a Rustunsafe { ... }block or C pointer cast is preceded by a syntactic// SAFETY:comment—not whether the stated invariant holds mathematically or whether aliasing/lifetime rules are respected. - Consequently, an LLM coding agent that prepends
// SAFETY: pointer is validto an out-of-bounds dereference or data-racingunsafeblock reducesc_3to0and strictly increases its Fruition ScoreFwhile leaving memory unsafety completely intact.Ftherefore measures syntactic stub absence and documentation completeness, not semantic soundness (contrast RustBelt, Jung et al. POPL 2018, whereunsafeblocks carry formal separation-logic proof obligations).
- While
- Detector–Label Circularity in the 50,000-File Scan & 2,000-File Precision/Recall Benchmark:
- In the December 2025 evaluation, both the
50,000-file repository prevalence audit and the2,000-file human-verified ground-truth rubric defined “incomplete or placeholder code” primarily via explicit surface markers (TODO,FIXME,todo!(),unimplemented!(),NotImplementedError,fake_*/mock_*names, and empty exception handlers)—the exact same lexical and CST patterns encoded in AI-Verify’s rule set. - This detector–label circularity explains why a lightweight
tree-sitterrule engine outscored an unconstrained LLM reviewer (92.9%vs.87.2%F1) on marker-bearing stubs, while having zero recall on silent semantic incompleteness (e.g., an agent omittingtodo!()and returning a plausible-looking arithmetic expression with a wrong boundary condition or missing authorization check).
- In the December 2025 evaluation, both the
- Epistemic & Licensing Status (
est_j, Private Prototype): Both~0.05 J/file(0.0145 s × ~3.5 Wsingle-core TDP) and35–50 J/file(cloud LLM TDP estimate) are analytical envelope estimates (est_j). Archival PDF (#02) is public at/papers/archive/02-Deterministic-Code-Auditing.pdfunder CC BY-ND 4.0; the originalopenIE-dev/deterministic-codingsource repository is private (unreproduced externally).
Chronological Evolution Within OpenIE Research
Recognizing that tree-sitter pattern lints cannot verify semantic behavior or prevent comment gaming motivated three stricter verification designs in our November 2026 stack:
- Executable Behavioral & Boundary Harnesses (SATB Harness): Moved beyond static identifier/comment linting to executable specification, boundary, and property harnesses that test input–output invariants directly.
- Machine-Checked IR Proof Obligations (RCE-VC): Replaced prose
// SAFETY:comments with formal pre-/post-conditions and machine-checked verification conditions over Reality Code Engine IR nodes, backed by our5,496-theorem Lean4.36.0suite (0 sorry). - Hardware-Metered State-Mutation Gates (Metered Commit Gates): Tested deterministic state-commit gating on an AMD Kria KV260 FPGA, recording
11.43 nJper gate decision via inline DC board shunts (measured_j) with 0 unsafe approvals observed in 209k simulated checks.
Related Work & External References
- Rust Clippy (
rust-lang/rust-clippy) — standardrustcHIR/MIR lint suite includingclippy::todo,clippy::unimplemented, andclippy::undocumented_unsafe_blocks. - Semgrep (Return To Corp / Semgrep Inc., 2020–2026) — polyglot CST/
tree-sitterpattern-matching static analysis engine with SARIF output. - SonarQube & Campbell, G. A. (2018). Cognitive Complexity: An Overview and Evaluation. TechDebt / ICSE 2018 — source of the nesting-weighted Cognitive Complexity metric alongside McCabe, T. J. (1976), A Complexity Measure, IEEE TSE, SE-2(4), 308–320.
- Calcagno, C., Distefano, D., Dubreil, J., et al. (2015). Moving Fast with Software Verification (Meta Infer). NASA Formal Methods 2015 — compositional bi-abductive separation-logic analyzer catching real null-dereference, resource-leak, and concurrency bugs semantically.
- Cousot, P., Cousot, R., Feret, J., Mauborgne, L., Miné, A., Monniaux, D., & Rival, X. (2005). The ASTREE Analyzer. ESOP 2005 — sound abstract interpretation proving absence of runtime errors in safety-critical C.
- Jung, R., Jourdan, J.-H., Krebbers, R., & Dreyer, D. (2018). RustBelt: Securing the Foundations of the Rust Programming Language. POPL 2018 — machine-checked Coq/Iris semantic soundness proofs for
unsafeRust encapsulations.
Changelog (2026-11-25)
- Separated Part I (December 22, 2025 summary) from Part II (November 25, 2026 formal limitations errata, provenance, and related work).
- Documented both formal limitations prominently: (a) syntactic
// SAFETY:comments raise the Fruition Score without proving semantic memory safety, and (b) detector–label circularity in the50,000-file /2,000-file stub benchmark. - Qualified the Kria KV260 Commit Gate evolution reference strictly as
0 unsafe approvals observed in 209k simulated checks(11.43 nJboard shunt,measured_j). - Added citations to Clippy, Semgrep, SonarQube / Campbell (2018), McCabe (1976), Meta Infer (2015), Astrée (Cousot et al., 2005), and RustBelt (Jung et al., POPL 2018).
David Charlot
Open Interface Engineering, Inc. · Signed Provenance · Self-Checked
Archival PDF (#02) public at /papers/archive/02-Deterministic-Code-Auditing.pdf under CC BY-ND 4.0; original AI-Verify codebase in openIE-dev/deterministic-coding is private (externally unreproduced). Full licensing & AI-use disclosure →
Video Summaries, Syndication & Site Reference
Check the primary artifacts or run an independent replication
Inspect signed provenance manifests, rerun our public Apache-2.0 commodity-hardware replication kits, review our November 25, 2026 outside-review errata, or browse primary manuscripts on the Research Hub.