lean-runtime 3.0.3__tar.gz → 4.0.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.
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/CHANGELOG.md +29 -0
- lean_runtime-4.0.1/PKG-INFO +198 -0
- lean_runtime-4.0.1/README.md +162 -0
- lean_runtime-4.0.1/docs/cli.md +111 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/development.md +1 -1
- lean_runtime-4.0.1/docs/environments.md +32 -0
- lean_runtime-4.0.1/docs/getting-started.md +132 -0
- lean_runtime-4.0.1/docs/index.md +150 -0
- lean_runtime-4.0.1/docs/local-projects.md +70 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/portable-copies.md +12 -12
- lean_runtime-4.0.1/docs/project-publishing.md +32 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/python-api.md +1 -1
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/ready-programs.md +4 -4
- lean_runtime-4.0.1/docs/standalone-files.md +33 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/v1-precision.md +11 -11
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/cli.py +843 -494
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/catalog_cli.py +2 -2
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/environments.py +16 -1
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/projects.py +2 -2
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/run_cli.py +12 -8
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/runtime.py +25 -13
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/toolchains.py +88 -6
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/verification.py +14 -5
- lean_runtime-4.0.1/lean_runtime.egg-info/PKG-INFO +198 -0
- lean_runtime-4.0.1/lean_runtime.egg-info/entry_points.txt +2 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/mkdocs.yml +42 -9
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/pyproject.toml +1 -3
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/scripts/announcement_gate.py +17 -7
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/scripts/smoke_wheel.py +5 -2
- lean_runtime-4.0.1/tests/test_cli.py +229 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_environment_integration.py +11 -3
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_project_publish.py +2 -27
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_projects.py +3 -2
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_run_cli.py +10 -33
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_runtime.py +1 -1
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_schemas.py +1 -1
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_toolchains.py +56 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_verification_probe.py +27 -2
- lean_runtime-3.0.3/PKG-INFO +0 -326
- lean_runtime-3.0.3/README.md +0 -290
- lean_runtime-3.0.3/docs/cli.md +0 -274
- lean_runtime-3.0.3/docs/environments.md +0 -124
- lean_runtime-3.0.3/docs/getting-started.md +0 -209
- lean_runtime-3.0.3/docs/index.md +0 -47
- lean_runtime-3.0.3/docs/local-projects.md +0 -249
- lean_runtime-3.0.3/docs/project-publishing.md +0 -163
- lean_runtime-3.0.3/docs/standalone-files.md +0 -88
- lean_runtime-3.0.3/lean_runtime.egg-info/PKG-INFO +0 -326
- lean_runtime-3.0.3/lean_runtime.egg-info/entry_points.txt +0 -4
- lean_runtime-3.0.3/tests/test_cli.py +0 -988
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/LICENSE +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/MANIFEST.in +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/environments.toml +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/core-v4.32.2.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/leancert-v4.30.0.5.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/leancert-v4.31.0.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/leancert-v4.32.2.4.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/leancert-v4.33.0.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/mathlib-v4.30.0.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/mathlib-v4.31.0.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/mathlib-v4.32.2.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/catalog/locks/mathlib-v4.33.0.lock.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/compatibility/README.md +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/compatibility/lake-artifact-cache-4.33.0.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/compatibility/mathlib-4.32.2.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/compatibility/mathlib-4.32.2.toml +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/compatibility/mathlib-4.33.0.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/compatibility/mathlib-4.33.0.toml +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/architecture.md +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/captures.md +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/case-study-v1.md +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/lake-artifact-cache-design.md +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/docs/trust-and-limitations.md +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/examples/mathlib.toml +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/__init__.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/__main__.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/_git.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/_paths.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/backends.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/bundles.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/capsules.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/comparison.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/console.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/decisions.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/diagnostics.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/__init__.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/analyzer.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/api.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/candidate.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/catalog.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/catalog_build.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/catalog_manifest.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/data/catalog.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/defaults.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/engine.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/errors.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/module_inventory.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/planner.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/policy.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/probe.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/py.typed +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/result.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/schema_resources.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/schemas/catalog-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/schemas/plan-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/discovery/schemas/result-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/errors.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/events.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/facade.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/frontmatter.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/header_cache.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/health.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/identifier_resolver.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/lake.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/lake_cache.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/lockfiles.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/locking.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/matrix.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/models.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/oci.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/oci_protocol.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/packs.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/policies.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/profiling.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/programs.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/project_execution.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/project_sharing.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/publisher_verification.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/py.typed +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/references.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/resolver.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/schema_resources.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/serialization.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/shared_projects.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/specs.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/store.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/timings.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/toolchain_oci.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/toolchain_slim.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime/wire.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime.egg-info/SOURCES.txt +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime.egg-info/dependency_links.txt +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime.egg-info/requires.txt +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/lean_runtime.egg-info/top_level.txt +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/attestation-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/check-batch-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/cleanup-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/comparison-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/execution-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/inspect-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/matrix-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/plan-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/profile-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/publication-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/schemas/verify-v1.schema.json +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/scripts/lake_cache_gate.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/scripts/registry_preflight.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/scripts/run_compatibility.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/scripts/run_v1_case_study.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/setup.cfg +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/conftest.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/discovery/e2e/test_real_discovery.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/discovery/test_analyzer.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/discovery/test_catalog.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/discovery/test_catalog_build.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/discovery/test_discovery_schema_resources.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/discovery/test_engine.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/discovery/test_planner.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/discovery/test_policy.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_announcement_gate.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_backend.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_bundles.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_capsules.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_console.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_diagnostics.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_events_health.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_facade.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_frontmatter.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_git.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_header_cache.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_identifier_resolver.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_interactive.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_lake_cache.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_lockfiles.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_locking.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_models.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_multifile.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_oci_protocol.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_packs.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_paths.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_prebuilt_policy.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_programs.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_references.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_schema_resources.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_signatures.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_specs.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_store.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_toolchain_oci.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_toolchain_slim.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_v1_precision.py +0 -0
- {lean_runtime-3.0.3 → lean_runtime-4.0.1}/tests/test_verification_inventory.py +0 -0
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 4.0.1 - 2026-08-18
|
|
6
|
+
|
|
7
|
+
- Keep `verify ENV --offline` strictly local for sparse environments by probing
|
|
8
|
+
a retained capsule module and forbidding projection acquisition during the
|
|
9
|
+
probe.
|
|
10
|
+
- Pin the selected exact toolchain before project scaffolding and put a reused
|
|
11
|
+
user toolchain ahead of private Elan for nested Lake commands, preventing
|
|
12
|
+
`new --core` from downloading an alternate unprefixed toolchain.
|
|
13
|
+
|
|
14
|
+
## 4.0.0 - 2026-08-18
|
|
15
|
+
|
|
16
|
+
- Replace the implementation-shaped CLI with a cwd-first workflow: `new`,
|
|
17
|
+
`adopt`, universal `check`, `watch`, `build`, `update`, `publish`, `status`,
|
|
18
|
+
`verify`, `doctor`, and `clean`.
|
|
19
|
+
- Remove the `lean-run` and `lean-runtime-catalog` entry points and all v3
|
|
20
|
+
compatibility spellings. Exact environment operations now live under `env`;
|
|
21
|
+
advanced project operations use `project info/scan/share/unshare/lock/export`.
|
|
22
|
+
- Merge standalone discovery into `lean-runtime check`. A single `--using`
|
|
23
|
+
override replaces the old project, package, lock, environment, and toolchain
|
|
24
|
+
context flags.
|
|
25
|
+
- Make cwd the implicit subject for project commands. Adoption detects whether
|
|
26
|
+
its subject is one Lake project or a tree, previews the storage transition,
|
|
27
|
+
confirms interactively, and preserves atomic rollback.
|
|
28
|
+
- Detect compatible user Elan toolchains automatically and use them read-only.
|
|
29
|
+
Missing toolchains are still installed in Lean Runtime's private Elan home,
|
|
30
|
+
and optimization never prunes a user-managed installation.
|
|
31
|
+
- Make cleanup, adoption, updates, publication setup, and safe doctor repairs
|
|
32
|
+
guided operations. Automation uses `--yes`; inspection uses `--dry-run`.
|
|
33
|
+
|
|
5
34
|
## 3.0.3 - 2026-08-18
|
|
6
35
|
|
|
7
36
|
- Give sparse-environment and slim-toolchain downloads independent progress
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lean-runtime
|
|
3
|
+
Version: 4.0.1
|
|
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 at
|
|
198
|
+
[alerad.github.io/lean-runtime](https://alerad.github.io/lean-runtime/).
|
|
@@ -0,0 +1,162 @@
|
|
|
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 at
|
|
162
|
+
[alerad.github.io/lean-runtime](https://alerad.github.io/lean-runtime/).
|
|
@@ -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
|
|
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,132 @@
|
|
|
1
|
+
# Installation and first check
|
|
2
|
+
|
|
3
|
+
This guide takes you from an empty Python environment to a checked Lean proof.
|
|
4
|
+
Choose the path that matches what you already have; Lean Runtime infers the
|
|
5
|
+
rest from the current directory and the source itself.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Python 3.10 or newer;
|
|
10
|
+
- Git on `PATH`;
|
|
11
|
+
- Linux or macOS.
|
|
12
|
+
|
|
13
|
+
An existing Elan installation is useful but not required. When the exact
|
|
14
|
+
toolchain is already present, Lean Runtime uses its binaries read-only. Missing
|
|
15
|
+
toolchains are kept in Lean Runtime's private store.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Installing in a virtual environment keeps the command isolated from unrelated
|
|
20
|
+
Python tools:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
python -m venv .venv
|
|
24
|
+
source .venv/bin/activate
|
|
25
|
+
python -m pip install --upgrade pip
|
|
26
|
+
python -m pip install lean-runtime
|
|
27
|
+
lean-runtime --version
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The installed wheel provides one executable: `lean-runtime`.
|
|
31
|
+
|
|
32
|
+
## Choose your first workflow
|
|
33
|
+
|
|
34
|
+
=== "Standalone file"
|
|
35
|
+
|
|
36
|
+
Create `Main.lean`:
|
|
37
|
+
|
|
38
|
+
```lean
|
|
39
|
+
import Mathlib.Data.Nat.Prime.Basic
|
|
40
|
+
|
|
41
|
+
example : Nat.Prime 5 := by decide
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Check it:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
lean-runtime check Main.lean
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Outside a Lake project, Lean Runtime analyzes the imports, selects an exact
|
|
51
|
+
catalog environment, and acquires the required verified import closure. The
|
|
52
|
+
second check reuses that environment.
|
|
53
|
+
|
|
54
|
+
=== "New project"
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
lean-runtime new MyProof
|
|
58
|
+
cd MyProof
|
|
59
|
+
lean-runtime check
|
|
60
|
+
lean-runtime build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`new` selects a stable cataloged Mathlib/toolchain pair, writes exact Lake
|
|
64
|
+
metadata, and prepares reusable dependencies. Mutating commands show their
|
|
65
|
+
plan before acting; use `--yes` only for non-interactive automation.
|
|
66
|
+
|
|
67
|
+
=== "Existing Lake project"
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd ExistingProject
|
|
71
|
+
lean-runtime check
|
|
72
|
+
lean-runtime adopt
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Checking works before adoption. `adopt` is an optional storage optimization:
|
|
76
|
+
it verifies the pinned manifest and current dependency checkouts, previews
|
|
77
|
+
reuse and recovery, probes a shared graph, and swaps it atomically. It does
|
|
78
|
+
not update `lean-toolchain` or `lake-manifest.json`.
|
|
79
|
+
|
|
80
|
+
=== "Python"
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
import lean_runtime as lean
|
|
84
|
+
|
|
85
|
+
env = lean.setup(deps=["mathlib@v4.33.0"])
|
|
86
|
+
result = env.check("import Mathlib.Data.Nat.Prime.Basic\nexample : Nat.Prime 5 := by decide\n")
|
|
87
|
+
result.raise_for_error()
|
|
88
|
+
print(result.execution_id)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Keep the returned environment and call it repeatedly; setup and acquired
|
|
92
|
+
artifacts are reused.
|
|
93
|
+
|
|
94
|
+
## Understand what happened
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
lean-runtime status Main.lean
|
|
98
|
+
lean-runtime storage usage
|
|
99
|
+
lean-runtime doctor
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`status` explains context selection, `storage usage` reports retained content,
|
|
103
|
+
and `doctor` checks Git, disk, store health, toolchains, staging areas, and
|
|
104
|
+
abandoned workspaces.
|
|
105
|
+
|
|
106
|
+
For a standalone check, save the exact selected context when you want a durable
|
|
107
|
+
artifact:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
lean-runtime check Main.lean --lock-out environment.lock.json
|
|
111
|
+
lean-runtime check Main.lean --using environment.lock.json --offline
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
`--offline` is fail-closed: missing toolchains, environments, or sparse import
|
|
115
|
+
closures produce an error instead of a network request.
|
|
116
|
+
|
|
117
|
+
## Where to go next
|
|
118
|
+
|
|
119
|
+
- [Standalone files](standalone-files.md) — frontmatter, explicit context, watch,
|
|
120
|
+
and matrix checks.
|
|
121
|
+
- [Lake projects](local-projects.md) — focused checking, adoption, shared
|
|
122
|
+
dependencies, and updates.
|
|
123
|
+
- [Python API](python-api.md) — batch, async, cancellation, multi-file, and
|
|
124
|
+
interactive use.
|
|
125
|
+
- [Trust and limitations](trust-and-limitations.md) — the exact integrity and
|
|
126
|
+
execution boundary.
|
|
127
|
+
|
|
128
|
+
??? question "Something failed on the first run?"
|
|
129
|
+
|
|
130
|
+
Run `lean-runtime doctor`, then repeat with `--verbose`. A completed Lean
|
|
131
|
+
rejection exits 1; an invalid invocation or infrastructure failure exits 2.
|
|
132
|
+
The [CLI reference](cli.md#exit-status) lists all public exit classes.
|