lean-runtime 2.5.0__tar.gz → 2.6.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/CHANGELOG.md +32 -0
  2. {lean_runtime-2.5.0/lean_runtime.egg-info → lean_runtime-2.6.1}/PKG-INFO +23 -14
  3. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/README.md +22 -13
  4. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/cli.md +24 -9
  5. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/getting-started.md +47 -13
  6. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/local-projects.md +44 -7
  7. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/__init__.py +6 -0
  8. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/cli.py +180 -17
  9. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/models.py +1 -0
  10. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/project_sharing.py +100 -0
  11. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/projects.py +46 -1
  12. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/runtime.py +666 -131
  13. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/shared_projects.py +146 -1
  14. {lean_runtime-2.5.0 → lean_runtime-2.6.1/lean_runtime.egg-info}/PKG-INFO +23 -14
  15. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/pyproject.toml +1 -1
  16. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_cli.py +36 -0
  17. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_programs.py +1 -1
  18. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_projects.py +384 -11
  19. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/LICENSE +0 -0
  20. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/MANIFEST.in +0 -0
  21. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/environments.toml +0 -0
  22. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/core-v4.32.2.lock.json +0 -0
  23. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/leancert-v4.30.0.5.lock.json +0 -0
  24. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/leancert-v4.31.0.lock.json +0 -0
  25. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/leancert-v4.32.2.4.lock.json +0 -0
  26. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/leancert-v4.33.0.lock.json +0 -0
  27. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/mathlib-v4.30.0.lock.json +0 -0
  28. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/mathlib-v4.31.0.lock.json +0 -0
  29. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/mathlib-v4.32.2.lock.json +0 -0
  30. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/catalog/locks/mathlib-v4.33.0.lock.json +0 -0
  31. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/compatibility/README.md +0 -0
  32. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/compatibility/mathlib-4.32.2.json +0 -0
  33. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/compatibility/mathlib-4.32.2.toml +0 -0
  34. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/compatibility/mathlib-4.33.0.json +0 -0
  35. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/compatibility/mathlib-4.33.0.toml +0 -0
  36. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/architecture.md +0 -0
  37. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/captures.md +0 -0
  38. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/case-study-v1.md +0 -0
  39. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/development.md +0 -0
  40. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/environments.md +0 -0
  41. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/index.md +0 -0
  42. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/portable-copies.md +0 -0
  43. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/project-publishing.md +0 -0
  44. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/python-api.md +0 -0
  45. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/ready-programs.md +0 -0
  46. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/standalone-files.md +0 -0
  47. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/trust-and-limitations.md +0 -0
  48. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/docs/v1-precision.md +0 -0
  49. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/examples/mathlib.toml +0 -0
  50. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/__main__.py +0 -0
  51. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/_git.py +0 -0
  52. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/_paths.py +0 -0
  53. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/backends.py +0 -0
  54. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/bundles.py +0 -0
  55. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/capsules.py +0 -0
  56. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/comparison.py +0 -0
  57. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/console.py +0 -0
  58. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/decisions.py +0 -0
  59. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/diagnostics.py +0 -0
  60. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/__init__.py +0 -0
  61. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/analyzer.py +0 -0
  62. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/api.py +0 -0
  63. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/candidate.py +0 -0
  64. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/catalog.py +0 -0
  65. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/catalog_build.py +0 -0
  66. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/catalog_cli.py +0 -0
  67. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/catalog_manifest.py +0 -0
  68. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/data/catalog.json +0 -0
  69. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/defaults.py +0 -0
  70. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/engine.py +0 -0
  71. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/errors.py +0 -0
  72. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/module_inventory.py +0 -0
  73. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/planner.py +0 -0
  74. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/policy.py +0 -0
  75. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/probe.py +0 -0
  76. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/py.typed +0 -0
  77. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/result.py +0 -0
  78. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/schema_resources.py +0 -0
  79. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/schemas/catalog-v1.schema.json +0 -0
  80. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/schemas/plan-v1.schema.json +0 -0
  81. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/discovery/schemas/result-v1.schema.json +0 -0
  82. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/environments.py +0 -0
  83. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/errors.py +0 -0
  84. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/events.py +0 -0
  85. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/facade.py +0 -0
  86. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/frontmatter.py +0 -0
  87. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/health.py +0 -0
  88. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/lake.py +0 -0
  89. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/lockfiles.py +0 -0
  90. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/locking.py +0 -0
  91. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/matrix.py +0 -0
  92. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/oci.py +0 -0
  93. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/packs.py +0 -0
  94. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/policies.py +0 -0
  95. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/profiling.py +0 -0
  96. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/programs.py +0 -0
  97. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/publisher_verification.py +0 -0
  98. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/py.typed +0 -0
  99. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/references.py +0 -0
  100. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/resolver.py +0 -0
  101. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/run_cli.py +0 -0
  102. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/schema_resources.py +0 -0
  103. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/serialization.py +0 -0
  104. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/specs.py +0 -0
  105. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/store.py +0 -0
  106. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/timings.py +0 -0
  107. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/toolchain_oci.py +0 -0
  108. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/toolchain_slim.py +0 -0
  109. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/toolchains.py +0 -0
  110. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/verification.py +0 -0
  111. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime/wire.py +0 -0
  112. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime.egg-info/SOURCES.txt +0 -0
  113. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime.egg-info/dependency_links.txt +0 -0
  114. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime.egg-info/entry_points.txt +0 -0
  115. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime.egg-info/requires.txt +0 -0
  116. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/lean_runtime.egg-info/top_level.txt +0 -0
  117. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/mkdocs.yml +0 -0
  118. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/schemas/cleanup-v1.schema.json +0 -0
  119. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/schemas/comparison-v1.schema.json +0 -0
  120. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/schemas/execution-v1.schema.json +0 -0
  121. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/schemas/inspect-v1.schema.json +0 -0
  122. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/schemas/matrix-v1.schema.json +0 -0
  123. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/schemas/profile-v1.schema.json +0 -0
  124. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/schemas/verify-v1.schema.json +0 -0
  125. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/scripts/announcement_gate.py +0 -0
  126. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/scripts/registry_preflight.py +0 -0
  127. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/scripts/run_compatibility.py +0 -0
  128. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/scripts/run_v1_case_study.py +0 -0
  129. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/scripts/smoke_wheel.py +0 -0
  130. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/setup.cfg +0 -0
  131. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/conftest.py +0 -0
  132. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/discovery/e2e/test_real_discovery.py +0 -0
  133. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/discovery/test_analyzer.py +0 -0
  134. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/discovery/test_catalog.py +0 -0
  135. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/discovery/test_catalog_build.py +0 -0
  136. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/discovery/test_discovery_schema_resources.py +0 -0
  137. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/discovery/test_engine.py +0 -0
  138. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/discovery/test_planner.py +0 -0
  139. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/discovery/test_policy.py +0 -0
  140. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_backend.py +0 -0
  141. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_bundles.py +0 -0
  142. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_capsules.py +0 -0
  143. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_console.py +0 -0
  144. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_diagnostics.py +0 -0
  145. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_environment_integration.py +0 -0
  146. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_events_health.py +0 -0
  147. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_facade.py +0 -0
  148. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_frontmatter.py +0 -0
  149. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_git.py +0 -0
  150. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_interactive.py +0 -0
  151. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_lockfiles.py +0 -0
  152. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_models.py +0 -0
  153. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_multifile.py +0 -0
  154. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_packs.py +0 -0
  155. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_paths.py +0 -0
  156. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_prebuilt_policy.py +0 -0
  157. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_project_publish.py +0 -0
  158. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_references.py +0 -0
  159. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_run_cli.py +0 -0
  160. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_runtime.py +0 -0
  161. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_schema_resources.py +0 -0
  162. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_schemas.py +0 -0
  163. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_signatures.py +0 -0
  164. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_specs.py +0 -0
  165. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_store.py +0 -0
  166. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_toolchain_oci.py +0 -0
  167. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_toolchain_slim.py +0 -0
  168. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_toolchains.py +0 -0
  169. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_v1_precision.py +0 -0
  170. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_verification_inventory.py +0 -0
  171. {lean_runtime-2.5.0 → lean_runtime-2.6.1}/tests/test_verification_probe.py +0 -0
