Skip to main content

UcmEdge

Struct UcmEdge 

Source
pub struct UcmEdge {
    pub relation_type: RelationType,
    pub confidence: f64,
    pub evidence: Vec<EvidenceSource>,
    pub discovered_at: DateTime<Utc>,
    pub verified_at: Option<DateTime<Utc>>,
    pub decay_rate: f64,
}
Expand description

An edge in the context graph with confidence scoring and provenance.

Fields§

§relation_type: RelationType

What kind of relationship this represents

§confidence: f64

Fused confidence score in [0.0, 1.0] Updated via Bayesian fusion from multiple evidence sources

§evidence: Vec<EvidenceSource>

Individual evidence sources that contributed to this edge

§discovered_at: DateTime<Utc>

When this edge was first discovered

§verified_at: Option<DateTime<Utc>>

When this edge was last verified (by test, trace, or re-analysis)

§decay_rate: f64

Decay rate (lambda) for temporal confidence decay

  • Import statements: λ ≈ 0.001 (very slow decay)
  • Call graph edges: λ ≈ 0.005 (slow decay)
  • Heuristic inferences: λ ≈ 0.05 (moderate decay)
  • API traffic patterns: λ ≈ 0.1 (fast decay)

Implementations§

Source§

impl UcmEdge

Source

pub fn new( relation_type: RelationType, source: DiscoverySource, confidence: f64, description: impl Into<String>, ) -> Self

Create a new edge with a single initial evidence source.

Source

pub fn add_evidence( &mut self, source: DiscoverySource, confidence: f64, description: impl Into<String>, )

Add new evidence and re-fuse confidence using Bayesian update.

When sources agree, confidence compounds; when they conflict, the system expresses uncertainty rather than picking a winner.

Source

pub fn decayed_confidence(&self) -> f64

Get the current confidence after applying temporal decay.

confidence(t) = base_confidence × exp(-λ × days_since_verification) Reference: TempValid framework (ACL 2024)

Source

pub fn verify(&mut self)

Mark this edge as recently verified (resets decay timer).

Source§

impl UcmEdge

Source

pub fn relation_type_str(&self) -> &str

Trait Implementations§

Source§

impl Clone for UcmEdge

Source§

fn clone(&self) -> UcmEdge

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UcmEdge

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for UcmEdge

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for UcmEdge

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,