Conversation
Add a Lake project in misc/lean for Lean 4 models of Materialize, with a sample model of update collections that proves consolidation preserves multiplicities and leaves no zero diffs. warningAsError makes any sorry fail the build. The lean mzbuild image installs the toolchain pinned in lean-toolchain and builds the project's dependencies into the image. It copies only lean-toolchain, lakefile.toml and lake-manifest.json from misc/lean, so editing a model reuses the published image. The lean composition copies the mounted sources next to the baked dependencies and runs lake, and a new CI step runs it. Fix the mzbuild copy pre-image, which reported its inputs relative to the source directory instead of the repository root, so fingerprinting any image that used it failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QA LLM Review1. MEDIUM -- A model file that
|
Build every module under Mz/ with globs, so a model that Mz.lean does not import still fails the build on a sorry. Build each dependency's default targets in the image, since building the placeholder library only cloned them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Both QA findings are fixed in c289f51.
Posted by Claude Code. |
QA LLM Review1. MEDIUM -- The dependency loop ignores every
|
Build all dependency packages in one lake invocation. A for loop only reported the last package's status, so an earlier failure produced a published image without that package's modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fixed in a76a410: all packages now build in one Posted by Claude Code. |
Delete the static libraries, LLVM, .ilean files and sources from the toolchain, which shrinks it from 3.0 GB to 2.3 GB. Install the toolchain explicitly first, since elan otherwise downloads it lazily on first use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lean composition runs one short-lived container and no long-running service, so docker compose logs has nothing to collect and the check failed a passing build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QA LLM Review1. MEDIUM -- The stripped toolchain makes the dependency bake fail for Batteries, Aesop and Mathlib
The bake step's DetailsReproduced by adding Batteries A fix that keeps the 0.7 GB saving is to delete these files after the bake, in the same |
Batteries, which Aesop and Mathlib require, lists the runLinter executable in its default targets. Linking it needs the static libraries and LLVM, so stripping them breaks the dependency build as soon as any common library is added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fixed in 99fd85f, which keeps the whole toolchain again. Confirmed: Batteries' Posted by Claude Code. |
Motivation
Lean 4 models of Materialize have each brought their own Docker image and CI script. This PR adds one shared Lake project, one toolchain image, and one CI step, so the next model only adds a file under
misc/lean/Mz/.Description
misc/leanis a Lake project with a single library,Mz. WithwarningAsErrorset, asorryor any warning fails the build. The sample model,Mz/Collection.lean, proves that consolidating(record, diff)updates keeps every record's multiplicity and leaves no zero diffs.misc/images/leanis an mzbuild image. It installs the toolchain named inlean-toolchainthrough a pinned elan release and builds the project's dependencies into the image. It copies onlylean-toolchain,lakefile.toml, andlake-manifest.json, so editing a model reuses the published image.leancomposition mounts the sources read-only and copies them next to the dependencies built into the image before runninglake. Mounting the sources over the workspace would hide those dependencies.bin/mzcompose --find lean run defaultrunslake build, and any extra arguments are passed tolake.type: copymzbuild pre-image had a bug. It reported its inputs relative to the source directory, not the repository root, so fingerprinting any image that used it crashed. Until now, no image used it.Verification
Two deliberate breaks fail the build: adding a
sorry, and makinginsertkeep zero diffs. Editing a model leavesbin/mzimage fingerprint leanunchanged, and editinglakefile.tomlchanges it.Posted by Claude Code.
🤖 Generated with Claude Code