Expand description
Persistent run statistics for cumulative token savings tracking.
Stores one JSON line per SHIFT invocation in ~/.shift/stats.jsonl.
Inspired by RTK’s rtk gain analytics system.
Structs§
- Daily
Gain - Daily aggregation bucket.
- Gain
Summary - Aggregated gain summary.
- Load
Result - Result of loading stats records, including count of skipped malformed lines.
- RunRecord
- A single run record persisted to the stats file.
Functions§
- daily_
breakdown - Compute daily breakdown from records.
- default_
stats_ path - Get the default stats file path:
~/.shift/stats.jsonl. - load_
records - Load all run records from the stats file.
- record_
from_ report - Build a RunRecord from a completed Report.
- record_
run - Append a run record to the stats file.
- summarize
- Compute aggregate gain summary from records.