Skip to main content

DecayConfig

Struct DecayConfig 

Source
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: HalfLife

Semantic × @profile.

§sem_observation: HalfLife

Semantic × @observation.

§sem_self_report: HalfLife

Semantic × @self_report.

§sem_participant_report: HalfLife

Semantic × @participant_report (no explicit default — mirrors @self_report for unlisted pairs).

§sem_document: HalfLife

Semantic × @document.

§sem_registry: HalfLife

Semantic × @registry.

§sem_policy: HalfLife

Semantic × @policy (no explicit default; mirrors @agent_instruction).

§sem_external_authority: HalfLife

Semantic × @external_authority.

§sem_agent_instruction: HalfLife

Semantic × @agent_instruction.

§sem_librarian_assignment: HalfLife

Semantic × @librarian_assignment — no decay.

§sem_pending_verification: HalfLife

Semantic × @pending_verification.

§epi_observation: HalfLife

Episodic × @observation.

§epi_self_report: HalfLife

Episodic × @self_report.

§epi_participant_report: HalfLife

Episodic × @participant_report.

§pro_any: HalfLife

Procedural — any source. HalfLife::no_decay (spec § 6 activity-weighted instead — not implemented in 5.8).

Implementations§

Source§

impl DecayConfig

Source

pub const fn librarian_defaults() -> Self

v1 default parameters per spec § 5.2. User overrides happen by mutating the struct in-place.

Source

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

Source

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 instead

Unknown TOML keys are silently ignored per the spec’s “unlisted keys fall back” convention; the v1 goal is tolerance of future extensions.

§Errors
Source

pub fn apply_toml(&mut self, toml_str: &str) -> Result<(), DecayConfigError>

Apply TOML-encoded overrides in place. See from_toml for the accepted schema.

§Errors

See from_toml.

Trait Implementations§

Source§

impl Clone for DecayConfig

Source§

fn clone(&self) -> DecayConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DecayConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DecayConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for DecayConfig

Source§

fn eq(&self, other: &DecayConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for DecayConfig

Source§

impl StructuralPartialEq for DecayConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more