@@ -2,6 +2,38 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.6.1 - 2026-08-14
6
+
7
+ - Allow `lean-runtime init .` at an otherwise empty Git repository root while
8
+ preserving its original `.git` directory or worktree file, HEAD, and index.
9
+ Planning and execution now share target validation, so `init --plan` rejects
10
+ unsupported existing contents before reporting an acquisition-ready plan.
11
+ - Add `init --name NAME` for repository directories whose filesystem spelling
12
+ should not determine the Lake package and Lean root module name. Repeating
13
+ the same named initialization is idempotent; a conflicting name is rejected.
14
+ - Make `init --plan --offline` and `update --plan --offline` genuinely
15
+ network-free. Plans now report explicit blockers and return a failing status
16
+ when an exact local graph or required full toolchain is unavailable.
17
+
18
+ ## 2.6.0 - 2026-08-14
19
+
20
+ - Make the local-project path a four-command workflow: `init`, `check`,
21
+ `build`, and `update`. New projects use the newest stable cataloged Mathlib
22
+ by default; `--core` opts out, while `--mathlib VERSION` selects a release.
23
+ - Make `init` adopt an existing pinned Lake project without changing its graph,
24
+ or create a new project transactionally after its exact dependencies are
25
+ ready. `--plan`, `--offline`, `--max-download`, and `--seed-from` expose its
26
+ acquisition policy, and failed initialization leaves no partial project.
27
+ - Add persistent discovery of exact local Lake graphs. `scan` registers existing
28
+ projects as zero-download seeds for future initialization and updates.
29
+ - Preserve verified sparse-capsule build artifacts when materializing exact Git
30
+ sources for a mutable project, instead of throwing them away and forcing a
31
+ dependency rebuild.
32
+ - Add explicit, transactional `update` to the newest cataloged Mathlib, with an
33
+ old/new revision and toolchain preview and rollback after failed adoption.
34
+ - Include exact package revisions, Git tree hashes, and the shared workspace ID
35
+ in mutable-project check and build provenance.
36
+
5
37
  ## 2.5.0 - 2026-08-14
