pub struct EpisodeRetentionPolicy {
pub max_age_days: i64,
pub min_reward_threshold: f64,
pub max_episodes: usize,
pub cleanup_interval_secs: u64,
pub cleanup_batch_size: usize,
pub criterion: RetentionCriterion,
pub keep_pattern_sources: bool,
pub keep_heuristic_sources: bool,
pub dry_run: bool,
}Expand description
Policy for episode retention and garbage collection
Fields§
§max_age_days: i64Maximum age in days before episode is eligible for cleanup
min_reward_threshold: f64Minimum reward score to keep (episodes below this are candidates)
max_episodes: usizeMaximum number of episodes to retain
cleanup_interval_secs: u64Cleanup interval in seconds
cleanup_batch_size: usizeBatch size for cleanup operations (prevents long-running deletes)
criterion: RetentionCriterionWhich criterion to use for cleanup decisions
keep_pattern_sources: boolKeep episodes that have derived patterns
keep_heuristic_sources: boolKeep episodes that have derived heuristics
dry_run: boolKeep successful episodes (reward >= 0.7) keep_high_reward: bool, // Removed as unused Dry run mode (report what would be deleted without actually deleting)
Implementations§
Source§impl EpisodeRetentionPolicy
impl EpisodeRetentionPolicy
Sourcepub fn storage_limited() -> Self
pub fn storage_limited() -> Self
Create a policy optimized for limited storage
Sourcepub fn aggressive() -> Self
pub fn aggressive() -> Self
Create a policy for aggressive cleanup
Sourcepub fn with_max_age_days(self, days: i64) -> Self
pub fn with_max_age_days(self, days: i64) -> Self
Builder: set maximum age in days
Sourcepub fn with_min_reward_threshold(self, threshold: f64) -> Self
pub fn with_min_reward_threshold(self, threshold: f64) -> Self
Builder: set minimum reward threshold
Sourcepub fn with_max_episodes(self, max: usize) -> Self
pub fn with_max_episodes(self, max: usize) -> Self
Builder: set maximum episodes
Sourcepub fn with_cleanup_interval(self, interval: StdDuration) -> Self
pub fn with_cleanup_interval(self, interval: StdDuration) -> Self
Builder: set cleanup interval
Sourcepub fn with_cleanup_batch_size(self, size: usize) -> Self
pub fn with_cleanup_batch_size(self, size: usize) -> Self
Builder: set cleanup batch size
Sourcepub fn with_criterion(self, criterion: RetentionCriterion) -> Self
pub fn with_criterion(self, criterion: RetentionCriterion) -> Self
Builder: set retention criterion
Sourcepub fn with_dry_run(self, dry_run: bool) -> Self
pub fn with_dry_run(self, dry_run: bool) -> Self
Builder: enable dry run mode
Sourcepub fn validate(&self) -> Result<(), RetentionPolicyError>
pub fn validate(&self) -> Result<(), RetentionPolicyError>
Validate policy configuration
Sourcepub fn cleanup_interval(&self) -> StdDuration
pub fn cleanup_interval(&self) -> StdDuration
Get cleanup interval as Duration
Trait Implementations§
Source§impl Clone for EpisodeRetentionPolicy
impl Clone for EpisodeRetentionPolicy
Source§fn clone(&self) -> EpisodeRetentionPolicy
fn clone(&self) -> EpisodeRetentionPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EpisodeRetentionPolicy
impl Debug for EpisodeRetentionPolicy
Source§impl Default for EpisodeRetentionPolicy
impl Default for EpisodeRetentionPolicy
Source§impl<'de> Deserialize<'de> for EpisodeRetentionPolicy
impl<'de> Deserialize<'de> for EpisodeRetentionPolicy
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>,
Auto Trait Implementations§
impl Freeze for EpisodeRetentionPolicy
impl RefUnwindSafe for EpisodeRetentionPolicy
impl Send for EpisodeRetentionPolicy
impl Sync for EpisodeRetentionPolicy
impl Unpin for EpisodeRetentionPolicy
impl UnsafeUnpin for EpisodeRetentionPolicy
impl UnwindSafe for EpisodeRetentionPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.