//! SP15 Phase 2B Group 1 — cost sensitivity: trade freq drops ≥40% under high spread.
//! Anchor for: Phase 3.2 explicit cost in r_quality.

use crate::synthetic_markets::drift_market;
use crate::harness::{evaluate_policy_on_market, BehavioralResult};

#[test]
#[ignore = "Phase 2B contract — green when Phase 3.2 lands"]
fn test_2_4_cost_sensitivity() {
    // Same +drift series at different mean spreads
    let bars_low = drift_market(10_000, 0.5, 0.1, /*mean_spread*/ 0.1, 42);
    let bars_high = drift_market(10_000, 0.5, 0.1, /*mean_spread*/ 2.0, 42);

    let mut trainer = ();
    let result_low: BehavioralResult = evaluate_policy_on_market(&mut trainer, &bars_low[5_000..], 0);
    let result_high: BehavioralResult = evaluate_policy_on_market(&mut trainer, &bars_high[5_000..], 0);

    let low = result_low.trade_count as f32;
    let high = result_high.trade_count as f32;
    assert!(low > 0.0, "low-spread trade_count = 0; cannot compute sensitivity");
    let drop = (low - high) / low;
    assert!(drop >= 0.40,
        "test 2.4 FAIL: trade-freq drop = {:.2}, expected >= 0.40 (high-spread)", drop);
}
