ccf-core 1.0.1

Canonical CCF core v1 trust-update and runtime-certificate primitives for filed-Prov6 contract enforcement
Documentation
use ccf_core::qac::{
    reject_arithmetic_interpolation_regression, Matrix3, PositiveDiagonal3, QacInputs3,
    ARITHMETIC_INTERPOLATION_OLD_WRONG_PATH,
};

fn fixture() -> QacInputs3 {
    QacInputs3 {
        prior_a_t: Matrix3::new([[0.82, 1.15, 0.64], [1.04, 0.91, 1.33], [0.77, 1.28, 1.09]]),
        reference_r_t: Matrix3::new([[1.21, 0.73, 1.08], [0.88, 1.42, 0.96], [1.31, 0.69, 1.17]]),
        left_l_t: PositiveDiagonal3::try_new([1.10, 0.90, 1.05]).unwrap(),
        right_c_t: PositiveDiagonal3::try_new([0.95, 1.20, 0.85]).unwrap(),
        alpha_t: 0.35,
        epsilon_floor: 1.0e-12,
    }
}

#[test]
fn arithmetic_interpolation_old_wrong_path_cannot_pass() {
    let report = reject_arithmetic_interpolation_regression(&fixture())
        .expect("arithmetic interpolation negative guard is required");

    assert_eq!(
        report.old_wrong_path,
        ARITHMETIC_INTERPOLATION_OLD_WRONG_PATH
    );
    assert!(report.rejected);
    assert!(report.kappa_excursion > 0.0);
}