pub struct ConfidenceScore {
pub value: f32,
pub confirmation_count: u32,
pub contributor_count: u32,
pub last_challenged: Option<u64>,
pub challenge_count: u32,
}Expand description
How much the system trusts this record’s accuracy.
Formula (ARCHITECTURE.md §13.1):
base_score:
DeveloperManual → 0.80
Import → 0.70
ClaudeEnrich → 0.60
SessionHook → 0.50
StaticAnalysis → 0.10
confidence = base_score
× log2(confirmation_count + 2)
× min(contributor_count, 3) / 3
× recency_weight(last_accessed) 90-day half-life
× ref_boost 1.5× if ref_url setRecomputed on every mem_get, written back with Durability::Eventual.
Hook injection thresholds:
>= 0.6 + confirmed → deny file read, inject record
0.3 – 0.6 → allow read + attach as additionalContext
< 0.3 → allow read, no injectionDoes not derive PartialEq — see module-level float equality note.
Fields§
§value: f320.0 → 1.0
confirmation_count: u32How many times this record has been explicitly confirmed correct.
contributor_count: u32How many distinct contributors have written or confirmed this record.
last_challenged: Option<u64>Unix timestamp of the last time this record was challenged or disputed.
challenge_count: u32Implementations§
Source§impl ConfidenceScore
impl ConfidenceScore
Sourcepub fn base_for_source(source: &RecordSource) -> f32
pub fn base_for_source(source: &RecordSource) -> f32
Initial confidence value for a freshly created record by source type.
Sourcepub fn for_new_record(source: &RecordSource) -> Self
pub fn for_new_record(source: &RecordSource) -> Self
Construct a ConfidenceScore for a newly created record.
Sets value from base_for_source and zeros all counters. Use this
instead of constructing manually to prevent value from diverging from
the source-derived base.
Trait Implementations§
Source§impl Clone for ConfidenceScore
impl Clone for ConfidenceScore
Source§fn clone(&self) -> ConfidenceScore
fn clone(&self) -> ConfidenceScore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfidenceScore
impl Debug for ConfidenceScore
Source§impl<'de> Deserialize<'de> for ConfidenceScore
impl<'de> Deserialize<'de> for ConfidenceScore
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ConfidenceScore
impl RefUnwindSafe for ConfidenceScore
impl Send for ConfidenceScore
impl Sync for ConfidenceScore
impl Unpin for ConfidenceScore
impl UnsafeUnpin for ConfidenceScore
impl UnwindSafe for ConfidenceScore
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
Mutably borrows from an owned value. Read more
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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>
Converts
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>
Converts
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 more