pub struct ClaimState {Show 15 fields
pub claim_id: ClaimId,
pub subject: EntityRef,
pub predicate: Predicate,
pub value: ClaimValue,
pub authority: Authority,
pub ttl: Ttl,
pub freshness_anchor: TimestampMillis,
pub lifecycle: ClaimLifecycle,
pub created_at: TimestampMillis,
pub updated_at: TimestampMillis,
pub last_event_id: ClaimEventId,
pub superseded_by: Option<ClaimId>,
pub contradicted_by: Vec<ClaimId>,
pub evidence_count: usize,
pub corroborating_sources: BTreeMap<SourceId, AuthorityLevel>,
}Expand description
The current projected state of a claim — the fold of its event stream. Serializable so a backend may materialize it (cache it as a derived row) or transmit it; it remains a pure projection of the log, never an independent source of truth.
Fields§
§claim_id: ClaimId§subject: EntityRef§predicate: Predicate§value: ClaimValueEntrenchment of the incumbent claim, captured at assertion. Drives
authority-weighted supersession arbitration; see docs/belief-revision.md.
ttl: TtlTTL captured at assertion, used by ClaimState::is_expired_at for
read-time freshness evaluation.
freshness_anchor: TimestampMillisValid-time anchor for TTL freshness: valid_from, else observed_at, else
the assertion’s recorded_at.
lifecycle: ClaimLifecycle§created_at: TimestampMillis§updated_at: TimestampMillis§last_event_id: ClaimEventId§superseded_by: Option<ClaimId>§contradicted_by: Vec<ClaimId>§evidence_count: usize§corroborating_sources: BTreeMap<SourceId, AuthorityLevel>The distinct provenance sources that have asserted or reinforced this exact
value, each mapped to the highest authority it backed at. This measures
same-value corroboration only — surviving a contradiction or a rejected
supersession is deliberately not counted here (that would require recording
rejected attempts; see docs/research/novelty.md rank 3). The asserter is the
first entry.
Implementations§
Source§impl ClaimState
impl ClaimState
Sourcepub fn corroboration(&self) -> usize
pub fn corroboration(&self) -> usize
Raw earned-entrenchment degree: the number of distinct sources backing this
value. Sybil-inflatable on its own (an attacker minting many sources raises
it), so security decisions should use ClaimState::corroboration_at_or_above
to count only sufficiently-authoritative backers.
Sourcepub fn corroboration_at_or_above(&self, min: AuthorityLevel) -> usize
pub fn corroboration_at_or_above(&self, min: AuthorityLevel) -> usize
Authority-weighted corroboration: the number of distinct backing sources whose
authority is at least min. This is the Sybil-resistant entrenchment signal —
minting low-authority sources cannot raise the count measured at a higher floor.
Sourcepub fn expires_at(&self) -> Option<TimestampMillis>
pub fn expires_at(&self) -> Option<TimestampMillis>
When this claim’s TTL elapses relative to its freshness anchor, if ever.
Sourcepub fn is_expired_at(&self, now: TimestampMillis) -> bool
pub fn is_expired_at(&self, now: TimestampMillis) -> bool
Whether the claim’s TTL has elapsed at now. A claim with Ttl::Never is
never expired. This is the read-time freshness predicate; it does not consult
lifecycle (a superseded claim can still be “unexpired” by TTL).
Trait Implementations§
Source§impl Clone for ClaimState
impl Clone for ClaimState
Source§fn clone(&self) -> ClaimState
fn clone(&self) -> ClaimState
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 ClaimState
impl Debug for ClaimState
Source§impl<'de> Deserialize<'de> for ClaimState
impl<'de> Deserialize<'de> for ClaimState
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>,
impl Eq for ClaimState
Source§impl PartialEq for ClaimState
impl PartialEq for ClaimState
Source§fn eq(&self, other: &ClaimState) -> bool
fn eq(&self, other: &ClaimState) -> bool
self and other values to be equal, and is used by ==.