lean-runtime 3.0.2__tar.gz → 4.0.0__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 (201) hide show
  1. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/CHANGELOG.md +33 -0
  2. lean_runtime-4.0.0/PKG-INFO +199 -0
  3. lean_runtime-4.0.0/README.md +163 -0
  4. lean_runtime-4.0.0/docs/cli.md +111 -0
  5. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/development.md +1 -1
  6. lean_runtime-4.0.0/docs/environments.md +32 -0
  7. lean_runtime-4.0.0/docs/getting-started.md +42 -0
  8. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/index.md +4 -4
  9. lean_runtime-4.0.0/docs/local-projects.md +70 -0
  10. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/portable-copies.md +12 -12
  11. lean_runtime-4.0.0/docs/project-publishing.md +32 -0
  12. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/python-api.md +1 -1
  13. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/ready-programs.md +4 -4
  14. lean_runtime-4.0.0/docs/standalone-files.md +33 -0
  15. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/v1-precision.md +11 -11
  16. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/cli.py +843 -494
  17. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/console.py +19 -3
  18. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/catalog_cli.py +2 -2
  19. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/projects.py +2 -2
  20. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/run_cli.py +12 -8
  21. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/runtime.py +11 -11
  22. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/toolchain_oci.py +32 -0
  23. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/toolchains.py +74 -6
  24. lean_runtime-4.0.0/lean_runtime.egg-info/PKG-INFO +199 -0
  25. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime.egg-info/SOURCES.txt +1 -0
  26. lean_runtime-4.0.0/lean_runtime.egg-info/entry_points.txt +2 -0
  27. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/pyproject.toml +1 -3
  28. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/scripts/announcement_gate.py +34 -11
  29. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/scripts/smoke_wheel.py +5 -2
  30. lean_runtime-4.0.0/tests/test_announcement_gate.py +43 -0
  31. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_bundles.py +94 -2
  32. lean_runtime-4.0.0/tests/test_cli.py +229 -0
  33. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_console.py +36 -0
  34. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_environment_integration.py +4 -3
  35. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_programs.py +50 -1
  36. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_project_publish.py +2 -27
  37. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_projects.py +2 -2
  38. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_run_cli.py +10 -33
  39. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_runtime.py +1 -1
  40. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_schemas.py +1 -1
  41. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_signatures.py +50 -0
  42. lean_runtime-4.0.0/tests/test_toolchain_oci.py +203 -0
  43. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_toolchains.py +53 -0
  44. lean_runtime-3.0.2/PKG-INFO +0 -326
  45. lean_runtime-3.0.2/README.md +0 -290
  46. lean_runtime-3.0.2/docs/cli.md +0 -274
  47. lean_runtime-3.0.2/docs/environments.md +0 -124
  48. lean_runtime-3.0.2/docs/getting-started.md +0 -209
  49. lean_runtime-3.0.2/docs/local-projects.md +0 -249
  50. lean_runtime-3.0.2/docs/project-publishing.md +0 -163
  51. lean_runtime-3.0.2/docs/standalone-files.md +0 -88
  52. lean_runtime-3.0.2/lean_runtime.egg-info/PKG-INFO +0 -326
  53. lean_runtime-3.0.2/lean_runtime.egg-info/entry_points.txt +0 -4
  54. lean_runtime-3.0.2/tests/test_cli.py +0 -988
  55. lean_runtime-3.0.2/tests/test_toolchain_oci.py +0 -86
  56. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/LICENSE +0 -0
  57. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/MANIFEST.in +0 -0
  58. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/environments.toml +0 -0
  59. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/core-v4.32.2.lock.json +0 -0
  60. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/leancert-v4.30.0.5.lock.json +0 -0
  61. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/leancert-v4.31.0.lock.json +0 -0
  62. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/leancert-v4.32.2.4.lock.json +0 -0
  63. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/leancert-v4.33.0.lock.json +0 -0
  64. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/mathlib-v4.30.0.lock.json +0 -0
  65. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/mathlib-v4.31.0.lock.json +0 -0
  66. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/mathlib-v4.32.2.lock.json +0 -0
  67. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/catalog/locks/mathlib-v4.33.0.lock.json +0 -0
  68. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/compatibility/README.md +0 -0
  69. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/compatibility/lake-artifact-cache-4.33.0.json +0 -0
  70. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/compatibility/mathlib-4.32.2.json +0 -0
  71. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/compatibility/mathlib-4.32.2.toml +0 -0
  72. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/compatibility/mathlib-4.33.0.json +0 -0
  73. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/compatibility/mathlib-4.33.0.toml +0 -0
  74. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/architecture.md +0 -0
  75. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/captures.md +0 -0
  76. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/case-study-v1.md +0 -0
  77. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/lake-artifact-cache-design.md +0 -0
  78. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/docs/trust-and-limitations.md +0 -0
  79. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/examples/mathlib.toml +0 -0
  80. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/__init__.py +0 -0
  81. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/__main__.py +0 -0
  82. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/_git.py +0 -0
  83. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/_paths.py +0 -0
  84. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/backends.py +0 -0
  85. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/bundles.py +0 -0
  86. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/capsules.py +0 -0
  87. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/comparison.py +0 -0
  88. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/decisions.py +0 -0
  89. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/diagnostics.py +0 -0
  90. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/__init__.py +0 -0
  91. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/analyzer.py +0 -0
  92. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/api.py +0 -0
  93. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/candidate.py +0 -0
  94. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/catalog.py +0 -0
  95. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/catalog_build.py +0 -0
  96. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/catalog_manifest.py +0 -0
  97. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/data/catalog.json +0 -0
  98. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/defaults.py +0 -0
  99. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/engine.py +0 -0
  100. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/errors.py +0 -0
  101. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/module_inventory.py +0 -0
  102. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/planner.py +0 -0
  103. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/policy.py +0 -0
  104. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/probe.py +0 -0
  105. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/py.typed +0 -0
  106. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/result.py +0 -0
  107. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/schema_resources.py +0 -0
  108. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/schemas/catalog-v1.schema.json +0 -0
  109. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/schemas/plan-v1.schema.json +0 -0
  110. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/discovery/schemas/result-v1.schema.json +0 -0
  111. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/environments.py +0 -0
  112. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/errors.py +0 -0
  113. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/events.py +0 -0
  114. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/facade.py +0 -0
  115. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/frontmatter.py +0 -0
  116. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/header_cache.py +0 -0
  117. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/health.py +0 -0
  118. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/identifier_resolver.py +0 -0
  119. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/lake.py +0 -0
  120. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/lake_cache.py +0 -0
  121. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/lockfiles.py +0 -0
  122. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/locking.py +0 -0
  123. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/matrix.py +0 -0
  124. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/models.py +0 -0
  125. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/oci.py +0 -0
  126. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/oci_protocol.py +0 -0
  127. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/packs.py +0 -0
  128. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/policies.py +0 -0
  129. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/profiling.py +0 -0
  130. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/programs.py +0 -0
  131. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/project_execution.py +0 -0
  132. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/project_sharing.py +0 -0
  133. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/publisher_verification.py +0 -0
  134. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/py.typed +0 -0
  135. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/references.py +0 -0
  136. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/resolver.py +0 -0
  137. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/schema_resources.py +0 -0
  138. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/serialization.py +0 -0
  139. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/shared_projects.py +0 -0
  140. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/specs.py +0 -0
  141. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/store.py +0 -0
  142. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/timings.py +0 -0
  143. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/toolchain_slim.py +0 -0
  144. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/verification.py +0 -0
  145. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime/wire.py +0 -0
  146. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime.egg-info/dependency_links.txt +0 -0
  147. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime.egg-info/requires.txt +0 -0
  148. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/lean_runtime.egg-info/top_level.txt +0 -0
  149. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/mkdocs.yml +0 -0
  150. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/attestation-v1.schema.json +0 -0
  151. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/check-batch-v1.schema.json +0 -0
  152. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/cleanup-v1.schema.json +0 -0
  153. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/comparison-v1.schema.json +0 -0
  154. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/execution-v1.schema.json +0 -0
  155. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/inspect-v1.schema.json +0 -0
  156. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/matrix-v1.schema.json +0 -0
  157. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/plan-v1.schema.json +0 -0
  158. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/profile-v1.schema.json +0 -0
  159. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/publication-v1.schema.json +0 -0
  160. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/schemas/verify-v1.schema.json +0 -0
  161. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/scripts/lake_cache_gate.py +0 -0
  162. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/scripts/registry_preflight.py +0 -0
  163. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/scripts/run_compatibility.py +0 -0
  164. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/scripts/run_v1_case_study.py +0 -0
  165. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/setup.cfg +0 -0
  166. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/conftest.py +0 -0
  167. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/discovery/e2e/test_real_discovery.py +0 -0
  168. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/discovery/test_analyzer.py +0 -0
  169. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/discovery/test_catalog.py +0 -0
  170. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/discovery/test_catalog_build.py +0 -0
  171. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/discovery/test_discovery_schema_resources.py +0 -0
  172. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/discovery/test_engine.py +0 -0
  173. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/discovery/test_planner.py +0 -0
  174. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/discovery/test_policy.py +0 -0
  175. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_backend.py +0 -0
  176. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_capsules.py +0 -0
  177. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_diagnostics.py +0 -0
  178. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_events_health.py +0 -0
  179. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_facade.py +0 -0
  180. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_frontmatter.py +0 -0
  181. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_git.py +0 -0
  182. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_header_cache.py +0 -0
  183. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_identifier_resolver.py +0 -0
  184. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_interactive.py +0 -0
  185. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_lake_cache.py +0 -0
  186. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_lockfiles.py +0 -0
  187. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_locking.py +0 -0
  188. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_models.py +0 -0
  189. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_multifile.py +0 -0
  190. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_oci_protocol.py +0 -0
  191. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_packs.py +0 -0
  192. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_paths.py +0 -0
  193. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_prebuilt_policy.py +0 -0
  194. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_references.py +0 -0
  195. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_schema_resources.py +0 -0
  196. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_specs.py +0 -0
  197. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_store.py +0 -0
  198. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_toolchain_slim.py +0 -0
  199. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_v1_precision.py +0 -0
  200. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_verification_inventory.py +0 -0
  201. {lean_runtime-3.0.2 → lean_runtime-4.0.0}/tests/test_verification_probe.py +0 -0
