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.

porttyperequireddescriptionconstraint
inpaperSlugBuild one paper instead of all of them.string · pattern ^[a-z0-9][a-z0-9-]*$ · A folio slug, e.g. quantum-observable-universe
incacheFlagFetch 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
inupdateFlagRun lake update before building.boolean · A boolean switch — projects to a bare flag, with no value word
inlogDirRepoPathWhere 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.
outstatusRepoPathlean-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-all runs cat-harness-tools/scripts/lean-build-all.sh (declared in cat-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.

installnone
runtimebash, lean, lake
networkyes

When a host it reaches is refused:

host / errorremedy
release.lean-lang.orgtool lean-toolchain-setup
github.comnone: Lake fetches the declared dependencies from GitHub; with it refused they cannot resolve.

What it is made of

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."
    }
  ]
}

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev