Skip to main content

sync_if_compacted

Function sync_if_compacted 

Source
pub fn sync_if_compacted(cache: &mut SessionCache, data_dir: &Path) -> bool
Expand description

Check if a host compaction event occurred since our last check. If so, reset all full_content_delivered flags so the next read delivers full content instead of a stub.

Detection strategy (#808):

  1. Check last_compaction.json marker file first (written atomically by the observe hook). This is only a few bytes, immune to being displaced by large events.
  2. Fall back to scanning the tail of context_radar.jsonl (256 KB window) for older hook binaries that don’t write the marker.