6
38
 
7
39
  - Make `lean-runtime init` create a concise `AGENTS.md` with build, checking,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lean-runtime
3
- Version: 2.5.0
3
+ Version: 2.6.1
4
4
  Summary: Run Lean 4 proofs from Python or standalone files
5
5
  Author: Alejandro Radisic
6
6
  License-Expression: Apache-2.0
@@ -181,31 +181,40 @@ project = lean.setup(project="./my-project")
181
181
  result = project.check_file("./my-project/MyProject/Main.lean")
182
182
  ```
183
183
 
184
- Create a normal Lake project whose exact dependencies are shared automatically:
184
+ Create a normal Lake project. The newest stable cataloged Mathlib is the
185
+ default, and exact dependencies are shared automatically:
185
186
 
186
187
  ```bash
187
- lean-runtime init MyProof --mathlib
188
+ lean-runtime init MyProof
188
189
  cd MyProof
189
- lean-runtime build .
190
+ lean-runtime check MyProof/Basic.lean
191
+ lean-runtime build
190
192
  ```
191
193
 
192
194
  `init` also writes an `AGENTS.md` with the project build, checking, dependency,
193
195
  and shared-package rules for coding agents. Pass `--no-agents` to omit it; an
194
- existing `AGENTS.md` is never overwritten.
196
+ existing `AGENTS.md` is never overwritten. Use `--core` for no Mathlib, or
197
+ `--mathlib 4.33.0` to select a cataloged release. `lean-runtime update`
198
+ explicitly moves a project to the newest cataloged Mathlib after a preview.
195
199
 
196
- Existing repositories can preview and adopt the same layout individually or in
197
- bulk:
200
+ Running `lean-runtime init .` in an existing pinned Lake project adopts its
201
+ current exact graph without running `lake update`. If you already have many
202
+ Lake checkouts, register them once as local dependency seeds:
198
203
 
199
204
  ```bash
