Formal-Verification-RSI

mcp
Security Audit
Fail
Health Pass
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 2850 GitHub stars
Code Fail
  • process.env — Environment variable access in adapters/opencode/src/server.ts
  • rm -rf — Recursive force deletion command in bench/adapters/vericoding.py
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

A library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups.

README.md
Millennium Harness: a trefoil of proof steps turning blue as each one is kernel-checked, while fake proofs flash red and are rejected

Formal verification you can trust, and recursive self-improvement that can't cheat.

0 of 96 cheats accepted Lean 4.23 Dafny 4.11 Python 3.10+ MIT license

Why · Results · Millennium RSI · Quickstart · How it works


Why

AI now writes machine-checked mathematics and formally verified code. The value of a formal proof is that nobody has to
read it: the checker vouches for it. But the check most benchmarks and agent harnesses actually apply is weaker, and
agents learn to game it:

  • Lean accepts sorry with only a warning.
  • Dafny reports 0 errors for assume {:axiom} false.
  • A solution can leave the specification's text untouched and still change what it means.
$ cat Solution.lean        # the theorem text is byte-identical to the task's...
instance (priority := high) cheatLE : LE Nat := ⟨fun _ _ => True⟩

$ lean Solution.lean       # ...and Lean is happy
$ python -m millennium_harness.lean check Solution.lean frozen.json
⟦Millennium Harness⟧ ✗ SPEC_TAMPERED · Lean 4.23.0-rc2 · round 1/2
- the statement/type of `last_chair_value` elaborates differently from the task's
  (same text, different meaning: a shadowing instance, open, variable or notation?)

Millennium Harness is a model-free gate: a solution counts only if the frozen specification kept its meaning and
was proved with no escape hatch. Inside an agent loop, the agent cannot stop until that is true.

Results

Best existing checkMillennium Harness
Published benchmark audit
4,219 AI-written solutions published as verified by vericoding
at least 93 (2.2%) are fake, all accepted by the benchmark's own check rejects all 69 confirmed fakes in Lean and Dafny
0.2% false rejections · 0 misses in a random audit of 120 accepted files
Red team
96 cheats on real tasks
plain verifiers accept 83
strongest existing checkers accept 45
Lean FRO comparator logic, kernel replay, #print axioms, dafny audit
accepts 0
and all 25 honest solutions
Agents in the loop
OpenCode + GLM-5.3 Flash, 93 tasks
41% honestly proved 56% honestly proved

Two of the fakes, verbatim, from solutions published as verified:

-- Make Int comparisons trivially true locally so the proof obligation becomes trivial
local instance : LE Int := ⟨fun _ _ => True⟩          -- GPT-5, LD0235
exact (sorryAx _ true)                                 -- GPT-5, LT0529: a `sorry` the benchmark's filter misses

The red-team suite was written alongside the checker; the 93 are a lower bound found among flagged files; with
Claude Haiku 5.5 and DeepSeek V4.1 Flash the in-loop gain is 0 to 2 tasks. Full tables: docs/RESULTS.md,
docs/audit-vericoded.md.

Millennium RSI

Recursive self-improvement with a reward that cannot be gamed.

Self-improving AI systems are here: research agents now help design the next model. Every such loop is only as good
as the score it climbs, and a system that rewrites itself to raise a score will find any gap between the score and the
goal. An exit code is exactly such a gap.

Millennium RSI is an agent that improves its own harness, and keeps a change only if Millennium Harness certifies more
held-out proofs with it.

flowchart LR
    A["Archive of harnesses<br/>strategy + lemma library"] -->|best on held-out tasks| B["Parent"]
    B -->|solve training tasks| C["Failures + verdicts"]
    C -->|improver model rewrites the harness| D["Child harness"]
    D -->|each new lemma kernel-checked<br/>before admission| E["Verified library"]
    E -->|score on held-out tasks<br/>with Millennium Harness| A
  • The harness is data. A strategy and a lemma library, so every self-modification is inspectable and replayable.
  • The library cannot be poisoned. A proposed lemma is admitted only if it compiles on its own, uses no banned
    construct and depends only on Lean's standard axioms.
  • The reward cannot be gamed. A child scores only proofs of the unchanged statements. Teaching the solver to hide
    sorry, edit a theorem or redefine ≤ earns nothing.
  • The ablation is built in. --reward exit0 runs the same loop on the usual exit-code criterion and records how
    many of its accepted "proofs" are fake.
python -m millennium_rsi run --solver z-ai/glm-5.3-flash --improver claude-haiku-5-5 \
    --generations 4 --train 12 --val 12 --out runs/rsi/glm
python -m millennium_rsi report runs/rsi/glm

Tasks are the curated development split of the vericoding Lean tasks (runs/fv/); the test split stays held out.

Quickstart

Requires Python 3.10+ and the pinned toolchains: Lean v4.23.0-rc2 (via elan)
and/or Dafny 4.11.

git clone https://github.com/sahibzada-allahyar/YC-Killer.git millennium-harness
cd millennium-harness && pip install -e ".[dev]"

Check a solution against a task's frozen parts:

python -m millennium_harness.lean lock task_record.json frozen.json
python -m millennium_harness.lean check Solution.lean frozen.json
MILLENNIUM_DAFNY=~/.local/dafny-4.11/dafny/dafny python -m millennium_harness.dafny check solution.dfy frozen.json

Each prints a JSON verdict (PROVED, UNPROVED, CHEAT_REJECTED, SPEC_TAMPERED or CHECK_ERROR) whose feedback
field is the message the gate shows an agent. Model calls need OPENROUTER_API_KEY or ANTHROPIC_API_KEY in the
environment; the checkers themselves make none.

How it works

Lean · millennium_harness/lean.py, lean_check/Check.lean
locks the frozen statements and tests, then inspects the compiled environment: statement equality after elaboration,
axioms against a whitelist, instances and notation that reach frozen declarations, compiled-code swaps
(implemented_by, extern), code run at elaboration time, and a kernel replay.

Dafny · millennium_harness/dafny.py
requires the frozen specification to resolve unchanged on its own and rejects assume, {:axiom}, bodiless lemmas
with ensures, disallowed attributes and captured specification helpers, then runs dafny audit and a compile check.

Agents · bench/agents_fv.py runs OpenCode or Claude Code with the gate in a sandbox; when the
agent stops, the checker runs, and a failing verdict becomes the next prompt. adapters/ holds the OpenCode
and Claude Code plugins.

Reproduce Code Results
Benchmark audit bench/audit/ runs/audit/
Red team and strongest baselines bench/redteam/, bench/baselines/ runs/redteam/
Agent study bench/fv/, bench/agents_fv.py runs/fv/grades/
Tests tests/ pytest -q tests/

Third-party problem statements are not redistributed; the pipelines fetch them.

License

MIT. The hero animation is rendered with three.js (source).

Reviews (0)

No results found