Expand description
Core command entry API for the SIM bootloader.
§Bootloader frame
The shipped sim binary is a bootloader frame, not a batteries-included
runtime. run builds a LoadSession whose only registered loader is
the in-process LoadSession::add_host_factory host loader: with no host
factory and no injected artifact loader it can boot no codec and no
library, so run(["sim", "run"]) fails with no codec 'lisp' available.
This is by design: behavior lives in loadable libraries, not baked into the
frame. The default frame loads a codec when an explicit source, cache
artifact, registry resolver, or host factory supplies it.
A working session therefore comes from one of:
- an explicitly provided source:
--load path/to/artifact.simlib(needs an artifact loader registered viaLoadSession::with_loader), or - a seeded cache resolved by the cache-only
CratesIoResolver(it never reaches the network unless an explicit registry resolver is installed; the cache must otherwise already hold the artifact), or - a host factory registered through
LoadSession::with_host_factoryand driven viarun_with_session– the path every functional test uses.
The registry feature adds a git registry artifact resolver, but it is active
only when the host installs it. Nothing here bakes in a codec.
Structs§
- Bootloader
- A thin bootloader over
LoadSessionfor a single-library product binary. - CliBoot
- Parsed bootloader controls and payload data.
- CliEntrypoint
- A loaded function that owns command-line execution.
- CliEnvelope
- Data envelope supplied to the selected loaded-lib entrypoint.
- CliError
- Command-line error returned by the bootloader core.
- Config
Load Options - Source-selection options for runtime configuration discovery.
- Config
Report Request - Request selected by the
sim config ...CLI surface. - Config
Source Report - One config source and its discovery status.
- Crates
IoResolver - crates.io-style artifact resolver owned by the CLI layer.
- Crates
IoSpec - A parsed
crates.io:NAME@REQsource. - Load
Receipt - Receipt for one library loaded by the bootloader.
- Load
Session - Kernel-backed loader session used by the command entry API.
- Loaded
LibReport - One loaded library as it appears in a boot session report.
- Loaded
State Report - Loaded-state report built from one
LoadSession. - Payload
- Payload preserved for loaded-lib behavior.
- Resolved
Crates IoSource - A crates.io source resolved to a local artifact path.
- Runtime
Config State - Configuration layers discovered during a boot session.
- Version
Req - Version requirement syntax accepted by the CLI crates.io resolver.
Enums§
- CliCommand
- Top-level command selected by the bootloader parser.
- Config
Report Kind - Config report variants supported by the bootloader.
- LibSource
Spec - Library source syntax accepted by the command line.
- Load
Receipt Role - The role a loaded library serves in a boot session.
- Source
Status - Discovery status for one config source.
Constants§
- CLI_
MAIN_ ENTRYPOINT - Symbol prefix a loaded lib claims to own command-line execution.
- DEFAULT_
CODEC_ NAME - Codec name used when
--codecis omitted.
Functions§
- boot_
codec_ name - Returns the selected codec name for a boot session.
- cli_
main_ entrypoint_ symbol - Builds the qualified
cli/main/NAMEentrypoint symbol for a named lib. - codec_
lib_ symbol - Returns the library symbol for a codec name.
- format_
config_ sources - Renders a text config-source report.
- format_
config_ sources_ json - Renders a stable JSON config-source report.
- format_
config_ status - Renders a text status report.
- format_
config_ status_ json - Renders a stable JSON status report.
- format_
effective_ config - Renders one effective config table as config text.
- format_
effective_ config_ json - Renders one effective config table as stable JSON.
- load_
config_ sources - Loads config layers from files and site exports.
- load_
config_ sources_ with_ probes - Loads config layers from probes, files, and site exports.
- parse_
args - Parses the minimal bootloader flags.
- render_
config_ report - Renders the selected config report.
- run
- Runs the command entry API with process arguments.
- run_
command_ with_ session - Runs an already-parsed command with an injected loader session.
- run_
config_ probe - Executes one config probe, applying any emitted layer and recording its report.
- run_
with_ session - Runs the command entry API with an injected loader session.
- version_
line - Returns the version line printed by
sim --version.