200
- lean-runtime attach ~/research --recursive
201
- lean-runtime attach ~/research --recursive --execute
205
+ lean-runtime scan ~/research
206
+ lean-runtime init .
202
207
  ```
203
208
 
204
- The dry run reports blockers and estimated recovery without changing anything.
205
- Adoption preserves each root `.lake/build`, verifies both the override and
206
- ordinary Lake views, then replaces only generated package copies with links to
207
- the content-addressed store. `lean-runtime detach . --execute` materializes an
208
- independent project again.
209
+ `init --plan` is side-effect free; `--max-download 500MiB` and `--offline`
210
+ enforce cold-start policy. Advanced bulk migration remains available through
211
+ `attach`, and `detach --execute` materializes an independent project again.
212
+ For a new project, the target may be absent, empty, or an otherwise empty Git
213
+ repository root; existing Git identity and index state are preserved. A custom
214
+ `AGENTS.md` is also allowed and retained. Other existing contents are rejected
215
+ before acquisition rather than overwritten.
216
+ When the directory spelling is not the intended Lean module capitalization,
217
+ set it explicitly, for example `lean-runtime init . --name IntegralFramework`.
209
218
 
210
219
  One-shot helpers are available when setup reuse is unnecessary:
211
220
 
@@ -145,31 +145,40 @@ project = lean.setup(project="./my-project")
145
145
  result = project.check_file("./my-project/MyProject/Main.lean")
146
146
  ```
147
147
 
148
- Create a normal Lake project whose exact dependencies are shared automatically:
148
+ Create a normal Lake project. The newest stable cataloged Mathlib is the
149
+ default, and exact dependencies are shared automatically:
149
150
 
150
151
  ```bash
151
- lean-runtime init MyProof --mathlib
152
+ lean-runtime init MyProof
152
153
  cd MyProof
153
- lean-runtime build .
154
+ lean-runtime check MyProof/Basic.lean
155
+ lean-runtime build
154
156
  ```
155
157
 
156
158
  `init` also writes an `AGENTS.md` with the project build, checking, dependency,
157
159
  and shared-package rules for coding agents. Pass `--no-agents` to omit it; an
158
- existing `AGENTS.md` is never overwritten.
160
+ existing `AGENTS.md` is never overwritten. Use `--core` for no Mathlib, or
161
+ `--mathlib 4.33.0` to select a cataloged release. `lean-runtime update`
162
+ explicitly moves a project to the newest cataloged Mathlib after a preview.
159
163
 
160
- Existing repositories can preview and adopt the same layout individually or in
161
- bulk:
164
+ Running `lean-runtime init .` in an existing pinned Lake project adopts its
165
+ current exact graph without running `lake update`. If you already have many
166
+ Lake checkouts, register them once as local dependency seeds:
162
167
 
163
168
  ```bash
164
- lean-runtime attach ~/research --recursive
165
- lean-runtime attach ~/research --recursive --execute
169
+ lean-runtime scan ~/research
170
+ lean-runtime init .
166
171
  ```
167
172
 
168
- The dry run reports blockers and estimated recovery without changing anything.
169
- Adoption preserves each root `.lake/build`, verifies both the override and
170
- ordinary Lake views, then replaces only generated package copies with links to
171
- the content-addressed store. `lean-runtime detach . --execute` materializes an
172
- independent project again.
173
+ `init --plan` is side-effect free; `--max-download 500MiB` and `--offline`
174
+ enforce cold-start policy. Advanced bulk migration remains available through
175
+ `attach`, and `detach --execute` materializes an independent project again.
176
+ For a new project, the target may be absent, empty, or an otherwise empty Git
177
+ repository root; existing Git identity and index state are preserved. A custom
178
+ `AGENTS.md` is also allowed and retained. Other existing contents are rejected
179
+ before acquisition rather than overwritten.
180
+ When the directory spelling is not the intended Lean module capitalization,
181
+ set it explicitly, for example `lean-runtime init . --name IntegralFramework`.
173
182
 
