| Filename | Latest commit message | Latest commit date |
|---|---|---|
The tests wrote each mock `lean` script in this process, then ran it. A fork copies the forker's open descriptors into its child until that child's exec, so a sibling test's spawn could hold the script open for writing at the moment it ran. exec then failed with ETXTBSY, and the oracle rightly reported a toolchain it could not start: `lean-toolchain-missing` where the test expected `lean-timeout`, and the same in three other tests of the crate. `sh` now writes the script, and has exited before the test goes on, so this process never holds a descriptor for it. The timeout test also prints the oracle's message when it fails, which is how the cause was read. 16 runs at a time, 8 test threads each, on Linux arm64: 23 of 4,800 runs failed before, all `Text file busy (os error 26)`; 0 of 4,800 after. Co-Authored-By: Claude Opus 5.5 <[email protected]> |
||
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
jouleclaw-oracle-lean
Scope: jouleclaw-oracle::Oracle impl backed by a Lean 4
toolchain. The candidate's content is written to a temp file;
lean is invoked; exit code maps to Verdict { Pass | Fail }.
Relation to jouleclaw-formalize
These two crates are complementary, not duplicative. They gate different stages of the same proof chain:
-
Informal claim → Lean source (translation): the faithfulness gate.
jouleclaw-formalize::FaithfulnessCheckerverifies that the Lean encoding actually expresses the English claim the human intended. Without this, you can rigorously prove the wrong theorem. -
Lean source → exit code (compilation): the correctness gate. This crate's
LeanOracle::verifyinvokes the compiler and treatsexit 0as proof acceptance.
A production proof-carrying-code pipeline runs BOTH:
claim --[jouleclaw-formalize]--> Lean source --[jouleclaw-oracle-lean]--> Verdict
^ ^
faithfulness compiler exit
If you skip jouleclaw-formalize, the Verdict::Pass from this
crate means "this Lean source compiles" — not "the Lean source
proves the claim the user actually made." That distinction is
the same distinction the AlphaProof / AlphaGeometry literature
makes: compiler feedback only rules out hallucinations if the
formalization is faithful.
What ships
LeanOracle(Oracle trait impl)LeanOracleConfig{ toolchain, timeout, workdir, extra_flags }LeanOracleError{ ToolchainMissing | Io | Timeout }- Mock-lean test harness (no real Lean install required)