franken-evidence 0.2.9

Canonical EvidenceLedger schema for FrankenSuite decision tracing.
Documentation

Canonical EvidenceLedger schema for FrankenSuite decision tracing (bd-qaaxt.1).

Every FrankenSuite decision produces an [EvidenceLedger] entry explaining what was decided, why, and how confident the system was. All FrankenSuite projects import this crate — no forking allowed.

Schema

EvidenceLedger
├── ts_unix_ms          : u64       (millisecond timestamp)
├── component           : String    (producing subsystem)
├── action              : String    (decision taken)
├── posterior            : Vec<f64>  (probability distribution, sums to ~1.0)
├── expected_loss_by_action : BTreeMap<String, f64>  (loss per candidate action)
├── chosen_expected_loss : f64      (loss of the selected action)
├── calibration_score   : f64       (calibration quality, [0, 1])
├── fallback_active     : bool      (true if fallback heuristic fired)
└── top_features        : Vec<(String, f64)>  (most influential features)

Builder

use franken_evidence::EvidenceLedgerBuilder;

let entry = EvidenceLedgerBuilder::new()
    .ts_unix_ms(1700000000000)
    .component("scheduler")
    .action("preempt")
    .posterior(vec![0.7, 0.2, 0.1])
    .expected_loss("preempt", 0.05)
    .expected_loss("continue", 0.3)
    .expected_loss("defer", 0.15)
    .chosen_expected_loss(0.05)
    .calibration_score(0.92)
    .fallback_active(false)
    .top_feature("queue_depth", 0.45)
    .top_feature("priority_gap", 0.30)
    .build()
    .expect("valid entry");