Skip to main content

Module writer

Module writer 

Source
Expand description

Trajectory construction and crash-safe persistence.

Structs§

TrajectoryBuilder
Incremental builder used by the harness’s unsigned-workflow path.

Enums§

WriterError
Errors from trajectory building / writing.

Functions§

metrics
Convenience: build a metrics block with the three token counts the fidelity criterion (R17) requires on strict v1.7 agent steps with nonzero llm_call_count — in practice, every LLM-backed exported step.
write_atomic
Write a trajectory to path atomically: serialize → temp file in the same directory → fsync → rename. A crash can leave a stale .tmp file but never a torn trajectory (silent-error class D13.16). The trajectory is validated (strict) before any byte is written — this crate never produces an invalid file (success criterion R28).