Skip to main content

Crate locode_host

Crate locode_host 

Source
Expand description

locode-host — the one place the system touches the OS (ADR-0008).

Every side effect funnels through the Host: a path jail, shell execution with a timeout + output cap, jailed filesystem helpers, and the shared post-processes. Tools never call std::fs/Command directly — they go through a Host. This crate is a sibling of locode-tools, so it defines its own plain error types; the harness pack (which depends on both) maps them to ToolError::Respond.

Structs§

DirEntry
One entry in a directory listing.
ExecLimits
Limits on shell execution. Defaults mirror Grok Build (the primary model).
ExecOutput
The captured result of a command (completed, timed out, or cancelled).
ExecRequest
A command to run through the host’s shell.
FileRead
A file’s contents plus its stat (the stat is the freshness token edits compare).
FileStat
A file’s size and last-modified time.
Host
The injectable side-effect seam (ADR-0008). Construct once per session, share behind an Arc; holds the jail root + policy and the exec/truncation limits.
HostConfig
Construction-time configuration for a Host.

Enums§

ExecError
A failure to spawn or capture — not a failed command (that is a successful capture with a non-zero exit_code).
FsError
A filesystem operation failure.
PathError
A path-jail failure.
PathPolicy
Whether the filesystem tools are jailed to the workspace root (ADR-0008 amendment).

Functions§

rg_program
The ripgrep program to invoke: the LOCODE_RG_PATH override, else bare rg on PATH (invoked by name — PATH-hijack hygiene, per Claude Code).