Expand description
Trajectory construction and crash-safe persistence.
Structs§
- Trajectory
Builder - Incremental builder used by the harness’s unsigned-workflow path.
Enums§
- Writer
Error - 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
pathatomically: serialize → temp file in the same directory → fsync → rename. A crash can leave a stale.tmpfile 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).