pub struct DecayConfig {Show 15 fields
pub sem_profile: HalfLife,
pub sem_observation: HalfLife,
pub sem_self_report: HalfLife,
pub sem_participant_report: HalfLife,
pub sem_document: HalfLife,
pub sem_registry: HalfLife,
pub sem_policy: HalfLife,
pub sem_external_authority: HalfLife,
pub sem_agent_instruction: HalfLife,
pub sem_librarian_assignment: HalfLife,
pub sem_pending_verification: HalfLife,
pub epi_observation: HalfLife,
pub epi_self_report: HalfLife,
pub epi_participant_report: HalfLife,
pub pro_any: HalfLife,
}Expand description
Per-(memory-kind, source-kind) decay parameter table with the
v1 librarian defaults from spec § 5.2. Fields are pub so callers
can override at runtime without restart (spec § 13 invariant 5);
apply_toml reads mimir.toml-shaped
overrides in days.
Half-lives are stored in milliseconds; NO_DECAY encodes the
spec § 5.3 infinity case (librarian_assignment, Procedural
time-decay).
Fields§
§sem_profile: HalfLifeSemantic × @profile.
sem_observation: HalfLifeSemantic × @observation.
sem_self_report: HalfLifeSemantic × @self_report.
sem_participant_report: HalfLifeSemantic × @participant_report (no explicit default — mirrors
@self_report for unlisted pairs).
sem_document: HalfLifeSemantic × @document.
sem_registry: HalfLifeSemantic × @registry.
sem_policy: HalfLifeSemantic × @policy (no explicit default; mirrors
@agent_instruction).
Semantic × @external_authority.
sem_agent_instruction: HalfLifeSemantic × @agent_instruction.
sem_librarian_assignment: HalfLifeSemantic × @librarian_assignment — no decay.
sem_pending_verification: HalfLifeSemantic × @pending_verification.
epi_observation: HalfLifeEpisodic × @observation.
epi_self_report: HalfLifeEpisodic × @self_report.
epi_participant_report: HalfLifeEpisodic × @participant_report.
pro_any: HalfLifeProcedural — any source. HalfLife::no_decay (spec § 6
activity-weighted instead — not implemented in 5.8).
Implementations§
Source§impl DecayConfig
impl DecayConfig
Sourcepub const fn librarian_defaults() -> Self
pub const fn librarian_defaults() -> Self
v1 default parameters per spec § 5.2. User overrides happen by mutating the struct in-place.
Sourcepub const fn half_life_for(
&self,
memory_kind: MemoryKindTag,
source_kind: SourceKind,
) -> Option<HalfLife>
pub const fn half_life_for( &self, memory_kind: MemoryKindTag, source_kind: SourceKind, ) -> Option<HalfLife>
Look up the half-life for a given memory kind / source kind
pair. Returns None for pairs that SourceKind::admits
rejects (the caller should validate upstream) or for
Inferential memories, which decay via their parents rather than
a per-pair half-life.
Source§impl DecayConfig
impl DecayConfig
Sourcepub fn from_toml(toml_str: &str) -> Result<Self, DecayConfigError>
pub fn from_toml(toml_str: &str) -> Result<Self, DecayConfigError>
Parse mimir.toml-shaped overrides on top of the v1 librarian
defaults (spec § 5.2). Accepted TOML shape:
[decay.semantic]
profile = 730 # days; `0` encodes NO_DECAY (spec § 5.3)
observation = 180
# any of the other SourceKind keys under the `[decay.semantic]`
# table; unlisted keys fall back to librarian defaults
[decay.episodic]
observation = 90
self_report = 30
participant_report = 60
[decay.procedural]
any = 0 # v1 uses activity weighting insteadUnknown TOML keys are silently ignored per the spec’s “unlisted keys fall back” convention; the v1 goal is tolerance of future extensions.
§Errors
DecayConfigError::Parseif the TOML doesn’t parse.DecayConfigError::ExpectedTableifdecayor a known subsection is not a TOML table.DecayConfigError::ExpectedNonNegIntegerif a recognized leaf key is not an integer.DecayConfigError::InvalidDaysif the integer is negative.
Sourcepub fn apply_toml(&mut self, toml_str: &str) -> Result<(), DecayConfigError>
pub fn apply_toml(&mut self, toml_str: &str) -> Result<(), DecayConfigError>
Trait Implementations§
Source§impl Clone for DecayConfig
impl Clone for DecayConfig
Source§fn clone(&self) -> DecayConfig
fn clone(&self) -> DecayConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecayConfig
impl Debug for DecayConfig
Source§impl Default for DecayConfig
impl Default for DecayConfig
Source§impl PartialEq for DecayConfig
impl PartialEq for DecayConfig
impl Eq for DecayConfig
impl StructuralPartialEq for DecayConfig
Auto Trait Implementations§
impl Freeze for DecayConfig
impl RefUnwindSafe for DecayConfig
impl Send for DecayConfig
impl Sync for DecayConfig
impl Unpin for DecayConfig
impl UnsafeUnpin for DecayConfig
impl UnwindSafe for DecayConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.