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.

Illustration of deterministic verification harnesses gating AI-generated software artifacts
Illustration of deterministic verification harnesses gating AI-generated software artifacts

Temporal & Archival Scope: Era 0 Historical Whitepaper (Originally dated December 22, 2025; verbatim historical summary followed below by dated November 25, 2026 Errata & Related Work Addendum) · Canonical OpenIE Chronicle Entry: https://blog.openie.dev/posts/wp-deterministic-code-auditing/ · Original Archival PDF: https://blog.openie.dev/papers/archive/02-Deterministic-Code-Auditing.pdf

Provenance & Telemetry Hygiene: Signed Provenance · Self-Checked (automated OpenIE internal gates; not externally peer-reviewed) · Energy Class: est_j (measured_j ⊥ reported_j ⊥ est_j ⊥ unmetered — Verification, Licensing & AI-Use Disclosure · Glossary & Non-Mixing Rules).

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-Compile engineering 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:

  1. Bitwise Determinism (Theorem 1): Identical source byte inputs produce identical CST spans, SARIF fingerprints, and Fruition Scores (Var(F | source) = 0).
  2. Defect-Count Monotonicity (Theorem 2): Reducing a detected category count c'_i < c_i with other counts fixed yields F(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):


Formal & Methodological Limitations Errata (2026-11-25 Audit)

  1. Non-Monotonicity of Semantic Safety Under Syntactic Comments (// SAFETY: Gaming):
    • While F decreases monotonically in the raw syntactic detector count c_i, it is NOT monotonic in actual memory or semantic safety! Specifically, Category 3 (Undocumented Unsafe) checks only whether a Rust unsafe { ... } 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 valid to an out-of-bounds dereference or data-racing unsafe block reduces c_3 to 0 and strictly increases its Fruition Score F while leaving memory unsafety completely intact. F therefore measures syntactic stub absence and documentation completeness, not semantic soundness (contrast RustBelt, Jung et al. POPL 2018, where unsafe blocks carry formal separation-logic proof obligations).
  2. 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 the 2,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-sitter rule 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 omitting todo!() and returning a plausible-looking arithmetic expression with a wrong boundary condition or missing authorization check).
  3. Epistemic & Licensing Status (est_j, Private Prototype): Both ~0.05 J/file (0.0145 s × ~3.5 W single-core TDP) and 35–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.pdf under CC BY-ND 4.0; the original openIE-dev/deterministic-coding source 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:

  1. 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.
  2. 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 our 5,496-theorem Lean 4.36.0 suite (0 sorry).
  3. Hardware-Metered State-Mutation Gates (Metered Commit Gates): Tested deterministic state-commit gating on an AMD Kria KV260 FPGA, recording 11.43 nJ per gate decision via inline DC board shunts (measured_j) with 0 unsafe approvals observed in 209k simulated checks.

Changelog (2026-11-25)


Canonical Provenance, Primary Artifacts & Independent Replication