Skip to main content

Module retention

Module retention 

Source
Expand description

Retention and garbage-collection for the unified session store.

Structs§

RetentionPolicy
Retention policy applied to the set of per-session stores.

Constants§

RETENTION_PIN_FILE
Sidecar marker written when a session must outlive ordinary retention because an unresolved blocker archive references it.

Functions§

apply_retention
Apply the retention policy, removing the oldest / stale sessions.
apply_retention_preserving
Apply retention while preserving one session directory, even when its existing manifest still says completed (for example, a resumed session).
evict_zero_turn_completed_store
Delete a 0-turn completed session store immediately (close-path hygiene).
gc_legacy
Remove the legacy history/ and logs/ directories after they have been imported into the unified store by crate::migrate_legacy.
mark_abandoned_active_sessions
Flip active manifests that have been idle past max_age_days to completed so ordinary retention can evict them.
pin_session_retention
Write a retention pin for a session (best-effort path check by caller).
retention_pinned_session_ids
Session ids whose stores are retention-pinned against ordinary eviction.
session_retention_pinned
Whether a session directory is pinned against ordinary retention eviction.
unpin_session_retention
Remove a retention pin if present.