pub enum Tier {
Short,
Mid,
Long,
}Expand description
Memory-lifecycle tier — short (6h TTL) / mid (7d TTL) / long (permanent). Drives the create-time backstop, the touch-time sliding window, the auto-promotion at 5 accesses (mid → long), the GC sweep, and the recall ranker’s per-tier bonus.
§Disambiguation (issue #970)
The codebase has three enums whose names end in Tier. They are
orthogonal — same descriptive substring, distinct domains:
Tier(this enum) — memory-lifecycle TTL bucket.ConfidenceTier— confidence-value bucket (Confirmed / Likely / Ambiguous) derived fromMemory.confidencethresholds. Operator dashboards / human-review queues filter on it.crate::config::FeatureTier— host capability tier (Keyword / Semantic / Smart / Autonomous) that gates which AI features the host can fit in RAM.
They do not share variants, do not share wire strings, and are
never substitutable. See docs/internal/enum-proliferation-audit-970.md.
Variants§
Implementations§
Source§impl Tier
impl Tier
pub fn as_str(&self) -> &'static str
Sourcepub fn from_str(s: &str) -> Option<Self>
pub fn from_str(s: &str) -> Option<Self>
Parse a tier wire string into the typed enum.
The string literals in the match arms below are the canonical
deserializer for the Tier wire form. They are the one place
in the codebase where raw "short" / "mid" / "long" literals
legitimately appear, because this is the boundary where a
caller-supplied &str (HTTP body field, MCP JSON param, CLI
flag value, TOML config field) gets dispatched into the typed
enum. They are intentionally byte-equal to
Tier::as_str’s outputs so the round-trip is identity.
Anywhere else that constructs a tier wire value MUST route
through Tier::<X>.as_str() instead of restamping a fresh
literal. See pm-v3.1 PR6 (#1174) for the sweep that pinned this
invariant.
pub fn default_ttl_secs(&self) -> Option<i64>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tier
impl<'de> Deserialize<'de> for Tier
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 StructuralPartialEq for Tier
Auto Trait Implementations§
impl Freeze for Tier
impl RefUnwindSafe for Tier
impl Send for Tier
impl Sync for Tier
impl Unpin for Tier
impl UnsafeUnpin for Tier
impl UnwindSafe for Tier
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.