174
183
  One-shot helpers are available when setup reuse is unnecessary:
175
184
 
@@ -146,30 +146,45 @@ environment can replay offline.
146
146
  ## Existing projects and core Lean
147
147
 
148
148
  ```bash
149
- lean-runtime check-file Main.lean --toolchain 4.32.2
150
- lean-runtime check-file ./existing-project/MyProject/Main.lean
151
- lean-runtime build ./existing-project MyLibrary
152
- lean-runtime init MyProof --mathlib
153
- lean-runtime init MyProof --mathlib --no-agents
149
+ lean-runtime check Main.lean --toolchain 4.32.2
150
+ lean-runtime check ./existing-project/MyProject/Main.lean
151
+ lean-runtime build
152
+ lean-runtime init MyProof
153
+ lean-runtime init MyProof --core
154
+ lean-runtime init --plan --max-download 500MiB
155
+ lean-runtime update --plan
156
+ lean-runtime scan ~/research
154
157
  lean-runtime attach ~/research --recursive
155
158
  lean-runtime attach ~/research --recursive --execute
156
159
  lean-runtime detach ./existing-project --execute
157
160
  lean-runtime install 4.32.2
158
161
  ```
159
162
 
160
- Without `--with`, the environment-aware `check` command requires an environment
161
- identifier. `check-file` is the direct local-project route. When no
163
+ `check FILE` is the direct standalone/local-project route; the legacy
164
+ `check ENVIRONMENT FILE` spelling remains accepted. When no
162
165
  `--project` or `--toolchain` is supplied, it discovers the nearest directory
163
166
  containing a Lake configuration and `lean-toolchain`, then passes the actual
164
167
  project-relative file to `lake env lean`.
165
168
 
166
- `init` creates a standard core or Mathlib Lake library and attaches its exact
167
- cataloged dependencies. `attach` is read-only unless `--execute` is present;
169
+ `init` defaults to the newest stable cataloged Mathlib, or adopts an existing
170
+ pinned Lake project without changing its graph. `--core` opts out of Mathlib.
171
+ It prepares dependencies before atomically publishing a new project. `update`
172
+ is the explicit transactional move to the newest cataloged Mathlib; `scan`
173
+ records exact existing graphs as future local seeds. `attach` is read-only
174
+ unless `--execute` is present;
168
175
  recursive mode inventories a project tree, reports blockers and estimated disk
169
176
  recovery, and adopts each valid project transactionally. `detach` is likewise a
170
177
  preview unless `--execute` is present. Attached projects use shared mode by
171
178
  default in `lean-runtime build`; detach before requesting `--local`.
172
179
 
180
+ A new `init` target may be absent, empty, or an otherwise empty Git root, with
181
+ an optional existing `AGENTS.md`. Git metadata and the custom guide are
182
+ preserved. Planning rejects any other existing contents using the same
183
+ validation as execution.
184
+ `--name NAME` overrides the inferred Lake package/root module name for a new
185
+ project, which is useful when a lowercase repository name needs internal
186
+ capitalization such as `IntegralFramework`.
187
+
173
188
  Add supporting source files with repeatable `--include` options:
174
189
 
175
190
  ```bash
@@ -18,33 +18,67 @@ Create a standard Lake library with the newest cataloged Mathlib release and
18
18
  shared exact dependencies:
19
19
 
20
20
  ```bash
21
- lean-runtime init MyProof --mathlib
21
+ lean-runtime init MyProof
22
22
  cd MyProof
