- Run every
lean,lake, and Lean compiler command throughtools/leanrun. In standard mode the runner enforcesMemoryHigh=4G,MemoryMax=6G,MemorySwapMax=1G,CPUQuota=100%,nice -n 10, andionice -c 3, and it setsLEAN_NUM_THREADS=1. - The runner acquires the same machine-wide lock as
../vq/tools/leanrun. Never bypass the runner. Lean and Lake processes run concurrently on one host only inside one runner command. The user has authorized concurrent runs on separate hosts, each through its own resource-limited runner. --threads NsetsLEAN_NUM_THREADS=NandCPUQuotatoNCPUs. Lake takes its number of parallel jobs fromLEAN_NUM_THREADS, and each Lean process uses it for its own tasks. The user has authorized more than one thread.--memory-high SIZEselects a memory high limit in whole gibibytes, such as10G, and a maximum 2 GiB above it. The default limits remain 4 GiB high and 6 GiB maximum. The full numerical proof builds recorded in the journal use10Gfor the lgamma root-range proofs.- Add a reasonable
timeoutto diagnostic commands whose runtime is not intrinsically bounded. - After a target reaches its timeout without a diagnostic, do not run the unchanged target again. First divide the proof or module, or add a verified reusable lemma that reduces the elaboration boundary.
- Pass
--timeoutfor a command-specific limit and--lock-timeoutwhen the default 900-second lock wait is unsuitable. Keeptools/leanrunas the first command token so one approval covers every Lean target. If the runner cannot create its user scope or enforce the required cgroup properties, stop and ask the user; the only exception is the explicitly authorized local mode below. - Only after the user explicitly authorizes local execution without a systemd cgroup may
LEANRUN_LOCAL=1be set on the repository driver ortools/leanruninvocation. This opt-in mode retains the pinned toolchain, shared lock, timeout,LEAN_NUM_THREADS=1,nice, andionice, but it warns that CPU, memory, and swap cgroup limits are absent. It never activates implicitly. Invoke runner-calling repository drivers directly with the variable rather than wrapping the driver intools/leanrun; nested local-mode runner calls fail immediately because they would otherwise wait on the same non-reentrant lock. - Do not wrap
tools/leanrunin another resource scope. Do not substitute an address-space limit such asulimit -vorprlimit --as.
The standard command form is:
tools/leanrun --timeout <duration> <lean-or-lake-command>- Run every Python program in this repository with
uv run PATH, never withpython3or a hand-made virtual environment. Each program declaresrequires-python = ">=3.12"and its pinned dependencies in a PEP 723# /// scriptblock, and a new program must do the same.
- Reuse saved command approvals through normal execution. If a sandbox failure requires escalation, request a reusable prefix for the repository driver or command category.
- Keep the repository driver as the first command token for verification runs:
tests/modules/run.sh,tests/gpt/run.sh,tests/wgsl/run.sh,tests/gpt32/native.sh,tests/drone/oracle.sh,tests/verified/run.sh, ortools/demo-check, each of which callstools/leanrunitself. Request approval for that driver prefix rather than one case, module, corpus file, temporary path, or internal child command. - Put repeatable corpus membership and expected results in the driver's checked files, such as an example's
Cases.leanunderExamples/. Do not place globs, brace expansions, generated file lists, pipes, or shell wrappers around a repository verification command. - Use direct
tools/leanruncommands only for focused diagnostics that do not belong in an existing repository gate. Keeptools/leanrunas the first token and pass file paths as ordinary arguments without shell expansion.
Treat accepted theorems and the LeanExe compiler manual's full check as gates. Evaluate each iteration across proof-generation time, successful LTG retrieval, agent revisions, proof structure and size, shared abstraction use, compiler hint use, and applicability beyond the measured program. No single measurement determines retention or promotion. Do not treat raw source bytes, word length, or identifier length as proof complexity. Longer declaration names often record useful shared theorem use. Consider lines, explicit syntax, local scaffolding, repeated derivations, and shared theorem or tactic use. After every proof run, review the journal and the accepted proof together. Use that evidence to consider changes to compiler hints, shared lemmas, tactics, and guidance, as well as the instructions that govern proof generation and journaling.
Keep journals as frequent, natural prose. They should identify supplied help that worked or failed, explain changes of approach, and note missing general abstractions. Test changes on fixed modules, preserve failures, and use diverse or held-out demos to avoid problem-specific optimization.
Preserve checked narrow or program-specific LTG material as worked examples by default. Generality and recurring evidence determine importability, automatic selection, and promotion, while specificity alone does not justify deletion. Remove an example only when it is invalid, stale, unsafe to disclose to a measured proof task, or duplicated without a distinct lesson.