Expand description
Persistent per-path bounce memory (#496).
The in-process BounceTracker detects bounces (compressed read followed by
a full read of the same file within a short window) but forgets everything
on restart, and should_force_full only knows per-extension rates. This
store remembers which specific files keep bouncing across sessions so
mode=auto stops compressing them — compression is a net token loss for
a file the agent always re-reads in full.
Storage: ~/.lean-ctx/path_mode_memory.json, atomic write (tmp+rename),
loaded once per process, flushed periodically like the heatmap.
Structs§
Functions§
- disk_
summary - Dashboard summary:
(tracked_paths, forced_full_paths). Reads straight from disk so a separate process (the dashboard) sees the same state the MCP/CLI processes persisted (#505). - flush
- record_
bounce - Process-global: record a confirmed bounce for
path(already normalized by the caller —BounceTrackernormalizes viapathutil). - record_
read_ if_ tracked - Process-global: count a read for an already-tracked path.
- should_
force_ full - Process-global: should
mode=autoresolve tofullfor this path?