Durable state & crash recovery
Every turn is written to disk before anything else happens. Close the laptop, lose the network, kill the model — then attach and resume.
A long run is only useful if it survives the real world: a closed laptop, a dropped connection, a model that hangs. deadreckon earns that by writing everything to disk as it goes, so no single failure costs you the run.
Every turn, before anything else happens, the run saves its state. The
state.json file is written the safe way: deadreckon writes a
temporary file, flushes it to disk, then atomically renames
it into place, so a crash can never leave it half-written. Alongside it, the
run writes a full
snapshot of the working tree under
snapshots/turn-N/, plus append-only logs for spend, traces, file
provenance, and events.
When the process holding a run dies, its task lock goes stale:
the lock records a process id, and a quick liveness check shows that process
is gone. The next caller reclaims the lock cleanly. You then
deadreckon resume from any terminal, and the loop replays from
the last completed turn, reconstructing history from traces.jsonl
if needed.
One completed run is final. A run that already reached
Completed can't be resumed back into the loop; it can only be
re-promoted (which is safe to repeat) or replaced by a new run.