use anyhow::{Result, bail};
use std::collections::BTreeMap;

use crate::sync_probe::analyze::report::{SyncAnalysisReport, SyncEventPair};

use super::{PulseSegment, median};

#[path = "correlation_collapse.rs"]
mod collapse;
pub(super) use collapse::collapse_segments_by_phase;

const MARKER_WIDTH_MULTIPLIER: f64 = 1.5;
const PHASE_TOLERANCE_WIDTH_MULTIPLIER: f64 = 2.5;
const STARTUP_PHASE_ANCHOR_TOLERANCE_FRACTION: f64 = 1.0 / 3.0;
const MIN_CODED_PAIRS: usize = 3;
const DIAGNOSTIC_CODED_MAX_PAIR_GAP_S: f64 = 30.0;

include!("correlation/activity_pairing.rs");

include!("correlation/coded_pair_candidates.rs");
include!("correlation/coded_pair_matching.rs");

include!("correlation/report_building.rs");
