Skip to main content

Module context

Module context 

Source
Expand description

RunContext detection.

clap owns flag parsing, so detect_run_context takes already-parsed values (a DetectInput) and performs the filesystem validation, sibling-skill enumeration, and path defaulting that produce a RunContext.

Structs§

DetectInput
Already-parsed flag values handed to detect_run_context. clap owns the actual argv parsing, and --harness is resolved against the registry before this struct is built (unknown names are rejected there); it carries the raw values through to filesystem validation and defaulting.
Harness
The agent harness an eval runs against: a validated handle to an entry in the descriptor registry. Constructible only through registry resolution, so a held Harness always names a registered harness and adapter lookup never fails. The registry-dependent behavior lives next to the registry in crate::adapters::harness: Harness::resolve (the string-to-handle gateway, resolving --harness after parsing), Harness::known (every registered harness), Default (the registry’s default harness), and Deserialize (resolves artifact values, rejecting unknown names).
RunContext
The resolved environment for a run: validated skill location, sibling skills, workspace/stage roots, optional bootstrap file, and the target harness. Built by detect_run_context; held in memory and never (de)serialized.

Enums§

ContextError
A user-facing failure while detecting the run context. Display strings carry the offending flag/path so the error: <msg> boundary in main.rs is actionable.

Functions§

detect_run_context
Validate the parsed flags against the filesystem and assemble a RunContext: resolves either a seeded --skill-dir environment or a direct single skill selected from --skill <path-or-name> / the current directory, validates SKILL.md, an optional existing --bootstrap, and defaults the workspace/stage roots from the current directory.