pub enum ConfidenceSource {
CallerProvided,
AutoDerived,
Calibrated,
Decayed,
CuratorDerived,
Default,
}Expand description
v0.7.0 Form 5 (issue #758) — typed discriminator for the provenance
of a memory’s confidence value.
Stored on memories.confidence_source TEXT NOT NULL DEFAULT 'caller_provided' (schema v39 sqlite / v38 postgres). The auto-
derive engine in crate::confidence::derive writes
AutoDerived when crate::confidence::derive computes a fresh
value; the calibration sweep writes Calibrated when it replaces
the live value with a per-source baseline; the decay updater writes
Decayed after applying crate::confidence::decay::decayed on
recall touch. The (overwhelming-majority) legacy + default bucket
is CallerProvided, matching the SQL DEFAULT clause.
The discriminator lets recall ranking and the forensic bundle
reason about the trust path of a confidence score without re-running
the derivation. The calibration CLI scans the partial index
idx_memories_confidence_source (which excludes caller_provided)
to enumerate derived / calibrated / decayed rows cheaply.
Variants§
CallerProvided
The legacy and default bucket — the caller’s value was accepted
verbatim. Matches the SQL DEFAULT 'caller_provided' clause on
the confidence_source column added in schema v39 (sqlite) /
v38 (postgres).
AutoDerived
The Form 5 auto-derive engine (crate::confidence::derive)
computed the value at write time from row signals (atom
derivation, prior-corroboration count, source age, namespace
baseline). Opt-in via AI_MEMORY_AUTO_CONFIDENCE=1.
Calibrated
The calibration sweep (ai-memory calibrate confidence --from-shadow) replaced the live value with a per-source
baseline computed from observed shadow-mode samples.
Decayed
The freshness-decay updater (crate::confidence::decay) wrote
a decayed copy of the previous value, bumping
confidence_decayed_at. Fires when
AI_MEMORY_CONFIDENCE_DECAY=1 or the namespace policy
confidence_decay_half_life_days is set.
CuratorDerived
v0.7.0 issue #1242 — the curator engine (atomisation
LlmCurator, persona generator) computed the value at row-
mint time without an explicit caller-supplied number. Atom
rows inherit confidence from their parent memory; persona
rows pin confidence = 1.0 per the QW-2 brief. In both
cases the value is engine-derived, not caller-supplied, and
must be discoverable to the calibration sweep + the partial
index idx_memories_confidence_source (which excludes
caller_provided). Pre-#1242 these rows mis-labelled
confidence_source = CallerProvided, hiding them from the
derived-row enumeration and violating the audit-honesty
invariant.
Default
v0.7.x issue #1591 — the caller OMITTED confidence and the
store surface stamped the compiled DEFAULT_CONFIDENCE
fallback. Pre-#1591 these rows mis-labelled
confidence_source = 'caller_provided' — a false provenance
claim that made an unexamined 1.0 indistinguishable from a
caller’s deliberate full-confidence assertion. The Form-5
calibration / decay engines treat this bucket exactly like
caller_provided (the value is not engine-derived), but
auditors and recall ranking can now discount the compiled
fallback honestly.
Implementations§
Trait Implementations§
Source§impl Clone for ConfidenceSource
impl Clone for ConfidenceSource
Source§fn clone(&self) -> ConfidenceSource
fn clone(&self) -> ConfidenceSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ConfidenceSource
Source§impl Debug for ConfidenceSource
impl Debug for ConfidenceSource
Source§impl Default for ConfidenceSource
impl Default for ConfidenceSource
Source§fn default() -> ConfidenceSource
fn default() -> ConfidenceSource
Source§impl<'de> Deserialize<'de> for ConfidenceSource
impl<'de> Deserialize<'de> for ConfidenceSource
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>,
Source§impl Display for ConfidenceSource
impl Display for ConfidenceSource
impl Eq for ConfidenceSource
Source§impl PartialEq for ConfidenceSource
impl PartialEq for ConfidenceSource
Source§fn eq(&self, other: &ConfidenceSource) -> bool
fn eq(&self, other: &ConfidenceSource) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ConfidenceSource
impl Serialize for ConfidenceSource
impl StructuralPartialEq for ConfidenceSource
Auto Trait Implementations§
impl Freeze for ConfidenceSource
impl RefUnwindSafe for ConfidenceSource
impl Send for ConfidenceSource
impl Sync for ConfidenceSource
impl Unpin for ConfidenceSource
impl UnsafeUnpin for ConfidenceSource
impl UnwindSafe for ConfidenceSource
Blanket Implementations§
impl<T> Boilerplate for T
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>,
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§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.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.