//! Pre-flight Built-In Self-Test orchestration.
//!
//! Today's BIT is a placeholder that confirms basic config sanity. The real BIT
//! (MAVLink heartbeat, gimbal probe, RTSP open, missions API reachability,
//! disk-quota check) lands in AZ-650 (`mission_executor_bit_f9`). Keeping the
//! seam here lets that task slot in without touching `main.rs`.

use shared::config::Config;

// AZ-650 will produce `Degraded` and `Block` results once the real BIT lands.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[allow(dead_code)]
pub enum BitOutcome {
    /// All prerequisites met — flight allowed.
    Pass,
    /// Degraded but flight-allowed (operator acknowledges).
    Degraded,
    /// Block — takeoff forbidden.
    Block,
}

/// Run the pre-flight BIT. Today's implementation only validates the config.
pub async fn run_preflight_bit(_config: &Config) -> anyhow::Result<BitOutcome> {
    // TODO(AZ-650): wire the full BIT — MAVLink heartbeat probe, gimbal status,
    // RTSP open, missions API reachability, mapobjects_store hydrate dry-run,
    // disk-quota check (takeoff blocker per architecture.md §5).
    Ok(BitOutcome::Pass)
}
