pub struct RetentionPolicy {
pub rules: BTreeMap<String, RetentionRule>,
pub default_rule: RetentionRule,
}Expand description
Per-surface retention policy: surface tag → rule, with a conservative keep-all default for unknown surfaces. Applies to the grow-only log tier only — the LWW registry tier is already one compact record per id, and the proposal’s table assigns it no retention.
Fields§
§rules: BTreeMap<String, RetentionRule>§default_rule: RetentionRuleImplementations§
Source§impl RetentionPolicy
impl RetentionPolicy
Sourcepub fn keep_all() -> Self
pub fn keep_all() -> Self
Retain everything — the exact-checkpoint policy (compaction still drops ops; the snapshot just keeps their full folded state).
Sourcepub fn proposal_default(
conversation_last_n: usize,
trajectory_max_age_ms: u64,
) -> Self
pub fn proposal_default( conversation_last_n: usize, trajectory_max_age_ms: u64, ) -> Self
The proposal’s retention table. Two rows are deployment-configurable
in the proposal itself and therefore parameters here: conversations’
N (“= today’s max_turns” — a memgine config value, not a global
constant) and trajectories’ D days (given as max_age_ms). Runs
use the shipped RunStore::gc constants
(RUNS_MAX_PER_AGENT/RUNS_MAX_AGE_MS) and its semantics, in which
a zero cap is DISABLED rather than zero-tolerance (car#1338); knowledge, skills, and
routing observations keep all (routing’s keep-all is also enforced
structurally — see CompactError::EventStreamRetention).