Skip to main content

Module state

Module state 

Source
Expand description

Runner-owned state stored at .pitboss/play/state.json.

Phase 2 introduces the type vocabulary; phase 5 wires the atomic load/save helpers that read and write this struct from disk.

The on-disk form is Option<RunState> so a freshly-initialized workspace (no run started yet) round-trips as JSON null. load returns Ok(None) for a missing file or a null payload; save writes either null or the pretty-printed RunState via crate::util::write_atomic.

Structs§

RoleUsage
Per-role token counters. Aggregated into TokenUsage::by_role.
RunState
Persistent runner state stored at .pitboss/play/state.json.
TokenUsage
Aggregated token usage for a run, broken down by agent role.

Functions§

load
Read the state file from a workspace.
save
Atomically write the state file. Creates the .pitboss/play/ directory if it does not already exist. Pass None to mark the workspace as having no active run; the file is written as JSON null.
state_path
Path of the runner-owned state file inside a workspace (<workspace>/.pitboss/play/state.json).