pub struct ClaimsLedger {
pub claims: Vec<Claim>,
/* private fields */
}Expand description
Fields§
§claims: Vec<Claim>All claims (pending, validated, falsified).
Implementations§
Source§impl ClaimsLedger
impl ClaimsLedger
Sourcepub fn record(
&mut self,
statement: &str,
domain: &str,
source_date: i64,
predicted_outcome: &str,
confidence: f64,
falsification_criteria: &str,
) -> Claim
pub fn record( &mut self, statement: &str, domain: &str, source_date: i64, predicted_outcome: &str, confidence: f64, falsification_criteria: &str, ) -> Claim
Record a new pending claim.
Returns the stored claim. The falsification criterion is mandatory — a claim that cannot be falsified is not a claim.
Sourcepub fn resolve(
&mut self,
claim_id: &str,
validated: bool,
event: &str,
event_date: i64,
source: Option<String>,
) -> Result<Claim, String>
pub fn resolve( &mut self, claim_id: &str, validated: bool, event: &str, event_date: i64, source: Option<String>, ) -> Result<Claim, String>
Resolve a claim against a validation event.
validated: true marks the claim validated and credits points equal
to the verified lead time in weeks. validated: false marks it
falsified — recorded as a miss, which is part of the track record.
Sourcepub fn status(&self) -> Value
pub fn status(&self) -> Value
Aggregate ledger status: totals, score, average lead, falsified count.
Sourcepub fn list(
&self,
domain: Option<&str>,
status: Option<ClaimStatus>,
) -> Vec<Claim>
pub fn list( &self, domain: Option<&str>, status: Option<ClaimStatus>, ) -> Vec<Claim>
List claims, optionally filtered by domain and status.
Sourcepub fn calibration(&self) -> ClaimCalibration
pub fn calibration(&self) -> ClaimCalibration
Calibration report over resolved (validated + falsified) claims with statutory default k.
Sourcepub fn calibration_with_k(&self, k: f64) -> ClaimCalibration
pub fn calibration_with_k(&self, k: f64) -> ClaimCalibration
Calibration report over resolved (validated + falsified) claims with custom empirical-Bayes prior strength k.
Sourcepub fn calibrated_confidence(&self, raw: f64) -> f64
pub fn calibrated_confidence(&self, raw: f64) -> f64
Empirical-Bayes calibrated confidence for a raw confidence with statutory default k.
Shrinks the raw confidence toward the observed hit rate, weighted by resolved sample size (w = n/(n + k)). Identity when nothing is resolved — the record is never edited, only re-read through the lens of its own track record.
Sourcepub fn calibrated_confidence_with_k(&self, raw: f64, k: f64) -> f64
pub fn calibrated_confidence_with_k(&self, raw: f64, k: f64) -> f64
Empirical-Bayes calibrated confidence with custom prior sample weight k.
Trait Implementations§
Source§impl Clone for ClaimsLedger
impl Clone for ClaimsLedger
Source§fn clone(&self) -> ClaimsLedger
fn clone(&self) -> ClaimsLedger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more