Expand description
Beholder framework — observer-side parsers and rewriters for structured output.
A beholder attaches to a TaskRun at spawn time and turns raw output
chunks into structured Event rows. There are two modes:
- Rewriter: mutates
argvbefore the subprocess starts (e.g. cargo gets--message-format=json-render-diagnostics). - Parser: reads human-formatted output and scrapes events out of it.
§Integration point
ⓘ
let result = registry.attach(raw_cmd, &BeholderSelect::Auto, tty_attached);
// spawn the process with result.argv (may be rewritten)
// for each chunk captured:
if let Some(b) = result.beholder.as_mut() {
for event in b.parse_chunk(&chunk) {
store.append_event(run_id, ...);
}
}
// persist result.status on the run:
store.update_beholder_status(run_id, &result.status)?;Structs§
- Attach
Result - Returned by
BeholderRegistry::attach. - Beholder
Registry - Registry of available beholders, consulted at
task.runtime. - Biome
Beholder - Per-run Biome JSON parser. Buffers all output; parses in
on_done. - Biome
Beholder Factory - Factory for the bundled Biome beholder (Tier 1.5, Rewriter mode).
- BunTest
Beholder Factory - Factory for the bundled bun-test beholder (Tier 1.5, Rewriter mode).
- Cargo
Beholder - Per-run cargo JSON parser.
- Cargo
Beholder Factory - Factory for the bundled cargo beholder (Tier 1.5, Rewriter mode).
- Eslint
Beholder - Per-run ESLint JSON parser. Buffers all output; parses in
on_done. - Eslint
Beholder Factory - Factory for the bundled ESLint beholder (Tier 1.5, Rewriter mode).
- Jest
Beholder Factory - Factory for the bundled jest beholder (Tier 1.5, Rewriter mode).
- JsTest
Beholder - Per-run JS test JSON parser shared by vitest, jest, and bun-test.
- Pytest
Beholder - Per-run pytest text-output parser.
- Pytest
Beholder Factory - Factory for the bundled pytest beholder (Tier 1.5, Parser mode).
- Tool
Version Range - Declared support range for the tool’s structured-output schema (not the
beholder’s own version). Used to surface
unknown_formatwhen drift is detected at parse time. - TscBeholder
- Per-run tsc parser.
- TscBeholder
Factory - Factory for the bundled tsc beholder (Tier 1.5, Rewriter + Parser).
- Vite
Build Beholder - Per-run vite build output parser.
- Vite
Build Beholder Factory - Factory for the bundled vite-build beholder (Tier 1.5, Parser mode).
- Vitest
Beholder Factory - Factory for the bundled vitest beholder (Tier 1.5, Rewriter mode).
Enums§
- Beholder
Mode - Whether a beholder modifies the invocation (rewriter) or reads human output (parser).
- Beholder
Select - Caller-supplied attachment policy for
task.run.
Traits§
- Beholder
- Per-run stateful chunk processor.
- Beholder
Factory - Static descriptor + factory for a beholder type. Held in the registry.
Functions§
- default_
registry - Construct a
BeholderRegistrypre-loaded with all bundled beholders. - registry_
with_ user_ beholders - Construct a
BeholderRegistrywith bundled beholders plus any user-defined beholders loaded fromuser_dir(typically~/.yah/beholders/). - resolve_
argv - Tokenize
raw_cmdand strip common wrapper binaries so beholders see the bare tool name asargv[0].