#![deny(clippy::unwrap_used, clippy::expect_used)]
#![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used))]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::integer_division)]
#![allow(clippy::float_arithmetic)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::missing_const_for_fn)]
#![allow(clippy::shadow_reuse, clippy::shadow_same, clippy::shadow_unrelated)] // Tensor ops: let x = x.relu() is idiomatic
#![allow(clippy::non_ascii_literal)] // Math symbols in ML documentation and error messages
#![allow(clippy::partial_pub_fields)] // ML config structs: some fields are pub API, some internal
#![allow(clippy::same_name_method)] // Intentional: inherent methods shadow trait defaults for ML-specific behavior
#![allow(clippy::type_complexity)] // Complex generic types in validation pipeline
#![allow(clippy::single_char_lifetime_names)] // 'a is idiomatic Rust

//! Statistical and Financial Validation — core algorithms.
//!
//! Provides two categories of validation:
//! - Statistical validation (walk-forward, DSR, PBO, permutation tests)
//! - Temporal guards for preventing forward-looking data leakage
//! - Noise injection for robustness testing
//! - Fold-by-fold performance degradation tracking
//!
//! Bridge modules (DQN/PPO adapters, regime analysis, harness) stay in the `ml`
//! crate and re-export types from this crate.

pub use ml_core::{MLError, MLResult};

pub mod degradation;
pub mod noise;
pub mod statistical;
pub mod temporal_guard;
pub mod types;
pub mod walk_forward;

// Re-export core types at crate root for convenience.
pub use degradation::{DegradationReport, DegradationTracker, FoldMetrics};
pub use noise::{compute_robustness_score, NoiseConfig, NoiseInjector};
pub use statistical::{
    binomial_coefficient, deflated_sharpe_ratio, excess_kurtosis, normal_cdf, normal_ppf,
    permutation_test, probability_of_backtest_overfitting, sharpe_ratio, skewness, DsrResult,
    PboResult, PermutationResult,
};
pub use temporal_guard::{LeakageAuditReport, NormalizationStats, TemporalGuard};
pub use types::{TimeSeriesData, ValidatableStrategy};
pub use walk_forward::{walk_forward_split, Fold, WalkForwardConfig};
