feat(drift_ledger): literal-100% residue — dichotomy wave

Port the last audit-missing fn name-preserving: _auto_fix_decision,
the facade routing probe's reunited-crate twin (delegates in-process to
the existing auto_fix_decision kernel; the loader-failure fallback arm
cannot fire in-process). Battery k_auto_fix replay now enters through
the twin — 8/8 green. Truth regen x2 byte-identical; embedded truth
== live regen; RUNE_DL_CORE=auto parity pass 87 cases byte-identical
against the built .so; clippy -D warnings clean; adjacent pytest
27/27 BOTH pins (RUNE_DL_CORE=python|auto). Fn coverage 20/21 -> 21/21.
This commit is contained in:
Nick committed 2026-10-15 05:19:37 +01:00
1 parent 73ac04f810
commit 97fac433f7
2 files changed
+13 -4

No files matched your search

+4 -4
View File
@@ -7,7 +7,7 @@
//! are replayed byte-for-byte, the IO-seam groups ride along as provenance
//! and are re-verified live by the generator's RUNE_DL_CORE=auto parity pass).
use crate::{anchor_record, auto_fix_decision, check_alerts, diff_blocks,
use crate::{_auto_fix_decision, anchor_record, check_alerts, diff_blocks,
fix_decision, ledger_path_for, sha, snapshot_entry};
const TRUTH: &str = r###"{
@@ -2111,9 +2111,9 @@ fn check_alerts_matches_oracle() {
#[test]
fn auto_fix_decision_matches_oracle() {
for (idx, case) in truth()["k_auto_fix"].as_array().expect("k_auto_fix array").iter().enumerate() {
let got = auto_fix_decision(case["input"]["label"].as_str().unwrap_or(""),
matches!(case["input"]["anchored"], serde_json::Value::Bool(true)),
matches!(case["input"]["has_last_good"], serde_json::Value::Bool(true)));
let got = _auto_fix_decision(case["input"]["label"].as_str().unwrap_or(""),
matches!(case["input"]["anchored"], serde_json::Value::Bool(true)),
matches!(case["input"]["has_last_good"], serde_json::Value::Bool(true)));
assert_eq!(got, case["expected"], "k_auto_fix case {}", idx);
}
}
+9
View File
@@ -155,6 +155,15 @@ pub fn auto_fix_decision(label: &str, anchored: bool, has_last_good: bool) -> Va
}
}
/// Name-preserving twin of the facade's `_auto_fix_decision` routing probe:
/// the oracle wrapper's whole body is delegate-to-dl_loader-else-Python —
/// in the reunited crate the delegation is in-process (the loader-failure
/// fallback arm can't fire), so the twin forwards to [`auto_fix_decision`].
/// The k_auto_fix truth rows pin this entry point.
pub fn _auto_fix_decision(label: &str, anchored: bool, has_last_good: bool) -> Value {
auto_fix_decision(label, anchored, has_last_good)
}
/// Python round(x, 3): correct rounding of the binary value with ties-to-even
/// (the same contract Rust's {:.3} formatting implements).
fn py_round3(x: f64) -> f64 {