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, once wired, the harness ValueEnum rejection); this struct carries the raw values through to filesystem validation and defaulting.
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.
Harness
The agent harness an eval runs against. Single source of truth, shared with the CLI layer (it derives clap::ValueEnum so flags can parse it directly).

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.