Expand description
Checkpoint storage — fold-state types + JSONL event-log reader.
See SRD-44a §“Reader behaviour” for the fold algorithm.
Checkpoint is the in-memory representation produced by
folding the on-disk checkpoint.jsonl event stream; each
per-phase PhaseEntry records the entry’s identity, status,
and any cursor state for in-flight Tier 2 resume.
Structs§
- Checkpoint
- In-memory checkpoint state — the fold of an append-only
JSONL event stream at
logs/<session>/checkpoint.jsonl. One per session. Per SRD-44a, the on-disk format is the event log; this struct is what consumers (resume planner, summary report) see after reading and folding. - Event
Iter - Iterator over
CheckpointDatarecords from a JSONL log. - OpCounts
- Op-execution counts captured on every flush.
- Phase
Entry - Per-phase entry in the checkpoint document.
Enums§
- Phase
Status - Lifecycle status as recorded in the checkpoint file.
Mirrors
crate::scene_tree::PhaseStatussemantically; kept as a separate type so the on-disk vocabulary doesn’t coupled-evolve with scene-tree internal status (e.g. if we ever add a transient state for a runtime invariant that has no on-disk meaning, the storage type stays clean).
Functions§
- iter_
events - Stream events from the JSONL log at
path. Returns an iterator overCheckpointDatarecords; malformed lines surface asErritems so the caller decides whether to stop or continue. Truncated-tail recovery is handled byread’s fold; this function is the lower-level building block for diagnostics tools that want raw event streams. - now_
rfc3339 - Format the current wall-clock time as an RFC 3339 UTC
timestamp, e.g.
2026-01-01T00:00:00Z. Used by the writer forstarted_at/checkpoint_atand by the runner when stamping a fresh session. Local implementation to avoid dragging chrono in for one call site. - read
- Read and fold every event in
pathinto aCheckpoint. ReturnsOk(None)when the file doesn’t exist (fresh session); returnsErronly on hard parse failures mid-stream. A truncated last line is recovered with a Warn per SRD-44a §“Truncated-tail recovery”.