Skip to main content

Module state

Module state 

Source
Expand description

Persistent, git-untracked engine state: .aristo/nudge-state.toml (Phase 18 #9, S0c). Holds the runtime facts the index can’t carry:

  • the reviewed map (annotation id → {text_hash, body_hash, reviewed}) — the reviewed/unreviewed axis #7 drives; a hash drift re-flips an entry to unreviewed (D6/Q3);
  • the proof-reviewed map (proof id → reviewed);
  • the edit-window baseline (score + tier captured at SessionStart) for the congrats / slump signals;
  • the per-window edit counter for the authoring-debt signal;
  • per-signal throttle records (last fired + last surfaced metric).

Writes are atomic (tempfile + rename), tolerant on read (a missing or corrupt file degrades to default state — the engine never fails a hook on bad state). The file is git-untracked: it is per-user runtime, like .aristo/sessions/.

Structs§

Baseline
The score/tier snapshot captured at the start of an edit window, against which congrats (gain) and slump (drop) are measured.
NudgeState
The whole engine state file. Every field defaults, so older / partial files deserialize cleanly.
ReviewRecord
One annotation’s review record. reviewed is re-flipped to the unreviewed view whenever the live text/body hashes drift from these.
ThrottleRecord
Per-signal throttle bookkeeping.

Constants§

STATE_FILENAME
Basename under .aristo/.