Skip to main content

Module worker

Module worker 

Source
Expand description

Worker dispatch and report extraction. One worker = one OS process: recorded argv template + generated prompt as the final argument, cwd = the unit worktree, its own Unix process group, a private TMPDIR, stdout/stderr written straight to .vitrify/logs/<job>/worker-<holder>.{out,err} as the harness produces them — with a streaming spelling, a worker that is killed leaves its session up to that point.

Structs§

Report
The C-004 worker report line.
WorkerHandle
A spawned worker: child process (own process group), log paths.

Functions§

extract_report
The extraction rule: if the output is the probed JSON envelope/event stream, extract the assistant’s final text; else raw stdout; in either case parse the LAST NON-EMPTY LINE against the schema — models habitually wrap the line in a markdown code fence, so fence-delimiter lines don’t count as content. None = missing/unparseable (treated as released + failed).
kill_group
SIGKILL a worker’s whole process group (kill(2), declared in signals.rs — no shell, no subprocess, no crate).
report_or_released
The missing/unparseable-report rule: treated as released with notes: "unparseable report"; the unit counts failed for the wave.
spawn
Spawn one worker per C-003. A missing template binary is a named error — never guess a spelling.
spawn_in
spawn with a private temp directory: workers build side by side, and test runners that share one temp root trip over each other.