Run the repository checks
Run the fast zero-Lean Rust workspace tests on any OS, validate OpenSpec schemas, and run path-selected native verification suites with lema-native in a lema-lang checkout.
If you are contributing to the lema-lang repository itself (as opposed to running lema test inside a user project), Lema organizes its repository test suites into two tiers (LEMA-381, Decision 0033):
- The default plain tier (
cargo test --workspace): Starts no Lean process, opens no store, and needs no Linux sandbox. It runs in seconds on both macOS and Linux, testing canonical object hashing (lema-core), Pythonic.lemarendering/parsing/rederive (view.rs), semantic version control andlema.contract/v1witness checking (lema-store),LemaIRcompilation andConstantTime/SecretFlowstatic analyses (lema-ir), in-memory VM execution (lema-vmandlema-vm-runner), 6-tag capability framing (lema-cap), and static site generation (lema-site). - Path-selected native suites (
cargo run -q -p lema-native): End-to-end tests that invoke the pinned Lean 4.34.1 kernel inside the Linuxbubblewrapsandbox or run full VM deployment and release scenarios (natives.json).
Before you start
- A checkout of
lema-langwith the pinned Rust1.98.0toolchain installed. - Node.js
20.19or newer when validatingopenspec/specifications. - For native suites (Step 3), an
x86_64Linux machine wherelema toolchain installandlema check-runtimehave passed (Set up a machine for Lema).
1. Run the fast plain tier (any OS, no Lean process)
From the root of your lema-lang checkout, run formatting, Clippy, and the workspace unit and integration tests:
cargo fmt --check
cargo clippy --workspace --all-targets
cargo test --workspaceWhy is cargo test --workspace so fast in Lema v0.2?
- Every library module (
Core,BlockStore,ChaCha20Poly1305,X25519,Ed25519,P256Verify,RsaVerify,Noise,Tls13,Http1,S3,S3d,Collector,EscrowLedger) has its committed canonical input inaudit/inputs/and its generated audit view inaudit/view/(LEMA-190,LEMA-191). - That allows
cargo test --workspaceto testLemaIRcompilation,Ir.Semanticsdifferential checks,ConstantTimeandSecretFlowstatic guarantees,Store::check_witnesscontract selection discharge, and VM task/actor/session execution directly in memory without spawning a singleleansubprocess.
2. Validate OpenSpec specifications (when touching specs)
If your change adds or modifies an OpenSpec change proposal under openspec/, run the Node check:
npm ci --ignore-scripts
npm run check3. Select and run native suites for changed paths (lema-native)
Notice an important rule when reporting test coverage: #[ignore]d native tests have not run merely because cargo test --workspace is green.
Rather than guessing which native suites your change affects, natives.json and the lema-native tool map modified repository paths to the exact native test rows they require. List the native suites triggered by your branch relative to origin/main:
cargo run -q -p lema-native -- list --changed origin/mainFor example:
- Editing
crates/lema-core/src/view.rsoraudit/inputs/triggers thelibrary_publishreproducibility suite (which re-publishes a fixed set of library modules into a fresh store through the Lean 4.34.1 kernel) and contract view round-trip checks. - Editing
crates/lema-vm-runner/,crates/lema-cap/, orcrates/lema-store/src/release.rstriggers thevm_release(crates/lema-cli/tests/vm_release/deploy.rs) andescrow_ledger(crates/lema-cli/tests/escrow_ledger/deploy.rs) native rows.
Run the selected native rows using lema-native (or by passing the isolated runtime configuration environment variable for that row with -- --ignored --test-threads=1 --nocapture):
cargo run -q -p lema-native -- run --changed origin/mainEach native row automatically gets its own isolated runtime output directory so its ledger.jsonl, .olean module cache, and fault state stay separate from other runs.
4. How to interpret and report check results
When summarizing verification results in a commit message or pull request, keep the three evidence tiers distinct (Checked, tested and assumed):
checked: Declarations and theorems replayed through the pinned Lean 4.34.1 kernel under the store’s axiom policy (library_publish,reverify).tested: Rust workspace tests (cargo test --workspace),ConstantTimeandSecretFlowstaticLemaIRanalyses, and native VM application suites (vm_release,escrow_ledger). Distinguish between the default minimal release gate suites and the full stress scenario suites (LEMA_ESCROW_FULL,LEMA_COLLECTOR_FULL).assumed: The pinned Lean 4.34.1 kernel, the Rust compiler and VM worker,bwrap, and the host OS.
Lema v0.3.2 · Updated 29 October 2026 · Version and compatibility