lean-runtime 4.2.0__tar.gz → 4.22.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.
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/CHANGELOG.md +4 -0
- {lean_runtime-4.2.0/lean_runtime.egg-info → lean_runtime-4.22.0}/PKG-INFO +12 -6
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/README.md +11 -5
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/docs/concepts/context-selection.md +4 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/docs/index.md +2 -3
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/docs/reference/commands.md +8 -3
- lean_runtime-4.22.0/docs/reference/python-advanced.md +69 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/docs/reference/python-api.md +19 -51
- lean_runtime-4.22.0/docs/reference/storage.md +54 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/docs/trust.md +4 -1
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/docs/tutorial.md +24 -35
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/docs/workflows/check-files.md +36 -35
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/cli.py +526 -215
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/health.py +23 -5
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/run_cli.py +3 -3
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/store.py +80 -18
- {lean_runtime-4.2.0 → lean_runtime-4.22.0/lean_runtime.egg-info}/PKG-INFO +12 -6
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime.egg-info/SOURCES.txt +2 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/mkdocs.yml +2 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/pyproject.toml +1 -1
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_cli.py +101 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_events_health.py +17 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_store.py +17 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/LICENSE +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/MANIFEST.in +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/environments.toml +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/core-v4.32.2.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/leancert-v4.30.0.5.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/leancert-v4.31.0.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/leancert-v4.32.2.4.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/leancert-v4.33.0.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/mathlib-v4.30.0.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/mathlib-v4.31.0.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/mathlib-v4.32.2.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/mathlib-v4.33.0.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/catalog/locks/mathlib-v4.33.1.lock.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/compatibility/README.md +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/compatibility/lake-artifact-cache-4.33.0.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/compatibility/mathlib-4.32.2.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/compatibility/mathlib-4.32.2.toml +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/compatibility/mathlib-4.33.0.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/compatibility/mathlib-4.33.0.toml +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/docs/workflows/lake-projects.md +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/examples/mathlib.toml +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/__init__.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/__main__.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/_git.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/_paths.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/backends.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/bundles.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/capsules.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/comparison.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/console.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/context_resolution.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/decisions.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/declaration_index.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/declaration_index_build.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/declaration_index_oci.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/diagnostics.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/__init__.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/analyzer.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/api.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/candidate.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/catalog.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/catalog_build.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/catalog_cli.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/catalog_manifest.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/data/catalog.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/defaults.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/engine.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/errors.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/history.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/memo.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/module_inventory.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/planner.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/policy.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/probe.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/py.typed +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/result.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/schema_resources.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/schemas/catalog-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/schemas/plan-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/discovery/schemas/result-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/environments.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/errors.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/events.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/facade.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/frontmatter.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/header_cache.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/identifier_resolver.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/import_syntax.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/lake.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/lake_cache.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/lockfiles.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/locking.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/matrix.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/models.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/oci.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/oci_protocol.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/packs.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/policies.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/profiling.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/programs.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/project_execution.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/project_sharing.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/projects.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/publisher_verification.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/py.typed +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/references.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/resolver.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/runtime.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/schema_resources.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/serialization.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/shared_projects.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/specs.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/timings.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/toolchain_oci.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/toolchain_slim.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/toolchains.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/verification.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime/wire.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime.egg-info/dependency_links.txt +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime.egg-info/entry_points.txt +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime.egg-info/requires.txt +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/lean_runtime.egg-info/top_level.txt +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/attestation-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/check-batch-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/cleanup-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/comparison-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/execution-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/inspect-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/matrix-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/plan-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/profile-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/publication-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/schemas/verify-v1.schema.json +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/announcement_gate.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/catalog_update.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/lake_cache_gate.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/prepare_declaration_index.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/publish_declaration_index.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/registry_preflight.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/run_compatibility.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/run_v1_case_study.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/scripts/smoke_wheel.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/setup.cfg +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/conftest.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/e2e/test_real_discovery.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/test_analyzer.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/test_catalog.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/test_catalog_build.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/test_discovery_schema_resources.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/test_engine.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/test_memo.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/test_planner.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/discovery/test_policy.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_announcement_gate.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_backend.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_bundles.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_capsules.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_console.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_context_resolution.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_declaration_index.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_diagnostics.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_environment_integration.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_facade.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_frontmatter.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_git.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_header_cache.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_identifier_resolver.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_interactive.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_lake_cache.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_lockfiles.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_locking.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_models.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_multifile.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_oci_protocol.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_packs.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_paths.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_prebuilt_policy.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_programs.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_project_publish.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_projects.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_references.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_run_cli.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_runtime.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_schema_resources.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_schemas.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_signatures.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_specs.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_toolchain_oci.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_toolchain_slim.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_toolchains.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_v1_precision.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_verification_inventory.py +0 -0
- {lean_runtime-4.2.0 → lean_runtime-4.22.0}/tests/test_verification_probe.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lean-runtime
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.22.0
|
|
4
4
|
Summary: Run Lean 4 proofs from Python or standalone files
|
|
5
5
|
Author: Alejandro Radisic
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -53,16 +53,15 @@ example : 2 + 2 = 4 := by norm_num
|
|
|
53
53
|
|
|
54
54
|
```console
|
|
55
55
|
$ lean-runtime check Main.lean
|
|
56
|
-
✓ Main.lean accepted in 2.60s
|
|
57
56
|
```
|
|
58
57
|
|
|
59
58
|
No Lake project, dependency checkout, or toolchain setup required. Lean Runtime
|
|
60
59
|
discovers and verifies the exact environment, then keeps it ready for offline
|
|
61
60
|
reuse.
|
|
62
61
|
|
|
63
|
-
[Get started](https://alerad.github.io/lean-runtime/
|
|
62
|
+
[Get started](https://alerad.github.io/lean-runtime/tutorial/) ·
|
|
64
63
|
[Read the documentation](https://alerad.github.io/lean-runtime/) ·
|
|
65
|
-
[Explore the CLI](https://alerad.github.io/lean-runtime/
|
|
64
|
+
[Explore the CLI](https://alerad.github.io/lean-runtime/reference/commands/)
|
|
66
65
|
|
|
67
66
|
## Start where you are
|
|
68
67
|
|
|
@@ -100,8 +99,15 @@ lean-runtime check Main.lean
|
|
|
100
99
|
The same command uses the nearest pinned Lake project when one exists and
|
|
101
100
|
otherwise performs bounded exact-environment discovery. Automatic discovery
|
|
102
101
|
uses retained or verified downloadable environments; building a missing
|
|
103
|
-
candidate from source requires `--allow-source-build`.
|
|
104
|
-
|
|
102
|
+
candidate from source requires `--allow-source-build`.
|
|
103
|
+
|
|
104
|
+
Record the environment only when the result must be reproduced elsewhere:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
lean-runtime check Main.lean --write-lock environment.lock.json
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
A file can instead carry an explicit context in strict comment frontmatter:
|
|
105
111
|
|
|
106
112
|
```lean
|
|
107
113
|
-- /// lean-runtime
|
|
@@ -17,16 +17,15 @@ example : 2 + 2 = 4 := by norm_num
|
|
|
17
17
|
|
|
18
18
|
```console
|
|
19
19
|
$ lean-runtime check Main.lean
|
|
20
|
-
✓ Main.lean accepted in 2.60s
|
|
21
20
|
```
|
|
22
21
|
|
|
23
22
|
No Lake project, dependency checkout, or toolchain setup required. Lean Runtime
|
|
24
23
|
discovers and verifies the exact environment, then keeps it ready for offline
|
|
25
24
|
reuse.
|
|
26
25
|
|
|
27
|
-
[Get started](https://alerad.github.io/lean-runtime/
|
|
26
|
+
[Get started](https://alerad.github.io/lean-runtime/tutorial/) ·
|
|
28
27
|
[Read the documentation](https://alerad.github.io/lean-runtime/) ·
|
|
29
|
-
[Explore the CLI](https://alerad.github.io/lean-runtime/
|
|
28
|
+
[Explore the CLI](https://alerad.github.io/lean-runtime/reference/commands/)
|
|
30
29
|
|
|
31
30
|
## Start where you are
|
|
32
31
|
|
|
@@ -64,8 +63,15 @@ lean-runtime check Main.lean
|
|
|
64
63
|
The same command uses the nearest pinned Lake project when one exists and
|
|
65
64
|
otherwise performs bounded exact-environment discovery. Automatic discovery
|
|
66
65
|
uses retained or verified downloadable environments; building a missing
|
|
67
|
-
candidate from source requires `--allow-source-build`.
|
|
68
|
-
|
|
66
|
+
candidate from source requires `--allow-source-build`.
|
|
67
|
+
|
|
68
|
+
Record the environment only when the result must be reproduced elsewhere:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
lean-runtime check Main.lean --write-lock environment.lock.json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A file can instead carry an explicit context in strict comment frontmatter:
|
|
69
75
|
|
|
70
76
|
```lean
|
|
71
77
|
-- /// lean-runtime
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Every check runs inside one selected context. Context selection and compiler acceptance are separate decisions.
|
|
4
4
|
|
|
5
|
+
For ordinary standalone checks, let Lean Runtime discover the context. Explicit
|
|
6
|
+
context is an override for reproducibility, compatibility testing, or a request
|
|
7
|
+
that specifically names a release.
|
|
8
|
+
|
|
5
9
|
## Precedence
|
|
6
10
|
|
|
7
11
|
For a Lean file, Lean Runtime considers context sources in this order:
|
|
@@ -93,7 +93,7 @@ hide:
|
|
|
93
93
|
<p class="lr-card-label">Standalone file</p>
|
|
94
94
|
<h3>Bring a Lean source file</h3>
|
|
95
95
|
<pre><code>lean-runtime check Main.lean</code></pre>
|
|
96
|
-
<p>
|
|
96
|
+
<p>Lean Runtime discovers a plausible exact environment and accepts it only when Lean accepts the file.</p>
|
|
97
97
|
<a href="workflows/check-files/">Check Lean files</a>
|
|
98
98
|
</article>
|
|
99
99
|
<article>
|
|
@@ -108,11 +108,10 @@ lean-runtime build</code></pre>
|
|
|
108
108
|
<p class="lr-card-label">Exact and offline</p>
|
|
109
109
|
<h3>Record the environment</h3>
|
|
110
110
|
<pre><code>lean-runtime check Main.lean \
|
|
111
|
-
--lock
|
|
111
|
+
--write-lock environment.lock.json</code></pre>
|
|
112
112
|
<p>Reuse the resulting lock explicitly, including with network access disabled.</p>
|
|
113
113
|
<a href="workflows/check-files/#record-and-reuse-an-exact-lock">Use an exact lock</a>
|
|
114
114
|
</article>
|
|
115
115
|
</div>
|
|
116
116
|
</section>
|
|
117
117
|
|
|
118
|
-
|
|
@@ -32,23 +32,28 @@ This page summarizes the command surface. Run `lean-runtime COMMAND --help` for
|
|
|
32
32
|
| `env` | Exact immutable environments and locks. |
|
|
33
33
|
| `project` | Mutable project inspection, sharing, locks, and exports. |
|
|
34
34
|
| `toolchain` | Toolchain installation, inspection, optimization, and publication. |
|
|
35
|
-
| `storage` | Storage usage and verification. |
|
|
35
|
+
| `storage` | Storage usage and verification; see [Storage](storage.md). |
|
|
36
36
|
| `program` | Ready-to-run program artifacts. |
|
|
37
37
|
| `catalog` | Discovery catalog maintenance. |
|
|
38
38
|
|
|
39
39
|
## Common check options
|
|
40
40
|
|
|
41
41
|
```console
|
|
42
|
-
lean-runtime check Main.lean
|
|
43
|
-
lean-runtime check Main.lean --offline
|
|
42
|
+
lean-runtime check Main.lean
|
|
44
43
|
lean-runtime check Main.lean --json
|
|
45
44
|
lean-runtime check Main.lean --timings
|
|
46
45
|
lean-runtime check Main.lean --repeat 10
|
|
46
|
+
lean-runtime check Main.lean --write-lock environment.lock.json
|
|
47
47
|
lean-runtime check - --using leanprover/lean4:v4.33.0
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
`-` reads Lean source from standard input and requires an explicit context.
|
|
51
51
|
|
|
52
|
+
Automatic discovery is the normal standalone workflow. `--using CONTEXT`
|
|
53
|
+
overrides it when a package release, lock, toolchain, environment, or project is
|
|
54
|
+
specifically required. `--offline` prevents acquisition and therefore needs the
|
|
55
|
+
selected content to be retained locally.
|
|
56
|
+
|
|
52
57
|
`--allow-source-build` permits standalone discovery to build an environment from source when no suitable acquired form is available.
|
|
53
58
|
|
|
54
59
|
## Build cache control
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Advanced Python workflows
|
|
2
|
+
|
|
3
|
+
These APIs are useful for services and integrations. Ordinary scripts can use
|
|
4
|
+
the synchronous API in [Python API](python-api.md).
|
|
5
|
+
|
|
6
|
+
## Cancel work in flight
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
import lean_runtime as lean
|
|
10
|
+
|
|
11
|
+
environment = lean.setup(toolchain="v4.33.0")
|
|
12
|
+
job = environment.start_check("example : True := trivial")
|
|
13
|
+
cancelled = job.cancel()
|
|
14
|
+
result = job.result()
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`cancel()` returns `False` once the job has completed. Cancellation is
|
|
18
|
+
cooperative and terminates the local child process.
|
|
19
|
+
|
|
20
|
+
## Use asyncio
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
import asyncio
|
|
24
|
+
import lean_runtime as lean
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
async def main() -> None:
|
|
28
|
+
environment = lean.setup(toolchain="v4.33.0")
|
|
29
|
+
source = "example : True := trivial"
|
|
30
|
+
result = await environment.check_async(source)
|
|
31
|
+
results = await environment.check_many_async([source, source], concurrency=2)
|
|
32
|
+
assert result.ok and all(item.ok for item in results)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
asyncio.run(main())
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Synchronous `setup()`, `check()`, and `Runtime.prepare()` also accept a
|
|
39
|
+
`threading.Event` through `cancel=`.
|
|
40
|
+
|
|
41
|
+
## Replay a capture
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import lean_runtime as lean
|
|
45
|
+
|
|
46
|
+
result = lean.replay("execution.capture.json")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The path must identify an execution capture created or supplied by the caller;
|
|
50
|
+
Lean Runtime does not bundle the placeholder file above.
|
|
51
|
+
|
|
52
|
+
## Keep a process alive
|
|
53
|
+
|
|
54
|
+
`spawn_interactive()` exposes line-buffered UTF-8 pipes for a line-oriented tool
|
|
55
|
+
provided by the selected environment:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import lean_runtime as lean
|
|
59
|
+
|
|
60
|
+
environment = lean.setup(["mathlib@v4.33.0"])
|
|
61
|
+
with environment.spawn_interactive(["lake", "exe", "lean_bridge"]) as session:
|
|
62
|
+
response = session.request_json({"id": 1, "method": "get_info", "params": {}})
|
|
63
|
+
|
|
64
|
+
result = session.close()
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`lean_bridge` is an example project executable, not a program bundled with Lean
|
|
68
|
+
Runtime. `close()` is idempotent and terminates the process group when the tool
|
|
69
|
+
does not exit after its input closes.
|
|
@@ -11,9 +11,10 @@ happens on the first call; everything after it reuses the prepared environment.
|
|
|
11
11
|
import lean_runtime as lean
|
|
12
12
|
|
|
13
13
|
environment = lean.setup(["mathlib@v4.33.0"])
|
|
14
|
-
locked = lean.setup(lock="environment.lock.json")
|
|
15
|
-
existing = lean.setup(environment="research-stack")
|
|
16
14
|
core = lean.setup(toolchain="v4.33.0")
|
|
15
|
+
|
|
16
|
+
# Alternatives when these caller-provided contexts already exist:
|
|
17
|
+
locked = lean.setup(lock="environment.lock.json")
|
|
17
18
|
project = lean.setup(project="./my-project")
|
|
18
19
|
```
|
|
19
20
|
|
|
@@ -28,6 +29,16 @@ function for explicit configuration.
|
|
|
28
29
|
## Check a source
|
|
29
30
|
|
|
30
31
|
```python
|
|
32
|
+
source = """\
|
|
33
|
+
import Mathlib
|
|
34
|
+
example : 2 + 2 = 4 := by norm_num
|
|
35
|
+
"""
|
|
36
|
+
files = {
|
|
37
|
+
"Helper.lean": "def answer := 42\n",
|
|
38
|
+
"Main.lean": "import Helper\nexample : answer = 42 := rfl\n",
|
|
39
|
+
}
|
|
40
|
+
sources = [source, "example : True := trivial"]
|
|
41
|
+
|
|
31
42
|
result = environment.check(source)
|
|
32
43
|
result = environment.check_files(files, entrypoint="Main.lean")
|
|
33
44
|
results = environment.check_many(sources, concurrency=8)
|
|
@@ -37,13 +48,9 @@ One-shot helpers route the same way:
|
|
|
37
48
|
|
|
38
49
|
```python
|
|
39
50
|
result = lean.check(source, deps=["mathlib@v4.33.0"])
|
|
40
|
-
result = lean.check_file("./my-project/MyProject/
|
|
41
|
-
result = lean.replay("execution.capture.json")
|
|
51
|
+
result = lean.check_file("./my-project/MyProject/Basic.lean")
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
`replay()` requires an existing execution capture; the filename above is a
|
|
45
|
-
placeholder for an artifact supplied by the caller or an execution backend.
|
|
46
|
-
|
|
47
54
|
## Read the result
|
|
48
55
|
|
|
49
56
|
Failed checks expose parsed diagnostics directly:
|
|
@@ -131,6 +138,7 @@ instead records the canonical root, a workspace digest excluding `.git` and
|
|
|
131
138
|
## Work with Lake projects
|
|
132
139
|
|
|
133
140
|
```python
|
|
141
|
+
runtime = lean.Runtime()
|
|
134
142
|
project = runtime.project("./existing-project")
|
|
135
143
|
project.check_file("./existing-project/MyLibrary/Main.lean")
|
|
136
144
|
project.build(("MyLibrary",))
|
|
@@ -146,55 +154,15 @@ project.build(("MyLibrary",), artifact_cache=False)
|
|
|
146
154
|
`runtime.project()` also accepts a contained file and resolves the nearest
|
|
147
155
|
pinned Lake root. See [Work with Lake projects](../workflows/lake-projects.md).
|
|
148
156
|
|
|
149
|
-
## Cancel work in flight
|
|
150
|
-
|
|
151
|
-
```python
|
|
152
|
-
job = environment.start_check(source)
|
|
153
|
-
if no_longer_needed:
|
|
154
|
-
job.cancel()
|
|
155
|
-
result = job.result()
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
`cancel()` returns `False` once the job has completed. Cancellation is
|
|
159
|
-
cooperative and terminates the local child process.
|
|
160
|
-
|
|
161
|
-
The asyncio helpers preserve that behaviour:
|
|
162
|
-
|
|
163
|
-
```python
|
|
164
|
-
result = await environment.check_async(source)
|
|
165
|
-
results = await environment.check_many_async(sources, concurrency=8)
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Synchronous `setup()`, `check()`, and `Runtime.prepare()` accept a
|
|
169
|
-
`threading.Event` through `cancel=`, which interrupts toolchain installation,
|
|
170
|
-
Lake resolution, and environment builds.
|
|
171
|
-
|
|
172
|
-
## Keep a tool alive
|
|
173
|
-
|
|
174
|
-
`spawn_interactive()` holds one process open inside a disposable instance and
|
|
175
|
-
exposes line-buffered UTF-8 pipes, for REPLs, language servers, and NDJSON
|
|
176
|
-
bridges where startup cost should be paid once:
|
|
177
|
-
|
|
178
|
-
```python
|
|
179
|
-
with environment.spawn_interactive(["lake", "exe", "lean_bridge"]) as session:
|
|
180
|
-
response = session.request_json({"id": 1, "method": "get_info", "params": {}})
|
|
181
|
-
|
|
182
|
-
result = session.close()
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
`close()` is idempotent, closes stdin first so cooperative servers exit on EOF,
|
|
186
|
-
then terminates the process group if needed. `send_line()`, `read_line()`,
|
|
187
|
-
`request_line()`, and `request_json()` are locked so concurrent callers cannot
|
|
188
|
-
interleave protocol frames. `lean_bridge` is an example project executable, not
|
|
189
|
-
a program bundled with Lean Runtime; replace it with a line-oriented tool provided
|
|
190
|
-
by the selected environment.
|
|
191
|
-
|
|
192
157
|
## Observe progress
|
|
193
158
|
|
|
194
159
|
```python
|
|
195
|
-
runtime = Runtime(on_event=lambda event: print(event.kind, event.data))
|
|
160
|
+
runtime = lean.Runtime(on_event=lambda event: print(event.kind, event.data))
|
|
196
161
|
```
|
|
197
162
|
|
|
198
163
|
Events are typed `RuntimeEvent` values, not parsed log lines. They cover
|
|
199
164
|
toolchain readiness, Lake resolution, source locking, artifact restoration,
|
|
200
165
|
builds, publication, and environment reuse.
|
|
166
|
+
|
|
167
|
+
Cancellation, asyncio, replay, and persistent interactive processes are covered
|
|
168
|
+
in [Advanced Python workflows](python-advanced.md).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Storage
|
|
2
|
+
|
|
3
|
+
Lean Runtime retains exact toolchains, sources, environments, and compiled
|
|
4
|
+
artifacts so later checks can run without repeating acquisition or builds.
|
|
5
|
+
|
|
6
|
+
## Inspect usage
|
|
7
|
+
|
|
8
|
+
```console
|
|
9
|
+
lean-runtime storage usage
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The report distinguishes two totals:
|
|
13
|
+
|
|
14
|
+
- **Materialized** sums the logical size of every retained category. A file
|
|
15
|
+
hard-linked from the shared CAS into an environment appears in both category
|
|
16
|
+
rows.
|
|
17
|
+
- **Allocated** counts hard-linked files once and uses allocated filesystem
|
|
18
|
+
blocks. It remains an estimate because filesystems such as APFS can share
|
|
19
|
+
copy-on-write blocks without exposing that relationship through ordinary file
|
|
20
|
+
metadata.
|
|
21
|
+
|
|
22
|
+
Consequently, materialized size is useful for understanding retained content
|
|
23
|
+
but is not a claim about unique physical disk consumption.
|
|
24
|
+
|
|
25
|
+
`lean-runtime storage verify` rebuilds the storage ledger by scanning the whole
|
|
26
|
+
store. It can take significant time on a large cache; ordinary usage reads the
|
|
27
|
+
cached ledger when its fingerprint is current.
|
|
28
|
+
|
|
29
|
+
## Scratch workspaces
|
|
30
|
+
|
|
31
|
+
Checks, builds, dependency resolution, and interactive programs use disposable
|
|
32
|
+
workspaces. Normal completion removes them. A workspace is considered abandoned
|
|
33
|
+
when it is old enough and no process holds its ownership lease.
|
|
34
|
+
|
|
35
|
+
Legacy workspaces from releases that predate ownership markers are retained for
|
|
36
|
+
at least 24 hours before `doctor --yes` removes them.
|
|
37
|
+
|
|
38
|
+
## Reclaim space
|
|
39
|
+
|
|
40
|
+
Preview cleanup first:
|
|
41
|
+
|
|
42
|
+
```console
|
|
43
|
+
lean-runtime clean --dry-run
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Apply the displayed plan explicitly:
|
|
47
|
+
|
|
48
|
+
```console
|
|
49
|
+
lean-runtime clean --yes
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Named, recent, and in-use environments are retained. Add `--all` only when the
|
|
53
|
+
download cache should also be considered. Shared project packages remain
|
|
54
|
+
available for project reuse.
|
|
@@ -27,11 +27,14 @@ Lake packages and build scripts can execute code during acquisition or compilati
|
|
|
27
27
|
```console
|
|
28
28
|
lean-runtime verify environment.lock.json
|
|
29
29
|
lean-runtime verify ENVIRONMENT
|
|
30
|
-
lean-runtime storage verify
|
|
31
30
|
```
|
|
32
31
|
|
|
33
32
|
Use `--offline` when verification must not contact remote services. Use `verify --rebuild` when independent reconstruction is required and permitted.
|
|
34
33
|
|
|
34
|
+
`lean-runtime storage verify` performs a deeper scan of the entire local store.
|
|
35
|
+
It is a maintenance operation and can take significant time on a large cache;
|
|
36
|
+
see [Storage](reference/storage.md).
|
|
37
|
+
|
|
35
38
|
## Diagnose the local runtime
|
|
36
39
|
|
|
37
40
|
```console
|
|
@@ -26,13 +26,14 @@ Create `Basic.lean`:
|
|
|
26
26
|
example : 1 + 1 = 2 := by decide
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Check it directly:
|
|
30
30
|
|
|
31
31
|
```console
|
|
32
|
-
lean-runtime check Basic.lean
|
|
32
|
+
lean-runtime check Basic.lean
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Lean Runtime selects a plausible catalog context and runs Lean. Exit code `0`
|
|
36
|
+
means Lean accepted the file in the reported context.
|
|
36
37
|
|
|
37
38
|
## Check a file that imports Mathlib
|
|
38
39
|
|
|
@@ -51,63 +52,51 @@ Run the check without specifying a context:
|
|
|
51
52
|
lean-runtime check Primes.lean
|
|
52
53
|
```
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
For a standalone file, Lean Runtime uses imports as evidence for automatic
|
|
56
|
+
discovery. It tries exact catalog environments within a bounded policy. A
|
|
57
|
+
candidate succeeds only when Lean accepts the source in that environment.
|
|
55
58
|
|
|
56
59
|
The first run may install a toolchain and acquire environment content. Later checks reuse retained content.
|
|
57
60
|
|
|
58
|
-
##
|
|
61
|
+
## Record an exact lock
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
Write the environment used by a successful check:
|
|
61
64
|
|
|
62
65
|
```console
|
|
63
|
-
lean-runtime
|
|
66
|
+
lean-runtime check Primes.lean --write-lock primes.lock.json
|
|
64
67
|
```
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## Specify a package release
|
|
69
|
-
|
|
70
|
-
Use `--using` when the context is part of the request:
|
|
69
|
+
Use the lock on a later run:
|
|
71
70
|
|
|
72
71
|
```console
|
|
73
|
-
lean-runtime check Primes.lean --using
|
|
72
|
+
lean-runtime check Primes.lean --using primes.lock.json
|
|
74
73
|
```
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```lean
|
|
79
|
-
-- /// lean-runtime
|
|
80
|
-
-- requires = ["mathlib@v4.33.0"]
|
|
81
|
-
-- ///
|
|
82
|
-
import Mathlib.Data.Nat.Prime.Infinite
|
|
75
|
+
After the required toolchain and environment content are available locally, the same check can prohibit network access:
|
|
83
76
|
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
```console
|
|
78
|
+
lean-runtime check Primes.lean --using primes.lock.json --offline
|
|
86
79
|
```
|
|
87
80
|
|
|
88
|
-
|
|
81
|
+
Offline mode does not acquire missing remote content. Missing requirements produce an infrastructure failure rather than a Lean rejection.
|
|
89
82
|
|
|
90
|
-
##
|
|
83
|
+
## Troubleshoot or override selection
|
|
91
84
|
|
|
92
|
-
|
|
85
|
+
`status` previews routing without running Lean:
|
|
93
86
|
|
|
94
87
|
```console
|
|
95
|
-
lean-runtime
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Use the lock on a later run:
|
|
99
|
-
|
|
100
|
-
```console
|
|
101
|
-
lean-runtime check Primes.lean --using primes.lock.json
|
|
88
|
+
lean-runtime status Primes.lean
|
|
102
89
|
```
|
|
103
90
|
|
|
104
|
-
|
|
91
|
+
Most checks should rely on discovery. Use `--using` only when a particular
|
|
92
|
+
release or context is part of the request:
|
|
105
93
|
|
|
106
94
|
```console
|
|
107
|
-
lean-runtime check Primes.lean --using
|
|
95
|
+
lean-runtime check Primes.lean --using mathlib@v4.33.0
|
|
108
96
|
```
|
|
109
97
|
|
|
110
|
-
|
|
98
|
+
See [Context selection](concepts/context-selection.md) for frontmatter, project
|
|
99
|
+
precedence, and other explicit context forms.
|
|
111
100
|
|
|
112
101
|
## Interpret the result
|
|
113
102
|
|
|
@@ -16,44 +16,10 @@ Preview the routing decision without running Lean:
|
|
|
16
16
|
lean-runtime status Main.lean
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
## Select a context explicitly
|
|
20
|
-
|
|
21
|
-
`--using` accepts several kinds of context:
|
|
22
|
-
|
|
23
|
-
```console
|
|
24
|
-
lean-runtime check Main.lean --using mathlib@v4.33.0
|
|
25
|
-
lean-runtime check Main.lean --using environment.lock.json
|
|
26
|
-
lean-runtime check Main.lean --using leanprover/lean4:v4.33.0
|
|
27
|
-
lean-runtime check Main.lean --using ./some-project
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Package references resolve a published package release. Lock files identify an exact dependency graph. Toolchain references provide a core Lean context. Project paths use the project toolchain and manifest; the file must live inside that project's root.
|
|
31
|
-
|
|
32
|
-
## Check standard input
|
|
33
|
-
|
|
34
|
-
Pass `-` as the input. Standard input carries no filename evidence, so an explicit context is required:
|
|
35
|
-
|
|
36
|
-
```console
|
|
37
|
-
echo 'example : True := trivial' | lean-runtime check - --using leanprover/lean4:v4.33.0
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Put context in the file
|
|
41
|
-
|
|
42
|
-
Frontmatter must appear before Lean source and each line remains a Lean comment:
|
|
43
|
-
|
|
44
|
-
```lean
|
|
45
|
-
-- /// lean-runtime
|
|
46
|
-
-- requires = ["mathlib@v4.33.0"]
|
|
47
|
-
-- ///
|
|
48
|
-
import Mathlib
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Supported fields are `requires`, `toolchain`, and `lock`. A lock already identifies the complete environment, so `lock` cannot be combined with `requires` or `toolchain`.
|
|
52
|
-
|
|
53
19
|
## Record and reuse an exact lock
|
|
54
20
|
|
|
55
21
|
```console
|
|
56
|
-
lean-runtime check Main.lean --lock
|
|
22
|
+
lean-runtime check Main.lean --write-lock environment.lock.json
|
|
57
23
|
lean-runtime check Main.lean --using environment.lock.json
|
|
58
24
|
```
|
|
59
25
|
|
|
@@ -91,6 +57,41 @@ lean-runtime check Main.lean --json
|
|
|
91
57
|
|
|
92
58
|
The structured result distinguishes compiler rejection from context or acquisition failure and includes execution metadata.
|
|
93
59
|
|
|
60
|
+
## Override discovery
|
|
61
|
+
|
|
62
|
+
Use `--using` only when a particular context is part of the request:
|
|
63
|
+
|
|
64
|
+
```console
|
|
65
|
+
lean-runtime check Main.lean --using mathlib@v4.33.0
|
|
66
|
+
lean-runtime check Main.lean --using environment.lock.json
|
|
67
|
+
lean-runtime check Main.lean --using leanprover/lean4:v4.33.0
|
|
68
|
+
lean-runtime check some-project/MyProject/Main.lean --using ./some-project
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Package references resolve a published release. Lock files identify an exact
|
|
72
|
+
dependency graph. Toolchain references provide a core Lean context. A file
|
|
73
|
+
checked in a project context must live inside that project.
|
|
74
|
+
|
|
75
|
+
Frontmatter can carry the same requirement with the source:
|
|
76
|
+
|
|
77
|
+
```lean
|
|
78
|
+
-- /// lean-runtime
|
|
79
|
+
-- requires = ["mathlib@v4.33.0"]
|
|
80
|
+
-- ///
|
|
81
|
+
import Mathlib
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Supported fields are `requires`, `toolchain`, and `lock`. A lock cannot be
|
|
85
|
+
combined with `requires` or `toolchain`.
|
|
86
|
+
|
|
87
|
+
## Check standard input
|
|
88
|
+
|
|
89
|
+
Standard input has no filename evidence, so it requires an explicit context:
|
|
90
|
+
|
|
91
|
+
```console
|
|
92
|
+
echo 'example : True := trivial' | lean-runtime check - --using leanprover/lean4:v4.33.0
|
|
93
|
+
```
|
|
94
|
+
|
|
94
95
|
## Watch a project file
|
|
95
96
|
|
|
96
97
|
The current watch workflow requires one file inside a pinned Lake project:
|