@@ -2,6 +2,39 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.0.0 - 2026-08-18
6
+
7
+ - Replace the implementation-shaped CLI with a cwd-first workflow: `new`,
8
+ `adopt`, universal `check`, `watch`, `build`, `update`, `publish`, `status`,
9
+ `verify`, `doctor`, and `clean`.
10
+ - Remove the `lean-run` and `lean-runtime-catalog` entry points and all v3
11
+ compatibility spellings. Exact environment operations now live under `env`;
12
+ advanced project operations use `project info/scan/share/unshare/lock/export`.
13
+ - Merge standalone discovery into `lean-runtime check`. A single `--using`
14
+ override replaces the old project, package, lock, environment, and toolchain
15
+ context flags.
16
+ - Make cwd the implicit subject for project commands. Adoption detects whether
17
+ its subject is one Lake project or a tree, previews the storage transition,
18
+ confirms interactively, and preserves atomic rollback.
19
+ - Detect compatible user Elan toolchains automatically and use them read-only.
20
+ Missing toolchains are still installed in Lean Runtime's private Elan home,
21
+ and optimization never prunes a user-managed installation.
22
+ - Make cleanup, adoption, updates, publication setup, and safe doctor repairs
23
+ guided operations. Automation uses `--yes`; inspection uses `--dry-run`.
24
+
25
+ ## 3.0.3 - 2026-08-18
26
+
27
+ - Give sparse-environment and slim-toolchain downloads independent progress
28
+ lifecycles, so the toolchain transfer reports its real size instead of
29
+ inheriting a completed environment total.
30
+ - Reject duplicate members and symlink extraction destinations in
31
+ slim-toolchain archives, matching the portable-environment boundary.
32
+ - Correct the announcement gate's versioned plan-envelope parsing and add the
33
+ missing macOS Intel clean-consumer job.
34
+ - Expand release acceptance coverage for archive limits and traversal,
35
+ deterministic multi-platform finalization, duplicate platforms, supported
36
+ Cosign releases, missing Cosign, and publisher identity/issuer mismatches.
37
+
5
38
  ## 3.0.2 - 2026-08-17
