Lean REPL Setup
Setup and verification guide for the Lean environment used by wonton-soup.
Toolchain Contract
- Lean version pinned in
lean_project/lean-toolchain(currently4.25.0) - Local leantree checkout at
libs/leantree LEAN_PROJECT_PATHmust point to this dossier’slean_project/
Requirements
- Python
3.12+ uvelan
Step 1: Install Pinned Lean
Install elan if needed:
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | shInstall + select pinned toolchain:
elan install leanprover/lean4:v4.25.0
elan default leanprover/lean4:v4.25.0
lean --versionExpected: Lean (version 4.25.x, ...).
Step 2: Ensure LeanTree Checkout
From repo root:
git submodule update --init --recursive dossiers/wonton-soup/libs/leantreeStep 3: Create Lean Project
From dossiers/wonton-soup/:
uv run python setup_lean.pyThis initializes lean_project/ and fetches Lean dependencies.
Step 4: Export LEAN_PROJECT_PATH
export LEAN_PROJECT_PATH=/path/to/specter-labs/dossiers/wonton-soup/lean_projectStep 5: Smoke Test
From dossiers/wonton-soup/:
uv run python wonton.py lean run -m dev --sample 3 --seed 123 --plainExpected signals:
- a new
logs/corpus-YYYY-MM-DD-HHMMSS/directory run_status.jsonwithstatus: completedsummary.json.gzpresent
Platform Notes
- macOS uses
gzcat; most Linux distributions usezcat. - if elan binaries are not discovered, prepend
$HOME/.elan/bintoPATH.
Troubleshooting
lake not found
export PATH="$HOME/.elan/bin:$PATH"Then verify:
lake --versionLean version mismatch
elan override set leanprover/lean4:v4.25.0
lean --versionREPL build failures in lean_project/
cd lean_project
lake buildIf dependency fetch/build still fails, remove transient build outputs and rebuild with the pinned version active.
LEAN_PROJECT_PATH not respected
Verify current shell value:
echo "$LEAN_PROJECT_PATH"It must resolve to this dossier’s lean_project path, not another repository.