Skip to main content

Module stats

Module stats 

Source
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§

DailyGain
Daily aggregation bucket.
GainSummary
Aggregated gain summary.
LoadResult
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.