pub struct KnowledgeFact {Show 28 fields
pub origin: FactOrigin,
pub category: String,
pub key: String,
pub value: String,
pub source_session: String,
pub confidence: f32,
pub created_at: DateTime<Utc>,
pub last_confirmed: DateTime<Utc>,
pub retrieval_count: u32,
pub last_retrieved: Option<DateTime<Utc>>,
pub valid_from: Option<DateTime<Utc>>,
pub valid_until: Option<DateTime<Utc>>,
pub supersedes: Option<String>,
pub confirmation_count: u32,
pub feedback_up: u32,
pub feedback_down: u32,
pub last_feedback: Option<DateTime<Utc>>,
pub privacy: FactPrivacy,
pub sensitivity: SensitivityLevel,
pub imported_from: Option<String>,
pub archetype: KnowledgeArchetype,
pub fidelity: Option<FidelityScore>,
pub revision_count: u32,
pub status: Option<FactStatus>,
pub validity: Option<FactValidity>,
pub anchors: Vec<CodeAnchor>,
pub review: Option<FactReview>,
pub capture: FactCapture,
}Fields§
§origin: FactOrigin§category: String§key: String§value: String§source_session: String§confidence: f32§created_at: DateTime<Utc>§last_confirmed: DateTime<Utc>§retrieval_count: u32§last_retrieved: Option<DateTime<Utc>>§valid_from: Option<DateTime<Utc>>§valid_until: Option<DateTime<Utc>>§supersedes: Option<String>§confirmation_count: u32§feedback_up: u32§feedback_down: u32§last_feedback: Option<DateTime<Utc>>§privacy: FactPrivacy§sensitivity: SensitivityLevelPer-item sensitivity classification (#212). Defaults to Public; set at
creation from content and enforced by the policy floor at injection time.
imported_from: Option<String>§archetype: KnowledgeArchetype§fidelity: Option<FidelityScore>§revision_count: u32§status: Option<FactStatus>The recorded status (V01). Absent on facts written before it existed
and on facts nobody classified; KnowledgeFact::status then
derives it from the origin. Omitted when absent (byte-compatible).
validity: Option<FactValidity>Validity class (AP01 §4). Absent on facts written before it existed and on unclassified facts, which keep today’s behaviour. Omitted when absent (byte-compatible).
anchors: Vec<CodeAnchor>Code anchors (J2, C0 1.9 CodeAnchorV1): the code this fact is
about, so a change there makes it to verify. Omitted when empty
(byte-compatible).
review: Option<FactReview>Review state (C0 1.9 fact states): set when what the fact rests on
moved under it — an anchor that no longer holds, a removed import
source, a contradiction. Orthogonal to FactStatus (evidence): a
verified fact can be to verify. Omitted when absent (byte-compatible).
capture: FactCaptureWhat the Hive capture gate reads (v4 V1): node type, procedure steps and commands, references, evidence. Every field is omitted when empty (byte-compatible).
Implementations§
Source§impl KnowledgeFact
impl KnowledgeFact
pub fn is_current(&self) -> bool
Sourcepub fn is_synthesized_observation(&self) -> bool
pub fn is_synthesized_observation(&self) -> bool
A synthesized observation: an entity-summary written by the cognition loop’s synthesis step (#802), not a user-supplied finding. Recall surfaces these as orientation (a balanced boost, never absolute).
Sourcepub fn quality_score(&self) -> f32
pub fn quality_score(&self) -> f32
Stable, intrinsic quality metric (0.0..1.0).
Based only on confidence, confirmation count, and feedback balance.
Deliberately excludes volatile signals (retrieval count, recency) to
keep recall output deterministic. For display ordering use
salience_score() which adds recency and category weighting.
pub fn was_valid_at(&self, at: DateTime<Utc>) -> bool
Sourcepub fn compute_structural_fidelity(&self) -> f64
pub fn compute_structural_fidelity(&self) -> f64
Compute structural fidelity score (0.0 - 1.0). Based on: has source, confirmations, confidence, freshness, feedback.
pub fn update_fidelity(&mut self)
Source§impl KnowledgeFact
impl KnowledgeFact
Sourcepub fn package_origin(&self) -> Option<&str>
pub fn package_origin(&self) -> Option<&str>
The context package this fact was merged from (name@version, as the
package loader tags it), or None for every other origin — the
other importers tag with a word or a kind: prefix.
Sourcepub fn hive_origin(&self) -> Option<&str>
pub fn hive_origin(&self) -> Option<&str>
The import tag of a fact pulled from a Hive repo (other members’
knowledge), None for every other fact.
Sourcepub fn as_delivered(&self, value: String) -> String
pub fn as_delivered(&self, value: String) -> String
value — this fact’s value as a renderer prepared it — as it enters
model-visible output (V04). A fact from a context package is
third-party text: it reaches the model as data, inside a fence its
author cannot produce and under a header that says so, like provider
content (K06). It grants nothing: every later check — the egress
admission above all — judges it like any other text.
A fact pulled from a Hive repo was written by other members: it is
foreign content (X5). Its value is stored in the Hive wrapper
(sync_into_knowledge), so every renderer delivers it fenced; a
value stored before that is wrapped here.
Source§impl KnowledgeFact
impl KnowledgeFact
Sourcepub fn status(&self) -> FactStatus
pub fn status(&self) -> FactStatus
The fact’s status: as recorded, else verified only when its origin
names a source, else assumption.
Sourcepub fn mark_review(
&mut self,
state: FactReviewState,
reason: FactReviewReason,
now: DateTime<Utc>,
)
pub fn mark_review( &mut self, state: FactReviewState, reason: FactReviewReason, now: DateTime<Utc>, )
Mark the fact for review; an existing mark keeps its since.
Sourcepub fn clear_review(&mut self)
pub fn clear_review(&mut self)
A person or a fresh write confirmed the fact again.
Trait Implementations§
Source§impl Clone for KnowledgeFact
impl Clone for KnowledgeFact
Source§impl Debug for KnowledgeFact
impl Debug for KnowledgeFact
Source§impl<'de> Deserialize<'de> for KnowledgeFact
impl<'de> Deserialize<'de> for KnowledgeFact
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>,
Auto Trait Implementations§
impl Forget for KnowledgeFact
impl Freeze for KnowledgeFact
impl Move for KnowledgeFact
impl RefUnwindSafe for KnowledgeFact
impl Send for KnowledgeFact
impl Sync for KnowledgeFact
impl Unpin for KnowledgeFact
impl UnsafeUnpin for KnowledgeFact
impl UnwindSafe for KnowledgeFact
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more