23
- lean-runtime build .
23
+ lean-runtime check MyProof/Basic.lean
24
+ lean-runtime build
24
25
  ```
25
26
 
26
27
  By default, `init` writes an `AGENTS.md` explaining the project workflow and
27
28
  shared-dependency safety rules to coding agents. Pass `--no-agents` to omit it.
28
29
  An existing file is preserved.
29
30
 
30
- Use `--mathlib 4.33.0` to select that release explicitly. Omit `--mathlib` for
31
- a core-only library. The root project remains an ordinary mutable Lake project;
31
+ Use `--mathlib 4.33.0` to select that release explicitly, or `--core` for a
32
+ core-only library. The root project remains an ordinary mutable Lake project;
32
33
  its dependency sources and build artifacts are reused by other projects with
33
34
  the same exact graph.
34
35
 
35
- For an existing project or a directory containing many projects, preview the
36
- migration before applying it:
36
+ Before doing any work, `init --plan` reports the exact release, local reuse, and
37
+ known download size. `--max-download 500MiB` refuses a larger transfer and
38
+ `--offline` requires a matching local graph. Initialization is transactional:
39
+ the target appears only after Lake and the shared dependency graph both verify.
40
+ Offline plans perform no registry lookup; they return a blocked plan and a
41
+ nonzero status when the required exact local graph is absent.
42
+ Project development requires one full Lake-capable Lean toolchain per Lean
43
+ version. When it is absent, the plan says its Elan download size is unknown;
44
+ `--offline` and `--max-download` fail closed instead of silently installing it.
45
+
46
+ The target may be a missing directory, an empty directory, or an otherwise
47
+ empty Git repository root. In the Git case, `init` preserves the existing HEAD,
48
+ index, remotes, and worktree metadata. It also preserves an existing
49
+ `AGENTS.md`; any other non-project contents are rejected by both `--plan` and
50
+ execution rather than overwritten.
51
+ The directory name normally supplies the Lake package/root module name. Override
52
+ it when capitalization matters, for example:
37
53
 
38
54
  ```bash
39
- lean-runtime attach .
40
- lean-runtime attach ~/research --recursive
41
- lean-runtime attach ~/research --recursive --execute
55
+ lean-runtime init . --name IntegralFramework
42
56
  ```
43
57
 
44
- The first two commands are read-only. Execution verifies the shared graph,
45
- replaces only generated package copies, and rolls back the swap if ordinary
46
- Lake cannot load the result. See [Local Lake projects](local-projects.md) for
47
- detachment, storage estimates, and the complete safety model.
58
+ The same command can be rerun safely after initialization; a different name is
59
+ rejected rather than silently renaming an existing project.
60
+
61
+ Dependency upgrades are explicit:
62
+
63
+ ```bash
64
+ lean-runtime update --plan
65
+ lean-runtime update
66
+ ```
67
+
68
+ The update preview names both exact Mathlib revisions and toolchains. In a
69
+ terminal, the second command asks for confirmation; use `--yes` in automation.
70
+
71
+ For one existing pinned Lake project, preserve and adopt its current exact graph:
72
+
73
+ ```bash
74
+ lean-runtime init .
75
+ lean-runtime scan ~/research
76
+ ```
77
+
78
+ `scan` only records exact local graphs as possible future zero-download seeds.
79
+ Advanced bulk migration remains available through `attach`. See [Local Lake
80
+ projects](local-projects.md) for detachment, storage estimates, and the complete
81
+ safety model.
48
82
 
49
83
  ## Run a file
50
84
 
@@ -22,10 +22,10 @@ managed environment, dependency list, or explicit toolchain is supplied:
22
22
  result = Runtime().check_file("./my-project/MyProject/Main.lean")
23
23
  ```
24
24
 
25
- The CLI equivalent is:
25
+ The primary CLI equivalent is:
26
26
 
27
27
  ```bash
28
- lean-runtime check-file ./my-project/MyProject/Main.lean
28
+ lean-runtime check ./my-project/MyProject/Main.lean
29
29
  ```
30
30
 
31
31
  The actual project-relative file is passed to `lake env lean`, so imports of
