[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"aXRwOb2LWd":3},"# Lean Beam\n\nLean Beam is an experimental project for efficient interaction with Lean from AI-assisted and\ntool-assisted workflows. It combines new [Lean LSP extensions](docs/STATUS.md#core-lean-surface)\nwith a thin local broker. The extensions provide Lean-specific capabilities, and the broker exposes\nthem through a [`lean-beam` CLI](docs/SETUP.md#use-beam-from-a-lean-project) and an\n[MCP server](docs/SETUP.md#mcp-setup) for agent- and tool-facing workflows.\n\n```mermaid\nflowchart TB\n  subgraph level1[\"Level 1: agents and tools\"]\n    cli[\"CLI / shell / agent\"]\n    mcp[\"MCP client / agent\"]\n  end\n\n  subgraph level2[\"Level 2: Beam broker\"]\n    broker[\"Beam broker\u003Cbr/>request routing\u003Cbr/>session ownership\"]\n  end\n\n  subgraph level3[\"Level 3: Lean instances\"]\n    subgraph lsp1[\"Lean LSP server\"]\n      lean1[\"Lean\"]\n      plugin1[\"Beam LSP plugin\"]\n    end\n    subgraph lsp2[\"Lean LSP server\"]\n      lean2[\"Lean\"]\n      plugin2[\"Beam LSP plugin\"]\n    end\n    subgraph lspn[\"Lean LSP server\"]\n      leanN[\"Lean\"]\n      pluginN[\"Beam LSP plugin\"]\n    end\n  end\n\n  cli -- lean-beam --> broker\n  mcp -- lean-beam-mcp --> broker\n  broker --> lsp1\n  broker -- Lean LSP + Beam requests --> lsp2\n  broker --> lspn\n  lean1 --- plugin1\n  lean2 --- plugin2\n  leanN --- pluginN\n```\n\nBeam keeps the agent-facing surface small: clients talk to the broker, and the broker owns request\nrouting plus one or more Lean LSP sessions with the Beam plugin loaded.\n\nBeam lets a client try Lean commands or tactics at specific positions in saved files without\nchanging those files. The central Beam extension is speculative execution through\n[`runAt`](docs/STATUS.md#core-lean-surface), exposed by the CLI as\n[`lean-beam run-at`](docs/SETUP.md#use-beam-from-a-lean-project) and through MCP as\n[`lean_run_at`](docs/MCP.md#client-tool-semantics). Because these probes can be issued\nconcurrently, agents and tools can cheaply explore several \"would this work here?\" possibilities in\nthe real module context.\n\nTogether, the LSP extensions, CLI, and MCP interface are intended to make that loop cheaper and more\nstructured than repeatedly creating scratch files or using full `lake build` runs as the inner loop.\n\nBeam is implemented in Lean, which lets it integrate more directly with Lean server state, saved\nsnapshots, and synchronization where that matters.\n\nWe have found Beam useful for proof repair, proof search experiments, proof translation and porting,\nautoformalization experiments, and regular AI-assisted Lean editing.\n\nFeedback is welcome through GitHub issues or Lean Zulip. For structured bug reports from a local\ncheckout, `lean-beam feedback --stdin` can produce a pasteable report card; see\n[docs/FEEDBACK.md](docs/FEEDBACK.md).\n\nLean Beam is experimental beta software. It is not an official Lean FRO product. Current\nscope, limitations, and release direction are tracked in [docs/STATUS.md](docs/STATUS.md).\n\nMost readers should start with [Install](#install), then use [docs/SETUP.md](docs/SETUP.md) for\ntoolchains, first CLI commands, agent-skill setup, and MCP registration. Release-facing changes are\ntracked in [CHANGELOG.md](CHANGELOG.md).\n\n## Current Beta Surface\n\nThe current development line includes support for:\n\n- speculative Lean execution with [`runAt`](docs/STATUS.md#core-lean-surface)\n- incremental synchronization of Lean's view of a file after edits with\n  [`sync`](docs/SYNC_AND_DIAGNOSTICS.md#command-model)\n- actionable file information with [`todo`](docs/STATUS.md#core-lean-surface), including sorries,\n  holes, diagnostics, code actions, and incomplete proofs\n- saving `.olean` artifacts from an interactive session with\n  [`save`](docs/SYNC_AND_DIAGNOSTICS.md#command-model)\n- selected Lean/LSP features through the same\n  [CLI](docs/SETUP.md#use-beam-from-a-lean-project) and\n  [MCP](docs/MCP.md#client-tool-semantics) interfaces, including hover, signature help,\n  definitions, references, document/workspace symbols, and proof-state inspection\n- feedback report cards for bug reports and project feedback through\n  [`lean-beam feedback`](docs/FEEDBACK.md) and MCP [`beam_feedback`](docs/FEEDBACK.md#mcp)\n\nSee [docs/STATUS.md](docs/STATUS.md) for the current supported surface, known limitations, and\nrelease direction.\n\n## Install\n\nInstall or update Beam from a Lean Beam checkout:\n\n```bash\n./scripts/install-beam.sh\n```\n\nRun the installer again when you update the checkout and want the installed runtime to match it.\nSetup details, supported toolchains, agent-skill installation, MCP registration, direct CLI\nexamples, installer locations, overrides, and offline advice live in\n[docs/SETUP.md](docs/SETUP.md).\n\nLean Beam serves validated Lean toolchains listed in\n[`supported-lean-toolchains`](supported-lean-toolchains). See\n[docs/SETUP.md](docs/SETUP.md#supported-toolchains-and-bundles) for bundle setup and\n[docs/CUSTOM_TOOLCHAINS.md](docs/CUSTOM_TOOLCHAINS.md) for explicitly accepted local Lean builds.\n\n## Documentation Map\n\nFor users:\n\n- [docs/SETUP.md](docs/SETUP.md): install, toolchain, first-use, MCP, and installer reference.\n- [docs/CUSTOM_TOOLCHAINS.md](docs/CUSTOM_TOOLCHAINS.md): explicit local Lean toolchain support.\n- [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md): pre-stable compatibility policy and supported\n  targets.\n- [docs/ROCQ.md](docs/ROCQ.md): optional Rocq goal probes for Rocq-to-Lean porting.\n- [docs/FEEDBACK.md](docs/FEEDBACK.md): feedback report cards for useful bug reports.\n- [docs/STATUS.md](docs/STATUS.md): current scope, limitations, and direction.\n- [CHANGELOG.md](CHANGELOG.md): release-facing changes.\n\nFor agent workflows:\n\n- [skills/lean-beam/SKILL.md](skills/lean-beam/SKILL.md): Lean workflow contract.\n- [skills/rocq-beam/SKILL.md](skills/rocq-beam/SKILL.md): auxiliary Rocq workflow surface.\n\nFor contributors and maintainers:\n\n- [CONTRIBUTING.md](CONTRIBUTING.md): commit, PR, and contributor workflow guidance.\n- [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md): maintainer workflow and implementation notes.\n- [docs/TESTING.md](docs/TESTING.md): developer test-suite guidance and coverage map.\n- [docs/SYNC_AND_DIAGNOSTICS.md](docs/SYNC_AND_DIAGNOSTICS.md): sync, save, progress,\n  diagnostics, and readiness contract.\n- [docs/MCP.md](docs/MCP.md): current MCP maintainer architecture and conformance notes.\n- [AGENTS.md](AGENTS.md): repo-specific agent instructions.\n\n## Contributing And Help\n\nThe main goal of the beta development cycle is to gather feedback from Lean users and tool authors.\nBug reports, design feedback, and documentation improvements are welcome through\n[GitHub issues](https://github.com/ejgallego/lean-beam/issues). Discussion is also welcome on the\n[Lean Zulip](https://leanprover.zulipchat.com).\n\nBefore contributing code or docs, read [CONTRIBUTING.md](CONTRIBUTING.md). Maintainer workflow notes\nlive in [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).\n\n## License\n\nApache-2.0. See [LICENSE](LICENSE).\n",1783784680141]