6
39
 
7
40
  - Route the first check directly through a newly downloaded slim Lean runtime.
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: lean-runtime
3
+ Version: 4.0.0
4
+ Summary: Run Lean 4 proofs from Python or standalone files
5
+ Author: Alejandro Radisic
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/alerad/lean-runtime
8
+ Project-URL: Documentation, https://alerad.github.io/lean-runtime/
9
+ Project-URL: Repository, https://github.com/alerad/lean-runtime.git
10
+ Project-URL: Issues, https://github.com/alerad/lean-runtime/issues
11
+ Project-URL: Changelog, https://github.com/alerad/lean-runtime/blob/main/CHANGELOG.md
12
+ Keywords: lean4,theorem-prover,formal-verification,toolchain
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: tomli>=2; python_version < "3.11"
25
+ Requires-Dist: zstandard<1,>=0.23
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=8; extra == "dev"
28
+ Requires-Dist: ruff>=0.6; extra == "dev"
29
+ Requires-Dist: mypy>=1.10; extra == "dev"
30
+ Requires-Dist: tomli>=2; extra == "dev"
31
+ Requires-Dist: jsonschema>=4.23; extra == "dev"
32
+ Provides-Extra: docs
33
+ Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
34
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
35
+ Dynamic: license-file
36
+
37
+ # Lean Runtime
38
+
39
+ Lean Runtime makes Lean projects and standalone proofs work without asking you
40
+ to manage toolchains, dependency checkouts, exact environments, or caches.
41
+
42
+ ```bash
43
+ python -m pip install lean-runtime
44
+ ```
45
+
46
+ ## The daily workflow
47
+
48
+ Create a project:
49
+
50
+ ```bash
51
+ lean-runtime new MyProof
52
+ cd MyProof
53
+ lean-runtime check
54
+ lean-runtime build
55
+ ```
56
+
57
+ Use an existing pinned Lake project from its directory:
58
+
59
+ ```bash
60
+ lean-runtime check
61
+ lean-runtime adopt
62
+ ```
63
+
64
+ `adopt` verifies the existing exact dependency graph, previews reuse and disk
65
+ recovery, asks for confirmation, and swaps dependency links atomically. It does
66
+ not change `lean-toolchain` or `lake-manifest.json`. Passing a directory that
67
+ contains several projects discovers them automatically:
68
+
69
+ ```bash
70
+ lean-runtime adopt ~/research
71
+ ```
72
+
73
+ Check a standalone source file:
74
+
75
+ ```bash
76
+ lean-runtime check Main.lean
77
+ ```
78
+
79
+ The same command uses the nearest pinned Lake project when one exists and
80
+ otherwise performs bounded exact-environment discovery. A file can carry its
81
+ context in strict comment frontmatter:
82
+
83
+ ```lean
84
+ -- /// lean-runtime
85
+ -- requires = ["mathlib@v4.33.0"]
86
+ -- ///
87
+
88
+ import Mathlib
89
+ example : 2 + 2 = 4 := by norm_num
90
+ ```
91
+
92
+ When inference needs an override, there is one spelling:
93
+
94
+ ```bash
95
+ lean-runtime check Main.lean --using mathlib@v4.33.0
96
+ lean-runtime check Main.lean --using environment.lock.json
97
+ lean-runtime check Main.lean --using research-stack
98
+ lean-runtime check Main.lean --using lean:v4.33.0
99
+ lean-runtime check Main.lean --using ~/proofs/MyProject
100
+ ```
101
+
102
+ Typed `package:`, `lock:`, `env:`, `toolchain:`, and `project:` prefixes resolve
103
+ rare ambiguities. Persistent store, registry, and trust policy belongs in
104
+ environment configuration rather than everyday command lines.
105
+
106
+ ## Commands
107
+
108
+ The normal surface is deliberately small:
109
+
110
+ ```text
111
+ new NAME create a project
112
+ adopt [PATH] share dependencies from existing project(s)
113
+ check [PATH…] check a project, directory, source file, or stdin
114
+ watch FILE re-check on save
115
+ build [TARGET] build the current project
116
+ update preview and apply a safe project update
117
+ publish configure verified project publication
118
+ status [PATH] explain the selected project or environment
119
+ verify SUBJECT verify an exact artifact
120
+ doctor diagnose and offer safe repairs
121
+ clean preview and reclaim unused storage
122
+ ```
123
+
124
+ Project commands use the current directory when no path is supplied. Guided
125
+ mutations show their plan and ask before changing anything; automation passes
126
+ `--yes`, and inspection-only calls pass `--dry-run`.
127
+
128
+ Persistent registry, availability, store, and publisher-trust policy belongs
129
+ in `~/.config/lean-runtime/config.toml`; the nearest project's
130
+ `lean-runtime.toml` can override it. Daily commands therefore normally need no
131
+ configuration flags.
132
+
133
+ Exact and operator workflows live under noun namespaces:
134
+
135
+ ```text
136
+ env list · info · lock · acquire · diff · export · import
137
+ project info · scan · share · unshare · lock · export
138
+ program create · run · info · acquire · export · import · publish
139
+ toolchain list · info · install · optimize
140
+ storage usage · verify
141
+ catalog catalog maintenance
142
+ ```
143
+
144
+ There are no v3 command aliases. `run`, `init`, `prepare`, `open`, `download`,
145
+ `environments`, `inspect`, `compare`, `copy`, `finalize`, `lean-run`, and
146
+ `lean-runtime-catalog` were removed in 4.0.
147
+
148
+ ## Existing Elan installations
149
+
150
+ Lean Runtime automatically reuses an exact compatible toolchain already
151
+ installed by the user's Elan. This access is read-only: it never changes the
152
+ user's default, installs into the user's Elan home, or removes user toolchains.
153
+ Missing toolchains and downloadable slim checking runtimes remain isolated in
154
+ Lean Runtime's private store. `lean-runtime status` and `doctor` expose the
155
+ choice when it matters.
156
+
157
+ ## Exact environments
158
+
159
+ ```bash
160
+ lean-runtime env lock environment.toml --output environment.lock.json
161
+ lean-runtime env acquire environment.lock.json --name research-stack
162
+ lean-runtime env info research-stack
163
+ lean-runtime env diff previous.lock.json environment.lock.json
164
+ lean-runtime env export research-stack --output research-stack.lean-environment
165
+ lean-runtime env import research-stack.lean-environment --name imported-stack
166
+ ```
167
+
168
+ Locks are canonical and content-addressed. Full environments preserve source;
169
+ downloaded sparse capsules project only verified import closures and keep the
170
+ same environment identity as their projection grows.
171
+
172
+ ## Python
173
+
174
+ ```python
175
+ import lean_runtime as lean
176
+
177
+ env = lean.setup(deps=["mathlib@v4.33.0"])
178
+ result = env.check("import Mathlib\nexample : 2 + 2 = 4 := by norm_num\n")
179
+ result.raise_for_error()
180
+ ```
181
+
182
+ The Python API retains the explicit `Runtime`, `EnvironmentSpec`,
183
+ `EnvironmentLock`, project, capture, program, cancellation, and verification
184
+ interfaces for infrastructure code.
185
+
186
+ ## Guarantees and limits
187
+
188
+ - Exact Git commits, trees, locks, toolchains, platform identities, and artifact
189
+ digests are verified before an environment becomes ready.
190
+ - Acquisitions and project sharing are staged, probed, and published atomically.
191
+ - User project metadata and user Elan state are not silently rewritten.
192
+ - The local execution backend enforces supported resource limits but is not a
193
+ network sandbox; unsupported isolation requests fail explicitly.
194
+ - Logical Lean rejections exit 1; invalid/infrastructure invocations exit 2;
195
+ publication failures retain their documented classified exit statuses.
196
+
197
+ Documentation lives in [`docs/`](docs/index.md). Start with
198
+ [`docs/getting-started.md`](docs/getting-started.md),
199
+ [`docs/cli.md`](docs/cli.md), and [`docs/local-projects.md`](docs/local-projects.md).
@@ -0,0 +1,163 @@
1
+ # Lean Runtime
2
+
3
+ Lean Runtime makes Lean projects and standalone proofs work without asking you
4
+ to manage toolchains, dependency checkouts, exact environments, or caches.
5
+
6
+ ```bash
7
+ python -m pip install lean-runtime
8
+ ```
9
+
10
+ ## The daily workflow
11
+
12
+ Create a project:
13
+
14
+ ```bash
15
+ lean-runtime new MyProof
16
+ cd MyProof
17
+ lean-runtime check
18
+ lean-runtime build
19
+ ```
20
+
21
+ Use an existing pinned Lake project from its directory:
22
+
23
+ ```bash
24
+ lean-runtime check
25
+ lean-runtime adopt
26
+ ```
27
+
28
+ `adopt` verifies the existing exact dependency graph, previews reuse and disk
29
+ recovery, asks for confirmation, and swaps dependency links atomically. It does
30
+ not change `lean-toolchain` or `lake-manifest.json`. Passing a directory that
31
+ contains several projects discovers them automatically:
32
+
33
+ ```bash
34
+ lean-runtime adopt ~/research
35
+ ```
36
+
37
+ Check a standalone source file:
38
+
39
+ ```bash
40
+ lean-runtime check Main.lean
41
+ ```
42
+
43
+ The same command uses the nearest pinned Lake project when one exists and
44
+ otherwise performs bounded exact-environment discovery. A file can carry its
45
+ context in strict comment frontmatter:
46
+
47
+ ```lean
48
+ -- /// lean-runtime
49
+ -- requires = ["mathlib@v4.33.0"]
50
+ -- ///
51
+
52
+ import Mathlib
53
+ example : 2 + 2 = 4 := by norm_num
54
+ ```
55
+
56
+ When inference needs an override, there is one spelling:
57
+
58
+ ```bash
59
+ lean-runtime check Main.lean --using mathlib@v4.33.0
60
+ lean-runtime check Main.lean --using environment.lock.json
61
+ lean-runtime check Main.lean --using research-stack
62
+ lean-runtime check Main.lean --using lean:v4.33.0
63
+ lean-runtime check Main.lean --using ~/proofs/MyProject
64
+ ```
65
+
66
+ Typed `package:`, `lock:`, `env:`, `toolchain:`, and `project:` prefixes resolve
67
+ rare ambiguities. Persistent store, registry, and trust policy belongs in
68
+ environment configuration rather than everyday command lines.
69
+
70
+ ## Commands
71
+
72
+ The normal surface is deliberately small:
73
+
74
+ ```text
75
+ new NAME create a project
76
+ adopt [PATH] share dependencies from existing project(s)
77
+ check [PATH…] check a project, directory, source file, or stdin
78
+ watch FILE re-check on save
79
+ build [TARGET] build the current project
80
+ update preview and apply a safe project update
81
+ publish configure verified project publication
82
+ status [PATH] explain the selected project or environment
83
+ verify SUBJECT verify an exact artifact
84
+ doctor diagnose and offer safe repairs
85
+ clean preview and reclaim unused storage
86
+ ```
87
+
88
+ Project commands use the current directory when no path is supplied. Guided
89
+ mutations show their plan and ask before changing anything; automation passes
90
+ `--yes`, and inspection-only calls pass `--dry-run`.
91
+
92
+ Persistent registry, availability, store, and publisher-trust policy belongs
93
+ in `~/.config/lean-runtime/config.toml`; the nearest project's
94
+ `lean-runtime.toml` can override it. Daily commands therefore normally need no
95
+ configuration flags.
96
+
97
+ Exact and operator workflows live under noun namespaces:
98
+
99
+ ```text
100
+ env list · info · lock · acquire · diff · export · import
101
+ project info · scan · share · unshare · lock · export
102
+ program create · run · info · acquire · export · import · publish
103
+ toolchain list · info · install · optimize
104
+ storage usage · verify
105
+ catalog catalog maintenance
106
+ ```
107
+
108
+ There are no v3 command aliases. `run`, `init`, `prepare`, `open`, `download`,
109
+ `environments`, `inspect`, `compare`, `copy`, `finalize`, `lean-run`, and
110
+ `lean-runtime-catalog` were removed in 4.0.
111
+
112
+ ## Existing Elan installations
113
+
114
+ Lean Runtime automatically reuses an exact compatible toolchain already
115
+ installed by the user's Elan. This access is read-only: it never changes the
116
+ user's default, installs into the user's Elan home, or removes user toolchains.
117
+ Missing toolchains and downloadable slim checking runtimes remain isolated in
118
+ Lean Runtime's private store. `lean-runtime status` and `doctor` expose the
119
+ choice when it matters.
120
+
121
+ ## Exact environments
122
+
123
+ ```bash
124
+ lean-runtime env lock environment.toml --output environment.lock.json
125
+ lean-runtime env acquire environment.lock.json --name research-stack
126
+ lean-runtime env info research-stack
127
+ lean-runtime env diff previous.lock.json environment.lock.json
128
+ lean-runtime env export research-stack --output research-stack.lean-environment
129
+ lean-runtime env import research-stack.lean-environment --name imported-stack
130
+ ```
131
+
132
+ Locks are canonical and content-addressed. Full environments preserve source;
133
+ downloaded sparse capsules project only verified import closures and keep the
134
+ same environment identity as their projection grows.
135
+
136
+ ## Python
137
+
138
+ ```python
139
+ import lean_runtime as lean
140
+
141
+ env = lean.setup(deps=["mathlib@v4.33.0"])
142
+ result = env.check("import Mathlib\nexample : 2 + 2 = 4 := by norm_num\n")
143
+ result.raise_for_error()
144
+ ```
145
+
146
+ The Python API retains the explicit `Runtime`, `EnvironmentSpec`,
147
+ `EnvironmentLock`, project, capture, program, cancellation, and verification
148
+ interfaces for infrastructure code.
149
+
150
+ ## Guarantees and limits
151
+
152
+ - Exact Git commits, trees, locks, toolchains, platform identities, and artifact
153
+ digests are verified before an environment becomes ready.
154
+ - Acquisitions and project sharing are staged, probed, and published atomically.
155
+ - User project metadata and user Elan state are not silently rewritten.
156
+ - The local execution backend enforces supported resource limits but is not a
157
+ network sandbox; unsupported isolation requests fail explicitly.
158
+ - Logical Lean rejections exit 1; invalid/infrastructure invocations exit 2;
159
+ publication failures retain their documented classified exit statuses.
160
+
161
+ Documentation lives in [`docs/`](docs/index.md). Start with
162
+ [`docs/getting-started.md`](docs/getting-started.md),
163
+ [`docs/cli.md`](docs/cli.md), and [`docs/local-projects.md`](docs/local-projects.md).
@@ -0,0 +1,111 @@
1
+ # Command line
2
+
3
+ Lean Runtime 4 exposes intentions, not its storage implementation.
4
+
5
+ ## Daily commands
6
+
7
+ ```text
8
+ lean-runtime new NAME
9
+ lean-runtime adopt [PATH]
10
+ lean-runtime check [PATH...]
11
+ lean-runtime watch FILE
12
+ lean-runtime build [TARGET...]
13
+ lean-runtime update
14
+ lean-runtime publish
15
+ ```
16
+
17
+ All project commands use the current directory by default. `check` selects the
18
+ nearest pinned Lake project or discovers an exact standalone environment. It
19
+ accepts files, directories, stdin (`-`), or no path for the current project.
20
+
21
+ Use `--using CONTEXT` only to override inference. It accepts a project path,
22
+ lock path, environment name, Lean version, or package reference. Prefixes
23
+ `project:`, `lock:`, `env:`, `toolchain:`, and `package:` disambiguate names.
24
+
25
+ ```bash
26
+ lean-runtime check Main.lean --using mathlib@v4.33.0
27
+ lean-runtime check Main.lean --using environment.lock.json --offline
28
+ lean-runtime check Main.lean --using research-stack
29
+ ```
30
+
31
+ `watch` is the file-watching operation. Repeated performance samples remain a
32
+ variant of checking:
33
+
34
+ ```bash
35
+ lean-runtime watch MyProject/Basic.lean
36
+ lean-runtime check MyProject/Basic.lean --repeat 5
37
+ lean-runtime check Main.lean --matrix compatibility.toml
38
+ ```
39
+
40
+ ## Guided mutation
41
+
42
+ `new`, `adopt`, `update`, `publish`, `doctor`, and `clean` print what they will
43
+ do and confirm in a terminal. `--yes` is the non-interactive spelling.
44
+ `--dry-run` requests an inspection-only adoption, update, share/unshare, or
45
+ cleanup.
46
+
47
+ ## Persistent configuration
48
+
49
+ Machine policy belongs in `~/.config/lean-runtime/config.toml` (or the file
50
+ named by `LEAN_RUNTIME_CONFIG`). A nearest project `lean-runtime.toml` may
51
+ override it. Command-line values are temporary overrides.
52
+
53
+ ```toml
54
+ [runtime]
55
+ home = "/var/lib/lean-runtime"
56
+ libraries = ["ghcr.io/example/lean-runtime-cache"]
57
+ availability = "auto" # auto, required, or local
58
+
59
+ [trust]
60
+ publisher_verification = "required" # required or ignore
61
+ trusted_publisher = "https://github.com/example/repo/.github/workflows/publish.yml@refs/heads/main"
62
+ trusted_issuer = "https://token.actions.githubusercontent.com"
63
+ verification_tool = "cosign"
64
+ ```
65
+
66
+ The project file can keep its existing adoption metadata at the top level;
67
+ only the `[runtime]` and `[trust]` tables participate in CLI configuration.
68
+
69
+ ## Inspection
70
+
71
+ ```bash
72
+ lean-runtime status
73
+ lean-runtime status Main.lean
74
+ lean-runtime verify SUBJECT
75
+ lean-runtime doctor
76
+ lean-runtime clean
77
+ ```
78
+
79
+ ## Advanced namespaces
80
+
81
+ ```text
82
+ env list
83
+ env info NAME
84
+ env lock SPEC
85
+ env acquire LOCK
86
+ env diff A B
87
+ env export NAME --output FILE
88
+ env import FILE
89
+ env publish / env finalize
90
+
91
+ project info / scan / share / unshare / lock / export
92
+ program create / run / info / export / import / acquire / publish / finalize
93
+ toolchain list / info / install / optimize / publish / finalize
94
+ storage usage / verify
95
+ catalog build
96
+ ```
97
+
98
+ `replay` and `completion` remain top-level reproducibility utilities.
99
+
100
+ There are no compatibility aliases for the v3 surface. In particular, `run`,
101
+ `init`, `prepare`, `open`, `download`, `environments`, `inspect`, `compare`,
102
+ `copy`, `finalize`, `project attach/detach`, and `toolchain slim` are invalid.
103
+ The `lean-run` and `lean-runtime-catalog` executables are not installed.
104
+
105
+ ## Exit status
106
+
107
+ - 0: successful operation or accepted proof
108
+ - 1: completed negative result, such as a rejected proof or blocked plan
109
+ - 2: invalid invocation, missing context, integrity, or infrastructure failure
110
+ - 3–5: classified publication failures
111
+ - 130: interrupted operation
@@ -33,7 +33,7 @@ python scripts/run_compatibility.py compatibility/mathlib-4.32.2.json
33
33
  The bundled discovery catalog is generated deterministically from exact locks:
