Repository navigation
Releases
v0.17.3
What's Changed
- docs(readme): link lean-intent from verdict limits by @rbeauchamp in #608
- feat: admit closed IEEE-754 moreLeancArgs allowlist in RG1010 by @rbeauchamp in #609
- fix: admit "expose" atom in RG1010 for sectionHeader and derivingClass by @rbeauchamp in #610
Full Changelog: v0.17.2...v0.17.3
v0.17.2
What's Changed
- perf(Regula): accelerate Facts.prepare and sharded proof front-end, and prepare v0.17.2 by @rbeauchamp in #607
Full Changelog: v0.17.1...v0.17.2
v0.17.1
What's Changed
- chore(gate): enable lint.covered_by_test in .no-mistakes.yaml by @rbeauchamp in #605
- perf(Regula): accelerate Sha256, parallelize envTableDigest, and prepare v0.17.1 by @rbeauchamp in #606
Full Changelog: v0.17.0...v0.17.1
v0.17.0
What's Changed
- feat(Regula): add sharded proof replay, verify_shards, and prepare v0.17.0 by @rbeauchamp in #604
Full Changelog: v0.16.2...v0.17.0
v0.16.2
What's Changed
- chore: upgrade lean-intent to v0.3.0 and backfill governance rules by @rbeauchamp in #600
- ci: add immutable GHCR CI package publishing workflow by @rbeauchamp in #601
- perf(Regula): parallelize RG2001 kernel cone replay with persistent spine by @rbeauchamp in #602
- chore(release): bump package version to 0.16.2 by @rbeauchamp in #603
Full Changelog: v0.16.1...v0.16.2
v0.16.1
What's Changed
- ci: add source-only release workflow and exact-ref gate checks by @rbeauchamp in #592
- build(specification): pin lean-intent at release v0.1.0 by @rbeauchamp in #593
- ci(gate): adopt lean-intent required-theorems and implementation checks by @rbeauchamp in #594
- ci(gate): pin no-comments v0.3.1, run RequiredGate via --run, and record gate footprint by @rbeauchamp in #595
- refactor: drain all Lean comments to zero and complete Option R1 documentation migration by @rbeauchamp in #596
- ci: add collaborator-aware issue auto-assignment workflow by @rbeauchamp in #597
- fix(docs,release): enforce release version parity, remove hardcoded doc tags, and reorganize README by @rbeauchamp in #599
Full Changelog: v0.16.0...v0.16.1
v0.16.0
Regula v0.16.0 adds out-of-tree strict proof verdict mode (REGULA_PROOF=DIR lake exe lint PROFILE) on pinned Lean v4.36.0 (611c117bfaf7b7ae1cfcf246ce6fba31e8f509e9) for already-built zero-dependency lakefile.toml Lean 4 packages (#583 / PR #589), while keeping every existing in-tree lake lint and full-gate REGULA_FULL guarantee unchanged.
Use out-of-tree proof verdict mode (no [[require]] in target lakefile.toml):
# In target zero-dependency lakefile.toml package
lake build --wfail
# From this built Regula v0.16.0 checkout
REGULA_PROOF=/path/to/project lake exe lint standard-logicalChanges since v0.15.0
- Out-of-tree strict proof verdict mode (
REGULA_PROOF=DIR, #583 / PR #589): Loads already-built zero-dependencylakefile.tomlpackages without modifyingDIR/lakefile.tomlorDIR/lake-manifest.json, refusesDIR/lakefile.leanpre-load shadowing, emptyREGULA_PROOF, dualREGULA_FULL+REGULA_PROOF, and empty or non-librarydefaultTargets, replays the claim's cone into Lean's kernel, checksRG1001–RG1006andRG1011–RG1013, and emits coverage plusregula: proof verdict: pass, which says nothing about what ran during the build, on <realDir>. - Specifications, proofs, and gate isolation: Proves end-to-end equivalence, refusal separation, owedness, witness existence, and zero trusted-base expansion (
Route.outOfTreeProofadds zero newOporAssumptionconstructors) acrossRegulaSpecification, and clearsREGULA_PROOFalongsideREGULA_FULLinRegula.DiagnosticsGatechild invocations.
Full Changelog: v0.15.0...v0.16.0
v0.15.0
Regula v0.15.0 reads one Lean release, leanprover/lean4:v4.36.0 (611c117bfaf7b7ae1cfcf246ce6fba31e8f509e9), and refuses any other via Regula.Shell.supportsLean (exit 2) and RG1010 (exit 1). It is a breaking pre-1.0 minor release over v0.14.0: projects staying on Lean v4.35.0 must remain on v0.14.0 (or v0.13.0 for the earlier rule set; projects on Lean v4.36.0 needing the v0.13.0 rule set use v0.13.1). All eleven checks (RG1001 to RG1006, RG1010 to RG1013, and RG2001), proved-safe 2-space-indented fix: guidance beneath every finding, and STANDARD.md ship at Lean v4.36.0 with the structural T.ctorIdx / T.ctorIdx._impl exemption across RG1006 and RG1011.
Use it. Put leanprover/lean4:v4.36.0 in lean-toolchain, and add this to lakefile.toml, with one profile in lintDriverArgs:
lintDriver = "regula/lint"
lintDriverArgs = ["standard-logical"]
[[require]]
name = "regula"
git = "https://github.com/rbeauchamp/regula"
rev = "v0.15.0"Run lake update regula, and then run these two commands in order on one build, from the project's own directory with no option of Lake's and REGULA_FULL unset:
lake build --wfail
lake lintFull gate (standalone no-require libraries):
git clone --branch v0.15.0 https://github.com/rbeauchamp/regula
cd regula
lake build lint
REGULA_FULL=/path/to/project lake exe lint standard-logicalBREAKING CHANGE — upgrading from v0.14.0.
- Change
lean-toolchaintoleanprover/lean4:v4.36.0, setrev = "v0.15.0", and runlake update regula. For the full verdict, build a clone of tagv0.15.0. - Lean
v4.36.0pin and structuralctorIdxexemption (Option A1): Leanv4.36.0(mkCtorIdx) generates anunsafedefinitionT.ctorIdx._implcallinggetObjTagNatand attaches@[implemented_by T.ctorIdx._impl]to the safeT.casesOn-basedT.ctorIdxon safe, non-Prop, non-single-constructor, non-runtime-builtin inductives whoseT.casesOneliminates into an extra universe parameter.v0.15.0exempts only structurally verifiedT.ctorIdx(from RG1011's@[implemented_by]clause only) andT.ctorIdx._impl(from RG1006's safety and helper-name clauses only), preserving every otherunsafe,partial, recursion-helper, loop,Lean.Order.fix,@[implemented_by],@[extern],@[init]/@[builtin_init], and foreign@[csimp]refusal.
Changes since v0.14.0
- Lean
v4.36.0upgrade (#585): Moveslean-toolchain,specification/lean-toolchain,Regula.Closed.pinnedLean,Regula.Language.leanToolchain,Regula.Language.Report.label,Regula.Shell.profileOfRun,.github/workflows/gate.yml(lean-4.36.0-linux.zipSHA-25692a996be487b48e1c2f2985be6b150490475c94d02f5a5e26665a9dab780902a), and published pins tov0.15.0and Leanv4.36.0, updatingspecification/'slean-intentdependency pin (631ed3a2196040bf491289de67da760c9eeb59f5). - Structural
T.ctorIdx/T.ctorIdx._implverification across RG1006 and RG1011 (#585): ExtendsDeclandTableswithCtorIdxForm/ctorIdxPair, verifiesT.casesOndirectly againstLean.mkCasesOnImp env.toKernelEnv T, reduces inductive types purely viaLean.Kernel.whnf(with a documented fail-closed boundary for non-canonical universe-polymorphic type aliases) and checks head-beta binder domains viaLean.Expr.headBeta, checks runtime builtins viaLean.Compiler.LCNF.isRuntimeBuiltinType(proved equal toRuntimeBuiltinTypes), checksisExtern = falseandinitFn = noneon both halves, proves full bidirectional equivalence (rg1006_exact,rg1011_exact,isCtorIdxDef_eq,isCtorIdxImpl_eq,ctorIdxFormOf_eq_iff,pass_iff,pass_held), provesctorIdxImpl_unreachedunder H6 (SafeMentionsSafe), and provides non-vacuity and forgery witnesses (Witnesses.withCtorIdx,withForgedCtorIdx,withForgedCtorIdx11). - Trusted base (
RegulaSpecification.Assumptions.Assumption, 19 entries): AddsAssumption.ctorIdxTag(trustinglean_obj_tag_natbehindgetObjTagNatto matchT.casesOnfor verified pairs) alongside the corresponding compiler-generatedT.ctorIdxcarve-out inAssumption.h2andLeanBehaviour.NoProjectCode, and re-reads all 19 Lean, Lake, and OS source citations against Leanv4.36.0.
Full Changelog: v0.14.0...v0.15.0
v0.14.0
Regula v0.14.0 reads one Lean release, leanprover/lean4:v4.35.0, and refuses any other. It is a breaking release (bumping 0.13.0 to 0.14.0 under pre-1.0 Semantic Versioning): RG1013 now refuses claimed modules whose files are not module files under both verdicts (including the files lake new generates at Lean v4.35.0), RG1011 refuses replaced compiled code and foreign claimed-module @[csimp] entries, RG1012 refuses direct panic forms in claimed definitions and opaque constants, RG1006 also refuses direct Lean.Order.fix (partial_fixpoint) mentions in claimed definitions and opaque constants, and every registered rule now emits a proved-safe, 2-space-indented fix: ... guidance line beneath each finding. All eleven checks (RG1001 to RG1006, RG1010 to RG1013, and RG2001) ship in v0.14.0, together with the standalone Lean 4 engineering standard in STANDARD.md and the noncomputable boundary documentation. The README and specification/README.md at the tag state each check and what is proved of it.
Use it. Put leanprover/lean4:v4.35.0 in lean-toolchain, and add this to lakefile.toml, with one profile in lintDriverArgs:
lintDriver = "regula/lint"
lintDriverArgs = ["standard-logical"]
[[require]]
name = "regula"
git = "https://github.com/rbeauchamp/regula"
rev = "v0.14.0"Run lake update regula, and then run these two commands in order on one build, from the project's own directory with no option of Lake's and REGULA_FULL unset:
lake build --wfail
lake lintBREAKING CHANGE — upgrading from v0.13.0.
- Change
revto"v0.14.0"and runlake update regula. For the full verdict, build a clone of the tagv0.14.0. - RG1013 (
modulefiles): Every claimed Lean file must be amodulefile (start withmodule, usingpublic section,@[expose], orimport allwhere other files unfold bodies). The files thatlake newgenerates at Leanv4.35.0have nomoduleheader and fail RG1013 until migrated. Lean refuses amodulefile that imports a non-modulefile, so dependencies imported by claimed modules must also bemodulefiles (Mathlib.leanand each file belowMathlib/at Mathlib's tagv4.35.0were measured asmodulefiles). - Additional new refusals: Projects that v0.13.0 passed can now get findings or
incompletefrom RG1011 (@[implemented_by],@[extern],@[init]/@[builtin_init]naming an initialization function on claimed definitions, exported claimed-module@[csimp]entries targeting theorems not declared in any claimed module, and loader RG2001 checks for hidden module-local entries or missing claimed module indices), RG1012 (direct panic forms in claimeddef/opaquevalues), and RG1006'sLean.Order.fix(partial_fixpoint) clause on claimeddef/opaquevalues. - Diagnostic output format: Each finding of a registered rule keeps its primary line (
RGxxxx <subject>: <reason>) unchanged and adds one 2-space-indentedfix: ...guidance line directly beneath it, escaping LF and CR. The finding count line and final verdict line are unchanged.
The two verdicts
- The proof verdict, from
lake build --wfailandlake linton one build, means that the proofs of the claimed modules are sound and use only axioms that the profile allows, that Lean read each claimed module as amodulefile (RG1013), that no claimed constant has@[implemented_by]or@[extern], no claimed definition has an initialization function by@[init]or@[builtin_init], and every exported (globalorscoped)@[csimp]entry registered in a claimed module names a theorem declared in some claimed module (RG1011, with loader checks under RG2001), that no claimed definition or opaque constant directly mentions a panic form (RG1012) orLean.Order.fix(RG1006), and that no claimed constant violates RG1001 to RG1006—for a project that places no file or code aimed at the checker or the toolchain. Beyond those checks, the proof verdict says nothing about compiled execution or whether a claimed data-valued definition has executable code (attribute [local csimp], dependency-registered@[csimp], dependency and toolchain constants,noncomputabledefinitions, and RG1006-exempted constants added by build-time code stay outside it).lake build --wfailis Lake's own command and the replay is Lean's ownKernel.Environment.replay: Regula makes no claim of its own about what they decide, and proves which constants it gives the replay. - A project that may be aimed at the checker needs the full verdict. The two commands run in the project's own Lake, so a project written to attack the checker can make them print a pass whatever its build holds, an unsound proof included, by four routes: a library loaded from the project's own library directory into the checker, a doctored copy of Regula from its configuration or package directory, a
lakefile.lean, or code that runs while it builds. The full verdict closes each of them. A project with a dependency or with Mathlib in its imports gets only the proof verdict, so Regula gives no verdict that holds of such a project if it is aimed at the checker. - The full verdict, from
REGULA_FULL=DIR lake exe lint PROFILEin a checkout of Regula built apart from the project (git clone --branch v0.14.0 https://github.com/rbeauchamp/regula, thenlake build lintin it), also means that no code written in the project ran while Lake built the files that the check read, and that no file installed anything that replaces what the compiler runs for a definition. That rests on hypotheses H1 to H5 and the rest of the list of assumptions below. No proof here can examine Lean's own program, so a route that H2 misses would be a false pass. Only a project with norequireinlakefile.tomland no Mathlib in its imports can have this verdict; for any other project the full gate builds nothing, says that only a proof verdict is possible, and exits with 3.
The last line of a run names its verdict, such as regula: proof verdict: fail, and a pass ends that line with the directory it audited.
Where the claim holds
The claim holds only for these named configurations:
- Lean
v4.35.0, at commiteb6cafb7290e8bd5f2937522d8d804f58f02bafc, withlakeandleanthat toolchain's programs. - For the proof verdict,
lake lintfrom the project's own directory, with no option of Lake's andREGULA_FULLunset. For the full verdict,REGULA_FULL=DIR lake exe lint PROFILEfrom the directory of a checkout of Regula built apart from the project, with no option of Lake's. - Two platforms, on which the operating-system assumptions were observed: macOS 27.2 on Apple silicon (arm64) and Ubuntu 24.04.5 LTS on x86-64. The 8-step local gate ran on macOS 27.2 (arm64) and on GitHub's
ubuntu-24.04(x86-64) runner at this release.
Outside the contract, and not defects: Windows, another release of macOS, another distribution, release or architecture of Linux, another Lean, starting the full gate from a project's Lake, lake -d, lake -f and every other option of Lake's, starting through lake test or lake env, and lake lint with REGULA_FULL set. Also outside: for a proof verdict, a project that places a file or code aimed at the checker or the toolchain, and what the code of a claimed module or of a dependency does while it is built; another process that changes the project, the checker's tree or a build during a run; a call that does not return, and a TMPDIR that names nothing; what a theorem means to a reader; and anything about a dependency's code.
The list of assumptions remains 18 entries (Assumption in specification/RegulaSpecification/Assumptions.lean), each with its pinned source at Lean v4.35.0: Lean holds kernel, h6, replay, compiler, h1, h2, usedConstants, leanImport, leanVersion and platform; Lake holds lakeLoad, h3, h5, lakeCommands and lakeStart; the operating system holds h4, files and processes. leanImport now also cites Lean's getInitFnNameFor?, getModuleIdx?, getModuleEntries (including Lean.Compiler.CSimp.ext.ext.getModuleEntries), and ModuleData.isModule.
What is proved
Lean checks these theorems of the specification package about the definitions that the checker runs, under the hypotheses each states:
- Each registered rule, RG1001 to RG1006 and RG1011 to RG1013, reports a subject exactly when it violates the rule over Regula's closed input (
rg1001_exacttorg1006_exact,rg1011_exacttorg1013_exact,rg1011_attributed), with the specification and checker registries proved equal (registry_rules), and linked to Lean's loaded environment (pass_iff,pass_floor,pass_held). - Every finding of a registered rule carries non-blank guidance by type (
finding_guidance_nonblank), and diagnostic serialization keeps the primary finding line unchanged while emitting one 2-space-indentedfix: ...line with LF and CR escaped (detailText_guidanceLine,say_guidanceLine_spec). - The replay receives exactly the claim's cone (
mem_cone_env,replayConstants_env), each claimed constant is in it (claimed_inCone), each claimed theorem is kept or replayed under a fresh name (claimed_theorem_replayed,copy_name_fresh), single-pass table preparation agrees withdecision(decisionPrepared_eq), and exit 0 requires replay success (plain_exit_zero,full_exit_zero). - The language check admits a project exactly when everything it reads is in the closed set (
decision_admitted_iff), every non-pass rests on the published closed list of refusals (run_meets), a run with no refusal on which the rules hold passes (plain_owed,full_owed,run_plain_owed,run_full_owed), and the specification build fails for any unlisted operation, route, premise, or toolchain version (Assumption.ofOp,run_route,meaning,readAt_pinned).
A pass does not mean that the code is correct. No checker ca...
Regula v0.13.1
Regula v0.13.1 is a compatibility release on the v0.13.x series for leanprover/lean4:v4.36.0 (611c117bfaf7b7ae1cfcf246ce6fba31e8f509e9). It keeps the exact rule set of v0.13.0 (RG1001 to RG1006, RG1010, and RG2001) and refuses any Lean release other than v4.36.0.
Use it. Put leanprover/lean4:v4.36.0 in lean-toolchain, and set rev = "v0.13.1" in lakefile.toml, then run lake update regula, lake build --wfail, and lake lint. For the full verdict, build a clone of the tag v0.13.1.
Changes since v0.13.0
- Lean v4.36.0 toolchain support: Updates
lean-toolchain,Verdict.pinnedLean, language-check labels, and all Lean and Lake source citations to Lean v4.36.0 (611c117bfaf7b7ae1cfcf246ce6fba31e8f509e9). - RG1006 exact structural exemption for Lean v4.36.0
ctorIdx: Lean v4.36.0 generates anunsafehelperT.ctorIdx._impl(calling@[extern "lean_obj_tag_nat"] unsafe opaque getObjTagNat) and attaches@[implemented_by]toT.ctorIdxfor every non-Prop, non-builtin inductive typeTwithnumCtors != 1. RG1006 now exemptsT.ctorIdx._implonly when bothT.ctorIdxandT.ctorIdx._impllive in the same module as a safe inductiveTand structurally match Lean'smkCtorIdxandmkCtorIdxImplexpressions (includingu.isNeverZero, constructor indices, and toolchaingetObjTagNat), closing plain-source proof-verdict forgeries. - Specification and trusted base: Adds
Assumption.ctorIdxTag(19 assumptions total) and records the 2026-11-20 owner confirmation inspecification/confirmation.md, re-verifies H1 (474 commands across 15 default-target files, 0 differences) and H2 (60 eval-site files) against Lean v4.36.0 source, and updatesspecification/tolean-intentbd7af6c0fc90d7adddcfd03fed93cf63eef1e3b3on Lean v4.36.0.
Full Changelog: v0.13.0...v0.13.1