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); knowledge, skills, and
routing observations keep all (routing’s keep-all is also enforced
structurally — see CompactError::EventStreamRetention).
pub fn rule_for(&self, surface_tag: &str) -> &RetentionRule
Trait Implementations§
Source§impl Clone for RetentionPolicy
impl Clone for RetentionPolicy
Source§fn clone(&self) -> RetentionPolicy
fn clone(&self) -> RetentionPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetentionPolicy
impl Debug for RetentionPolicy
Source§impl Default for RetentionPolicy
impl Default for RetentionPolicy
Source§impl<'de> Deserialize<'de> for RetentionPolicy
impl<'de> Deserialize<'de> for RetentionPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RetentionPolicy
Source§impl PartialEq for RetentionPolicy
impl PartialEq for RetentionPolicy
Source§fn eq(&self, other: &RetentionPolicy) -> bool
fn eq(&self, other: &RetentionPolicy) -> bool
self and other values to be equal, and is used by ==.