Expand description
Unified Evidence Ledger for all Bayesian decision points (bd-fp38v).
Every adaptive controller in FrankenTUI (diff strategy, resize coalescing, frame budget, degradation, VOI sampling, hint ranking, command palette scoring) emits decisions through this common schema. Each decision records:
log_posterior: log-odds of the chosen action being optimal- Top-3 evidence terms with Bayes factors
- Action chosen
- Loss avoided (expected loss of next-best minus chosen)
- Confidence interval
[lower, upper]
The ledger is a fixed-capacity ring buffer (zero per-decision allocation on
the hot path). JSONL export is supported via [EvidenceSink].
§Usage
use ftui_runtime::unified_evidence::{
DecisionDomain, EvidenceEntry, EvidenceTerm, UnifiedEvidenceLedger,
};
let mut ledger = UnifiedEvidenceLedger::new(1000);
let entry = EvidenceEntry {
decision_id: 1,
timestamp_ns: 42_000,
domain: DecisionDomain::DiffStrategy,
log_posterior: 1.386,
top_evidence: [
Some(EvidenceTerm::new("change_rate", 4.0)),
Some(EvidenceTerm::new("dirty_rows", 2.5)),
None,
],
action: "dirty_rows",
loss_avoided: 0.15,
confidence_interval: (0.72, 0.95),
};
ledger.record(entry);
assert_eq!(ledger.len(), 1);Structs§
- Domain
Summary - Per-domain summary statistics.
- Evidence
Entry - Unified evidence record for any Bayesian decision point.
- Evidence
Entry Builder - Builder for constructing
EvidenceEntryvalues. - Evidence
Term - A single piece of evidence contributing to a Bayesian decision.
- Ledger
Summary - Summary of ledger contents.
- Unified
Evidence Ledger - Fixed-capacity ring buffer storing
EvidenceEntryrecords from all decision domains.
Enums§
- Decision
Domain - Domain of a Bayesian decision point.
Traits§
- Emits
Evidence - Trait for decision-making components that emit unified evidence.