@@ -43,19 +43,56 @@ Ordinary Lake workspaces put remote dependencies and their build artifacts in
43
43
  each repository's `.lake/packages`. New projects can start in shared mode:
44
44
 
45
45
  ```bash
46
- lean-runtime init MyProof --mathlib
46
+ lean-runtime init MyProof
47
47
  cd MyProof
48
- lean-runtime build .
48
+ lean-runtime check MyProof/Basic.lean
49
+ lean-runtime build
49
50
  ```
50
51
 
51
52
  The generated files are a standard Lake project plus a small
52
53
  `lean-runtime.toml`. Root build outputs stay local; exact dependencies are
53
- shared. Select a cataloged release with `--mathlib 4.33.0`, or omit `--mathlib`
54
- for a core-only library. `init` also creates an `AGENTS.md` describing the safe
54
+ shared. The newest stable cataloged Mathlib is selected by default. Select a
55
+ release with `--mathlib 4.33.0`, or use `--core` for a core-only library.
56
+ `init` also creates an `AGENTS.md` describing the safe
55
57
  build and dependency workflow unless `--no-agents` is passed; it never
56
58
  overwrites an existing guide.
57
59
 
58
- For one existing project, preview before changing anything:
60
+ Initialization acquires and verifies the exact graph before publishing the
61
+ target directory. Use `--plan` for a side-effect-free cost report, `--offline`
62
+ to require local data, `--max-download SIZE` to enforce a transfer ceiling, or
63
+ `--seed-from PROJECT` to name an exact local donor.
64
+ Offline planning never queries configured registries. A missing exact local
65
+ graph appears as a blocker and makes the planning command fail.
66
+ The plan separately reports whether the full Lake-capable toolchain is already
67
+ installed. Because Elan does not publish a preflight byte count, a missing full
68
+ toolchain is rejected under `--offline` or `--max-download` rather than silently
69
+ bypassing the policy.
70
+
71
+ An otherwise empty Git root is a valid new-project target. The original `.git`
72
+ directory—or `.git` worktree file—is transferred through the atomic publication
73
+ without changing HEAD, the index, or remotes. A pre-existing `AGENTS.md` is also
74
+ preserved. Other contents must be moved first or represented by an existing
75
+ pinned Lake project; the read-only plan enforces the same rule as execution.
76
+ Use `--name NAME` when creating inside a lowercase or otherwise differently
77
+ named repository and the Lean root module needs an explicit spelling.
78
+
79
+ For an existing pinned project, `lean-runtime init .` adopts its current
80
+ manifest without changing versions. Register a collection once with
81
+ `lean-runtime scan ~/research`; future exact matches are preferred over
82
+ downloads automatically.
83
+
84
+ Move an adopted TOML project to the newest cataloged Mathlib explicitly:
85
+
86
+ ```bash
87
+ lean-runtime update --plan
88
+ lean-runtime update
89
+ ```
90
+
91
+ The plan reports old and new release, commit, toolchain, local donor, and known
92
+ download bytes. Acquisition happens before metadata changes, and failures
93
+ restore the prior Lake files and attachment metadata.
94
+
95
+ For advanced bulk onboarding, preview before changing anything:
59
96
 
60
97
  ```bash
61
98
  lean-runtime attach .
@@ -59,6 +59,9 @@ from .project_sharing import (
59
59
  AdoptionResult,
60
60
  DetachmentPlan,
61
61
  ProjectAdoption,
62
+ ProjectInitPlan,
63
+ ProjectScanResult,
64
+ ProjectUpdatePlan,
62
65
  )
63
66
  from .projects import (
64
67
  ProjectContext,
@@ -85,6 +88,9 @@ __all__ = [
85
88
  "AdoptionPlan",
86
89
  "AdoptionResult",
87
90
  "DetachmentPlan",
91
+ "ProjectInitPlan",
92
+ "ProjectScanResult",
93
+ "ProjectUpdatePlan",
88
94
  "EnvironmentComparison",
89
95
  "ComparisonEntry",
90
96
  "PortableCopyInfo",