34
34
 
35
35
  ```bash
36
- lean-runtime-catalog build catalog/environments.toml \
36
+ lean-runtime catalog build catalog/environments.toml \
37
37
  --runtime-home .catalog-runtime \
38
38
  --output lean_runtime/discovery/data/catalog.json
39
39
  ```
@@ -0,0 +1,32 @@
1
+ # Exact environments
2
+
3
+ Normal users let `check` infer environments. Infrastructure authors use `env`:
4
+
5
+ ```bash
6
+ lean-runtime env lock environment.toml --output environment.lock.json
7
+ lean-runtime env acquire environment.lock.json --name research-stack
8
+ lean-runtime env list
9
+ lean-runtime env info research-stack
10
+ lean-runtime env diff old.lock.json environment.lock.json
11
+ ```
12
+
13
+ `env lock` resolves tags to complete Git commits and trees and computes the
14
+ canonical lock identity. `env acquire` makes that identity ready using verified
15
+ local content, configured libraries, or exact source materialization. The
16
+ mechanism does not change the semantic environment identity.
17
+
18
+ Use `env acquire --download-only` to require a published artifact with no
19
+ source fallback. Sparse environments can extend their verified import
20
+ projection without changing identity; local/offline policy refuses missing
21
+ closures before network access.
22
+
23
+ Portable complete environments use:
24
+
25
+ ```bash
26
+ lean-runtime env export research-stack --output stack.lean-environment
27
+ lean-runtime env import stack.lean-environment --name imported-stack
28
+ ```
29
+
30
+ Publication operators use `env publish` for one platform and `env finalize`
31
+ after collecting the required platform descriptors. These are deliberately not
32
+ top-level daily commands.
@@ -0,0 +1,42 @@
1
+ # Getting started
2
+
3
+ Install the released wheel:
4
+
5
+ ```bash
6
+ python -m pip install lean-runtime
7
+ lean-runtime --version
8
+ ```
9
+
10
+ For a new project:
11
+
12
+ ```bash
13
+ lean-runtime new MyProof
14
+ cd MyProof
15
+ lean-runtime check
16
+ ```
17
+
18
+ For an existing pinned Lake project:
19
+
20
+ ```bash
21
+ cd ExistingProject
22
+ lean-runtime check
23
+ lean-runtime adopt
24
+ ```
25
+
26
+ The initial check works before adoption. Adoption is the optional storage and
27
+ reuse optimization: it verifies the current manifest and dependency checkouts,
28
+ reuses their bytes, previews the transition, and rolls back if the attached
29
+ graph does not probe successfully.
30
+
31
+ For a standalone proof:
32
+
33
+ ```bash
34
+ lean-runtime check Main.lean
35
+ ```
36
+
37
+ Lean Runtime infers the context. Add strict source frontmatter or `--using`
38
+ only when you need an exact override. A second check reuses the exact cached
39
+ environment; `--offline` guarantees that no acquisition occurs.
40
+
41
+ Run `lean-runtime status` to see what was selected and `lean-runtime doctor`
42
+ when a prerequisite or store needs attention.
@@ -6,7 +6,7 @@ exact reusable environment, then returns structured results and a record of what
6
6
  was used.
