Skip to main content

Module trace_export

Module trace_export 

Source
Expand description

Derived, event-log-regenerable export of validation-PASSED worker traces in instruction-pair form (plan §M2). Mirrors the pattern of orchestrator::render_mission_report: a pure function over the folded MissionState with no second persisted source of truth. Calling export_validated_traces/to_jsonl again over the same log always yields the same bytes — there is nothing to regenerate FROM except the event log itself.

Structs§

InstructionPair
One fine-tuning-ready training example derived from a validation-PASSED worker run: the task it was given (instruction) and its accepted final report (response), carrying model provenance for dataset filtering.

Functions§

export_validated_traces
Derive the validation-passed instruction-pair dataset from folded mission state. Selection is validation-PASSED and DERIVED, never stored: a run qualifies iff it is a Role::Worker run whose feature reached FeatureStatus::Complete inside a milestone that reached MilestoneStatus::Complete, AND the run’s own result is Some(RunResult::Pass). Runs on failed/skipped features, non-worker (orchestrator/validator) runs, and failed respawn attempts that precede a later passing run on the same now-Complete feature, are all excluded.
to_jsonl
Render instruction pairs as JSONL: one compact JSON object per line, each terminated by \n. Pure function of its input — no I/O, no persisted dataset file — so it is byte-identical across repeated calls on the same pairs.
write_export_output
Write one export payload to an operator-named --out path: parent chain pinned no-follow, a symlinked (or otherwise non-regular) destination REFUSED, bytes landed through a sibling temp file and a rename.