pub struct Relationship {Show 13 fields
pub id: Value,
pub from_id: Value,
pub to_id: Value,
pub rel_type: String,
pub description: Option<String>,
pub valid_from: Value,
pub valid_until: Option<Value>,
pub confidence: f64,
pub alpha: Option<f64>,
pub beta: Option<f64>,
pub self_reinforcements: Option<i64>,
pub last_reinforced: Option<Value>,
pub source: Option<String>,
}Expand description
A stored relationship.
Fields§
§id: Value§from_id: Value§to_id: Value§rel_type: String§description: Option<String>§valid_from: Value§valid_until: Option<Value>§confidence: f64Posterior mean of the edge’s Beta distribution — alpha / (alpha + beta).
Kept in sync with the counts on every write; this is what read paths score on.
alpha: Option<f64>Accumulated corroborating evidence (Beta α).
None only on an edge the schema migration has not reached yet.
beta: Option<f64>Accumulated contradicting evidence (Beta β).
self_reinforcements: Option<i64>How many corroborations came from the agent itself — counted, never laundered into confidence. Populated from Phase 1 increment 2 onward.
last_reinforced: Option<Value>When this relationship was last reinforced (Bayesian corroboration). Used by temporal decay: effective_confidence = confidence × 0.5^(days_since / half_life).
source: Option<String>Implementations§
Source§impl Relationship
impl Relationship
Sourcepub fn evidence(&self) -> Evidence
pub fn evidence(&self) -> Evidence
The edge’s accumulated evidence, falling back to the prior implied by its mean when the counts have not been backfilled yet.
Sourcepub fn edge_evidence(&self) -> EdgeEvidence
pub fn edge_evidence(&self) -> EdgeEvidence
The edge’s full evidence state — Beta counts plus coherence tally. This is what a confidence-moving observation is applied to.
Trait Implementations§
Source§impl Clone for Relationship
impl Clone for Relationship
Source§fn clone(&self) -> Relationship
fn clone(&self) -> Relationship
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Relationship
impl Debug for Relationship
Source§impl<'de> Deserialize<'de> for Relationship
impl<'de> Deserialize<'de> for Relationship
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 Freeze for Relationship
impl RefUnwindSafe for Relationship
impl Send for Relationship
impl Sync for Relationship
impl Unpin for Relationship
impl UnsafeUnpin for Relationship
impl UnwindSafe for Relationship
Blanket Implementations§
impl<T> AsyncFriendly 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<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request