7
7
 
8
8
  ```text
9
- lean-runtime run FILE / lean-run FILE / lean.setup(CONTEXT)
9
+ lean-runtime check FILE / lean.setup(CONTEXT)
10
10
 
11
11
  ├── pinned local project ───────────> ProjectEnvironment
12
12
  └── dependencies / exact lock ─────> Environment
@@ -17,9 +17,9 @@ lean-runtime run FILE / lean-run FILE / lean.setup(CONTEXT)
17
17
  ExecutionResult + provenance
18
18
  ```
19
19
 
20
- - `lean-runtime run FILE` discovers or selects context for one file.
21
- - `lean-runtime check` operates in a known environment or pinned project.
22
- - `lean-run FILE` is a shortcut for `lean-runtime run FILE`.
20
+ - `lean-runtime check FILE` discovers or selects context for one file.
21
+ - `lean-runtime check` checks the current pinned Lake project.
22
+ - `lean-runtime adopt` safely shares dependencies from existing projects.
23
23
 
24
24
  It deliberately does not replace the official tools:
25
25
 
@@ -0,0 +1,70 @@
1
+ # Local Lake projects
2
+
3
+ Lean Runtime discovers the nearest pinned Lake project from the current
4
+ directory or source path.
5
+
6
+ ```bash
7
+ lean-runtime check
8
+ lean-runtime check MyProject/Basic.lean
9
+ lean-runtime build
10
+ lean-runtime watch MyProject/Basic.lean
11
+ ```
12
+
13
+ Focused checking passes the real project-relative path to Lake. Project-wide
14
+ checking builds local libraries' Lean artifacts; `build` retains ordinary Lake
15
+ build semantics and root outputs.
16
+
17
+ ## Create
18
+
19
+ ```bash
20
+ lean-runtime new MyProof
21
+ ```
22
+
23
+ `new` only creates projects. It chooses the stable cataloged Mathlib/toolchain,
24
+ creates exact Lake metadata, shares exact dependency storage, and optionally
25
+ generates CI. It refuses an existing Lake project; use `adopt` there.
26
+
27
+ ## Adopt an existing project
28
+
29
+ ```bash
30
+ cd ExistingProject
31
+ lean-runtime adopt
32
+ ```
33
+
34
+ Adoption does not update the toolchain or manifest. It validates pinned Git
35
+ dependencies, checks dirty/mismatched checkouts, uses the existing
36
+ `.lake/packages` as an exact byte donor, prepares the shared graph, probes it,
37
+ then atomically replaces package directories with links. The old graph is
38
+ restored if any post-swap probe fails.
39
+
40
+ For many repositories:
41
+
42
+ ```bash
43
+ lean-runtime adopt ~/research
44
+ ```
45
+
46
+ A directory that is itself a Lake project is adopted as one project; otherwise
47
+ Lean Runtime discovers pinned projects below it. Independent failures do not
48
+ prevent safe projects from being processed.
49
+
50
+ Advanced equivalents are `project scan`, `project share`, and `project
51
+ unshare`. They also default to the current directory.
52
+
53
+ ## Existing Elan
54
+
55
+ If the exact pinned toolchain already exists in the user's Elan home, Lean
56
+ Runtime invokes its `lean`/`lake` binaries read-only. It never changes the user
57
+ default, installs there, or prunes it. Missing toolchains go to the private
58
+ runtime store. `toolchain optimize` can create a verified slim checking copy;
59
+ pruning is allowed only for a private original.
60
+
61
+ ## Update
62
+
63
+ ```bash
64
+ lean-runtime update
65
+ ```
66
+
67
+ The command shows the exact old/new Mathlib commit and toolchain, local reuse,
68
+ and download requirements before confirmation. Application is transactional;
69
+ project metadata is restored if the new graph or project-wide check fails.
70
+ Use `--dry-run`, `--offline`, or `--yes` when scripting.