Lean build
Build every Lean project in the workspace from the root Lake manifest, so cross-package dependencies resolve against it rather than a possibly-stale per-paper manifest. Writes a committable build-status sidecar every run.
Skills it satisfies
A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.
lean-build-fix
Iteratively fix Lean build errors and linter warnings until the build passes cleanly. Uses MCP diagnostics when available, falls back to parsing lake build output.
Source: folio-assistant-sci/skills/content/folio-paper-adapter/lean-build-fix.md.
The skill declares no I/O contract (schemas/skills/lean-build-fix/{input,output}.schema.json).
Inputs and outputs
Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.
| port | type | required | description | constraint | |
|---|---|---|---|---|---|
| in | paper | Slug | Build one paper instead of all of them. | string · pattern ^[a-z0-9][a-z0-9-]*$ · A folio slug, e.g. quantum-observable-universe | |
| in | cache | Flag | Fetch the Mathlib cache first. A from-source Mathlib build is 30–60 minutes against ~2 for a restore. | boolean · A boolean switch — projects to a bare flag, with no value word | |
| in | update | Flag | Run lake update before building. | boolean · A boolean switch — projects to a bare flag, with no value word | |
| in | logDir | RepoPath | Where logs and the status sidecar go. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| out | status | RepoPath | lean-build-status.json — committable, so a green build is distinguishable from one nobody ran. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. |
Processes and tasks
No process step names a skill this Tool satisfies.
How it is deployed and reached
- Command line. From the repository root:
bun run cat lean:build-all.cat lean:build-allrunscat-harness-tools/scripts/lean-build-all.sh(declared incat-harness-tools/package.json). - GitHub Actions. No workflow in this checkout runs its command.
As an API: its operation in the OpenAPI document and the MCP tool list of its layer.
| install | none |
| runtime | bash, lean, lake |
| network | yes |
When a host it reaches is refused:
| host / error | remedy |
|---|---|
release.lean-lang.org | tool lean-toolchain-setup |
github.com | none: Lake fetches the declared dependencies from GitHub; with it refused they cannot resolve. |
What it is made of
| role | file | |
|---|---|---|
| definition | folio-assistant-sci/tools/lean-build/lean-build.ts | |
| script | cat-harness-tools/scripts/lean-build-all.sh |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/folio-assistant-sci/tools/lean-build.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.
{
"@context": "https://litlfred.github.io/folio-assistant/folio-assistant-sci/folio-assistant-sci.context.jsonld",
"@id": "https://litlfred.github.io/folio-assistant/folio-assistant-sci/tools/lean-build.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/folio-assistant-sci/folio-assistant-sci.jsonld",
"name": "lean-build",
"title": "Lean build",
"description": "Build every Lean project in the workspace from the root Lake manifest, so cross-package dependencies resolve against it rather than a possibly-stale per-paper manifest. Writes a committable build-status sidecar every run.",
"install": {
"none": true
},
"invoke": {
"shell": "bun run cat lean:build-all"
},
"io": {
"inputs": [
{
"name": "paper",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Slug",
"description": "Build one paper instead of all of them.",
"required": false,
"arg": {
"flag": "--paper"
}
},
{
"name": "cache",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Flag",
"description": "Fetch the Mathlib cache first. A from-source Mathlib build is 30–60 minutes against ~2 for a restore.",
"required": false,
"arg": {
"flag": "--cache"
}
},
{
"name": "update",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Flag",
"description": "Run `lake update` before building.",
"required": false,
"arg": {
"flag": "--update"
}
},
{
"name": "logDir",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "Where logs and the status sidecar go.",
"required": false,
"arg": {
"flag": "--log-dir"
}
}
],
"outputs": [
{
"name": "status",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "`lean-build-status.json` — committable, so a green build is distinguishable from one nobody ran."
}
]
},
"satisfies": [
"lean-build-fix"
],
"requirements": {
"runtime": [
"bash",
"lean",
"lake"
],
"network": true
},
"remedies": [
{
"host": "release.lean-lang.org",
"error": "Host not in allowlist",
"tool": "lean-toolchain-setup"
},
{
"host": "github.com",
"none": "Lake fetches the declared dependencies from GitHub; with it refused they cannot resolve."
}
]
}