lev docs

Why lev exists

A one-line edit low in Mathlib can rebuild thousands of modules. The reasons are in Lake's .trace files, but nothing reads them back to you. lev inspect build does.

lake check replays the whole environment through the kernel on every run: Init, Std, every dependency and the project. For Mathlib that is a 7 minute export and a 53 minute single-threaded kernel run, no matter how small the edit. lev check checks each module as its own slice, caches every verdict by the slice's content, and after a typical Mathlib commit rechecks a handful of slices in about 20 seconds of checking.

Lake's artifact cache only grows, and lake cache clean is the one way to shrink it. lev cache gc --lake removes what no registered project references.

Commands

CommandWhat it does
lev inspect buildRuns lake --verbose build once and reports, for every module whose trace changed, the inputs that changed. Inspection
lev checkExports every module with lev-export, checks one slice per module with the official kernel, leanchecker-paranoid or nanoda, reuses cached verdicts, and checks that the per-module results compose. Checking
lev cache status, lev cache gcInventory lev's cache, the check caches and the Lake caches of registered projects, and remove unreferenced or unused entries older than an age gate. Cache
lev doctorReports elan, Lean, Lake, Git, bwrap, the kernels in the toolchain, what lev check has built for it, and where Lake's artifact cache lives. Getting started

Where lev stops

  • Lake owns packages, builds and caches, and Lean owns elaboration. lev runs Lean and Lake through elan the way a plain lake build in the project would, and never changes Lake's environment.
  • lev writes only to its own cache directory. The one exception is lev cache gc --lake --apply, which deletes the Lake cache entries it listed.
  • lev check is not a replacement for the trust model of lake check. Its slices are checked by the same kernels, but whether the slices compose is decided by lev's own small linker, not by a proved theorem. Checking says what that means.
  • lev inspect build explains the build it ran. Lake overwrites its traces, so an earlier build cannot be explained after the fact.

Guides

PageCovers
Getting startedInstalling lev and a first run of each command.
InspectionHow lev inspect build reads Lake's traces, and how to read its report.
CheckingSlices, views, the composition check, the kernels, measured numbers on Mathlib, and the limits.
CacheWhat lev keeps, what lev cache gc removes, and what protects an entry.
Command referenceOptions, exit status, JSON schemas and environment variables.