//! Full end-to-end PSTN sim via the binary's `MediaThread` + `RegisterTrunk`.
//!
//! This test was moved from `crates/rutster-trunk/tests/sim_integ.rs` because
//! `rutster-trunk` integration tests cannot depend on the `rutster` binary
//! crate (`rutster` already depends on `rutster-trunk`; Cargo disallows
//! circular dev-dependencies). The binary crate has access to
//! `MediaThread`, `MediaCmd::RegisterTrunk`, and `spawn_tap_engine` — the
//! full wiring surface the trunk crate's tests couldn't reach.
//!
//! The active `pstn_sim_synthetic_caller_drives_trunk_reflex_loop` in
//! `crates/rutster-trunk/tests/sim_integ.rs` covers the FOB reflex loop +
//! trunk-leg tick directly. This test extends that to exercise the binary's
//! `MediaThread` command channel + the `RegisterTrunk` spawn seam end-to-end.

#[ignore = "requires MediaThread::RegisterTrunk wiring + MockTwilioMediaStreamsServer; not yet implemented in the binary crate's test harness"]
#[tokio::test]
async fn full_pstn_e2e_through_media_thread_register_trunk() {
    // TODO: exercise MediaCmd::RegisterTrunk + MediaThread tick loop against a
    // live TwilioMediaStreamsServer mock. The test should:
    //   1. Start MockRealtimeBrain.
    //   2. Spawn a MediaThread (from crates/rutster/src/media_thread.rs).
    //   3. Construct a MockTwilioMediaStreamsServer that pushes synthetic loud
    //      PcmFrames into a RegisterTrunkInboundChannel.
    //   4. Send MediaCmd::RegisterTrunk to the MediaThread.
    //   5. Drive the 20ms tick loop for ~500ms.
    //   6. Assert barge-in fired (ReflexMetrics.barge_in_count >= 1).
    //   7. Assert brain reply observed on the outbound mpsc.
    //   8. Assert idle timeout closes the session (ChannelState::Closed).
    //
    // This requires the binary crate's test harness to expose a way to
    // construct a TrunkSession's pipe stack outside the normal axum route
    // handler (or to drive the route handler in-process via axum's test
    // `oneshot` pattern). Either path is feasible; pick the one that
    // matches the existing `barge_in_integration.rs` harness pattern.
}
