This page documents Regula 0.8.0. The latest release is Regula 0.11.1: this page in Regula 0.11.1.
RG2001: The declared Lean environment must be available
- Category Environment
- Scope project
- Subreason
environment
The declared Lean environment could not be loaded or identified, so the requested audit could not run. The result is INCOMPLETE, not a violation of the source.
What to do. Repair the workspace so Lake can load it with its exact toolchain and dependencies, then rerun the same command.
- Requirement
- The audit runs in the declared environment: Lake loads the workspace with the pinned toolchain and resolves every dependency.
- Reported in
- Enforcement
- Strict, like every rule: see how rules are enforced.
Checked example
Diagnostic demonstration: the violating run is INCOMPLETE by design. It shows the exact diagnostic and is not accepted negative evidence. The corrected input passed a completed positive check.
Violating input
lake-manifest.json (written by the qualification runner) differs; its change is shown under Correction.
lakefile.lean (written by the qualification runner) differs; its change is shown under Correction.
Unchanged input
Example.leansource examples/rules/RG2001/Example.lean/-! # Reflexivity
Reflexivity for every natural number. -/
theorem reflexive (n : Nat) : n = n := rfl
Findings of the violating run
RG2001 error incomplete fresh file
Subject <example> at project <example>
lake-workspace-load-failed: unavailable: package directory not found: <example>/./missingCorrection
lake-manifest.json β― 7 unchanged lines
"inherited": false,
"dir":
"<regula>",
- "configFile": "lakefile.lean"},
- {"type": "path",
- "name": "unavailable",
- "manifestFile": "lake-manifest.json",
- "inherited": false,
- "dir": "./missing",
"configFile": "lakefile.lean"}],
"name": "regula",
"lakeDir": ".lake",
"fixedToolchain": false}
lakefile.lean β― 3 unchanged lines
leanOptions := #[β¨`autoImplicit, falseβ©, β¨`relaxedAutoImplicit, falseβ©, β¨`linter.missingDocs, trueβ©]
require regula from "<regula>"
@[default_target] lean_lib Example
-
- require unavailable from "./missing"
The examples are the qualification runner's requests for the same Example.lean. The correction removes a Lake dependency that cannot be resolved (the violating workspace adds require unavailable from "./missing"); the Lean source is unchanged.
Checked by a fresh single-file audit of <example>/Example.lean (axiomGate --file, claim kernel-only, execution checked): violating run incomplete, corrected run completed.
How to fix it
-
Read the original setup error in the diagnostic detail and fix it: a missing path dependency, an unresolvable Git revision, or a toolchain that does not match
lean-toolchain. -
Provision pinned dependencies (for example
lake exe cache getfor Mathlib) before auditing; provisioning is setup, not verification. -
Rerun the audit; a new run produces new, complete evidence.
Why it matters
Every conformance claim is about one exact elaboration environment: toolchain, dependency revisions and source state. A result under an unknown or different environment is not evidence for the declared one.
What triggers it
Setup checks load the Lake workspace, resolve dependencies to exact source states, and establish the compiler assumptions the audit needs. A failure (for example lake-workspace-load-failed when a required package directory is missing) is reported with impact incomplete.
RG2001 is also the finding for any other error that escapes the audit before a more specific rule classifies it (for example a malformed Lake query result). Read the detail: it names the failing step. Such an error is INCOMPLETE, never a pass.
A checker worker that loads a built environment for inspection and fails (for example an import conflict, or Lean's maximum recursion depth) is RG2001 too: the detail names the environment it was inspecting and carries the worker's own error text, and the result lists the stages that completed before it.
What a passing result establishes
A passing result was produced in the declared environment: Lake loaded the workspace with the exact toolchain and resolved dependency state the result reports. An unavailable or unidentified environment is incomplete and never accepted.
It does not establish:
-
That a dependency checkout matches its recorded revision's content: dependency acquisition is a trusted mechanism.
-
Anything about the source; no declaration was inspected.
It leaves these review obligations open: R-QUALIFY.
Configuration and exceptions
There is no configuration that turns an incomplete setup into a pass.
Limitations and unsupported cases
This page's example is a diagnostic demonstration: the violating run is INCOMPLETE by design and is not accepted negative evidence. Its corrected counterpart passed a completed positive check.
Sources
- Normative clauses
- standard Β§7.1 Declare the Elaboration Environment
- Checklist rows
DECL-01,DECL-04- Detector, policy and proof sources
lean/Regula/Checker/Workspace.lean,lean/Regula/Checker/Lake.lean,lean/Regula/Checker/ResultProtocol.lean- Proved linkage
- None. Setup failures and escaped audit errors reach this rule by their error message prefix, failing closed to INCOMPLETE; that classification is not proved.