Re-check a store from scratch
Replay accepted objects with the pinned Lean kernel and no cached modules, and compare every axiom footprint with its receipt.
Normal acceptance is incremental: later replays import cached modules, so the pinned Lean 4.34.1 kernel checks only new objects, and the earlier ones rest on the module cache (How acceptance works). reverify replays objects from scratch, with no modules, so the objects it replays no longer depend on that cache.
Before you start
- A running server on the store, with a runtime that can make native calls: no HALTED latch, and a quiet host.
- In the commands,
$SOCKis the server’s socket.
Steps
-
Check how many objects the store has accepted:
Shell lema --socket $SOCK infoOne
reverifycall replays at most 20,000 objects. Ifacceptedis larger, go to step 3. -
Re-check everything:
Shell lema --socket $SOCK reverifyThis is one native call. The response is
{call, notes, objects, receipts}:objects: how many objects were re-checked;receipts: how many kernel receipts the replay produced (for declarations, records, families and externals);notes: how many other objects were covered by a declaration replayed in the same call;call: the native call’s name in the runtime’s ledger.
-
For a larger store, re-check it in parts. Pass
roots, and the call replays their closure:Shell lema --socket $SOCK call reverify --params '{"roots": ["<id>", "<id>"]}'Choose roots whose closures together cover every accepted object. The
lean/cappublication suite, for example, re-checks its store in three parts, each the closure of some publications’ roots, and checks that together they cover every accepted object.
Reading the result
A pass means two things. Every receipt’s axiom footprint equals the one worked out now. Every object without a receipt (a statement, template, proof or satisfaction) is used directly by a declaration replayed in that call. Any difference is an error.
Time and size
One call may run for at most 600 seconds, and the 20,000-object bound is meant to keep a call within that. In the lean/cap publication run of 17 Oct 2026, parts of 16,926, 13,066 and 15,430 objects took 63, 156 and 54 seconds (lean/cap/README.md).
A call that runs past its limit is a supervision fault: it writes a HALTED latch and stops later native calls. Split the store into smaller parts rather than let a call run long.
Refusals
| Message | Meaning |
|---|---|
nothing to re-verify | The store has no accepted objects. |
… objects exceed one re-verification call (20000); re-verify in parts with roots | Use step 3. |
… is not accepted | A root, or an object in its closure, is not accepted in this store. |
the kernel refused accepted objects […] on re-verification; see … | Kernel replay failed. The log path is in the runtime’s output. |
re-verification failed (…): footprints or receipts differ for […]; nothing replayed now checks […] | A footprint differs from its receipt, or an object was not covered. |
native calls halted; see … | A HALTED latch is set. |
Written against lema-lang at commit 5a94951, 17 Oct 2026.