//! SP15 Phase 2B Group 1 — action latency: Hold→Long within 5 bars of +5σ signal.
//! Anchor for: Phase 3 (responsiveness via teaching).

use crate::synthetic_markets::flat_market;
use crate::harness::BehavioralResult;
use ml::cuda_pipeline::lob_bar::LobBar;

#[test]
#[ignore = "Phase 2B contract — requires per-bar action access from harness (Phase 2B.b)"]
fn test_2_18_action_latency() {
    // Flat for 5000 bars, then step-function +drift starts at bar 5000
    let mut bars = flat_market(5_000, 0.1, 0.25, 42);
    let drift_start_price = bars.last().unwrap().price;
    for i in 0..5_000 {
        let p = drift_start_price + 0.5 * (i as f32);
        bars.push(LobBar::new(p, 0.25, 1.0));
    }

    // Once harness exposes per-bar actions:
    //   let switch_bar = result.actions.iter().skip(5_000)
    //       .position(|a| matches!(a, ActionEnum::Long(_)))
    //       .map(|p| p + 5_000);
    //   assert!(switch_bar.unwrap_or(usize::MAX) < 5_005, ...);

    let _ = bars;  // contract document
    let _ = BehavioralResult::default();
}
