Skip to main content

Module runtime_validator

Module runtime_validator 

Source
Expand description

Runtime version validation for Limitless CLI.

Checks an installed runtime version against per-stack requirements and returns a VersionReport carrying a CheckStatus plus actionable feedback. Thresholds follow the Limitless spec:

StackMinimumRecommended
Node14.0.0 (warn)>= 18.0.0
Python3.8.0 (warn)>= 3.9.0
Rust1.56.0—

Project-specific requirements are honoured when available: package.json engines.node, pyproject.toml requires-python, and the rust-toolchain / rust-toolchain.toml channel.

§Example outputs

PASS  "Node v18.12.0 meets the recommended version (>= 18.0.0)."
WARN  "Node v16.3.1 works, but Node >= 18.0.0 is recommended."
FAIL  "Node v12.22.0 is too old. Node 14.0.0 or newer is required."
FAIL  "engines.node requires Node 20.0.0+, but v18.12.0 is installed."

Structs§

SemVer
A strict major.minor.patch semantic version with ordering support.
VersionReport
The outcome of a validate_runtime_version call.

Functions§

validate_installed_runtime
Convenience wrapper for limit check: detects the current directory’s stack, probes the installed tool, and validates it against the repo. Returns None when there is nothing to validate (unknown/Docker stack or the relevant tool binary is not installed).
validate_project_runtime
Validates an installed version against a repository’s own requirements files (engines.node, requires-python, rust-toolchain) in addition to the spec thresholds.
validate_runtime_version
Core validation. Applies the spec thresholds for the given stack using only the installed version — no project files are consulted.