pub fn purge_stale_sessions(
parent: &Path,
max_sessions: usize,
shelflife: Duration,
)Expand description
Purge stale session directories under parent according to
max_sessions (keep the latest N) and shelflife (drop
anything older than this).
Skipped: the latest symlink and whatever it points at
(the active session). Non-directory entries (loose files
like a stray summary.md) are left alone.
Errors during enumeration / removal are logged at Warn (this is a best-effort housekeeping pass; failure shouldn’t abort startup).