Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/benches/tlob_performance.rs:314:
 
 #[cfg(test)]
 mod bench_tests {
[31m-    
[m 
     #[test]
     fn test_feature_generation() {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/config.rs:153:
 
 impl Default for ModelConfig {
     fn default() -> Self {
[31m-        eprintln!("WARNING: Using hardcoded ModelConfig::default() - migrate to database configuration!");
[m[32m+        eprintln!(
[m[32m+            "WARNING: Using hardcoded ModelConfig::default() - migrate to database configuration!"
[m[32m+        );
[m         Self {
             id: "default_model".to_string(),
             name: "default_model".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/config.rs:186:
 
 impl Default for RiskConfig {
     fn default() -> Self {
[31m-        eprintln!("WARNING: Using hardcoded RiskConfig::default() - migrate to database configuration!");
[m[32m+        eprintln!(
[m[32m+            "WARNING: Using hardcoded RiskConfig::default() - migrate to database configuration!"
[m[32m+        );
[m         Self {
             max_position_size: 0.1,
             max_leverage: 2.0,
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/config.rs:267:
 
 impl Default for RegimeConfig {
     fn default() -> Self {
[31m-        eprintln!("WARNING: Using hardcoded RegimeConfig::default() - migrate to database configuration!");
[m[32m+        eprintln!(
[m[32m+            "WARNING: Using hardcoded RegimeConfig::default() - migrate to database configuration!"
[m[32m+        );
[m         Self {
             detection_method: RegimeDetectionMethod::HMM,
             lookback_window: 252,
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/config_types.rs:263:
             "EQUAL_WEIGHT" => Ok(Self::EqualWeight),
             "RISK_PARITY" => Ok(Self::RiskParity),
             "VOLATILITY_TARGET" => Ok(Self::VolatilityTarget),
[31m-            custom if custom.starts_with("CUSTOM") => {
[m[31m-                Ok(Self::Custom(custom.to_string()))
[m[31m-            }
[m[32m+            custom if custom.starts_with("CUSTOM") => Ok(Self::Custom(custom.to_string())),
[m             _ => Err(format!("Unknown position sizing method: {}", s)),
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/config_types.rs:413:
                 features: self.microstructure_features,
             },
             regime: RegimeConfig {
[31m-                detection_method: RegimeDetectionMethod::from_str(
[m[31m-                    &self.regime_detection_method,
[m[31m-                )?,
[m[32m+                detection_method: RegimeDetectionMethod::from_str(&self.regime_detection_method)?,
[m                 lookback_window: self.regime_lookback_window as usize,
                 transition_threshold: self.regime_transition_threshold,
                 features: self.regime_features,
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/config_types.rs:588:
         }
 
         // Execution validation
[31m-        if self.execution.dark_pool_preference < 0.0 || self.execution.dark_pool_preference > 1.0
[m[31m-        {
[m[32m+        if self.execution.dark_pool_preference < 0.0 || self.execution.dark_pool_preference > 1.0 {
[m             return Err(format!(
                 "Invalid dark_pool_preference: {} (must be 0.0-1.0)",
                 self.execution.dark_pool_preference
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/config_types.rs:633:
         let methods = vec![
             ("HMM", RegimeDetectionMethod::HMM),
             ("GMM", RegimeDetectionMethod::GMM),
[31m-            (
[m[31m-                "MARKOV_SWITCHING",
[m[31m-                RegimeDetectionMethod::MarkovSwitching,
[m[31m-            ),
[m[32m+            ("MARKOV_SWITCHING", RegimeDetectionMethod::MarkovSwitching),
[m         ];
 
         for (s, expected) in methods {
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/database_loader.rs:13:
 use sqlx::postgres::PgListener;
 
 #[cfg(feature = "postgres")]
[31m-use crate::config_types::{AdaptiveStrategyConfig, AdaptiveStrategyConfigRow, ModelConfigRow, FeatureConfigRow};
[m[32m+use crate::config_types::{
[m[32m+    AdaptiveStrategyConfig, AdaptiveStrategyConfigRow, FeatureConfigRow, ModelConfigRow,
[m[32m+};
[m #[cfg(feature = "postgres")]
 use std::time::Duration;
 
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/database_loader.rs:215:
         if let Some(listener) = &mut self.listener {
             if let Some(notification) = listener.try_recv().await? {
                 // Parse notification payload
[31m-                if let Ok(payload) = serde_json::from_str::<serde_json::Value>(notification.payload()) {
[m[32m+                if let Ok(payload) =
[m[32m+                    serde_json::from_str::<serde_json::Value>(notification.payload())
[m[32m+                {
[m                     if let Some(strategy_id) = payload.get("strategy_id").and_then(|v| v.as_str()) {
                         return Ok(Some(strategy_id.to_string()));
                     }
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/database_loader.rs:238:
 #[cfg(not(feature = "postgres"))]
 impl DatabaseConfigLoader {
     /// Always returns default configuration when postgres feature is disabled
[31m-    pub fn load_config_or_default(&self, _strategy_id: &str) -> crate::config::AdaptiveStrategyConfig {
[m[32m+    pub fn load_config_or_default(
[m[32m+        &self,
[m[32m+        _strategy_id: &str,
[m[32m+    ) -> crate::config::AdaptiveStrategyConfig {
[m         crate::config::AdaptiveStrategyConfig::default()
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/database_loader.rs:255:
         {
             let loader = DatabaseConfigLoader;
             let config = loader.load_config_or_default("test");
[31m-            assert_eq!(config.general.execution_interval, Duration::from_millis(100));
[m[32m+            assert_eq!(
[m[32m+                config.general.execution_interval,
[m[32m+                Duration::from_millis(100)
[m[32m+            );
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/lib.rs:393:
         config_types::PositionSizingMethod::Kelly => config::PositionSizingMethod::Kelly,
         config_types::PositionSizingMethod::FixedFractional(f) => {
             config::PositionSizingMethod::FixedFractional(f)
[31m-        }
[m[32m+        },
[m         config_types::PositionSizingMethod::FixedFraction => {
             config::PositionSizingMethod::FixedFraction
[31m-        }
[m[32m+        },
[m         config_types::PositionSizingMethod::PPO => config::PositionSizingMethod::PPO,
         config_types::PositionSizingMethod::EqualWeight => {
             config::PositionSizingMethod::EqualWeight
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/lib.rs:403:
[31m-        }
[m[31m-        config_types::PositionSizingMethod::RiskParity => {
[m[31m-            config::PositionSizingMethod::RiskParity
[m[31m-        }
[m[32m+        },
[m[32m+        config_types::PositionSizingMethod::RiskParity => config::PositionSizingMethod::RiskParity,
[m         config_types::PositionSizingMethod::VolatilityTarget => {
             config::PositionSizingMethod::VolatilityTarget
[31m-        }
[m[32m+        },
[m         config_types::PositionSizingMethod::Custom(s) => config::PositionSizingMethod::Custom(s),
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/lib.rs:419:
         config_types::RegimeDetectionMethod::HMM => config::RegimeDetectionMethod::HMM,
         config_types::RegimeDetectionMethod::MarkovSwitching => {
             config::RegimeDetectionMethod::MarkovSwitching
[31m-        }
[m[31m-        config_types::RegimeDetectionMethod::Threshold => {
[m[31m-            config::RegimeDetectionMethod::Threshold
[m[31m-        }
[m[32m+        },
[m[32m+        config_types::RegimeDetectionMethod::Threshold => config::RegimeDetectionMethod::Threshold,
[m         config_types::RegimeDetectionMethod::MLClassification => {
             config::RegimeDetectionMethod::MLClassification
[31m-        }
[m[32m+        },
[m         config_types::RegimeDetectionMethod::GMM => config::RegimeDetectionMethod::GMM,
         config_types::RegimeDetectionMethod::MLClassifier => {
             config::RegimeDetectionMethod::MLClassifier
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/lib.rs:432:
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/src/lib.rs:443:
         config_types::ExecutionAlgorithm::IS => config::ExecutionAlgorithm::IS,
         config_types::ExecutionAlgorithm::ImplementationShortfall => {
             config::ExecutionAlgorithm::ImplementationShortfall
[31m-        }
[m[31m-        config_types::ExecutionAlgorithm::ArrivalPrice => {
[m[31m-            config::ExecutionAlgorithm::ArrivalPrice
[m[31m-        }
[m[32m+        },
[m[32m+        config_types::ExecutionAlgorithm::ArrivalPrice => config::ExecutionAlgorithm::ArrivalPrice,
[m         config_types::ExecutionAlgorithm::POV => config::ExecutionAlgorithm::POV,
     }
 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:85:
     let state = StrategyState {
         active: true,
         current_regime: "bull".to_string(),
[31m-        model_weights: HashMap::from([
[m[31m-            ("mamba2".to_string(), 0.4),
[m[31m-            ("tlob".to_string(), 0.6),
[m[31m-        ]),
[m[32m+        model_weights: HashMap::from([("mamba2".to_string(), 0.4), ("tlob".to_string(), 0.6)]),
[m         last_update: chrono::Utc::now(),
         performance: PerformanceMetrics::default(),
     };
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:107:
     config.risk.kelly_fraction = 0.25;
 
     let strategy = AdaptiveStrategy::new(config).await;
[31m-    assert!(strategy.is_ok(), "Strategy with Kelly sizing should create successfully");
[m[32m+    assert!(
[m[32m+        strategy.is_ok(),
[m[32m+        "Strategy with Kelly sizing should create successfully"
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:116:
     config.risk.position_sizing_method = PositionSizingMethod::PPO;
 
     let strategy = AdaptiveStrategy::new(config).await;
[31m-    assert!(strategy.is_ok(), "Strategy with PPO sizing should create successfully");
[m[32m+    assert!(
[m[32m+        strategy.is_ok(),
[m[32m+        "Strategy with PPO sizing should create successfully"
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:126:
     config.execution.max_slippage_bps = 5.0;
 
     let strategy = AdaptiveStrategy::new(config).await;
[31m-    assert!(strategy.is_ok(), "Strategy with VWAP should create successfully");
[m[32m+    assert!(
[m[32m+        strategy.is_ok(),
[m[32m+        "Strategy with VWAP should create successfully"
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:136:
     config.regime.lookback_window = 252;
 
     let strategy = AdaptiveStrategy::new(config).await;
[31m-    assert!(strategy.is_ok(), "Strategy with HMM regime detection should succeed");
[m[32m+    assert!(
[m[32m+        strategy.is_ok(),
[m[32m+        "Strategy with HMM regime detection should succeed"
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:178:
     ];
 
     let strategy = AdaptiveStrategy::new(config).await;
[31m-    assert!(strategy.is_ok(), "Strategy with 4 models should create successfully");
[m[32m+    assert!(
[m[32m+        strategy.is_ok(),
[m[32m+        "Strategy with 4 models should create successfully"
[m[32m+    );
[m }
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:210:
     let mut sizer = KellyPositionSizer::new(config).unwrap();
 
     let historical_returns = vec![
[31m-        0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02,
[m[31m-        0.07, -0.01, 0.03, -0.04, 0.09, -0.02, 0.05, -0.03,
[m[32m+        0.05, -0.02, 0.08, -0.03, 0.06, -0.01, 0.04, -0.02, 0.07, -0.01, 0.03, -0.04, 0.09, -0.02,
[m[32m+        0.05, -0.03,
[m     ];
 
     let mut market_data = adaptive_strategy::risk::MarketData {
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:402:
 async fn test_ensemble_coordinator_creation() {
     let config = AdaptiveStrategyConfig::default();
     let coordinator = EnsembleCoordinator::new(&config).await;
[31m-    assert!(coordinator.is_ok(), "Ensemble coordinator should create successfully");
[m[32m+    assert!(
[m[32m+        coordinator.is_ok(),
[m[32m+        "Ensemble coordinator should create successfully"
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:421:
         pred.confidence >= 0.0 && pred.confidence <= 1.0,
         "Confidence should be in [0,1]"
     );
[31m-    assert!(!pred.model_contributions.is_empty(), "Should have model contributions");
[m[32m+    assert!(
[m[32m+        !pred.model_contributions.is_empty(),
[m[32m+        "Should have model contributions"
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:448:
     let timestamp = chrono::Utc::now();
     let actual_outcome = 0.05;
 
[31m-    let result = coordinator.record_outcome_legacy(timestamp, actual_outcome).await;
[m[32m+    let result = coordinator
[m[32m+        .record_outcome_legacy(timestamp, actual_outcome)
[m[32m+        .await;
[m     assert!(result.is_ok(), "Outcome recording should succeed");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:458:
     let coordinator = EnsembleCoordinator::new(&config).await.unwrap();
 
     let performance = coordinator.get_performance().await;
[31m-    assert_eq!(performance.accuracy().len(), 0, "Initial accuracy should be empty");
[m[32m+    assert_eq!(
[m[32m+        performance.accuracy().len(),
[m[32m+        0,
[m[32m+        "Initial accuracy should be empty"
[m[32m+    );
[m }
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:469:
 async fn test_model_factory_available_models() {
     let models = ModelFactory::available_models();
     assert!(models.contains(&"lstm"), "Should support LSTM");
[31m-    assert!(models.contains(&"transformer"), "Should support Transformer");
[m[31m-    assert!(models.contains(&"random_forest"), "Should support Random Forest");
[m[32m+    assert!(
[m[32m+        models.contains(&"transformer"),
[m[32m+        "Should support Transformer"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        models.contains(&"random_forest"),
[m[32m+        "Should support Random Forest"
[m[32m+    );
[m     assert!(models.contains(&"xgboost"), "Should support XGBoost");
     assert!(models.contains(&"tlob"), "Should support TLOB");
 }
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:490:
 #[tokio::test]
 async fn test_model_registry_operations() {
     let mut registry = ModelRegistry::new();
[31m-    assert_eq!(registry.list_models().len(), 0, "Registry should start empty");
[m[32m+    assert_eq!(
[m[32m+        registry.list_models().len(),
[m[32m+        0,
[m[32m+        "Registry should start empty"
[m[32m+    );
[m 
     let config = adaptive_strategy::models::ModelConfig::default();
     let model = ModelFactory::create_model("mock", "test_model".to_string(), config)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:525:
     let feature_names = vec!["f1".to_string(), "f2".to_string()];
 
     let data = TrainingData::new(features, targets, feature_names);
[31m-    assert!(data.validate().is_err(), "Invalid data should fail validation");
[m[32m+    assert!(
[m[32m+        data.validate().is_err(),
[m[32m+        "Invalid data should fail validation"
[m[32m+    );
[m }
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:603:
     let result = risk_manager.update_market_regime(MarketRegime::Bull).await;
     assert!(result.is_ok(), "Market regime update should succeed");
 
[31m-    let result = risk_manager.update_market_regime(MarketRegime::HighVolatility).await;
[m[31m-    assert!(result.is_ok(), "High volatility regime update should succeed");
[m[32m+    let result = risk_manager
[m[32m+        .update_market_regime(MarketRegime::HighVolatility)
[m[32m+        .await;
[m[32m+    assert!(
[m[32m+        result.is_ok(),
[m[32m+        "High volatility regime update should succeed"
[m[32m+    );
[m }
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:629:
     let serialized = serde_json::to_string(&metrics);
     assert!(serialized.is_ok());
 
[31m-    let deserialized: Result<PortfolioRiskMetrics, _> =
[m[31m-        serde_json::from_str(&serialized.unwrap());
[m[32m+    let deserialized: Result<PortfolioRiskMetrics, _> = serde_json::from_str(&serialized.unwrap());
[m     assert!(deserialized.is_ok());
 }
 
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/algorithm_comprehensive.rs:647:
 
     assert!(metrics.sharpe_ratio > 0.0);
     assert!(metrics.cvar_95 > metrics.var_95, "CVaR should exceed VaR");
[31m-    assert!(metrics.max_loss >= metrics.cvar_95, "Max loss should be highest");
[m[32m+    assert!(
[m[32m+        metrics.max_loss >= metrics.cvar_95,
[m[32m+        "Max loss should be highest"
[m[32m+    );
[m }
 
 #[tokio::test]
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/backtesting_comprehensive.rs:13:
     create_adaptive_strategy_with_config, metrics::MetricsCalculator, replay_engine::MarketReplay,
     replay_engine::ReplayConfig, AdaptiveStrategyConfig, BacktestConfig, BacktestEngine,
     FeatureSettings, PerformanceSnapshot, RiskSettings, SignalType, Strategy, StrategyConfig,
[31m-    StrategyContext, TradingSignal, TradeRecord,
[m[32m+    StrategyContext, TradeRecord, TradingSignal,
[m };
 use chrono::{DateTime, Duration as ChronoDuration, TimeDelta, Utc};
 use common::{Order, OrderSide, Position, Price, Quantity, Symbol};
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/backtesting_comprehensive.rs:44:
     let state = replay.get_state().await;
 
     // Should start at configured start_time (using captured timestamp)
[31m-    assert_eq!(
[m[31m-        state.current_time.timestamp(),
[m[31m-        start_time.timestamp()
[m[31m-    );
[m[32m+    assert_eq!(state.current_time.timestamp(), start_time.timestamp());
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/backtesting_comprehensive.rs:653:
     for day in 0..252 {
         // Trading days in a year
         let benchmark_value = dec!(1000) * (dec!(1.10).powu(day) / dec!(252));
[31m-        benchmark_data.push((base_time + ChronoDuration::days(day as i64), benchmark_value));
[m[32m+        benchmark_data.push((
[m[32m+            base_time + ChronoDuration::days(day as i64),
[m[32m+            benchmark_value,
[m[32m+        ));
[m     }
 
     calculator.set_benchmark("SPY".to_string(), benchmark_data);
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/backtesting_comprehensive.rs:862:
     });
 
     let base_time = Utc::now();
[31m-    
[m[32m+
[m     // Snapshot 1: Initial state
     calculator.add_snapshot(PerformanceSnapshot {
         timestamp: base_time,
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/backtesting_comprehensive.rs:873:
         open_positions: 0,
         drawdown: dec!(0),
     });
[31m-    
[m[32m+
[m     // Snapshot 2: After trade (next day)
     calculator.add_snapshot(PerformanceSnapshot {
         timestamp: base_time + ChronoDuration::days(1),
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/backtesting_comprehensive.rs:884:
         open_positions: 0,
         drawdown: dec!(0),
     });
[31m-    
[m[32m+
[m     let analytics = calculator.calculate_analytics()?;
 
     // Total commission should be tracked
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/backtesting_comprehensive.rs:933:
     // Fix: Capture timestamp once to avoid race condition between Utc::now() calls
     let now = Utc::now();
     let window_configs = vec![
[31m-        (
[m[31m-            now - TimeDelta::days(60),
[m[31m-            now - TimeDelta::days(30),
[m[31m-        ), // Window 1
[m[31m-        (
[m[31m-            now - TimeDelta::days(45),
[m[31m-            now - TimeDelta::days(15),
[m[31m-        ), // Window 2
[m[31m-        (
[m[31m-            now - TimeDelta::days(30),
[m[31m-            now - TimeDelta::days(0),
[m[31m-        ), // Window 3
[m[32m+        (now - TimeDelta::days(60), now - TimeDelta::days(30)), // Window 1
[m[32m+        (now - TimeDelta::days(45), now - TimeDelta::days(15)), // Window 2
[m[32m+        (now - TimeDelta::days(30), now - TimeDelta::days(0)),  // Window 3
[m     ];
 
     for (start, end) in window_configs {
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/backtesting_comprehensive.rs:1132:
     // No snapshots added
     let result = calculator.calculate_analytics();
 
[31m-    assert!(
[m[31m-        result.is_err(),
[m[31m-        "Should error when no snapshots available"
[m[31m-    );
[m[32m+    assert!(result.is_err(), "Should error when no snapshots available");
[m 
     if let Err(e) = result {
         assert!(
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/database_config_integration.rs:81:
     assert!(config.execution.smart_routing_enabled);
 
     // Verify regime detection
[31m-    assert_eq!(
[m[31m-        config.regime.detection_method,
[m[31m-        RegimeDetectionMethod::HMM
[m[31m-    );
[m[32m+    assert_eq!(config.regime.detection_method, RegimeDetectionMethod::HMM);
[m     assert_eq!(config.regime.lookback_window, 252);
 
     // Verify models loaded
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/database_config_integration.rs:157:
     // Verify aggressive risk settings
     assert_eq!(config.risk.max_position_size, 0.15); // 15%
     assert_eq!(config.risk.kelly_fraction, 0.40);
[31m-    assert_eq!(config.risk.position_sizing_method, PositionSizingMethod::PPO);
[m[32m+    assert_eq!(
[m[32m+        config.risk.position_sizing_method,
[m[32m+        PositionSizingMethod::PPO
[m[32m+    );
[m 
     // Verify minimal ensemble for speed
     assert_eq!(config.ensemble.max_parallel_models, 2); // Only 2 for latency
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/database_config_integration.rs:250:
         .expect("Config not found");
 
     // Verify expected models
[31m-    let model_types: Vec<String> = config
[m[31m-        .models
[m[31m-        .iter()
[m[31m-        .map(|m| m.model_type.clone())
[m[31m-        .collect();
[m[32m+    let model_types: Vec<String> = config.models.iter().map(|m| m.model_type.clone()).collect();
[m 
     assert!(model_types.contains(&"mamba2".to_string()));
     assert!(model_types.contains(&"tlob".to_string()));
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/database_config_integration.rs:287:
     // Development should have more models
     assert_eq!(config.models.len(), 5);
 
[31m-    let model_types: Vec<String> = config
[m[31m-        .models
[m[31m-        .iter()
[m[31m-        .map(|m| m.model_type.clone())
[m[31m-        .collect();
[m[32m+    let model_types: Vec<String> = config.models.iter().map(|m| m.model_type.clone()).collect();
[m 
     // Verify comprehensive model set
     assert!(model_types.contains(&"mamba2".to_string()));
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/database_config_integration.rs:314:
     assert_eq!(config.models.len(), 2);
 
     // Verify HFT-optimized models
[31m-    let model_types: Vec<String> = config
[m[31m-        .models
[m[31m-        .iter()
[m[31m-        .map(|m| m.model_type.clone())
[m[31m-        .collect();
[m[32m+    let model_types: Vec<String> = config.models.iter().map(|m| m.model_type.clone()).collect();
[m 
     assert!(model_types.contains(&"tlob".to_string()));
     assert!(model_types.contains(&"ppo".to_string()));
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/database_config_integration.rs:520:
         match result {
             Ok(None) => {
                 // Expected: strategy not found
[31m-            }
[m[32m+            },
[m             Ok(Some(_)) => {
                 panic!("Should not load config for invalid ID: {}", id);
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 // Acceptable: database error for malformed ID
                 eprintln!("Database error for ID '{}': {}", id, e);
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/database_config_integration.rs:530:
[31m-            }
[m[32m+            },
[m         }
     }
 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:102:
     sqlx::query(
         "UPDATE adaptive_strategy_config
          SET name = 'Updated Test Strategy', updated_at = NOW()
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .execute(&pool)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:138:
          WHERE strategy_config_id = (
              SELECT id FROM adaptive_strategy_config
              WHERE strategy_id = 'default-production'
[31m-         ) LIMIT 1"
[m[32m+         ) LIMIT 1",
[m     )
     .fetch_one(&pool)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:148:
     sqlx::query(
         "UPDATE adaptive_strategy_models
          SET initial_weight = 0.35, updated_at = NOW()
[31m-         WHERE id = $1"
[m[32m+         WHERE id = $1",
[m     )
     .bind(model_id)
     .execute(&pool)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:180:
          WHERE strategy_config_id = (
              SELECT id FROM adaptive_strategy_config
              WHERE strategy_id = 'default-production'
[31m-         ) LIMIT 1"
[m[32m+         ) LIMIT 1",
[m     )
     .fetch_one(&pool)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:190:
     sqlx::query(
         "UPDATE adaptive_strategy_features
          SET enabled = NOT enabled, updated_at = NOW()
[31m-         WHERE id = $1"
[m[32m+         WHERE id = $1",
[m     )
     .bind(feature_id)
     .execute(&pool)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:225:
     sqlx::query(
         "UPDATE adaptive_strategy_config
          SET max_position_size = 0.08
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .execute(&pool)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:258:
         "INSERT INTO adaptive_strategy_config (
             strategy_id, name, description
          ) VALUES ($1, $2, $3)
[31m-         ON CONFLICT (strategy_id) DO UPDATE SET name = EXCLUDED.name"
[m[32m+         ON CONFLICT (strategy_id) DO UPDATE SET name = EXCLUDED.name",
[m     )
     .bind("test-notification-format")
     .bind("Test Notification Format")
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:297:
     sqlx::query(
         "UPDATE adaptive_strategy_config
          SET description = 'Reconnection test'
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .execute(&pool)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:304:
     .unwrap();
 
[31m-    let notification = wait_for_notification(&mut loader, 5)
[m[31m-        .await
[m[31m-        .unwrap();
[m[32m+    let notification = wait_for_notification(&mut loader, 5).await.unwrap();
[m 
     assert!(
         notification.is_some(),
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:327:
     sqlx::query(
         "INSERT INTO adaptive_strategy_config (
             strategy_id, name
[31m-         ) VALUES ($1, $2)"
[m[32m+         ) VALUES ($1, $2)",
[m     )
     .bind(test_id)
     .bind("Atomic Test Strategy")
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:336:
     .unwrap();
 
     // Get config ID
[31m-    let config_id: uuid::Uuid = sqlx::query_scalar(
[m[31m-        "SELECT id FROM adaptive_strategy_config WHERE strategy_id = $1"
[m[31m-    )
[m[31m-    .bind(test_id)
[m[31m-    .fetch_one(&pool)
[m[31m-    .await
[m[31m-    .unwrap();
[m[32m+    let config_id: uuid::Uuid =
[m[32m+        sqlx::query_scalar("SELECT id FROM adaptive_strategy_config WHERE strategy_id = $1")
[m[32m+            .bind(test_id)
[m[32m+            .fetch_one(&pool)
[m[32m+            .await
[m[32m+            .unwrap();
[m 
     // Start transaction
     let mut tx = pool.begin().await.unwrap();
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:357:
     sqlx::query(
         "INSERT INTO adaptive_strategy_models (
             strategy_config_id, model_id, model_name, model_type, parameters, initial_weight
[31m-         ) VALUES ($1, $2, $3, $4, $5, $6)"
[m[32m+         ) VALUES ($1, $2, $3, $4, $5, $6)",
[m     )
     .bind(config_id)
     .bind("test-model")
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:372:
     sqlx::query(
         "INSERT INTO adaptive_strategy_features (
             strategy_config_id, feature_name, feature_type, parameters
[31m-         ) VALUES ($1, $2, $3, $4)"
[m[32m+         ) VALUES ($1, $2, $3, $4)",
[m     )
     .bind(config_id)
     .bind("test-feature")
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:386:
     tx.commit().await.unwrap();
 
     // Verify all changes persisted
[31m-    let name: String = sqlx::query_scalar(
[m[31m-        "SELECT name FROM adaptive_strategy_config WHERE id = $1"
[m[31m-    )
[m[31m-    .bind(config_id)
[m[31m-    .fetch_one(&pool)
[m[31m-    .await
[m[31m-    .unwrap();
[m[32m+    let name: String =
[m[32m+        sqlx::query_scalar("SELECT name FROM adaptive_strategy_config WHERE id = $1")
[m[32m+            .bind(config_id)
[m[32m+            .fetch_one(&pool)
[m[32m+            .await
[m[32m+            .unwrap();
[m 
     assert_eq!(name, "Updated", "Config update should persist");
 
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:399:
     let model_count: i64 = sqlx::query_scalar(
[31m-        "SELECT COUNT(*) FROM adaptive_strategy_models WHERE strategy_config_id = $1"
[m[32m+        "SELECT COUNT(*) FROM adaptive_strategy_models WHERE strategy_config_id = $1",
[m     )
     .bind(config_id)
     .fetch_one(&pool)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:417:
 
     // Get original config
     let original_name: String = sqlx::query_scalar(
[31m-        "SELECT name FROM adaptive_strategy_config WHERE strategy_id = 'default-production'"
[m[32m+        "SELECT name FROM adaptive_strategy_config WHERE strategy_id = 'default-production'",
[m     )
     .fetch_one(&pool)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:429:
     // Update config
     sqlx::query(
         "UPDATE adaptive_strategy_config SET name = 'Will be rolled back'
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .execute(&mut *tx)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:438:
     // Attempt to insert duplicate strategy_id (UNIQUE constraint violation)
     let result = sqlx::query(
         "INSERT INTO adaptive_strategy_config (strategy_id, name)
[31m-         VALUES ('default-production', 'Duplicate')"
[m[32m+         VALUES ('default-production', 'Duplicate')",
[m     )
     .execute(&mut *tx)
     .await;
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:450:
 
     // Verify original config unchanged
     let current_name: String = sqlx::query_scalar(
[31m-        "SELECT name FROM adaptive_strategy_config WHERE strategy_id = 'default-production'"
[m[32m+        "SELECT name FROM adaptive_strategy_config WHERE strategy_id = 'default-production'",
[m     )
     .fetch_one(&pool)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:474:
     // T1: Read original value
     let original: f64 = sqlx::query_scalar(
         "SELECT max_position_size FROM adaptive_strategy_config
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .fetch_one(&mut *tx1)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:483:
     // T1: Update value
     sqlx::query(
         "UPDATE adaptive_strategy_config SET max_position_size = 0.20
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .execute(&mut *tx1)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:492:
     // T2: Read value BEFORE T1 commits (should see original due to READ COMMITTED)
     let uncommitted_read: f64 = sqlx::query_scalar(
         "SELECT max_position_size FROM adaptive_strategy_config
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .fetch_one(&pool2)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:509:
     // T2: Read value AFTER T1 commits (should see updated value)
     let committed_read: f64 = sqlx::query_scalar(
         "SELECT max_position_size FROM adaptive_strategy_config
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .fetch_one(&pool2)
     .await
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:523:
     // Restore original value
     sqlx::query(
         "UPDATE adaptive_strategy_config SET max_position_size = $1
[31m-         WHERE strategy_id = 'default-production'"
[m[32m+         WHERE strategy_id = 'default-production'",
[m     )
     .bind(original)
     .execute(&pool1)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:580:
         let mut tx = pool1.begin().await.unwrap();
         sqlx::query(
             "INSERT INTO adaptive_strategy_config (strategy_id, name)
[31m-             VALUES ($1, $2)"
[m[32m+             VALUES ($1, $2)",
[m         )
         .bind(test_id)
         .bind("Durability Test")
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:594:
     let pool2 = create_test_pool().await;
 
     // Verify config persisted
[31m-    let name: Option<String> = sqlx::query_scalar(
[m[31m-        "SELECT name FROM adaptive_strategy_config WHERE strategy_id = $1"
[m[31m-    )
[m[31m-    .bind(test_id)
[m[31m-    .fetch_optional(&pool2)
[m[31m-    .await
[m[31m-    .unwrap();
[m[32m+    let name: Option<String> =
[m[32m+        sqlx::query_scalar("SELECT name FROM adaptive_strategy_config WHERE strategy_id = $1")
[m[32m+            .bind(test_id)
[m[32m+            .fetch_optional(&pool2)
[m[32m+            .await
[m[32m+            .unwrap();
[m 
     assert_eq!(
         name,
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:625:
     // Create test config with version=1
     sqlx::query(
         "INSERT INTO adaptive_strategy_config (strategy_id, name, version)
[31m-         VALUES ($1, $2, 1)"
[m[32m+         VALUES ($1, $2, 1)",
[m     )
     .bind(test_id)
     .bind("Concurrent Test")
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:643:
         sqlx::query(
             "UPDATE adaptive_strategy_config
              SET name = 'Task 1 Update', version = version + 1
[31m-             WHERE strategy_id = $1 AND version = 1"
[m[32m+             WHERE strategy_id = $1 AND version = 1",
[m         )
         .bind(&id1)
         .execute(&pool1)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:656:
         sqlx::query(
             "UPDATE adaptive_strategy_config
              SET name = 'Task 2 Update', version = version + 1
[31m-             WHERE strategy_id = $1 AND version = 1"
[m[32m+             WHERE strategy_id = $1 AND version = 1",
[m         )
         .bind(&id2)
         .execute(&pool2)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:674:
     );
 
     // Verify final version is 2
[31m-    let version: i32 = sqlx::query_scalar(
[m[31m-        "SELECT version FROM adaptive_strategy_config WHERE strategy_id = $1"
[m[31m-    )
[m[31m-    .bind(test_id)
[m[31m-    .fetch_one(&pool)
[m[31m-    .await
[m[31m-    .unwrap();
[m[32m+    let version: i32 =
[m[32m+        sqlx::query_scalar("SELECT version FROM adaptive_strategy_config WHERE strategy_id = $1")
[m[32m+            .bind(test_id)
[m[32m+            .fetch_one(&pool)
[m[32m+            .await
[m[32m+            .unwrap();
[m 
     assert_eq!(version, 2, "Version should be incremented once");
 
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:746:
         sqlx::query(
             "UPDATE adaptive_strategy_config
              SET description = $1
[31m-             WHERE strategy_id = 'default-production'"
[m[32m+             WHERE strategy_id = 'default-production'",
[m         )
         .bind(format!("Delay test {}", i))
         .execute(&pool)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:807:
     // Create config
     sqlx::query(
         "INSERT INTO adaptive_strategy_config (strategy_id, name)
[31m-         VALUES ($1, $2)"
[m[32m+         VALUES ($1, $2)",
[m     )
     .bind(test_id)
     .bind("Original Name")
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:818:
     // Update config
     sqlx::query(
         "UPDATE adaptive_strategy_config SET name = 'Updated Name'
[31m-         WHERE strategy_id = $1"
[m[32m+         WHERE strategy_id = $1",
[m     )
     .bind(test_id)
     .execute(&pool)
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:850:
     // Create test config
     sqlx::query(
         "INSERT INTO adaptive_strategy_config (strategy_id, name)
[31m-         VALUES ($1, $2)"
[m[32m+         VALUES ($1, $2)",
[m     )
     .bind(test_id)
     .bind("Partial Failure Test")
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:858:
     .await
     .unwrap();
 
[31m-    let config_id: uuid::Uuid = sqlx::query_scalar(
[m[31m-        "SELECT id FROM adaptive_strategy_config WHERE strategy_id = $1"
[m[31m-    )
[m[31m-    .bind(test_id)
[m[31m-    .fetch_one(&pool)
[m[31m-    .await
[m[31m-    .unwrap();
[m[32m+    let config_id: uuid::Uuid =
[m[32m+        sqlx::query_scalar("SELECT id FROM adaptive_strategy_config WHERE strategy_id = $1")
[m[32m+            .bind(test_id)
[m[32m+            .fetch_one(&pool)
[m[32m+            .await
[m[32m+            .unwrap();
[m 
     // Start transaction
     let mut tx = pool.begin().await.unwrap();
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/hot_reload_integration.rs:898:
     drop(tx);
 
     // Verify config unchanged
[31m-    let name: String = sqlx::query_scalar(
[m[31m-        "SELECT name FROM adaptive_strategy_config WHERE id = $1"
[m[31m-    )
[m[31m-    .bind(config_id)
[m[31m-    .fetch_one(&pool)
[m[31m-    .await
[m[31m-    .unwrap();
[m[32m+    let name: String =
[m[32m+        sqlx::query_scalar("SELECT name FROM adaptive_strategy_config WHERE id = $1")
[m[32m+            .bind(config_id)
[m[32m+            .fetch_one(&pool)
[m[32m+            .await
[m[32m+            .unwrap();
[m 
     assert_eq!(
         name, "Partial Failure Test",
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:35:
 #![allow(unused_crate_dependencies)]
 
 use adaptive_strategy::risk::{
[31m-    DailyPnL, DrawdownCalculator, PortfolioRiskMetrics,
[m[31m-    PositionRiskMetrics, PnLTracker, RiskLimits,
[m[32m+    DailyPnL, DrawdownCalculator, PnLTracker, PortfolioRiskMetrics, PositionRiskMetrics, RiskLimits,
[m };
 use adaptive_strategy::PerformanceMetrics;
 use chrono::{NaiveDate, Utc};
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:56:
     average_price: f64,
     current_price: f64,
 ) -> Position {
[31m-    use uuid::Uuid;
[m     use chrono::Utc;
[32m+    use uuid::Uuid;
[m 
     let quantity_decimal = Decimal::from_f64_retain(quantity).unwrap();
     let avg_price_decimal = Decimal::from_f64_retain(average_price).unwrap();
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:90:
         max_portfolio_var: 0.02, // 2% VaR
         max_position_size: 0.10, // 10% max position
         max_leverage: 2.0,
[31m-        max_drawdown: 0.15, // 15% max drawdown
[m[31m-        max_daily_loss: 0.05, // 5% daily loss limit
[m[32m+        max_drawdown: 0.15,      // 15% max drawdown
[m[32m+        max_daily_loss: 0.05,    // 5% daily loss limit
[m         max_concentration: 0.25, // 25% max concentration
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:279:
 fn test_portfolio_value_aggregation() {
     // Test portfolio value calculation across multiple positions
     let positions = vec![
[31m-        create_test_position("AAPL", 100.0, 150.0, 160.0),  // $16,000 market value
[m[32m+        create_test_position("AAPL", 100.0, 150.0, 160.0), // $16,000 market value
[m         create_test_position("GOOGL", 50.0, 2800.0, 2900.0), // $145,000 market value
[31m-        create_test_position("MSFT", -75.0, 380.0, 370.0),   // $27,750 market value (short)
[m[32m+        create_test_position("MSFT", -75.0, 380.0, 370.0), // $27,750 market value (short)
[m     ];
 
     let total_value: f64 = positions
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:315:
         sharpe > 0.0,
         "Sharpe ratio should be positive for profitable strategy"
     );
[31m-    assert!(
[m[31m-        sharpe < 10.0,
[m[31m-        "Sharpe ratio should be realistic (< 10.0)"
[m[31m-    );
[m[32m+    assert!(sharpe < 10.0, "Sharpe ratio should be realistic (< 10.0)");
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:362:
         sortino > 0.0,
         "Sortino ratio should be positive for profitable strategy"
     );
[31m-    assert!(
[m[31m-        sortino < 15.0,
[m[31m-        "Sortino ratio should be realistic (< 15.0)"
[m[31m-    );
[m[32m+    assert!(sortino < 15.0, "Sortino ratio should be realistic (< 15.0)");
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:425:
 
     let ir = calculate_information_ratio(&portfolio_returns, &benchmark_returns);
 
[31m-    assert!(
[m[31m-        ir.is_none(),
[m[31m-        "IR should return None for mismatched lengths"
[m[31m-    );
[m[32m+    assert!(ir.is_none(), "IR should return None for mismatched lengths");
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:474:
 fn test_position_level_attribution() {
     // Test attribution at individual position level
     let positions = vec![
[31m-        create_test_position("AAPL", 100.0, 150.0, 160.0),   // +$1,000
[m[32m+        create_test_position("AAPL", 100.0, 150.0, 160.0), // +$1,000
[m         create_test_position("GOOGL", 50.0, 2800.0, 2850.0), // +$2,500
[31m-        create_test_position("MSFT", -75.0, 380.0, 370.0),   // +$750
[m[32m+        create_test_position("MSFT", -75.0, 380.0, 370.0), // +$750
[m     ];
 
     let total_pnl: f64 = positions
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:511:
 
     sector_pnl.insert("Technology", 5000.0); // AAPL, MSFT, GOOGL
     sector_pnl.insert("Healthcare", 1200.0); // Biotech stocks
[31m-    sector_pnl.insert("Finance", -800.0);    // Banking stocks
[m[32m+    sector_pnl.insert("Finance", -800.0); // Banking stocks
[m 
     let total_pnl: f64 = sector_pnl.values().sum();
 
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:847:
 
     let alert_triggered = current_drawdown >= limits.max_drawdown;
 
[31m-    assert!(
[m[31m-        !alert_triggered,
[m[31m-        "Should not trigger alert below threshold"
[m[31m-    );
[m[32m+    assert!(!alert_triggered, "Should not trigger alert below threshold");
[m 
     let excessive_drawdown = 0.18; // 18% drawdown
     let alert_triggered_high = excessive_drawdown >= limits.max_drawdown;
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:872:
 
     let alert_triggered = var_percentage >= limits.max_portfolio_var;
 
[31m-    assert!(
[m[31m-        !alert_triggered,
[m[31m-        "VaR should be within limits (1.5% < 2%)"
[m[31m-    );
[m[32m+    assert!(!alert_triggered, "VaR should be within limits (1.5% < 2%)");
[m }
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/adaptive-strategy/tests/performance_tracking_comprehensive.rs:886:
 fn test_concentration_risk_calculation() {
     // Test concentration risk (largest position / portfolio value)
     let positions = vec![
[31m-        create_test_position("AAPL", 100.0, 150.0, 160.0),  // $16,000
[m[32m+        create_test_position("AAPL", 100.0, 150.0, 160.0), // $16,000
[m         create_test_position("GOOGL", 50.0, 2800.0, 2900.0), // $145,000
[31m-        create_test_position("MSFT", 75.0, 380.0, 390.0),   // $29,250
[m[32m+        create_test_position("MSFT", 75.0, 380.0, 390.0),  // $29,250
[m     ];
 
     let portfolio_value: f64 = positions
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/lib.rs:79:
 };
 pub use strategy_tester::{
     PerformanceSnapshot, SignalType, Strategy, StrategyConfig, StrategyContext, StrategyResult,
[31m-    StrategyTester, TradingSignal, TradeRecord,
[m[32m+    StrategyTester, TradeRecord, TradingSignal,
[m };
 
 // Import events from trading_engine types
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:700:
         let excess_return = returns.total_return - benchmark_return;
 
         // Calculate beta (covariance / variance)
[31m-        let strategy_mean = strategy_returns.iter().sum::<Decimal>() / Decimal::from(strategy_returns.len());
[m[31m-        let benchmark_mean = benchmark_returns.iter().sum::<Decimal>() / Decimal::from(benchmark_returns.len());
[m[32m+        let strategy_mean =
[m[32m+            strategy_returns.iter().sum::<Decimal>() / Decimal::from(strategy_returns.len());
[m[32m+        let benchmark_mean =
[m[32m+            benchmark_returns.iter().sum::<Decimal>() / Decimal::from(benchmark_returns.len());
[m 
         let mut covariance = Decimal::ZERO;
         let mut benchmark_variance = Decimal::ZERO;
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:733:
             excess_returns.push(strategy_returns[i] - benchmark_returns[i]);
         }
 
[31m-        let excess_mean = excess_returns.iter().sum::<Decimal>() / Decimal::from(excess_returns.len());
[m[32m+        let excess_mean =
[m[32m+            excess_returns.iter().sum::<Decimal>() / Decimal::from(excess_returns.len());
[m         let mut tracking_variance = Decimal::ZERO;
         for excess_return in &excess_returns {
             let dev = excess_return - excess_mean;
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:766:
         }
 
         let up_capture = if !up_benchmark.is_empty() {
[31m-            let up_strategy_avg = up_strategy.iter().sum::<Decimal>() / Decimal::from(up_strategy.len());
[m[31m-            let up_benchmark_avg = up_benchmark.iter().sum::<Decimal>() / Decimal::from(up_benchmark.len());
[m[32m+            let up_strategy_avg =
[m[32m+                up_strategy.iter().sum::<Decimal>() / Decimal::from(up_strategy.len());
[m[32m+            let up_benchmark_avg =
[m[32m+                up_benchmark.iter().sum::<Decimal>() / Decimal::from(up_benchmark.len());
[m             if up_benchmark_avg > Decimal::ZERO {
                 up_strategy_avg / up_benchmark_avg
             } else {
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:778:
         };
 
         let down_capture = if !down_benchmark.is_empty() {
[31m-            let down_strategy_avg = down_strategy.iter().sum::<Decimal>() / Decimal::from(down_strategy.len());
[m[31m-            let down_benchmark_avg = down_benchmark.iter().sum::<Decimal>() / Decimal::from(down_benchmark.len());
[m[32m+            let down_strategy_avg =
[m[32m+                down_strategy.iter().sum::<Decimal>() / Decimal::from(down_strategy.len());
[m[32m+            let down_benchmark_avg =
[m[32m+                down_benchmark.iter().sum::<Decimal>() / Decimal::from(down_benchmark.len());
[m             if down_benchmark_avg < Decimal::ZERO {
                 down_strategy_avg / down_benchmark_avg
             } else {
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:1454:
             };
 
             // Count trades in this month
[31m-            let trade_count = self.trades.iter()
[m[32m+            let trade_count = self
[m[32m+                .trades
[m[32m+                .iter()
[m                 .filter(|t| {
                     let trade_month = (t.exit_time.year(), t.exit_time.month());
                     trade_month == (year, month)
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:1462:
                 .count() as u64;
 
             // Calculate win rate for month
[31m-            let month_trades: Vec<_> = self.trades.iter()
[m[32m+            let month_trades: Vec<_> = self
[m[32m+                .trades
[m[32m+                .iter()
[m                 .filter(|t| {
                     let trade_month = (t.exit_time.year(), t.exit_time.month());
                     trade_month == (year, month)
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:1469:
                 })
                 .collect();
 
[31m-            let winning_trades = month_trades.iter()
[m[32m+            let winning_trades = month_trades
[m[32m+                .iter()
[m                 .filter(|t| t.pnl > Decimal::ZERO)
                 .count();
 
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:1480:
             };
 
             // Use first day of month for timestamp
[31m-            let month_timestamp = chrono::Utc.with_ymd_and_hms(year, month, 1, 0, 0, 0)
[m[32m+            let month_timestamp = chrono::Utc
[m[32m+                .with_ymd_and_hms(year, month, 1, 0, 0, 0)
[m                 .single()
                 .unwrap_or_else(|| snapshots.first().unwrap().timestamp);
 
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:1511:
         let mut yearly_groups: BTreeMap<i32, Vec<&PerformanceSnapshot>> = BTreeMap::new();
 
         for snapshot in &self.snapshots {
[31m-            yearly_groups.entry(snapshot.timestamp.year()).or_default().push(snapshot);
[m[32m+            yearly_groups
[m[32m+                .entry(snapshot.timestamp.year())
[m[32m+                .or_default()
[m[32m+                .push(snapshot);
[m         }
 
         // Calculate metrics for each year
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:1532:
             };
 
             // Count trades in this year
[31m-            let trade_count = self.trades.iter()
[m[32m+            let trade_count = self
[m[32m+                .trades
[m[32m+                .iter()
[m                 .filter(|t| t.exit_time.year() == year)
                 .count() as u64;
 
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:1539:
             // Calculate win rate for year
[31m-            let year_trades: Vec<_> = self.trades.iter()
[m[32m+            let year_trades: Vec<_> = self
[m[32m+                .trades
[m[32m+                .iter()
[m                 .filter(|t| t.exit_time.year() == year)
                 .collect();
 
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/metrics.rs:1544:
[31m-            let winning_trades = year_trades.iter()
[m[31m-                .filter(|t| t.pnl > Decimal::ZERO)
[m[31m-                .count();
[m[32m+            let winning_trades = year_trades.iter().filter(|t| t.pnl > Decimal::ZERO).count();
[m 
             let win_rate = if !year_trades.is_empty() {
                 Decimal::from(winning_trades) / Decimal::from(year_trades.len())
Diff in /home/jgrusewski/Work/foxhunt/backtesting/src/strategy_runner.rs:13:
 use rust_decimal::Decimal;
 use trading_engine::types::events::MarketEvent;
 // Use canonical types from ML module and real ML registry
[31m-use ml::{Features, ModelPrediction, get_global_registry};
[m use chrono::{DateTime, Utc};
 use dashmap::DashMap;
[32m+use ml::{get_global_registry, Features, ModelPrediction};
[m use parking_lot::RwLock;
 use serde::{Deserialize, Serialize};
 use std::collections::HashMap;
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:24:
             max_connections,
         }
     }
[31m-    
[m[32m+
[m     fn acquire(&mut self) -> Option<MockConnection> {
         if self.available > 0 {
             self.available -= 1;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:48:
 /// Benchmark connection pool acquisition
 fn bench_connection_acquisition(c: &mut Criterion) {
     let mut group = c.benchmark_group("connection_acquisition");
[31m-    
[m[32m+
[m     for pool_size in [5, 10, 20, 50].iter() {
         group.bench_with_input(
             BenchmarkId::new("pool_size", pool_size),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:65:
             },
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:73:
 fn bench_query_execution(c: &mut Criterion) {
     let mut group = c.benchmark_group("query_execution");
     group.throughput(Throughput::Elements(1));
[31m-    
[m[32m+
[m     // Simulate query parsing and execution overhead
     group.bench_function("simple_select", |b| {
         b.iter(|| {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:80:
             // Simulate query parsing
             let query = "SELECT id, symbol, price FROM orders WHERE symbol = $1";
             let _params = vec!["BTCUSD"];
[31m-            
[m[32m+
[m             // Simulate execution (serialization + network)
             let _result_rows = 10;
             let overhead_ns = 100; // Simulated overhead
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:87:
[31m-            
[m[32m+
[m             std::thread::sleep(Duration::from_nanos(overhead_ns));
             black_box(query)
         });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:91:
     });
[31m-    
[m[32m+
[m     group.bench_function("parameterized_query", |b| {
         b.iter(|| {
             let query = "SELECT * FROM positions WHERE symbol = $1 AND quantity > $2";
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:96:
             let params = vec!["BTCUSD", "0.1"];
[31m-            
[m[32m+
[m             // Simulate parameter binding and execution
             let overhead_ns = 150;
             std::thread::sleep(Duration::from_nanos(overhead_ns));
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:101:
[31m-            
[m[32m+
[m             black_box((query, params))
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:105:
[31m-    
[m[32m+
[m     group.bench_function("insert_query", |b| {
         b.iter(|| {
[31m-            let query = "INSERT INTO trades (symbol, price, quantity, timestamp) VALUES ($1, $2, $3, $4)";
[m[32m+            let query =
[m[32m+                "INSERT INTO trades (symbol, price, quantity, timestamp) VALUES ($1, $2, $3, $4)";
[m             let params = vec!["BTCUSD", "50000", "1.0", "2024-01-01"];
[31m-            
[m[32m+
[m             // Simulate insert overhead
             let overhead_ns = 200;
             std::thread::sleep(Duration::from_nanos(overhead_ns));
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:114:
[31m-            
[m[32m+
[m             black_box((query, params))
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:118:
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:122:
 /// Benchmark transaction commit latency
 fn bench_transaction_latency(c: &mut Criterion) {
     let mut group = c.benchmark_group("transaction_latency");
[31m-    
[m[32m+
[m     group.bench_function("begin_commit", |b| {
         b.iter(|| {
             // Simulate BEGIN
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:129:
             let begin_overhead_ns = 50;
             std::thread::sleep(Duration::from_nanos(begin_overhead_ns));
[31m-            
[m[32m+
[m             // Simulate work (insert)
             let work_overhead_ns = 200;
             std::thread::sleep(Duration::from_nanos(work_overhead_ns));
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:135:
[31m-            
[m[32m+
[m             // Simulate COMMIT
             let commit_overhead_ns = 100;
             std::thread::sleep(Duration::from_nanos(commit_overhead_ns));
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:139:
[31m-            
[m[32m+
[m             black_box(())
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:143:
[31m-    
[m[32m+
[m     group.bench_function("rollback", |b| {
         b.iter(|| {
             // Simulate BEGIN
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:147:
             std::thread::sleep(Duration::from_nanos(50));
[31m-            
[m[32m+
[m             // Simulate ROLLBACK (typically faster than COMMIT)
             let rollback_overhead_ns = 50;
             std::thread::sleep(Duration::from_nanos(rollback_overhead_ns));
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:152:
[31m-            
[m[32m+
[m             black_box(())
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:156:
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:160:
 /// Benchmark pool saturation behavior
 fn bench_pool_saturation(c: &mut Criterion) {
     let mut group = c.benchmark_group("pool_saturation");
[31m-    
[m[32m+
[m     let pool_size = 10;
[31m-    
[m[32m+
[m     for concurrent_requests in [5, 10, 20, 50].iter() {
         group.bench_with_input(
             BenchmarkId::new("concurrent_requests", concurrent_requests),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:187:
             },
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:195:
 fn bench_batch_operations(c: &mut Criterion) {
     let mut group = c.benchmark_group("batch_operations");
     group.throughput(Throughput::Elements(100));
[31m-    
[m[32m+
[m     group.bench_function("batch_insert_100", |b| {
         b.iter(|| {
             // Simulate batch insert of 100 records
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:202:
             let batch_size = 100;
             let per_record_ns = 10; // Amortized overhead
[31m-            
[m[32m+
[m             for _ in 0..batch_size {
                 std::thread::sleep(Duration::from_nanos(per_record_ns));
             }
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:208:
[31m-            
[m[32m+
[m             black_box(batch_size)
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:212:
[31m-    
[m[32m+
[m     group.bench_function("individual_inserts_100", |b| {
         b.iter(|| {
             // Simulate 100 individual inserts
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:216:
             let count = 100;
             let per_insert_ns = 200; // Higher overhead per insert
[31m-            
[m[32m+
[m             for _ in 0..count {
                 std::thread::sleep(Duration::from_nanos(per_insert_ns));
             }
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:222:
[31m-            
[m[32m+
[m             black_box(count)
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:226:
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:230:
 /// Benchmark index lookup performance
 fn bench_index_lookups(c: &mut Criterion) {
     let mut group = c.benchmark_group("index_lookups");
[31m-    
[m[32m+
[m     // Simulate different table sizes
     for table_size in [1000, 10000, 100000, 1000000].iter() {
         group.bench_with_input(
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:242:
                     let depth = (size as f64).log2() as u64;
                     let per_level_ns = 10;
                     let total_ns = depth * per_level_ns;
[31m-                    
[m[32m+
[m                     std::thread::sleep(Duration::from_nanos(total_ns));
                     black_box(size)
                 });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:249:
             },
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:275:
 mod performance_validation {
     use super::*;
     use std::time::Instant;
[31m-    
[m[32m+
[m     #[test]
     fn validate_connection_acquisition_latency() {
         let mut pool = MockConnectionPool::new(10);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:282:
         let iterations = 1000;
[31m-        
[m[32m+
[m         let start = Instant::now();
         for _ in 0..iterations {
             let _conn = pool.acquire();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:287:
         }
         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         let avg_latency_us = elapsed.as_micros() / iterations;
         println!("✓ Average connection acquisition: {}μs", avg_latency_us);
[31m-        
[m[32m+
[m         // Target: <5ms = 5000μs
         assert!(
             avg_latency_us < 5000,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:297:
             avg_latency_us
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_pool_saturation_handling() {
         let mut pool = MockConnectionPool::new(10);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:304:
[31m-        
[m[32m+
[m         // Acquire all connections
         let mut connections = Vec::new();
         for _ in 0..10 {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:308:
             connections.push(pool.acquire().unwrap());
         }
[31m-        
[m[32m+
[m         // Attempt to acquire when saturated
         let start = Instant::now();
         let result = pool.acquire();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:314:
         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         assert!(result.is_none(), "Should return None when pool saturated");
         assert!(
             elapsed < Duration::from_micros(100),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:319:
             "Saturation check should be fast: {:?}",
             elapsed
         );
[31m-        
[m[32m+
[m         println!("✓ Pool saturation handled correctly in {:?}", elapsed);
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_batch_performance_improvement() {
         // Batch operations should show significant improvement over individual operations
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:329:
         let batch_size = 100;
[31m-        
[m[32m+
[m         // Simulate batch insert
         let start = Instant::now();
         for _ in 0..batch_size {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:334:
             std::thread::sleep(Duration::from_nanos(10)); // Amortized
         }
         let batch_time = start.elapsed();
[31m-        
[m[32m+
[m         // Simulate individual inserts
         let start = Instant::now();
         for _ in 0..10 {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:341:
             std::thread::sleep(Duration::from_nanos(200)); // Per-insert overhead
         }
         let individual_time = start.elapsed();
[31m-        
[m[32m+
[m         let batch_per_record = batch_time.as_nanos() / batch_size;
         let individual_per_record = individual_time.as_nanos() / 10;
[31m-        
[m[32m+
[m         println!(
             "✓ Batch: {}ns/record, Individual: {}ns/record, Improvement: {:.1}x",
             batch_per_record,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/database_performance.rs:351:
             individual_per_record,
             individual_per_record as f64 / batch_per_record as f64
         );
[31m-        
[m[32m+
[m         assert!(
             batch_per_record < individual_per_record,
             "Batch operations should be more efficient"
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:12:
 use std::time::{Duration, Instant};
 
 // Core trading types
[31m-use common::{Order, OrderId, OrderSide, OrderType, Position, Price, Quantity, Symbol};
[m[31m-use trading_engine::types::events::MarketEvent;
[m use chrono::Utc;
[32m+use common::{Order, OrderId, OrderSide, OrderType, Position, Price, Quantity, Symbol};
[m use rust_decimal::Decimal;
[32m+use trading_engine::types::events::MarketEvent;
[m 
 /// Trading pipeline stages
 #[derive(Debug, Clone)]
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:42:
             total_latency: Duration::ZERO,
         }
     }
[31m-    
[m[32m+
[m     fn record_stage(&mut self, stage: PipelineStage, duration: Duration) {
         self.stage_latencies.push((stage, duration));
     }
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:49:
[31m-    
[m[32m+
[m     fn finalize(&mut self, total: Duration) {
         self.total_latency = total;
     }
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:67:
             capital,
         }
     }
[31m-    
[m[32m+
[m     fn process_market_event(&mut self, event: &MarketEvent) -> Result<Option<Order>, String> {
         let mut metrics = PipelineMetrics::new();
         let pipeline_start = Instant::now();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:74:
[31m-        
[m[32m+
[m         // Stage 1: Market Data Ingestion
         let stage_start = Instant::now();
         let (price, _size) = match event {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:85:
             _ => return Ok(None),
         };
         metrics.record_stage(PipelineStage::MarketDataIngestion, stage_start.elapsed());
[31m-        
[m[32m+
[m         // Stage 2: Signal Generation (simplified momentum strategy)
         let stage_start = Instant::now();
         let should_buy = price.as_f64() > 50000.0; // Simplified signal
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:92:
         metrics.record_stage(PipelineStage::SignalGeneration, stage_start.elapsed());
[31m-        
[m[32m+
[m         if !should_buy {
             metrics.finalize(pipeline_start.elapsed());
             return Ok(None);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:97:
         }
[31m-        
[m[32m+
[m         // Stage 3: Risk Validation
         let stage_start = Instant::now();
         let position_size = Decimal::from(1);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:102:
         let position_value = price.as_f64() as i64 * position_size.mantissa();
         let max_position_value = (self.capital * Decimal::from_f64(0.1).unwrap()).mantissa();
[31m-        
[m[32m+
[m         if position_value > max_position_value {
             metrics.record_stage(PipelineStage::RiskValidation, stage_start.elapsed());
             metrics.finalize(pipeline_start.elapsed());
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:108:
             return Ok(None);
         }
         metrics.record_stage(PipelineStage::RiskValidation, stage_start.elapsed());
[31m-        
[m[32m+
[m         // Stage 4: Order Creation
         let stage_start = Instant::now();
         let order = Order {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:128:
             exchange_order_id: None,
         };
         metrics.record_stage(PipelineStage::OrderCreation, stage_start.elapsed());
[31m-        
[m[32m+
[m         // Stage 5: Order Submission (simulated)
         let stage_start = Instant::now();
         // Simulate network/broker submission
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:135:
         std::thread::sleep(Duration::from_nanos(100));
         metrics.record_stage(PipelineStage::OrderSubmission, stage_start.elapsed());
[31m-        
[m[32m+
[m         // Stage 6: Confirmation (simulated)
         let stage_start = Instant::now();
         // Simulate confirmation receipt
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:141:
         std::thread::sleep(Duration::from_nanos(50));
         metrics.record_stage(PipelineStage::Confirmation, stage_start.elapsed());
[31m-        
[m[32m+
[m         metrics.finalize(pipeline_start.elapsed());
[31m-        
[m[32m+
[m         Ok(Some(order))
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:151:
 fn bench_end_to_end_pipeline(c: &mut Criterion) {
     let mut group = c.benchmark_group("end_to_end_pipeline");
     group.throughput(Throughput::Elements(1));
[31m-    
[m[32m+
[m     let symbol = Symbol::new("BTCUSD".to_string());
     let capital = Decimal::from(100000);
[31m-    
[m[32m+
[m     group.bench_function("market_data_to_order", |b| {
         b.iter_batched(
             || {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:177:
             criterion::BatchSize::SmallInput,
         );
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:184:
 /// Benchmark pipeline under different loads
 fn bench_pipeline_load(c: &mut Criterion) {
     let mut group = c.benchmark_group("pipeline_load");
[31m-    
[m[32m+
[m     let symbol = Symbol::new("BTCUSD".to_string());
     let capital = Decimal::from(100000);
[31m-    
[m[32m+
[m     for events_per_sec in [100, 1000, 10000].iter() {
         group.bench_with_input(
             BenchmarkId::new("events_per_sec", events_per_sec),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:196:
                 b.iter(|| {
                     let mut pipeline = TradingPipeline::new(symbol.clone(), capital);
                     let mut orders = 0;
[31m-                    
[m[32m+
[m                     // Simulate event stream
                     for i in 0..rate {
                         let event = MarketEvent::Trade {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:208:
                             venue: None,
                             trade_id: None,
                         };
[31m-                        
[m[32m+
[m                         if let Ok(Some(_order)) = pipeline.process_market_event(&event) {
                             orders += 1;
                         }
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:215:
                     }
[31m-                    
[m[32m+
[m                     black_box((pipeline, orders))
                 });
             },
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:220:
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:226:
 /// Benchmark risk validation impact
 fn bench_risk_validation_overhead(c: &mut Criterion) {
     let mut group = c.benchmark_group("risk_validation_overhead");
[31m-    
[m[32m+
[m     let symbol = Symbol::new("BTCUSD".to_string());
[31m-    
[m[32m+
[m     group.bench_function("with_risk_checks", |b| {
         b.iter(|| {
             let capital = Decimal::from(100000);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:235:
             let position_size = Decimal::from(1);
             let price = 50000.0;
[31m-            
[m[32m+
[m             // Check position limits
             let position_value = price as i64 * position_size.mantissa();
             let max_position = (capital * Decimal::from_f64(0.1).unwrap()).mantissa();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:241:
             let risk_ok = position_value <= max_position;
[31m-            
[m[32m+
[m             // Check drawdown
             let current_value = capital;
             let peak_value = capital * Decimal::from_f64(1.1).unwrap();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:246:
             let drawdown = (peak_value - current_value) / peak_value;
             let max_drawdown = Decimal::from_f64(0.2).unwrap();
             let drawdown_ok = drawdown <= max_drawdown;
[31m-            
[m[32m+
[m             black_box((risk_ok, drawdown_ok))
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:253:
[31m-    
[m[32m+
[m     group.bench_function("without_risk_checks", |b| {
         b.iter(|| {
             // No risk validation
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:258:
             black_box(order_created)
         });
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:265:
 /// Benchmark order routing latency
 fn bench_order_routing(c: &mut Criterion) {
     let mut group = c.benchmark_group("order_routing");
[31m-    
[m[32m+
[m     let symbol = Symbol::new("BTCUSD".to_string());
     let order = Order {
         id: OrderId::new(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:283:
         updated_at: Utc::now(),
         exchange_order_id: None,
     };
[31m-    
[m[32m+
[m     group.bench_function("direct_routing", |b| {
         b.iter(|| {
             // Simulate direct market access
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:292:
             black_box(&order)
         });
     });
[31m-    
[m[32m+
[m     group.bench_function("smart_routing", |b| {
         b.iter(|| {
             // Simulate smart order routing (venue selection)
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:299:
             let venues = vec!["Binance", "Coinbase", "Kraken"];
             let best_venue = venues[0]; // Simplified selection
[31m-            
[m[32m+
[m             let routing_overhead_ns = 500;
             std::thread::sleep(Duration::from_nanos(routing_overhead_ns));
[31m-            
[m[32m+
[m             black_box((best_venue, &order))
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:308:
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:328:
 #[cfg(test)]
 mod end_to_end_validation {
     use super::*;
[31m-    
[m[32m+
[m     #[test]
     fn validate_full_pipeline_latency() {
         let symbol = Symbol::new("BTCUSD".to_string());
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:335:
         let mut pipeline = TradingPipeline::new(symbol.clone(), Decimal::from(100000));
[31m-        
[m[32m+
[m         let event = MarketEvent::Trade {
             symbol: symbol.clone(),
             price: Price::from_f64(50100.0).unwrap(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:343:
             venue: None,
             trade_id: None,
         };
[31m-        
[m[32m+
[m         let iterations = 1000;
         let mut latencies = Vec::new();
[31m-        
[m[32m+
[m         for _ in 0..iterations {
             let start = Instant::now();
             let _ = pipeline.process_market_event(&event);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:353:
             latencies.push(start.elapsed());
         }
[31m-        
[m[32m+
[m         // Calculate percentiles
         latencies.sort();
         let p50 = latencies[iterations / 2];
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:359:
         let p95 = latencies[(iterations * 95) / 100];
         let p99 = latencies[(iterations * 99) / 100];
[31m-        
[m[31m-        println!("✓ Pipeline latency - p50: {:?}, p95: {:?}, p99: {:?}", p50, p95, p99);
[m[31m-        
[m[32m+
[m[32m+        println!(
[m[32m+            "✓ Pipeline latency - p50: {:?}, p95: {:?}, p99: {:?}",
[m[32m+            p50, p95, p99
[m[32m+        );
[m[32m+
[m         // Target: p99 <200μs
         assert!(
             p99 < Duration::from_micros(200),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:368:
             p99
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_risk_validation_overhead() {
         let capital = Decimal::from(100000);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:375:
         let iterations = 10000;
[31m-        
[m[32m+
[m         let start = Instant::now();
         for i in 0..iterations {
             let position_size = Decimal::from(1);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:380:
             let price = 50000.0 + (i % 100) as f64;
[31m-            
[m[32m+
[m             let position_value = price as i64 * position_size.mantissa();
             let max_position = (capital * Decimal::from_f64(0.1).unwrap()).mantissa();
             let _risk_ok = position_value <= max_position;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:385:
         }
         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         let avg_overhead_ns = elapsed.as_nanos() / iterations;
[31m-        
[m[32m+
[m         println!("✓ Risk validation overhead: {}ns", avg_overhead_ns);
[31m-        
[m[32m+
[m         // Target: <10μs = 10000ns
         assert!(
             avg_overhead_ns < 10000,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:396:
             avg_overhead_ns
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_throughput_capacity() {
         let symbol = Symbol::new("BTCUSD".to_string());
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:403:
         let mut pipeline = TradingPipeline::new(symbol.clone(), Decimal::from(100000));
[31m-        
[m[32m+
[m         let events = 10000;
         let start = Instant::now();
[31m-        
[m[32m+
[m         for i in 0..events {
             let event = MarketEvent::Trade {
                 symbol: symbol.clone(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:415:
                 venue: None,
                 trade_id: None,
             };
[31m-            
[m[32m+
[m             let _ = pipeline.process_market_event(&event);
         }
[31m-        
[m[32m+
[m         let elapsed = start.elapsed();
         let events_per_sec = (events as f64 / elapsed.as_secs_f64()) as u64;
[31m-        
[m[32m+
[m         println!(
             "✓ Pipeline throughput: {} events/sec ({} events in {:?})",
             events_per_sec, events, elapsed
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/end_to_end.rs:428:
         );
[31m-        
[m[32m+
[m         // Should handle at least 1000 events/sec
         assert!(
             events_per_sec >= 1000,
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:16:
 //!
 //! This profiling completes the 30% → 100% performance validation requirement.
 
[31m-use criterion::{
[m[31m-    black_box, criterion_group, criterion_main, BenchmarkId, Criterion, Throughput,
[m[31m-};
[m[32m+use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
[m use std::sync::Arc;
 use std::time::{Duration, Instant};
 use tokio::runtime::Runtime;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:25:
 
 // Trading engine components
[31m-use common::{OrderSide, OrderStatus, OrderId};
[m[32m+use chrono::Utc;
[m[32m+use common::{OrderId, OrderSide, OrderStatus};
[m use rust_decimal::Decimal;
[32m+use std::collections::HashMap;
[m use trading_engine::trading_operations::{
[31m-    ExecutionResult, LiquidityFlag, OrderType, TradingOperations, TradingOrder, TimeInForce,
[m[32m+    ExecutionResult, LiquidityFlag, OrderType, TimeInForce, TradingOperations, TradingOrder,
[m };
[31m-use chrono::Utc;
[m[31m-use std::collections::HashMap;
[m 
 /// Performance metrics for each stage of the trading cycle
 #[derive(Debug, Clone)]
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:106:
 }
 
 /// Helper to create a TradingOrder with all required fields
[31m-fn create_order(order_type: OrderType, side: OrderSide, quantity: Decimal, price: Decimal) -> TradingOrder {
[m[32m+fn create_order(
[m[32m+    order_type: OrderType,
[m[32m+    side: OrderSide,
[m[32m+    quantity: Decimal,
[m[32m+    price: Decimal,
[m[32m+) -> TradingOrder {
[m     TradingOrder {
         id: OrderId::new(),
         symbol: "BTCUSD".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:127:
 }
 
 /// Helper to create an ExecutionResult with all required fields
[31m-fn create_execution(order_id: OrderId, quantity: Decimal, price: Decimal, liquidity_flag: LiquidityFlag) -> ExecutionResult {
[m[32m+fn create_execution(
[m[32m+    order_id: OrderId,
[m[32m+    quantity: Decimal,
[m[32m+    price: Decimal,
[m[32m+    liquidity_flag: LiquidityFlag,
[m[32m+) -> ExecutionResult {
[m     ExecutionResult {
         order_id,
         symbol: "BTCUSD".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:154:
                 OrderType::Limit,
                 OrderSide::Buy,
                 Decimal::new(1, 0),
[31m-                Decimal::new(50000, 0)
[m[32m+                Decimal::new(50000, 0),
[m             );
 
             let result = trading_ops.submit_order(order).await;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:170:
                 OrderType::Market,
                 OrderSide::Sell,
                 Decimal::new(1, 0),
[31m-                Decimal::ZERO
[m[32m+                Decimal::ZERO,
[m             );
 
             let result = trading_ops.submit_order(order).await;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:197:
                 OrderType::Limit,
                 OrderSide::Buy,
                 Decimal::new(1, 0),
[31m-                Decimal::new(50000, 0)
[m[32m+                Decimal::new(50000, 0),
[m             );
             let order_id = order.id.clone();
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:211:
                 order_id,
                 Decimal::new(1, 0),
                 Decimal::new(50000, 0),
[31m-                LiquidityFlag::Maker
[m[32m+                LiquidityFlag::Maker,
[m             );
 
             let result = trading_ops.process_execution(execution).await;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:227:
                 OrderType::Limit,
                 OrderSide::Buy,
                 Decimal::new(10, 0),
[31m-                Decimal::new(50000, 0)
[m[32m+                Decimal::new(50000, 0),
[m             );
             let order_id = order.id.clone();
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:241:
                 order_id,
                 Decimal::new(3, 0),
                 Decimal::new(50000, 0),
[31m-                LiquidityFlag::Taker
[m[32m+                LiquidityFlag::Taker,
[m             );
 
             let result = trading_ops.process_execution(execution).await;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:272:
                 OrderType::Limit,
                 OrderSide::Buy,
                 Decimal::new(1, 0),
[31m-                Decimal::new(50000, 0)
[m[32m+                Decimal::new(50000, 0),
[m             );
             let order_id = order.id.clone();
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:288:
                 order_id,
                 Decimal::new(1, 0),
                 Decimal::new(50000, 0),
[31m-                LiquidityFlag::Maker
[m[32m+                LiquidityFlag::Maker,
[m             );
 
             trading_ops
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:313:
                 OrderType::Market,
                 OrderSide::Sell,
                 Decimal::new(1, 0),
[31m-                Decimal::ZERO
[m[32m+                Decimal::ZERO,
[m             );
             let order_id = order.id.clone();
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:326:
                 order_id,
                 Decimal::new(1, 0),
                 Decimal::new(50000, 0),
[31m-                LiquidityFlag::Taker
[m[32m+                LiquidityFlag::Taker,
[m             );
 
             trading_ops
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:360:
 
                     for i in 0..count {
                         let order = create_order(
[31m-                            if i % 2 == 0 { OrderType::Limit } else { OrderType::Market },
[m[31m-                            if i % 2 == 0 { OrderSide::Buy } else { OrderSide::Sell },
[m[32m+                            if i % 2 == 0 {
[m[32m+                                OrderType::Limit
[m[32m+                            } else {
[m[32m+                                OrderType::Market
[m[32m+                            },
[m[32m+                            if i % 2 == 0 {
[m[32m+                                OrderSide::Buy
[m[32m+                            } else {
[m[32m+                                OrderSide::Sell
[m[32m+                            },
[m                             Decimal::new(1, 0),
[31m-                            Decimal::new(50000 + i as i64, 0)
[m[32m+                            Decimal::new(50000 + i as i64, 0),
[m                         );
 
                         let _ = trading_ops.submit_order(order).await;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:419:
                 OrderType::Limit,
                 OrderSide::Buy,
                 Decimal::new(1, 0),
[31m-                Decimal::new(50000 + i as i64, 0)
[m[32m+                Decimal::new(50000 + i as i64, 0),
[m             );
             let order_id = order.id.clone();
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:435:
                 order_id,
                 Decimal::new(1, 0),
                 Decimal::new(50000, 0),
[31m-                LiquidityFlag::Maker
[m[32m+                LiquidityFlag::Maker,
[m             );
 
             trading_ops
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/full_trading_cycle.rs:518:
         for i in 0..total_orders {
             let order = create_order(
                 OrderType::Limit,
[31m-                if i % 2 == 0 { OrderSide::Buy } else { OrderSide::Sell },
[m[32m+                if i % 2 == 0 {
[m[32m+                    OrderSide::Buy
[m[32m+                } else {
[m[32m+                    OrderSide::Sell
[m[32m+                },
[m                 Decimal::new(1, 0),
[31m-                Decimal::new(50000 + (i % 100) as i64, 0)
[m[32m+                Decimal::new(50000 + (i % 100) as i64, 0),
[m             );
 
             let _ = trading_ops.submit_order(order).await;
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:45:
             histograms: Arc::new(Mutex::new(HashMap::new())),
         }
     }
[31m-    
[m[32m+
[m     fn observe_counter(&self, name: String, value: f64) {
         let mut counters = self.counters.lock().unwrap();
         *counters.entry(name).or_insert(0.0) += value;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:52:
     }
[31m-    
[m[32m+
[m     fn observe_gauge(&self, name: String, value: f64) {
         let mut gauges = self.gauges.lock().unwrap();
         gauges.insert(name, value);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:57:
     }
[31m-    
[m[32m+
[m     fn observe_histogram(&self, name: String, value: f64) {
         let mut histograms = self.histograms.lock().unwrap();
         histograms.entry(name).or_insert_with(Vec::new).push(value);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:62:
     }
[31m-    
[m[32m+
[m     fn metric_count(&self) -> usize {
         self.counters.lock().unwrap().len()
             + self.gauges.lock().unwrap().len()
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:72:
 fn bench_observation_overhead(c: &mut Criterion) {
     let mut group = c.benchmark_group("observation_overhead");
     group.throughput(Throughput::Elements(1));
[31m-    
[m[32m+
[m     let registry = MetricsRegistry::new();
[31m-    
[m[32m+
[m     group.bench_function("counter_increment", |b| {
         b.iter(|| {
             registry.observe_counter("requests_total".to_string(), 1.0);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:81:
             black_box(&registry)
         });
     });
[31m-    
[m[32m+
[m     group.bench_function("gauge_set", |b| {
         b.iter(|| {
             registry.observe_gauge("queue_size".to_string(), 42.0);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:88:
             black_box(&registry)
         });
     });
[31m-    
[m[32m+
[m     group.bench_function("histogram_observe", |b| {
         b.iter(|| {
             registry.observe_histogram("request_duration_ms".to_string(), 15.5);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:95:
             black_box(&registry)
         });
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:102:
 /// Benchmark registry lookup performance
 fn bench_registry_lookup(c: &mut Criterion) {
     let mut group = c.benchmark_group("registry_lookup");
[31m-    
[m[32m+
[m     for num_metrics in [10, 100, 1000, 10000].iter() {
         group.bench_with_input(
             BenchmarkId::new("metrics", num_metrics),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:109:
             num_metrics,
             |b, &count| {
                 let registry = MetricsRegistry::new();
[31m-                
[m[32m+
[m                 // Pre-populate registry
                 for i in 0..count {
                     registry.observe_counter(format!("metric_{}", i), 1.0);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:116:
                 }
[31m-                
[m[32m+
[m                 b.iter(|| {
                     // Lookup random metric
                     let metric_name = format!("metric_{}", count / 2);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:124:
             },
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:131:
 /// Benchmark label cardinality impact
 fn bench_label_cardinality(c: &mut Criterion) {
     let mut group = c.benchmark_group("label_cardinality");
[31m-    
[m[32m+
[m     for num_labels in [1, 5, 10, 20].iter() {
         group.bench_with_input(
             BenchmarkId::new("labels", num_labels),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:142:
                     for i in 0..labels {
                         label_map.insert(format!("label_{}", i), format!("value_{}", i));
                     }
[31m-                    
[m[32m+
[m                     let observation = MetricObservation {
                         name: "request_latency".to_string(),
                         labels: label_map,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:149:
                         value: 42.0,
                         timestamp: 0,
                     };
[31m-                    
[m[32m+
[m                     black_box(observation)
                 });
             },
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:156:
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:162:
 /// Benchmark metric aggregation
 fn bench_aggregation(c: &mut Criterion) {
     let mut group = c.benchmark_group("metric_aggregation");
[31m-    
[m[32m+
[m     for sample_count in [100, 1000, 10000].iter() {
         group.throughput(Throughput::Elements(*sample_count as u64));
         group.bench_with_input(
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:178:
                         // Calculate percentiles
                         let mut sorted = samples.clone();
                         sorted.sort_by(|a, b| a.partial_cmp(b).unwrap());
[31m-                        
[m[32m+
[m                         let p50 = sorted[count / 2];
                         let p95 = sorted[(count * 95) / 100];
                         let p99 = sorted[(count * 99) / 100];
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:185:
[31m-                        
[m[32m+
[m                         black_box((p50, p95, p99))
                     },
                     criterion::BatchSize::SmallInput,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:190:
             },
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:197:
 /// Benchmark concurrent metric updates
 fn bench_concurrent_updates(c: &mut Criterion) {
     let mut group = c.benchmark_group("concurrent_updates");
[31m-    
[m[32m+
[m     for num_threads in [1, 2, 4, 8].iter() {
         group.bench_with_input(
             BenchmarkId::new("threads", num_threads),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:206:
                 b.iter(|| {
                     let registry = Arc::new(MetricsRegistry::new());
                     let mut handles = vec![];
[31m-                    
[m[32m+
[m                     for t in 0..threads {
                         let reg = Arc::clone(&registry);
                         let handle = std::thread::spawn(move || {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:216:
                         });
                         handles.push(handle);
                     }
[31m-                    
[m[32m+
[m                     for handle in handles {
                         handle.join().unwrap();
                     }
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:223:
[31m-                    
[m[32m+
[m                     black_box(registry)
                 });
             },
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:227:
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:233:
 /// Benchmark histogram bucket operations
 fn bench_histogram_buckets(c: &mut Criterion) {
     let mut group = c.benchmark_group("histogram_buckets");
[31m-    
[m[32m+
[m     for num_buckets in [10, 50, 100].iter() {
         group.bench_with_input(
             BenchmarkId::new("buckets", num_buckets),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:242:
                 b.iter(|| {
                     // Simulate finding appropriate bucket
                     let value = 42.5;
[31m-                    let bucket_boundaries: Vec<f64> = (0..buckets)
[m[31m-                        .map(|i| (i as f64) * 10.0)
[m[31m-                        .collect();
[m[31m-                    
[m[32m+                    let bucket_boundaries: Vec<f64> =
[m[32m+                        (0..buckets).map(|i| (i as f64) * 10.0).collect();
[m[32m+
[m                     let bucket = bucket_boundaries
                         .iter()
                         .position(|&b| value < b)
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:252:
                         .unwrap_or(buckets - 1);
[31m-                    
[m[32m+
[m                     black_box(bucket)
                 });
             },
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:257:
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:282:
 mod metrics_validation {
     use super::*;
     use std::time::Instant;
[31m-    
[m[32m+
[m     #[test]
     fn validate_observation_overhead() {
         let registry = MetricsRegistry::new();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:289:
         let iterations = 100000;
[31m-        
[m[32m+
[m         let start = Instant::now();
         for i in 0..iterations {
             registry.observe_counter("test_counter".to_string(), i as f64);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:294:
         }
         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         let avg_overhead_ns = elapsed.as_nanos() / iterations;
         let avg_overhead_us = avg_overhead_ns / 1000;
[31m-        
[m[31m-        println!("✓ Average observation overhead: {}ns ({}μs)", avg_overhead_ns, avg_overhead_us);
[m[31m-        
[m[32m+
[m[32m+        println!(
[m[32m+            "✓ Average observation overhead: {}ns ({}μs)",
[m[32m+            avg_overhead_ns, avg_overhead_us
[m[32m+        );
[m[32m+
[m         // Target: <5μs = 5000ns
         assert!(
             avg_overhead_ns < 5000,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:306:
             avg_overhead_ns
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_registry_scalability() {
         let registry = MetricsRegistry::new();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:313:
[31m-        
[m[32m+
[m         // Add many metrics
         for i in 0..10000 {
             registry.observe_counter(format!("metric_{}", i), 1.0);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:317:
         }
[31m-        
[m[32m+
[m         // Measure lookup time with large registry
         let start = Instant::now();
         for _ in 0..1000 {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:322:
             registry.observe_counter("metric_5000".to_string(), 1.0);
         }
         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         let avg_lookup_ns = elapsed.as_nanos() / 1000;
[31m-        
[m[32m+
[m         println!(
             "✓ Registry with {} metrics, avg lookup: {}ns",
             registry.metric_count(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:331:
             avg_lookup_ns
         );
[31m-        
[m[32m+
[m         // Should maintain O(1) performance
         assert!(
             avg_lookup_ns < 10000,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:338:
             avg_lookup_ns
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_label_cardinality() {
         let max_labels = 20;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:345:
         let iterations = 10000;
[31m-        
[m[32m+
[m         let start = Instant::now();
         for _ in 0..iterations {
             let mut labels = HashMap::new();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:350:
             for i in 0..max_labels {
                 labels.insert(format!("label_{}", i), format!("value_{}", i));
             }
[31m-            
[m[32m+
[m             let _observation = MetricObservation {
                 name: "test_metric".to_string(),
                 labels,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:359:
             };
         }
         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         let avg_time_ns = elapsed.as_nanos() / iterations;
[31m-        
[m[32m+
[m         println!(
             "✓ {} labels per metric, avg creation time: {}ns",
             max_labels, avg_time_ns
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:368:
         );
[31m-        
[m[32m+
[m         // Should handle high cardinality efficiently
         assert!(
             avg_time_ns < 50000,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:374:
             avg_time_ns
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_aggregation_performance() {
         let sample_count = 10000;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:381:
         let samples: Vec<f64> = (0..sample_count).map(|i| i as f64).collect();
[31m-        
[m[32m+
[m         let start = Instant::now();
[31m-        
[m[32m+
[m         let mut sorted = samples.clone();
         sorted.sort_by(|a, b| a.partial_cmp(b).unwrap());
[31m-        
[m[32m+
[m         let _p50 = sorted[sample_count / 2];
         let _p95 = sorted[(sample_count * 95) / 100];
         let _p99 = sorted[(sample_count * 99) / 100];
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/metrics_overhead.rs:391:
[31m-        
[m[32m+
[m         let elapsed = start.elapsed();
[31m-        
[m[31m-        println!(
[m[31m-            "✓ Aggregated {} samples in {:?}",
[m[31m-            sample_count, elapsed
[m[31m-        );
[m[31m-        
[m[32m+
[m[32m+        println!("✓ Aggregated {} samples in {:?}", sample_count, elapsed);
[m[32m+
[m         // Target: <100μs for aggregation
         assert!(
             elapsed < Duration::from_micros(100),
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:9:
 //! Critical for real-time market data and order flow.
 
 use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
[31m-use std::sync::{Arc, atomic::{AtomicU64, Ordering}};
[m[32m+use std::sync::{
[m[32m+    atomic::{AtomicU64, Ordering},
[m[32m+    Arc,
[m[32m+};
[m use std::time::Duration;
 
 /// Mock streaming message
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:48:
             sent_count: Arc::new(AtomicU64::new(0)),
         }
     }
[31m-    
[m[32m+
[m     fn send(&mut self, message: StreamMessage) -> Result<(), &'static str> {
         if self.buffer.len() < self.capacity {
             self.buffer.push(message);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:58:
             Err("Channel full")
         }
     }
[31m-    
[m[32m+
[m     fn receive(&mut self) -> Option<StreamMessage> {
         if !self.buffer.is_empty() {
             Some(self.buffer.remove(0))
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:66:
             None
         }
     }
[31m-    
[m[32m+
[m     fn len(&self) -> usize {
         self.buffer.len()
     }
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:75:
 /// Benchmark message throughput
 fn bench_message_throughput(c: &mut Criterion) {
     let mut group = c.benchmark_group("message_throughput");
[31m-    
[m[32m+
[m     for payload_size in [64, 256, 1024, 4096].iter() {
         group.throughput(Throughput::Bytes(*payload_size as u64));
         group.bench_with_input(
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:96:
             },
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:104:
 fn bench_stream_latency(c: &mut Criterion) {
     let mut group = c.benchmark_group("stream_latency");
     group.throughput(Throughput::Elements(1));
[31m-    
[m[32m+
[m     group.bench_function("send_receive_latency", |b| {
         b.iter_batched(
             || StreamChannel::new(1000),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:117:
             criterion::BatchSize::SmallInput,
         );
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:124:
 /// Benchmark backpressure handling
 fn bench_backpressure(c: &mut Criterion) {
     let mut group = c.benchmark_group("backpressure_handling");
[31m-    
[m[32m+
[m     for buffer_size in [100, 1000, 10000].iter() {
         group.bench_with_input(
             BenchmarkId::new("buffer_size", buffer_size),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:135:
                     |mut channel| {
                         let mut successful = 0;
                         let mut failed = 0;
[31m-                        
[m[32m+
[m                         // Try to send more than capacity
                         for i in 0..(size * 2) {
                             let msg = StreamMessage::new(i as u64, 256);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:144:
                                 Err(_) => failed += 1,
                             }
                         }
[31m-                        
[m[32m+
[m                         black_box((successful, failed, channel))
                     },
                     criterion::BatchSize::SmallInput,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:152:
             },
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:159:
 /// Benchmark concurrent streams
 fn bench_concurrent_streams(c: &mut Criterion) {
     let mut group = c.benchmark_group("concurrent_streams");
[31m-    
[m[32m+
[m     for num_streams in [10, 50, 100, 200].iter() {
         group.bench_with_input(
             BenchmarkId::new("streams", num_streams),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:167:
             |b, &streams| {
                 b.iter(|| {
                     let mut channels: Vec<StreamChannel> = Vec::new();
[31m-                    
[m[32m+
[m                     // Create multiple streams
                     for _ in 0..streams {
                         channels.push(StreamChannel::new(1000));
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:174:
                     }
[31m-                    
[m[32m+
[m                     // Send messages to all streams
                     for channel in &mut channels {
                         for i in 0..10 {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:180:
                             let _ = channel.send(msg);
                         }
                     }
[31m-                    
[m[32m+
[m                     black_box(channels)
                 });
             },
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:187:
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:193:
 /// Benchmark message serialization overhead
 fn bench_serialization(c: &mut Criterion) {
     let mut group = c.benchmark_group("message_serialization");
[31m-    
[m[32m+
[m     for payload_size in [64, 256, 1024].iter() {
         group.throughput(Throughput::Bytes(*payload_size as u64));
         group.bench_with_input(
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:209:
             },
         );
     }
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:216:
 /// Benchmark flow control
 fn bench_flow_control(c: &mut Criterion) {
     let mut group = c.benchmark_group("flow_control");
[31m-    
[m[32m+
[m     group.bench_function("windowed_send", |b| {
         b.iter(|| {
             let mut channel = StreamChannel::new(1000);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:223:
             let window_size = 100;
[31m-            
[m[32m+
[m             // Send in windows with flow control
             for window in 0..10 {
                 // Send window
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:229:
                     let msg = StreamMessage::new(window * window_size + i, 256);
                     let _ = channel.send(msg);
                 }
[31m-                
[m[32m+
[m                 // Receive window (simulate acknowledgment)
                 for _ in 0..window_size {
                     let _ = channel.receive();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:236:
                 }
             }
[31m-            
[m[32m+
[m             black_box(channel)
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:242:
[31m-    
[m[32m+
[m     group.bench_function("continuous_send", |b| {
         b.iter(|| {
             let mut channel = StreamChannel::new(1000);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:246:
[31m-            
[m[32m+
[m             // Send continuously
             for i in 0..1000 {
                 let msg = StreamMessage::new(i, 256);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:250:
                 let _ = channel.send(msg);
             }
[31m-            
[m[32m+
[m             black_box(channel)
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:256:
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:279:
 mod throughput_validation {
     use super::*;
     use std::time::Instant;
[31m-    
[m[32m+
[m     #[test]
     fn validate_message_throughput() {
         let mut channel = StreamChannel::new(100000);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:286:
         let message_count = 100000;
[31m-        
[m[32m+
[m         let start = Instant::now();
         for i in 0..message_count {
             let msg = StreamMessage::new(i, 256);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:291:
             channel.send(msg).unwrap();
         }
         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         let messages_per_sec = (message_count as f64 / elapsed.as_secs_f64()) as u64;
         println!("✓ Throughput: {} msg/sec", messages_per_sec);
[31m-        
[m[32m+
[m         // Target: >10,000 msg/sec
         assert!(
             messages_per_sec > 10000,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:302:
             messages_per_sec
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_stream_latency() {
         let mut channel = StreamChannel::new(1000);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:309:
         let iterations = 10000;
[31m-        
[m[32m+
[m         let start = Instant::now();
         for i in 0..iterations {
             let msg = StreamMessage::new(i, 256);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:315:
             let _ = channel.receive();
         }
         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         let avg_latency_us = elapsed.as_micros() / iterations;
         println!("✓ Average stream latency: {}μs", avg_latency_us);
[31m-        
[m[32m+
[m         // Target: p99 <1ms = 1000μs
         assert!(
             avg_latency_us < 1000,
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:326:
             avg_latency_us
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_backpressure_handling() {
         let capacity = 1000;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:333:
         let mut channel = StreamChannel::new(capacity);
[31m-        
[m[32m+
[m         let mut successful = 0;
         let mut failed = 0;
[31m-        
[m[32m+
[m         // Attempt to send 2x capacity
         for i in 0..(capacity * 2) {
             let msg = StreamMessage::new(i as u64, 256);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:343:
                 Err(_) => failed += 1,
             }
         }
[31m-        
[m[31m-        assert_eq!(successful, capacity, "Should accept exactly capacity messages");
[m[32m+
[m[32m+        assert_eq!(
[m[32m+            successful, capacity,
[m[32m+            "Should accept exactly capacity messages"
[m[32m+        );
[m         assert_eq!(failed, capacity, "Should reject messages beyond capacity");
[31m-        
[m[32m+
[m         println!(
             "✓ Backpressure: accepted {}, rejected {} (capacity: {})",
             successful, failed, capacity
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:353:
         );
     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_concurrent_streams() {
         let num_streams = 100;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:359:
         let msgs_per_stream = 100;
[31m-        
[m[32m+
[m         let start = Instant::now();
         let mut channels: Vec<StreamChannel> = Vec::new();
[31m-        
[m[32m+
[m         for _ in 0..num_streams {
             let mut channel = StreamChannel::new(1000);
             for i in 0..msgs_per_stream {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:369:
             }
             channels.push(channel);
         }
[31m-        
[m[32m+
[m         let elapsed = start.elapsed();
         let total_messages = num_streams * msgs_per_stream;
[31m-        
[m[32m+
[m         println!(
             "✓ {} streams, {} total messages in {:?}",
             num_streams, total_messages, elapsed
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/streaming_throughput.rs:379:
         );
[31m-        
[m[32m+
[m         assert!(
             elapsed < Duration::from_secs(1),
             "Concurrent stream creation too slow: {:?}",
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:12:
 use std::time::Duration;
 
 // Core trading types
[31m-use common::{Order, OrderId, OrderSide, OrderType, Position, Price, Quantity, Symbol, TimeInForce, HftTimestamp};
[m[31m-use trading_engine::types::events::MarketEvent;
[m use chrono::Utc;
[31m-use uuid::Uuid;
[m[31m-use serde_json::json;
[m[31m-use rust_decimal::Decimal;
[m[32m+use common::{
[m[32m+    HftTimestamp, Order, OrderId, OrderSide, OrderType, Position, Price, Quantity, Symbol,
[m[32m+    TimeInForce,
[m[32m+};
[m use rust_decimal::prelude::FromPrimitive;
[32m+use rust_decimal::Decimal;
[m[32m+use serde_json::json;
[m[32m+use trading_engine::types::events::MarketEvent;
[m[32m+use uuid::Uuid;
[m 
 /// Benchmark order creation and validation
 fn bench_order_creation(c: &mut Criterion) {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:25:
     let mut group = c.benchmark_group("order_creation");
[31m-    
[m[32m+
[m     let symbol = Symbol::new("BTCUSD".to_string());
     let price = Price::from_f64(50000.0).unwrap();
     let quantity = Quantity::from_f64(1.0).unwrap();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:30:
[31m-    
[m[32m+
[m     group.bench_function("create_limit_order", |b| {
         b.iter(|| {
             let order = Order {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:73:
             black_box(order)
         });
     });
[31m-    
[m[32m+
[m     group.bench_function("create_market_order", |b| {
         b.iter(|| {
             let order = Order {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:119:
             black_box(order)
         });
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:127:
 fn bench_market_event_processing(c: &mut Criterion) {
     let mut group = c.benchmark_group("market_event_processing");
     group.throughput(Throughput::Elements(1));
[31m-    
[m[32m+
[m     let symbol = Symbol::new("BTCUSD".to_string());
     let price = Price::from_f64(50000.0).unwrap();
     let size = Quantity::from_f64(1.0).unwrap();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:134:
[31m-    
[m[32m+
[m     group.bench_function("trade_event_creation", |b| {
         b.iter(|| {
             let event = MarketEvent::Trade {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:146:
             black_box(event)
         });
     });
[31m-    
[m[32m+
[m     group.bench_function("quote_event_creation", |b| {
         b.iter(|| {
             let event = MarketEvent::Quote {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:161:
             black_box(event)
         });
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:168:
 /// Benchmark position calculations
 fn bench_position_calculations(c: &mut Criterion) {
     let mut group = c.benchmark_group("position_calculations");
[31m-    
[m[32m+
[m     let now = Utc::now();
     let mut position = Position {
         id: Uuid::new_v4(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:188:
         notional_value: Decimal::from(500000),
         margin_requirement: Decimal::from(50000),
     };
[31m-    
[m[32m+
[m     group.bench_function("update_market_value", |b| {
         b.iter(|| {
             let new_price = Decimal::from(50100);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:195:
             position.market_value = position.quantity * new_price;
[31m-            position.unrealized_pnl = position.market_value - (position.quantity * position.average_price);
[m[32m+            position.unrealized_pnl =
[m[32m+                position.market_value - (position.quantity * position.average_price);
[m             black_box(())
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:200:
[31m-    
[m[32m+
[m     group.bench_function("calculate_pnl", |b| {
         b.iter(|| {
             let current_price = Decimal::from(50100);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:205:
             black_box(pnl)
         });
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:213:
 fn bench_order_book_updates(c: &mut Criterion) {
     let mut group = c.benchmark_group("order_book_updates");
     group.throughput(Throughput::Elements(1));
[31m-    
[m[32m+
[m     // Simulate order book level updates
     let mut bids: Vec<(Price, Quantity)> = Vec::with_capacity(100);
     let mut asks: Vec<(Price, Quantity)> = Vec::with_capacity(100);
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:220:
[31m-    
[m[32m+
[m     for i in 0..100 {
         bids.push((
             Price::from_f64(50000.0 - i as f64).unwrap(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:241:
             black_box(())
         });
     });
[31m-    
[m[32m+
[m     group.bench_function("best_bid_ask", |b| {
         b.iter(|| {
             let best_bid = bids.first();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:249:
             black_box((best_bid, best_ask))
         });
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:257:
 fn bench_event_queue(c: &mut Criterion) {
     let mut group = c.benchmark_group("event_queue");
     group.throughput(Throughput::Elements(1));
[31m-    
[m[32m+
[m     use std::collections::VecDeque;
     let mut queue: VecDeque<MarketEvent> = VecDeque::with_capacity(1000);
[31m-    
[m[32m+
[m     let symbol = Symbol::new("BTCUSD".to_string());
     let event = MarketEvent::Trade {
         symbol: symbol.clone(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:271:
         venue: None,
         trade_id: None,
     };
[31m-    
[m[32m+
[m     group.bench_function("push_event", |b| {
         b.iter(|| {
             queue.push_back(event.clone());
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:278:
             black_box(())
         });
     });
[31m-    
[m[32m+
[m     group.bench_function("pop_event", |b| {
         b.iter(|| {
             if queue.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:288:
             black_box(popped)
         });
     });
[31m-    
[m[32m+
[m     group.bench_function("push_pop_cycle", |b| {
         b.iter(|| {
             queue.push_back(event.clone());
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:296:
             black_box(popped)
         });
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:304:
 fn bench_order_pipeline(c: &mut Criterion) {
     let mut group = c.benchmark_group("order_pipeline");
     group.measurement_time(Duration::from_secs(15));
[31m-    
[m[32m+
[m     let symbol = Symbol::new("BTCUSD".to_string());
     let price = Price::from_f64(50000.0).unwrap();
     let quantity = Quantity::from_f64(1.0).unwrap();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:311:
[31m-    
[m[32m+
[m     group.bench_function("end_to_end_order_processing", |b| {
         b.iter(|| {
             // 1. Create order
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:364:
             black_box((order, is_valid, risk_ok))
         });
     });
[31m-    
[m[32m+
[m     group.finish();
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:390:
 mod latency_validation {
     use super::*;
     use std::time::Instant;
[31m-    
[m[32m+
[m     #[test]
     fn validate_order_creation_latency() {
         let symbol = Symbol::new("BTCUSD".to_string());
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:397:
         let price = Price::from_f64(50000.0).unwrap();
         let quantity = Quantity::from_f64(1.0).unwrap();
[31m-        
[m[32m+
[m         let iterations = 10000;
         let start = Instant::now();
[31m-        
[m[32m+
[m         for _ in 0..iterations {
             let _order = Order {
                 // Core Identity
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:442:
                 metadata: json!({}),
             };
         }
[31m-        
[m[32m+
[m         let elapsed = start.elapsed();
         let avg_latency_us = elapsed.as_micros() / iterations;
[31m-        
[m[32m+
[m         println!("✓ Average order creation: {}μs", avg_latency_us);
[31m-        assert!(avg_latency_us < 50, "Order creation exceeds 50μs target: {}μs", avg_latency_us);
[m[32m+        assert!(
[m[32m+            avg_latency_us < 50,
[m[32m+            "Order creation exceeds 50μs target: {}μs",
[m[32m+            avg_latency_us
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     #[test]
     fn validate_event_queue_latency() {
         use std::collections::VecDeque;
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:456:
         let mut queue: VecDeque<MarketEvent> = VecDeque::with_capacity(1000);
[31m-        
[m[32m+
[m         let symbol = Symbol::new("BTCUSD".to_string());
         let event = MarketEvent::Trade {
             symbol: symbol.clone(),
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:465:
             venue: None,
             trade_id: None,
         };
[31m-        
[m[32m+
[m         let iterations = 100000;
         let start = Instant::now();
[31m-        
[m[32m+
[m         for _ in 0..iterations {
             queue.push_back(event.clone());
             let _ = queue.pop_front();
Diff in /home/jgrusewski/Work/foxhunt/benches/comprehensive/trading_latency.rs:475:
         }
[31m-        
[m[32m+
[m         let elapsed = start.elapsed();
         let avg_latency_ns = elapsed.as_nanos() / iterations;
[31m-        
[m[32m+
[m         println!("✓ Average queue push/pop: {}ns", avg_latency_ns);
[31m-        assert!(avg_latency_ns < 1000, "Queue operations exceed 1μs target: {}ns", avg_latency_ns);
[m[32m+        assert!(
[m[32m+            avg_latency_ns < 1000,
[m[32m+            "Queue operations exceed 1μs target: {}ns",
[m[32m+            avg_latency_ns
[m[32m+        );
[m     }
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/lockfree/atomic_ops.rs:162:
                 SystemTime::now()
                     .duration_since(UNIX_EPOCH)
                     .unwrap_or_default()
[31m-                    .as_nanos() as u64
[m[32m+                    .as_nanos() as u64,
[m             ),
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/lockfree/atomic_ops.rs:189:
     pub fn operations_per_second(&self) -> f64 {
         let ops = self.operations_count.load(Ordering::Relaxed);
         let start_ns = self.start_time_ns.load(Ordering::Relaxed);
[31m-        
[m[32m+
[m         let now_ns = SystemTime::now()
             .duration_since(UNIX_EPOCH)
             .unwrap_or_default()
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/lockfree/atomic_ops.rs:196:
             .as_nanos() as u64;
[31m-        
[m[32m+
[m         let elapsed_ns = now_ns.saturating_sub(start_ns);
         let elapsed_secs = elapsed_ns as f64 / 1_000_000_000.0;
[31m-        
[m[32m+
[m         if elapsed_secs > 0.0 {
             ops as f64 / elapsed_secs
         } else {
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/lockfree/atomic_ops.rs:301:
                 .duration_since(UNIX_EPOCH)
                 .unwrap_or_default()
                 .as_nanos() as u64,
[31m-            Ordering::Relaxed
[m[32m+            Ordering::Relaxed,
[m         );
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/lockfree/mod.rs:48:
 pub mod small_batch_ring;
 
 // Re-export key types for external use
[32m+pub use atomic_ops::{AtomicMetrics, SequenceGenerator};
[m pub use ring_buffer::LockFreeRingBuffer;
 pub use small_batch_ring::{BatchMode, SmallBatchOrdersSoA, SmallBatchRing};
[31m-pub use atomic_ops::{AtomicMetrics, SequenceGenerator};
[m 
 // High-performance shared memory channel implementation
 use std::sync::atomic::{AtomicU64, Ordering};
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/simd/mod.rs:1903:
 
             // Test sum with various sizes
             let test_cases = vec![
[31m-                vec![1.0, 2.0, 3.0, 4.0], // 4 elements
[m[32m+                vec![1.0, 2.0, 3.0, 4.0],                     // 4 elements
[m                 vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], // 8 elements
[31m-                vec![1.0; 100], // 100 elements
[m[32m+                vec![1.0; 100],                               // 100 elements
[m             ];
 
             for prices in test_cases {
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/simd/mod.rs:1913:
                 let simd_sum = price_ops.sum_aligned(&aligned_prices);
                 let expected_sum: f64 = prices.iter().sum();
 
[31m-                assert!((simd_sum - expected_sum).abs() < 1e-10,
[m[31m-                       "SIMD sum {} should match expected {}", simd_sum, expected_sum);
[m[32m+                assert!(
[m[32m+                    (simd_sum - expected_sum).abs() < 1e-10,
[m[32m+                    "SIMD sum {} should match expected {}",
[m[32m+                    simd_sum,
[m[32m+                    expected_sum
[m[32m+                );
[m             }
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:281:
                 // Prevents overflow after 8.5+ hours uptime (>18.4 quintillion cycles at 3GHz)
                 let cycles_u128 = cycles as u128;
                 let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
[31m-                
[m[32m+
[m                 // Overflow detection: warn if approaching u64::MAX (unlikely but possible)
                 if nanos_u128 > u64::MAX as u128 {
                     tracing::error!(
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:367:
                 // Use u128 to handle large cycle counts without overflow
                 let cycles_u128 = cycles2 as u128;
                 let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
[31m-                
[m[32m+
[m                 if nanos_u128 > u64::MAX as u128 {
                     return Err(anyhow!(
                         "TSC calculation overflow: cycles={}, freq={}, result={}",
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:374:
[31m-                        cycles2, freq, nanos_u128
[m[32m+                        cycles2,
[m[32m+                        freq,
[m[32m+                        nanos_u128
[m                     ));
                 }
                 nanos_u128 as u64
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:496:
 ///
 /// **FIX 4 (UNRESTRICTED CALIBRATION ACCESS - CRITICAL):**
 /// This function is now restricted and logged to prevent timing manipulation attacks.
[31m-/// 
[m[32m+///
[m /// **Access Control Measures:**
 /// - Audit logging of all calibration attempts
 /// - Rate limiting prevents DoS via repeated calibration
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:506:
 /// - PUBLIC function allowed any module to recalibrate system timing
 /// - No authentication or authorization checks
 /// - **IMPACT:** Market manipulation, order sequencing attacks, regulatory violations
[31m-/// 
[m[32m+///
[m /// **Production Recommendations:**
 /// - Monitor calibration attempts in production environments
 /// - Alert on calibration during trading hours
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:516:
     tracing::warn!(
         "TSC calibration initiated - this is a privileged operation that affects system-wide timing"
     );
[31m-    
[m[32m+
[m     calibrate_tsc_with_config(&TimingSafetyConfig::default())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:875:
         // Simulate 3GHz CPU running for 10 hours
         const THREE_GHZ: u64 = 3_000_000_000;
         const TEN_HOURS_CYCLES: u64 = THREE_GHZ * 60 * 60 * 10;
[31m-        
[m[32m+
[m         // Set up test TSC frequency
         TSC_FREQUENCY.store(THREE_GHZ, Ordering::Release);
         TSC_VALIDATED.store(true, Ordering::Release);
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:882:
[31m-        
[m[32m+
[m         // Calculate expected nanoseconds using fixed u128 arithmetic
[31m-        let expected_nanos = ((TEN_HOURS_CYCLES as u128 * 1_000_000_000u128) 
[m[31m-                              / THREE_GHZ as u128) as u64;
[m[31m-        
[m[32m+        let expected_nanos =
[m[32m+            ((TEN_HOURS_CYCLES as u128 * 1_000_000_000u128) / THREE_GHZ as u128) as u64;
[m[32m+
[m         // Verify calculation doesn't overflow
         assert_eq!(expected_nanos, 36_000_000_000_000); // 10 hours in nanoseconds
[31m-        
[m[32m+
[m         // Old buggy calculation would have overflowed:
         // cycles.saturating_mul(1_000_000_000) saturates at u64::MAX
         // Then dividing by freq gives incorrect small value
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:893:
         let buggy_result = TEN_HOURS_CYCLES.saturating_mul(1_000_000_000) / THREE_GHZ;
[31m-        
[m[32m+
[m         // Buggy calculation produces wrong result (saturates)
         assert_ne!(buggy_result, expected_nanos);
         assert!(buggy_result < expected_nanos);
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:898:
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_race_condition_fix_atomic_ordering() {
         // Test FIX 2: Race condition in atomic operations
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:905:
         // Verify we're using Acquire ordering for loads
[31m-        
[m[32m+
[m         // Set frequency with Release ordering
         TSC_FREQUENCY.store(2_500_000_000, Ordering::Release);
[31m-        
[m[32m+
[m         // Load with Acquire ordering (happens-before relationship guaranteed)
         let freq = TSC_FREQUENCY.load(Ordering::Acquire);
[31m-        
[m[32m+
[m         assert_eq!(freq, 2_500_000_000);
[31m-        
[m[32m+
[m         // Verify calibration uses proper ordering
         TSC_VALIDATED.store(true, Ordering::Release);
         assert!(TSC_VALIDATED.load(Ordering::Acquire));
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:918:
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_reliability_score_underflow_protection() {
         // Test FIX 3: Reliability score underflow protection
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:954:
         // Reset for future tests
         TSC_RELIABILITY_SCORE.store(100, Ordering::SeqCst);
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_calibration_access_control_logging() -> Result<()> {
         // Test FIX 4: Calibration access control and audit logging
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:961:
[31m-        
[m[32m+
[m         // Reset calibration state
         reset_tsc_calibration();
[31m-        
[m[32m+
[m         // Attempt calibration (will log security audit)
         let result = calibrate_tsc();
[31m-        
[m[32m+
[m         // In test environment, calibration may fail due to system load
         // The important part is that it attempts with proper logging
         match result {
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:977:
                 // Calibration can fail in test environments - that's OK
                 // The security fix is about logging and access control
                 eprintln!("Calibration failed in test environment: {}", e);
[31m-            }
[m[32m+            },
[m         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_overflow_boundary_conditions() -> Result<()> {
         // Test boundary conditions around u64::MAX overflow
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:995:
         TSC_VALIDATED.store(true, Ordering::Release);
 
         // Test with overflow: OVERFLOW_CYCLES * 1B overflows u64
[31m-        let correct_nanos = ((OVERFLOW_CYCLES as u128 * 1_000_000_000u128)
[m[31m-                              / FREQ as u128) as u64;
[m[32m+        let correct_nanos = ((OVERFLOW_CYCLES as u128 * 1_000_000_000u128) / FREQ as u128) as u64;
[m 
         // Verify calculation using u128 is correct
         assert_eq!(correct_nanos, OVERFLOW_CYCLES);
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:1012:
 
         Ok(())
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_high_frequency_cpu_extended_runtime() -> Result<()> {
         // Test with high-end CPU (5 GHz) running for 24 hours
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:1019:
         const FIVE_GHZ: u64 = 5_000_000_000;
         const TWENTYFOUR_HOURS_CYCLES: u64 = FIVE_GHZ * 60 * 60 * 24;
[31m-        
[m[32m+
[m         TSC_FREQUENCY.store(FIVE_GHZ, Ordering::Release);
[31m-        
[m[32m+
[m         // Calculate using fixed u128 arithmetic
[31m-        let correct_nanos = ((TWENTYFOUR_HOURS_CYCLES as u128 * 1_000_000_000u128) 
[m[31m-                             / FIVE_GHZ as u128) as u64;
[m[31m-        
[m[32m+        let correct_nanos =
[m[32m+            ((TWENTYFOUR_HOURS_CYCLES as u128 * 1_000_000_000u128) / FIVE_GHZ as u128) as u64;
[m[32m+
[m         // Verify 24 hours = 86,400 seconds = 86,400,000,000,000 nanoseconds
         assert_eq!(correct_nanos, 86_400_000_000_000);
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_concurrent_calibration_safety() -> Result<()> {
         // Test that concurrent calibration attempts are safe
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:1037:
[31m-        use std::sync::Arc;
[m         use std::sync::atomic::AtomicBool;
[31m-        
[m[32m+        use std::sync::Arc;
[m[32m+
[m         reset_tsc_calibration();
[31m-        
[m[32m+
[m         let running = Arc::new(AtomicBool::new(true));
         let running_clone = running.clone();
[31m-        
[m[32m+
[m         // Spawn thread that attempts calibration
         let handle = thread::spawn(move || {
             let _ = calibrate_tsc();
Diff in /home/jgrusewski/Work/foxhunt/benches/../trading_engine/src/timing.rs:1048:
             running_clone.store(false, Ordering::SeqCst);
         });
[31m-        
[m[32m+
[m         // Wait for thread to complete
         handle.join().expect("Thread panicked");
[31m-        
[m[32m+
[m         // Verify running flag was set (thread completed)
         assert!(!running.load(Ordering::SeqCst));
[31m-        
[m[32m+
[m         Ok(())
     }
 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/benches/grpc_streaming_load.rs:3:
 //! Validates HTTP/2 streaming optimizations from Wave 67 Agent 3 under load.
 //! Run with: cargo bench --bench grpc_streaming_load
 
[31m-use criterion::{black_box, criterion_group, criterion_main, Criterion, BenchmarkId, Throughput};
[m[31m-use std::time::Duration;
[m[31m-use std::sync::Arc;
[m[32m+use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
[m use std::sync::atomic::{AtomicU64, Ordering};
[32m+use std::sync::Arc;
[m[32m+use std::time::Duration;
[m 
 /// Stream type classification matching Wave 67 Agent 3
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
Diff in /home/jgrusewski/Work/foxhunt/benches/grpc_streaming_load.rs:13:
 pub enum StreamType {
[31m-    HighFrequency,    // 100K buffer, target >50K msg/sec
[m[31m-    MediumFrequency,  // 10K buffer, target >10K msg/sec
[m[31m-    LowFrequency,     // 1K buffer, target >1K msg/sec
[m[32m+    HighFrequency,   // 100K buffer, target >50K msg/sec
[m[32m+    MediumFrequency, // 10K buffer, target >10K msg/sec
[m[32m+    LowFrequency,    // 1K buffer, target >1K msg/sec
[m }
 
 impl StreamType {
Diff in /home/jgrusewski/Work/foxhunt/benches/grpc_streaming_load.rs:27:
 
     pub fn target_throughput(&self) -> u64 {
         match self {
[31m-            StreamType::HighFrequency => 50_000,    // 50K msg/sec
[m[31m-            StreamType::MediumFrequency => 10_000,   // 10K msg/sec
[m[31m-            StreamType::LowFrequency => 1_000,       // 1K msg/sec
[m[32m+            StreamType::HighFrequency => 50_000,   // 50K msg/sec
[m[32m+            StreamType::MediumFrequency => 10_000, // 10K msg/sec
[m[32m+            StreamType::LowFrequency => 1_000,     // 1K msg/sec
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/benches/grpc_streaming_load.rs:124:
     ];
 
     for (name, window_size) in window_sizes {
[31m-        group.bench_with_input(
[m[31m-            BenchmarkId::from_parameter(name),
[m[31m-            &window_size,
[m[31m-            |b, &ws| {
[m[31m-                // Simulate flow control operations
[m[31m-                let counter = Arc::new(AtomicU64::new(0));
[m[32m+        group.bench_with_input(BenchmarkId::from_parameter(name), &window_size, |b, &ws| {
[m[32m+            // Simulate flow control operations
[m[32m+            let counter = Arc::new(AtomicU64::new(0));
[m 
[31m-                b.iter(|| {
[m[31m-                    let mut bytes_sent = 0u64;
[m[31m-                    while bytes_sent < ws {
[m[31m-                        bytes_sent += 1024; // Send 1KB chunks
[m[31m-                        counter.fetch_add(1, Ordering::Relaxed);
[m[32m+            b.iter(|| {
[m[32m+                let mut bytes_sent = 0u64;
[m[32m+                while bytes_sent < ws {
[m[32m+                    bytes_sent += 1024; // Send 1KB chunks
[m[32m+                    counter.fetch_add(1, Ordering::Relaxed);
[m 
[31m-                        // Simulate window update check
[m[31m-                        if bytes_sent % (ws / 10) == 0 {
[m[31m-                            black_box(counter.load(Ordering::Relaxed));
[m[31m-                        }
[m[32m+                    // Simulate window update check
[m[32m+                    if bytes_sent % (ws / 10) == 0 {
[m[32m+                        black_box(counter.load(Ordering::Relaxed));
[m                     }
[31m-                });
[m[31m-            },
[m[31m-        );
[m[32m+                }
[m[32m+            });
[m[32m+        });
[m     }
 
     group.finish();
Diff in /home/jgrusewski/Work/foxhunt/benches/grpc_streaming_load.rs:154:
 fn bench_backpressure_handling(c: &mut Criterion) {
     let mut group = c.benchmark_group("backpressure_handling");
 
[31m-    for stream_type in [
[m[31m-        StreamType::HighFrequency,
[m[31m-        StreamType::MediumFrequency,
[m[31m-    ] {
[m[32m+    for stream_type in [StreamType::HighFrequency, StreamType::MediumFrequency] {
[m         let buffer_size = stream_type.buffer_size();
 
         group.bench_with_input(
Diff in /home/jgrusewski/Work/foxhunt/benches/grpc_streaming_load.rs:200:
             BenchmarkId::from_parameter(sample_size),
             &sample_size,
             |b, &size| {
[31m-                let mut samples: Vec<u64> = (0..size)
[m[31m-                    .map(|i| (i * 1000 + i % 100) as u64)
[m[31m-                    .collect();
[m[32m+                let mut samples: Vec<u64> =
[m[32m+                    (0..size).map(|i| (i * 1000 + i % 100) as u64).collect();
[m 
                 b.iter(|| {
                     samples.sort_unstable();
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/common/src/thresholds.rs:10:
 
 /// Risk management thresholds
 pub mod risk {
[31m-    
[m 
     /// Breach severity warning threshold (percentage of limit)
     /// Used when position is at 80-90% of limit
Diff in /home/jgrusewski/Work/foxhunt/common/src/thresholds.rs:73:
 
 /// Performance and timing constants
 pub mod performance {
[31m-    
[m 
     /// Maximum latency for HFT critical path operations (nanoseconds)
     pub const MAX_CRITICAL_PATH_LATENCY_NS: u64 = 14;
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:30:
 
 #[test]
 fn test_retry_strategy_calculate_delay_exponential_basic() {
[31m-    let strategy = RetryStrategy::Exponential { base_delay_ms: 100, max_delay_ms: 10000 };
[m[32m+    let strategy = RetryStrategy::Exponential {
[m[32m+        base_delay_ms: 100,
[m[32m+        max_delay_ms: 10000,
[m[32m+    };
[m 
     // Attempt 0: 100 * 2^0 = 100ms (with jitter 90-100ms)
     let delay_0 = strategy.calculate_delay(0).expect("should have delay");
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:47:
 
 #[test]
 fn test_retry_strategy_calculate_delay_exponential_capping() {
[31m-    let strategy = RetryStrategy::Exponential { base_delay_ms: 100, max_delay_ms: 1000 };
[m[32m+    let strategy = RetryStrategy::Exponential {
[m[32m+        base_delay_ms: 100,
[m[32m+        max_delay_ms: 1000,
[m[32m+    };
[m 
     // Attempt 10: 100 * 2^10 = 102400ms, but capped at min(10) = 100 * 2^10, then max_delay_ms = 1000ms
     let delay_10 = strategy.calculate_delay(10).expect("should have delay");
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:98:
 
 #[test]
 fn test_common_error_severity_database() {
[31m-    let err = CommonError::Database(
[m[31m-        common::database::DatabaseError::PoolExhausted
[m[31m-    );
[m[32m+    let err = CommonError::Database(common::database::DatabaseError::PoolExhausted);
[m     assert_eq!(err.severity(), ErrorSeverity::Critical);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:124:
 
 #[test]
 fn test_common_error_severity_timeout() {
[31m-    let err = CommonError::Timeout { actual_ms: 5000, max_ms: 3000 };
[m[32m+    let err = CommonError::Timeout {
[m[32m+        actual_ms: 5000,
[m[32m+        max_ms: 3000,
[m[32m+    };
[m     assert_eq!(err.severity(), ErrorSeverity::Error);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:215:
 
 #[test]
 fn test_common_error_retry_strategy_database() {
[31m-    let err = CommonError::Database(
[m[31m-        common::database::DatabaseError::PoolExhausted
[m[31m-    );
[m[31m-    assert!(matches!(err.retry_strategy(), RetryStrategy::Exponential { .. }));
[m[32m+    let err = CommonError::Database(common::database::DatabaseError::PoolExhausted);
[m[32m+    assert!(matches!(
[m[32m+        err.retry_strategy(),
[m[32m+        RetryStrategy::Exponential { .. }
[m[32m+    ));
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:229:
 
 #[test]
 fn test_common_error_retry_strategy_timeout() {
[31m-    let err = CommonError::Timeout { actual_ms: 5000, max_ms: 3000 };
[m[32m+    let err = CommonError::Timeout {
[m[32m+        actual_ms: 5000,
[m[32m+        max_ms: 3000,
[m[32m+    };
[m     assert!(matches!(err.retry_strategy(), RetryStrategy::Linear { .. }));
 }
 
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:256:
 #[test]
 fn test_common_error_retry_strategy_service_rate_limit() {
     let err = CommonError::service(ErrorCategory::RateLimit, "rate limited");
[31m-    assert!(matches!(err.retry_strategy(), RetryStrategy::Exponential { .. }));
[m[32m+    assert!(matches!(
[m[32m+        err.retry_strategy(),
[m[32m+        RetryStrategy::Exponential { .. }
[m[32m+    ));
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:280:
 
 #[test]
 fn test_retry_strategy_exponential_zero_attempt() {
[31m-    let strategy = RetryStrategy::Exponential { base_delay_ms: 50, max_delay_ms: 5000 };
[m[32m+    let strategy = RetryStrategy::Exponential {
[m[32m+        base_delay_ms: 50,
[m[32m+        max_delay_ms: 5000,
[m[32m+    };
[m     let delay = strategy.calculate_delay(0).expect("should have delay");
     // 50 * 2^0 = 50ms with jitter (45-50ms)
     assert!(delay.as_millis() >= 45 && delay.as_millis() <= 50);
Diff in /home/jgrusewski/Work/foxhunt/common/tests/error_retry_strategy_tests.rs:288:
 
 #[test]
 fn test_retry_strategy_exponential_large_max_delay() {
[31m-    let strategy = RetryStrategy::Exponential { base_delay_ms: 100, max_delay_ms: 100000 };
[m[32m+    let strategy = RetryStrategy::Exponential {
[m[32m+        base_delay_ms: 100,
[m[32m+        max_delay_ms: 100000,
[m[32m+    };
[m     // Attempt 5: 100 * 2^5 = 3200ms (no capping)
     let delay_5 = strategy.calculate_delay(5).expect("should have delay");
     assert!(delay_5.as_millis() >= 2880 && delay_5.as_millis() <= 3200);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:10:
 //!
 //! Coverage: 70+ test cases, 1,500+ lines targeting all 60+ public types
 
[32m+use chrono::{Datelike, Utc};
[m use common::types::*;
 use rust_decimal::Decimal;
[31m-use std::str::FromStr;
[m[31m-use chrono::{Utc, Datelike};
[m use serde_json;
[32m+use std::str::FromStr;
[m use std::thread;
 
 // =============================================================================
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:322:
     }
 
     // Check all IDs are unique
[31m-    let unique_count = all_ids.iter().collect::<std::collections::HashSet<_>>().len();
[m[32m+    let unique_count = all_ids
[m[32m+        .iter()
[m[32m+        .collect::<std::collections::HashSet<_>>()
[m[32m+        .len();
[m     assert_eq!(unique_count, 1000);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:543:
     assert_eq!(Exchange::from_str("NasDaQ").unwrap(), Exchange::NASDAQ); // Case insensitive
 
     // Unknown exchange
[31m-    assert_eq!(Exchange::from_str("UNKNOWN_EXCHANGE").unwrap(), Exchange::UNKNOWN);
[m[32m+    assert_eq!(
[m[32m+        Exchange::from_str("UNKNOWN_EXCHANGE").unwrap(),
[m[32m+        Exchange::UNKNOWN
[m[32m+    );
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:670:
     let mut order = Order::limit(symbol, OrderSide::Buy, qty, price);
 
     // First fill: 30 shares at $150.50
[31m-    order.fill(Quantity::from_f64(30.0).unwrap(), Price::from_f64(150.5).unwrap()).unwrap();
[m[32m+    order
[m[32m+        .fill(
[m[32m+            Quantity::from_f64(30.0).unwrap(),
[m[32m+            Price::from_f64(150.5).unwrap(),
[m[32m+        )
[m[32m+        .unwrap();
[m 
     // Second fill: 40 shares at $150.25
[31m-    order.fill(Quantity::from_f64(40.0).unwrap(), Price::from_f64(150.25).unwrap()).unwrap();
[m[32m+    order
[m[32m+        .fill(
[m[32m+            Quantity::from_f64(40.0).unwrap(),
[m[32m+            Price::from_f64(150.25).unwrap(),
[m[32m+        )
[m[32m+        .unwrap();
[m 
     // Third fill: 30 shares at $150.75
[31m-    order.fill(Quantity::from_f64(30.0).unwrap(), Price::from_f64(150.75).unwrap()).unwrap();
[m[32m+    order
[m[32m+        .fill(
[m[32m+            Quantity::from_f64(30.0).unwrap(),
[m[32m+            Price::from_f64(150.75).unwrap(),
[m[32m+        )
[m[32m+        .unwrap();
[m 
     assert!(order.is_filled());
 
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:711:
 
     assert_eq!(order.fill_percentage(), 0.0);
 
[31m-    order.fill(Quantity::from_f64(25.0).unwrap(), price).unwrap();
[m[32m+    order
[m[32m+        .fill(Quantity::from_f64(25.0).unwrap(), price)
[m[32m+        .unwrap();
[m     assert!((order.fill_percentage() - 25.0).abs() < 0.01);
 
[31m-    order.fill(Quantity::from_f64(25.0).unwrap(), price).unwrap();
[m[32m+    order
[m[32m+        .fill(Quantity::from_f64(25.0).unwrap(), price)
[m[32m+        .unwrap();
[m     assert!((order.fill_percentage() - 50.0).abs() < 0.01);
 
[31m-    order.fill(Quantity::from_f64(50.0).unwrap(), price).unwrap();
[m[32m+    order
[m[32m+        .fill(Quantity::from_f64(50.0).unwrap(), price)
[m[32m+        .unwrap();
[m     assert!((order.fill_percentage() - 100.0).abs() < 0.01);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:731:
 
     assert!(!order.is_partially_filled());
 
[31m-    order.fill(Quantity::from_f64(50.0).unwrap(), price).unwrap();
[m[32m+    order
[m[32m+        .fill(Quantity::from_f64(50.0).unwrap(), price)
[m[32m+        .unwrap();
[m     assert!(order.is_partially_filled());
 
[31m-    order.fill(Quantity::from_f64(50.0).unwrap(), price).unwrap();
[m[32m+    order
[m[32m+        .fill(Quantity::from_f64(50.0).unwrap(), price)
[m[32m+        .unwrap();
[m     assert!(!order.is_partially_filled()); // Now fully filled
 }
 
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:741:
 #[test]
 fn test_position_creation() {
[31m-    let pos = Position::new("AAPL".to_string(), Decimal::from(100), Decimal::from_str("150.50").unwrap());
[m[32m+    let pos = Position::new(
[m[32m+        "AAPL".to_string(),
[m[32m+        Decimal::from(100),
[m[32m+        Decimal::from_str("150.50").unwrap(),
[m[32m+    );
[m 
     assert_eq!(pos.symbol, "AAPL");
     assert_eq!(pos.quantity, Decimal::from(100));
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:751:
 
 #[test]
 fn test_position_is_long() {
[31m-    let pos = Position::new("AAPL".to_string(), Decimal::from(100), Decimal::from_str("150.0").unwrap());
[m[32m+    let pos = Position::new(
[m[32m+        "AAPL".to_string(),
[m[32m+        Decimal::from(100),
[m[32m+        Decimal::from_str("150.0").unwrap(),
[m[32m+    );
[m     assert!(pos.is_long());
     assert!(!pos.is_short());
 }
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:758:
 
 #[test]
 fn test_position_is_short() {
[31m-    let pos = Position::new("AAPL".to_string(), Decimal::from(-50), Decimal::from_str("150.0").unwrap());
[m[32m+    let pos = Position::new(
[m[32m+        "AAPL".to_string(),
[m[32m+        Decimal::from(-50),
[m[32m+        Decimal::from_str("150.0").unwrap(),
[m[32m+    );
[m     assert!(pos.is_short());
     assert!(!pos.is_long());
 }
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:765:
 
 #[test]
 fn test_position_unrealized_pnl_long() {
[31m-    let mut pos = Position::new("AAPL".to_string(), Decimal::from(100), Decimal::from_str("150.0").unwrap());
[m[32m+    let mut pos = Position::new(
[m[32m+        "AAPL".to_string(),
[m[32m+        Decimal::from(100),
[m[32m+        Decimal::from_str("150.0").unwrap(),
[m[32m+    );
[m 
     // Price goes up to $160
     pos.calculate_unrealized_pnl(Decimal::from_str("160.0").unwrap());
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:776:
 
 #[test]
 fn test_position_unrealized_pnl_short() {
[31m-    let mut pos = Position::new("AAPL".to_string(), Decimal::from(-100), Decimal::from_str("150.0").unwrap());
[m[32m+    let mut pos = Position::new(
[m[32m+        "AAPL".to_string(),
[m[32m+        Decimal::from(-100),
[m[32m+        Decimal::from_str("150.0").unwrap(),
[m[32m+    );
[m 
     // Price goes up to $160 (bad for short)
     pos.calculate_unrealized_pnl(Decimal::from_str("160.0").unwrap());
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:787:
 
 #[test]
 fn test_position_roi_percentage() {
[31m-    let mut pos = Position::new("AAPL".to_string(), Decimal::from(100), Decimal::from_str("150.0").unwrap());
[m[32m+    let mut pos = Position::new(
[m[32m+        "AAPL".to_string(),
[m[32m+        Decimal::from(100),
[m[32m+        Decimal::from_str("150.0").unwrap(),
[m[32m+    );
[m     pos.calculate_unrealized_pnl(Decimal::from_str("165.0").unwrap());
 
     // ROI = (1500 / 15000) * 100 = 10%
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:866:
 
     // Effective price = (15000 + 50) / 100 = 150.50
     let eff_price = exec.effective_price();
[31m-    assert!((eff_price - Decimal::from_str("150.50").unwrap()).abs() < Decimal::from_str("0.01").unwrap());
[m[32m+    assert!(
[m[32m+        (eff_price - Decimal::from_str("150.50").unwrap()).abs()
[m[32m+            < Decimal::from_str("0.01").unwrap()
[m[32m+    );
[m }
 
 // =============================================================================
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:964:
 #[test]
 fn test_market_data_event_timestamp_accessor() {
     let now = Utc::now();
[31m-    let trade = TradeEvent::new("MSFT".to_string(), Decimal::from(300), Decimal::from(50), now);
[m[32m+    let trade = TradeEvent::new(
[m[32m+        "MSFT".to_string(),
[m[32m+        Decimal::from(300),
[m[32m+        Decimal::from(50),
[m[32m+        now,
[m[32m+    );
[m     let event = MarketDataEvent::Trade(trade);
 
     assert_eq!(event.timestamp(), Some(now));
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:1110:
     assert!(invalid_conf.is_err());
 
     // Invalid strength (< -1.0)
[31m-    let invalid_strength = TradingSignal::new(
[m[31m-        symbol,
[m[31m-        -1.5,
[m[31m-        OrderSide::Buy,
[m[31m-        0.85,
[m[31m-        "ML_MODEL_1".to_string(),
[m[31m-    );
[m[32m+    let invalid_strength =
[m[32m+        TradingSignal::new(symbol, -1.5, OrderSide::Buy, 0.85, "ML_MODEL_1".to_string());
[m     assert!(invalid_strength.is_err());
 }
 
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:1231:
 #[test]
 fn test_trade_event_json_serialization() {
     let now = Utc::now();
[31m-    let trade = TradeEvent::new("MSFT".to_string(), Decimal::from(300), Decimal::from(50), now);
[m[32m+    let trade = TradeEvent::new(
[m[32m+        "MSFT".to_string(),
[m[32m+        Decimal::from(300),
[m[32m+        Decimal::from(50),
[m[32m+        now,
[m[32m+    );
[m 
     let json = serde_json::to_string(&trade).unwrap();
     let deserialized: TradeEvent = serde_json::from_str(&json).unwrap();
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:1280:
     let deserialized: CommonTypeError = serde_json::from_str(&json).unwrap();
 
     // Should deserialize as ConversionError (per custom implementation)
[31m-    assert!(matches!(deserialized, CommonTypeError::ConversionError { .. }));
[m[32m+    assert!(matches!(
[m[32m+        deserialized,
[m[32m+        CommonTypeError::ConversionError { .. }
[m[32m+    ));
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/common/tests/types_comprehensive_tests.rs:1365:
 
     let version_with_desc = ConfigVersion::with_description(2, "Updated config");
     assert_eq!(version_with_desc.version, 2);
[31m-    assert_eq!(version_with_desc.description, Some("Updated config".to_string()));
[m[32m+    assert_eq!(
[m[32m+        version_with_desc.description,
[m[32m+        Some("Updated config".to_string())
[m[32m+    );
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/config/examples/runtime_config_example.rs:11:
     println!("1. Auto-detecting environment:");
     let config = RuntimeConfig::from_env()?;
     println!("   Environment: {:?}", config.environment);
[31m-    println!("   Database query timeout: {:?}", config.database.query_timeout);
[m[32m+    println!(
[m[32m+        "   Database query timeout: {:?}",
[m[32m+        config.database.query_timeout
[m[32m+    );
[m     println!("   Position cache TTL: {:?}", config.cache.position_ttl);
[31m-    println!("   gRPC request timeout: {:?}", config.timeouts.grpc_request_timeout);
[m[32m+    println!(
[m[32m+        "   gRPC request timeout: {:?}",
[m[32m+        config.timeouts.grpc_request_timeout
[m[32m+    );
[m     println!("   ML max batch size: {}", config.limits.ml_max_batch_size);
     println!();
 
Diff in /home/jgrusewski/Work/foxhunt/config/examples/runtime_config_example.rs:20:
     // Example 2: Development environment defaults
     println!("2. Development environment defaults:");
     let dev_config = RuntimeConfig::with_defaults(Environment::Development);
[31m-    println!("   Database query timeout: {:?} (relaxed for debugging)", dev_config.database.query_timeout);
[m[31m-    println!("   Position cache TTL: {:?} (longer for debugging)", dev_config.cache.position_ttl);
[m[31m-    println!("   Safety check timeout: {:?} (relaxed)", dev_config.limits.safety_check_timeout);
[m[32m+    println!(
[m[32m+        "   Database query timeout: {:?} (relaxed for debugging)",
[m[32m+        dev_config.database.query_timeout
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   Position cache TTL: {:?} (longer for debugging)",
[m[32m+        dev_config.cache.position_ttl
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   Safety check timeout: {:?} (relaxed)",
[m[32m+        dev_config.limits.safety_check_timeout
[m[32m+    );
[m     println!();
 
     // Example 3: Production environment defaults
Diff in /home/jgrusewski/Work/foxhunt/config/examples/runtime_config_example.rs:29:
     println!("3. Production environment defaults:");
     let prod_config = RuntimeConfig::with_defaults(Environment::Production);
[31m-    println!("   Database query timeout: {:?} (tight for HFT)", prod_config.database.query_timeout);
[m[31m-    println!("   Position cache TTL: {:?} (short for HFT)", prod_config.cache.position_ttl);
[m[31m-    println!("   Safety check timeout: {:?} (aggressive)", prod_config.limits.safety_check_timeout);
[m[32m+    println!(
[m[32m+        "   Database query timeout: {:?} (tight for HFT)",
[m[32m+        prod_config.database.query_timeout
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   Position cache TTL: {:?} (short for HFT)",
[m[32m+        prod_config.cache.position_ttl
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   Safety check timeout: {:?} (aggressive)",
[m[32m+        prod_config.limits.safety_check_timeout
[m[32m+    );
[m     println!();
 
     // Example 4: Staging environment (middle ground)
Diff in /home/jgrusewski/Work/foxhunt/config/examples/runtime_config_example.rs:37:
     println!("4. Staging environment defaults:");
     let staging_config = RuntimeConfig::with_defaults(Environment::Staging);
[31m-    println!("   Database query timeout: {:?}", staging_config.database.query_timeout);
[m[31m-    println!("   Position cache TTL: {:?}", staging_config.cache.position_ttl);
[m[31m-    println!("   Safety check timeout: {:?}", staging_config.limits.safety_check_timeout);
[m[32m+    println!(
[m[32m+        "   Database query timeout: {:?}",
[m[32m+        staging_config.database.query_timeout
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   Position cache TTL: {:?}",
[m[32m+        staging_config.cache.position_ttl
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   Safety check timeout: {:?}",
[m[32m+        staging_config.limits.safety_check_timeout
[m[32m+    );
[m     println!();
 
     // Example 5: Validation
Diff in /home/jgrusewski/Work/foxhunt/config/examples/runtime_config_example.rs:61:
     println!("7. Environment comparison (timeouts in ms):");
     println!("   Configuration           | Development | Staging | Production");
     println!("   ----------------------- | ----------- | ------- | ----------");
[31m-    println!("   DB Query Timeout        | {:>11} | {:>7} | {:>10}",
[m[32m+    println!(
[m[32m+        "   DB Query Timeout        | {:>11} | {:>7} | {:>10}",
[m         dev_config.database.query_timeout.as_millis(),
         staging_config.database.query_timeout.as_millis(),
[31m-        prod_config.database.query_timeout.as_millis());
[m[31m-    println!("   Safety Check Timeout    | {:>11} | {:>7} | {:>10}",
[m[32m+        prod_config.database.query_timeout.as_millis()
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   Safety Check Timeout    | {:>11} | {:>7} | {:>10}",
[m         dev_config.limits.safety_check_timeout.as_millis(),
         staging_config.limits.safety_check_timeout.as_millis(),
[31m-        prod_config.limits.safety_check_timeout.as_millis());
[m[31m-    println!("   ML Inference Timeout    | {:>11} | {:>7} | {:>10}",
[m[32m+        prod_config.limits.safety_check_timeout.as_millis()
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   ML Inference Timeout    | {:>11} | {:>7} | {:>10}",
[m         dev_config.limits.ml_inference_timeout.as_millis(),
         staging_config.limits.ml_inference_timeout.as_millis(),
[31m-        prod_config.limits.ml_inference_timeout.as_millis());
[m[32m+        prod_config.limits.ml_inference_timeout.as_millis()
[m[32m+    );
[m     println!();
 
     // Example 8: Cache TTLs (in seconds)
Diff in /home/jgrusewski/Work/foxhunt/config/examples/runtime_config_example.rs:79:
     println!("8. Cache TTL comparison (seconds):");
     println!("   Cache Type         | Development | Staging | Production");
     println!("   ------------------ | ----------- | ------- | ----------");
[31m-    println!("   Position Cache     | {:>11} | {:>7} | {:>10}",
[m[32m+    println!(
[m[32m+        "   Position Cache     | {:>11} | {:>7} | {:>10}",
[m         dev_config.cache.position_ttl.as_secs(),
         staging_config.cache.position_ttl.as_secs(),
[31m-        prod_config.cache.position_ttl.as_secs());
[m[31m-    println!("   VaR Cache          | {:>11} | {:>7} | {:>10}",
[m[32m+        prod_config.cache.position_ttl.as_secs()
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   VaR Cache          | {:>11} | {:>7} | {:>10}",
[m         dev_config.cache.var_ttl.as_secs(),
         staging_config.cache.var_ttl.as_secs(),
[31m-        prod_config.cache.var_ttl.as_secs());
[m[31m-    println!("   Market Data Cache  | {:>11} | {:>7} | {:>10}",
[m[32m+        prod_config.cache.var_ttl.as_secs()
[m[32m+    );
[m[32m+    println!(
[m[32m+        "   Market Data Cache  | {:>11} | {:>7} | {:>10}",
[m         dev_config.cache.market_data_ttl.as_secs(),
         staging_config.cache.market_data_ttl.as_secs(),
[31m-        prod_config.cache.market_data_ttl.as_secs());
[m[32m+        prod_config.cache.market_data_ttl.as_secs()
[m[32m+    );
[m     println!();
 
     println!("=== Example Complete ===");
Diff in /home/jgrusewski/Work/foxhunt/config/src/compliance_config.rs:121:
     ///
     /// Result indicating success or error
     pub async fn start_listener(&self) -> ConfigResult<()> {
[31m-        let mut listener = PgListener::connect_with(&self.pool)
[m[31m-            .await?;
[m[32m+        let mut listener = PgListener::connect_with(&self.pool).await?;
[m 
[31m-        listener
[m[31m-            .listen("compliance_rules_changed")
[m[31m-            .await?;
[m[32m+        listener.listen("compliance_rules_changed").await?;
[m 
         *self.listener.write().await = Some(listener);
 
Diff in /home/jgrusewski/Work/foxhunt/config/src/compliance_config.rs:149:
                             );
 
                             // Parse notification payload to get rule_id
[31m-                            if let Ok(payload) = serde_json::from_str::<serde_json::Value>(
[m[31m-                                notification.payload(),
[m[31m-                            ) {
[m[31m-                                if let Some(rule_id) = payload.get("rule_id").and_then(|v| v.as_str()) {
[m[32m+                            if let Ok(payload) =
[m[32m+                                serde_json::from_str::<serde_json::Value>(notification.payload())
[m[32m+                            {
[m[32m+                                if let Some(rule_id) =
[m[32m+                                    payload.get("rule_id").and_then(|v| v.as_str())
[m[32m+                                {
[m                                     // Invalidate cache for this rule
                                     cache_clone.write().await.remove(rule_id);
                                     info!("Invalidated cache for compliance rule: {}", rule_id);
Diff in /home/jgrusewski/Work/foxhunt/config/src/compliance_config.rs:159:
 
                                     // Optionally reload the rule immediately
[31m-                                    if let Err(e) = Self::reload_rule_static(&pool_clone, &cache_clone, rule_id).await {
[m[31m-                                        error!("Failed to reload compliance rule {}: {}", rule_id, e);
[m[32m+                                    if let Err(e) =
[m[32m+                                        Self::reload_rule_static(&pool_clone, &cache_clone, rule_id)
[m[32m+                                            .await
[m[32m+                                    {
[m[32m+                                        error!(
[m[32m+                                            "Failed to reload compliance rule {}: {}",
[m[32m+                                            rule_id, e
[m[32m+                                        );
[m                                     }
                                 }
                             }
Diff in /home/jgrusewski/Work/foxhunt/config/src/compliance_config.rs:244:
     /// # Returns
     ///
     /// Vector of rules matching the specified type
[31m-    pub async fn load_rules_by_type(&self, rule_type: &str) -> ConfigResult<Vec<ComplianceRuleConfig>> {
[m[32m+    pub async fn load_rules_by_type(
[m[32m+        &self,
[m[32m+        rule_type: &str,
[m[32m+    ) -> ConfigResult<Vec<ComplianceRuleConfig>> {
[m         let query = "SELECT rule_id, name, description, rule_type::text as rule_type, active, version,
                            severity, priority, parameters, regulatory_framework, regulatory_reference
                     FROM compliance_rules
Diff in /home/jgrusewski/Work/foxhunt/config/src/compliance_config.rs:293:
 
         // Update cache if found
         if let Some(ref rule_data) = rule {
[31m-            self.rules_cache.write().await.insert(rule_id.to_string(), rule_data.clone());
[m[32m+            self.rules_cache
[m[32m+                .write()
[m[32m+                .await
[m[32m+                .insert(rule_id.to_string(), rule_data.clone());
[m         }
 
         Ok(rule)
Diff in /home/jgrusewski/Work/foxhunt/config/src/data_providers.rs:128:
                 "https://paper-api.alpaca.markets",
                 "https://data.alpaca.markets",
             ),
[31m-            DataProviderEnvironment::Production => (
[m[31m-                "https://api.alpaca.markets",
[m[31m-                "https://data.alpaca.markets",
[m[31m-            ),
[m[32m+            DataProviderEnvironment::Production => {
[m[32m+                ("https://api.alpaca.markets", "https://data.alpaca.markets")
[m[32m+            }
[m         };
 
         Self {
Diff in /home/jgrusewski/Work/foxhunt/config/src/data_providers.rs:168:
         };
 
         Self {
[31m-            host: std::env::var("IB_GATEWAY_HOST")
[m[31m-                .unwrap_or_else(|_| host_default.to_string()),
[m[32m+            host: std::env::var("IB_GATEWAY_HOST").unwrap_or_else(|_| host_default.to_string()),
[m             port: std::env::var("IB_GATEWAY_PORT")
                 .ok()
                 .and_then(|s| s.parse().ok())
Diff in /home/jgrusewski/Work/foxhunt/config/src/data_providers.rs:274:
     #[test]
     fn test_benzinga_defaults() {
         let config = BenzingaEndpoints::from_env(DataProviderEnvironment::Production);
[31m-        assert_eq!(
[m[31m-            config.websocket_url,
[m[31m-            "wss://api.benzinga.com/api/v1/stream"
[m[31m-        );
[m[32m+        assert_eq!(config.websocket_url, "wss://api.benzinga.com/api/v1/stream");
[m         assert_eq!(config.api_base_url, "https://api.benzinga.com/api/v2");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1088:
                     "Missing strategy_id in config",
                 )))
             })?;
[31m-    
[m[32m+
[m         // Extract all configuration fields
[31m-        let name = config.get("name").and_then(|v| v.as_str()).unwrap_or("Unnamed Strategy");
[m[32m+        let name = config
[m[32m+            .get("name")
[m[32m+            .and_then(|v| v.as_str())
[m[32m+            .unwrap_or("Unnamed Strategy");
[m         let description = config.get("description").and_then(|v| v.as_str());
[31m-    
[m[32m+
[m         // Helper macro for extracting fields with defaults
         macro_rules! get_i32 {
             ($field:expr, $default:expr) => {
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1099:
[31m-                config.get($field).and_then(|v| v.as_i64()).map(|v| v as i32).unwrap_or($default)
[m[32m+                config
[m[32m+                    .get($field)
[m[32m+                    .and_then(|v| v.as_i64())
[m[32m+                    .map(|v| v as i32)
[m[32m+                    .unwrap_or($default)
[m             };
         }
         macro_rules! get_f64 {
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1103:
             ($field:expr, $default:expr) => {
[31m-                config.get($field).and_then(|v| v.as_f64()).unwrap_or($default)
[m[32m+                config
[m[32m+                    .get($field)
[m[32m+                    .and_then(|v| v.as_f64())
[m[32m+                    .unwrap_or($default)
[m             };
         }
         macro_rules! get_bool {
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1108:
             ($field:expr, $default:expr) => {
[31m-                config.get($field).and_then(|v| v.as_bool()).unwrap_or($default)
[m[32m+                config
[m[32m+                    .get($field)
[m[32m+                    .and_then(|v| v.as_bool())
[m[32m+                    .unwrap_or($default)
[m             };
         }
         macro_rules! get_str {
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1113:
             ($field:expr, $default:expr) => {
[31m-                config.get($field).and_then(|v| v.as_str()).unwrap_or($default)
[m[32m+                config
[m[32m+                    .get($field)
[m[32m+                    .and_then(|v| v.as_str())
[m[32m+                    .unwrap_or($default)
[m             };
         }
[31m-    
[m[32m+
[m         // Full upsert with all 50+ fields
         let query = r#"
             INSERT INTO adaptive_strategy_config (
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1186:
                 updated_at = NOW()
             RETURNING strategy_id
         "#;
[31m-    
[m[32m+
[m         // Extract trade_size_buckets and features arrays
[31m-        let trade_size_buckets: Vec<f64> = config.get("trade_size_buckets")
[m[32m+        let trade_size_buckets: Vec<f64> = config
[m[32m+            .get("trade_size_buckets")
[m             .and_then(|v| v.as_array())
             .map(|arr| arr.iter().filter_map(|v| v.as_f64()).collect())
             .unwrap_or_else(|| vec![10.0, 100.0, 1000.0, 10000.0]);
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1195:
[31m-    
[m[31m-        let microstructure_features: Vec<String> = config.get("microstructure_features")
[m[32m+
[m[32m+        let microstructure_features: Vec<String> = config
[m[32m+            .get("microstructure_features")
[m             .and_then(|v| v.as_array())
[31m-            .map(|arr| arr.iter().filter_map(|v| v.as_str().map(|s| s.to_string())).collect())
[m[31m-            .unwrap_or_else(|| vec!["vpin".to_string(), "order_flow".to_string(), "bid_ask_spread".to_string()]);
[m[31m-    
[m[31m-        let regime_features: Vec<String> = config.get("regime_features")
[m[32m+            .map(|arr| {
[m[32m+                arr.iter()
[m[32m+                    .filter_map(|v| v.as_str().map(|s| s.to_string()))
[m[32m+                    .collect()
[m[32m+            })
[m[32m+            .unwrap_or_else(|| {
[m[32m+                vec![
[m[32m+                    "vpin".to_string(),
[m[32m+                    "order_flow".to_string(),
[m[32m+                    "bid_ask_spread".to_string(),
[m[32m+                ]
[m[32m+            });
[m[32m+
[m[32m+        let regime_features: Vec<String> = config
[m[32m+            .get("regime_features")
[m             .and_then(|v| v.as_array())
[31m-            .map(|arr| arr.iter().filter_map(|v| v.as_str().map(|s| s.to_string())).collect())
[m[31m-            .unwrap_or_else(|| vec!["volatility".to_string(), "momentum".to_string(), "volume".to_string()]);
[m[31m-    
[m[32m+            .map(|arr| {
[m[32m+                arr.iter()
[m[32m+                    .filter_map(|v| v.as_str().map(|s| s.to_string()))
[m[32m+                    .collect()
[m[32m+            })
[m[32m+            .unwrap_or_else(|| {
[m[32m+                vec![
[m[32m+                    "volatility".to_string(),
[m[32m+                    "momentum".to_string(),
[m[32m+                    "volume".to_string(),
[m[32m+                ]
[m[32m+            });
[m[32m+
[m         let row = sqlx::query(query)
             .bind(strategy_id)
             .bind(name)
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1246:
             .bind(get_f64!("dark_pool_preference", 0.3))
             .fetch_one(&self.pool)
             .await?;
[31m-    
[m[31m-                let result: String = row.try_get("strategy_id")?;
[m[31m-                Ok(result)
[m[31m-            }
[m[31m-        
[m[31m-            // ========================================================================
[m[31m-            // MODEL CRUD OPERATIONS
[m[31m-            // ========================================================================
[m[31m-        
[m[31m-            /// Add a model configuration to a strategy
[m[31m-            ///
[m[31m-            /// # Arguments
[m[31m-            /// * `strategy_config_id` - UUID of the parent strategy configuration
[m[31m-            /// * `model` - Model configuration as JSON
[m[31m-            ///
[m[31m-            /// # Returns
[m[31m-            /// UUID of the created model configuration
[m[31m-            pub async fn add_model_config(
[m[31m-                &self,
[m[31m-                strategy_config_id: uuid::Uuid,
[m[31m-                model: &serde_json::Value,
[m[31m-            ) -> Result<uuid::Uuid, sqlx::Error> {
[m[31m-                let model_id = model.get("model_id")
[m[31m-                    .and_then(|v| v.as_str())
[m[31m-                    .ok_or_else(|| sqlx::Error::Decode(Box::new(std::io::Error::new(
[m[31m-                        std::io::ErrorKind::InvalidData,
[m[31m-                        "Missing model_id"
[m[31m-                    ))))?;
[m[31m-        
[m[31m-                let query = r#"
[m[32m+
[m[32m+        let result: String = row.try_get("strategy_id")?;
[m[32m+        Ok(result)
[m[32m+    }
[m[32m+
[m[32m+    // ========================================================================
[m[32m+    // MODEL CRUD OPERATIONS
[m[32m+    // ========================================================================
[m[32m+
[m[32m+    /// Add a model configuration to a strategy
[m[32m+    ///
[m[32m+    /// # Arguments
[m[32m+    /// * `strategy_config_id` - UUID of the parent strategy configuration
[m[32m+    /// * `model` - Model configuration as JSON
[m[32m+    ///
[m[32m+    /// # Returns
[m[32m+    /// UUID of the created model configuration
[m[32m+    pub async fn add_model_config(
[m[32m+        &self,
[m[32m+        strategy_config_id: uuid::Uuid,
[m[32m+        model: &serde_json::Value,
[m[32m+    ) -> Result<uuid::Uuid, sqlx::Error> {
[m[32m+        let model_id = model
[m[32m+            .get("model_id")
[m[32m+            .and_then(|v| v.as_str())
[m[32m+            .ok_or_else(|| {
[m[32m+                sqlx::Error::Decode(Box::new(std::io::Error::new(
[m[32m+                    std::io::ErrorKind::InvalidData,
[m[32m+                    "Missing model_id",
[m[32m+                )))
[m[32m+            })?;
[m[32m+
[m[32m+        let query = r#"
[m                     INSERT INTO adaptive_strategy_models (
                         strategy_config_id, model_id, model_name, model_type,
                         parameters, initial_weight, enabled, display_order
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1282:
                     ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
                     RETURNING id
                 "#;
[31m-        
[m[31m-                let row = sqlx::query(query)
[m[31m-                    .bind(strategy_config_id)
[m[31m-                    .bind(model_id)
[m[31m-                    .bind(model.get("model_name").and_then(|v| v.as_str()).unwrap_or(model_id))
[m[31m-                    .bind(model.get("model_type").and_then(|v| v.as_str()).unwrap_or("unknown"))
[m[31m-                    .bind(model.get("parameters").unwrap_or(&serde_json::json!({})))
[m[31m-                    .bind(model.get("initial_weight").and_then(|v| v.as_f64()).unwrap_or(0.25))
[m[31m-                    .bind(model.get("enabled").and_then(|v| v.as_bool()).unwrap_or(true))
[m[31m-                    .bind(model.get("display_order").and_then(|v| v.as_i64()).unwrap_or(0) as i32)
[m[31m-                    .fetch_one(&self.pool)
[m[31m-                    .await?;
[m[31m-        
[m[31m-                row.try_get("id")
[m[31m-            }
[m[31m-        
[m[31m-            /// Update a model configuration
[m[31m-            ///
[m[31m-            /// # Arguments
[m[31m-            /// * `model_id` - UUID of the model to update
[m[31m-            /// * `updates` - Fields to update as JSON
[m[31m-            pub async fn update_model_config(
[m[31m-                &self,
[m[31m-                model_id: uuid::Uuid,
[m[31m-                updates: &serde_json::Value,
[m[31m-            ) -> Result<(), sqlx::Error> {
[m[31m-                let query = r#"
[m[32m+
[m[32m+        let row = sqlx::query(query)
[m[32m+            .bind(strategy_config_id)
[m[32m+            .bind(model_id)
[m[32m+            .bind(
[m[32m+                model
[m[32m+                    .get("model_name")
[m[32m+                    .and_then(|v| v.as_str())
[m[32m+                    .unwrap_or(model_id),
[m[32m+            )
[m[32m+            .bind(
[m[32m+                model
[m[32m+                    .get("model_type")
[m[32m+                    .and_then(|v| v.as_str())
[m[32m+                    .unwrap_or("unknown"),
[m[32m+            )
[m[32m+            .bind(model.get("parameters").unwrap_or(&serde_json::json!({})))
[m[32m+            .bind(
[m[32m+                model
[m[32m+                    .get("initial_weight")
[m[32m+                    .and_then(|v| v.as_f64())
[m[32m+                    .unwrap_or(0.25),
[m[32m+            )
[m[32m+            .bind(
[m[32m+                model
[m[32m+                    .get("enabled")
[m[32m+                    .and_then(|v| v.as_bool())
[m[32m+                    .unwrap_or(true),
[m[32m+            )
[m[32m+            .bind(
[m[32m+                model
[m[32m+                    .get("display_order")
[m[32m+                    .and_then(|v| v.as_i64())
[m[32m+                    .unwrap_or(0) as i32,
[m[32m+            )
[m[32m+            .fetch_one(&self.pool)
[m[32m+            .await?;
[m[32m+
[m[32m+        row.try_get("id")
[m[32m+    }
[m[32m+
[m[32m+    /// Update a model configuration
[m[32m+    ///
[m[32m+    /// # Arguments
[m[32m+    /// * `model_id` - UUID of the model to update
[m[32m+    /// * `updates` - Fields to update as JSON
[m[32m+    pub async fn update_model_config(
[m[32m+        &self,
[m[32m+        model_id: uuid::Uuid,
[m[32m+        updates: &serde_json::Value,
[m[32m+    ) -> Result<(), sqlx::Error> {
[m[32m+        let query = r#"
[m                     UPDATE adaptive_strategy_models
                     SET
                         model_name = COALESCE($1, model_name),
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1320:
                         updated_at = NOW()
                     WHERE id = $7
                 "#;
[31m-        
[m[31m-                sqlx::query(query)
[m[31m-                    .bind(updates.get("model_name").and_then(|v| v.as_str()))
[m[31m-                    .bind(updates.get("model_type").and_then(|v| v.as_str()))
[m[31m-                    .bind(updates.get("parameters"))
[m[31m-                    .bind(updates.get("initial_weight").and_then(|v| v.as_f64()))
[m[31m-                    .bind(updates.get("enabled").and_then(|v| v.as_bool()))
[m[31m-                    .bind(updates.get("display_order").and_then(|v| v.as_i64()).map(|v| v as i32))
[m[31m-                    .bind(model_id)
[m[31m-                    .execute(&self.pool)
[m[31m-                    .await?;
[m[31m-        
[m[31m-                Ok(())
[m[31m-            }
[m[31m-        
[m[31m-            /// Remove a model configuration
[m[31m-            ///
[m[31m-            /// # Arguments
[m[31m-            /// * `model_id` - UUID of the model to remove
[m[31m-            pub async fn remove_model_config(
[m[31m-                &self,
[m[31m-                model_id: uuid::Uuid,
[m[31m-            ) -> Result<(), sqlx::Error> {
[m[31m-                let query = "DELETE FROM adaptive_strategy_models WHERE id = $1";
[m[31m-                sqlx::query(query)
[m[31m-                    .bind(model_id)
[m[31m-                    .execute(&self.pool)
[m[31m-                    .await?;
[m[31m-                Ok(())
[m[31m-            }
[m[31m-        
[m[31m-            // ========================================================================
[m[31m-            // FEATURE CRUD OPERATIONS
[m[31m-            // ========================================================================
[m[31m-        
[m[31m-            /// Add a feature configuration to a strategy
[m[31m-            ///
[m[31m-            /// # Arguments
[m[31m-            /// * `strategy_config_id` - UUID of the parent strategy configuration
[m[31m-            /// * `feature` - Feature configuration as JSON
[m[31m-            ///
[m[31m-            /// # Returns
[m[31m-            /// UUID of the created feature configuration
[m[31m-            pub async fn add_feature_config(
[m[31m-                &self,
[m[31m-                strategy_config_id: uuid::Uuid,
[m[31m-                feature: &serde_json::Value,
[m[31m-            ) -> Result<uuid::Uuid, sqlx::Error> {
[m[31m-                let feature_name = feature.get("feature_name")
[m[31m-                    .and_then(|v| v.as_str())
[m[31m-                    .ok_or_else(|| sqlx::Error::Decode(Box::new(std::io::Error::new(
[m[31m-                        std::io::ErrorKind::InvalidData,
[m[31m-                        "Missing feature_name"
[m[31m-                    ))))?;
[m[31m-        
[m[31m-                let query = r#"
[m[32m+
[m[32m+        sqlx::query(query)
[m[32m+            .bind(updates.get("model_name").and_then(|v| v.as_str()))
[m[32m+            .bind(updates.get("model_type").and_then(|v| v.as_str()))
[m[32m+            .bind(updates.get("parameters"))
[m[32m+            .bind(updates.get("initial_weight").and_then(|v| v.as_f64()))
[m[32m+            .bind(updates.get("enabled").and_then(|v| v.as_bool()))
[m[32m+            .bind(
[m[32m+                updates
[m[32m+                    .get("display_order")
[m[32m+                    .and_then(|v| v.as_i64())
[m[32m+                    .map(|v| v as i32),
[m[32m+            )
[m[32m+            .bind(model_id)
[m[32m+            .execute(&self.pool)
[m[32m+            .await?;
[m[32m+
[m[32m+        Ok(())
[m[32m+    }
[m[32m+
[m[32m+    /// Remove a model configuration
[m[32m+    ///
[m[32m+    /// # Arguments
[m[32m+    /// * `model_id` - UUID of the model to remove
[m[32m+    pub async fn remove_model_config(&self, model_id: uuid::Uuid) -> Result<(), sqlx::Error> {
[m[32m+        let query = "DELETE FROM adaptive_strategy_models WHERE id = $1";
[m[32m+        sqlx::query(query)
[m[32m+            .bind(model_id)
[m[32m+            .execute(&self.pool)
[m[32m+            .await?;
[m[32m+        Ok(())
[m[32m+    }
[m[32m+
[m[32m+    // ========================================================================
[m[32m+    // FEATURE CRUD OPERATIONS
[m[32m+    // ========================================================================
[m[32m+
[m[32m+    /// Add a feature configuration to a strategy
[m[32m+    ///
[m[32m+    /// # Arguments
[m[32m+    /// * `strategy_config_id` - UUID of the parent strategy configuration
[m[32m+    /// * `feature` - Feature configuration as JSON
[m[32m+    ///
[m[32m+    /// # Returns
[m[32m+    /// UUID of the created feature configuration
[m[32m+    pub async fn add_feature_config(
[m[32m+        &self,
[m[32m+        strategy_config_id: uuid::Uuid,
[m[32m+        feature: &serde_json::Value,
[m[32m+    ) -> Result<uuid::Uuid, sqlx::Error> {
[m[32m+        let feature_name = feature
[m[32m+            .get("feature_name")
[m[32m+            .and_then(|v| v.as_str())
[m[32m+            .ok_or_else(|| {
[m[32m+                sqlx::Error::Decode(Box::new(std::io::Error::new(
[m[32m+                    std::io::ErrorKind::InvalidData,
[m[32m+                    "Missing feature_name",
[m[32m+                )))
[m[32m+            })?;
[m[32m+
[m[32m+        let query = r#"
[m                     INSERT INTO adaptive_strategy_features (
                         strategy_config_id, feature_name, feature_type,
                         parameters, enabled, required
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1382:
                     ) VALUES ($1, $2, $3, $4, $5, $6)
                     RETURNING id
                 "#;
[31m-        
[m[31m-                let row = sqlx::query(query)
[m[31m-                    .bind(strategy_config_id)
[m[31m-                    .bind(feature_name)
[m[31m-                    .bind(feature.get("feature_type").and_then(|v| v.as_str()).unwrap_or("unknown"))
[m[31m-                    .bind(feature.get("parameters").unwrap_or(&serde_json::json!({})))
[m[31m-                    .bind(feature.get("enabled").and_then(|v| v.as_bool()).unwrap_or(true))
[m[31m-                    .bind(feature.get("required").and_then(|v| v.as_bool()).unwrap_or(false))
[m[31m-                    .fetch_one(&self.pool)
[m[31m-                    .await?;
[m[31m-        
[m[31m-                row.try_get("id")
[m[31m-            }
[m[31m-        
[m[31m-            /// Update a feature configuration
[m[31m-            ///
[m[31m-            /// # Arguments
[m[31m-            /// * `feature_id` - UUID of the feature to update
[m[31m-            /// * `updates` - Fields to update as JSON
[m[31m-            pub async fn update_feature_config(
[m[31m-                &self,
[m[31m-                feature_id: uuid::Uuid,
[m[31m-                updates: &serde_json::Value,
[m[31m-            ) -> Result<(), sqlx::Error> {
[m[31m-                let query = r#"
[m[32m+
[m[32m+        let row = sqlx::query(query)
[m[32m+            .bind(strategy_config_id)
[m[32m+            .bind(feature_name)
[m[32m+            .bind(
[m[32m+                feature
[m[32m+                    .get("feature_type")
[m[32m+                    .and_then(|v| v.as_str())
[m[32m+                    .unwrap_or("unknown"),
[m[32m+            )
[m[32m+            .bind(feature.get("parameters").unwrap_or(&serde_json::json!({})))
[m[32m+            .bind(
[m[32m+                feature
[m[32m+                    .get("enabled")
[m[32m+                    .and_then(|v| v.as_bool())
[m[32m+                    .unwrap_or(true),
[m[32m+            )
[m[32m+            .bind(
[m[32m+                feature
[m[32m+                    .get("required")
[m[32m+                    .and_then(|v| v.as_bool())
[m[32m+                    .unwrap_or(false),
[m[32m+            )
[m[32m+            .fetch_one(&self.pool)
[m[32m+            .await?;
[m[32m+
[m[32m+        row.try_get("id")
[m[32m+    }
[m[32m+
[m[32m+    /// Update a feature configuration
[m[32m+    ///
[m[32m+    /// # Arguments
[m[32m+    /// * `feature_id` - UUID of the feature to update
[m[32m+    /// * `updates` - Fields to update as JSON
[m[32m+    pub async fn update_feature_config(
[m[32m+        &self,
[m[32m+        feature_id: uuid::Uuid,
[m[32m+        updates: &serde_json::Value,
[m[32m+    ) -> Result<(), sqlx::Error> {
[m[32m+        let query = r#"
[m                     UPDATE adaptive_strategy_features
                     SET
                         feature_type = COALESCE($1, feature_type),
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1416:
                         updated_at = NOW()
                     WHERE id = $5
                 "#;
[31m-        
[m[31m-                sqlx::query(query)
[m[31m-                    .bind(updates.get("feature_type").and_then(|v| v.as_str()))
[m[31m-                    .bind(updates.get("parameters"))
[m[31m-                    .bind(updates.get("enabled").and_then(|v| v.as_bool()))
[m[31m-                    .bind(updates.get("required").and_then(|v| v.as_bool()))
[m[31m-                    .bind(feature_id)
[m[31m-                    .execute(&self.pool)
[m[31m-                    .await?;
[m[31m-        
[m[31m-                Ok(())
[m[31m-            }
[m[31m-        
[m[31m-            /// Remove a feature configuration
[m[31m-            ///
[m[31m-            /// # Arguments
[m[31m-            /// * `feature_id` - UUID of the feature to remove
[m[31m-            pub async fn remove_feature_config(
[m[31m-                &self,
[m[31m-                feature_id: uuid::Uuid,
[m[31m-            ) -> Result<(), sqlx::Error> {
[m[31m-                let query = "DELETE FROM adaptive_strategy_features WHERE id = $1";
[m[31m-                sqlx::query(query)
[m[31m-                    .bind(feature_id)
[m[31m-                    .execute(&self.pool)
[m[31m-                    .await?;
[m[31m-                Ok(())
[m[31m-            }
[m[31m-        
[m[31m-            // ========================================================================
[m[31m-            // TRANSACTION SUPPORT
[m[31m-            // ========================================================================
[m[31m-        
[m[31m-            /// Update strategy configuration with models and features in a single transaction
[m[31m-            ///
[m[31m-            /// Provides atomic updates across all three tables:
[m[31m-            /// - adaptive_strategy_config (main configuration)
[m[31m-            /// - adaptive_strategy_models (model configurations)
[m[31m-            /// - adaptive_strategy_features (feature configurations)
[m[31m-            ///
[m[31m-            /// # Arguments
[m[31m-            /// * `config` - Full configuration including models and features
[m[31m-            ///
[m[31m-            /// # Returns
[m[31m-            /// Strategy ID of the updated configuration
[m[31m-            pub async fn update_strategy_atomic(
[m[31m-                &self,
[m[31m-                config: &serde_json::Value,
[m[31m-            ) -> Result<String, sqlx::Error> {
[m[31m-                // Start transaction
[m[31m-                let mut tx = self.pool.begin().await?;
[m[31m-        
[m[31m-                // 1. Upsert main configuration
[m[31m-                let strategy_id = config.get("strategy_id")
[m[31m-                    .and_then(|v| v.as_str())
[m[31m-                    .ok_or_else(|| sqlx::Error::Decode(Box::new(std::io::Error::new(
[m[31m-                        std::io::ErrorKind::InvalidData,
[m[31m-                        "Missing strategy_id"
[m[31m-                    ))))?;
[m[31m-        
[m[31m-                // Get or create config_id
[m[31m-                let config_id: uuid::Uuid = sqlx::query_scalar(
[m[31m-                    "SELECT id FROM adaptive_strategy_config WHERE strategy_id = $1"
[m[31m-                )
[m[32m+
[m[32m+        sqlx::query(query)
[m[32m+            .bind(updates.get("feature_type").and_then(|v| v.as_str()))
[m[32m+            .bind(updates.get("parameters"))
[m[32m+            .bind(updates.get("enabled").and_then(|v| v.as_bool()))
[m[32m+            .bind(updates.get("required").and_then(|v| v.as_bool()))
[m[32m+            .bind(feature_id)
[m[32m+            .execute(&self.pool)
[m[32m+            .await?;
[m[32m+
[m[32m+        Ok(())
[m[32m+    }
[m[32m+
[m[32m+    /// Remove a feature configuration
[m[32m+    ///
[m[32m+    /// # Arguments
[m[32m+    /// * `feature_id` - UUID of the feature to remove
[m[32m+    pub async fn remove_feature_config(&self, feature_id: uuid::Uuid) -> Result<(), sqlx::Error> {
[m[32m+        let query = "DELETE FROM adaptive_strategy_features WHERE id = $1";
[m[32m+        sqlx::query(query)
[m[32m+            .bind(feature_id)
[m[32m+            .execute(&self.pool)
[m[32m+            .await?;
[m[32m+        Ok(())
[m[32m+    }
[m[32m+
[m[32m+    // ========================================================================
[m[32m+    // TRANSACTION SUPPORT
[m[32m+    // ========================================================================
[m[32m+
[m[32m+    /// Update strategy configuration with models and features in a single transaction
[m[32m+    ///
[m[32m+    /// Provides atomic updates across all three tables:
[m[32m+    /// - adaptive_strategy_config (main configuration)
[m[32m+    /// - adaptive_strategy_models (model configurations)
[m[32m+    /// - adaptive_strategy_features (feature configurations)
[m[32m+    ///
[m[32m+    /// # Arguments
[m[32m+    /// * `config` - Full configuration including models and features
[m[32m+    ///
[m[32m+    /// # Returns
[m[32m+    /// Strategy ID of the updated configuration
[m[32m+    pub async fn update_strategy_atomic(
[m[32m+        &self,
[m[32m+        config: &serde_json::Value,
[m[32m+    ) -> Result<String, sqlx::Error> {
[m[32m+        // Start transaction
[m[32m+        let mut tx = self.pool.begin().await?;
[m[32m+
[m[32m+        // 1. Upsert main configuration
[m[32m+        let strategy_id = config
[m[32m+            .get("strategy_id")
[m[32m+            .and_then(|v| v.as_str())
[m[32m+            .ok_or_else(|| {
[m[32m+                sqlx::Error::Decode(Box::new(std::io::Error::new(
[m[32m+                    std::io::ErrorKind::InvalidData,
[m[32m+                    "Missing strategy_id",
[m[32m+                )))
[m[32m+            })?;
[m[32m+
[m[32m+        // Get or create config_id
[m[32m+        let config_id: uuid::Uuid =
[m[32m+            sqlx::query_scalar("SELECT id FROM adaptive_strategy_config WHERE strategy_id = $1")
[m                 .bind(strategy_id)
                 .fetch_optional(&mut *tx)
                 .await?
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1486:
                 .unwrap_or_else(uuid::Uuid::new_v4);
[31m-        
[m[31m-                // 2. Update models if provided
[m[31m-                if let Some(models) = config.get("models").and_then(|v| v.as_array()) {
[m[31m-                    // Delete existing models
[m[31m-                    sqlx::query("DELETE FROM adaptive_strategy_models WHERE strategy_config_id = $1")
[m[31m-                        .bind(config_id)
[m[31m-                        .execute(&mut *tx)
[m[31m-                        .await?;
[m[31m-        
[m[31m-                    // Insert new models
[m[31m-                    for model in models {
[m[31m-                        sqlx::query(r#"
[m[32m+
[m[32m+        // 2. Update models if provided
[m[32m+        if let Some(models) = config.get("models").and_then(|v| v.as_array()) {
[m[32m+            // Delete existing models
[m[32m+            sqlx::query("DELETE FROM adaptive_strategy_models WHERE strategy_config_id = $1")
[m[32m+                .bind(config_id)
[m[32m+                .execute(&mut *tx)
[m[32m+                .await?;
[m[32m+
[m[32m+            // Insert new models
[m[32m+            for model in models {
[m[32m+                sqlx::query(
[m[32m+                    r#"
[m                             INSERT INTO adaptive_strategy_models (
                                 strategy_config_id, model_id, model_name, model_type,
                                 parameters, initial_weight, enabled
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1502:
                             ) VALUES ($1, $2, $3, $4, $5, $6, $7)
[31m-                        "#)
[m[31m-                        .bind(config_id)
[m[31m-                        .bind(model.get("model_id").and_then(|v| v.as_str()).unwrap_or("unknown"))
[m[31m-                        .bind(model.get("model_name").and_then(|v| v.as_str()).unwrap_or("Unknown Model"))
[m[31m-                        .bind(model.get("model_type").and_then(|v| v.as_str()).unwrap_or("unknown"))
[m[31m-                        .bind(model.get("parameters").unwrap_or(&serde_json::json!({})))
[m[31m-                        .bind(model.get("initial_weight").and_then(|v| v.as_f64()).unwrap_or(0.25))
[m[31m-                        .bind(model.get("enabled").and_then(|v| v.as_bool()).unwrap_or(true))
[m[31m-                        .execute(&mut *tx)
[m[31m-                        .await?;
[m[31m-                    }
[m[31m-                }
[m[31m-        
[m[31m-                // 3. Update features if provided
[m[31m-                if let Some(features) = config.get("features").and_then(|v| v.as_array()) {
[m[31m-                    // Delete existing features
[m[31m-                    sqlx::query("DELETE FROM adaptive_strategy_features WHERE strategy_config_id = $1")
[m[31m-                        .bind(config_id)
[m[31m-                        .execute(&mut *tx)
[m[31m-                        .await?;
[m[31m-        
[m[31m-                    // Insert new features
[m[31m-                    for feature in features {
[m[31m-                        sqlx::query(r#"
[m[32m+                        "#,
[m[32m+                )
[m[32m+                .bind(config_id)
[m[32m+                .bind(
[m[32m+                    model
[m[32m+                        .get("model_id")
[m[32m+                        .and_then(|v| v.as_str())
[m[32m+                        .unwrap_or("unknown"),
[m[32m+                )
[m[32m+                .bind(
[m[32m+                    model
[m[32m+                        .get("model_name")
[m[32m+                        .and_then(|v| v.as_str())
[m[32m+                        .unwrap_or("Unknown Model"),
[m[32m+                )
[m[32m+                .bind(
[m[32m+                    model
[m[32m+                        .get("model_type")
[m[32m+                        .and_then(|v| v.as_str())
[m[32m+                        .unwrap_or("unknown"),
[m[32m+                )
[m[32m+                .bind(model.get("parameters").unwrap_or(&serde_json::json!({})))
[m[32m+                .bind(
[m[32m+                    model
[m[32m+                        .get("initial_weight")
[m[32m+                        .and_then(|v| v.as_f64())
[m[32m+                        .unwrap_or(0.25),
[m[32m+                )
[m[32m+                .bind(
[m[32m+                    model
[m[32m+                        .get("enabled")
[m[32m+                        .and_then(|v| v.as_bool())
[m[32m+                        .unwrap_or(true),
[m[32m+                )
[m[32m+                .execute(&mut *tx)
[m[32m+                .await?;
[m[32m+            }
[m[32m+        }
[m[32m+
[m[32m+        // 3. Update features if provided
[m[32m+        if let Some(features) = config.get("features").and_then(|v| v.as_array()) {
[m[32m+            // Delete existing features
[m[32m+            sqlx::query("DELETE FROM adaptive_strategy_features WHERE strategy_config_id = $1")
[m[32m+                .bind(config_id)
[m[32m+                .execute(&mut *tx)
[m[32m+                .await?;
[m[32m+
[m[32m+            // Insert new features
[m[32m+            for feature in features {
[m[32m+                sqlx::query(
[m[32m+                    r#"
[m                             INSERT INTO adaptive_strategy_features (
                                 strategy_config_id, feature_name, feature_type,
                                 parameters, enabled, required
Diff in /home/jgrusewski/Work/foxhunt/config/src/database.rs:1530:
                             ) VALUES ($1, $2, $3, $4, $5, $6)
[31m-                        "#)
[m[31m-                        .bind(config_id)
[m[31m-                        .bind(feature.get("feature_name").and_then(|v| v.as_str()).unwrap_or("unknown"))
[m[31m-                        .bind(feature.get("feature_type").and_then(|v| v.as_str()).unwrap_or("unknown"))
[m[31m-                        .bind(feature.get("parameters").unwrap_or(&serde_json::json!({})))
[m[31m-                        .bind(feature.get("enabled").and_then(|v| v.as_bool()).unwrap_or(true))
[m[31m-                        .bind(feature.get("required").and_then(|v| v.as_bool()).unwrap_or(false))
[m[31m-                        .execute(&mut *tx)
[m[31m-                        .await?;
[m[31m-                    }
[m[31m-                }
[m[31m-        
[m[31m-                // Commit transaction
[m[31m-                tx.commit().await?;
[m[31m-        
[m[31m-                Ok(strategy_id.to_string())
[m[32m+                        "#,
[m[32m+                )
[m[32m+                .bind(config_id)
[m[32m+                .bind(
[m[32m+                    feature
[m[32m+                        .get("feature_name")
[m[32m+                        .and_then(|v| v.as_str())
[m[32m+                        .unwrap_or("unknown"),
[m[32m+                )
[m[32m+                .bind(
[m[32m+                    feature
[m[32m+                        .get("feature_type")
[m[32m+                        .and_then(|v| v.as_str())
[m[32m+                        .unwrap_or("unknown"),
[m[32m+                )
[m[32m+                .bind(feature.get("parameters").unwrap_or(&serde_json::json!({})))
[m[32m+                .bind(
[m[32m+                    feature
[m[32m+                        .get("enabled")
[m[32m+                        .and_then(|v| v.as_bool())
[m[32m+                        .unwrap_or(true),
[m[32m+                )
[m[32m+                .bind(
[m[32m+                    feature
[m[32m+                        .get("required")
[m[32m+                        .and_then(|v| v.as_bool())
[m[32m+                        .unwrap_or(false),
[m[32m+                )
[m[32m+                .execute(&mut *tx)
[m[32m+                .await?;
[m             }
         }
[31m-        
[m[31m-        #[cfg(test)]
[m[32m+
[m[32m+        // Commit transaction
[m[32m+        tx.commit().await?;
[m[32m+
[m[32m+        Ok(strategy_id.to_string())
[m[32m+    }
[m[32m+}
[m[32m+
[m[32m+#[cfg(test)]
[m mod tests {
     use super::*;
 
Diff in /home/jgrusewski/Work/foxhunt/config/src/lib.rs:33:
 pub use asset_classification::{
     create_default_configurations, AssetClass, AssetClassificationManager, AssetConfig,
     CommodityType, CryptoType, DerivativeType, EquitySector, ExecutionConfig, FixedIncomeType,
[31m-    ForexPairType, FutureType, GeographicRegion, JumpRiskProfile, MarketCapTier, MarketMakingConfig, OrderType,
[m[31m-    PositionLimits, RiskThresholds, SettlementConfig, TimeInForce,
[m[32m+    ForexPairType, FutureType, GeographicRegion, JumpRiskProfile, MarketCapTier,
[m[32m+    MarketMakingConfig, OrderType, PositionLimits, RiskThresholds, SettlementConfig, TimeInForce,
[m     TradingHours as DetailedTradingHours, TradingParameters,
     VolatilityProfile as DetailedVolatilityProfile,
 };
Diff in /home/jgrusewski/Work/foxhunt/config/src/lib.rs:41:
[32m+pub use compliance_config::ComplianceRuleConfig;
[m[32m+#[cfg(feature = "postgres")]
[m[32m+pub use compliance_config::PostgresComplianceRuleLoader;
[m pub use data_config::{
     DataCompressionAlgorithm, DataCompressionConfig, DataConfig, DataRetentionConfig,
     DataStorageConfig, DataStorageFormat, DataVersioningConfig, MissingDataHandling,
Diff in /home/jgrusewski/Work/foxhunt/config/src/lib.rs:46:
     AlpacaEndpoints, BenzingaEndpoints, DataProviderConfig, DataProviderEnvironment,
     DatabentoEndpoints, IBGatewayConfig,
 };
[31m-pub use compliance_config::ComplianceRuleConfig;
[m[31m-#[cfg(feature = "postgres")]
[m[31m-pub use compliance_config::PostgresComplianceRuleLoader;
[m pub use database::{DatabaseConfig, PoolConfig, TransactionConfig};
 #[cfg(feature = "postgres")]
 pub use database::{
Diff in /home/jgrusewski/Work/foxhunt/config/src/lib.rs:72:
 pub use structures::{
     AssetClass as SimpleAssetClass, AssetClassificationConfig, BacktestingDatabaseConfig,
     BacktestingPerformanceConfig, BacktestingStrategyConfig, BrokerConfig, BrokerRoutingRule,
[31m-    CommissionConfig, EncryptionConfig, MarketDataConfig, TlsConfig, TradingConfig, VolatilityProfile as SimpleVolatilityProfile,
[m[32m+    CommissionConfig, EncryptionConfig, MarketDataConfig, TlsConfig, TradingConfig,
[m[32m+    VolatilityProfile as SimpleVolatilityProfile,
[m };
 pub use symbol_config::{
     AssetClassification, SymbolConfig, SymbolConfigManager, SymbolMetadata, TradingHours,
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:155:
                 pool_size: 10,
                 max_pool_size: 50,
                 connection_lifetime: Duration::from_secs(1800), // 30 minutes
[31m-                idle_timeout: Duration::from_secs(600), // 10 minutes
[m[32m+                idle_timeout: Duration::from_secs(600),         // 10 minutes
[m             },
             Environment::Staging => Self {
                 query_timeout: Duration::from_millis(2000),
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:164:
                 pool_size: 15,
                 max_pool_size: 75,
                 connection_lifetime: Duration::from_secs(3600), // 1 hour
[31m-                idle_timeout: Duration::from_secs(300), // 5 minutes
[m[32m+                idle_timeout: Duration::from_secs(300),         // 5 minutes
[m             },
             Environment::Production => Self {
                 query_timeout: Duration::from_millis(1000), // Tight timeout for HFT
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:173:
                 pool_size: 20,
                 max_pool_size: 100,
                 connection_lifetime: Duration::from_secs(3600), // 1 hour
[31m-                idle_timeout: Duration::from_secs(300), // 5 minutes
[m[32m+                idle_timeout: Duration::from_secs(300),         // 5 minutes
[m             },
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:183:
         let defaults = Self::with_defaults(env);
 
         Ok(Self {
[31m-            query_timeout: parse_env_duration_ms("DATABASE_QUERY_TIMEOUT_MS", defaults.query_timeout)?,
[m[31m-            connection_timeout: parse_env_duration_ms("DATABASE_CONNECTION_TIMEOUT_MS", defaults.connection_timeout)?,
[m[31m-            acquire_timeout: parse_env_duration_ms("DATABASE_ACQUIRE_TIMEOUT_MS", defaults.acquire_timeout)?,
[m[32m+            query_timeout: parse_env_duration_ms(
[m[32m+                "DATABASE_QUERY_TIMEOUT_MS",
[m[32m+                defaults.query_timeout,
[m[32m+            )?,
[m[32m+            connection_timeout: parse_env_duration_ms(
[m[32m+                "DATABASE_CONNECTION_TIMEOUT_MS",
[m[32m+                defaults.connection_timeout,
[m[32m+            )?,
[m[32m+            acquire_timeout: parse_env_duration_ms(
[m[32m+                "DATABASE_ACQUIRE_TIMEOUT_MS",
[m[32m+                defaults.acquire_timeout,
[m[32m+            )?,
[m             pool_size: parse_env_u32("DATABASE_POOL_SIZE", defaults.pool_size)?,
             max_pool_size: parse_env_u32("DATABASE_MAX_POOL_SIZE", defaults.max_pool_size)?,
[31m-            connection_lifetime: parse_env_duration_secs("DATABASE_CONNECTION_LIFETIME_SECS", defaults.connection_lifetime)?,
[m[31m-            idle_timeout: parse_env_duration_secs("DATABASE_IDLE_TIMEOUT_SECS", defaults.idle_timeout)?,
[m[32m+            connection_lifetime: parse_env_duration_secs(
[m[32m+                "DATABASE_CONNECTION_LIFETIME_SECS",
[m[32m+                defaults.connection_lifetime,
[m[32m+            )?,
[m[32m+            idle_timeout: parse_env_duration_secs(
[m[32m+                "DATABASE_IDLE_TIMEOUT_SECS",
[m[32m+                defaults.idle_timeout,
[m[32m+            )?,
[m         })
     }
 
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:196:
     /// Validates the configuration.
     pub fn validate(&self) -> ConfigResult<()> {
         if self.query_timeout.as_millis() == 0 {
[31m-            return Err(ConfigError::Invalid("Query timeout must be positive".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "Query timeout must be positive".into(),
[m[32m+            ));
[m         }
         if self.pool_size == 0 {
             return Err(ConfigError::Invalid("Pool size must be positive".into()));
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:203:
         }
         if self.pool_size > self.max_pool_size {
[31m-            return Err(ConfigError::Invalid("Pool size cannot exceed max pool size".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "Pool size cannot exceed max pool size".into(),
[m[32m+            ));
[m         }
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:231:
         match env {
             Environment::Development => Self {
                 position_ttl: Duration::from_secs(120), // Longer TTL for debugging
[31m-                var_ttl: Duration::from_secs(7200), // 2 hours
[m[32m+                var_ttl: Duration::from_secs(7200),     // 2 hours
[m                 compliance_ttl: Duration::from_secs(172800), // 48 hours
                 market_data_ttl: Duration::from_secs(600), // 10 minutes
                 model_prediction_ttl: Duration::from_secs(120), // 2 minutes
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:244:
                 model_prediction_ttl: Duration::from_secs(90),
             },
             Environment::Production => Self {
[31m-                position_ttl: Duration::from_secs(60), // 1 minute for HFT
[m[31m-                var_ttl: Duration::from_secs(3600), // 1 hour
[m[32m+                position_ttl: Duration::from_secs(60),      // 1 minute for HFT
[m[32m+                var_ttl: Duration::from_secs(3600),         // 1 hour
[m                 compliance_ttl: Duration::from_secs(86400), // 24 hours
[31m-                market_data_ttl: Duration::from_secs(300), // 5 minutes
[m[32m+                market_data_ttl: Duration::from_secs(300),  // 5 minutes
[m                 model_prediction_ttl: Duration::from_secs(60), // 1 minute
             },
         }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:258:
         let defaults = Self::with_defaults(env);
 
         Ok(Self {
[31m-            position_ttl: parse_env_duration_secs("CACHE_POSITION_TTL_SECS", defaults.position_ttl)?,
[m[32m+            position_ttl: parse_env_duration_secs(
[m[32m+                "CACHE_POSITION_TTL_SECS",
[m[32m+                defaults.position_ttl,
[m[32m+            )?,
[m             var_ttl: parse_env_duration_secs("CACHE_VAR_TTL_SECS", defaults.var_ttl)?,
[31m-            compliance_ttl: parse_env_duration_secs("CACHE_COMPLIANCE_TTL_SECS", defaults.compliance_ttl)?,
[m[31m-            market_data_ttl: parse_env_duration_secs("CACHE_MARKET_DATA_TTL_SECS", defaults.market_data_ttl)?,
[m[31m-            model_prediction_ttl: parse_env_duration_secs("CACHE_MODEL_PREDICTION_TTL_SECS", defaults.model_prediction_ttl)?,
[m[32m+            compliance_ttl: parse_env_duration_secs(
[m[32m+                "CACHE_COMPLIANCE_TTL_SECS",
[m[32m+                defaults.compliance_ttl,
[m[32m+            )?,
[m[32m+            market_data_ttl: parse_env_duration_secs(
[m[32m+                "CACHE_MARKET_DATA_TTL_SECS",
[m[32m+                defaults.market_data_ttl,
[m[32m+            )?,
[m[32m+            model_prediction_ttl: parse_env_duration_secs(
[m[32m+                "CACHE_MODEL_PREDICTION_TTL_SECS",
[m[32m+                defaults.model_prediction_ttl,
[m[32m+            )?,
[m         })
     }
 
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:328:
         let defaults = Self::with_defaults(env);
 
         Ok(Self {
[31m-            grpc_connect_timeout: parse_env_duration_secs("NETWORK_GRPC_CONNECT_TIMEOUT_SECS", defaults.grpc_connect_timeout)?,
[m[31m-            grpc_request_timeout: parse_env_duration_secs("NETWORK_GRPC_REQUEST_TIMEOUT_SECS", defaults.grpc_request_timeout)?,
[m[31m-            keep_alive_interval: parse_env_duration_secs("NETWORK_KEEP_ALIVE_INTERVAL_SECS", defaults.keep_alive_interval)?,
[m[31m-            keep_alive_timeout: parse_env_duration_secs("NETWORK_KEEP_ALIVE_TIMEOUT_SECS", defaults.keep_alive_timeout)?,
[m[31m-            max_concurrent_connections: parse_env_u32("NETWORK_MAX_CONCURRENT_CONNECTIONS", defaults.max_concurrent_connections)?,
[m[32m+            grpc_connect_timeout: parse_env_duration_secs(
[m[32m+                "NETWORK_GRPC_CONNECT_TIMEOUT_SECS",
[m[32m+                defaults.grpc_connect_timeout,
[m[32m+            )?,
[m[32m+            grpc_request_timeout: parse_env_duration_secs(
[m[32m+                "NETWORK_GRPC_REQUEST_TIMEOUT_SECS",
[m[32m+                defaults.grpc_request_timeout,
[m[32m+            )?,
[m[32m+            keep_alive_interval: parse_env_duration_secs(
[m[32m+                "NETWORK_KEEP_ALIVE_INTERVAL_SECS",
[m[32m+                defaults.keep_alive_interval,
[m[32m+            )?,
[m[32m+            keep_alive_timeout: parse_env_duration_secs(
[m[32m+                "NETWORK_KEEP_ALIVE_TIMEOUT_SECS",
[m[32m+                defaults.keep_alive_timeout,
[m[32m+            )?,
[m[32m+            max_concurrent_connections: parse_env_u32(
[m[32m+                "NETWORK_MAX_CONCURRENT_CONNECTIONS",
[m[32m+                defaults.max_concurrent_connections,
[m[32m+            )?,
[m         })
     }
 
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:339:
     /// Validates the configuration.
     pub fn validate(&self) -> ConfigResult<()> {
         if self.grpc_connect_timeout.as_secs() == 0 {
[31m-            return Err(ConfigError::Invalid("gRPC connect timeout must be positive".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "gRPC connect timeout must be positive".into(),
[m[32m+            ));
[m         }
         if self.max_concurrent_connections == 0 {
[31m-            return Err(ConfigError::Invalid("Max concurrent connections must be positive".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "Max concurrent connections must be positive".into(),
[m[32m+            ));
[m         }
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:413:
                 ml_max_batch_size: 1024,
                 ml_inference_timeout: Duration::from_millis(200),
                 ml_cache_cleanup_interval: Duration::from_secs(7200), // 2 hours
[31m-                ml_drift_check_interval: Duration::from_secs(600), // 10 minutes
[m[32m+                ml_drift_check_interval: Duration::from_secs(600),    // 10 minutes
[m 
                 // Risk
                 risk_var_lookback_days: 252,
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:437:
                 ml_max_batch_size: 4096,
                 ml_inference_timeout: Duration::from_millis(150),
                 ml_cache_cleanup_interval: Duration::from_secs(5400), // 1.5 hours
[31m-                ml_drift_check_interval: Duration::from_secs(450), // 7.5 minutes
[m[32m+                ml_drift_check_interval: Duration::from_secs(450),    // 7.5 minutes
[m 
                 // Risk
                 risk_var_lookback_days: 252,
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:461:
                 ml_max_batch_size: 8192,
                 ml_inference_timeout: Duration::from_millis(100),
                 ml_cache_cleanup_interval: Duration::from_secs(3600), // 1 hour
[31m-                ml_drift_check_interval: Duration::from_secs(300), // 5 minutes
[m[32m+                ml_drift_check_interval: Duration::from_secs(300),    // 5 minutes
[m 
                 // Risk
                 risk_var_lookback_days: 252,
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:477:
 
         Ok(Self {
             // Retry
[31m-            retry_initial_delay: parse_env_duration_ms("RETRY_INITIAL_DELAY_MS", defaults.retry_initial_delay)?,
[m[31m-            retry_max_delay: parse_env_duration_secs("RETRY_MAX_DELAY_SECS", defaults.retry_max_delay)?,
[m[32m+            retry_initial_delay: parse_env_duration_ms(
[m[32m+                "RETRY_INITIAL_DELAY_MS",
[m[32m+                defaults.retry_initial_delay,
[m[32m+            )?,
[m[32m+            retry_max_delay: parse_env_duration_secs(
[m[32m+                "RETRY_MAX_DELAY_SECS",
[m[32m+                defaults.retry_max_delay,
[m[32m+            )?,
[m             retry_max_attempts: parse_env_u32("RETRY_MAX_ATTEMPTS", defaults.retry_max_attempts)?,
[31m-            retry_backoff_multiplier: parse_env_f32("RETRY_BACKOFF_MULTIPLIER", defaults.retry_backoff_multiplier)?,
[m[32m+            retry_backoff_multiplier: parse_env_f32(
[m[32m+                "RETRY_BACKOFF_MULTIPLIER",
[m[32m+                defaults.retry_backoff_multiplier,
[m[32m+            )?,
[m 
             // Safety
[31m-            safety_check_timeout: parse_env_duration_ms("SAFETY_CHECK_TIMEOUT_MS", defaults.safety_check_timeout)?,
[m[31m-            safety_auto_recovery_delay: parse_env_duration_secs("SAFETY_AUTO_RECOVERY_DELAY_SECS", defaults.safety_auto_recovery_delay)?,
[m[31m-            safety_loss_check_interval: parse_env_duration_secs("SAFETY_LOSS_CHECK_INTERVAL_SECS", defaults.safety_loss_check_interval)?,
[m[31m-            safety_position_check_interval: parse_env_duration_secs("SAFETY_POSITION_CHECK_INTERVAL_SECS", defaults.safety_position_check_interval)?,
[m[32m+            safety_check_timeout: parse_env_duration_ms(
[m[32m+                "SAFETY_CHECK_TIMEOUT_MS",
[m[32m+                defaults.safety_check_timeout,
[m[32m+            )?,
[m[32m+            safety_auto_recovery_delay: parse_env_duration_secs(
[m[32m+                "SAFETY_AUTO_RECOVERY_DELAY_SECS",
[m[32m+                defaults.safety_auto_recovery_delay,
[m[32m+            )?,
[m[32m+            safety_loss_check_interval: parse_env_duration_secs(
[m[32m+                "SAFETY_LOSS_CHECK_INTERVAL_SECS",
[m[32m+                defaults.safety_loss_check_interval,
[m[32m+            )?,
[m[32m+            safety_position_check_interval: parse_env_duration_secs(
[m[32m+                "SAFETY_POSITION_CHECK_INTERVAL_SECS",
[m[32m+                defaults.safety_position_check_interval,
[m[32m+            )?,
[m 
             // ML
             ml_max_batch_size: parse_env_usize("ML_MAX_BATCH_SIZE", defaults.ml_max_batch_size)?,
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:493:
[31m-            ml_inference_timeout: parse_env_duration_ms("ML_INFERENCE_TIMEOUT_MS", defaults.ml_inference_timeout)?,
[m[31m-            ml_cache_cleanup_interval: parse_env_duration_secs("ML_MODEL_CACHE_CLEANUP_INTERVAL_SECS", defaults.ml_cache_cleanup_interval)?,
[m[31m-            ml_drift_check_interval: parse_env_duration_secs("ML_DRIFT_CHECK_INTERVAL_SECS", defaults.ml_drift_check_interval)?,
[m[32m+            ml_inference_timeout: parse_env_duration_ms(
[m[32m+                "ML_INFERENCE_TIMEOUT_MS",
[m[32m+                defaults.ml_inference_timeout,
[m[32m+            )?,
[m[32m+            ml_cache_cleanup_interval: parse_env_duration_secs(
[m[32m+                "ML_MODEL_CACHE_CLEANUP_INTERVAL_SECS",
[m[32m+                defaults.ml_cache_cleanup_interval,
[m[32m+            )?,
[m[32m+            ml_drift_check_interval: parse_env_duration_secs(
[m[32m+                "ML_DRIFT_CHECK_INTERVAL_SECS",
[m[32m+                defaults.ml_drift_check_interval,
[m[32m+            )?,
[m 
             // Risk
[31m-            risk_var_lookback_days: parse_env_usize("RISK_VAR_LOOKBACK_DAYS", defaults.risk_var_lookback_days)?,
[m[31m-            risk_var_confidence: parse_env_f64("RISK_VAR_CONFIDENCE", defaults.risk_var_confidence)?,
[m[31m-            risk_max_drawdown_warning_pct: parse_env_u8("RISK_MAX_DRAWDOWN_WARNING_PCT", defaults.risk_max_drawdown_warning_pct)?,
[m[32m+            risk_var_lookback_days: parse_env_usize(
[m[32m+                "RISK_VAR_LOOKBACK_DAYS",
[m[32m+                defaults.risk_var_lookback_days,
[m[32m+            )?,
[m[32m+            risk_var_confidence: parse_env_f64(
[m[32m+                "RISK_VAR_CONFIDENCE",
[m[32m+                defaults.risk_var_confidence,
[m[32m+            )?,
[m[32m+            risk_max_drawdown_warning_pct: parse_env_u8(
[m[32m+                "RISK_MAX_DRAWDOWN_WARNING_PCT",
[m[32m+                defaults.risk_max_drawdown_warning_pct,
[m[32m+            )?,
[m         })
     }
 
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:504:
     /// Validates the configuration.
     pub fn validate(&self) -> ConfigResult<()> {
         if self.retry_max_attempts == 0 {
[31m-            return Err(ConfigError::Invalid("Retry max attempts must be positive".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "Retry max attempts must be positive".into(),
[m[32m+            ));
[m         }
         if self.retry_backoff_multiplier <= 1.0 {
[31m-            return Err(ConfigError::Invalid("Backoff multiplier must be > 1.0".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "Backoff multiplier must be > 1.0".into(),
[m[32m+            ));
[m         }
         if self.ml_max_batch_size == 0 {
[31m-            return Err(ConfigError::Invalid("ML max batch size must be positive".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "ML max batch size must be positive".into(),
[m[32m+            ));
[m         }
         if self.risk_var_confidence < 0.0 || self.risk_var_confidence > 1.0 {
[31m-            return Err(ConfigError::Invalid("VaR confidence must be between 0.0 and 1.0".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "VaR confidence must be between 0.0 and 1.0".into(),
[m[32m+            ));
[m         }
         if self.risk_var_lookback_days == 0 {
[31m-            return Err(ConfigError::Invalid("VaR lookback days must be positive".into()));
[m[32m+            return Err(ConfigError::Invalid(
[m[32m+                "VaR lookback days must be positive".into(),
[m[32m+            ));
[m         }
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:612:
 fn parse_env_duration_ms(key: &str, default: Duration) -> ConfigResult<Duration> {
     match std::env::var(key) {
         Ok(val) => {
[31m-            let ms = val.parse::<u64>()
[m[31m-                .map_err(|e| ConfigError::Invalid(format!("Invalid duration for {}: {}", key, e)))?;
[m[32m+            let ms = val.parse::<u64>().map_err(|e| {
[m[32m+                ConfigError::Invalid(format!("Invalid duration for {}: {}", key, e))
[m[32m+            })?;
[m             Ok(Duration::from_millis(ms))
         }
         Err(_) => Ok(default),
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:623:
 fn parse_env_duration_secs(key: &str, default: Duration) -> ConfigResult<Duration> {
     match std::env::var(key) {
         Ok(val) => {
[31m-            let secs = val.parse::<u64>()
[m[31m-                .map_err(|e| ConfigError::Invalid(format!("Invalid duration for {}: {}", key, e)))?;
[m[32m+            let secs = val.parse::<u64>().map_err(|e| {
[m[32m+                ConfigError::Invalid(format!("Invalid duration for {}: {}", key, e))
[m[32m+            })?;
[m             Ok(Duration::from_secs(secs))
         }
         Err(_) => Ok(default),
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:633:
 
 fn parse_env_u32(key: &str, default: u32) -> ConfigResult<u32> {
     match std::env::var(key) {
[31m-        Ok(val) => val.parse::<u32>()
[m[32m+        Ok(val) => val
[m[32m+            .parse::<u32>()
[m             .map_err(|e| ConfigError::Invalid(format!("Invalid u32 for {}: {}", key, e))),
         Err(_) => Ok(default),
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:641:
 
 fn parse_env_u8(key: &str, default: u8) -> ConfigResult<u8> {
     match std::env::var(key) {
[31m-        Ok(val) => val.parse::<u8>()
[m[32m+        Ok(val) => val
[m[32m+            .parse::<u8>()
[m             .map_err(|e| ConfigError::Invalid(format!("Invalid u8 for {}: {}", key, e))),
         Err(_) => Ok(default),
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:649:
 
 fn parse_env_usize(key: &str, default: usize) -> ConfigResult<usize> {
     match std::env::var(key) {
[31m-        Ok(val) => val.parse::<usize>()
[m[32m+        Ok(val) => val
[m[32m+            .parse::<usize>()
[m             .map_err(|e| ConfigError::Invalid(format!("Invalid usize for {}: {}", key, e))),
         Err(_) => Ok(default),
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:657:
 
 fn parse_env_f32(key: &str, default: f32) -> ConfigResult<f32> {
     match std::env::var(key) {
[31m-        Ok(val) => val.parse::<f32>()
[m[32m+        Ok(val) => val
[m[32m+            .parse::<f32>()
[m             .map_err(|e| ConfigError::Invalid(format!("Invalid f32 for {}: {}", key, e))),
         Err(_) => Ok(default),
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:665:
 
 fn parse_env_f64(key: &str, default: f64) -> ConfigResult<f64> {
     match std::env::var(key) {
[31m-        Ok(val) => val.parse::<f64>()
[m[32m+        Ok(val) => val
[m[32m+            .parse::<f64>()
[m             .map_err(|e| ConfigError::Invalid(format!("Invalid f64 for {}: {}", key, e))),
         Err(_) => Ok(default),
     }
Diff in /home/jgrusewski/Work/foxhunt/config/src/runtime.rs:679:
     fn test_environment_detection() {
         // Should default to Development
         let env = Environment::detect();
[31m-        assert!(matches!(env, Environment::Development | Environment::Production | Environment::Staging));
[m[32m+        assert!(matches!(
[m[32m+            env,
[m[32m+            Environment::Development | Environment::Production | Environment::Staging
[m[32m+        ));
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/config/src/structures.rs:54:
             // Position and exposure limits
             max_position_size: Decimal::new(1_000_000, 0), // $1M max single position
             max_portfolio_exposure: Decimal::new(10_000_000, 0), // $10M total portfolio exposure
[31m-            max_concentration_pct: Decimal::new(25, 2), // 25% max concentration
[m[31m-            
[m[32m+            max_concentration_pct: Decimal::new(25, 2),    // 25% max concentration
[m[32m+
[m             // Loss and drawdown limits
             max_daily_loss: Decimal::new(100_000, 0), // $100K max daily loss
[31m-            max_drawdown_pct: Decimal::new(15, 2), // 15% max drawdown
[m[32m+            max_drawdown_pct: Decimal::new(15, 2),    // 15% max drawdown
[m             stop_loss_threshold: Decimal::new(50_000, 0), // $50K stop loss threshold
[31m-            
[m[32m+
[m             // VaR configuration
[31m-            var_confidence_level: 0.95, // 95% confidence
[m[31m-            var_time_horizon: 1, // 1-day horizon
[m[31m-            var_limit_1d: Decimal::new(50_000, 0), // $50K 1-day VaR limit
[m[32m+            var_confidence_level: 0.95,              // 95% confidence
[m[32m+            var_time_horizon: 1,                     // 1-day horizon
[m[32m+            var_limit_1d: Decimal::new(50_000, 0),   // $50K 1-day VaR limit
[m             var_limit_10d: Decimal::new(150_000, 0), // $150K 10-day VaR limit
[31m-            
[m[32m+
[m             // Order limits and rate limiting
             max_order_size: Decimal::new(100_000, 0), // $100K max order size
[31m-            max_orders_per_second: 100, // 100 orders/sec
[m[32m+            max_orders_per_second: 100,               // 100 orders/sec
[m             max_notional_per_hour: Decimal::new(10_000_000, 0), // $10M hourly notional
[31m-            
[m[32m+
[m             // Kelly criterion parameters
[31m-            kelly_fraction_limit: 0.25, // 25% Kelly fraction limit
[m[32m+            kelly_fraction_limit: 0.25,    // 25% Kelly fraction limit
[m             max_kelly_position_size: 0.20, // 20% max Kelly position
[31m-            
[m[32m+
[m             // Emergency stop
             emergency_stop_threshold: 0.10, // 10% loss triggers emergency stop
[31m-            
[m[32m+
[m             // Nested configurations
             var_config: VarConfig::default(),
             circuit_breaker: CircuitBreakerConfig::default(),
Diff in /home/jgrusewski/Work/foxhunt/config/src/structures.rs:715:
             max_price_deviation: 0.05,
             enable_symbol_validation: false,
             max_batch_notional: 10_000_000.0, // $10M batch limit
[31m-            max_position_var: 50_000.0,        // $50K VaR limit
[m[32m+            max_position_var: 50_000.0,       // $50K VaR limit
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/config/src/vault.rs:4:
 //! to securely manage secrets, API keys, and sensitive configuration data in the
 //! Foxhunt trading system. Supports token-based authentication and namespace isolation.
 
[31m-use serde::{Deserialize, Serialize};
[m use secrecy::{ExposeSecret, SecretString};
[32m+use serde::{Deserialize, Serialize};
[m use std::fmt;
 
 /// HashiCorp Vault configuration for secure secret storage.
Diff in /home/jgrusewski/Work/foxhunt/config/src/vault.rs:24:
     /// Vault server URL (e.g., "<https://vault.example.com:8200>")
     pub url: String,
     /// Vault authentication token for API access (securely stored)
[31m-    #[serde(serialize_with = "serialize_secret", deserialize_with = "deserialize_secret")]
[m[32m+    #[serde(
[m[32m+        serialize_with = "serialize_secret",
[m[32m+        deserialize_with = "deserialize_secret"
[m[32m+    )]
[m     pub token: SecretString,
     /// Mount path for the secrets engine (e.g., "secret/")
     pub mount_path: String,
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/examples/account_portfolio_demo.rs:38:
 
     match adapter.get_account_info().await {
         Ok(account_info) => {
[31m-            println!("Account ID: {}", account_info.get("account_id").unwrap_or(&"Unknown".to_string()));
[m             println!(
[32m+                "Account ID: {}",
[m[32m+                account_info
[m[32m+                    .get("account_id")
[m[32m+                    .unwrap_or(&"Unknown".to_string())
[m[32m+            );
[m[32m+            println!(
[m                 "Net Liquidation Value: ${:.2}",
[31m-                account_info.get("net_liquidation").and_then(|s| s.parse::<f64>().ok()).unwrap_or(0.0)
[m[32m+                account_info
[m[32m+                    .get("net_liquidation")
[m[32m+                    .and_then(|s| s.parse::<f64>().ok())
[m[32m+                    .unwrap_or(0.0)
[m             );
[31m-            println!("Available Funds: ${:.2}", account_info.get("available_funds").and_then(|s| s.parse::<f64>().ok()).unwrap_or(0.0));
[m[31m-            println!("Buying Power: ${:.2}", account_info.get("buying_power").and_then(|s| s.parse::<f64>().ok()).unwrap_or(0.0));
[m             println!(
[32m+                "Available Funds: ${:.2}",
[m[32m+                account_info
[m[32m+                    .get("available_funds")
[m[32m+                    .and_then(|s| s.parse::<f64>().ok())
[m[32m+                    .unwrap_or(0.0)
[m[32m+            );
[m[32m+            println!(
[m[32m+                "Buying Power: ${:.2}",
[m[32m+                account_info
[m[32m+                    .get("buying_power")
[m[32m+                    .and_then(|s| s.parse::<f64>().ok())
[m[32m+                    .unwrap_or(0.0)
[m[32m+            );
[m[32m+            println!(
[m                 "Day Trading Buying Power: ${:.2}",
[31m-                account_info.get("day_trading_buying_power").and_then(|s| s.parse::<f64>().ok()).unwrap_or(0.0)
[m[32m+                account_info
[m[32m+                    .get("day_trading_buying_power")
[m[32m+                    .and_then(|s| s.parse::<f64>().ok())
[m[32m+                    .unwrap_or(0.0)
[m             );
[31m-            println!("Currency: {}", account_info.get("currency").unwrap_or(&"USD".to_string()));
[m[32m+            println!(
[m[32m+                "Currency: {}",
[m[32m+                account_info.get("currency").unwrap_or(&"USD".to_string())
[m[32m+            );
[m         },
         Err(e) => error!("Failed to get account info: {}", e),
     }
Diff in /home/jgrusewski/Work/foxhunt/data/examples/account_portfolio_demo.rs:115:
         Ok(account_info) => {
             println!(
                 "Final Net Liquidation Value: ${:.2}",
[31m-                account_info.get("net_liquidation").and_then(|s| s.parse::<f64>().ok()).unwrap_or(0.0)
[m[32m+                account_info
[m[32m+                    .get("net_liquidation")
[m[32m+                    .and_then(|s| s.parse::<f64>().ok())
[m[32m+                    .unwrap_or(0.0)
[m             );
             println!(
                 "Final Available Funds: ${:.2}",
Diff in /home/jgrusewski/Work/foxhunt/data/examples/account_portfolio_demo.rs:122:
[31m-                account_info.get("available_funds").and_then(|s| s.parse::<f64>().ok()).unwrap_or(0.0)
[m[32m+                account_info
[m[32m+                    .get("available_funds")
[m[32m+                    .and_then(|s| s.parse::<f64>().ok())
[m[32m+                    .unwrap_or(0.0)
[m             );
         },
         Err(e) => error!("Failed to get final account info: {}", e),
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/examples/order_submission.rs:11:
 //! - Paper trading account recommended for testing
 #![allow(unused_crate_dependencies)]
 
[31m-use common::{Order, OrderId, OrderSide, OrderStatus, OrderType, Price, Quantity, Symbol, TimeInForce};
[m[32m+use common::{
[m[32m+    Order, OrderId, OrderSide, OrderStatus, OrderType, Price, Quantity, Symbol, TimeInForce,
[m[32m+};
[m use data::brokers::interactive_brokers::{IBConfig, InteractiveBrokersAdapter};
[31m-use data::brokers::{BrokerClient, common::TradingOrder};
[m[32m+use data::brokers::{common::TradingOrder, BrokerClient};
[m use std::time::Duration;
 use tokio::time::sleep;
 use tracing::{error, info, warn};
Diff in /home/jgrusewski/Work/foxhunt/data/examples/order_submission.rs:69:
         Symbol::from("AAPL"),
         OrderSide::Buy,
         Quantity::new(10.0)?,
[31m-        None,  // price
[m[32m+        None, // price
[m         OrderType::Market,
     );
     market_order.time_in_force = TimeInForce::Day;
Diff in /home/jgrusewski/Work/foxhunt/data/examples/order_submission.rs:101:
         Symbol::from("GOOGL"),
         OrderSide::Sell,
         Quantity::new(5.0)?,
[31m-        Some(Price::new(2500.00)?),  // Limit price
[m[32m+        Some(Price::new(2500.00)?), // Limit price
[m         OrderType::Limit,
     );
     limit_order.time_in_force = TimeInForce::GoodTillCancel;
Diff in /home/jgrusewski/Work/foxhunt/data/examples/order_submission.rs:133:
         Symbol::from("MSFT"),
         OrderSide::Buy,
         Quantity::new(20.0)?,
[31m-        Some(Price::new(350.00)?),  // price
[m[32m+        Some(Price::new(350.00)?), // price
[m         OrderType::Stop,
     );
     stop_order.stop_price = Some(Price::new(350.00)?);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/examples/risk_management_demo.rs:1:
 #![allow(unused_crate_dependencies)]
 use common::{Order, OrderSide, OrderType, Price, Quantity, Symbol, TimeInForce};
 use data::brokers::interactive_brokers::{IBConfig, InteractiveBrokersAdapter};
[31m-use data::brokers::{BrokerClient, common::TradingOrder};
[m[31m-use rust_decimal_macros::dec;
[m[32m+use data::brokers::{common::TradingOrder, BrokerClient};
[m use rust_decimal::prelude::ToPrimitive;
[32m+use rust_decimal_macros::dec;
[m use tokio::time::{sleep, Duration};
 use tracing::{error, info};
 // use trading_engine::prelude::*; // REMOVED - prelude does not exist
Diff in /home/jgrusewski/Work/foxhunt/data/examples/risk_management_demo.rs:96:
                 symbol.clone(),
                 OrderSide::Sell,
                 Quantity::try_from(max_shares as f64)?,
[31m-                None,  // price
[m[32m+                None, // price
[m                 OrderType::Stop,
             );
             stop_order.stop_price = Some(stop_loss_price);
Diff in /home/jgrusewski/Work/foxhunt/data/examples/risk_management_demo.rs:105:
             println!("Submitting protective stop loss at ${:.2}", stop_loss_price);
 
             let trading_order = TradingOrder::from_common_order(&stop_order)?;
[31m-    match adapter.submit_order(&trading_order).await {
[m[32m+            match adapter.submit_order(&trading_order).await {
[m                 Ok(_) => println!("✓ Stop loss order submitted successfully"),
                 Err(e) => error!("✗ Failed to submit stop loss: {}", e),
             }
Diff in /home/jgrusewski/Work/foxhunt/data/examples/risk_management_demo.rs:139:
 
                     if let Some(position) = aapl_position {
                         let unrealized_pnl = position.unrealized_pnl;
[31m-                        let pnl_percentage = (unrealized_pnl.to_f64().unwrap_or(0.0) / position_value.to_f64().unwrap_or(1.0)) * 100.0;
[m[32m+                        let pnl_percentage = (unrealized_pnl.to_f64().unwrap_or(0.0)
[m[32m+                            / position_value.to_f64().unwrap_or(1.0))
[m[32m+                            * 100.0;
[m 
                         println!("Position Update: {} shares", position.quantity);
                         println!(
Diff in /home/jgrusewski/Work/foxhunt/data/examples/risk_management_demo.rs:192:
                                 OrderSide::Buy
                             },
                             Quantity::try_from(qty.abs())?,
[31m-                        None,  // price
[m[31m-                        OrderType::Market,
[m[31m-                    );
[m[31m-                    close_order.time_in_force = TimeInForce::ImmediateOrCancel;
[m[32m+                            None, // price
[m[32m+                            OrderType::Market,
[m[32m+                        );
[m[32m+                        close_order.time_in_force = TimeInForce::ImmediateOrCancel;
[m 
                         let trading_order = TradingOrder::from_common_order(&close_order)?;
                         match adapter.submit_order(&trading_order).await {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/src/brokers/interactive_brokers.rs:1055:
                     }
                 }
                 Ok::<_, BrokerError>(account_info)
[31m-            }).await {
[m[32m+            })
[m[32m+            .await
[m[32m+            {
[m                 Ok(Ok(info)) => {
                     // Unsubscribe from account updates
                     let unsub_fields = vec![
Diff in /home/jgrusewski/Work/foxhunt/data/src/brokers/interactive_brokers.rs:1115:
                     }
                 }
                 Ok::<_, BrokerError>(positions)
[31m-            }).await {
[m[32m+            })
[m[32m+            .await
[m[32m+            {
[m                 Ok(Ok(pos)) => {
                     // Cancel positions subscription
                     let cancel_fields = vec![
Diff in /home/jgrusewski/Work/foxhunt/data/src/brokers/interactive_brokers.rs:1150:
             // Send REQ_EXECUTIONS message to subscribe
             let request_id = self.request_tracker.next_id();
             let fields = vec![
[31m-                "7".to_string(),  // REQ_EXECUTIONS (assuming message type 7)
[m[31m-                "3".to_string(),  // version
[m[32m+                "7".to_string(), // REQ_EXECUTIONS (assuming message type 7)
[m[32m+                "3".to_string(), // version
[m                 request_id.to_string(),
                 // Execution filter (empty = all executions)
[31m-                "0".to_string(),  // client_id (0 = all)
[m[32m+                "0".to_string(), // client_id (0 = all)
[m                 self.config.account_id.clone(),
[31m-                "".to_string(),   // time (empty = all)
[m[31m-                "".to_string(),   // symbol (empty = all)
[m[31m-                "".to_string(),   // sec_type (empty = all)
[m[31m-                "".to_string(),   // exchange (empty = all)
[m[31m-                "".to_string(),   // side (empty = all)
[m[32m+                "".to_string(), // time (empty = all)
[m[32m+                "".to_string(), // symbol (empty = all)
[m[32m+                "".to_string(), // sec_type (empty = all)
[m[32m+                "".to_string(), // exchange (empty = all)
[m[32m+                "".to_string(), // side (empty = all)
[m             ];
 
             self.send_message(&fields).await?;
Diff in /home/jgrusewski/Work/foxhunt/data/src/brokers/interactive_brokers.rs:1168:
             // Store the sender in adapter state for handle_execution_details to use
             // Note: In production, this would require adding execution_tx field to adapter
             // For now, returning the receiver directly
[31m-            info!(
[m[31m-                "Subscribed to executions with request ID {}",
[m[31m-                request_id
[m[31m-            );
[m[32m+            info!("Subscribed to executions with request ID {}", request_id);
[m 
             Ok(rx)
         }
Diff in /home/jgrusewski/Work/foxhunt/data/src/brokers/interactive_brokers.rs:1257:
                     return Ok(());
                 },
                 Ok(Err(e)) => {
[31m-                    warn!(
[m[31m-                        "Reconnection attempt {} failed: {}",
[m[31m-                        attempt + 1,
[m[31m-                        e
[m[31m-                    );
[m[32m+                    warn!("Reconnection attempt {} failed: {}", attempt + 1, e);
[m                 },
                 Err(_) => {
                     warn!(
Diff in /home/jgrusewski/Work/foxhunt/data/src/brokers/interactive_brokers.rs:1557:
         fn test_config_default_values() {
             let config = IBConfig::default();
             // Host can be overridden by IB_TWS_HOST environment variable
[31m-            let expected_host = std::env::var("IB_TWS_HOST").unwrap_or_else(|_| "127.0.0.1".to_string());
[m[32m+            let expected_host =
[m[32m+                std::env::var("IB_TWS_HOST").unwrap_or_else(|_| "127.0.0.1".to_string());
[m             assert_eq!(config.host, expected_host);
             // Port can be overridden by IB_TWS_PORT environment variable
             let expected_port = std::env::var("IB_TWS_PORT")
Diff in /home/jgrusewski/Work/foxhunt/data/src/brokers/interactive_brokers.rs:1572:
                 .unwrap_or(1);
             assert_eq!(config.client_id, expected_client_id);
             // Account ID can be overridden by IB_ACCOUNT_ID environment variable
[31m-            let expected_account = std::env::var("IB_ACCOUNT_ID").unwrap_or_else(|_| "DU123456".to_string());
[m[32m+            let expected_account =
[m[32m+                std::env::var("IB_ACCOUNT_ID").unwrap_or_else(|_| "DU123456".to_string());
[m             assert_eq!(config.account_id, expected_account);
             assert_eq!(config.connection_timeout, 30);
             assert_eq!(config.heartbeat_interval, 30);
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/benzinga/ml_integration.rs:1072:
 #[cfg(test)]
 mod tests {
     use super::*;
[31m-    
[m 
     #[test]
     fn test_ml_config_default() {
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/benzinga/mod.rs:464:
 
     #[tokio::test]
     async fn test_hft_integration_creation() {
[31m-        
[m[31m-
[m         let config = BenzingaStreamingConfig {
             api_key: "test-key".to_string(),
             enable_news: true,
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/benzinga/production_historical.rs:530:
         #[cfg(feature = "redis-cache")]
         if let Some(redis_client) = &self.redis_client {
             if let Ok(mut conn) = redis_client.get_multiplexed_async_connection().await {
[31m-                let _: std::result::Result<(), _> = conn.set_ex(key, data, self.config.cache_ttl_secs).await;
[m[32m+                let _: std::result::Result<(), _> =
[m[32m+                    conn.set_ex(key, data, self.config.cache_ttl_secs).await;
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/benzinga/production_historical.rs:1113:
         #[cfg(feature = "redis-cache")]
         if let Some(redis_client) = &self.redis_client {
             if let Ok(mut conn) = redis_client.get_multiplexed_async_connection().await {
[31m-                let _: std::result::Result<(), _> = redis::cmd("FLUSHDB").query_async(&mut conn).await;
[m[32m+                let _: std::result::Result<(), _> =
[m[32m+                    redis::cmd("FLUSHDB").query_async(&mut conn).await;
[m             }
         }
         // Clear in-memory cache
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/benzinga/streaming.rs:1285:
 #[cfg(test)]
 mod tests {
     use super::*;
[31m-    
[m 
     #[test]
     fn test_config_creation() {
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/types.rs:127:
 
 impl DatabentoWebSocketConfig {
     pub fn production() -> Self {
[31m-        let endpoints = config::DatabentoEndpoints::from_env(config::DataProviderEnvironment::Production);
[m[32m+        let endpoints =
[m[32m+            config::DatabentoEndpoints::from_env(config::DataProviderEnvironment::Production);
[m         Self {
             endpoint: endpoints.websocket_url,
             connect_timeout_ms: 5000,
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/types.rs:177:
 
 impl DatabentoHistoricalConfig {
     pub fn production() -> Self {
[31m-        let endpoints = config::DatabentoEndpoints::from_env(config::DataProviderEnvironment::Production);
[m[32m+        let endpoints =
[m[32m+            config::DatabentoEndpoints::from_env(config::DataProviderEnvironment::Production);
[m         Self {
             base_url: endpoints.historical_base_url,
             timeout_seconds: 30,
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:316:
                             if let Some(success) = json.get("success").and_then(|v| v.as_bool()) {
                                 if success {
                                     info!("WebSocket authentication successful");
[31m-                                    if let Some(session_id) = json.get("session_id").and_then(|v| v.as_str()) {
[m[32m+                                    if let Some(session_id) =
[m[32m+                                        json.get("session_id").and_then(|v| v.as_str())
[m[32m+                                    {
[m                                         debug!("Session ID: {}", session_id);
                                     }
                                 } else {
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:330:
                             }
                         },
                         "subscription_response" | "subscribed" => {
[31m-                            if let Ok(response) = serde_json::from_value::<SubscriptionResponse>(json.clone()) {
[m[32m+                            if let Ok(response) =
[m[32m+                                serde_json::from_value::<SubscriptionResponse>(json.clone())
[m[32m+                            {
[m                                 if response.success {
                                     info!(
                                         "Subscription successful - {} symbols (session: {})",
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:346:
                             info!("Unsubscription acknowledged");
                         },
                         "status" => {
[31m-                            if let Ok(status) = serde_json::from_value::<StatusMessage>(json.clone()) {
[m[32m+                            if let Ok(status) =
[m[32m+                                serde_json::from_value::<StatusMessage>(json.clone())
[m[32m+                            {
[m                                 match status.status {
                                     super::types::StatusType::Connected => {
                                         info!("Status: Connected - {}", status.message)
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:366:
                         },
                         "error" => {
                             if let Ok(error) = serde_json::from_value::<ErrorMessage>(json) {
[31m-                                error!(
[m[31m-                                    "WebSocket error (code {}): {}",
[m[31m-                                    error.code, error.message
[m[31m-                                );
[m[32m+                                error!("WebSocket error (code {}): {}", error.code, error.message);
[m                                 metrics.increment_connection_errors();
                             }
                         },
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:386:
                 }
             },
             Err(e) => {
[31m-                warn!("Failed to parse text message as JSON: {} - Error: {}", text, e);
[m[32m+                warn!(
[m[32m+                    "Failed to parse text message as JSON: {} - Error: {}",
[m[32m+                    text, e
[m[32m+                );
[m                 metrics.increment_parse_errors();
             },
         }
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:672:
         }
 
         // Send subscription message to WebSocket following Databento protocol
[31m-        use super::types::{DatabentoDataset, DatabentoSchema, DatabentoSType};
[m[32m+        use super::types::{DatabentoDataset, DatabentoSType, DatabentoSchema};
[m 
         let subscribe_message = serde_json::json!({
             "type": "subscribe",
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:682:
             "stype_in": DatabentoSType::RawSymbol,
         });
 
[31m-        let message_str = serde_json::to_string(&subscribe_message).map_err(|e| {
[m[31m-            DataError::Serialization {
[m[32m+        let message_str =
[m[32m+            serde_json::to_string(&subscribe_message).map_err(|e| DataError::Serialization {
[m                 message: format!("Failed to serialize subscription message: {}", e),
[31m-            }
[m[31m-        })?;
[m[32m+            })?;
[m 
         debug!("Sending subscription message: {}", message_str);
 
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:711:
         }
 
         // Send unsubscription message to WebSocket following Databento protocol
[31m-        use super::types::{DatabentoDataset, DatabentoSchema, DatabentoSType};
[m[32m+        use super::types::{DatabentoDataset, DatabentoSType, DatabentoSchema};
[m 
         let unsubscribe_message = serde_json::json!({
             "type": "unsubscribe",
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:721:
             "stype_in": DatabentoSType::RawSymbol,
         });
 
[31m-        let message_str = serde_json::to_string(&unsubscribe_message).map_err(|e| {
[m[31m-            DataError::Serialization {
[m[32m+        let message_str =
[m[32m+            serde_json::to_string(&unsubscribe_message).map_err(|e| DataError::Serialization {
[m                 message: format!("Failed to serialize unsubscription message: {}", e),
[31m-            }
[m[31m-        })?;
[m[32m+            })?;
[m 
         debug!("Sending unsubscription message: {}", message_str);
 
Diff in /home/jgrusewski/Work/foxhunt/data/src/providers/databento/websocket_client.rs:732:
         // Note: In production, would need access to ws_sender from attempt_connection
         // For now, just log - actual sending would happen through a channel or shared state
[31m-        warn!("Unsubscription message prepared but not sent - requires WebSocket sender integration");
[m[32m+        warn!(
[m[32m+            "Unsubscription message prepared but not sent - requires WebSocket sender integration"
[m[32m+        );
[m 
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:670:
     /// Process a batch of raw data through feature engineering pipeline
     pub async fn process_batch(&mut self, raw_data: &[u8]) -> Result<Vec<u8>> {
         // Deserialize raw market data
[31m-        let market_batch: MarketDataBatch = bincode::deserialize(raw_data)
[m[31m-            .map_err(|e| crate::error::DataError::serialization(format!("Failed to deserialize market data: {}", e)))?;
[m[32m+        let market_batch: MarketDataBatch = bincode::deserialize(raw_data).map_err(|e| {
[m[32m+            crate::error::DataError::serialization(format!(
[m[32m+                "Failed to deserialize market data: {}",
[m[32m+                e
[m[32m+            ))
[m[32m+        })?;
[m 
         let symbol = market_batch.symbol.clone();
         let mut feature_points = Vec::new();
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:731:
         };
 
         // Serialize processed features
[31m-        bincode::serialize(&feature_batch)
[m[31m-            .map_err(|e| crate::error::DataError::serialization(format!("Failed to serialize features: {}", e)))
[m[32m+        bincode::serialize(&feature_batch).map_err(|e| {
[m[32m+            crate::error::DataError::serialization(format!("Failed to serialize features: {}", e))
[m[32m+        })
[m     }
 
     /// Extract temporal features from timestamp
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:748:
         features.insert("hour_of_day".to_string(), hour as f64);
 
         // Day of week (1-7, Monday=1)
[31m-        features.insert("day_of_week".to_string(), timestamp.date_naive().weekday().num_days_from_monday() as f64);
[m[32m+        features.insert(
[m[32m+            "day_of_week".to_string(),
[m[32m+            timestamp.date_naive().weekday().num_days_from_monday() as f64,
[m[32m+        );
[m 
         // Minute of hour (0-59)
         features.insert("minute_of_hour".to_string(), minute as f64);
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:755:
 
         // Trading session indicators (US market hours)
         features.insert("is_premarket".to_string(), if hour < 9 { 1.0 } else { 0.0 });
[31m-        features.insert("is_regular_hours".to_string(), if hour >= 9 && hour < 16 { 1.0 } else { 0.0 });
[m[31m-        features.insert("is_aftermarket".to_string(), if hour >= 16 { 1.0 } else { 0.0 });
[m[32m+        features.insert(
[m[32m+            "is_regular_hours".to_string(),
[m[32m+            if hour >= 9 && hour < 16 { 1.0 } else { 0.0 },
[m[32m+        );
[m[32m+        features.insert(
[m[32m+            "is_aftermarket".to_string(),
[m[32m+            if hour >= 16 { 1.0 } else { 0.0 },
[m[32m+        );
[m 
         features
     }
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:773:
 
     /// Update price history for a symbol
     pub fn update_price(&mut self, symbol: &str, point: &MarketDataPoint) {
[31m-        let prices = self.price_history.entry(symbol.to_string()).or_insert_with(VecDeque::new);
[m[32m+        let prices = self
[m[32m+            .price_history
[m[32m+            .entry(symbol.to_string())
[m[32m+            .or_insert_with(VecDeque::new);
[m         prices.push_back(point.close);
 
[31m-        let volumes = self.volume_history.entry(symbol.to_string()).or_insert_with(VecDeque::new);
[m[32m+        let volumes = self
[m[32m+            .volume_history
[m[32m+            .entry(symbol.to_string())
[m[32m+            .or_insert_with(VecDeque::new);
[m         volumes.push_back(point.volume);
 
         // Keep only the maximum window size needed
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:819:
             if prices.len() >= 20 {
                 let recent: Vec<f64> = prices.iter().rev().take(20).copied().collect();
                 let mean = recent.iter().sum::<f64>() / recent.len() as f64;
[31m-                let variance = recent.iter().map(|&x| (x - mean).powi(2)).sum::<f64>() / recent.len() as f64;
[m[32m+                let variance =
[m[32m+                    recent.iter().map(|&x| (x - mean).powi(2)).sum::<f64>() / recent.len() as f64;
[m                 features.insert("volatility_20".to_string(), variance.sqrt());
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:840:
     /// Update with market data
     pub fn update_market_data(&mut self, symbol: &str, point: &MarketDataPoint) {
         // Store trade data for microstructure analysis
[31m-        let trades = self.trade_history.entry(symbol.to_string()).or_insert_with(VecDeque::new);
[m[32m+        let trades = self
[m[32m+            .trade_history
[m[32m+            .entry(symbol.to_string())
[m[32m+            .or_insert_with(VecDeque::new);
[m         trades.push_back(TradeData {
             timestamp: point.timestamp,
             symbol: symbol.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:863:
         if let Some(trades) = self.trade_history.get(symbol) {
             if !trades.is_empty() {
                 // Calculate average trade size
[31m-                let total_size: f64 = trades.iter()
[m[32m+                let total_size: f64 = trades
[m[32m+                    .iter()
[m                     .map(|t| t.size.to_string().parse::<f64>().unwrap_or(0.0))
                     .sum();
[31m-                features.insert("avg_trade_size".to_string(), total_size / trades.len() as f64);
[m[32m+                features.insert(
[m[32m+                    "avg_trade_size".to_string(),
[m[32m+                    total_size / trades.len() as f64,
[m[32m+                );
[m 
                 // Calculate trade count in window
                 features.insert("trade_count".to_string(), trades.len() as f64);
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:873:
 
                 // Calculate price impact (simplified)
                 if trades.len() >= 2 {
[31m-                    let first_price = trades.front().unwrap().price.to_string().parse::<f64>().unwrap_or(0.0);
[m[31m-                    let last_price = trades.back().unwrap().price.to_string().parse::<f64>().unwrap_or(0.0);
[m[32m+                    let first_price = trades
[m[32m+                        .front()
[m[32m+                        .unwrap()
[m[32m+                        .price
[m[32m+                        .to_string()
[m[32m+                        .parse::<f64>()
[m[32m+                        .unwrap_or(0.0);
[m[32m+                    let last_price = trades
[m[32m+                        .back()
[m[32m+                        .unwrap()
[m[32m+                        .price
[m[32m+                        .to_string()
[m[32m+                        .parse::<f64>()
[m[32m+                        .unwrap_or(0.0);
[m                     let impact = if first_price != 0.0 {
                         (last_price - first_price) / first_price
                     } else {
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:909:
 
     /// Update market state for a symbol
     pub fn update_state(&mut self, symbol: &str, point: &MarketDataPoint) {
[31m-        let states = self.market_states.entry(symbol.to_string()).or_insert_with(VecDeque::new);
[m[32m+        let states = self
[m[32m+            .market_states
[m[32m+            .entry(symbol.to_string())
[m[32m+            .or_insert_with(VecDeque::new);
[m 
         // Calculate simple volatility estimate
         let volatility = if states.len() >= 2 {
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:941:
         if let Some(states) = self.market_states.get(symbol) {
             if !states.is_empty() {
                 // Calculate average volatility
[31m-                let avg_vol: f64 = states.iter().map(|s| s.volatility).sum::<f64>() / states.len() as f64;
[m[32m+                let avg_vol: f64 =
[m[32m+                    states.iter().map(|s| s.volatility).sum::<f64>() / states.len() as f64;
[m                 features.insert("regime_volatility".to_string(), avg_vol);
 
                 // Calculate volume trend
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:948:
[31m-                let avg_volume: f64 = states.iter().map(|s| s.volume).sum::<f64>() / states.len() as f64;
[m[32m+                let avg_volume: f64 =
[m[32m+                    states.iter().map(|s| s.volume).sum::<f64>() / states.len() as f64;
[m                 features.insert("regime_avg_volume".to_string(), avg_volume);
 
                 // Volatility regime classification (0 = low, 1 = medium, 2 = high)
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:975:
     /// Validate feature batch with quality checks
     pub async fn validate_batch(&self, data: &[u8]) -> Result<Vec<u8>> {
         // Deserialize feature batch
[31m-        let mut feature_batch: FeatureBatch = bincode::deserialize(data)
[m[31m-            .map_err(|e| crate::error::DataError::serialization(format!("Failed to deserialize features: {}", e)))?;
[m[32m+        let mut feature_batch: FeatureBatch = bincode::deserialize(data).map_err(|e| {
[m[32m+            crate::error::DataError::serialization(format!("Failed to deserialize features: {}", e))
[m[32m+        })?;
[m 
         // Apply validation to each feature point
         for feature_point in &mut feature_batch.feature_points {
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:1031:
             let missing_count = self.count_missing_features(&feature_point.features);
             if missing_count > 0 {
                 match self.config.missing_data_handling {
[31m-                    MissingDataHandling::Skip |
[m[31m-                    MissingDataHandling::Drop |
[m[31m-                    MissingDataHandling::Error => {
[m[32m+                    MissingDataHandling::Skip
[m[32m+                    | MissingDataHandling::Drop
[m[32m+                    | MissingDataHandling::Error => {
[m                         is_valid = false;
[31m-                    }
[m[31m-                    MissingDataHandling::ForwardFill |
[m[31m-                    MissingDataHandling::FillForward |
[m[31m-                    MissingDataHandling::BackwardFill |
[m[31m-                    MissingDataHandling::FillBackward |
[m[31m-                    MissingDataHandling::Mean |
[m[31m-                    MissingDataHandling::Median => {
[m[32m+                    },
[m[32m+                    MissingDataHandling::ForwardFill
[m[32m+                    | MissingDataHandling::FillForward
[m[32m+                    | MissingDataHandling::BackwardFill
[m[32m+                    | MissingDataHandling::FillBackward
[m[32m+                    | MissingDataHandling::Mean
[m[32m+                    | MissingDataHandling::Median => {
[m                         // Fill with zeros (basic strategy for now)
                         // In production, would implement proper fill strategies
                         self.fill_missing_features(&mut feature_point.features);
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:1048:
[31m-                    }
[m[32m+                    },
[m                     MissingDataHandling::Interpolate => {
                         // For now, treat as skip - interpolation needs historical context
                         is_valid = false;
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:1052:
[31m-                    }
[m[32m+                    },
[m                 }
             }
 
Diff in /home/jgrusewski/Work/foxhunt/data/src/training_pipeline.rs:1060:
         feature_batch.feature_points.retain(|fp| fp.is_valid);
 
         // Serialize validated features
[31m-        bincode::serialize(&feature_batch)
[m[31m-            .map_err(|e| crate::error::DataError::serialization(format!("Failed to serialize validated features: {}", e)))
[m[32m+        bincode::serialize(&feature_batch).map_err(|e| {
[m[32m+            crate::error::DataError::serialization(format!(
[m[32m+                "Failed to serialize validated features: {}",
[m[32m+                e
[m[32m+            ))
[m[32m+        })
[m     }
 
     /// Calculate Z-score for outlier detection
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:721:
                 }
 
                 // 4. Market State Features
[31m-                let (volatility_percentile, trend_strength) = self.calculate_regime_metrics(&prices);
[m[32m+                let (volatility_percentile, trend_strength) =
[m[32m+                    self.calculate_regime_metrics(&prices);
[m                 features.insert("volatility_percentile".to_string(), volatility_percentile);
                 features.insert("trend_strength".to_string(), trend_strength);
             }
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:728:
         }
 
         // Default to neutral regime if insufficient data
[31m-        features.entry("volatility_regime".to_string()).or_insert(0.0);
[m[32m+        features
[m[32m+            .entry("volatility_regime".to_string())
[m[32m+            .or_insert(0.0);
[m         features.entry("trend_regime".to_string()).or_insert(0.0);
         features.entry("volume_regime".to_string()).or_insert(0.0);
 
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:746:
             .windows(2)
             .filter_map(|w| {
                 let ret = (w[1] / w[0]).ln();
[31m-                if ret.is_finite() { Some(ret) } else { None }
[m[32m+                if ret.is_finite() {
[m[32m+                    Some(ret)
[m[32m+                } else {
[m[32m+                    None
[m[32m+                }
[m             })
             .collect();
 
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:756:
 
         // Calculate realized volatility (standard deviation of returns)
         let mean = returns.iter().sum::<f64>() / returns.len() as f64;
[31m-        let variance = returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
[m[32m+        let variance =
[m[32m+            returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
[m         let volatility = variance.sqrt();
 
         // Annualize volatility (assuming daily data, multiply by sqrt(252))
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:784:
         let short_window = 10;
         let long_window = 20.min(prices.len());
 
[31m-        let short_ma = prices[prices.len() - short_window..]
[m[31m-            .iter()
[m[31m-            .sum::<f64>() / short_window as f64;
[m[32m+        let short_ma =
[m[32m+            prices[prices.len() - short_window..].iter().sum::<f64>() / short_window as f64;
[m 
[31m-        let long_ma = prices[prices.len() - long_window..]
[m[31m-            .iter()
[m[31m-            .sum::<f64>() / long_window as f64;
[m[32m+        let long_ma = prices[prices.len() - long_window..].iter().sum::<f64>() / long_window as f64;
[m 
         // Calculate trend strength
         let trend_pct = (short_ma - long_ma) / long_ma;
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:838:
             .windows(2)
             .filter_map(|w| {
                 let ret = (w[1] / w[0]).ln();
[31m-                if ret.is_finite() { Some(ret) } else { None }
[m[32m+                if ret.is_finite() {
[m[32m+                    Some(ret)
[m[32m+                } else {
[m[32m+                    None
[m[32m+                }
[m             })
             .collect();
 
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:845:
         // Volatility percentile (normalized to 0-1)
         let mean = returns.iter().sum::<f64>() / returns.len() as f64;
[31m-        let variance = returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
[m[32m+        let variance =
[m[32m+            returns.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / returns.len() as f64;
[m         let volatility = variance.sqrt();
         let volatility_percentile = (volatility * 100.0).min(1.0).max(0.0);
 
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:1085:
 
             if let Some(bars) = market_data {
                 // Analyze price reaction at different time windows: 5m, 15m, 1h
[31m-                let windows = vec![
[m[31m-                    (5, "5m"),
[m[31m-                    (15, "15m"),
[m[31m-                    (60, "1h"),
[m[31m-                ];
[m[32m+                let windows = vec![(5, "5m"), (15, "15m"), (60, "1h")];
[m 
                 for (window_minutes, suffix) in windows {
[31m-                    let reaction = self.calculate_price_reaction_window(
[m[31m-                        news_events,
[m[31m-                        bars,
[m[31m-                        window_minutes,
[m[31m-                    );
[m[32m+                    let reaction =
[m[32m+                        self.calculate_price_reaction_window(news_events, bars, window_minutes);
[m 
                     features.insert(
                         format!("news_price_reaction_{}", suffix),
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:1115:
         }
 
         // Default values if no news or data
[31m-        features.entry("news_price_reaction_5m".to_string()).or_insert(0.0);
[m[31m-        features.entry("news_price_reaction_15m".to_string()).or_insert(0.0);
[m[31m-        features.entry("news_price_reaction_1h".to_string()).or_insert(0.0);
[m[32m+        features
[m[32m+            .entry("news_price_reaction_5m".to_string())
[m[32m+            .or_insert(0.0);
[m[32m+        features
[m[32m+            .entry("news_price_reaction_15m".to_string())
[m[32m+            .or_insert(0.0);
[m[32m+        features
[m[32m+            .entry("news_price_reaction_1h".to_string())
[m[32m+            .or_insert(0.0);
[m 
         Ok(features)
     }
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:1134:
         // For each news event, find price changes before and after
         for news_event in news_events.iter().rev().take(10) {
             // Take most recent 10 news events
[31m-            if let Some(reaction) = self.calculate_single_event_reaction(
[m[31m-                news_event,
[m[31m-                market_data,
[m[31m-                window_minutes,
[m[31m-            ) {
[m[32m+            if let Some(reaction) =
[m[32m+                self.calculate_single_event_reaction(news_event, market_data, window_minutes)
[m[32m+            {
[m                 reactions.push(reaction);
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:1156:
 
         // Calculate volatility of reactions
         let mean = avg_reaction;
[31m-        let variance = reactions.iter().map(|r| (r - mean).powi(2)).sum::<f64>()
[m[31m-            / reactions.len() as f64;
[m[32m+        let variance =
[m[32m+            reactions.iter().map(|r| (r - mean).powi(2)).sum::<f64>() / reactions.len() as f64;
[m         let volatility = variance.sqrt();
 
         // Determine direction (positive or negative)
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:1191:
 
         // Find price before news event (within 5 minutes before)
         let before_window_start = news_time - Duration::minutes(5);
[31m-        let before_price = market_data
[m[31m-            .iter()
[m[31m-            .rev()
[m[31m-            .find_map(|event| {
[m[31m-                if let MarketDataEvent::Bar(bar) = event {
[m[31m-                    if bar.end_timestamp >= before_window_start && bar.end_timestamp < news_time {
[m[31m-                        return ToPrimitive::to_f64(&bar.close);
[m[31m-                    }
[m[32m+        let before_price = market_data.iter().rev().find_map(|event| {
[m[32m+            if let MarketDataEvent::Bar(bar) = event {
[m[32m+                if bar.end_timestamp >= before_window_start && bar.end_timestamp < news_time {
[m[32m+                    return ToPrimitive::to_f64(&bar.close);
[m                 }
[31m-                None
[m[31m-            });
[m[32m+            }
[m[32m+            None
[m[32m+        });
[m 
         // Find price after news event (at end of window)
         let after_window_end = news_time + window_duration;
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:1208:
[31m-        let after_price = market_data
[m[31m-            .iter()
[m[31m-            .rev()
[m[31m-            .find_map(|event| {
[m[31m-                if let MarketDataEvent::Bar(bar) = event {
[m[31m-                    if bar.end_timestamp > news_time && bar.end_timestamp <= after_window_end {
[m[31m-                        return ToPrimitive::to_f64(&bar.close);
[m[31m-                    }
[m[32m+        let after_price = market_data.iter().rev().find_map(|event| {
[m[32m+            if let MarketDataEvent::Bar(bar) = event {
[m[32m+                if bar.end_timestamp > news_time && bar.end_timestamp <= after_window_end {
[m[32m+                    return ToPrimitive::to_f64(&bar.close);
[m                 }
[31m-                None
[m[31m-            });
[m[32m+            }
[m[32m+            None
[m[32m+        });
[m 
         // Calculate percentage change
         match (before_price, after_price) {
Diff in /home/jgrusewski/Work/foxhunt/data/src/unified_feature_extractor.rs:1223:
                 let pct_change = ((after - before) / before) * 100.0;
                 // Weight by news importance
                 Some(pct_change * news_event.importance)
[31m-            }
[m[32m+            },
[m             _ => None,
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/data/src/utils.rs:1890:
 
         let helper = ConnectionHelper::default();
         let timeout_task = helper.connect_with_timeout(
[31m-            || async {
[m[31m-                std::future::pending::<std::result::Result<(), std::io::Error>>().await
[m[31m-            },
[m[32m+            || async { std::future::pending::<std::result::Result<(), std::io::Error>>().await },
[m             Duration::from_millis(50),
         );
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/tests/benzinga_streaming_tests.rs:8:
 
 #![allow(unused_crate_dependencies)]
 
[31m-use std::collections::HashMap;
[m use chrono::{Duration, Utc};
 use common::types::Symbol;
 use data::error::DataError;
Diff in /home/jgrusewski/Work/foxhunt/data/tests/benzinga_streaming_tests.rs:15:
 use data::providers::common::{NewsEvent, NewsEventType};
[32m+use std::collections::HashMap;
[m 
 // ============================================================================
 // News Article Processing Tests
Diff in /home/jgrusewski/Work/foxhunt/data/tests/benzinga_streaming_tests.rs:218:
         symbols: vec![],
         story_id: "BZ123461".to_string(),
         headline: "Federal Reserve FOMC Meeting".to_string(),
[31m-        content: "Federal Reserve to announce interest rate decision... High importance event for USA".to_string(),
[m[32m+        content:
[m[32m+            "Federal Reserve to announce interest rate decision... High importance event for USA"
[m[32m+                .to_string(),
[m         summary: "FOMC meeting scheduled".to_string(),
         category: "Economic".to_string(),
         tags: vec!["fed".to_string(), "fomc".to_string()],
Diff in /home/jgrusewski/Work/foxhunt/data/tests/benzinga_streaming_tests.rs:340:
 #[test]
 fn test_benzinga_symbol_validation() {
     let too_long = "TOOLONG".repeat(100);
[31m-    let invalid_symbols = vec![
[m[31m-        "",
[m[31m-        " ",
[m[31m-        "\n",
[m[31m-        &too_long,
[m[31m-        "!@#$%",
[m[31m-        "symbol with spaces",
[m[31m-    ];
[m[32m+    let invalid_symbols = vec!["", " ", "\n", &too_long, "!@#$%", "symbol with spaces"];
[m 
     for symbol in invalid_symbols {
         let is_valid = !symbol.is_empty()
Diff in /home/jgrusewski/Work/foxhunt/data/tests/benzinga_streaming_tests.rs:363:
 
 #[test]
 fn test_benzinga_symbol_normalization() {
[31m-    let symbols = vec![
[m[31m-        ("aapl", "AAPL"),
[m[31m-        ("tsla", "TSLA"),
[m[31m-        ("brk.b", "BRK.B"),
[m[31m-    ];
[m[32m+    let symbols = vec![("aapl", "AAPL"), ("tsla", "TSLA"), ("brk.b", "BRK.B")];
[m 
     for (input, expected) in symbols {
         let normalized = input.to_uppercase();
Diff in /home/jgrusewski/Work/foxhunt/data/tests/benzinga_streaming_tests.rs:429:
 fn test_benzinga_news_deduplication() {
     let mut seen_ids: std::collections::HashSet<String> = std::collections::HashSet::new();
 
[31m-    let event_ids = vec![
[m[31m-        "news_1", "news_2", "news_3", "news_2", "news_4", "news_3",
[m[31m-    ];
[m[32m+    let event_ids = vec!["news_1", "news_2", "news_3", "news_2", "news_4", "news_3"];
[m 
     let mut unique_count = 0;
     for id in event_ids {
Diff in /home/jgrusewski/Work/foxhunt/data/tests/benzinga_streaming_tests.rs:586:
 
     let relevant_tags: Vec<&str> = tags
         .iter()
[31m-        .filter(|t| {
[m[31m-            t.contains("earnings") || t.contains("revenue") || t.contains("growth")
[m[31m-        })
[m[32m+        .filter(|t| t.contains("earnings") || t.contains("revenue") || t.contains("growth"))
[m         .copied()
         .collect();
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/tests/databento_edge_cases_tests.rs:35:
     let too_long = "a".repeat(1000);
 
     let test_keys = vec![
[31m-        "",                            // Empty
[m[31m-        "short",                       // Too short
[m[31m-        valid_length.as_str(),        // Valid length
[m[31m-        too_long.as_str(),            // Too long
[m[31m-        "db-valid-key-12345678",      // Valid format
[m[31m-        "invalid@#$%",                // Invalid characters
[m[32m+        "",                      // Empty
[m[32m+        "short",                 // Too short
[m[32m+        valid_length.as_str(),   // Valid length
[m[32m+        too_long.as_str(),       // Too long
[m[32m+        "db-valid-key-12345678", // Valid format
[m[32m+        "invalid@#$%",           // Invalid characters
[m     ];
 
     for key in test_keys {
Diff in /home/jgrusewski/Work/foxhunt/data/tests/databento_edge_cases_tests.rs:47:
[31m-        let is_valid = !key.is_empty()
[m[31m-            && key.len() >= 10
[m[31m-            && key.len() <= 500
[m[31m-            && key.trim() == key;
[m[32m+        let is_valid = !key.is_empty() && key.len() >= 10 && key.len() <= 500 && key.trim() == key;
[m 
         // Validation should catch invalid keys
         let _ = is_valid;
Diff in /home/jgrusewski/Work/foxhunt/data/tests/databento_edge_cases_tests.rs:153:
 #[test]
 fn test_databento_message_parsing_errors() {
     let invalid_messages = vec![
[31m-        "",                           // Empty
[m[31m-        "{}",                         // Empty JSON
[m[31m-        "{invalid json",              // Malformed JSON
[m[31m-        "null",                       // Null
[m[31m-        "[]",                         // Empty array
[m[31m-        "{\"type\":\"unknown\"}",     // Unknown type
[m[32m+        "",                       // Empty
[m[32m+        "{}",                     // Empty JSON
[m[32m+        "{invalid json",          // Malformed JSON
[m[32m+        "null",                   // Null
[m[32m+        "[]",                     // Empty array
[m[32m+        "{\"type\":\"unknown\"}", // Unknown type
[m     ];
 
     for msg in invalid_messages {
Diff in /home/jgrusewski/Work/foxhunt/data/tests/databento_edge_cases_tests.rs:240:
     let too_long = "X".repeat(100);
 
     let invalid_symbols = vec![
[31m-        "",                           // Empty
[m[31m-        " ",                          // Whitespace
[m[31m-        "\n",                         // Newline
[m[31m-        too_long.as_str(),           // Too long
[m[31m-        "!@#$%",                      // Special chars
[m[31m-        "symbol with spaces",         // Spaces
[m[32m+        "",                   // Empty
[m[32m+        " ",                  // Whitespace
[m[32m+        "\n",                 // Newline
[m[32m+        too_long.as_str(),    // Too long
[m[32m+        "!@#$%",              // Special chars
[m[32m+        "symbol with spaces", // Spaces
[m     ];
 
     for symbol in invalid_symbols {
Diff in /home/jgrusewski/Work/foxhunt/data/tests/databento_edge_cases_tests.rs:252:
         let is_valid = !symbol.is_empty()
             && symbol.len() <= 20
             && symbol.trim() == symbol
[31m-            && symbol.chars().all(|c| c.is_alphanumeric() || c == '.' || c == '-');
[m[32m+            && symbol
[m[32m+                .chars()
[m[32m+                .all(|c| c.is_alphanumeric() || c == '.' || c == '-');
[m 
         assert!(!is_valid);
     }
Diff in /home/jgrusewski/Work/foxhunt/data/tests/databento_edge_cases_tests.rs:283:
     use chrono::NaiveDateTime;
 
     let timestamps = vec![
[31m-        0i64,                         // Unix epoch
[m[31m-        1_000_000_000,                // Year 2001
[m[31m-        1_609_459_200,                // 2021-01-01
[m[31m-        2_000_000_000,                // Year 2033
[m[32m+        0i64,          // Unix epoch
[m[32m+        1_000_000_000, // Year 2001
[m[32m+        1_609_459_200, // 2021-01-01
[m[32m+        2_000_000_000, // Year 2033
[m     ];
 
     for ts in timestamps {
Diff in /home/jgrusewski/Work/foxhunt/data/tests/databento_edge_cases_tests.rs:299:
 fn test_databento_price_conversion() {
     use rust_decimal::Decimal;
 
[31m-    let prices = vec![
[m[31m-        "0.0",
[m[31m-        "0.01",
[m[31m-        "1.23456789",
[m[31m-        "999999.99",
[m[31m-        "0.00000001",
[m[31m-    ];
[m[32m+    let prices = vec!["0.0", "0.01", "1.23456789", "999999.99", "0.00000001"];
[m 
     for price_str in prices {
         let decimal = Decimal::from_str_exact(price_str);
Diff in /home/jgrusewski/Work/foxhunt/data/tests/databento_edge_cases_tests.rs:352:
     let message_sizes = vec![
         0,
         1,
[31m-        1024,                         // 1 KB
[m[31m-        1024 * 1024,                  // 1 MB
[m[31m-        10 * 1024 * 1024,             // 10 MB
[m[32m+        1024,             // 1 KB
[m[32m+        1024 * 1024,      // 1 MB
[m[32m+        10 * 1024 * 1024, // 10 MB
[m     ];
 
     for size in message_sizes {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/tests/feature_extraction_tests.rs:183:
     if prices.len() >= period {
         let window = &prices[prices.len() - period..];
         let mean: f64 = window.iter().sum::<f64>() / period as f64;
[31m-        let variance: f64 = window.iter().map(|x| (x - mean).powi(2)).sum::<f64>()
[m[31m-            / period as f64;
[m[32m+        let variance: f64 = window.iter().map(|x| (x - mean).powi(2)).sum::<f64>() / period as f64;
[m         let std_dev = variance.sqrt();
 
         let upper_band = mean + (num_std * std_dev);
Diff in /home/jgrusewski/Work/foxhunt/data/tests/feature_extraction_tests.rs:280:
     let min = values.iter().cloned().fold(f64::INFINITY, f64::min);
     let max = values.iter().cloned().fold(f64::NEG_INFINITY, f64::max);
 
[31m-    let normalized: Vec<f64> = values
[m[31m-        .iter()
[m[31m-        .map(|&v| (v - min) / (max - min))
[m[31m-        .collect();
[m[32m+    let normalized: Vec<f64> = values.iter().map(|&v| (v - min) / (max - min)).collect();
[m 
     for &val in &normalized {
         assert!(val >= 0.0 && val <= 1.0);
Diff in /home/jgrusewski/Work/foxhunt/data/tests/feature_extraction_tests.rs:296:
 fn test_z_score_normalization() {
     let values = vec![10.0, 20.0, 30.0, 40.0, 50.0];
     let mean: f64 = values.iter().sum::<f64>() / values.len() as f64;
[31m-    let variance: f64 = values
[m[31m-        .iter()
[m[31m-        .map(|&x| (x - mean).powi(2))
[m[31m-        .sum::<f64>()
[m[31m-        / values.len() as f64;
[m[32m+    let variance: f64 =
[m[32m+        values.iter().map(|&x| (x - mean).powi(2)).sum::<f64>() / values.len() as f64;
[m     let std_dev = variance.sqrt();
 
     let normalized: Vec<f64> = values.iter().map(|&v| (v - mean) / std_dev).collect();
Diff in /home/jgrusewski/Work/foxhunt/data/tests/feature_extraction_tests.rs:354:
     let prices = vec![100.0, 101.0, 102.0];
     let volumes = vec![1000.0, 1500.0, 2000.0];
 
[31m-    let total_value: f64 = prices
[m[31m-        .iter()
[m[31m-        .zip(volumes.iter())
[m[31m-        .map(|(p, v)| p * v)
[m[31m-        .sum();
[m[32m+    let total_value: f64 = prices.iter().zip(volumes.iter()).map(|(p, v)| p * v).sum();
[m     let total_volume: f64 = volumes.iter().sum();
 
     let vwap = total_value / total_volume;
Diff in /home/jgrusewski/Work/foxhunt/data/tests/feature_extraction_tests.rs:451:
             Some(v) => {
                 filled.push(v);
                 last_valid = v;
[31m-            }
[m[32m+            },
[m             None => filled.push(last_valid),
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/data/tests/feature_extraction_tests.rs:468:
 
     for i in 0..values.len() {
         if values[i].is_nan() {
[31m-            if i > 0 && i < values.len() - 1 && !values[i - 1].is_nan() && !values[i + 1].is_nan()
[m[31m-            {
[m[32m+            if i > 0 && i < values.len() - 1 && !values[i - 1].is_nan() && !values[i + 1].is_nan() {
[m                 let interpolated = (values[i - 1] + values[i + 1]) / 2.0;
                 filled.push(interpolated);
             } else {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/tests/interactive_brokers_tests.rs:7:
 
 use chrono::Utc;
 use common::{OrderId, OrderSide, OrderStatus, OrderType, Position, Symbol, TimeInForce};
[31m-use data::brokers::common::{
[m[31m-    BrokerConnectionStatus, BrokerError, ExecutionReport, TradingOrder,
[m[31m-};
[m[32m+use data::brokers::common::{BrokerConnectionStatus, BrokerError, ExecutionReport, TradingOrder};
[m use data::brokers::interactive_brokers::IBConfig;
 // Note: IBClient doesn't exist - InteractiveBrokersAdapter is the actual implementation
 // use data::brokers::interactive_brokers::{IBClient, IBConfig};
Diff in /home/jgrusewski/Work/foxhunt/data/tests/interactive_brokers_tests.rs:707:
         status: OrderStatus::PartiallyFilled,
     };
 
[31m-    assert!(matches!(partial_report.status, OrderStatus::PartiallyFilled));
[m[32m+    assert!(matches!(
[m[32m+        partial_report.status,
[m[32m+        OrderStatus::PartiallyFilled
[m[32m+    ));
[m 
     // 4. Complete fill
     let fill_report = ExecutionReport {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/data/tests/provider_error_path_tests.rs:56:
         Dataset::CBOEBZX,     // BATS.PITCH
         Dataset::CMEGroup,    // CME.MDP3
         Dataset::ICEFutures,  // ICE.IMPACT
[31m-        // NOTE: Old dataset variants don't exist in current DatabentoDataset
[m[31m-        // The actual enum only supports: NasdaqBasic, NYSEBasic, IEXDeep, CBOEBZX, CMEGroup, ICEFutures
[m[32m+                              // NOTE: Old dataset variants don't exist in current DatabentoDataset
[m[32m+                              // The actual enum only supports: NasdaqBasic, NYSEBasic, IEXDeep, CBOEBZX, CMEGroup, ICEFutures
[m     ];
 
     for dataset in datasets {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/market-data/src/orderbook.rs:569:
         profile.insert(BookSide::Ask, Vec::new());
 
         for level in levels {
[31m-            profile.entry(level.side).or_insert_with(Vec::new).push(level);
[m[32m+            profile
[m[32m+                .entry(level.side)
[m[32m+                .or_insert_with(Vec::new)
[m[32m+                .push(level);
[m         }
 
         // Sort by price (descending for bids, ascending for asks)
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/market-data/tests/basic_test.rs:1:
 use chrono::Utc;
 use market_data::models::{
[31m-        BookSide, IndicatorType, OrderBook, OrderBookLevelDb, PriceRecord, TechnicalIndicator,
[m[31m-    };
[m[32m+    BookSide, IndicatorType, OrderBook, OrderBookLevelDb, PriceRecord, TechnicalIndicator,
[m[32m+};
[m use rust_decimal_macros::dec;
 use std::collections::HashMap;
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/ml/src/benchmarks.rs:487:
             throughput_pps: throughput,
             target_met,
             compilation_time_ms,
[31m-            memory_usage_mb: 0.0,         // Known limitation: Memory measurement requires platform-specific profiling
[m[32m+            memory_usage_mb: 0.0, // Known limitation: Memory measurement requires platform-specific profiling
[m             gpu_utilization_percent: 0.0, // Known limitation: GPU utilization requires vendor-specific APIs (NVIDIA CUDA: nvidia-ml-py/NVML, AMD ROCm: rocm-smi)
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/ml/src/benchmarks.rs:552:
         let components = Components::new_with_refreshed_list();
 
         // Look for CPU or package temperature sensors
[31m-        components
[m[31m-            .iter()
[m[31m-            .find_map(|component| {
[m[31m-                let label = component.label().to_lowercase();
[m[31m-                if label.contains("cpu") || label.contains("package") || label.contains("core") {
[m[31m-                    component.temperature()
[m[31m-                } else {
[m[31m-                    None
[m[31m-                }
[m[31m-            })
[m[32m+        components.iter().find_map(|component| {
[m[32m+            let label = component.label().to_lowercase();
[m[32m+            if label.contains("cpu") || label.contains("package") || label.contains("core") {
[m[32m+                component.temperature()
[m[32m+            } else {
[m[32m+                None
[m[32m+            }
[m[32m+        })
[m     }
 
     fn get_gpu_info(&self) -> Option<GpuInfo> {
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/mod.rs:740:
             .filter(|entry| {
                 let metadata = entry.value();
                 // Empty string matches all model names (wildcard behavior)
[31m-                metadata.model_type == model_type &&
[m[31m-                    (model_name.is_empty() || metadata.model_name == model_name)
[m[32m+                metadata.model_type == model_type
[m[32m+                    && (model_name.is_empty() || metadata.model_name == model_name)
[m             })
             .map(|entry| entry.value().clone())
             .collect();
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/storage.rs:16:
 
 // S3 dependencies for AWS SDK
 #[cfg(feature = "s3-storage")]
[32m+use aws_config::meta::credentials::CredentialsProviderChain;
[m[32m+#[cfg(feature = "s3-storage")]
[m use aws_config::BehaviorVersion;
 #[cfg(feature = "s3-storage")]
[32m+use aws_credential_types::Credentials;
[m[32m+#[cfg(feature = "s3-storage")]
[m use aws_sdk_s3::primitives::ByteStream;
 #[cfg(feature = "s3-storage")]
 use aws_sdk_s3::types::StorageClass;
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/storage.rs:24:
 #[cfg(feature = "s3-storage")]
 use aws_sdk_s3::Client as S3Client;
[31m-#[cfg(feature = "s3-storage")]
[m[31m-use aws_config::meta::credentials::CredentialsProviderChain;
[m[31m-#[cfg(feature = "s3-storage")]
[m[31m-use aws_credential_types::Credentials;
[m 
 /// Trait for checkpoint storage backends
 #[async_trait]
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/storage.rs:778:
                 .key("model_type")
                 .value(format!("{:?}", checkpoint_metadata.model_type))
                 .build()
[31m-                .map_err(|e| MLError::CheckpointError(format!("Failed to build model_type tag: {:?}", e)))?,
[m[32m+                .map_err(|e| {
[m[32m+                    MLError::CheckpointError(format!("Failed to build model_type tag: {:?}", e))
[m[32m+                })?,
[m             aws_sdk_s3::types::Tag::builder()
                 .key("model_name")
                 .value(&checkpoint_metadata.model_name)
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/storage.rs:785:
                 .build()
[31m-                .map_err(|e| MLError::CheckpointError(format!("Failed to build model_name tag: {:?}", e)))?,
[m[32m+                .map_err(|e| {
[m[32m+                    MLError::CheckpointError(format!("Failed to build model_name tag: {:?}", e))
[m[32m+                })?,
[m             aws_sdk_s3::types::Tag::builder()
                 .key("version")
                 .value(&checkpoint_metadata.version)
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/storage.rs:790:
                 .build()
[31m-                .map_err(|e| MLError::CheckpointError(format!("Failed to build version tag: {:?}", e)))?,
[m[32m+                .map_err(|e| {
[m[32m+                    MLError::CheckpointError(format!("Failed to build version tag: {:?}", e))
[m[32m+                })?,
[m             aws_sdk_s3::types::Tag::builder()
                 .key("service")
                 .value("ml-training")
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/storage.rs:795:
                 .build()
[31m-                .map_err(|e| MLError::CheckpointError(format!("Failed to build service tag: {:?}", e)))?,
[m[32m+                .map_err(|e| {
[m[32m+                    MLError::CheckpointError(format!("Failed to build service tag: {:?}", e))
[m[32m+                })?,
[m         ];
 
         // Add custom tags from metadata
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/storage.rs:803:
                     .key("custom_tag")
                     .value(tag)
                     .build()
[31m-                    .map_err(|e| MLError::CheckpointError(format!("Failed to build custom tag: {:?}", e)))?,
[m[32m+                    .map_err(|e| {
[m[32m+                        MLError::CheckpointError(format!("Failed to build custom tag: {:?}", e))
[m[32m+                    })?,
[m             );
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/checkpoint/storage.rs:897:
             .map(|tag| {
                 let key = tag.key();
                 let value = tag.value();
[31m-                format!("{}={}", urlencoding::encode(key), urlencoding::encode(value))
[m[32m+                format!(
[m[32m+                    "{}={}",
[m[32m+                    urlencoding::encode(key),
[m[32m+                    urlencoding::encode(value)
[m[32m+                )
[m             })
             .collect::<Vec<_>>()
             .join("&");
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/multi_step.rs:466:
         };
 
         // Create dummy Q-values for final states (f32 to match model outputs)
[31m-        let final_q_values = Tensor::new(&[[1.0f32, 2.0f32, 3.0f32], [4.0f32, 5.0f32, 6.0f32]], &device)?;
[m[32m+        let final_q_values = Tensor::new(
[m[32m+            &[[1.0f32, 2.0f32, 3.0f32], [4.0f32, 5.0f32, 6.0f32]],
[m[32m+            &device,
[m[32m+        )?;
[m 
         let targets = batch.compute_targets(&final_q_values)?;
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:155:
 
         // Update metrics
         {
[31m-            let mut step_count = self.step_count.lock()
[m[32m+            let mut step_count = self
[m[32m+                .step_count
[m[32m+                .lock()
[m                 .map_err(|_| MLError::LockError("Failed to acquire step_count lock".to_string()))?;
             *step_count += 1;
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:162:
[31m-            let mut metrics = self.metrics.write()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire metrics write lock".to_string()))?;
[m[32m+            let mut metrics = self.metrics.write().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire metrics write lock".to_string())
[m[32m+            })?;
[m             metrics.total_steps = *step_count;
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:181:
 
         // Add to replay buffer
         {
[31m-            let buffer = self.replay_buffer.lock()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire replay_buffer lock".to_string()))?;
[m[32m+            let buffer = self.replay_buffer.lock().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire replay_buffer lock".to_string())
[m[32m+            })?;
[m             buffer.push(experience)?;
 
             // Update metrics
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:189:
[31m-            let mut metrics = self.metrics.write()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire metrics write lock".to_string()))?;
[m[32m+            let mut metrics = self.metrics.write().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire metrics write lock".to_string())
[m[32m+            })?;
[m             metrics.replay_buffer_size = buffer.size();
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:198:
     pub fn train(&self) -> Result<Option<TrainingResult>, MLError> {
         // Check if we can train
         let can_train = {
[31m-            let buffer = self.replay_buffer.lock()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire replay_buffer lock for train check".to_string()))?;
[m[32m+            let buffer = self.replay_buffer.lock().map_err(|_| {
[m[32m+                MLError::LockError(
[m[32m+                    "Failed to acquire replay_buffer lock for train check".to_string(),
[m[32m+                )
[m[32m+            })?;
[m             buffer.can_sample() && buffer.size() >= self.config.min_replay_size
         };
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:209:
 
         // Check training frequency
         let step_count = {
[31m-            let count = self.step_count.lock()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire step_count lock for training frequency check".to_string()))?;
[m[32m+            let count = self.step_count.lock().map_err(|_| {
[m[32m+                MLError::LockError(
[m[32m+                    "Failed to acquire step_count lock for training frequency check".to_string(),
[m[32m+                )
[m[32m+            })?;
[m             *count
         };
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:220:
 
         // Sample batch from replay buffer
         let batch = {
[31m-            let buffer = self.replay_buffer.lock()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire replay_buffer lock for sampling".to_string()))?;
[m[32m+            let buffer = self.replay_buffer.lock().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire replay_buffer lock for sampling".to_string())
[m[32m+            })?;
[m             buffer.sample(Some(self.config.batch_size))?
         };
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:232:
 
         // Backward pass
         {
[31m-            let mut optimizer_guard = self.optimizer.lock()
[m[32m+            let mut optimizer_guard = self
[m[32m+                .optimizer
[m[32m+                .lock()
[m                 .map_err(|_| MLError::LockError("Failed to acquire optimizer lock".to_string()))?;
             if let Some(ref mut optimizer) = *optimizer_guard {
                 optimizer
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:248:
 
         // Update priority beta
         {
[31m-            let mut beta = self.priority_beta.lock()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire priority_beta lock".to_string()))?;
[m[32m+            let mut beta = self.priority_beta.lock().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire priority_beta lock".to_string())
[m[32m+            })?;
[m             *beta = (*beta + self.config.priority_beta_increment).min(1.0);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:260:
             as f64;
 
         {
[31m-            let mut metrics = self.metrics.write()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire metrics write lock".to_string()))?;
[m[32m+            let mut metrics = self.metrics.write().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire metrics write lock".to_string())
[m[32m+            })?;
[m             metrics.current_loss = loss_value;
[31m-            let beta = self.priority_beta.lock()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire priority_beta lock for metrics update".to_string()))?;
[m[32m+            let beta = self.priority_beta.lock().map_err(|_| {
[m[32m+                MLError::LockError(
[m[32m+                    "Failed to acquire priority_beta lock for metrics update".to_string(),
[m[32m+                )
[m[32m+            })?;
[m             metrics.priority_beta = *beta;
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:273:
 
     /// Get current metrics
     pub fn metrics(&self) -> RainbowAgentMetrics {
[31m-        self.metrics.read()
[m[31m-            .map(|m| m.clone())
[m[31m-            .unwrap_or_default()
[m[32m+        self.metrics.read().map(|m| m.clone()).unwrap_or_default()
[m     }
 
     /// Reset agent state
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:282:
     pub fn reset(&self) -> Result<(), MLError> {
         // Reset metrics
         {
[31m-            let mut metrics = self.metrics.write()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire metrics write lock for reset".to_string()))?;
[m[32m+            let mut metrics = self.metrics.write().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire metrics write lock for reset".to_string())
[m[32m+            })?;
[m             *metrics = RainbowAgentMetrics::default();
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:290:
         // Reset counters
         {
[31m-            let mut step_count = self.step_count.lock()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire step_count lock for reset".to_string()))?;
[m[32m+            let mut step_count = self.step_count.lock().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire step_count lock for reset".to_string())
[m[32m+            })?;
[m             *step_count = 0;
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/rainbow_agent_impl.rs:297:
         // Reset replay buffer
         {
[31m-            let mut buffer = self.replay_buffer.lock()
[m[31m-                .map_err(|_| MLError::LockError("Failed to acquire replay_buffer lock for reset".to_string()))?;
[m[32m+            let mut buffer = self.replay_buffer.lock().map_err(|_| {
[m[32m+                MLError::LockError("Failed to acquire replay_buffer lock for reset".to_string())
[m[32m+            })?;
[m             // Create new buffer with same config
             let buffer_config = ReplayBufferConfig {
                 capacity: self.config.replay_buffer_size,
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/self_supervised_pretraining.rs:63:
         let batch_std = (variance + 1e-8)?.sqrt()?; // Add epsilon for numerical stability
 
         // Update running statistics using Welford's algorithm
[31m-        if let (Some(ref mut running_mean), Some(ref mut running_std)) = (&mut self.mean, &mut self.std) {
[m[32m+        if let (Some(ref mut running_mean), Some(ref mut running_std)) =
[m[32m+            (&mut self.mean, &mut self.std)
[m[32m+        {
[m             // Online update of running statistics
             let n = self.num_samples as f32;
             let m = batch_size as f32;
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/self_supervised_pretraining.rs:127:
     }
 
     /// Create span-masked input for temporal learning
[31m-    fn create_span_masked_input(&self, data: &Tensor, dims: &[usize], device: &candle_core::Device) -> CandleResult<(Tensor, Tensor)> {
[m[32m+    fn create_span_masked_input(
[m[32m+        &self,
[m[32m+        data: &Tensor,
[m[32m+        dims: &[usize],
[m[32m+        device: &candle_core::Device,
[m[32m+    ) -> CandleResult<(Tensor, Tensor)> {
[m         let batch_size = dims[0];
         let time_steps = dims[1];
         let features = dims[2];
Diff in /home/jgrusewski/Work/foxhunt/ml/src/dqn/self_supervised_pretraining.rs:170:
     }
 
     /// Create random masked input (fallback for non-temporal data)
[31m-    fn create_random_masked_input(&self, data: &Tensor, dims: &[usize], device: &candle_core::Device) -> CandleResult<(Tensor, Tensor)> {
[m[32m+    fn create_random_masked_input(
[m[32m+        &self,
[m[32m+        data: &Tensor,
[m[32m+        dims: &[usize],
[m[32m+        device: &candle_core::Device,
[m[32m+    ) -> CandleResult<(Tensor, Tensor)> {
[m         let mask_values: Vec<f32> = (0..data.elem_count())
             .map(|_| {
                 if rand::random::<f32>() < self.config.mask_prob as f32 {
Diff in /home/jgrusewski/Work/foxhunt/ml/src/ensemble/mod.rs:40:
 impl From<EnsembleError> for crate::MLError {
     fn from(err: EnsembleError) -> Self {
         match err {
[31m-            EnsembleError::InvalidConfiguration(msg) => {
[m[31m-                crate::MLError::ConfigurationError(msg)
[m[31m-            }
[m[31m-            EnsembleError::ModelNotFound(msg) => {
[m[31m-                crate::MLError::ModelNotFound(msg)
[m[31m-            }
[m[32m+            EnsembleError::InvalidConfiguration(msg) => crate::MLError::ConfigurationError(msg),
[m[32m+            EnsembleError::ModelNotFound(msg) => crate::MLError::ModelNotFound(msg),
[m             EnsembleError::InsufficientModels { expected, actual } => {
                 crate::MLError::ValidationError {
                     message: format!("Insufficient models: expected {}, got {}", expected, actual),
Diff in /home/jgrusewski/Work/foxhunt/ml/src/ensemble/mod.rs:52:
                 }
[31m-            }
[m[31m-            EnsembleError::LockAcquisitionFailed(msg) => {
[m[31m-                crate::MLError::LockError(msg)
[m[31m-            }
[m[32m+            },
[m[32m+            EnsembleError::LockAcquisitionFailed(msg) => crate::MLError::LockError(msg),
[m             EnsembleError::WeightCalculationFailed(msg) => {
                 crate::MLError::ModelError(format!("Weight calculation failed: {}", msg))
[31m-            }
[m[32m+            },
[m             EnsembleError::AggregationFailed(msg) => {
                 crate::MLError::InferenceError(format!("Aggregation failed: {}", msg))
[31m-            }
[m[32m+            },
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/ml/src/features.rs:2220:
         let lookback = 14.min(market_data.len());
         let recent_data = &market_data[market_data.len() - lookback..];
 
[31m-        let current_price = recent_data.last()
[m[32m+        let current_price = recent_data
[m[32m+            .last()
[m             .map(|d| d.price.to_f64().unwrap_or(0.0))
             .unwrap_or(0.0);
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/features.rs:2256:
             return 0.5; // Market neutral for insufficient periods // True neutral when no data
         }
 
[31m-        let current = market_data.last()
[m[32m+        let current = market_data
[m[32m+            .last()
[m             .map(|d| d.price.to_f64().unwrap_or(0.0))
             .unwrap_or(0.0);
         let prev = market_data[market_data.len() - 2]
Diff in /home/jgrusewski/Work/foxhunt/ml/src/features.rs:2417:
             return 0.5;
         }
 
[31m-        let current_volume = market_data.last().map(|d| d.volume.to_f64().unwrap_or(0.0)).unwrap_or(0.0);
[m[32m+        let current_volume = market_data
[m[32m+            .last()
[m[32m+            .map(|d| d.volume.to_f64().unwrap_or(0.0))
[m[32m+            .unwrap_or(0.0);
[m         let avg_volume = if market_data.len() >= 10 {
             market_data
                 .iter()
Diff in /home/jgrusewski/Work/foxhunt/ml/src/features.rs:3440:
 
     #[tokio::test]
     async fn test_feature_extraction() -> Result<(), Box<dyn std::error::Error>> {
[31m-
[m         let config = FeatureExtractionConfig::default();
         let safety_manager = Arc::new(MLSafetyManager::new(
             crate::safety::MLSafetyConfig::default(),
Diff in /home/jgrusewski/Work/foxhunt/ml/src/flash_attention/mod.rs:339:
 
     #[test]
     fn test_flash_attention_creation() -> Result<(), MLError> {
[31m-        let device = Device::cuda_if_available(0).map_err(|e| MLError::ConfigurationError(
[m[31m-            format!("GPU required for flash attention: {}", e)
[m[31m-        ))?;
[m[32m+        let device = Device::cuda_if_available(0).map_err(|e| {
[m[32m+            MLError::ConfigurationError(format!("GPU required for flash attention: {}", e))
[m[32m+        })?;
[m         let config = FlashAttention3Config::default();
         let _attention = FlashAttention3::new(config, device)?;
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/ml/src/inference.rs:589:
 
         // Convert prediction to financial type (handle [1,1] tensor, F32 dtype)
         // Use abs() to ensure positive price for validation
[31m-        let raw_prediction = (prediction_tensor.get(0)?.get(0)?.to_scalar::<f32>()? as f64).abs() + 0.01;
[m[32m+        let raw_prediction =
[m[32m+            (prediction_tensor.get(0)?.get(0)?.to_scalar::<f32>()? as f64).abs() + 0.01;
[m 
         // Validate prediction
         let validated_prediction = self
Diff in /home/jgrusewski/Work/foxhunt/ml/src/integration/coordinator.rs:147:
     /// Create new ensemble coordinator with configuration
     pub async fn with_config(config: EnsembleConfig) -> Result<Self, MLError> {
         let hub_config = IntegrationHubConfig::default();
[31m-        let inference_engine = Arc::new(
[m[31m-            InferenceEngine::new(&hub_config)
[m[31m-                .await
[m[31m-                .map_err(|e| MLError::InitializationError {
[m[31m-                    component: "InferenceEngine".to_string(),
[m[31m-                    message: format!("{:?}", e),
[m[31m-                })?,
[m[31m-        );
[m[32m+        let inference_engine = Arc::new(InferenceEngine::new(&hub_config).await.map_err(|e| {
[m[32m+            MLError::InitializationError {
[m[32m+                component: "InferenceEngine".to_string(),
[m[32m+                message: format!("{:?}", e),
[m[32m+            }
[m[32m+        })?);
[m         Ok(Self {
             config,
             models: Arc::new(RwLock::new(HashMap::new())),
Diff in /home/jgrusewski/Work/foxhunt/ml/src/integration/mod.rs:183:
 #[test]
 fn test_model_type_serialization() -> Result<(), MLError> {
     let model_type = ModelType::DistilledMicroNet;
[31m-    let serialized = serde_json::to_string(&model_type)
[m[31m-        .map_err(|e| MLError::SerializationError { reason: e.to_string() })?;
[m[31m-    let deserialized: ModelType = serde_json::from_str(&serialized)
[m[31m-        .map_err(|e| MLError::SerializationError { reason: e.to_string() })?;
[m[32m+    let serialized =
[m[32m+        serde_json::to_string(&model_type).map_err(|e| MLError::SerializationError {
[m[32m+            reason: e.to_string(),
[m[32m+        })?;
[m[32m+    let deserialized: ModelType =
[m[32m+        serde_json::from_str(&serialized).map_err(|e| MLError::SerializationError {
[m[32m+            reason: e.to_string(),
[m[32m+        })?;
[m     assert_eq!(model_type, deserialized);
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/ml/src/labeling/concurrent_tracking.rs:83:
 
     /// Check if price update triggers any barrier
     pub fn check_barriers(&self, price_point: &PricePoint) -> Option<BarrierResult> {
[31m-        let holding_period = price_point.timestamp_ns.saturating_sub(self.entry_timestamp_ns);
[m[32m+        let holding_period = price_point
[m[32m+            .timestamp_ns
[m[32m+            .saturating_sub(self.entry_timestamp_ns);
[m 
         // Calculate barriers
         let profit_barrier = self.entry_price_cents
Diff in /home/jgrusewski/Work/foxhunt/ml/src/labeling/sample_weights.rs:119:
             let barrier_result = BarrierResult::ProfitTarget;
 
             let label = EventLabel::new(
[31m-                (1692000000_000_000_000 + i as u64 * 3600_000_000_000).saturating_sub(3600_000_000_000),
[m[32m+                (1692000000_000_000_000 + i as u64 * 3600_000_000_000)
[m[32m+                    .saturating_sub(3600_000_000_000),
[m                 10000,
                 barrier_result,
                 1,
Diff in /home/jgrusewski/Work/foxhunt/ml/src/lib.rs:525:
 
     /// Initialization error
     #[error("Initialization error in {component}: {message}")]
[31m-    InitializationError {
[m[31m-        component: String,
[m[31m-        message: String,
[m[31m-    },
[m[32m+    InitializationError { component: String, message: String },
[m 
     /// Training error
     #[error("Training error: {0}")]
Diff in /home/jgrusewski/Work/foxhunt/ml/src/lib.rs:647:
             MLError::ConfigurationError(msg) => {
                 CommonError::config(format!("ML configuration error: {}", msg))
             },
[31m-            MLError::InitializationError { component, message } => {
[m[31m-                CommonError::service(
[m[31m-                    ErrorCategory::System,
[m[31m-                    format!("ML initialization error in {}: {}", component, message),
[m[31m-                )
[m[31m-            },
[m[32m+            MLError::InitializationError { component, message } => CommonError::service(
[m[32m+                ErrorCategory::System,
[m[32m+                format!("ML initialization error in {}: {}", component, message),
[m[32m+            ),
[m             MLError::DimensionMismatch { expected, actual } => CommonError::validation(format!(
                 "ML dimension mismatch: expected {}, got {}",
                 expected, actual
Diff in /home/jgrusewski/Work/foxhunt/ml/src/lib.rs:689:
             MLError::ModelError(msg) => {
                 CommonError::service(ErrorCategory::System, format!("ML model error: {}", msg))
             },
[31m-            MLError::CheckpointError(msg) => {
[m[31m-                CommonError::service(ErrorCategory::System, format!("ML checkpoint error: {}", msg))
[m[31m-            },
[m[32m+            MLError::CheckpointError(msg) => CommonError::service(
[m[32m+                ErrorCategory::System,
[m[32m+                format!("ML checkpoint error: {}", msg),
[m[32m+            ),
[m             MLError::NotTrained(msg) => CommonError::service(
                 ErrorCategory::System,
                 format!("ML model not trained: {}", msg),
Diff in /home/jgrusewski/Work/foxhunt/ml/src/lib.rs:2053:
 pub mod prelude {
     // Core ML types
     pub use crate::{
[31m-        CommonError, CommonTypeError, ErrorCategory, Features, Feedback, FeatureVector,
[m[32m+        CommonError, CommonTypeError, ErrorCategory, FeatureVector, Features, Feedback,
[m         HealthStatus, InferenceResult, IntegerTensor, MarketDataSnapshot, MarketRegime,
         ModelMetadata, ModelPrediction, ModelType, Trade, TrainingMetrics, UpdateSummary,
         ValidationMetrics,
Diff in /home/jgrusewski/Work/foxhunt/ml/src/lib.rs:2070:
 
     // Performance types
     pub use crate::{
[31m-        create_hft_latency_optimizer, create_hft_parallel_executor,
[m[31m-        create_hft_performance_profile, create_hft_performance_profile_with_latency,
[m[31m-        create_ultra_low_latency_profile, ExecutorStats, HFTPerformanceProfile,
[m[31m-        LatencyOptimizer, OptimizationLevel, OptimizationRecommendations, ParallelExecutor,
[m[32m+        create_hft_latency_optimizer, create_hft_parallel_executor, create_hft_performance_profile,
[m[32m+        create_hft_performance_profile_with_latency, create_ultra_low_latency_profile,
[m[32m+        ExecutorStats, HFTPerformanceProfile, LatencyOptimizer, OptimizationLevel,
[m[32m+        OptimizationRecommendations, ParallelExecutor,
[m     };
 
     // Constants
Diff in /home/jgrusewski/Work/foxhunt/ml/src/liquid/mod.rs:152:
         match err {
             MLError::ConfigurationError(msg) | MLError::ConfigError { reason: msg } => {
                 LiquidError::InvalidConfiguration(msg)
[31m-            }
[m[32m+            },
[m             MLError::InvalidInput(msg) => LiquidError::InvalidInput(msg),
             MLError::InferenceError(msg) => LiquidError::InferenceError(msg),
             MLError::TrainingError(msg) => LiquidError::TrainingError(msg),
Diff in /home/jgrusewski/Work/foxhunt/ml/src/mamba/hardware_aware.rs:572:
     let expected = 70_000_000; // 0.7 in fixed point (PRECISION_FACTOR)
 
     // Allow some small error due to precision
[31m-    assert!((result - expected).abs() < 100_000, "SIMD result {} differs from expected {} by {}", result, expected, (result - expected).abs());
[m[32m+    assert!(
[m[32m+        (result - expected).abs() < 100_000,
[m[32m+        "SIMD result {} differs from expected {} by {}",
[m[32m+        result,
[m[32m+        expected,
[m[32m+        (result - expected).abs()
[m[32m+    );
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/mamba/scan_algorithms.rs:255:
             let batch_segments = segment_ids.narrow(0, b, 1)?;
 
             let mut accumulator = batch_input.narrow(1, 0, 1)?;
[31m-            let first_seg: i64 = batch_segments.narrow(1, 0, 1)?.flatten_all()?.to_vec1::<i64>()?[0];
[m[32m+            let first_seg: i64 = batch_segments
[m[32m+                .narrow(1, 0, 1)?
[m[32m+                .flatten_all()?
[m[32m+                .to_vec1::<i64>()?[0];
[m             let mut current_segment = first_seg;
             result_data.push(accumulator.clone());
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/mamba/scan_algorithms.rs:262:
             for t in 1..seq_len {
                 let element = batch_input.narrow(1, t, 1)?;
[31m-                let seg_id: i64 = batch_segments.narrow(1, t, 1)?.flatten_all()?.to_vec1::<i64>()?[0];
[m[32m+                let seg_id: i64 = batch_segments
[m[32m+                    .narrow(1, t, 1)?
[m[32m+                    .flatten_all()?
[m[32m+                    .to_vec1::<i64>()?[0];
[m 
                 if seg_id == current_segment {
                     // Same segment - continue accumulation
Diff in /home/jgrusewski/Work/foxhunt/ml/src/mamba/scan_algorithms.rs:504:
     let engine = ParallelScanEngine::new(device, 1_000_000);
 
     // Test addition scan
[31m-    let input = Tensor::new(&[1.0f32, 2.0f32, 3.0f32, 4.0f32, 5.0f32], &Device::Cpu)?.reshape((1, 5))?;
[m[32m+    let input =
[m[32m+        Tensor::new(&[1.0f32, 2.0f32, 3.0f32, 4.0f32, 5.0f32], &Device::Cpu)?.reshape((1, 5))?;
[m     let result = engine.sequential_scan(&input, ScanOperator::Add)?;
 
     let expected = vec![1.0, 3.0, 6.0, 10.0, 15.0];
Diff in /home/jgrusewski/Work/foxhunt/ml/src/mamba/scan_algorithms.rs:544:
     let mut engine = ParallelScanEngine::new(device, 1_000_000);
     engine.block_size = 3; // Small block size for testing
 
[31m-    let input = Tensor::new(&[1.0f32, 2.0f32, 3.0f32, 4.0f32, 5.0f32, 6.0f32], &Device::Cpu)?.reshape((1, 6))?;
[m[32m+    let input = Tensor::new(
[m[32m+        &[1.0f32, 2.0f32, 3.0f32, 4.0f32, 5.0f32, 6.0f32],
[m[32m+        &Device::Cpu,
[m[32m+    )?
[m[32m+    .reshape((1, 6))?;
[m     let result = engine.block_parallel_scan(&input, ScanOperator::Add)?;
 
     let expected = vec![1.0, 3.0, 6.0, 10.0, 15.0, 21.0];
Diff in /home/jgrusewski/Work/foxhunt/ml/src/mamba/scan_algorithms.rs:563:
     let device = Device::Cpu;
     let engine = ParallelScanEngine::new(device, 1_000_000);
 
[31m-    let input = Tensor::new(&[1.0f32, 2.0f32, 3.0f32, 1.0f32, 2.0f32], &Device::Cpu)?.reshape((1, 5))?;
[m[32m+    let input =
[m[32m+        Tensor::new(&[1.0f32, 2.0f32, 3.0f32, 1.0f32, 2.0f32], &Device::Cpu)?.reshape((1, 5))?;
[m     let segment_ids = Tensor::new(&[0i64, 0, 0, 1, 1], &Device::Cpu)?.reshape((1, 5))?;
 
     let result = engine.segmented_scan(&input, &segment_ids, ScanOperator::Add)?;
Diff in /home/jgrusewski/Work/foxhunt/ml/src/mamba/scan_algorithms.rs:645:
     let engine = ParallelScanEngine::new(device, 1_000_000);
 
     // Test with financial-precision numbers
[31m-    let input = Tensor::new(&[0.123456f32, 0.234567f32, 0.345678f32], &Device::Cpu)?.reshape((1, 3))?;
[m[32m+    let input =
[m[32m+        Tensor::new(&[0.123456f32, 0.234567f32, 0.345678f32], &Device::Cpu)?.reshape((1, 3))?;
[m     let result = engine.simd_financial_scan(&input, ScanOperator::Add)?;
 
     // Result is rank-2 (1, 3), need to flatten to rank-1 before extracting
Diff in /home/jgrusewski/Work/foxhunt/ml/src/observability/metrics.rs:24:
     let upper_str = upper.as_str();
 
     // Cryptocurrency
[31m-    if upper_str.starts_with("BTC") || upper_str.starts_with("ETH") || upper_str.ends_with("BTC") || upper_str.ends_with("ETH") || upper_str.contains('/') {
[m[32m+    if upper_str.starts_with("BTC")
[m[32m+        || upper_str.starts_with("ETH")
[m[32m+        || upper_str.ends_with("BTC")
[m[32m+        || upper_str.ends_with("ETH")
[m[32m+        || upper_str.contains('/')
[m[32m+    {
[m         return "crypto";
     }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/observability/metrics.rs:40:
     }
 
     // Equities (1-5 alphabetic chars)
[31m-    if upper_str.len() >= 1 && upper_str.len() <= 5 && upper_str.chars().all(|c| c.is_alphabetic()) {
[m[32m+    if upper_str.len() >= 1 && upper_str.len() <= 5 && upper_str.chars().all(|c| c.is_alphabetic())
[m[32m+    {
[m         return "equities";
     }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/portfolio_transformer.rs:612:
             correlations: vec![0.6; num_assets * num_assets],
             market_regime: vec![1.0, 0.0, 0.0, 0.0],
             risk_metrics: vec![0.05, 0.08, 0.03, 0.15],
[31m-            confidence_scores: (0..num_assets).map(|i| 0.7 + (i as f64 * 0.05).min(0.3)).collect(),
[m[31m-            alpha_signals: (0..num_assets).map(|i| 0.01 * (i as f64 - num_assets as f64 / 2.0) / num_assets as f64).collect(),
[m[32m+            confidence_scores: (0..num_assets)
[m[32m+                .map(|i| 0.7 + (i as f64 * 0.05).min(0.3))
[m[32m+                .collect(),
[m[32m+            alpha_signals: (0..num_assets)
[m[32m+                .map(|i| 0.01 * (i as f64 - num_assets as f64 / 2.0) / num_assets as f64)
[m[32m+                .collect(),
[m             timestamp: Utc::now(),
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/ml/src/portfolio_transformer.rs:708:
         let result = transformer.optimize_portfolio(&portfolio_state).await?;
 
         // Calculate risk contribution for each asset: RC_i = w_i * σ_i
[31m-        let risk_contributions: Vec<f64> = result.optimal_weights
[m[32m+        let risk_contributions: Vec<f64> = result
[m[32m+            .optimal_weights
[m             .iter()
             .zip(portfolio_state.volatilities.iter())
             .map(|(w, vol)| w * vol)
Diff in /home/jgrusewski/Work/foxhunt/ml/src/portfolio_transformer.rs:721:
 
         // Calculate variance of risk contributions to check diversification
         let mean_rc: f64 = risk_contributions.iter().sum::<f64>() / risk_contributions.len() as f64;
[31m-        let variance: f64 = risk_contributions.iter()
[m[32m+        let variance: f64 = risk_contributions
[m[32m+            .iter()
[m             .map(|rc| (rc - mean_rc).powi(2))
[31m-            .sum::<f64>() / risk_contributions.len() as f64;
[m[32m+            .sum::<f64>()
[m[32m+            / risk_contributions.len() as f64;
[m         let std_dev = variance.sqrt();
 
         // Risk contributions should have reasonable diversification
Diff in /home/jgrusewski/Work/foxhunt/ml/src/ppo/continuous_demo.rs:50:
     println!("\n📊 Position Sizing Recommendations:");
 
     for (scenario_name, state_vec) in market_scenarios {
[31m-        let state_tensor = Tensor::from_vec(state_vec, (1, 8), &device)?.to_dtype(candle_core::DType::F32)?;
[m[32m+        let state_tensor =
[m[32m+            Tensor::from_vec(state_vec, (1, 8), &device)?.to_dtype(candle_core::DType::F32)?;
[m 
         // Sample multiple actions to show distribution
         let mut position_sizes = Vec::new();
Diff in /home/jgrusewski/Work/foxhunt/ml/src/ppo/continuous_demo.rs:89:
     }
 
     // Show entropy (exploration level)
[31m-    let test_state = Tensor::from_vec(vec![0.5; 8], (1, 8), &device)?.to_dtype(candle_core::DType::F32)?;
[m[32m+    let test_state =
[m[32m+        Tensor::from_vec(vec![0.5; 8], (1, 8), &device)?.to_dtype(candle_core::DType::F32)?;
[m 
     let entropy = policy.entropy(&test_state)?;
     let entropy_value = entropy.flatten_all()?.to_vec1::<f32>()?[0];
Diff in /home/jgrusewski/Work/foxhunt/ml/src/ppo/continuous_demo.rs:181:
         0.3,  // Risk utilization
     ];
 
[31m-    let state_tensor = Tensor::from_vec(trading_state, (1, 16), &device)?.to_dtype(candle_core::DType::F32)?;
[m[32m+    let state_tensor =
[m[32m+        Tensor::from_vec(trading_state, (1, 16), &device)?.to_dtype(candle_core::DType::F32)?;
[m 
     // Get position sizing recommendation
     let (action_value, log_prob) = policy.sample_action(&state_tensor)?;
Diff in /home/jgrusewski/Work/foxhunt/ml/src/ppo/continuous_demo.rs:225:
             Err(e) => {
                 eprintln!("Demo failed with error: {:?}", e);
                 panic!("Demo failed: {:?}", e);
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/ppo/continuous_policy.rs:408:
     pub fn from_tensor(tensor: &Tensor) -> Result<Self, MLError> {
         // Handle both scalar (rank 0) and single-element (rank 1, shape [1]) tensors
         let position_size = if tensor.rank() == 0 {
[31m-            tensor
[m[31m-                .to_scalar::<f32>()
[m[31m-                .map_err(|e| MLError::ModelError(format!("Failed to extract position size: {}", e)))?
[m[32m+            tensor.to_scalar::<f32>().map_err(|e| {
[m[32m+                MLError::ModelError(format!("Failed to extract position size: {}", e))
[m[32m+            })?
[m         } else {
[31m-            tensor
[m[31m-                .squeeze(0)?
[m[31m-                .to_scalar::<f32>()
[m[31m-                .map_err(|e| MLError::ModelError(format!("Failed to extract position size: {}", e)))?
[m[32m+            tensor.squeeze(0)?.to_scalar::<f32>().map_err(|e| {
[m[32m+                MLError::ModelError(format!("Failed to extract position size: {}", e))
[m[32m+            })?
[m         };
         Ok(Self::new(position_size))
     }
Diff in /home/jgrusewski/Work/foxhunt/ml/src/ppo/continuous_policy.rs:658:
         let policy = ContinuousPolicyNetwork::new(config, device.clone()).unwrap();
 
         let batch_size = 5;
[31m-        let states = Tensor::from_vec(vec![0.1f32; batch_size * 4], (batch_size, 4), &device).unwrap();
[m[32m+        let states =
[m[32m+            Tensor::from_vec(vec![0.1f32; batch_size * 4], (batch_size, 4), &device).unwrap();
[m 
         let (means, log_stds) = policy.forward(&states).unwrap();
         assert_eq!(means.dims(), &[batch_size, 1]);
Diff in /home/jgrusewski/Work/foxhunt/ml/src/safety/financial_validator.rs:96:
         }
 
         // Convert to safe financial type with proper error handling
[31m-        let integer_price = Price::from_f64(prediction).map_err(|e| MLSafetyError::FinancialValidation {
[m[31m-            reason: format!("Failed to convert validated price to Price type in {}: {} - {}", context, prediction, e),
[m[31m-        })?;
[m[32m+        let integer_price =
[m[32m+            Price::from_f64(prediction).map_err(|e| MLSafetyError::FinancialValidation {
[m[32m+                reason: format!(
[m[32m+                    "Failed to convert validated price to Price type in {}: {} - {}",
[m[32m+                    context, prediction, e
[m[32m+                ),
[m[32m+            })?;
[m 
         debug!(
             "Price validation passed: {} = {:.6} -> {} (raw: {})",
Diff in /home/jgrusewski/Work/foxhunt/ml/src/safety/financial_validator.rs:175:
                 );
             }
         } else {
[31m-            warn!("Unable to convert price to Price type for precision validation in {}: {}", context, price);
[m[32m+            warn!(
[m[32m+                "Unable to convert price to Price type for precision validation in {}: {}",
[m[32m+                context, price
[m[32m+            );
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/ml/src/safety/mod.rs:354:
     ) -> SafetyResult<Price> {
         if !self.config.safety_enabled {
             return Price::from_f64(prediction).map_err(|e| MLSafetyError::FinancialValidation {
[31m-                reason: format!("Failed to convert prediction to Price in {} (safety disabled): {} - {}", context, prediction, e),
[m[32m+                reason: format!(
[m[32m+                    "Failed to convert prediction to Price in {} (safety disabled): {} - {}",
[m[32m+                    context, prediction, e
[m[32m+                ),
[m             });
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/safety/mod.rs:383:
 
         // Convert to safe financial type with proper error handling
         Price::from_f64(prediction).map_err(|e| MLSafetyError::FinancialValidation {
[31m-            reason: format!("Failed to convert validated prediction to Price in {}: {} - {}", context, prediction, e),
[m[32m+            reason: format!(
[m[32m+                "Failed to convert validated prediction to Price in {}: {} - {}",
[m[32m+                context, prediction, e
[m[32m+            ),
[m         })
     }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/safety/mod.rs:395:
     ) -> SafetyResult<Price> {
         if !self.config.safety_enabled {
             return Price::from_f64(prediction).map_err(|e| MLSafetyError::FinancialValidation {
[31m-                reason: format!("Failed to convert prediction to Price for {} (safety disabled): {} - {}", currency, prediction, e),
[m[32m+                reason: format!(
[m[32m+                    "Failed to convert prediction to Price for {} (safety disabled): {} - {}",
[m[32m+                    currency, prediction, e
[m[32m+                ),
[m             });
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/safety/mod.rs:425:
 
         // Convert to safe financial type with proper error handling
         Price::from_f64(prediction).map_err(|e| MLSafetyError::FinancialValidation {
[31m-            reason: format!("Failed to convert validated prediction to Price for {}: {} - {}", currency, prediction, e),
[m[32m+            reason: format!(
[m[32m+                "Failed to convert validated prediction to Price for {}: {} - {}",
[m[32m+                currency, prediction, e
[m[32m+            ),
[m         })
     }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/tft/temporal_attention.rs:389:
         let masked_flat = masked.flatten_all()?.to_vec1::<f32>()?;
 
         // Basic sanity check - some values should be -inf (masked)
[31m-        assert!(masked_flat.iter().any(|&v| v.is_infinite() && v.is_sign_negative()));
[m[32m+        assert!(masked_flat
[m[32m+            .iter()
[m[32m+            .any(|&v| v.is_infinite() && v.is_sign_negative()));
[m 
         // Some values should be 1.0 (not masked)
         assert!(masked_flat.iter().any(|&v| (v - 1.0).abs() < 1e-6));
Diff in /home/jgrusewski/Work/foxhunt/ml/src/tgnn/gating.rs:237:
     /// Backpropagate gradient through GLU activation
     /// Input: gradient w.r.t. GLU output (dimension n/2)
     /// Output: gradient w.r.t. GLU input (dimension n)
[31m-    fn backprop_glu(&self, x: &Array1<f64>, grad_output: &Array1<f64>) -> Result<Array1<f64>, MLError> {
[m[32m+    fn backprop_glu(
[m[32m+        &self,
[m[32m+        x: &Array1<f64>,
[m[32m+        grad_output: &Array1<f64>,
[m[32m+    ) -> Result<Array1<f64>, MLError> {
[m         let n = x.len();
         if n % 2 != 0 {
             return Err(MLError::DimensionMismatch {
Diff in /home/jgrusewski/Work/foxhunt/ml/src/tgnn/gating.rs:258:
         // d(output)/d(second_half) = first_half * sigmoid(second_half) * (1 - sigmoid(second_half))
 
         let grad_first_half = grad_output * &sigmoid_second;
[31m-        let grad_second_half = grad_output * &first_half.to_owned() * &sigmoid_second.mapv(|s| s * (1.0 - s));
[m[32m+        let grad_second_half =
[m[32m+            grad_output * &first_half.to_owned() * &sigmoid_second.mapv(|s| s * (1.0 - s));
[m 
         // Concatenate gradients
         let mut grad_input = Array1::zeros(n);
Diff in /home/jgrusewski/Work/foxhunt/ml/src/tgnn/mod.rs:814:
                 let n_samples = transformed_features.len();
                 let feature_dim = self.config.hidden_dim;
                 let flat_len = n_samples * feature_dim;
[31m-                let flat: Vec<f64> = transformed_features.into_iter()
[m[32m+                let flat: Vec<f64> = transformed_features
[m[32m+                    .into_iter()
[m                     .flat_map(|arr| arr.to_vec())
                     .collect();
[31m-                current_features = Array2::from_shape_vec((n_samples, feature_dim), flat)
[m[31m-                    .map_err(|_| MLError::DimensionMismatch {
[m[31m-                        expected: flat_len,
[m[31m-                        actual: flat_len,
[m[32m+                current_features =
[m[32m+                    Array2::from_shape_vec((n_samples, feature_dim), flat).map_err(|_| {
[m[32m+                        MLError::DimensionMismatch {
[m[32m+                            expected: flat_len,
[m[32m+                            actual: flat_len,
[m[32m+                        }
[m                     })?;
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/ml/src/tgnn/mod.rs:830:
             // Transform node features to hidden_dim for gating mechanism
             // The gating mechanism expects hidden_dim inputs and outputs
             let mut transformed_inputs = Vec::new();
[31m-            for (node_features, neighbor_messages) in
[m[31m-                node_features_batch.iter().zip(neighbor_messages_batch.iter()) {
[m[32m+            for (node_features, neighbor_messages) in node_features_batch
[m[32m+                .iter()
[m[32m+                .zip(neighbor_messages_batch.iter())
[m[32m+            {
[m                 // Use first layer to transform node features to hidden_dim
                 if let Some(first_layer) = self.message_passing.first() {
                     let transformed = first_layer
Diff in /home/jgrusewski/Work/foxhunt/ml/src/tgnn/mod.rs:861:
 
                 self.gating
                     .update_weights(&transformed_inputs, &gating_targets, learning_rate)
[31m-                    .map_err(|e| MLError::TrainingError(format!("Gating training failed: {}", e)))?;
[m[32m+                    .map_err(|e| {
[m[32m+                        MLError::TrainingError(format!("Gating training failed: {}", e))
[m[32m+                    })?;
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/src/tlob/transformer.rs:360:
 
         // Wait for all threads to complete
         for handle in handles {
[31m-            handle.join().map_err(|e| format!("Thread panicked: {:?}", e))?;
[m[32m+            handle
[m[32m+                .join()
[m[32m+                .map_err(|e| format!("Thread panicked: {:?}", e))?;
[m         }
 
         let metrics = transformer.get_metrics();
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/checkpoint_test.rs:54:
     let json = serde_json::to_string(&format).expect("Should serialize");
 
     // Deserialize back
[31m-    let deserialized: CheckpointFormat =
[m[31m-        serde_json::from_str(&json).expect("Should deserialize");
[m[32m+    let deserialized: CheckpointFormat = serde_json::from_str(&json).expect("Should deserialize");
[m 
     assert_eq!(format, deserialized);
 }
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/checkpoint_test.rs:121:
     let json = serde_json::to_string(&compression).expect("Should serialize");
 
     // Deserialize back
[31m-    let deserialized: CompressionType =
[m[31m-        serde_json::from_str(&json).expect("Should deserialize");
[m[32m+    let deserialized: CompressionType = serde_json::from_str(&json).expect("Should deserialize");
[m 
     assert_eq!(compression, deserialized);
 }
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/checkpoint_test.rs:219:
     };
 
     // Learning rate should be positive and reasonable
[31m-    let learning_rate = metadata.hyperparameters.get("learning_rate").unwrap().as_f64().unwrap();
[m[32m+    let learning_rate = metadata
[m[32m+        .hyperparameters
[m[32m+        .get("learning_rate")
[m[32m+        .unwrap()
[m[32m+        .as_f64()
[m[32m+        .unwrap();
[m     assert!(learning_rate > 0.0);
     assert!(learning_rate <= 0.01);
 }
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/checkpoint_test.rs:349:
     let json = serde_json::to_string(&metadata).expect("Should serialize");
 
     // Deserialize back
[31m-    let deserialized: CheckpointMetadata =
[m[31m-        serde_json::from_str(&json).expect("Should deserialize");
[m[32m+    let deserialized: CheckpointMetadata = serde_json::from_str(&json).expect("Should deserialize");
[m 
     // Verify key fields match
     assert_eq!(metadata.checkpoint_id, deserialized.checkpoint_id);
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/checkpoint_test.rs:447:
 
     // Verify hyperparameters are stored
     assert_eq!(metadata.hyperparameters.len(), 3);
[31m-    assert_eq!(metadata.hyperparameters.get("batch_size").unwrap().as_i64(), Some(32));
[m[31m-    assert_eq!(metadata.hyperparameters.get("dropout").unwrap().as_f64(), Some(0.1));
[m[31m-    assert_eq!(metadata.hyperparameters.get("num_layers").unwrap().as_i64(), Some(4));
[m[32m+    assert_eq!(
[m[32m+        metadata.hyperparameters.get("batch_size").unwrap().as_i64(),
[m[32m+        Some(32)
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        metadata.hyperparameters.get("dropout").unwrap().as_f64(),
[m[32m+        Some(0.1)
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        metadata.hyperparameters.get("num_layers").unwrap().as_i64(),
[m[32m+        Some(4)
[m[32m+    );
[m }
 
 /// Test: Checkpoint format - all formats compatible
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/dqn_edge_cases_test.rs:11:
 #![allow(unused_crate_dependencies)]
 
 use ml::dqn::{
[31m-    DQNConfig, Experience, ReplayBuffer, ReplayBufferConfig,
[m[31m-    TradingAction, TradingState,
[m[32m+    DQNConfig, Experience, ReplayBuffer, ReplayBufferConfig, TradingAction, TradingState,
[m };
 use std::path::PathBuf;
 
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/dqn_edge_cases_test.rs:106:
     // Buffer should not exceed capacity
     let stats = buffer.stats();
     assert_eq!(stats.size, 10, "Buffer should cap at capacity");
[31m-    assert_eq!(
[m[31m-        stats.capacity, 10,
[m[31m-        "Capacity should remain unchanged"
[m[31m-    );
[m[31m-    assert_eq!(
[m[31m-        stats.experiences_added, 20,
[m[31m-        "Should track total additions"
[m[31m-    );
[m[32m+    assert_eq!(stats.capacity, 10, "Capacity should remain unchanged");
[m[32m+    assert_eq!(stats.experiences_added, 20, "Should track total additions");
[m }
 
 /// Test: Replay buffer - batch size larger than buffer
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/dqn_edge_cases_test.rs:332:
     );
 
     assert!(experience.done, "Terminal state should have done=true");
[31m-    assert!(experience.reward_f32() < 0.0, "Terminal state often has negative reward");
[m[32m+    assert!(
[m[32m+        experience.reward_f32() < 0.0,
[m[32m+        "Terminal state often has negative reward"
[m[32m+    );
[m }
 
 /// Test: Trading action variants
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/dqn_edge_cases_test.rs:433:
 #[test]
 fn test_experience_validity() {
     // Valid experience
[31m-    let valid_exp = Experience::new(
[m[31m-        vec![1.0, 2.0],
[m[31m-        0,
[m[31m-        1.0,
[m[31m-        vec![1.0, 2.0],
[m[31m-        false,
[m[31m-    );
[m[32m+    let valid_exp = Experience::new(vec![1.0, 2.0], 0, 1.0, vec![1.0, 2.0], false);
[m     assert!(valid_exp.is_valid());
 
     // Invalid experience - empty state
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/dqn_edge_cases_test.rs:446:
[31m-    let invalid_exp = Experience::new(
[m[31m-        vec![],
[m[31m-        0,
[m[31m-        1.0,
[m[31m-        vec![1.0, 2.0],
[m[31m-        false,
[m[31m-    );
[m[32m+    let invalid_exp = Experience::new(vec![], 0, 1.0, vec![1.0, 2.0], false);
[m     assert!(!invalid_exp.is_valid());
 
     // Invalid experience - mismatched state dimensions
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/dqn_edge_cases_test.rs:456:
[31m-    let invalid_exp2 = Experience::new(
[m[31m-        vec![1.0, 2.0],
[m[31m-        0,
[m[31m-        1.0,
[m[31m-        vec![1.0],
[m[31m-        false,
[m[31m-    );
[m[32m+    let invalid_exp2 = Experience::new(vec![1.0, 2.0], 0, 1.0, vec![1.0], false);
[m     assert!(!invalid_exp2.is_valid());
 }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/dqn_edge_cases_test.rs:490:
 
     // Should be able to sample with default batch size
     let sample_result = buffer.sample(None);
[31m-    assert!(sample_result.is_ok(), "Should sample with default batch size");
[m[32m+    assert!(
[m[32m+        sample_result.is_ok(),
[m[32m+        "Should sample with default batch size"
[m[32m+    );
[m 
     // Should be able to sample with custom batch size
     let sample_result2 = buffer.sample(Some(16));
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/dqn_edge_cases_test.rs:497:
[31m-    assert!(sample_result2.is_ok(), "Should sample with custom batch size");
[m[32m+    assert!(
[m[32m+        sample_result2.is_ok(),
[m[32m+        "Should sample with custom batch size"
[m[32m+    );
[m     assert_eq!(sample_result2.unwrap().batch_size, 16);
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/inference_engine_test.rs:378:
 
     // Verify key fields match
     assert_eq!(config.base_prediction, deserialized.base_prediction);
[31m-    assert_eq!(
[m[31m-        config.neutral_prediction,
[m[31m-        deserialized.neutral_prediction
[m[31m-    );
[m[31m-    assert_eq!(
[m[31m-        config.default_confidence,
[m[31m-        deserialized.default_confidence
[m[31m-    );
[m[32m+    assert_eq!(config.neutral_prediction, deserialized.neutral_prediction);
[m[32m+    assert_eq!(config.default_confidence, deserialized.default_confidence);
[m }
 
 /// Test: Inference engine config - serialization
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/inference_engine_test.rs:405:
         config.max_concurrent_requests,
         deserialized.max_concurrent_requests
     );
[31m-    assert_eq!(
[m[31m-        config.default_timeout_us,
[m[31m-        deserialized.default_timeout_us
[m[31m-    );
[m[32m+    assert_eq!(config.default_timeout_us, deserialized.default_timeout_us);
[m     assert_eq!(config.max_batch_size, deserialized.max_batch_size);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/inference_engine_test.rs:433:
         config1.max_concurrent_requests,
         config2.max_concurrent_requests
     );
[31m-    assert_eq!(
[m[31m-        config1.default_timeout_us,
[m[31m-        config2.default_timeout_us
[m[31m-    );
[m[32m+    assert_eq!(config1.default_timeout_us, config2.default_timeout_us);
[m     assert_eq!(config1.max_batch_size, config2.max_batch_size);
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/mamba_training_test.rs:52:
         hardware_aware: false,
         target_latency_us: 50, // Tighter latency for inference
         max_seq_len: 512,
[31m-        learning_rate: 0.0,    // Not used in inference
[m[31m-        weight_decay: 0.0,     // Not used in inference
[m[31m-        grad_clip: 0.0,        // Not used in inference
[m[31m-        warmup_steps: 0,       // Not used in inference
[m[31m-        batch_size: 1,         // Single sample inference
[m[32m+        learning_rate: 0.0, // Not used in inference
[m[32m+        weight_decay: 0.0,  // Not used in inference
[m[32m+        grad_clip: 0.0,     // Not used in inference
[m[32m+        warmup_steps: 0,    // Not used in inference
[m[32m+        batch_size: 1,      // Single sample inference
[m         seq_len: 128,
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/mamba_training_test.rs:233:
     assert!(compress_result.is_ok(), "Compression should succeed");
 
     let decompress_result = selective_state.decompress_state_component(index, &mut state);
[31m-    assert!(
[m[31m-        decompress_result.is_ok(),
[m[31m-        "Decompression should succeed"
[m[31m-    );
[m[32m+    assert!(decompress_result.is_ok(), "Decompression should succeed");
[m }
 
 /// Test: Importance score updates - training workflow
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/mamba_training_test.rs:251:
     let seq_len = config.seq_len;
     let d_model = config.d_model;
 
[31m-    let input = Tensor::randn(
[m[31m-        0.0,
[m[31m-        1.0,
[m[31m-        &[batch_size, seq_len, d_model],
[m[31m-        &device,
[m[31m-    )
[m[31m-    .unwrap();
[m[32m+    let input = Tensor::randn(0.0, 1.0, &[batch_size, seq_len, d_model], &device).unwrap();
[m 
     // Update importance scores
     let result = selective_state.update_importance_scores(&input, &mut state);
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/mamba_training_test.rs:314:
 
         // Update importance scores
         let result = selective_state.update_importance_scores(&input, &mut state);
[31m-        assert!(
[m[31m-            result.is_ok(),
[m[31m-            "Step {} importance update failed",
[m[31m-            step
[m[31m-        );
[m[32m+        assert!(result.is_ok(), "Step {} importance update failed", step);
[m 
         // Verify active indices are maintained
         assert!(
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/mamba_training_test.rs:450:
     let device = Device::Cpu;
 
     // Valid shapes
[31m-    let valid_shapes = vec![
[m[31m-        vec![1, 128, 256],
[m[31m-        vec![4, 128, 256],
[m[31m-        vec![8, 256, 512],
[m[31m-    ];
[m[32m+    let valid_shapes = vec![vec![1, 128, 256], vec![4, 128, 256], vec![8, 256, 512]];
[m 
     for shape in valid_shapes {
         let tensor = Tensor::randn(0.0, 1.0, &shape[..], &device);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/safety_comprehensive_test.rs:134:
     let config = MLSafetyConfig::default();
 
     // Production must have safety enabled
[31m-    assert!(config.safety_enabled, "Production requires safety_enabled = true");
[m[32m+    assert!(
[m[32m+        config.safety_enabled,
[m[32m+        "Production requires safety_enabled = true"
[m[32m+    );
[m 
     // Production must have NaN/Infinity checks
     assert!(
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/safety_comprehensive_test.rs:430:
     let json = serde_json::to_string(&config).expect("Should serialize");
 
     // Deserialize back
[31m-    let deserialized: MLSafetyConfig =
[m[31m-        serde_json::from_str(&json).expect("Should deserialize");
[m[32m+    let deserialized: MLSafetyConfig = serde_json::from_str(&json).expect("Should deserialize");
[m 
     // Verify fields match
     assert_eq!(config.safety_enabled, deserialized.safety_enabled);
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/safety_comprehensive_test.rs:438:
[31m-    assert_eq!(
[m[31m-        config.max_tensor_elements,
[m[31m-        deserialized.max_tensor_elements
[m[31m-    );
[m[32m+    assert_eq!(config.max_tensor_elements, deserialized.max_tensor_elements);
[m     assert_eq!(
         config.max_inference_timeout_ms,
         deserialized.max_inference_timeout_ms
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:13:
 use std::sync::Arc;
 use std::time::Duration;
 
[31m-use ml::deployment::hot_swap::{AtomicModelContainer, HotSwapEngine, HotSwapConfig};
[m use ml::batch_processing::{AlignedBuffer, MemoryPool, MemoryPoolConfig};
[31m-use ml::{ModelType, ModelVersion, MLError};
[m[32m+use ml::deployment::hot_swap::{AtomicModelContainer, HotSwapConfig, HotSwapEngine};
[m[32m+use ml::{MLError, ModelType, ModelVersion};
[m 
 // ==============================================================================
 // HOT-SWAP UNSAFE BLOCK TESTS (6 unsafe blocks)
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:30:
     let model1_arc = Arc::from(model1);
     let version1 = ModelVersion::new(1, 0, 0);
 
[31m-    let container = AtomicModelContainer::new(
[m[31m-        model1_arc.clone(),
[m[31m-        ModelType::DQN,
[m[31m-        version1.clone(),
[m[31m-        5,
[m[31m-    );
[m[32m+    let container =
[m[32m+        AtomicModelContainer::new(model1_arc.clone(), ModelType::DQN, version1.clone(), 5);
[m 
     // Perform swap - internally uses unsafe Arc::from_raw at line 175
     let model2 = ml::model_factory::create_dqn_wrapper().unwrap();
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:42:
     let model2_arc = Arc::from(model2);
     let version2 = ModelVersion::new(1, 1, 0);
 
[31m-    let result = container.swap_model(
[m[31m-        model2_arc,
[m[31m-        version2.clone(),
[m[31m-        Duration::from_secs(30),
[m[31m-    ).await;
[m[32m+    let result = container
[m[32m+        .swap_model(model2_arc, version2.clone(), Duration::from_secs(30))
[m[32m+        .await;
[m 
     assert!(result.is_ok(), "Swap failed: {:?}", result.err());
 
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:78:
 
     let handle1 = tokio::spawn(async move {
         let model = ml::model_factory::create_dqn_wrapper().unwrap();
[31m-        container_clone1.swap_model(
[m[31m-            Arc::from(model),
[m[31m-            ModelVersion::new(1, 1, 0),
[m[31m-            Duration::from_secs(30),
[m[31m-        ).await
[m[32m+        container_clone1
[m[32m+            .swap_model(
[m[32m+                Arc::from(model),
[m[32m+                ModelVersion::new(1, 1, 0),
[m[32m+                Duration::from_secs(30),
[m[32m+            )
[m[32m+            .await
[m     });
 
     let handle2 = tokio::spawn(async move {
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:89:
         let model = ml::model_factory::create_dqn_wrapper().unwrap();
[31m-        container_clone2.swap_model(
[m[31m-            Arc::from(model),
[m[31m-            ModelVersion::new(1, 2, 0),
[m[31m-            Duration::from_secs(30),
[m[31m-        ).await
[m[32m+        container_clone2
[m[32m+            .swap_model(
[m[32m+                Arc::from(model),
[m[32m+                ModelVersion::new(1, 2, 0),
[m[32m+                Duration::from_secs(30),
[m[32m+            )
[m[32m+            .await
[m     });
 
     let result1 = handle1.await.expect("Task panicked");
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:117:
 
     // Perform swap to create rollback snapshot
     let model2 = ml::model_factory::create_dqn_wrapper().unwrap();
[31m-    container.swap_model(
[m[31m-        Arc::from(model2),
[m[31m-        ModelVersion::new(1, 1, 0),
[m[31m-        Duration::from_secs(30),
[m[31m-    ).await.expect("Initial swap should succeed");
[m[32m+    container
[m[32m+        .swap_model(
[m[32m+            Arc::from(model2),
[m[32m+            ModelVersion::new(1, 1, 0),
[m[32m+            Duration::from_secs(30),
[m[32m+        )
[m[32m+        .await
[m[32m+        .expect("Initial swap should succeed");
[m 
     // Try concurrent rollbacks to trigger CAS failure
     let container_clone1 = Arc::clone(&container);
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:128:
     let container_clone2 = Arc::clone(&container);
 
[31m-    let handle1 = tokio::spawn(async move {
[m[31m-        container_clone1.rollback(Duration::from_secs(15)).await
[m[31m-    });
[m[32m+    let handle1 =
[m[32m+        tokio::spawn(async move { container_clone1.rollback(Duration::from_secs(15)).await });
[m 
[31m-    let handle2 = tokio::spawn(async move {
[m[31m-        container_clone2.rollback(Duration::from_secs(15)).await
[m[31m-    });
[m[32m+    let handle2 =
[m[32m+        tokio::spawn(async move { container_clone2.rollback(Duration::from_secs(15)).await });
[m 
     let result1 = handle1.await.expect("Task panicked");
     let result2 = handle2.await.expect("Task panicked");
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:152:
     let model1_arc = Arc::from(model1);
     let version1 = ModelVersion::new(1, 0, 0);
 
[31m-    let container = AtomicModelContainer::new(
[m[31m-        model1_arc.clone(),
[m[31m-        ModelType::DQN,
[m[31m-        version1.clone(),
[m[31m-        5,
[m[31m-    );
[m[32m+    let container =
[m[32m+        AtomicModelContainer::new(model1_arc.clone(), ModelType::DQN, version1.clone(), 5);
[m 
     // Swap to version 2
     let model2 = ml::model_factory::create_dqn_wrapper().unwrap();
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:164:
[31m-    container.swap_model(
[m[31m-        Arc::from(model2),
[m[31m-        ModelVersion::new(1, 1, 0),
[m[31m-        Duration::from_secs(30),
[m[31m-    ).await.expect("Swap should succeed");
[m[32m+    container
[m[32m+        .swap_model(
[m[32m+            Arc::from(model2),
[m[32m+            ModelVersion::new(1, 1, 0),
[m[32m+            Duration::from_secs(30),
[m[32m+        )
[m[32m+        .await
[m[32m+        .expect("Swap should succeed");
[m 
     // Rollback to version 1 - triggers cleanup at line 349
     let rollback_result = container.rollback(Duration::from_secs(15)).await;
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:172:
[31m-    assert!(rollback_result.is_ok(), "Rollback failed: {:?}", rollback_result.err());
[m[32m+    assert!(
[m[32m+        rollback_result.is_ok(),
[m[32m+        "Rollback failed: {:?}",
[m[32m+        rollback_result.err()
[m[32m+    );
[m 
     // Verify we're back to version 1
     let metadata = container.get_metadata().await;
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:219:
 
     // Perform several operations
     let model2 = ml::model_factory::create_dqn_wrapper().unwrap();
[31m-    container.swap_model(
[m[31m-        Arc::from(model2),
[m[31m-        ModelVersion::new(1, 1, 0),
[m[31m-        Duration::from_secs(30),
[m[31m-    ).await.expect("Swap should succeed");
[m[32m+    container
[m[32m+        .swap_model(
[m[32m+            Arc::from(model2),
[m[32m+            ModelVersion::new(1, 1, 0),
[m[32m+            Duration::from_secs(30),
[m[32m+        )
[m[32m+        .await
[m[32m+        .expect("Swap should succeed");
[m 
     let _ = container.get_current_model().await;
 
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:264:
         let handle = tokio::spawn(async move {
             let model = ml::model_factory::create_dqn_wrapper().unwrap();
             let version = ModelVersion::new(1, i, 0);
[31m-            container_clone.swap_model(
[m[31m-                Arc::from(model),
[m[31m-                version,
[m[31m-                Duration::from_secs(30),
[m[31m-            ).await
[m[32m+            container_clone
[m[32m+                .swap_model(Arc::from(model), version, Duration::from_secs(30))
[m[32m+                .await
[m         });
         writer_handles.push(handle);
     }
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:353:
     let mut pool = MemoryPool::new(config).expect("Pool creation should succeed");
 
     // Get buffer and initialize
[31m-    let mut buffer1 = pool.get_buffer(512).expect("Buffer allocation should succeed");
[m[32m+    let mut buffer1 = pool
[m[32m+        .get_buffer(512)
[m[32m+        .expect("Buffer allocation should succeed");
[m     buffer1.set_len(512);
 
     unsafe {
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:443:
         ModelVersion::new(1, 0, 0),
         5,
     ));
[31m-    engine.register_container(ModelType::DQN, container_dqn).await.expect("Registration should succeed");
[m[32m+    engine
[m[32m+        .register_container(ModelType::DQN, container_dqn)
[m[32m+        .await
[m[32m+        .expect("Registration should succeed");
[m 
     // Hot-swap DQN model
     let new_model_dqn = ml::model_factory::create_dqn_wrapper().unwrap();
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:450:
[31m-    let swap_result = engine.hot_swap(
[m[31m-        ModelType::DQN,
[m[31m-        Arc::from(new_model_dqn),
[m[31m-        ModelVersion::new(1, 1, 0),
[m[31m-    ).await;
[m[32m+    let swap_result = engine
[m[32m+        .hot_swap(
[m[32m+            ModelType::DQN,
[m[32m+            Arc::from(new_model_dqn),
[m[32m+            ModelVersion::new(1, 1, 0),
[m[32m+        )
[m[32m+        .await;
[m 
[31m-    assert!(swap_result.is_ok(), "Hot-swap failed: {:?}", swap_result.err());
[m[32m+    assert!(
[m[32m+        swap_result.is_ok(),
[m[32m+        "Hot-swap failed: {:?}",
[m[32m+        swap_result.err()
[m[32m+    );
[m 
     // Get model and verify
[31m-    let model = engine.get_model(ModelType::DQN).await.expect("Should retrieve model");
[m[32m+    let model = engine
[m[32m+        .get_model(ModelType::DQN)
[m[32m+        .await
[m[32m+        .expect("Should retrieve model");
[m     assert!(model.is_ready());
 }
 
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:477:
     for i in 1..=10 {
         let model = ml::model_factory::create_dqn_wrapper().unwrap();
         let version = ModelVersion::new(1, i, 0);
[31m-        container.swap_model(
[m[31m-            Arc::from(model),
[m[31m-            version,
[m[31m-            Duration::from_secs(30),
[m[31m-        ).await.expect("Swap should succeed");
[m[32m+        container
[m[32m+            .swap_model(Arc::from(model), version, Duration::from_secs(30))
[m[32m+            .await
[m[32m+            .expect("Swap should succeed");
[m     }
 
     // Verify rollback queue is limited
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:488:
     let rollback_status = container.get_rollback_status().await;
[31m-    assert!(rollback_status.available_snapshots <= max_history,
[m[32m+    assert!(
[m[32m+        rollback_status.available_snapshots <= max_history,
[m         "Rollback queue exceeded max: {} > {}",
         rollback_status.available_snapshots,
         max_history
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:506:
 
     // Simulate high throughput batch processing
     for batch_idx in 0..100 {
[31m-        let mut buffer = pool.get_buffer(1024).expect("Buffer allocation should succeed");
[m[32m+        let mut buffer = pool
[m[32m+            .get_buffer(1024)
[m[32m+            .expect("Buffer allocation should succeed");
[m         buffer.set_len(1024);
 
         // Process batch with unsafe slice access
Diff in /home/jgrusewski/Work/foxhunt/ml/tests/unsafe_validation_tests.rs:603:
                 } else {
                     // Writer
                     let model = ml::model_factory::create_dqn_wrapper().unwrap();
[31m-                    let _ = container_clone.swap_model(
[m[31m-                        Arc::from(model),
[m[31m-                        ModelVersion::new(1, i, 0),
[m[31m-                        Duration::from_secs(30),
[m[31m-                    ).await;
[m[32m+                    let _ = container_clone
[m[32m+                        .swap_model(
[m[32m+                            Arc::from(model),
[m[32m+                            ModelVersion::new(1, i, 0),
[m[32m+                            Duration::from_secs(30),
[m[32m+                        )
[m[32m+                        .await;
[m                 }
             });
             handles.push(handle);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/risk/src/compliance.rs:1907:
     /// Vector of active compliance rules sorted by priority
     pub async fn get_all_compliance_rules(&self) -> Vec<ComplianceRule> {
         let rules = self.compliance_rules.read().await;
[31m-        let mut active_rules: Vec<_> = rules
[m[31m-            .values()
[m[31m-            .filter(|r| r.active)
[m[31m-            .cloned()
[m[31m-            .collect();
[m[32m+        let mut active_rules: Vec<_> = rules.values().filter(|r| r.active).cloned().collect();
[m 
         // Sort by priority (descending) then by name
         active_rules.sort_by(|a, b| {
Diff in /home/jgrusewski/Work/foxhunt/risk/src/lib.rs:161:
 // Tests import these types directly from the risk crate
 
 // Export key types from submodules for test compatibility
[31m-pub use var_calculator::var_engine::RealVaREngine;
[m[31m-pub use safety::kill_switch::AtomicKillSwitch;
[m pub use kelly_sizing::KellySizer;
 pub use risk_engine::RiskEngine;
[32m+pub use safety::kill_switch::AtomicKillSwitch;
[m pub use stress_tester::StressTester;
[32m+pub use var_calculator::var_engine::RealVaREngine;
[m 
 // Export compliance types first
 pub use compliance::ComplianceValidator;
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/kill_switch.rs:78:
                         // Cascade: Portfolio halt also halts all its strategies
                         // Store cascade flag for broader halt interpretation
                         scoped.insert(format!("cascade:portfolio:{id}"), true);
[31m-                    }
[m[32m+                    },
[m                     KillSwitchScope::Strategy(id) => {
                         // Cascade: Strategy halt can affect related strategies
                         scoped.insert(format!("cascade:strategy:{id}"), true);
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/kill_switch.rs:85:
[31m-                    }
[m[31m-                    _ => {}
[m[32m+                    },
[m[32m+                    _ => {},
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/kill_switch.rs:102:
                         "timestamp": Utc::now().to_rfc3339()
                     });
 
[31m-                    if let Err(e) = conn.publish::<_, _, ()>(&channel, message.to_string()).await {
[m[32m+                    if let Err(e) = conn
[m[32m+                        .publish::<_, _, ()>(&channel, message.to_string())
[m[32m+                        .await
[m[32m+                    {
[m                         self.failure_count.fetch_add(1, Ordering::Relaxed);
[31m-                        return Err(RiskError::Config(format!("Failed to publish to Redis: {e}")));
[m[32m+                        return Err(RiskError::Config(format!(
[m[32m+                            "Failed to publish to Redis: {e}"
[m[32m+                        )));
[m                     }
[31m-                }
[m[32m+                },
[m                 Err(e) => {
                     self.failure_count.fetch_add(1, Ordering::Relaxed);
[31m-                    return Err(RiskError::Config(format!("Failed to get Redis connection: {e}")));
[m[31m-                }
[m[32m+                    return Err(RiskError::Config(format!(
[m[32m+                        "Failed to get Redis connection: {e}"
[m[32m+                    )));
[m[32m+                },
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/kill_switch.rs:145:
                             // Check if parent portfolio has cascade halt
                             scoped.iter().any(|(k, &v)| {
                                 v && k.starts_with("cascade:portfolio:")
[31m-                                    // In production, would check if strategy belongs to halted portfolio
[m[32m+                                // In production, would check if strategy belongs to halted portfolio
[m                             })
[31m-                        }
[m[32m+                        },
[m                         _ => false,
                     };
 
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/kill_switch.rs:189:
                 match s {
                     KillSwitchScope::Portfolio(id) => {
                         scoped.remove(&format!("cascade:portfolio:{id}"));
[31m-                    }
[m[32m+                    },
[m                     KillSwitchScope::Strategy(id) => {
                         scoped.remove(&format!("cascade:strategy:{id}"));
[31m-                    }
[m[31m-                    _ => {}
[m[32m+                    },
[m[32m+                    _ => {},
[m                 }
             },
         }
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/kill_switch.rs:210:
                             "timestamp": Utc::now().to_rfc3339()
                         });
 
[31m-                        if let Err(e) = conn.publish::<_, _, ()>(&channel, message.to_string()).await {
[m[32m+                        if let Err(e) = conn
[m[32m+                            .publish::<_, _, ()>(&channel, message.to_string())
[m[32m+                            .await
[m[32m+                        {
[m                             self.failure_count.fetch_add(1, Ordering::Relaxed);
[31m-                            return Err(RiskError::Config(format!("Failed to publish reset to Redis: {e}")));
[m[32m+                            return Err(RiskError::Config(format!(
[m[32m+                                "Failed to publish reset to Redis: {e}"
[m[32m+                            )));
[m                         }
[31m-                    }
[m[32m+                    },
[m                     Err(e) => {
                         self.failure_count.fetch_add(1, Ordering::Relaxed);
[31m-                        return Err(RiskError::Config(format!("Failed to get Redis connection: {e}")));
[m[31m-                    }
[m[32m+                        return Err(RiskError::Config(format!(
[m[32m+                            "Failed to get Redis connection: {e}"
[m[32m+                        )));
[m[32m+                    },
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/kill_switch.rs:287:
 
         // If Redis is configured, try to ping it
         if let Some(ref client) = self.redis_client {
[31m-            if let Ok(mut conn) = client.get_multiplexed_async_connection().await { if let Ok(()) = redis::cmd("PING").exec_async(&mut conn).await { Ok(true) } else {
[m[32m+            if let Ok(mut conn) = client.get_multiplexed_async_connection().await {
[m[32m+                if let Ok(()) = redis::cmd("PING").exec_async(&mut conn).await {
[m[32m+                    Ok(true)
[m[32m+                } else {
[m[32m+                    self.failure_count.fetch_add(1, Ordering::Relaxed);
[m[32m+                    Ok(false)
[m[32m+                }
[m[32m+            } else {
[m                 self.failure_count.fetch_add(1, Ordering::Relaxed);
                 Ok(false)
[31m-            } } else {
[m[31m-                self.failure_count.fetch_add(1, Ordering::Relaxed);
[m[31m-                Ok(false)
[m             }
         } else {
             // No Redis configured, consider healthy (test mode)
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/kill_switch.rs:720:
     #[tokio::test]
     async fn test_unix_socket_kill_switch() -> RiskResult<()> {
         let config = KillSwitchConfig::default();
[31m-        let unix_switch = UnixSocketKillSwitch::new_test(
[m[31m-            "/tmp/foxhunt_killswitch.sock".to_string(),
[m[31m-            config,
[m[31m-        );
[m[32m+        let unix_switch =
[m[32m+            UnixSocketKillSwitch::new_test("/tmp/foxhunt_killswitch.sock".to_string(), config);
[m 
         assert!(!unix_switch.is_triggered());
 
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/position_limiter.rs:106:
                 (portfolio_value * 0.10).map_err(|_| RiskError::ValidationError {
                     message: "Failed to calculate default position size".to_owned(),
                 })?
[31m-            }
[m[32m+            },
[m             Err(e) => return Err(e), // Propagate other errors
         };
 
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/position_limiter.rs:404:
         let cache_key = ("account_001".to_owned(), symbol.clone());
         if let Some(cached) = limiter.position_cache.get(&cache_key) {
             // Test with zero TTL - should always be expired
[31m-            assert!(cached.is_expired(Duration::from_nanos(0)),
[m[31m-                "Position should be expired with zero TTL");
[m[32m+            assert!(
[m[32m+                cached.is_expired(Duration::from_nanos(0)),
[m[32m+                "Position should be expired with zero TTL"
[m[32m+            );
[m 
             // Test with long TTL - should not be expired
[31m-            assert!(!cached.is_expired(Duration::from_secs(3600)),
[m[31m-                "Position should not be expired with 1 hour TTL");
[m[32m+            assert!(
[m[32m+                !cached.is_expired(Duration::from_secs(3600)),
[m[32m+                "Position should not be expired with 1 hour TTL"
[m[32m+            );
[m         }; // Add semicolon to drop temporary earlier
     }
 
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/position_limiter.rs:640:
         let cached_pos = cached.unwrap();
 
         // Should NOT be expired with a long TTL
[31m-        assert!(!cached_pos.is_expired(Duration::from_secs(3600)),
[m[31m-            "Position should not be expired with 1 hour TTL");
[m[32m+        assert!(
[m[32m+            !cached_pos.is_expired(Duration::from_secs(3600)),
[m[32m+            "Position should not be expired with 1 hour TTL"
[m[32m+        );
[m 
         // Should be expired with a zero TTL
[31m-        assert!(cached_pos.is_expired(Duration::from_nanos(0)),
[m[31m-            "Position should be expired with zero TTL");
[m[32m+        assert!(
[m[32m+            cached_pos.is_expired(Duration::from_nanos(0)),
[m[32m+            "Position should be expired with zero TTL"
[m[32m+        );
[m 
         drop(cached_pos);
 
Diff in /home/jgrusewski/Work/foxhunt/risk/src/safety/safety_coordinator.rs:505:
             .await?;
 
         // Should receive event (with timeout)
[31m-        let result =
[m[31m-            tokio::time::timeout(Duration::from_millis(100), event_rx.recv()).await;
[m[32m+        let result = tokio::time::timeout(Duration::from_millis(100), event_rx.recv()).await;
[m 
         match result {
             Ok(Ok(_event)) => {
Diff in /home/jgrusewski/Work/foxhunt/risk/src/var_calculator/mod.rs:9:
 
 // Re-export key types for external use
 pub use var_engine::{
[31m-    RealVaREngine as VarCalculator,
[m[31m-    VaRMethodology as VarMethod,
[m[31m-    ComprehensiveVaRResult as VarResult,
[m[31m-    HistoricalPrice,
[m[31m-    PositionInfo,
[m[31m-    StressScenario,
[m[31m-    StressTestResult,
[m[32m+    ComprehensiveVaRResult as VarResult, HistoricalPrice, PositionInfo,
[m[32m+    RealVaREngine as VarCalculator, StressScenario, StressTestResult, VaRMethodology as VarMethod,
[m };
 
Diff in /home/jgrusewski/Work/foxhunt/risk/src/var_calculator/parametric.rs:120:
 
         // Calculate portfolio variance: w^T * Σ * w
         let portfolio_variance = portfolio_weights.transpose() * covar_matrix * portfolio_weights;
[31m-        let portfolio_vol = portfolio_variance.get(0).copied().ok_or_else(|| {
[m[31m-            anyhow::anyhow!("Failed to calculate portfolio variance - invalid matrix dimensions")
[m[31m-        })?.sqrt();
[m[32m+        let portfolio_vol = portfolio_variance
[m[32m+            .get(0)
[m[32m+            .copied()
[m[32m+            .ok_or_else(|| {
[m[32m+                anyhow::anyhow!(
[m[32m+                    "Failed to calculate portfolio variance - invalid matrix dimensions"
[m[32m+                )
[m[32m+            })?
[m[32m+            .sqrt();
[m 
         // Get z-score for confidence level
         let z_score = Self::get_z_score(self.confidence_level);
Diff in /home/jgrusewski/Work/foxhunt/risk/src/var_calculator/parametric.rs:136:
 
         let var_amount = var_percentage * portfolio_value_f64;
 
[31m-        FromPrimitive::from_f64(var_amount.abs()).ok_or_else(|| {
[m[31m-            anyhow::anyhow!("Failed to convert VaR amount to Decimal: {var_amount}")
[m[31m-        })
[m[32m+        FromPrimitive::from_f64(var_amount.abs())
[m[32m+            .ok_or_else(|| anyhow::anyhow!("Failed to convert VaR amount to Decimal: {var_amount}"))
[m     }
 
     /// Get z-score for given confidence level
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/circuit_breaker_comprehensive_tests.rs:4:
 
 #![allow(unused_crate_dependencies)]
 
[31m-
[m // Import circuit breaker types
[31m-use risk::circuit_breaker::{CircuitBreakerConfig, CircuitBreakerState};
[m[31m-use common::types::Price;
[m use chrono::Utc;
[32m+use common::types::Price;
[m[32m+use risk::circuit_breaker::{CircuitBreakerConfig, CircuitBreakerState};
[m 
 #[cfg(test)]
 mod circuit_breaker_state_tests {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/circuit_breaker_comprehensive_tests.rs:61:
 
         assert_eq!(state.is_active, deserialized.is_active);
         assert_eq!(state.account_id, deserialized.account_id);
[31m-        assert_eq!(state.consecutive_violations, deserialized.consecutive_violations);
[m[32m+        assert_eq!(
[m[32m+            state.consecutive_violations,
[m[32m+            deserialized.consecutive_violations
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/circuit_breaker_comprehensive_tests.rs:111:
 
 #[cfg(test)]
 mod dynamic_limit_calculation_tests {
[31m-    
[m 
     #[test]
     fn test_daily_loss_limit_calculation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/circuit_breaker_comprehensive_tests.rs:326:
     fn test_cooldown_expiration() {
         let cooldown_duration = 300; // 5 minutes in seconds
         let activation_time = Utc::now();
[31m-        let current_time = activation_time + chrono::Duration::seconds(cooldown_duration as i64 + 10);
[m[32m+        let current_time =
[m[32m+            activation_time + chrono::Duration::seconds(cooldown_duration as i64 + 10);
[m 
         let elapsed = (current_time - activation_time).num_seconds();
         assert!(elapsed > cooldown_duration as i64);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:4:
 
 #![allow(unused_crate_dependencies)]
 
[32m+use chrono::{Duration, Utc};
[m use std::collections::HashMap;
[31m-use chrono::{Utc, Duration};
[m 
 #[cfg(test)]
 mod mifid_ii_compliance_tests {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:173:
             "action",
             "instrument",
             "quantity",
[31m-            "price"
[m[32m+            "price",
[m         ];
 
         let audit_entry = HashMap::from([
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:207:
 
 #[cfg(test)]
 mod violation_detection_tests {
[31m-    
[m 
     #[test]
     fn test_position_limit_violation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:269:
 
 #[cfg(test)]
 mod violation_severity_tests {
[31m-    
[m 
     #[test]
     fn test_severity_levels() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:309:
 
 #[cfg(test)]
 mod regulatory_flag_tests {
[31m-    
[m 
     #[test]
     fn test_large_in_scale_flag() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:341:
     fn test_multiple_regulatory_flags() {
         let mut flags: Vec<String> = Vec::new();
 
[31m-        if true { // Is algorithmic
[m[32m+        if true {
[m[32m+            // Is algorithmic
[m             flags.push("ALGO".to_string());
         }
[31m-        if true { // Large in scale
[m[32m+        if true {
[m[32m+            // Large in scale
[m             flags.push("LIS".to_string());
         }
         if false { // Not a short sale
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:351:
[31m-            // No flag
[m[32m+             // No flag
[m         }
 
         assert_eq!(flags.len(), 2);
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:359:
 
 #[cfg(test)]
 mod compliance_warning_tests {
[31m-    
[m 
     #[test]
     fn test_approaching_limit_warning() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:400:
 
 #[cfg(test)]
 mod dodd_frank_compliance_tests {
[31m-    
[m 
     #[test]
     fn test_swap_reporting_requirement() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:432:
 
 #[cfg(test)]
 mod basel_iii_compliance_tests {
[31m-    
[m 
     #[test]
     fn test_capital_adequacy_ratio() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:509:
 
 #[cfg(test)]
 mod client_suitability_tests {
[31m-    
[m 
     #[test]
     fn test_risk_tolerance_matching() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/compliance_comprehensive_tests.rs:547:
 
 #[cfg(test)]
 mod compliance_edge_cases {
[31m-    
[m 
     #[test]
     fn test_zero_position_compliance() {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:4:
 
 #![allow(unused_crate_dependencies)]
 
[32m+use chrono::{Duration, Utc};
[m use std::collections::HashMap;
[31m-use chrono::{Utc, Duration};
[m 
 #[cfg(test)]
 mod emergency_escalation_tests {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:12:
[31m-    
[m 
     #[test]
     fn test_single_violation_no_escalation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:72:
 
 #[cfg(test)]
 mod emergency_contact_tests {
[31m-    
[m 
     #[test]
     fn test_emergency_contact_list() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:79:
         let contacts = vec![
             "risk@foxhunt.com",
             "trading@foxhunt.com",
[31m-            "compliance@foxhunt.com"
[m[32m+            "compliance@foxhunt.com",
[m         ];
 
         assert_eq!(contacts.len(), 3);
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:138:
     #[test]
     fn test_max_drawdown_limit() {
         let current_drawdown = 0.25; // 25%
[31m-        let max_drawdown = 0.20;     // 20%
[m[32m+        let max_drawdown = 0.20; // 20%
[m 
         let exceeds_limit = current_drawdown > max_drawdown;
         assert!(exceeds_limit);
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:187:
 
 #[cfg(test)]
 mod loss_tracking_tests {
[31m-    
[m 
     #[test]
     fn test_daily_loss_accumulation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:195:
 
         // Simulate losses throughout the day
         daily_loss += -1000.0; // Trade 1 loss
[31m-        daily_loss += -500.0;  // Trade 2 loss
[m[31m-        daily_loss += 300.0;   // Trade 3 profit
[m[31m-        daily_loss += -800.0;  // Trade 4 loss
[m[32m+        daily_loss += -500.0; // Trade 2 loss
[m[32m+        daily_loss += 300.0; // Trade 3 profit
[m[32m+        daily_loss += -800.0; // Trade 4 loss
[m 
         assert_eq!(daily_loss, -2000.0);
     }
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:341:
 
 #[cfg(test)]
 mod automated_response_tests {
[31m-    
[m 
     #[test]
     fn test_automatic_position_reduction() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:452:
 
 #[cfg(test)]
 mod alert_threshold_tests {
[31m-    
[m 
     #[test]
     fn test_tiered_alert_thresholds() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:483:
 
 #[cfg(test)]
 mod emergency_shutdown_tests {
[31m-    
[m 
     #[test]
     fn test_orderly_shutdown_sequence() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:515:
 
 #[cfg(test)]
 mod rate_limiting_tests {
[31m-    
[m 
     #[test]
     fn test_order_rate_limiting() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:564:
     #[test]
     fn test_breaker_priority() {
         let breakers = vec![
[31m-            ("loss_limit", true, 1),        // Highest priority
[m[32m+            ("loss_limit", true, 1), // Highest priority
[m             ("position_limit", true, 2),
             ("volatility", false, 3),
         ];
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/emergency_response_comprehensive_tests.rs:571:
 
[31m-        let active_breakers: Vec<_> = breakers.iter()
[m[32m+        let active_breakers: Vec<_> = breakers
[m[32m+            .iter()
[m             .filter(|(_, triggered, _)| *triggered)
             .collect();
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/kill_switch_comprehensive_tests.rs:8:
 use tokio::time::Duration;
 
 // Import kill switch types
[31m-use risk::safety::KillSwitchConfig;
[m use risk::risk_types::KillSwitchScope;
[32m+use risk::safety::KillSwitchConfig;
[m 
 #[cfg(test)]
 mod kill_switch_scope_tests {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/kill_switch_comprehensive_tests.rs:201:
         scoped_triggers.insert("scope:strategy:s2".to_string(), false); // Strategy in p1
 
         // Check if cascade is set
[31m-        let has_cascade = scoped_triggers.iter()
[m[32m+        let has_cascade = scoped_triggers
[m[32m+            .iter()
[m             .any(|(k, &v)| v && k.starts_with("cascade:portfolio:"));
         assert!(has_cascade);
     }
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/kill_switch_comprehensive_tests.rs:214:
         scoped_triggers.insert("scope:symbol:AAPL".to_string(), true);
 
         // Should not have cascade flags
[31m-        let has_cascade = scoped_triggers.iter()
[m[32m+        let has_cascade = scoped_triggers
[m[32m+            .iter()
[m             .any(|(k, _)| k.starts_with("cascade:"));
         assert!(!has_cascade);
     }
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/kill_switch_comprehensive_tests.rs:222:
 
 #[cfg(test)]
 mod fail_safe_mode_tests {
[31m-    
[m 
     #[test]
     fn test_fail_safe_on_lock_contention() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/kill_switch_comprehensive_tests.rs:274:
 
 #[cfg(test)]
 mod trading_permission_tests {
[31m-    
[m 
     #[test]
     fn test_global_kill_switch_blocks_all() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/kill_switch_comprehensive_tests.rs:397:
 
 #[cfg(test)]
 mod metrics_tracking_tests {
[31m-    
[m[32m+
[m     use std::sync::atomic::{AtomicU64, Ordering};
 
     #[test]
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:11:
 
 #[cfg(test)]
 mod concentration_risk_tests {
[31m-    
[m 
     #[test]
     fn test_hhi_calculation_single_position() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:81:
 
 #[cfg(test)]
 mod position_weight_calculation_tests {
[31m-    
[m 
     #[test]
     fn test_position_weight_calculation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:202:
 
 #[cfg(test)]
 mod pnl_tracking_tests {
[31m-    
[m 
     #[test]
     fn test_realized_pnl_calculation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:253:
             (75.0, 80.0, 50.0),    // +250
         ];
 
[31m-        let daily_pnl: f64 = trades.iter()
[m[32m+        let daily_pnl: f64 = trades
[m[32m+            .iter()
[m             .map(|(entry, exit, qty)| (exit - entry) * qty)
             .sum();
 
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:272:
 
 #[cfg(test)]
 mod position_update_tests {
[31m-    
[m 
     #[test]
     fn test_position_size_increase() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:328:
 
 #[cfg(test)]
 mod risk_decomposition_tests {
[31m-    
[m 
     #[test]
     fn test_volatility_contribution() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:406:
 
 #[cfg(test)]
 mod portfolio_rebalancing_tests {
[31m-    
[m 
     #[test]
     fn test_target_weight_deviation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:413:
         let current_weight = 0.35_f64; // 35%
[31m-        let target_weight = 0.30_f64;  // 30%
[m[32m+        let target_weight = 0.30_f64; // 30%
[m         let deviation = (current_weight - target_weight).abs();
 
         assert!((deviation - 0.05).abs() < 0.0001);
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:438:
 
 #[cfg(test)]
 mod position_metrics_tests {
[31m-    
[m 
     #[test]
     fn test_turnover_calculation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:479:
 
 #[cfg(test)]
 mod position_limits_edge_cases {
[31m-    
[m 
     #[test]
     fn test_zero_position() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:520:
 
 #[cfg(test)]
 mod portfolio_metrics_tests {
[31m-    
[m 
     #[test]
     fn test_sharpe_ratio_calculation() {
Diff in /home/jgrusewski/Work/foxhunt/risk/tests/position_tracker_comprehensive_tests.rs:527:
         let portfolio_return = 0.12_f64; // 12%
[31m-        let risk_free_rate = 0.02_f64;   // 2%
[m[31m-        let volatility = 0.15_f64;        // 15%
[m[32m+        let risk_free_rate = 0.02_f64; // 2%
[m[32m+        let volatility = 0.15_f64; // 15%
[m 
         let sharpe = (portfolio_return - risk_free_rate) / volatility;
         assert!((sharpe - 0.6667_f64).abs() < 0.001_f64);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/risk-data/src/compliance.rs:935:
         };
 
         // Inline validation logic to test without database
[31m-        assert!(event.description.is_empty(), "Description should be empty for test");
[m[32m+        assert!(
[m[32m+            event.description.is_empty(),
[m[32m+            "Description should be empty for test"
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/risk-data/src/compliance.rs:976:
 
         assert!(base_score > Decimal::ZERO);
         assert!(base_score <= Decimal::from(100));
[31m-        assert_eq!(base_score, Decimal::from(50), "Breach severity should have base score of 50");
[m[32m+        assert_eq!(
[m[32m+            base_score,
[m[32m+            Decimal::from(50),
[m[32m+            "Breach severity should have base score of 50"
[m[32m+        );
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/risk-data/src/limits.rs:1016:
     fn test_breach_severity_calculation() {
         // Test breach severity calculation logic inline without database
         let test_cases = vec![
[31m-            (Decimal::from(85), BreachSeverity::Warning),   // 85% utilization
[m[31m-            (Decimal::from(95), BreachSeverity::Soft),      // 95% utilization
[m[31m-            (Decimal::from(105), BreachSeverity::Hard),     // 105% utilization
[m[32m+            (Decimal::from(85), BreachSeverity::Warning), // 85% utilization
[m[32m+            (Decimal::from(95), BreachSeverity::Soft),    // 95% utilization
[m[32m+            (Decimal::from(105), BreachSeverity::Hard),   // 105% utilization
[m             (Decimal::from(125), BreachSeverity::Critical), // 125% utilization
         ];
 
Diff in /home/jgrusewski/Work/foxhunt/risk-data/src/limits.rs:1033:
                 BreachSeverity::Warning
             };
 
[31m-            assert_eq!(severity, expected_severity,
[m[31m-                "Utilization {} should result in {:?}", utilization, expected_severity);
[m[32m+            assert_eq!(
[m[32m+                severity, expected_severity,
[m[32m+                "Utilization {} should result in {:?}",
[m[32m+                utilization, expected_severity
[m[32m+            );
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/risk-data/src/limits.rs:1066:
 
         // Test invalid limit (negative threshold)
         let invalid_threshold = Decimal::from(-100);
[31m-        assert!(invalid_threshold < Decimal::ZERO, "Negative threshold should be invalid");
[m[32m+        assert!(
[m[32m+            invalid_threshold < Decimal::ZERO,
[m[32m+            "Negative threshold should be invalid"
[m[32m+        );
[m     }
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/auth_overhead.rs:155:
 
     c.bench_function("jwt_signature_validation", |b| {
         b.iter(|| {
[31m-            let result = decode::<JwtClaims>(
[m[31m-                black_box(&token),
[m[31m-                &decoding_key,
[m[31m-                &validation,
[m[31m-            );
[m[32m+            let result = decode::<JwtClaims>(black_box(&token), &decoding_key, &validation);
[m             black_box(result);
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/auth_overhead.rs:186:
 
     c.bench_function("rbac_permission_check", |b| {
         b.iter(|| {
[31m-            let has_perm = cache.has_permission(
[m[31m-                black_box(user_id),
[m[31m-                black_box(permission),
[m[31m-            );
[m[32m+            let has_perm = cache.has_permission(black_box(user_id), black_box(permission));
[m             black_box(has_perm);
         });
     });
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/auth_overhead.rs:252:
     c.bench_function("8_layer_auth_pipeline", |b| {
         b.iter(|| {
             // Layer 1: Extract JWT
[31m-            let token_str = black_box(&auth_header)
[m[31m-                .strip_prefix("Bearer ")
[m[31m-                .unwrap();
[m[32m+            let token_str = black_box(&auth_header).strip_prefix("Bearer ").unwrap();
[m 
             // Layer 2: Validate JWT signature
[31m-            let token_data = decode::<JwtClaims>(
[m[31m-                token_str,
[m[31m-                &decoding_key,
[m[31m-                &validation,
[m[31m-            )
[m[31m-            .unwrap();
[m[32m+            let token_data = decode::<JwtClaims>(token_str, &decoding_key, &validation).unwrap();
[m 
             // Layer 3: Check revocation
             let is_revoked = revocation_cache.is_revoked(&token_data.claims.jti);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/auth_overhead.rs:269:
             assert!(!is_revoked);
 
             // Layer 4: Check RBAC permissions
[31m-            let has_permission = rbac_cache.has_permission(
[m[31m-                &token_data.claims.sub,
[m[31m-                "trade:write",
[m[31m-            );
[m[32m+            let has_permission = rbac_cache.has_permission(&token_data.claims.sub, "trade:write");
[m             assert!(has_permission);
 
             // Layer 5: Check rate limit
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/auth_overhead.rs:351:
                 "admin".to_string(),
                 "analyst".to_string(),
             ],
[31m-            permissions: (0..50)
[m[31m-                .map(|i| format!("permission:{}", i))
[m[31m-                .collect(),
[m[32m+            permissions: (0..50).map(|i| format!("permission:{}", i)).collect(),
[m         };
         encode(
             &Header::new(Algorithm::HS256),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/auth_overhead.rs:368:
         &small_jwt,
         |b, jwt| {
             b.iter(|| {
[31m-                let result = decode::<JwtClaims>(
[m[31m-                    black_box(jwt),
[m[31m-                    &decoding_key,
[m[31m-                    &validation,
[m[31m-                );
[m[32m+                let result = decode::<JwtClaims>(black_box(jwt), &decoding_key, &validation);
[m                 black_box(result);
             });
         },
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/auth_overhead.rs:383:
         &large_jwt,
         |b, jwt| {
             b.iter(|| {
[31m-                let result = decode::<JwtClaims>(
[m[31m-                    black_box(jwt),
[m[31m-                    &decoding_key,
[m[31m-                    &validation,
[m[31m-                );
[m[32m+                let result = decode::<JwtClaims>(black_box(jwt), &decoding_key, &validation);
[m                 black_box(result);
             });
         },
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/authz_dashmap_benchmark.rs:166:
             test_user_ids.push(user_id);
             let perms = UserPermissions {
                 user_id,
[31m-                permissions: vec![
[m[31m-                    "/api/trade".to_string(),
[m[31m-                    "/api/portfolio".to_string(),
[m[31m-                ]
[m[31m-                .into_iter()
[m[31m-                .collect(),
[m[32m+                permissions: vec!["/api/trade".to_string(), "/api/portfolio".to_string()]
[m[32m+                    .into_iter()
[m[32m+                    .collect(),
[m                 loaded_at: Instant::now(),
             };
             dashmap_cache.insert(user_id, perms);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/authz_dashmap_benchmark.rs:179:
 
         let mid_user = test_user_ids[size / 2];
 
[31m-        group.bench_with_input(
[m[31m-            BenchmarkId::new("dashmap", size),
[m[31m-            size,
[m[31m-            |b, _| {
[m[31m-                b.iter(|| {
[m[31m-                    let result = dashmap_cache.check_permission(black_box(&mid_user), black_box("/api/trade"));
[m[31m-                    black_box(result);
[m[31m-                });
[m[31m-            },
[m[31m-        );
[m[32m+        group.bench_with_input(BenchmarkId::new("dashmap", size), size, |b, _| {
[m[32m+            b.iter(|| {
[m[32m+                let result =
[m[32m+                    dashmap_cache.check_permission(black_box(&mid_user), black_box("/api/trade"));
[m[32m+                black_box(result);
[m[32m+            });
[m[32m+        });
[m     }
 
     group.finish();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/authz_dashmap_benchmark.rs:274:
     c.bench_function("hot_path_permission_check", |b| {
         b.iter(|| {
             // Simulate typical RBAC check pattern
[31m-            let has_trade = dashmap_cache.check_permission(black_box(&hot_user), black_box("/api/trade"));
[m[31m-            let has_portfolio = dashmap_cache.check_permission(black_box(&hot_user), black_box("/api/portfolio"));
[m[32m+            let has_trade =
[m[32m+                dashmap_cache.check_permission(black_box(&hot_user), black_box("/api/trade"));
[m[32m+            let has_portfolio =
[m[32m+                dashmap_cache.check_permission(black_box(&hot_user), black_box("/api/portfolio"));
[m             black_box((has_trade, has_portfolio));
         });
     });
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/cache_performance.rs:174:
 
         // Prepopulate to capacity
         for i in 0..*size {
[31m-            cache.put(
[m[31m-                format!("key{}", i),
[m[31m-                format!("value{}", i),
[m[31m-            );
[m[32m+            cache.put(format!("key{}", i), format!("value{}", i));
[m         }
 
[31m-        group.bench_with_input(
[m[31m-            BenchmarkId::new("cache_lookup", size),
[m[31m-            size,
[m[31m-            |b, &n| {
[m[31m-                b.iter(|| {
[m[31m-                    let key = format!("key{}", black_box(n / 2));
[m[31m-                    let value = cache.get(&key);
[m[31m-                    black_box(value);
[m[31m-                });
[m[31m-            },
[m[31m-        );
[m[32m+        group.bench_with_input(BenchmarkId::new("cache_lookup", size), size, |b, &n| {
[m[32m+            b.iter(|| {
[m[32m+                let key = format!("key{}", black_box(n / 2));
[m[32m+                let value = cache.get(&key);
[m[32m+                black_box(value);
[m[32m+            });
[m[32m+        });
[m     }
 
     group.finish();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/cache_performance.rs:325:
 
 /// Benchmark 9: Multi-tier cache (L1 + L2)
 fn bench_multi_tier_cache(c: &mut Criterion) {
[31m-    let l1_cache = Arc::new(RwLock::new(
[m[31m-        LruCache::<String, String>::new(100, Duration::from_secs(60)),
[m[31m-    ));
[m[31m-    let l2_cache = Arc::new(RwLock::new(
[m[31m-        LruCache::<String, String>::new(10_000, Duration::from_secs(300)),
[m[31m-    ));
[m[32m+    let l1_cache = Arc::new(RwLock::new(LruCache::<String, String>::new(
[m[32m+        100,
[m[32m+        Duration::from_secs(60),
[m[32m+    )));
[m[32m+    let l2_cache = Arc::new(RwLock::new(LruCache::<String, String>::new(
[m[32m+        10_000,
[m[32m+        Duration::from_secs(300),
[m[32m+    )));
[m 
     // Prepopulate L2
     for i in 0..1000 {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/dashmap_rate_limiter_bench.rs:251:
     println!("  Target:  <8ns ✓\n");
 
     // Benchmark 2: Concurrent reads (4 threads)
[31m-    println!("Benchmark 2: Concurrent Reads (4 threads, {} total ops)", iterations);
[m[32m+    println!(
[m[32m+        "Benchmark 2: Concurrent Reads (4 threads, {} total ops)",
[m[32m+        iterations
[m[32m+    );
[m     let rwlock_conc = bench_rwlock_concurrent(iterations, 4).await;
     let dashmap_conc = bench_dashmap_concurrent(iterations, 4).await;
     let improvement_conc = rwlock_conc as f64 / dashmap_conc as f64;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/dashmap_rate_limiter_bench.rs:262:
     println!("  Target:  <8ns ✓\n");
 
     // Benchmark 3: Concurrent reads (8 threads)
[31m-    println!("Benchmark 3: High Contention (8 threads, {} total ops)", iterations);
[m[32m+    println!(
[m[32m+        "Benchmark 3: High Contention (8 threads, {} total ops)",
[m[32m+        iterations
[m[32m+    );
[m     let rwlock_high = bench_rwlock_concurrent(iterations, 8).await;
     let dashmap_high = bench_dashmap_concurrent(iterations, 8).await;
     let improvement_high = rwlock_high as f64 / dashmap_high as f64;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/dashmap_rate_limiter_bench.rs:273:
     println!("  Target:  <8ns ✓\n");
 
     // Benchmark 4: Mixed read/write (10% writes)
[31m-    println!("Benchmark 4: Mixed Workload - 10% writes ({} ops)", iterations);
[m[32m+    println!(
[m[32m+        "Benchmark 4: Mixed Workload - 10% writes ({} ops)",
[m[32m+        iterations
[m[32m+    );
[m     let rwlock_mixed = bench_rwlock_mixed(iterations, 0.10).await;
     let dashmap_mixed = bench_dashmap_mixed(iterations, 0.10).await;
     let improvement_mixed = rwlock_mixed as f64 / dashmap_mixed as f64;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/dashmap_rate_limiter_bench.rs:284:
     println!("  Target:  <8ns ✓\n");
 
     // Benchmark 5: Mixed read/write (1% writes - typical rate limiter)
[31m-    println!("Benchmark 5: Rate Limiter Workload - 1% writes ({} ops)", iterations);
[m[32m+    println!(
[m[32m+        "Benchmark 5: Rate Limiter Workload - 1% writes ({} ops)",
[m[32m+        iterations
[m[32m+    );
[m     let rwlock_rl = bench_rwlock_mixed(iterations, 0.01).await;
     let dashmap_rl = bench_dashmap_mixed(iterations, 0.01).await;
     let improvement_rl = rwlock_rl as f64 / dashmap_rl as f64;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/dashmap_rate_limiter_bench.rs:297:
     // Summary
     println!("==========================================");
     println!("Performance Summary:");
[31m-    println!("  Sequential:       {:.2}x improvement ({} ns → {} ns)",
[m[31m-             improvement_seq, rwlock_seq, dashmap_seq);
[m[31m-    println!("  Concurrent (4T):  {:.2}x improvement ({} ns → {} ns)",
[m[31m-             improvement_conc, rwlock_conc, dashmap_conc);
[m[31m-    println!("  Concurrent (8T):  {:.2}x improvement ({} ns → {} ns)",
[m[31m-             improvement_high, rwlock_high, dashmap_high);
[m[31m-    println!("  Mixed (10% W):    {:.2}x improvement ({} ns → {} ns)",
[m[31m-             improvement_mixed, rwlock_mixed, dashmap_mixed);
[m[31m-    println!("  Rate Limiter:     {:.2}x improvement ({} ns → {} ns)",
[m[31m-             improvement_rl, rwlock_rl, dashmap_rl);
[m[32m+    println!(
[m[32m+        "  Sequential:       {:.2}x improvement ({} ns → {} ns)",
[m[32m+        improvement_seq, rwlock_seq, dashmap_seq
[m[32m+    );
[m[32m+    println!(
[m[32m+        "  Concurrent (4T):  {:.2}x improvement ({} ns → {} ns)",
[m[32m+        improvement_conc, rwlock_conc, dashmap_conc
[m[32m+    );
[m[32m+    println!(
[m[32m+        "  Concurrent (8T):  {:.2}x improvement ({} ns → {} ns)",
[m[32m+        improvement_high, rwlock_high, dashmap_high
[m[32m+    );
[m[32m+    println!(
[m[32m+        "  Mixed (10% W):    {:.2}x improvement ({} ns → {} ns)",
[m[32m+        improvement_mixed, rwlock_mixed, dashmap_mixed
[m[32m+    );
[m[32m+    println!(
[m[32m+        "  Rate Limiter:     {:.2}x improvement ({} ns → {} ns)",
[m[32m+        improvement_rl, rwlock_rl, dashmap_rl
[m[32m+    );
[m     println!("\n✓ All benchmarks completed successfully");
     println!("✓ Target <8ns achieved: {}", dashmap_seq < 8);
 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/rate_limiter_bench.rs:100:
     let elapsed3 = start3.elapsed();
     println!("Total time: {:?}", elapsed3);
     println!("Allowed requests: {}/{}", allowed, burst_size);
[31m-    println!("Average per request: {} ns\n", elapsed3.as_nanos() / burst_size);
[m[32m+    println!(
[m[32m+        "Average per request: {} ns\n",
[m[32m+        elapsed3.as_nanos() / burst_size
[m[32m+    );
[m 
     // Benchmark 4: High-frequency trading scenario
     println!("Benchmark 4: HFT Scenario (10,000 requests, 100 req/sec limit)");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/rate_limiter_bench.rs:119:
     println!("Total time: {:?}", elapsed4);
     println!("Allowed: {}/{} requests", hft_allowed, hft_requests);
     println!("Denied: {} requests", hft_requests - hft_allowed);
[31m-    println!("Average per check: {} ns\n", elapsed4.as_nanos() / hft_requests);
[m[32m+    println!(
[m[32m+        "Average per check: {} ns\n",
[m[32m+        elapsed4.as_nanos() / hft_requests
[m[32m+    );
[m 
     println!("========================================");
     println!("Performance Summary:");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/rate_limiter_bench.rs:126:
     println!("  - Cache hit: {} ns (target <50ns)", ns_per_op);
     println!("  - Token bucket: {} ns", ns_per_op2);
[31m-    println!("  - Burst handling: {} ns", elapsed3.as_nanos() / burst_size);
[m[31m-    println!("  - HFT scenario: {} ns", elapsed4.as_nanos() / hft_requests);
[m[32m+    println!(
[m[32m+        "  - Burst handling: {} ns",
[m[32m+        elapsed3.as_nanos() / burst_size
[m[32m+    );
[m[32m+    println!(
[m[32m+        "  - HFT scenario: {} ns",
[m[32m+        elapsed4.as_nanos() / hft_requests
[m[32m+    );
[m     println!("\n✓ All benchmarks completed successfully");
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/rate_limiting_perf.rs:221:
 fn bench_concurrent_access(c: &mut Criterion) {
     use std::thread;
 
[31m-    let limiter = Arc::new(
[m[31m-        AtomicRateLimiter::new(1_000_000).with_user("user123"),
[m[31m-    );
[m[32m+    let limiter = Arc::new(AtomicRateLimiter::new(1_000_000).with_user("user123"));
[m 
     c.bench_function("concurrent_rate_limiter_4_threads", |b| {
         b.iter(|| {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/revocation_cache_perf.rs:46:
         if let Some(entry) = self.cache.get(token_id) {
             if entry.cached_at.elapsed() < self.ttl {
                 // Cache hit
[31m-                self.hits
[m[31m-                    .fetch_add(1, std::sync::atomic::Ordering::Relaxed);
[m[32m+                self.hits.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
[m                 return entry.is_revoked;
             } else {
                 // Expired - remove it
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/routing_latency.rs:88:
         b.iter(|| {
             rt.block_on(async {
                 let result = router
[31m-                    .route_request(
[m[31m-                        black_box("valid-jwt-token"),
[m[31m-                        black_box(b"request"),
[m[31m-                    )
[m[32m+                    .route_request(black_box("valid-jwt-token"), black_box(b"request"))
[m                     .await;
                 black_box(result);
             });
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/routing_latency.rs:108:
         b.iter(|| {
             rt.block_on(async {
                 let result = router
[31m-                    .route_request(
[m[31m-                        black_box("valid-jwt-token"),
[m[31m-                        black_box(b"request"),
[m[31m-                    )
[m[32m+                    .route_request(black_box("valid-jwt-token"), black_box(b"request"))
[m                     .await;
                 black_box(result);
             });
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/routing_latency.rs:129:
         b.iter(|| {
             rt.block_on(async {
                 let result = router
[31m-                    .route_request(
[m[31m-                        black_box("valid-jwt-token"),
[m[31m-                        black_box(b"request"),
[m[31m-                    )
[m[32m+                    .route_request(black_box("valid-jwt-token"), black_box(b"request"))
[m                     .await;
                 black_box(result);
             });
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/routing_latency.rs:150:
         b.iter(|| {
             rt.block_on(async {
                 let result = router
[31m-                    .route_request(
[m[31m-                        black_box("valid-jwt-token"),
[m[31m-                        black_box(b"request"),
[m[31m-                    )
[m[32m+                    .route_request(black_box("valid-jwt-token"), black_box(b"request"))
[m                     .await;
                 black_box(result);
             });
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/routing_latency.rs:280:
             for _ in 0..iters {
                 let start = Instant::now();
                 rt.block_on(async {
[31m-                    let result = router
[m[31m-                        .route_request("valid-jwt-token", b"request")
[m[31m-                        .await;
[m[32m+                    let result = router.route_request("valid-jwt-token", b"request").await;
[m                     black_box(result);
                 });
                 total += start.elapsed();
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/throughput.rs:184:
                 let mut handles = vec![];
                 for i in 0..iters.min(1000) {
                     let handler_clone = handler.clone();
[31m-                    let handle = tokio::spawn(async move {
[m[31m-                        handler_clone.handle_request(i).await
[m[31m-                    });
[m[32m+                    let handle = tokio::spawn(async move { handler_clone.handle_request(i).await });
[m                     handles.push(handle);
                 }
                 for handle in handles {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/throughput.rs:215:
     }
 
     let auth = Arc::new(AuthSimulator::new(0.95));
[31m-    let processor = RequestProcessor {
[m[31m-        auth: auth.clone(),
[m[31m-    };
[m[32m+    let processor = RequestProcessor { auth: auth.clone() };
[m 
     let mut group = c.benchmark_group("request_size_throughput");
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/throughput.rs:307:
         let auth = Arc::new(AuthSimulator::new(0.95));
         let handler = RateLimitedHandler::new(auth.clone(), *limit);
 
[31m-        group.bench_with_input(
[m[31m-            BenchmarkId::new("max_rps", limit),
[m[31m-            limit,
[m[31m-            |b, _| {
[m[31m-                b.iter_custom(|iters| {
[m[31m-                    let start = Instant::now();
[m[31m-                    rt.block_on(async {
[m[31m-                        for i in 0..iters {
[m[31m-                            black_box(handler.handle(i).await);
[m[31m-                        }
[m[31m-                    });
[m[31m-                    start.elapsed()
[m[32m+        group.bench_with_input(BenchmarkId::new("max_rps", limit), limit, |b, _| {
[m[32m+            b.iter_custom(|iters| {
[m[32m+                let start = Instant::now();
[m[32m+                rt.block_on(async {
[m[32m+                    for i in 0..iters {
[m[32m+                        black_box(handler.handle(i).await);
[m[32m+                    }
[m                 });
[31m-            },
[m[31m-        );
[m[32m+                start.elapsed()
[m[32m+            });
[m[32m+        });
[m     }
 
     group.finish();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/benches/throughput.rs:380:
                         let mut handles = vec![];
                         for i in 0..n {
                             let handler_clone = handler.clone();
[31m-                            let handle = tokio::spawn(async move {
[m[31m-                                handler_clone.handle_request(i).await
[m[31m-                            });
[m[32m+                            let handle =
[m[32m+                                tokio::spawn(async move { handler_clone.handle_request(i).await });
[m                             handles.push(handle);
                         }
                         for handle in handles {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/build.rs:19:
         .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
         .server_mod_attribute(".", "#[allow(unused_qualifications)]")
         .client_mod_attribute(".", "#[allow(unused_qualifications)]")
[31m-        .compile_protos(
[m[31m-            &["proto/config_service.proto"],
[m[31m-            &["proto"]
[m[31m-        )?;
[m[32m+        .compile_protos(&["proto/config_service.proto"], &["proto"])?;
[m 
     // Compile TLI proto which contains TradingService, BacktestingService, and MLService
     // API Gateway acts as server (receives requests) and client (forwards to backends)
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/metrics_example.rs:2:
 //!
 //! Demonstrates how to integrate Prometheus metrics into the API Gateway
 
[31m-use api_gateway::metrics::{GatewayMetrics, metrics_router};
[m[31m-use tokio::net::TcpListener;
[m[31m-use std::time::Instant;
[m[32m+use api_gateway::metrics::{metrics_router, GatewayMetrics};
[m use std::net::SocketAddr;
[32m+use std::time::Instant;
[m[32m+use tokio::net::TcpListener;
[m 
 #[tokio::main]
 async fn main() -> Result<(), Box<dyn std::error::Error>> {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/metrics_example.rs:46:
 
         let total_duration_us = start.elapsed().as_nanos() as f64 / 1000.0;
         metrics.auth.record_success(total_duration_us);
[31m-        metrics.auth.record_user_request(&format!("user_{}", i % 10));
[m[32m+        metrics
[m[32m+            .auth
[m[32m+            .record_user_request(&format!("user_{}", i % 10));
[m 
         if i % 10 == 0 {
             println!("   ✅ Recorded {} successful auth requests", i + 1);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/metrics_example.rs:57:
     println!("\n3. Recording authentication failures...");
     metrics.auth.record_failure("expired_jwt", Some("user_99"));
     metrics.auth.record_failure("revoked_jwt", Some("user_88"));
[31m-    metrics.auth.record_failure("permission_denied", Some("user_77"));
[m[32m+    metrics
[m[32m+        .auth
[m[32m+        .record_failure("permission_denied", Some("user_77"));
[m     metrics.auth.record_rate_limit("user_66");
     println!("   ✅ Recorded 4 auth failures\n");
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/metrics_example.rs:66:
 
     // Trading service requests
     for i in 0..50 {
[31m-        metrics.proxy.record_backend_success("trading", "ExecuteTrade", 15.5);
[m[32m+        metrics
[m[32m+            .proxy
[m[32m+            .record_backend_success("trading", "ExecuteTrade", 15.5);
[m         if i % 10 == 0 {
             println!("   ✅ Recorded {} trading service requests", i + 1);
         }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/metrics_example.rs:74:
 
     // Backtesting service requests
     for i in 0..30 {
[31m-        metrics.proxy.record_backend_success("backtesting", "RunBacktest", 250.0);
[m[32m+        metrics
[m[32m+            .proxy
[m[32m+            .record_backend_success("backtesting", "RunBacktest", 250.0);
[m     }
     println!("   ✅ Recorded 30 backtesting service requests");
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/metrics_example.rs:81:
     // ML Training service requests
[31m-    metrics.proxy.record_backend_success("ml_training", "TrainModel", 5000.0);
[m[32m+    metrics
[m[32m+        .proxy
[m[32m+        .record_backend_success("ml_training", "TrainModel", 5000.0);
[m     println!("   ✅ Recorded ML training requests\n");
 
     // Update health status
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/metrics_example.rs:92:
     // Update connection pools
     println!("6. Updating connection pool metrics...");
     metrics.proxy.update_connection_pool("trading", 10, 5, 50);
[31m-    metrics.proxy.update_connection_pool("backtesting", 3, 7, 20);
[m[31m-    metrics.proxy.update_connection_pool("ml_training", 2, 8, 10);
[m[32m+    metrics
[m[32m+        .proxy
[m[32m+        .update_connection_pool("backtesting", 3, 7, 20);
[m[32m+    metrics
[m[32m+        .proxy
[m[32m+        .update_connection_pool("ml_training", 2, 8, 10);
[m     println!("   ✅ Connection pool stats updated\n");
 
     // Simulate configuration events
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/rate_limiter_usage.rs:3:
 //! Demonstrates how to use the RateLimiter in different scenarios
 
 use anyhow::Result;
[31m-use uuid::Uuid;
[m use api_gateway::routing::RateLimiter;
[32m+use uuid::Uuid;
[m 
 // Note: This is a pseudo-code example showing integration patterns
 // The actual types would come from the api_gateway crate
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/rate_limiter_usage.rs:16:
     endpoint: &str,
 ) -> Result<()> {
     // Check rate limit before processing request
[31m-    let allowed = rate_limiter
[m[31m-        .check_limit(user_id, endpoint)
[m[31m-        .await?;
[m[32m+    let allowed = rate_limiter.check_limit(user_id, endpoint).await?;
[m 
     if !allowed {
         return Err(anyhow::anyhow!("Rate limit exceeded"));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/rate_limiter_usage.rs:60:
     println!("Rate Limiter Cache Statistics:");
     println!("  Current size: {}/{}", stats.size, stats.max_size);
     println!("  Cache TTL: {} seconds", stats.ttl_seconds);
[31m-    println!("  Cache usage: {:.1}%",
[m[31m-             (stats.size as f64 / stats.max_size as f64) * 100.0);
[m[32m+    println!(
[m[32m+        "  Cache usage: {:.1}%",
[m[32m+        (stats.size as f64 / stats.max_size as f64) * 100.0
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/rate_limiter_usage.rs:73:
     request_uri: &str,
 ) -> Result<()> {
     // Extract endpoint from URI
[31m-    let endpoint = request_uri
[m[31m-        .split('/')
[m[31m-        .last()
[m[31m-        .unwrap_or("unknown");
[m[32m+    let endpoint = request_uri.split('/').last().unwrap_or("unknown");
[m 
     // Check rate limit
     if !rate_limiter.check_limit(user_id, endpoint).await? {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/examples/rate_limiter_usage.rs:131:
 
     // First request will populate cache from Redis
     let user_id = Uuid::new_v4();
[31m-    let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+    let _ = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m 
     println!("Cache populated - subsequent requests will be <50ns");
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:22:
 }
 
 impl AuthenticatedClient {
[31m-    pub async fn new(gateway_url: String, jwt_secret: &str, user_id: &str, username: &str) -> Result<Self> {
[m[32m+    pub async fn new(
[m[32m+        gateway_url: String,
[m[32m+        jwt_secret: &str,
[m[32m+        user_id: &str,
[m[32m+        username: &str,
[m[32m+    ) -> Result<Self> {
[m         let client = Client::builder()
             .timeout(std::time::Duration::from_secs(30))
             .pool_max_idle_per_host(10)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:51:
         })
     }
 
[31m-    pub async fn submit_order(
[m[31m-        &self,
[m[31m-        client_id: usize,
[m[31m-        order: TestOrder,
[m[31m-    ) -> Result<RequestMetric> {
[m[32m+    pub async fn submit_order(&self, client_id: usize, order: TestOrder) -> Result<RequestMetric> {
[m         let start = Instant::now();
 
         let result = self
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:79:
                 } else {
                     RequestStatus::Error
                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 if e.is_timeout() {
                     RequestStatus::Timeout
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:86:
                 } else {
                     RequestStatus::Error
                 }
[31m-            }
[m[32m+            },
[m         };
 
         Ok(RequestMetric {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:126:
                 } else {
                     RequestStatus::Error
                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 if e.is_timeout() {
                     RequestStatus::Timeout
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:133:
                 } else {
                     RequestStatus::Error
                 }
[31m-            }
[m[32m+            },
[m         };
 
         Ok(RequestMetric {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:150:
         })
     }
 
[31m-    pub async fn run_backtest(&self, client_id: usize, config: BacktestConfig) -> Result<RequestMetric> {
[m[32m+    pub async fn run_backtest(
[m[32m+        &self,
[m[32m+        client_id: usize,
[m[32m+        config: BacktestConfig,
[m[32m+    ) -> Result<RequestMetric> {
[m         let start = Instant::now();
 
         let result = self
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:174:
                 } else {
                     RequestStatus::Error
                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 if e.is_timeout() {
                     RequestStatus::Timeout
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:181:
                 } else {
                     RequestStatus::Error
                 }
[31m-            }
[m[32m+            },
[m         };
 
         Ok(RequestMetric {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:198:
         })
     }
 
[31m-    pub async fn train_model(&self, client_id: usize, config: TrainingConfig) -> Result<RequestMetric> {
[m[32m+    pub async fn train_model(
[m[32m+        &self,
[m[32m+        client_id: usize,
[m[32m+        config: TrainingConfig,
[m[32m+    ) -> Result<RequestMetric> {
[m         let start = Instant::now();
 
         let result = self
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:222:
                 } else {
                     RequestStatus::Error
                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 if e.is_timeout() {
                     RequestStatus::Timeout
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/authenticated_client.rs:229:
                 } else {
                     RequestStatus::Error
                 }
[31m-            }
[m[32m+            },
[m         };
 
         Ok(RequestMetric {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/mixed_workload.rs:45:
                     self.client
                         .submit_order(self.client_id, TestOrder::random())
                         .await?
[31m-                }
[m[32m+                },
[m                 60..=89 => {
                     // 30% - Query positions
                     self.client.get_positions(self.client_id).await?
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/mixed_workload.rs:52:
[31m-                }
[m[32m+                },
[m                 90..=97 => {
                     // 8% - Run backtest
                     self.client
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/mixed_workload.rs:56:
                         .run_backtest(self.client_id, BacktestConfig::default())
                         .await?
[31m-                }
[m[32m+                },
[m                 98..=99 => {
                     // 2% - Train model
                     self.client
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/clients/mixed_workload.rs:62:
                         .train_model(self.client_id, TrainingConfig::default())
                         .await?
[31m-                }
[m[32m+                },
[m                 _ => unreachable!(),
             };
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/main.rs:94:
                 num_clients,
                 duration_secs
             );
[31m-            let report = scenarios::normal_load::run(gateway_url, num_clients, duration_secs).await?;
[m[32m+            let report =
[m[32m+                scenarios::normal_load::run(gateway_url, num_clients, duration_secs).await?;
[m             reporting::generate_html_report("normal_load_report.html", report)?;
[31m-        }
[m[32m+        },
[m         Commands::Spike {
             gateway_url,
             target_clients,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/main.rs:109:
                 ramp_up_secs,
                 sustain_secs
             );
[31m-            let report = scenarios::spike_load::run(
[m[31m-                gateway_url,
[m[31m-                target_clients,
[m[31m-                ramp_up_secs,
[m[31m-                sustain_secs,
[m[31m-            )
[m[31m-            .await?;
[m[32m+            let report =
[m[32m+                scenarios::spike_load::run(gateway_url, target_clients, ramp_up_secs, sustain_secs)
[m[32m+                    .await?;
[m             reporting::generate_html_report("spike_load_report.html", report)?;
[31m-        }
[m[32m+        },
[m         Commands::Sustained {
             gateway_url,
             num_clients,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/main.rs:132:
             let report =
                 scenarios::sustained_load::run(gateway_url, num_clients, duration_secs).await?;
             reporting::generate_html_report("sustained_load_report.html", report)?;
[31m-        }
[m[32m+        },
[m         Commands::Stress {
             gateway_url,
             initial_clients,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/main.rs:157:
             )
             .await?;
             reporting::generate_html_report("stress_test_report.html", report)?;
[31m-        }
[m[32m+        },
[m         Commands::All { gateway_url } => {
             tracing::info!("Running ALL load test scenarios sequentially");
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/main.rs:182:
             reporting::generate_html_report("stress_test_report.html", stress_report)?;
 
             tracing::info!("All scenarios complete! Reports generated.");
[31m-        }
[m[32m+        },
[m     }
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/metrics/collector.rs:186:
                     ServiceStats {
                         total_requests: hist.len(),
                         successful_requests: hist.len(), // Simplified for now
[31m-                        error_rate_pct: 0.0,              // Simplified for now
[m[32m+                        error_rate_pct: 0.0,             // Simplified for now
[m                         latency_stats: service_latency_stats,
                     },
                 );
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/orchestrator.rs:21:
 
         // Normal load test
         tracing::info!("=== Running Normal Load Test ===");
[31m-        let normal_report = crate::scenarios::normal_load::run(
[m[31m-            self.gateway_url.clone(),
[m[31m-            1000,
[m[31m-            60,
[m[31m-        ).await?;
[m[32m+        let normal_report =
[m[32m+            crate::scenarios::normal_load::run(self.gateway_url.clone(), 1000, 60).await?;
[m         crate::reporting::generate_html_report("normal_load_report.html", normal_report)?;
 
         // Cooldown
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/orchestrator.rs:33:
 
         // Spike load test
         tracing::info!("=== Running Spike Load Test ===");
[31m-        let spike_report = crate::scenarios::spike_load::run(
[m[31m-            self.gateway_url.clone(),
[m[31m-            10000,
[m[31m-            10,
[m[31m-            60,
[m[31m-        ).await?;
[m[32m+        let spike_report =
[m[32m+            crate::scenarios::spike_load::run(self.gateway_url.clone(), 10000, 10, 60).await?;
[m         crate::reporting::generate_html_report("spike_load_report.html", spike_report)?;
 
         // Cooldown
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/orchestrator.rs:46:
 
         // Stress test (shortened for orchestrated run)
         tracing::info!("=== Running Stress Test ===");
[31m-        let stress_report = crate::scenarios::stress_test::run(
[m[31m-            self.gateway_url.clone(),
[m[31m-            100,
[m[31m-            100,
[m[31m-            60,
[m[31m-            50.0,
[m[31m-            5.0,
[m[31m-        ).await?;
[m[32m+        let stress_report =
[m[32m+            crate::scenarios::stress_test::run(self.gateway_url.clone(), 100, 100, 60, 50.0, 5.0)
[m[32m+                .await?;
[m         crate::reporting::generate_html_report("stress_test_report.html", stress_report)?;
 
         tracing::info!("All orchestrated tests completed successfully");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/reporting.rs:233:
         duration_hours = report.metrics.duration.as_secs_f64() / 3600.0,
         total_requests = report.metrics.total_requests,
         rps = report.metrics.requests_per_second,
[31m-        rps_class = if report.metrics.requests_per_second > 1000.0 { "success" } else { "warning" },
[m[32m+        rps_class = if report.metrics.requests_per_second > 1000.0 {
[m[32m+            "success"
[m[32m+        } else {
[m[32m+            "warning"
[m[32m+        },
[m         error_rate = report.metrics.error_rate_pct,
[31m-        error_class = if report.metrics.error_rate_pct < 1.0 { "success" } else if report.metrics.error_rate_pct < 5.0 { "warning" } else { "error" },
[m[32m+        error_class = if report.metrics.error_rate_pct < 1.0 {
[m[32m+            "success"
[m[32m+        } else if report.metrics.error_rate_pct < 5.0 {
[m[32m+            "warning"
[m[32m+        } else {
[m[32m+            "error"
[m[32m+        },
[m         p99_latency = report.metrics.latency_stats.p99_ms,
[31m-        latency_class = if report.metrics.latency_stats.p99_ms < 10.0 { "success" } else if report.metrics.latency_stats.p99_ms < 50.0 { "warning" } else { "error" },
[m[32m+        latency_class = if report.metrics.latency_stats.p99_ms < 10.0 {
[m[32m+            "success"
[m[32m+        } else if report.metrics.latency_stats.p99_ms < 50.0 {
[m[32m+            "warning"
[m[32m+        } else {
[m[32m+            "error"
[m[32m+        },
[m         min_latency = report.metrics.latency_stats.min_ms,
         p50_latency = report.metrics.latency_stats.p50_ms,
         p90_latency = report.metrics.latency_stats.p90_ms,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/reporting.rs:247:
         mean_latency = report.metrics.latency_stats.mean_ms,
         stddev_latency = report.metrics.latency_stats.stddev_ms,
         successful_requests = report.metrics.successful_requests,
[31m-        success_pct = (report.metrics.successful_requests as f64 / report.metrics.total_requests as f64) * 100.0,
[m[32m+        success_pct = (report.metrics.successful_requests as f64
[m[32m+            / report.metrics.total_requests as f64)
[m[32m+            * 100.0,
[m         failed_requests = report.metrics.failed_requests,
[31m-        failed_pct = (report.metrics.failed_requests as f64 / report.metrics.total_requests as f64) * 100.0,
[m[32m+        failed_pct =
[m[32m+            (report.metrics.failed_requests as f64 / report.metrics.total_requests as f64) * 100.0,
[m         timeout_requests = report.metrics.timeout_requests,
[31m-        timeout_pct = (report.metrics.timeout_requests as f64 / report.metrics.total_requests as f64) * 100.0,
[m[32m+        timeout_pct =
[m[32m+            (report.metrics.timeout_requests as f64 / report.metrics.total_requests as f64) * 100.0,
[m         rate_limited_requests = report.metrics.rate_limited_requests,
[31m-        rate_limited_pct = (report.metrics.rate_limited_requests as f64 / report.metrics.total_requests as f64) * 100.0,
[m[32m+        rate_limited_pct = (report.metrics.rate_limited_requests as f64
[m[32m+            / report.metrics.total_requests as f64)
[m[32m+            * 100.0,
[m         circuit_breaker_requests = report.metrics.circuit_breaker_requests,
[31m-        circuit_breaker_pct = (report.metrics.circuit_breaker_requests as f64 / report.metrics.total_requests as f64) * 100.0,
[m[32m+        circuit_breaker_pct = (report.metrics.circuit_breaker_requests as f64
[m[32m+            / report.metrics.total_requests as f64)
[m[32m+            * 100.0,
[m         per_service_stats = generate_per_service_stats_html(&report),
         capacity_recommendation = generate_capacity_recommendation_html(&report),
         rps_chart_filename = rps_chart_path.file_name().unwrap().to_str().unwrap(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/reporting.rs:392:
         .margin(10)
         .x_label_area_size(30)
         .y_label_area_size(50)
[31m-        .build_cartesian_2d(0..report.time_series.len(), 0f64..(max_error_rate * 1.1).max(1.0))?;
[m[32m+        .build_cartesian_2d(
[m[32m+            0..report.time_series.len(),
[m[32m+            0f64..(max_error_rate * 1.1).max(1.0),
[m[32m+        )?;
[m 
     chart.configure_mesh().draw()?;
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/scenarios/mod.rs:1:
 pub mod normal_load;
 pub mod spike_load;
[31m-pub mod sustained_load;
[m pub mod stress_test;
[31m-
[m[32m+pub mod sustained_load;
[m 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/scenarios/normal_load.rs:5:
 use crate::clients::{AuthenticatedClient, MixedWorkloadClient};
 use crate::metrics::{collector::MetricsCollector, LoadTestReport, TestConfig};
 
[31m-pub async fn run(gateway_url: String, num_clients: usize, duration_secs: u64) -> Result<LoadTestReport> {
[m[32m+pub async fn run(
[m[32m+    gateway_url: String,
[m[32m+    num_clients: usize,
[m[32m+    duration_secs: u64,
[m[32m+) -> Result<LoadTestReport> {
[m     tracing::info!(
         "Starting NORMAL load test: {} clients for {}s",
         num_clients,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/scenarios/spike_load.rs:37:
     // Calculate how many clients to spawn per interval
     let spawn_interval_ms = 100; // Spawn clients every 100ms
     let intervals_in_ramp_up = ramp_up_secs * 1000 / spawn_interval_ms;
[31m-    let clients_per_interval = (target_clients as f64 / intervals_in_ramp_up as f64).ceil() as usize;
[m[32m+    let clients_per_interval =
[m[32m+        (target_clients as f64 / intervals_in_ramp_up as f64).ceil() as usize;
[m 
     let start_time = std::time::Instant::now();
     let mut clients_spawned = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/scenarios/stress_test.rs:57:
                 )
                 .await?;
 
[31m-                let mut mixed_client =
[m[31m-                    MixedWorkloadClient::new(auth_client, client_id, metrics_tx);
[m[32m+                let mut mixed_client = MixedWorkloadClient::new(auth_client, client_id, metrics_tx);
[m 
                 // Run for a long time (clients will be terminated when threshold is hit)
                 mixed_client
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/scenarios/stress_test.rs:69:
     };
 
     // Spawn initial batch
[31m-    spawn_clients(
[m[31m-        &mut join_set,
[m[31m-        &metrics_tx,
[m[31m-        &gateway_url,
[m[31m-        0,
[m[31m-        initial_clients,
[m[31m-    );
[m[32m+    spawn_clients(&mut join_set, &metrics_tx, &gateway_url, 0, initial_clients);
[m     current_clients = initial_clients;
 
     tracing::info!("Initial {} clients spawned", current_clients);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/load_tests/src/scenarios/sustained_load.rs:183:
     let first_samples = &time_series[0..sample_size];
     let last_samples = &time_series[time_series.len() - sample_size..];
 
[31m-    let first_avg: f64 = first_samples.iter().map(|p| p.p99_latency_ms).sum::<f64>()
[m[31m-        / first_samples.len() as f64;
[m[31m-    let last_avg: f64 = last_samples.iter().map(|p| p.p99_latency_ms).sum::<f64>()
[m[31m-        / last_samples.len() as f64;
[m[32m+    let first_avg: f64 =
[m[32m+        first_samples.iter().map(|p| p.p99_latency_ms).sum::<f64>() / first_samples.len() as f64;
[m[32m+    let last_avg: f64 =
[m[32m+        last_samples.iter().map(|p| p.p99_latency_ms).sum::<f64>() / last_samples.len() as f64;
[m 
     if first_avg > 0.0 {
         ((last_avg - first_avg) / first_avg) * 100.0
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:22:
 
 use anyhow::{Context, Result};
 use dashmap::DashMap;
[31m-use governor::{Quota, RateLimiter as GovernorRateLimiter, state::keyed::DefaultKeyedStateStore};
[m[32m+use governor::{state::keyed::DefaultKeyedStateStore, Quota, RateLimiter as GovernorRateLimiter};
[m use jsonwebtoken::{decode, Algorithm, DecodingKey, Validation};
 use redis::{aio::ConnectionManager, AsyncCommands};
 use serde::{Deserialize, Serialize};
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:144:
     /// - Cache hit: <10ns (DashMap lookup)
     /// - Cache miss: ~500μs (Redis network latency)
     /// - Expected hit rate: >95%
[31m-    pub async fn check_revoked(&self, token_id: &str, redis: &mut ConnectionManager) -> Result<bool> {
[m[32m+    pub async fn check_revoked(
[m[32m+        &self,
[m[32m+        token_id: &str,
[m[32m+        redis: &mut ConnectionManager,
[m[32m+    ) -> Result<bool> {
[m         // Check cache first
         if let Some(entry) = self.cache.get(token_id) {
             if entry.cached_at.elapsed() < self.ttl {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:159:
         }
 
         // Cache miss - check Redis
[31m-        self.misses.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
[m[32m+        self.misses
[m[32m+            .fetch_add(1, std::sync::atomic::Ordering::Relaxed);
[m 
         let key = format!("jwt:blacklist:{}", token_id);
         let is_revoked: bool = redis
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:412:
 pub struct RateLimiter {
     /// Per-user rate limiters (TARGET: <50ns)
     /// PERFORMANCE: Governor provides O(1) atomic counter checks
[31m-    limiters: Arc<DashMap<String, Arc<GovernorRateLimiter<String, DefaultKeyedStateStore<String>, governor::clock::DefaultClock>>>>,
[m[32m+    limiters: Arc<
[m[32m+        DashMap<
[m[32m+            String,
[m[32m+            Arc<
[m[32m+                GovernorRateLimiter<
[m[32m+                    String,
[m[32m+                    DefaultKeyedStateStore<String>,
[m[32m+                    governor::clock::DefaultClock,
[m[32m+                >,
[m[32m+            >,
[m[32m+        >,
[m[32m+    >,
[m     /// Default quota (requests per second)
     default_quota: Quota,
 }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:419:
 
 impl RateLimiter {
     pub fn new(requests_per_second: u32) -> Result<Self, String> {
[31m-        let default_quota = Quota::per_second(
[m[31m-            NonZeroU32::new(requests_per_second)
[m[31m-                .ok_or_else(|| format!("Invalid rate limit: {} (must be > 0)", requests_per_second))?
[m[31m-        );
[m[32m+        let default_quota =
[m[32m+            Quota::per_second(NonZeroU32::new(requests_per_second).ok_or_else(|| {
[m[32m+                format!("Invalid rate limit: {} (must be > 0)", requests_per_second)
[m[32m+            })?);
[m 
         Ok(Self {
             limiters: Arc::new(DashMap::new()),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:433:
     /// Check if request is allowed (TARGET: <50ns)
     /// PERFORMANCE: Atomic counter increment, no locks
     pub fn check_rate_limit(&self, user_id: &str) -> bool {
[31m-        let limiter = self.limiters.entry(user_id.to_string()).or_insert_with(|| {
[m[31m-            Arc::new(GovernorRateLimiter::dashmap(self.default_quota))
[m[31m-        });
[m[32m+        let limiter = self
[m[32m+            .limiters
[m[32m+            .entry(user_id.to_string())
[m[32m+            .or_insert_with(|| Arc::new(GovernorRateLimiter::dashmap(self.default_quota)));
[m 
         limiter.check_key(&user_id.to_string()).is_ok()
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:541:
         // We can extract it from request extensions if needed for additional checks
 
         // Layer 2: Extract JWT from authorization header (~100ns)
[31m-        let bearer_token = self
[m[31m-            .extract_bearer_token(&request)
[m[31m-            .ok_or_else(|| {
[m[31m-                self.audit_logger
[m[31m-                    .log_auth_failure("missing_token", client_ip.as_deref());
[m[31m-                Status::unauthenticated("Authorization header required")
[m[31m-            })?;
[m[32m+        let bearer_token = self.extract_bearer_token(&request).ok_or_else(|| {
[m[32m+            self.audit_logger
[m[32m+                .log_auth_failure("missing_token", client_ip.as_deref());
[m[32m+            Status::unauthenticated("Authorization header required")
[m[32m+        })?;
[m 
         // Layer 4: Validate JWT signature and expiration (<1μs with cached key)
         // NOTE: Moved before revocation check for fail-fast on invalid tokens
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:601:
             user_id: claims.sub.clone(),
             roles: claims.roles,
             permissions: claims.permissions,
[31m-            session_id: claims.session_id.unwrap_or_else(|| Uuid::new_v4().to_string()),
[m[32m+            session_id: claims
[m[32m+                .session_id
[m[32m+                .unwrap_or_else(|| Uuid::new_v4().to_string()),
[m             authenticated_at: start,
         };
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:709:
     async fn test_jwt_service_validation() {
         use jsonwebtoken::{encode, EncodingKey, Header};
 
[31m-        let secret = "test-secret-must-be-at-least-64-characters-long-for-security-validation-ok".to_string();
[m[32m+        let secret = "test-secret-must-be-at-least-64-characters-long-for-security-validation-ok"
[m[32m+            .to_string();
[m         let jwt_service = JwtService::new(
             secret.clone(),
             "test-issuer".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:778:
 
     #[tokio::test]
     async fn test_revocation_cache_hit() {
[31m-        
[m[31m-        
[m[31m-
[m         // Create a mock Redis connection manager for testing
         // In real tests, you would use a real Redis instance or mock
         let cache = LocalRevocationCache::new(Duration::from_secs(60));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/interceptor.rs:866:
         let cache = LocalRevocationCache::new(Duration::from_secs(60));
 
         // Simulate cache hits
[31m-        cache.hits.fetch_add(95, std::sync::atomic::Ordering::Relaxed);
[m[32m+        cache
[m[32m+            .hits
[m[32m+            .fetch_add(95, std::sync::atomic::Ordering::Relaxed);
[m         cache
             .misses
             .fetch_add(5, std::sync::atomic::Ordering::Relaxed);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:6:
 use anyhow::{Context, Result};
 use chrono::{DateTime, Utc};
 use rand::Rng;
[32m+use secrecy::{ExposeSecret, Secret};
[m use serde::{Deserialize, Serialize};
 use sha2::{Digest, Sha256};
 use sqlx::PgPool;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:13:
 use tracing::{debug, info, warn};
 use uuid::Uuid;
 use zeroize::Zeroizing;
[31m-use secrecy::{Secret, ExposeSecret};
[m 
 /// Backup code with display format
 #[derive(Debug, Clone, Serialize, Deserialize)]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:32:
     fn new(code: String) -> Self {
         let hint = code.chars().take(4).collect();
         let display = format_backup_code(&code);
[31m-        
[m[32m+
[m         Self {
             code: Secret::new(code),
             hint,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:58:
     /// Create new backup code generator
     pub fn new() -> Self {
         // Exclude ambiguous characters: 0, O, 1, I, l
[31m-        let charset: Vec<char> = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ"
[m[31m-            .chars()
[m[31m-            .collect();
[m[32m+        let charset: Vec<char> = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ".chars().collect();
[m 
         Self {
             code_length: 16,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:132:
             return Ok(false);
         }
 
[31m-        let ip: Option<std::net::IpAddr> = ip_address
[m[31m-            .and_then(|s| s.parse().ok());
[m[32m+        let ip: Option<std::net::IpAddr> = ip_address.and_then(|s| s.parse().ok());
[m 
         // Convert IpAddr to String for database binding
         let ip_string: Option<String> = ip.map(|addr| addr.to_string());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:140:
 
         // Use database function for validation
[31m-        let is_valid = sqlx::query_scalar::<_, bool>(
[m[31m-            "SELECT validate_backup_code($1, $2, $3)"
[m[31m-        )
[m[31m-        .bind(user_id)
[m[31m-        .bind(&normalized_code)
[m[31m-        .bind(ip_string)
[m[31m-        .fetch_one(&*self.db_pool)
[m[31m-        .await
[m[31m-        .context("Failed to validate backup code")?;
[m[32m+        let is_valid = sqlx::query_scalar::<_, bool>("SELECT validate_backup_code($1, $2, $3)")
[m[32m+            .bind(user_id)
[m[32m+            .bind(&normalized_code)
[m[32m+            .bind(ip_string)
[m[32m+            .fetch_one(&*self.db_pool)
[m[32m+            .await
[m[32m+            .context("Failed to validate backup code")?;
[m 
         if is_valid {
             info!("Backup code successfully validated for user: {}", user_id);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:165:
             SELECT COUNT(*)::int
             FROM mfa_backup_codes
             WHERE user_id = $1 AND is_used = false AND expires_at > NOW()
[31m-            "#
[m[32m+            "#,
[m         )
         .bind(user_id)
         .fetch_one(&*self.db_pool)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:178:
     /// Check if user needs to regenerate backup codes
     pub async fn needs_regeneration(&self, user_id: Uuid) -> Result<bool> {
         let remaining = self.get_remaining_count(user_id).await?;
[31m-        
[m[32m+
[m         // Warn if less than 3 codes remaining
         Ok(remaining < 3)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:243:
     }
 
     // Must be alphanumeric uppercase
[31m-    code.chars().all(|c| c.is_ascii_uppercase() || c.is_ascii_digit())
[m[32m+    code.chars()
[m[32m+        .all(|c| c.is_ascii_uppercase() || c.is_ascii_digit())
[m }
 
 /// Hash backup code for secure storage (SHA-256)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:267:
         for code in &codes {
             // Check code length
             assert_eq!(code.code.expose_secret().len(), 16);
[31m-            
[m[32m+
[m             // Check hint
             assert_eq!(code.hint.len(), 4);
[31m-            
[m[32m+
[m             // Check display format (contains hyphens)
             assert!(code.display.contains('-'));
         }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:279:
     #[test]
     fn test_generate_codes_invalid_count() {
         let generator = BackupCodeGenerator::new();
[31m-        
[m[32m+
[m         assert!(generator.generate_codes(0).is_err());
         assert!(generator.generate_codes(21).is_err());
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:288:
     fn test_format_backup_code() {
         let code = "ABCDEFGHIJKLMNOP";
         let formatted = format_backup_code(code);
[31m-        
[m[32m+
[m         assert_eq!(formatted, "ABCD-EFGH-IJKL-MNOP");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:302:
             normalize_backup_code("abcd efgh ijkl mnop"),
             "ABCDEFGHIJKLMNOP"
         );
[31m-        assert_eq!(
[m[31m-            normalize_backup_code("  A-B-C-D  "),
[m[31m-            "ABCD"
[m[31m-        );
[m[32m+        assert_eq!(normalize_backup_code("  A-B-C-D  "), "ABCD");
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:312:
     fn test_is_valid_backup_code_format() {
         assert!(is_valid_backup_code_format("ABCDEFGH23456789"));
         assert!(is_valid_backup_code_format("2345678923456789"));
[31m-        
[m[32m+
[m         assert!(!is_valid_backup_code_format("ABCDEFGH2345678")); // Too short
         assert!(!is_valid_backup_code_format("ABCDEFGH234567890")); // Too long
         assert!(!is_valid_backup_code_format("abcdefgh23456789")); // Lowercase
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:323:
     fn test_hash_backup_code() {
         let code = "ABCDEFGH23456789";
         let hash = hash_backup_code(code);
[31m-        
[m[32m+
[m         // SHA-256 produces 64 hex characters
         assert_eq!(hash.len(), 64);
[31m-        
[m[32m+
[m         // Hash should be deterministic
         assert_eq!(hash_backup_code(code), hash);
[31m-        
[m[32m+
[m         // Different codes should have different hashes
         assert_ne!(hash_backup_code("DIFFERENT23456789"), hash);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/backup_codes.rs:337:
     #[test]
     fn test_backup_code_new() {
         let code = BackupCode::new("ABCDEFGH23456789".to_string());
[31m-        
[m[32m+
[m         assert_eq!(code.code.expose_secret(), "ABCDEFGH23456789");
         assert_eq!(code.hint, "ABCD");
         assert_eq!(code.display, "ABCD-EFGH-2345-6789");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:17:
 //! - PCI DSS: Multi-factor authentication requirements
 //! - SOX: Access control and authentication
 
[31m-pub mod totp;
[m pub mod backup_codes;
 pub mod enrollment;
[31m-pub mod verification;
[m pub mod qr_code;
[32m+pub mod totp;
[m[32m+pub mod verification;
[m 
[31m-pub use totp::{TotpConfig, TotpGenerator, TotpVerifier};
[m pub use backup_codes::{BackupCode, BackupCodeGenerator, BackupCodeValidator};
[31m-pub use enrollment::{MfaEnrollment, EnrollmentSession, EnrollmentError};
[m[31m-pub use verification::{MfaVerification, VerificationResult, VerificationError};
[m[31m-pub use qr_code::{QrCodeGenerator, QrCodeError};
[m[32m+pub use enrollment::{EnrollmentError, EnrollmentSession, MfaEnrollment};
[m[32m+pub use qr_code::{QrCodeError, QrCodeGenerator};
[m[32m+pub use totp::{TotpConfig, TotpGenerator, TotpVerifier};
[m[32m+pub use verification::{MfaVerification, VerificationError, VerificationResult};
[m 
 use anyhow::{Context, Result};
 use chrono::{DateTime, Utc};
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:34:
[32m+use secrecy::{ExposeSecret, Secret};
[m use serde::{Deserialize, Serialize};
 use sqlx::PgPool;
 use std::sync::Arc;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:37:
 use tracing::{debug, error, info, warn};
 use uuid::Uuid;
 use zeroize::Zeroizing;
[31m-use secrecy::{Secret, ExposeSecret};
[m 
 // Re-export Secret types from secrecy crate
 pub use secrecy::SecretString;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:117:
 
     /// Check if MFA is required for a user
     pub async fn is_mfa_required(&self, user_id: Uuid) -> Result<bool> {
[31m-        let result = sqlx::query_scalar::<_, bool>(
[m[31m-            "SELECT is_mfa_required($1)"
[m[31m-        )
[m[31m-        .bind(user_id)
[m[31m-        .fetch_one(&*self.db_pool)
[m[31m-        .await
[m[31m-        .context("Failed to check if MFA is required")?;
[m[32m+        let result = sqlx::query_scalar::<_, bool>("SELECT is_mfa_required($1)")
[m[32m+            .bind(user_id)
[m[32m+            .fetch_one(&*self.db_pool)
[m[32m+            .await
[m[32m+            .context("Failed to check if MFA is required")?;
[m 
         Ok(result)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:184:
         let secret = self.totp_generator.generate_secret()?;
 
         // Create QR code data
[31m-        let qr_uri = self.totp_generator.generate_qr_uri(&secret, issuer, account_name)?;
[m[32m+        let qr_uri = self
[m[32m+            .totp_generator
[m[32m+            .generate_qr_uri(&secret, issuer, account_name)?;
[m 
         // Encrypt the secret for database storage
         let encrypted_secret = self.encrypt_totp_secret(secret.expose_secret())?;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:316:
         .execute(&*self.db_pool)
         .await?;
 
[31m-        info!("MFA enrollment completed successfully for user: {}", user_id);
[m[32m+        info!(
[m[32m+            "MFA enrollment completed successfully for user: {}",
[m[32m+            user_id
[m[32m+        );
[m 
         Ok(backup_codes)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:331:
         // Check if account is locked
         if self.is_mfa_locked(user_id).await? {
             warn!("MFA verification attempted for locked account: {}", user_id);
[31m-            return Err(anyhow::anyhow!("Account is locked due to too many failed attempts"));
[m[32m+            return Err(anyhow::anyhow!(
[m[32m+                "Account is locked due to too many failed attempts"
[m[32m+            ));
[m         }
 
         // Get MFA config
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:338:
[31m-        let config = self.get_mfa_config(user_id)
[m[32m+        let config = self
[m[32m+            .get_mfa_config(user_id)
[m             .await?
             .ok_or_else(|| anyhow::anyhow!("MFA not configured for user"))?;
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:345:
 
         // Get encrypted secret
         let encrypted_secret = sqlx::query_scalar::<_, Vec<u8>>(
[31m-            "SELECT totp_secret_encrypted FROM mfa_config WHERE user_id = $1"
[m[32m+            "SELECT totp_secret_encrypted FROM mfa_config WHERE user_id = $1",
[m         )
         .bind(user_id)
         .fetch_one(&*self.db_pool)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:363:
             is_valid,
             ip_address,
             None,
[31m-            if is_valid { None } else { Some("INVALID_TOTP_CODE".to_string()) },
[m[31m-        ).await?;
[m[32m+            if is_valid {
[m[32m+                None
[m[32m+            } else {
[m[32m+                Some("INVALID_TOTP_CODE".to_string())
[m[32m+            },
[m[32m+        )
[m[32m+        .await?;
[m 
         Ok(is_valid)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:376:
         backup_code: &str,
         ip_address: Option<String>,
     ) -> Result<bool> {
[31m-        let is_valid = self.backup_code_validator
[m[32m+        let is_valid = self
[m[32m+            .backup_code_validator
[m             .validate(user_id, backup_code, ip_address.as_deref())
             .await?;
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:393:
         user_agent: Option<String>,
         error_code: Option<String>,
     ) -> Result<Uuid> {
[31m-        let ip: Option<std::net::IpAddr> = ip_address
[m[31m-            .as_ref()
[m[31m-            .and_then(|s| s.parse().ok());
[m[32m+        let ip: Option<std::net::IpAddr> = ip_address.as_ref().and_then(|s| s.parse().ok());
[m 
         let log_id = sqlx::query_scalar::<_, Uuid>(
             r#"
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:402:
             SELECT record_mfa_attempt($1, $2, $3, $4, $5, NULL, $6)
[31m-            "#
[m[32m+            "#,
[m         )
         .bind(user_id)
         .bind(method.to_string())
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:416:
     }
 
     /// Store backup codes in database
[31m-    async fn store_backup_codes(
[m[31m-        &self,
[m[31m-        user_id: Uuid,
[m[31m-        codes: &[BackupCode],
[m[31m-    ) -> Result<()> {
[m[32m+    async fn store_backup_codes(&self, user_id: Uuid, codes: &[BackupCode]) -> Result<()> {
[m         let expires_at = Utc::now() + chrono::Duration::days(365);
 
         for code in codes {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:458:
     fn decrypt_totp_secret(&self, encrypted: &[u8]) -> Result<String> {
         // In production, use proper decryption with KMS
         // This is a placeholder - actual decryption should use pgcrypto or external KMS
[31m-        String::from_utf8(encrypted.to_vec())
[m[31m-            .context("Failed to decrypt TOTP secret")
[m[32m+        String::from_utf8(encrypted.to_vec()).context("Failed to decrypt TOTP secret")
[m     }
 
     /// Hash backup code for secure storage
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:466:
     fn hash_backup_code(&self, code: &str) -> String {
[31m-        use sha2::{Sha256, Digest};
[m[32m+        use sha2::{Digest, Sha256};
[m         let mut hasher = Sha256::new();
         hasher.update(code.as_bytes());
         format!("{:x}", hasher.finalize())
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/mod.rs:472:
 
     /// Disable MFA for a user (admin only)
     pub async fn disable_mfa(&self, user_id: Uuid) -> Result<()> {
[31m-        warn!("Disabling MFA for user: {} - This should only be done by administrators", user_id);
[m[32m+        warn!(
[m[32m+            "Disabling MFA for user: {} - This should only be done by administrators",
[m[32m+            user_id
[m[32m+        );
[m 
         sqlx::query!(
             "UPDATE mfa_config SET is_enabled = false, updated_at = NOW() WHERE user_id = $1",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:3:
 //! Generates QR codes for TOTP secret enrollment in authenticator apps.
 
 use anyhow::{Context, Result};
[31m-use qrcode::{QrCode, render::svg};
[m[32m+use qrcode::{render::svg, QrCode};
[m use thiserror::Error;
 
 /// QR code generation errors
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:11:
 pub enum QrCodeError {
     #[error("QR code generation failed: {0}")]
     GenerationFailed(String),
[31m-    
[m[32m+
[m     #[error("Invalid URI format: {0}")]
     InvalidUri(String),
[31m-    
[m[32m+
[m     #[error("Rendering failed: {0}")]
     RenderingFailed(String),
 }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:48:
     pub fn generate_png(&self, uri: &str) -> Result<Vec<u8>> {
         // Validate URI format
         if !uri.starts_with("otpauth://") {
[31m-            return Err(QrCodeError::InvalidUri("URI must start with otpauth://".to_string()).into());
[m[32m+            return Err(
[m[32m+                QrCodeError::InvalidUri("URI must start with otpauth://".to_string()).into(),
[m[32m+            );
[m         }
 
         // Create QR code
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:63:
 
         // Convert to PNG bytes
         let mut png_bytes = Vec::new();
[31m-        image.write_to(
[m[31m-            &mut std::io::Cursor::new(&mut png_bytes),
[m[31m-            image::ImageFormat::Png,
[m[31m-        )
[m[31m-        .map_err(|e| QrCodeError::RenderingFailed(e.to_string()))?;
[m[32m+        image
[m[32m+            .write_to(
[m[32m+                &mut std::io::Cursor::new(&mut png_bytes),
[m[32m+                image::ImageFormat::Png,
[m[32m+            )
[m[32m+            .map_err(|e| QrCodeError::RenderingFailed(e.to_string()))?;
[m 
         Ok(png_bytes)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:76:
     pub fn generate_svg(&self, uri: &str) -> Result<String> {
         // Validate URI format
         if !uri.starts_with("otpauth://") {
[31m-            return Err(QrCodeError::InvalidUri("URI must start with otpauth://".to_string()).into());
[m[32m+            return Err(
[m[32m+                QrCodeError::InvalidUri("URI must start with otpauth://".to_string()).into(),
[m[32m+            );
[m         }
 
         // Create QR code
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:97:
     /// Generate data URL for inline display (base64 encoded PNG)
     pub fn generate_data_url(&self, uri: &str) -> Result<String> {
         let png_bytes = self.generate_png(uri)?;
[31m-        let base64_encoded = base64::Engine::encode(
[m[31m-            &base64::engine::general_purpose::STANDARD,
[m[31m-            &png_bytes,
[m[31m-        );
[m[31m-        
[m[32m+        let base64_encoded =
[m[32m+            base64::Engine::encode(&base64::engine::general_purpose::STANDARD, &png_bytes);
[m[32m+
[m         Ok(format!("data:image/png;base64,{}", base64_encoded))
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:129:
     #[test]
     fn test_generate_png() {
         let generator = QrCodeGenerator::new();
[31m-        let uri = "otpauth://totp/FoxhuntHFT:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=FoxhuntHFT";
[m[31m-        
[m[32m+        let uri =
[m[32m+            "otpauth://totp/FoxhuntHFT:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=FoxhuntHFT";
[m[32m+
[m         let png_bytes = generator.generate_png(uri).unwrap();
[31m-        
[m[32m+
[m         // PNG should have magic bytes
         assert_eq!(&png_bytes[0..8], b"\x89PNG\r\n\x1a\n");
[31m-        
[m[32m+
[m         // Should be a valid size
         assert!(png_bytes.len() > 100);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:143:
     #[test]
     fn test_generate_svg() {
         let generator = QrCodeGenerator::new();
[31m-        let uri = "otpauth://totp/FoxhuntHFT:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=FoxhuntHFT";
[m[31m-        
[m[32m+        let uri =
[m[32m+            "otpauth://totp/FoxhuntHFT:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=FoxhuntHFT";
[m[32m+
[m         let svg = generator.generate_svg(uri).unwrap();
[31m-        
[m[32m+
[m         // SVG should contain proper XML
         assert!(svg.contains("<svg"));
         assert!(svg.contains("</svg>"));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:155:
     #[test]
     fn test_generate_data_url() {
         let generator = QrCodeGenerator::new();
[31m-        let uri = "otpauth://totp/FoxhuntHFT:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=FoxhuntHFT";
[m[31m-        
[m[32m+        let uri =
[m[32m+            "otpauth://totp/FoxhuntHFT:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=FoxhuntHFT";
[m[32m+
[m         let data_url = generator.generate_data_url(uri).unwrap();
[31m-        
[m[32m+
[m         assert!(data_url.starts_with("data:image/png;base64,"));
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/qr_code.rs:166:
     fn test_invalid_uri() {
         let generator = QrCodeGenerator::new();
         let invalid_uri = "https://example.com/invalid";
[31m-        
[m[32m+
[m         assert!(generator.generate_png(invalid_uri).is_err());
         assert!(generator.generate_svg(invalid_uri).is_err());
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:6:
 use anyhow::{Context, Result};
 use base32::Alphabet;
 use chrono::Utc;
[32m+use hmac::{Hmac, Mac};
[m use rand::Rng;
 use serde::{Deserialize, Serialize};
 use sha1::Sha1;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:12:
[31m-use hmac::{Hmac, Mac};
[m use zeroize::Zeroizing;
 
 // Use secrecy::Secret from workspace dependencies
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:276:
     fn test_generate_secret() {
         let generator = TotpGenerator::new();
         let secret = generator.generate_secret().unwrap();
[31m-        
[m[32m+
[m         // Base32 encoded secret should be non-empty
         assert!(!secret.expose_secret().is_empty());
[31m-        
[m[32m+
[m         // Should be valid Base32
[31m-        assert!(base32::decode(Alphabet::Rfc4648 { padding: false }, secret.expose_secret()).is_some());
[m[32m+        assert!(
[m[32m+            base32::decode(Alphabet::Rfc4648 { padding: false }, secret.expose_secret()).is_some()
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:303:
     fn test_generate_and_verify_totp() {
         let generator = TotpGenerator::new();
         let verifier = TotpVerifier::new();
[31m-        
[m[32m+
[m         let secret = "JBSWY3DPEHPK3PXP"; // Test secret
         let current_time = 1234567890u64;
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:310:
         // Generate code
[31m-        let code = generator.generate_code_at_time(secret, current_time).unwrap();
[m[32m+        let code = generator
[m[32m+            .generate_code_at_time(secret, current_time)
[m[32m+            .unwrap();
[m         assert_eq!(code.len(), 6);
 
         // Verify code
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:315:
[31m-        assert!(verifier.verify_at_time(secret, &code, current_time, 1).unwrap());
[m[32m+        assert!(verifier
[m[32m+            .verify_at_time(secret, &code, current_time, 1)
[m[32m+            .unwrap());
[m 
         // Verify invalid code
[31m-        assert!(!verifier.verify_at_time(secret, "000000", current_time, 1).unwrap());
[m[32m+        assert!(!verifier
[m[32m+            .verify_at_time(secret, "000000", current_time, 1)
[m[32m+            .unwrap());
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:322:
     fn test_totp_drift_tolerance() {
         let generator = TotpGenerator::new();
         let verifier = TotpVerifier::new();
[31m-        
[m[32m+
[m         let secret = "JBSWY3DPEHPK3PXP";
         let current_time = 1234567890u64;
         let period = 30u64;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:329:
 
         // Generate code for current time
[31m-        let code = generator.generate_code_at_time(secret, current_time).unwrap();
[m[32m+        let code = generator
[m[32m+            .generate_code_at_time(secret, current_time)
[m[32m+            .unwrap();
[m 
         // Should verify within drift tolerance (±1 period)
[31m-        assert!(verifier.verify_at_time(secret, &code, current_time + period, 1).unwrap());
[m[31m-        assert!(verifier.verify_at_time(secret, &code, current_time - period, 1).unwrap());
[m[32m+        assert!(verifier
[m[32m+            .verify_at_time(secret, &code, current_time + period, 1)
[m[32m+            .unwrap());
[m[32m+        assert!(verifier
[m[32m+            .verify_at_time(secret, &code, current_time - period, 1)
[m[32m+            .unwrap());
[m 
         // Should fail outside drift tolerance
[31m-        assert!(!verifier.verify_at_time(secret, &code, current_time + period * 2, 1).unwrap());
[m[32m+        assert!(!verifier
[m[32m+            .verify_at_time(secret, &code, current_time + period * 2, 1)
[m[32m+            .unwrap());
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:350:
     fn test_verifier_time_remaining() {
         let verifier = TotpVerifier::new();
         let remaining = verifier.time_remaining();
[31m-        
[m[32m+
[m         // Should be between 0 and 30 seconds
         assert!(remaining > 0 && remaining <= 30);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/auth/mfa/totp.rs:362:
         let current_time = 1234567890u64;
 
         // Wrong length
[31m-        assert!(!verifier.verify_at_time(secret, "12345", current_time, 1).unwrap());
[m[31m-        assert!(!verifier.verify_at_time(secret, "1234567", current_time, 1).unwrap());
[m[32m+        assert!(!verifier
[m[32m+            .verify_at_time(secret, "12345", current_time, 1)
[m[32m+            .unwrap());
[m[32m+        assert!(!verifier
[m[32m+            .verify_at_time(secret, "1234567", current_time, 1)
[m[32m+            .unwrap());
[m 
         // Non-numeric
[31m-        assert!(!verifier.verify_at_time(secret, "12345a", current_time, 1).unwrap());
[m[31m-        assert!(!verifier.verify_at_time(secret, "abcdef", current_time, 1).unwrap());
[m[32m+        assert!(!verifier
[m[32m+            .verify_at_time(secret, "12345a", current_time, 1)
[m[32m+            .unwrap());
[m[32m+        assert!(!verifier
[m[32m+            .verify_at_time(secret, "abcdef", current_time, 1)
[m[32m+            .unwrap());
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/authz.rs:2:
 ///
 /// Provides role-based access control with sub-100ns cached permission checks.
 /// Supports hot-reload via PostgreSQL NOTIFY/LISTEN for permission changes.
[31m-
[m use anyhow::{Context, Result};
 use dashmap::DashMap;
 use sqlx::PgPool;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/authz.rs:178:
         .await
         .context("Failed to load user permissions from database")?;
 
[31m-        let permissions: HashSet<String> = rows
[m[31m-            .into_iter()
[m[31m-            .map(|row| row.endpoint)
[m[31m-            .collect();
[m[32m+        let permissions: HashSet<String> = rows.into_iter().map(|row| row.endpoint).collect();
[m 
         debug!(
             user_id = %user_id,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/authz.rs:209:
         // 2. Update role permissions cache (lock-free DashMap operations)
         self.role_permissions_cache.clear();
         for (role_name, permissions) in role_perms {
[31m-            self.role_permissions_cache.insert(role_name.clone(), RolePermissions {
[m[31m-                role_name,
[m[31m-                permissions,
[m[31m-                loaded_at: Instant::now(),
[m[31m-            });
[m[32m+            self.role_permissions_cache.insert(
[m[32m+                role_name.clone(),
[m[32m+                RolePermissions {
[m[32m+                    role_name,
[m[32m+                    permissions,
[m[32m+                    loaded_at: Instant::now(),
[m[32m+                },
[m[32m+            );
[m         }
 
         // 3. Clear user permissions cache (will be reloaded on demand)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/authz.rs:323:
     pub async fn start_notify_listener(self: Arc<Self>) -> Result<()> {
         info!("Starting PostgreSQL NOTIFY listener for permission changes");
 
[31m-        let mut listener = sqlx::postgres::PgListener::connect_with(self.db_pool.as_ref()).await
[m[32m+        let mut listener = sqlx::postgres::PgListener::connect_with(self.db_pool.as_ref())
[m[32m+            .await
[m             .context("Failed to create PostgreSQL listener")?;
 
[31m-        listener.listen("permission_changes").await
[m[32m+        listener
[m[32m+            .listen("permission_changes")
[m[32m+            .await
[m             .context("Failed to listen on permission_changes channel")?;
 
         // Spawn background task to handle notifications
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/authz.rs:343:
                         if let Err(e) = self.reload_permissions().await {
                             error!(error = %e, "Failed to reload permissions on NOTIFY");
                         }
[31m-                    }
[m[32m+                    },
[m                     Err(e) => {
                         error!(error = %e, "Error receiving PostgreSQL notification");
                         // Wait before retrying
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/authz.rs:350:
                         tokio::time::sleep(Duration::from_secs(5)).await;
[31m-                    }
[m[32m+                    },
[m                 }
             }
         });
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/endpoints.rs:142:
 
         // For now, this is a no-op since hot-reload is automatic via NOTIFY/LISTEN
         // In the future, this could force a cache invalidation
[31m-        
[m[32m+
[m         Ok(Response::new(ReloadConfigResponse {
             success: true,
             message: "Configuration reload triggered (hot-reload active)".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/manager.rs:1:
 //! Configuration management with PostgreSQL NOTIFY/LISTEN hot-reload and Redis caching
 
[31m-use crate::error::{ConfigError, ConfigResult};
[m use crate::config::validator::ConfigValidator;
[32m+use crate::error::{ConfigError, ConfigResult};
[m use chrono::{DateTime, Utc};
 use redis::aio::ConnectionManager;
 use serde_json::Value;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/manager.rs:57:
     /// Starts listening for configuration changes via PostgreSQL NOTIFY
     pub async fn start_listening(&mut self) -> ConfigResult<()> {
         let mut listener = sqlx::postgres::PgListener::connect_with(&*self.db_pool).await?;
[31m-        
[m[32m+
[m         // Listen to global config updates channel
         listener.listen("config_updates_global").await?;
[31m-        
[m[32m+
[m         info!("Started listening for configuration updates on 'config_updates_global'");
[31m-        
[m[32m+
[m         self.listener = Some(listener);
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/manager.rs:92:
         // Now invalidate caches without holding the listener borrow
         for (service_scope, config_key) in invalidations {
             self.invalidate_cache(&service_scope, &config_key).await?;
[31m-            info!(
[m[31m-                "Invalidated cache for {}/{}",
[m[31m-                service_scope, config_key
[m[31m-            );
[m[32m+            info!("Invalidated cache for {}/{}", service_scope, config_key);
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/manager.rs:150:
         // Validate new value
         {
             let mut validator = self.validator.write().await;
[31m-            validator.validate(&new_value, &current.data_type, current.validation_rules.as_ref())?;
[m[32m+            validator.validate(
[m[32m+                &new_value,
[m[32m+                &current.data_type,
[m[32m+                current.validation_rules.as_ref(),
[m[32m+            )?;
[m         }
 
         // Start transaction
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/manager.rs:201:
     ///
     /// # Arguments
     /// * `service_scope` - Service scope (None for all scopes)
[31m-    pub async fn list_configs(
[m[31m-        &self,
[m[31m-        service_scope: Option<&str>,
[m[31m-    ) -> ConfigResult<Vec<ConfigItem>> {
[m[32m+    pub async fn list_configs(&self, service_scope: Option<&str>) -> ConfigResult<Vec<ConfigItem>> {
[m         let configs = if let Some(scope) = service_scope {
             sqlx::query_as::<_, ConfigItem>(
                 r#"
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/manager.rs:297:
     }
 
     /// Invalidates Redis cache for a configuration
[31m-    async fn invalidate_cache(
[m[31m-        &self,
[m[31m-        service_scope: &str,
[m[31m-        config_key: &str,
[m[31m-    ) -> ConfigResult<()> {
[m[32m+    async fn invalidate_cache(&self, service_scope: &str, config_key: &str) -> ConfigResult<()> {
[m         let redis_key = format!("config:{}:{}", service_scope, config_key);
         let mut redis = self.redis.write().await;
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/manager.rs:317:
 
 #[cfg(test)]
 mod tests {
[31m-    
[m 
     // Note: These tests require a running PostgreSQL and Redis instance
     // They are integration tests and should be run with --ignored flag
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/mod.rs:6:
 pub mod validator;
 
 pub use endpoints::ConfigurationServiceImpl;
[31m-pub use manager::{ConfigurationManager, ConfigItem};
[m[32m+pub use manager::{ConfigItem, ConfigurationManager};
[m pub use validator::{ConfigValidator, ValidationRules};
 
 // Re-export RBAC types
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/mod.rs:13:
[31m-pub use authz::{AuthzService, AuthzMetrics, PermissionResult};
[m[32m+pub use authz::{AuthzMetrics, AuthzService, PermissionResult};
[m 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/validator.rs:67:
                 "integer" | "float" => self.validate_numeric(value, &rules)?,
                 "string" => self.validate_string(value, &rules)?,
                 "array" => self.validate_array(value, &rules)?,
[31m-                _ => {}
[m[32m+                _ => {},
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/validator.rs:88:
                     "Unknown data type: {}",
                     data_type
                 )))
[31m-            }
[m[32m+            },
[m         };
 
         if !matches {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/validator.rs:241:
     fn test_validate_integer_type() {
         let mut validator = ConfigValidator::new();
         assert!(validator.validate(&json!(42), "integer", None).is_ok());
[31m-        assert!(validator.validate(&json!("not a number"), "integer", None).is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("not a number"), "integer", None)
[m[32m+            .is_err());
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/validator.rs:263:
         let mut validator = ConfigValidator::new();
         let rules = json!({"min": 0.0, "max": 100.0});
 
[31m-        assert!(validator.validate(&json!(50.0), "float", Some(&rules)).is_ok());
[m[31m-        assert!(validator.validate(&json!(-1.0), "float", Some(&rules)).is_err());
[m[31m-        assert!(validator.validate(&json!(101.0), "float", Some(&rules)).is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!(50.0), "float", Some(&rules))
[m[32m+            .is_ok());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!(-1.0), "float", Some(&rules))
[m[32m+            .is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!(101.0), "float", Some(&rules))
[m[32m+            .is_err());
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/validator.rs:273:
         let mut validator = ConfigValidator::new();
         let rules = json!({"min_len": 3, "max_len": 10});
 
[31m-        assert!(validator.validate(&json!("hello"), "string", Some(&rules)).is_ok());
[m[31m-        assert!(validator.validate(&json!("hi"), "string", Some(&rules)).is_err());
[m[31m-        assert!(validator.validate(&json!("this is too long"), "string", Some(&rules)).is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("hello"), "string", Some(&rules))
[m[32m+            .is_ok());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("hi"), "string", Some(&rules))
[m[32m+            .is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("this is too long"), "string", Some(&rules))
[m[32m+            .is_err());
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/validator.rs:283:
         let mut validator = ConfigValidator::new();
         let rules = json!({"regex": "^[A-Z]{3}$"});
 
[31m-        assert!(validator.validate(&json!("USD"), "string", Some(&rules)).is_ok());
[m[31m-        assert!(validator.validate(&json!("usd"), "string", Some(&rules)).is_err());
[m[31m-        assert!(validator.validate(&json!("US"), "string", Some(&rules)).is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("USD"), "string", Some(&rules))
[m[32m+            .is_ok());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("usd"), "string", Some(&rules))
[m[32m+            .is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("US"), "string", Some(&rules))
[m[32m+            .is_err());
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/validator.rs:293:
         let mut validator = ConfigValidator::new();
         let rules = json!({"enum": ["FIXED", "VOLUME_BASED", "SPREAD_BASED"]});
 
[31m-        assert!(validator.validate(&json!("FIXED"), "string", Some(&rules)).is_ok());
[m[31m-        assert!(validator.validate(&json!("INVALID"), "string", Some(&rules)).is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("FIXED"), "string", Some(&rules))
[m[32m+            .is_ok());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!("INVALID"), "string", Some(&rules))
[m[32m+            .is_err());
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/config/validator.rs:305:
         assert!(validator
             .validate(&json!([1, 2, 3]), "array", Some(&rules))
             .is_ok());
[31m-        assert!(validator.validate(&json!([1]), "array", Some(&rules)).is_err());
[m[32m+        assert!(validator
[m[32m+            .validate(&json!([1]), "array", Some(&rules))
[m[32m+            .is_err());
[m         assert!(validator
             .validate(&json!([1, 2, 3, 4, 5, 6]), "array", Some(&rules))
             .is_err());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:1:
 //! Backtesting Service Proxy - Zero-copy gRPC forwarding
[31m-//! 
[m[32m+//!
[m //! This module implements a high-performance proxy for the backtesting service.
 //! Design goals:
 //! - <10μs routing overhead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:16:
 
 // Import generated protobuf types from build.rs
 use crate::foxhunt::tli::{
[31m-    backtesting_service_server::BacktestingService,
[m     backtesting_service_client::BacktestingServiceClient,
[32m+    backtesting_service_server::BacktestingService,
[m[32m+    BacktestProgressEvent,
[m[32m+    GetBacktestResultsRequest,
[m[32m+    GetBacktestResultsResponse,
[m[32m+    GetBacktestStatusRequest,
[m[32m+    GetBacktestStatusResponse,
[m[32m+    ListBacktestsRequest,
[m[32m+    ListBacktestsResponse,
[m     // Request/Response types
[31m-    StartBacktestRequest, StartBacktestResponse,
[m[31m-    GetBacktestStatusRequest, GetBacktestStatusResponse,
[m[31m-    GetBacktestResultsRequest, GetBacktestResultsResponse,
[m[31m-    ListBacktestsRequest, ListBacktestsResponse,
[m[31m-    SubscribeBacktestProgressRequest, BacktestProgressEvent,
[m[31m-    StopBacktestRequest, StopBacktestResponse,
[m[32m+    StartBacktestRequest,
[m[32m+    StartBacktestResponse,
[m[32m+    StopBacktestRequest,
[m[32m+    StopBacktestResponse,
[m[32m+    SubscribeBacktestProgressRequest,
[m };
 
 /// Health check state for circuit breaker
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:60:
     pub async fn record_success(&self) {
         let mut failures = self.consecutive_failures.write().await;
         *failures = 0;
[31m-        
[m[32m+
[m         let mut state = self.state.write().await;
         if *state != HealthState::Healthy {
             info!("Backtesting service backend recovered to healthy state");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:72:
     pub async fn record_failure(&self) {
         let mut failures = self.consecutive_failures.write().await;
         *failures += 1;
[31m-        
[m[32m+
[m         let mut state = self.state.write().await;
[31m-        
[m[32m+
[m         if *failures >= self.failure_threshold && *state != HealthState::Unhealthy {
[31m-            error!("Backtesting service backend marked as unhealthy after {} consecutive failures", failures);
[m[32m+            error!(
[m[32m+                "Backtesting service backend marked as unhealthy after {} consecutive failures",
[m[32m+                failures
[m[32m+            );
[m             *state = HealthState::Unhealthy;
         } else if *failures >= self.failure_threshold / 2 && *state == HealthState::Healthy {
[31m-            warn!("Backtesting service backend degraded after {} failures", failures);
[m[32m+            warn!(
[m[32m+                "Backtesting service backend degraded after {} failures",
[m[32m+                failures
[m[32m+            );
[m             *state = HealthState::Degraded;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:101:
     /// Client connection to backend service
     /// tonic::transport::Channel is cheap to clone and reuses connections
     client: BacktestingServiceClient<tonic::transport::Channel>,
[31m-    
[m[32m+
[m     /// Health checker with circuit breaker
     health_checker: Arc<HealthChecker>,
[31m-    
[m[32m+
[m     /// Backend service URL for logging
     backend_url: String,
 }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:111:
 
 impl BacktestingServiceProxy {
     /// Create a new backtesting service proxy
[31m-    /// 
[m[32m+    ///
[m     /// # Arguments
     /// * `backend_url` - URL of the backend backtesting service (e.g., "http://localhost:50052")
[31m-    /// 
[m[32m+    ///
[m     /// # Returns
     /// * `Result<Self>` - Proxy instance or connection error
     pub async fn new(backend_url: &str) -> Result<Self, Box<dyn std::error::Error>> {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:121:
[31m-        info!("Connecting to backtesting service backend at {}", backend_url);
[m[31m-        
[m[32m+        info!(
[m[32m+            "Connecting to backtesting service backend at {}",
[m[32m+            backend_url
[m[32m+        );
[m[32m+
[m         // Establish connection to backend service
         // tonic::transport::Channel automatically handles:
         // - Connection pooling
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:133:
             .keep_alive_while_idle(true)
             .connect()
             .await?;
[31m-        
[m[32m+
[m         let client = BacktestingServiceClient::new(channel);
[31m-        
[m[32m+
[m         // Initialize health checker with circuit breaker
         let health_checker = Arc::new(HealthChecker::new(
[31m-            5,                              // failure_threshold: 5 consecutive failures
[m[31m-            Duration::from_secs(10),        // health_check_interval: 10 seconds
[m[32m+            5,                       // failure_threshold: 5 consecutive failures
[m[32m+            Duration::from_secs(10), // health_check_interval: 10 seconds
[m         ));
[31m-        
[m[32m+
[m         info!("Successfully connected to backtesting service backend");
[31m-        
[m[32m+
[m         Ok(Self {
             client,
             health_checker,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:171:
 
         // Track latency
         let start = Instant::now();
[31m-        
[m[32m+
[m         // Forward request
         let result = forward_fn().await;
[31m-        
[m[32m+
[m         let elapsed = start.elapsed();
[31m-        
[m[32m+
[m         // Record health outcome
         match &result {
             Ok(_) => {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:186:
                     latency_us = elapsed.as_micros(),
                     "Forwarded request to backtesting service"
                 );
[31m-            }
[m[32m+            },
[m             Err(status) => {
                 self.health_checker.record_failure().await;
                 error!(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:195:
                     latency_us = elapsed.as_micros(),
                     "Failed to forward request to backtesting service"
                 );
[31m-            }
[m[32m+            },
[m         }
[31m-        
[m[32m+
[m         result
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:215:
         self.forward_with_health_check("start_backtest", || async {
             // Clone the client (cheap operation, reuses connection)
             let mut client = self.client.clone();
[31m-            
[m[32m+
[m             // Extract inner request and forward
             let inner_request = request.into_inner();
[31m-            
[m[32m+
[m             // Forward to backend - zero additional allocations
             client.start_backtest(inner_request).await
         })
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:272:
         self.forward_with_health_check("subscribe_backtest_progress", || async {
             let mut client = self.client.clone();
             let inner_request = request.into_inner();
[31m-            
[m[32m+
[m             // Forward streaming request - the response is already a stream
             let response = client.subscribe_backtest_progress(inner_request).await?;
[31m-            
[m[32m+
[m             // Extract the stream and pass it through
             Ok(Response::new(response.into_inner()))
         })
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:303:
     #[tokio::test]
     async fn test_health_checker_success() {
         let checker = HealthChecker::new(3, Duration::from_secs(10));
[31m-        
[m[32m+
[m         assert_eq!(checker.get_state().await, HealthState::Healthy);
         assert!(checker.is_healthy().await);
[31m-        
[m[32m+
[m         checker.record_success().await;
         assert_eq!(checker.get_state().await, HealthState::Healthy);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:314:
     #[tokio::test]
     async fn test_health_checker_failure() {
         let checker = HealthChecker::new(3, Duration::from_secs(10));
[31m-        
[m[32m+
[m         checker.record_failure().await;
         assert_eq!(checker.get_state().await, HealthState::Degraded);
[31m-        
[m[32m+
[m         checker.record_failure().await;
         assert_eq!(checker.get_state().await, HealthState::Degraded);
[31m-        
[m[32m+
[m         checker.record_failure().await;
         assert_eq!(checker.get_state().await, HealthState::Unhealthy);
         assert!(!checker.is_healthy().await);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:329:
     #[tokio::test]
     async fn test_health_checker_recovery() {
         let checker = HealthChecker::new(3, Duration::from_secs(10));
[31m-        
[m[32m+
[m         // Mark as unhealthy
         for _ in 0..3 {
             checker.record_failure().await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/backtesting_proxy.rs:336:
         }
         assert_eq!(checker.get_state().await, HealthState::Unhealthy);
[31m-        
[m[32m+
[m         // Recovery
         checker.record_success().await;
         assert_eq!(checker.get_state().await, HealthState::Healthy);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:7:
 //! - Efficient streaming support for training metrics
 //! - Health checking integration
 
[31m-use tonic::{Request, Response, Status};
[m use futures::Stream;
 use std::pin::Pin;
[31m-use tracing::{info, error, instrument, warn};
[m[32m+use tonic::{Request, Response, Status};
[m[32m+use tracing::{error, info, instrument, warn};
[m 
 // Import the generated ML training service protobuf definitions from lib.rs
[31m-use crate::ml_training::ml_training_service_server::{MlTrainingService, MlTrainingServiceServer};
[m use crate::ml_training::ml_training_service_client::MlTrainingServiceClient;
[32m+use crate::ml_training::ml_training_service_server::{MlTrainingService, MlTrainingServiceServer};
[m use crate::ml_training::{
[31m-    StartTrainingRequest, StartTrainingResponse,
[m[31m-    SubscribeToTrainingStatusRequest, TrainingStatusUpdate,
[m[31m-    StopTrainingRequest, StopTrainingResponse,
[m[31m-    ListAvailableModelsRequest, ListAvailableModelsResponse,
[m[31m-    ListTrainingJobsRequest, ListTrainingJobsResponse,
[m[31m-    GetTrainingJobDetailsRequest, GetTrainingJobDetailsResponse,
[m[31m-    HealthCheckRequest, HealthCheckResponse,
[m[32m+    GetTrainingJobDetailsRequest, GetTrainingJobDetailsResponse, HealthCheckRequest,
[m[32m+    HealthCheckResponse, ListAvailableModelsRequest, ListAvailableModelsResponse,
[m[32m+    ListTrainingJobsRequest, ListTrainingJobsResponse, StartTrainingRequest, StartTrainingResponse,
[m[32m+    StopTrainingRequest, StopTrainingResponse, SubscribeToTrainingStatusRequest,
[m[32m+    TrainingStatusUpdate,
[m };
 
 /// ML Training Service Proxy
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:57:
 #[tonic::async_trait]
 impl MlTrainingService for MlTrainingProxy {
     /// Server streaming type for training status updates
[31m-    type SubscribeToTrainingStatusStream = Pin<Box<dyn Stream<Item = Result<TrainingStatusUpdate, Status>> + Send>>;
[m[32m+    type SubscribeToTrainingStatusStream =
[m[32m+        Pin<Box<dyn Stream<Item = Result<TrainingStatusUpdate, Status>> + Send>>;
[m 
     /// Start a new model training job
     ///
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:70:
         request: Request<StartTrainingRequest>,
     ) -> Result<Response<StartTrainingResponse>, Status> {
         info!("Proxying StartTraining request");
[31m-        
[m[32m+
[m         // Clone client (cheap Arc increment) for concurrent request handling
         let mut client = self.client.clone();
[31m-        
[m[32m+
[m         // Forward request with zero-copy
         let response = client.start_training(request).await.map_err(|e| {
             error!("Backend StartTraining failed: {}", e);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:80:
             e
         })?;
[31m-        
[m[32m+
[m         info!("StartTraining request forwarded successfully");
         Ok(response)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:96:
         request: Request<SubscribeToTrainingStatusRequest>,
     ) -> Result<Response<Self::SubscribeToTrainingStatusStream>, Status> {
         info!("Proxying SubscribeToTrainingStatus streaming request");
[31m-        
[m[32m+
[m         let mut client = self.client.clone();
[31m-        
[m[32m+
[m         // Get backend stream response
[31m-        let stream_response = client.subscribe_to_training_status(request).await.map_err(|e| {
[m[31m-            error!("Backend SubscribeToTrainingStatus failed: {}", e);
[m[31m-            e
[m[31m-        })?;
[m[31m-        
[m[32m+        let stream_response = client
[m[32m+            .subscribe_to_training_status(request)
[m[32m+            .await
[m[32m+            .map_err(|e| {
[m[32m+                error!("Backend SubscribeToTrainingStatus failed: {}", e);
[m[32m+                e
[m[32m+            })?;
[m[32m+
[m         // Extract inner stream and forward directly (zero-copy)
         let stream = stream_response.into_inner();
         let boxed_stream = Box::pin(stream) as Self::SubscribeToTrainingStatusStream;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:111:
[31m-        
[m[32m+
[m         info!("SubscribeToTrainingStatus streaming request forwarded successfully");
         Ok(Response::new(boxed_stream))
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:124:
         request: Request<StopTrainingRequest>,
     ) -> Result<Response<StopTrainingResponse>, Status> {
         info!("Proxying StopTraining request");
[31m-        
[m[32m+
[m         let mut client = self.client.clone();
         let response = client.stop_training(request).await.map_err(|e| {
             error!("Backend StopTraining failed: {}", e);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:131:
             e
         })?;
[31m-        
[m[32m+
[m         info!("StopTraining request forwarded successfully");
         Ok(response)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:146:
         request: Request<ListAvailableModelsRequest>,
     ) -> Result<Response<ListAvailableModelsResponse>, Status> {
         info!("Proxying ListAvailableModels request");
[31m-        
[m[32m+
[m         let mut client = self.client.clone();
         let response = client.list_available_models(request).await.map_err(|e| {
             error!("Backend ListAvailableModels failed: {}", e);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:153:
             e
         })?;
[31m-        
[m[32m+
[m         info!("ListAvailableModels request forwarded successfully");
         Ok(response)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:168:
         request: Request<ListTrainingJobsRequest>,
     ) -> Result<Response<ListTrainingJobsResponse>, Status> {
         info!("Proxying ListTrainingJobs request");
[31m-        
[m[32m+
[m         let mut client = self.client.clone();
         let response = client.list_training_jobs(request).await.map_err(|e| {
             error!("Backend ListTrainingJobs failed: {}", e);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:175:
             e
         })?;
[31m-        
[m[32m+
[m         info!("ListTrainingJobs request forwarded successfully");
         Ok(response)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:190:
         request: Request<GetTrainingJobDetailsRequest>,
     ) -> Result<Response<GetTrainingJobDetailsResponse>, Status> {
         info!("Proxying GetTrainingJobDetails request");
[31m-        
[m[32m+
[m         let mut client = self.client.clone();
[31m-        let response = client.get_training_job_details(request).await.map_err(|e| {
[m[31m-            error!("Backend GetTrainingJobDetails failed: {}", e);
[m[31m-            e
[m[31m-        })?;
[m[31m-        
[m[32m+        let response = client
[m[32m+            .get_training_job_details(request)
[m[32m+            .await
[m[32m+            .map_err(|e| {
[m[32m+                error!("Backend GetTrainingJobDetails failed: {}", e);
[m[32m+                e
[m[32m+            })?;
[m[32m+
[m         info!("GetTrainingJobDetails request forwarded successfully");
         Ok(response)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:212:
         request: Request<HealthCheckRequest>,
     ) -> Result<Response<HealthCheckResponse>, Status> {
         info!("Proxying HealthCheck request");
[31m-        
[m[32m+
[m         let mut client = self.client.clone();
         let response = client.health_check(request).await.map_err(|e| {
             warn!("Backend HealthCheck failed: {}", e);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:219:
             e
         })?;
[31m-        
[m[32m+
[m         info!("HealthCheck request forwarded successfully");
         Ok(response)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/ml_training_proxy.rs:226:
 
 #[cfg(test)]
 mod tests {
[31m-    
[m 
     #[test]
     fn test_proxy_creation() {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/mod.rs:12:
 
 pub use backtesting_proxy::BacktestingServiceProxy;
 pub use ml_training_proxy::MlTrainingProxy;
[31m-pub use server::{MlTrainingBackendConfig, setup_ml_training_client, setup_ml_training_proxy};
[m[31m-pub use trading_proxy::{TradingServiceProxy, HealthChecker};
[m[32m+pub use server::{setup_ml_training_client, setup_ml_training_proxy, MlTrainingBackendConfig};
[m[32m+pub use trading_proxy::{HealthChecker, TradingServiceProxy};
[m 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/server.rs:3:
 //! This module provides utilities for setting up backend service clients
 //! with circuit breakers, connection pooling, and health checking.
 
[32m+use anyhow::Result;
[m use std::time::Duration;
 use tonic::transport::{Channel, Endpoint};
[31m-use anyhow::Result;
[m[31m-use tracing::{info, error};
[m[32m+use tracing::{error, info};
[m 
[31m-use crate::ml_training::ml_training_service_client::MlTrainingServiceClient;
[m use super::ml_training_proxy::MlTrainingProxy;
[32m+use crate::ml_training::ml_training_service_client::MlTrainingServiceClient;
[m 
 /// Configuration for ML Training Service backend
 #[derive(Debug, Clone)]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/server.rs:53:
 pub async fn setup_ml_training_client(
     config: MlTrainingBackendConfig,
 ) -> Result<MlTrainingServiceClient<Channel>> {
[31m-    info!("Setting up ML Training Service client for {}", config.address);
[m[32m+    info!(
[m[32m+        "Setting up ML Training Service client for {}",
[m[32m+        config.address
[m[32m+    );
[m 
     // Parse and configure endpoint
     let endpoint = Endpoint::from_shared(config.address.clone())?
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/server.rs:78:
         "Circuit breaker config: {} failures, {}s reset (to be implemented)",
         config.circuit_breaker_failures, config.circuit_breaker_reset_secs
     );
[31m-    
[m[32m+
[m     // Create client from channel
     let client = MlTrainingServiceClient::new(channel);
[31m-    
[m[32m+
[m     info!("✓ ML Training Service client ready");
 
     Ok(client)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/server.rs:94:
 ///
 /// # Returns
 /// * ML Training Service proxy ready for serving
[31m-pub async fn setup_ml_training_proxy(
[m[31m-    config: MlTrainingBackendConfig,
[m[31m-) -> Result<MlTrainingProxy> {
[m[32m+pub async fn setup_ml_training_proxy(config: MlTrainingBackendConfig) -> Result<MlTrainingProxy> {
[m     info!("Setting up ML Training Service proxy...");
 
     // Setup client with circuit breaker
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/server.rs:128:
             address: "invalid://address".to_string(),
             ..Default::default()
         };
[31m-        
[m[32m+
[m         let result = setup_ml_training_client(config).await;
         assert!(result.is_err());
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:9:
 //! - Metadata extraction and forwarding
 //! - Target: <10μs routing overhead (5-8μs typical)
 
[32m+use futures::Stream;
[m[32m+use std::pin::Pin;
[m use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
 use std::sync::Arc;
 use std::time::Instant;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:15:
 use tonic::transport::Channel;
 use tonic::{Request, Response, Status};
 use tracing::{debug, error, warn};
[31m-use futures::Stream;
[m[31m-use std::pin::Pin;
[m 
 // Import generated trading service client from foxhunt.tli proto package
[31m-use crate::foxhunt::tli::{trading_service_client::TradingServiceClient, trading_service_server::TradingService, *};
[m[32m+use crate::foxhunt::tli::{
[m[32m+    trading_service_client::TradingServiceClient, trading_service_server::TradingService, *,
[m[32m+};
[m 
 /// Health checker for backend trading service
 ///
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:145:
 
     /// Create proxy with lazy connection (for faster startup)
     pub fn new_lazy(backend_url: &str) -> Result<Self, Box<dyn std::error::Error>> {
[31m-        let channel = Channel::from_shared(backend_url.to_string())?
[m[31m-            .connect_lazy();
[m[32m+        let channel = Channel::from_shared(backend_url.to_string())?.connect_lazy();
[m 
         let client = TradingServiceClient::new(channel);
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:162:
     #[inline(always)]
     fn check_circuit_breaker(&self) -> Result<(), Status> {
         if !self.health_checker.is_healthy() {
[31m-            return Err(Status::unavailable("Trading service is unavailable (circuit breaker open)"));
[m[32m+            return Err(Status::unavailable(
[m[32m+                "Trading service is unavailable (circuit breaker open)",
[m[32m+            ));
[m         }
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:200:
 #[tonic::async_trait]
 impl TradingService for TradingServiceProxy {
     // Streaming response types
[31m-    type SubscribeMarketDataStream = Pin<Box<dyn Stream<Item = Result<MarketDataEvent, Status>> + Send>>;
[m[31m-    type SubscribeOrderUpdatesStream = Pin<Box<dyn Stream<Item = Result<OrderUpdateEvent, Status>> + Send>>;
[m[31m-    type SubscribeRiskAlertsStream = Pin<Box<dyn Stream<Item = Result<RiskAlertEvent, Status>> + Send>>;
[m[32m+    type SubscribeMarketDataStream =
[m[32m+        Pin<Box<dyn Stream<Item = Result<MarketDataEvent, Status>> + Send>>;
[m[32m+    type SubscribeOrderUpdatesStream =
[m[32m+        Pin<Box<dyn Stream<Item = Result<OrderUpdateEvent, Status>> + Send>>;
[m[32m+    type SubscribeRiskAlertsStream =
[m[32m+        Pin<Box<dyn Stream<Item = Result<RiskAlertEvent, Status>> + Send>>;
[m     type SubscribeMetricsStream = Pin<Box<dyn Stream<Item = Result<MetricsEvent, Status>> + Send>>;
     type SubscribeConfigStream = Pin<Box<dyn Stream<Item = Result<ConfigEvent, Status>> + Send>>;
[31m-    type SubscribeSystemStatusStream = Pin<Box<dyn Stream<Item = Result<SystemStatusEvent, Status>> + Send>>;
[m[32m+    type SubscribeSystemStatusStream =
[m[32m+        Pin<Box<dyn Stream<Item = Result<SystemStatusEvent, Status>> + Send>>;
[m 
     /// Submit order with zero-copy forwarding
     ///
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:228:
             Err(e) => {
                 error!("Backend error in submit_order: {}", e);
                 // Update circuit breaker on backend failure
[31m-                if matches!(e.code(), tonic::Code::Unavailable | tonic::Code::DeadlineExceeded) {
[m[32m+                if matches!(
[m[32m+                    e.code(),
[m[32m+                    tonic::Code::Unavailable | tonic::Code::DeadlineExceeded
[m[32m+                ) {
[m                     self.health_checker.mark_unhealthy();
                 }
                 Err(e)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:235:
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:251:
             Ok(response) => Ok(response),
             Err(e) => {
                 error!("Backend error in cancel_order: {}", e);
[31m-                if matches!(e.code(), tonic::Code::Unavailable | tonic::Code::DeadlineExceeded) {
[m[32m+                if matches!(
[m[32m+                    e.code(),
[m[32m+                    tonic::Code::Unavailable | tonic::Code::DeadlineExceeded
[m[32m+                ) {
[m                     self.health_checker.mark_unhealthy();
                 }
                 Err(e)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:258:
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:271:
             Ok(response) => Ok(response),
             Err(e) => {
                 error!("Backend error in get_order_status: {}", e);
[31m-                if matches!(e.code(), tonic::Code::Unavailable | tonic::Code::DeadlineExceeded) {
[m[32m+                if matches!(
[m[32m+                    e.code(),
[m[32m+                    tonic::Code::Unavailable | tonic::Code::DeadlineExceeded
[m[32m+                ) {
[m                     self.health_checker.mark_unhealthy();
                 }
                 Err(e)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:278:
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:291:
             Ok(response) => Ok(response),
             Err(e) => {
                 error!("Backend error in get_account_info: {}", e);
[31m-                if matches!(e.code(), tonic::Code::Unavailable | tonic::Code::DeadlineExceeded) {
[m[32m+                if matches!(
[m[32m+                    e.code(),
[m[32m+                    tonic::Code::Unavailable | tonic::Code::DeadlineExceeded
[m[32m+                ) {
[m                     self.health_checker.mark_unhealthy();
                 }
                 Err(e)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:298:
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:314:
             Ok(response) => Ok(response),
             Err(e) => {
                 error!("Backend error in get_positions: {}", e);
[31m-                if matches!(e.code(), tonic::Code::Unavailable | tonic::Code::DeadlineExceeded) {
[m[32m+                if matches!(
[m[32m+                    e.code(),
[m[32m+                    tonic::Code::Unavailable | tonic::Code::DeadlineExceeded
[m[32m+                ) {
[m                     self.health_checker.mark_unhealthy();
                 }
                 Err(e)
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:321:
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:331:
 
         let mut client = self.client.clone();
         let stream = client.subscribe_market_data(request).await?.into_inner();
[31m-        Ok(Response::new(Box::pin(stream) as Self::SubscribeMarketDataStream))
[m[32m+        Ok(Response::new(
[m[32m+            Box::pin(stream) as Self::SubscribeMarketDataStream
[m[32m+        ))
[m     }
 
     async fn subscribe_order_updates(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:342:
 
         let mut client = self.client.clone();
         let stream = client.subscribe_order_updates(request).await?.into_inner();
[31m-        Ok(Response::new(Box::pin(stream) as Self::SubscribeOrderUpdatesStream))
[m[32m+        Ok(Response::new(
[m[32m+            Box::pin(stream) as Self::SubscribeOrderUpdatesStream
[m[32m+        ))
[m     }
 
     // Risk management methods
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:394:
 
         let mut client = self.client.clone();
         let stream = client.subscribe_risk_alerts(request).await?.into_inner();
[31m-        Ok(Response::new(Box::pin(stream) as Self::SubscribeRiskAlertsStream))
[m[32m+        Ok(Response::new(
[m[32m+            Box::pin(stream) as Self::SubscribeRiskAlertsStream
[m[32m+        ))
[m     }
 
     async fn emergency_stop(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:446:
 
         let mut client = self.client.clone();
         let stream = client.subscribe_metrics(request).await?.into_inner();
[31m-        Ok(Response::new(Box::pin(stream) as Self::SubscribeMetricsStream))
[m[32m+        Ok(Response::new(
[m[32m+            Box::pin(stream) as Self::SubscribeMetricsStream
[m[32m+        ))
[m     }
 
     // Configuration methods
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:478:
 
         let mut client = self.client.clone();
         let stream = client.subscribe_config(request).await?.into_inner();
[31m-        Ok(Response::new(Box::pin(stream) as Self::SubscribeConfigStream))
[m[32m+        Ok(Response::new(
[m[32m+            Box::pin(stream) as Self::SubscribeConfigStream
[m[32m+        ))
[m     }
 
     // System status methods
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:500:
 
         let mut client = self.client.clone();
         let stream = client.subscribe_system_status(request).await?.into_inner();
[31m-        Ok(Response::new(Box::pin(stream) as Self::SubscribeSystemStatusStream))
[m[32m+        Ok(Response::new(
[m[32m+            Box::pin(stream) as Self::SubscribeSystemStatusStream
[m[32m+        ))
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/grpc/trading_proxy.rs:526:
         let checker = Arc::new(HealthChecker::new(30));
         let proxy = TradingServiceProxy {
             client: TradingServiceClient::new(
[31m-                Channel::from_static("http://[::1]:50051").connect_lazy()
[m[32m+                Channel::from_static("http://[::1]:50051").connect_lazy(),
[m             ),
             health_checker: checker.clone(),
         };
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/lib.rs:38:
 
 // Re-export configuration management types
 pub use config::{
[31m-    AuthzService, AuthzMetrics, PermissionResult, ConfigurationManager, ConfigurationServiceImpl,
[m[31m-    ConfigItem, ConfigValidator,
[m[32m+    AuthzMetrics, AuthzService, ConfigItem, ConfigValidator, ConfigurationManager,
[m[32m+    ConfigurationServiceImpl, PermissionResult,
[m };
 
 // Re-export routing and rate limiting types
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/lib.rs:46:
[31m-pub use routing::{RateLimiter, RateLimitConfig, CacheStats};
[m[32m+pub use routing::{CacheStats, RateLimitConfig, RateLimiter};
[m 
 // Re-export gRPC proxy types
 pub use grpc::{
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/lib.rs:50:
[31m-    TradingServiceProxy, HealthChecker,
[m[31m-    BacktestingServiceProxy,
[m[31m-    MlTrainingProxy, MlTrainingBackendConfig,
[m[31m-    setup_ml_training_proxy, setup_ml_training_client,
[m[32m+    setup_ml_training_client, setup_ml_training_proxy, BacktestingServiceProxy, HealthChecker,
[m[32m+    MlTrainingBackendConfig, MlTrainingProxy, TradingServiceProxy,
[m };
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/auth_metrics.rs:8:
 //! - MFA verification
 //! - Audit logging
 
[31m-use prometheus::{
[m[31m-    Counter, CounterVec, Histogram, HistogramOpts, IntGauge, Opts,
[m[31m-    Registry,
[m[31m-};
[m[32m+use prometheus::{Counter, CounterVec, Histogram, HistogramOpts, IntGauge, Opts, Registry};
[m 
 /// Authentication metrics for all 6 layers
 pub struct AuthMetrics {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/auth_metrics.rs:98:
     /// Create new authentication metrics and register with Prometheus
     pub fn new(registry: &Registry) -> Result<Self, prometheus::Error> {
         // === Request Counters ===
[31m-        let auth_requests_total =
[m[31m-            Counter::with_opts(Opts::new("api_gateway_auth_requests_total", "Total authentication requests"))?;
[m[32m+        let auth_requests_total = Counter::with_opts(Opts::new(
[m[32m+            "api_gateway_auth_requests_total",
[m[32m+            "Total authentication requests",
[m[32m+        ))?;
[m         registry.register(Box::new(auth_requests_total.clone()))?;
 
         let auth_requests_success = Counter::with_opts(Opts::new(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/auth_metrics.rs:269:
         registry.register(Box::new(requests_by_user.clone()))?;
 
         let auth_failures_by_user = CounterVec::new(
[31m-            Opts::new("api_gateway_auth_failures_by_user", "Auth failures per user"),
[m[32m+            Opts::new(
[m[32m+                "api_gateway_auth_failures_by_user",
[m[32m+                "Auth failures per user",
[m[32m+            ),
[m             &["user_id", "reason"],
         )?;
         registry.register(Box::new(auth_failures_by_user.clone()))?;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/auth_metrics.rs:276:
 
         let rate_limits_by_user = CounterVec::new(
[31m-            Opts::new("api_gateway_rate_limits_by_user", "Rate limit hits per user"),
[m[32m+            Opts::new(
[m[32m+                "api_gateway_rate_limits_by_user",
[m[32m+                "Rate limit hits per user",
[m[32m+            ),
[m             &["user_id"],
         )?;
         registry.register(Box::new(rate_limits_by_user.clone()))?;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/auth_metrics.rs:384:
             "rate_limited" => self.auth_errors_rate_limited.inc(),
             "mfa_failed" => self.auth_errors_mfa_failed.inc(),
             "redis_failure" => self.auth_errors_redis_failure.inc(),
[31m-            _ => {} // Unknown error type
[m[32m+            _ => {}, // Unknown error type
[m         }
 
         // Track per-user failures
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/config_metrics.rs:214:
             "routing" => self.config_updates_routing.inc(),
             "rate_limit" => self.config_updates_rate_limit.inc(),
             "backend" => self.config_updates_backend.inc(),
[31m-            _ => {}
[m[32m+            _ => {},
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/config_metrics.rs:221:
     /// Update NOTIFY listener connection status
     pub fn update_listener_status(&self, connected: bool) {
[31m-        self.notify_listener_connected.set(if connected { 1 } else { 0 });
[m[32m+        self.notify_listener_connected
[m[32m+            .set(if connected { 1 } else { 0 });
[m     }
 
     /// Record NOTIFY listener reconnection
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/exporter.rs:71:
 /// Create Prometheus endpoint as gRPC health check extension
 ///
 /// This allows exposing metrics through the same gRPC server
[31m-pub async fn serve_metrics_grpc(
[m[31m-    registry: Arc<Registry>,
[m[31m-) -> Result<Response<String>, Status> {
[m[32m+pub async fn serve_metrics_grpc(registry: Arc<Registry>) -> Result<Response<String>, Status> {
[m     let exporter = PrometheusExporter::new(registry);
 
     exporter
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/proxy_metrics.rs:5:
 //! - Backtesting Service
 //! - ML Training Service
 
[31m-use prometheus::{
[m[31m-    CounterVec, Histogram, HistogramOpts, HistogramVec, IntGaugeVec, Opts,
[m[31m-    Registry,
[m[31m-};
[m[32m+use prometheus::{CounterVec, Histogram, HistogramOpts, HistogramVec, IntGaugeVec, Opts, Registry};
[m 
 /// Backend proxy and routing metrics
 pub struct ProxyMetrics {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/proxy_metrics.rs:104:
                 "api_gateway_backend_request_duration_milliseconds",
                 "Backend request latency in milliseconds",
             )
[31m-            .buckets(vec![1.0, 5.0, 10.0, 25.0, 50.0, 100.0, 250.0, 500.0, 1000.0]),
[m[32m+            .buckets(vec![
[m[32m+                1.0, 5.0, 10.0, 25.0, 50.0, 100.0, 250.0, 500.0, 1000.0,
[m[32m+            ]),
[m             &["service", "method"],
         )?;
         registry.register(Box::new(backend_request_duration_ms.clone()))?;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/metrics/proxy_metrics.rs:326:
     }
 
     /// Update connection pool stats
[31m-    pub fn update_connection_pool(
[m[31m-        &self,
[m[31m-        service: &str,
[m[31m-        active: i64,
[m[31m-        idle: i64,
[m[31m-        max: i64,
[m[31m-    ) {
[m[32m+    pub fn update_connection_pool(&self, service: &str, active: i64, idle: i64, max: i64) {
[m         self.connection_pool_active
             .with_label_values(&[service])
             .set(active);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/routing/mod.rs:9:
 
 pub mod rate_limiter;
 
[31m-pub use rate_limiter::{RateLimiter, RateLimitConfig, CacheStats};
[m[32m+pub use rate_limiter::{CacheStats, RateLimitConfig, RateLimiter};
[m 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/routing/rate_limiter.rs:351:
 
     /// Add or update endpoint configuration (lock-free insertion)
     pub async fn set_endpoint_config(&self, config: RateLimitConfig) {
[31m-        self.endpoint_configs.insert(config.endpoint.clone(), config);
[m[32m+        self.endpoint_configs
[m[32m+            .insert(config.endpoint.clone(), config);
[m     }
 
     /// Get current cache statistics (lock-free reads)
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/main.rs:11:
 
 // Import all needed types from the library
 use api_gateway::auth::{
[31m-        AuditLogger, AuthInterceptor, AuthzService, JwtService, RateLimiter, RevocationService,
[m[31m-    };
[m[32m+    AuditLogger, AuthInterceptor, AuthzService, JwtService, RateLimiter, RevocationService,
[m[32m+};
[m 
 #[derive(Parser, Debug)]
 #[command(name = "api_gateway", about = "Foxhunt API Gateway Service")]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/main.rs:117:
     // Initialize trading service proxy
     let trading_proxy = api_gateway::grpc::TradingServiceProxy::new_lazy(&trading_backend_url)
         .expect("Failed to create trading service proxy");
[31m-    info!("✓ Trading service proxy initialized ({})", trading_backend_url);
[m[32m+    info!(
[m[32m+        "✓ Trading service proxy initialized ({})",
[m[32m+        trading_backend_url
[m[32m+    );
[m 
     // Initialize backtesting service proxy
[31m-    let backtesting_proxy = api_gateway::grpc::BacktestingServiceProxy::new(&backtesting_backend_url)
[m[31m-        .await
[m[31m-        .expect("Failed to create backtesting service proxy");
[m[31m-    info!("✓ Backtesting service proxy initialized ({})", backtesting_backend_url);
[m[32m+    let backtesting_proxy =
[m[32m+        api_gateway::grpc::BacktestingServiceProxy::new(&backtesting_backend_url)
[m[32m+            .await
[m[32m+            .expect("Failed to create backtesting service proxy");
[m[32m+    info!(
[m[32m+        "✓ Backtesting service proxy initialized ({})",
[m[32m+        backtesting_backend_url
[m[32m+    );
[m 
     // Initialize ML training service proxy
     let ml_config = api_gateway::grpc::MlTrainingBackendConfig {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/main.rs:136:
     let ml_training_proxy = api_gateway::grpc::setup_ml_training_proxy(ml_config)
         .await
         .expect("Failed to create ML training service proxy");
[31m-    info!("✓ ML training service proxy initialized ({})", ml_training_backend_url);
[m[32m+    info!(
[m[32m+        "✓ ML training service proxy initialized ({})",
[m[32m+        ml_training_backend_url
[m[32m+    );
[m 
     // Initialize configuration manager (requires database)
     let database_url = std::env::var("DATABASE_URL")
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/main.rs:147:
     info!("✓ Database connection established");
 
     // Create Redis connection for config manager
[31m-    let redis_client = redis::Client::open(args.redis_url.clone())
[m[31m-        .expect("Failed to create Redis client");
[m[32m+    let redis_client =
[m[32m+        redis::Client::open(args.redis_url.clone()).expect("Failed to create Redis client");
[m     let redis_conn = redis::aio::ConnectionManager::new(redis_client)
         .await
         .expect("Failed to create Redis connection manager");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/main.rs:158:
         .expect("Failed to create configuration manager");
 
     // Start NOTIFY listener for hot-reload
[31m-    config_manager.start_listening()
[m[32m+    config_manager
[m[32m+        .start_listening()
[m         .await
         .expect("Failed to start configuration listener");
     info!("✓ Configuration manager initialized with hot-reload");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/main.rs:165:
 
     // Build gRPC server with all services
     use api_gateway::foxhunt::tli::{
[31m-        trading_service_server::TradingServiceServer,
[m         backtesting_service_server::BacktestingServiceServer,
[32m+        trading_service_server::TradingServiceServer,
[m     };
     use api_gateway::ml_training::ml_training_service_server::MlTrainingServiceServer;
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/main.rs:173:
[31m-    let addr = args.bind_addr.parse()
[m[32m+    let addr = args
[m[32m+        .bind_addr
[m[32m+        .parse()
[m         .expect("Failed to parse bind address");
 
     info!("Starting gRPC server on {}", addr);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/src/main.rs:233:
 fn load_jwt_secret(env_secret: Option<String>) -> Result<String> {
     // Priority: 1) JWT_SECRET_FILE, 2) JWT_SECRET env var
     if let Ok(secret_file) = std::env::var("JWT_SECRET_FILE") {
[31m-        let secret = std::fs::read_to_string(&secret_file)
[m[31m-            .map_err(|e| anyhow::anyhow!("Failed to read JWT secret file {}: {}", secret_file, e))?;
[m[32m+        let secret = std::fs::read_to_string(&secret_file).map_err(|e| {
[m[32m+            anyhow::anyhow!("Failed to read JWT secret file {}: {}", secret_file, e)
[m[32m+        })?;
[m         info!("JWT secret loaded from file: {}", secret_file);
         return Ok(secret.trim().to_string());
     }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:14:
 mod common;
 
 use anyhow::Result;
[31m-use common::{cleanup_redis, generate_expired_token, generate_invalid_signature_token, generate_test_token, wait_for_redis, TestJwtConfig};
[m[32m+use common::{
[m[32m+    cleanup_redis, generate_expired_token, generate_invalid_signature_token, generate_test_token,
[m[32m+    wait_for_redis, TestJwtConfig,
[m[32m+};
[m use std::time::{Duration, Instant};
 use tonic::{metadata::MetadataValue, Request};
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:30:
     cleanup_redis(REDIS_URL).await?;
 
     let config = TestJwtConfig::default();
[31m-    
[m[31m-    let jwt_service = JwtService::new(
[m[31m-        config.secret,
[m[31m-        config.issuer,
[m[31m-        config.audience,
[m[31m-    );
[m[31m-    
[m[32m+
[m[32m+    let jwt_service = JwtService::new(config.secret, config.issuer, config.audience);
[m[32m+
[m     let revocation_service = RevocationService::new(REDIS_URL).await?;
     let authz_service = AuthzService::new();
     let rate_limiter = RateLimiter::new(100)?; // 100 req/s
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:43:
     let audit_logger = AuditLogger::new(true)?;
[31m-    
[m[32m+
[m     Ok(AuthInterceptor::new(
         jwt_service,
         revocation_service,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:54:
 #[tokio::test]
 async fn test_successful_authentication() -> Result<()> {
     println!("\n=== Test: Successful Authentication ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate valid token
     let (token, _jti) = generate_test_token(
         "user123",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:64:
         vec!["api.access".to_string(), "trading.submit".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     // Create request with Authorization header
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:71:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     // Measure authentication time
     let start = Instant::now();
     let result = auth_interceptor.clone().authenticate(request).await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:78:
     let elapsed = start.elapsed();
[31m-    
[m[32m+
[m     println!("✓ Authentication succeeded in {:?}", elapsed);
     println!("  Performance target: <10μs, Actual: {:?}", elapsed);
[31m-    
[m[32m+
[m     assert!(result.is_ok(), "Authentication should succeed");
[31m-    
[m[32m+
[m     // Verify user context was injected
     let authenticated_request = result.unwrap();
     let extensions = authenticated_request.extensions();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:88:
[31m-    
[m[32m+
[m     assert!(
         extensions.get::<api_gateway::auth::UserContext>().is_some(),
         "User context should be injected"
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:92:
     );
[31m-    
[m[32m+
[m     if let Some(user_ctx) = extensions.get::<api_gateway::auth::UserContext>() {
         assert_eq!(user_ctx.user_id, "user123");
         assert!(user_ctx.roles.contains(&"trader".to_string()));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:97:
         assert!(user_ctx.permissions.contains(&"api.access".to_string()));
         println!("✓ User context verified: user_id={}", user_ctx.user_id);
     }
[31m-    
[m[32m+
[m     // Warn if latency exceeds target
     if elapsed > Duration::from_micros(10) {
[31m-        println!("⚠ WARNING: Authentication latency {:?} exceeds 10μs target", elapsed);
[m[32m+        println!(
[m[32m+            "⚠ WARNING: Authentication latency {:?} exceeds 10μs target",
[m[32m+            elapsed
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:109:
 #[tokio::test]
 async fn test_missing_jwt_rejected() -> Result<()> {
     println!("\n=== Test: Missing JWT Rejected ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Create request without Authorization header
     let request = Request::new(());
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[32m+
[m     assert!(result.is_err(), "Request without JWT should be rejected");
[31m-    
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::Unauthenticated);
         println!("✓ Request rejected with status: {}", status.code());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:125:
         println!("  Message: {}", status.message());
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:131:
 #[tokio::test]
 async fn test_revoked_jwt_rejected() -> Result<()> {
     println!("\n=== Test: Revoked JWT Rejected ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate valid token
     let (token, jti) = generate_test_token(
         "user456",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:141:
         vec!["api.access".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     // Add token to blacklist
     let revocation_service = RevocationService::new(REDIS_URL).await?;
     revocation_service
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:148:
         .revoke_token(&Jti::from_string(jti), 3600)
         .await?;
[31m-    
[m[32m+
[m     println!("✓ Token added to blacklist");
[31m-    
[m[32m+
[m     // Create request with revoked token
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:156:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[32m+
[m     assert!(result.is_err(), "Revoked token should be rejected");
[31m-    
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::Unauthenticated);
         println!("✓ Revoked token rejected with status: {}", status.code());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:167:
[31m-        assert!(status.message().contains("revoked"), "Error message should mention revocation");
[m[32m+        assert!(
[m[32m+            status.message().contains("revoked"),
[m[32m+            "Error message should mention revocation"
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:173:
 #[tokio::test]
 async fn test_expired_jwt_rejected() -> Result<()> {
     println!("\n=== Test: Expired JWT Rejected ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate expired token
     let token = generate_expired_token("user789")?;
[31m-    
[m[32m+
[m     // Create request with expired token
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:185:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[32m+
[m     assert!(result.is_err(), "Expired token should be rejected");
[31m-    
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::Unauthenticated);
         println!("✓ Expired token rejected with status: {}", status.code());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:196:
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:201:
 #[tokio::test]
 async fn test_invalid_signature_rejected() -> Result<()> {
     println!("\n=== Test: Invalid Signature Rejected ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate token with wrong signature
     let token = generate_invalid_signature_token("attacker")?;
[31m-    
[m[32m+
[m     // Create request with invalid token
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:213:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[31m-    assert!(result.is_err(), "Token with invalid signature should be rejected");
[m[31m-    
[m[32m+
[m[32m+    assert!(
[m[32m+        result.is_err(),
[m[32m+        "Token with invalid signature should be rejected"
[m[32m+    );
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::Unauthenticated);
[31m-        println!("✓ Invalid signature rejected with status: {}", status.code());
[m[32m+        println!(
[m[32m+            "✓ Invalid signature rejected with status: {}",
[m[32m+            status.code()
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:229:
 #[tokio::test]
 async fn test_rbac_permission_denied() -> Result<()> {
     println!("\n=== Test: RBAC Permission Denied ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate token without api.access permission
     let (token, _jti) = generate_test_token(
         "restricted_user",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:239:
         vec!["limited.access".to_string()], // Missing api.access
         3600,
     )?;
[31m-    
[m[32m+
[m     // Create request with limited permissions
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:246:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[31m-    assert!(result.is_err(), "Request without api.access should be denied");
[m[31m-    
[m[32m+
[m[32m+    assert!(
[m[32m+        result.is_err(),
[m[32m+        "Request without api.access should be denied"
[m[32m+    );
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::PermissionDenied);
         println!("✓ Permission denied with status: {}", status.code());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:257:
         println!("  Message: {}", status.message());
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:263:
 #[tokio::test]
 async fn test_rate_limit_exceeded() -> Result<()> {
     println!("\n=== Test: Rate Limit Exceeded ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate valid token
     let (token, _jti) = generate_test_token(
         "rate_limited_user",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:273:
         vec!["api.access".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     let mut success_count = 0;
     let mut rate_limited_count = 0;
[31m-    
[m[32m+
[m     // Make 110 rapid requests (limit is 100/s)
     for i in 1..=110 {
         let mut request = Request::new(());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:284:
             "authorization",
             MetadataValue::try_from(format!("Bearer {}", token))?,
         );
[31m-        
[m[32m+
[m         let result = auth_interceptor.clone().authenticate(request).await;
[31m-        
[m[32m+
[m         if result.is_ok() {
             success_count += 1;
         } else if let Err(status) = result {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:298:
             }
         }
     }
[31m-    
[m[32m+
[m     println!("  Successful requests: {}", success_count);
     println!("  Rate limited requests: {}", rate_limited_count);
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:305:
[31m-    assert!(rate_limited_count > 0, "Some requests should be rate limited");
[m[32m+    assert!(
[m[32m+        rate_limited_count > 0,
[m[32m+        "Some requests should be rate limited"
[m[32m+    );
[m     // Allow small tolerance (3-5 extra) due to token bucket timing granularity
[31m-    assert!(success_count <= 105, "Success count should not significantly exceed limit (got {}, limit 100, tolerance 105)", success_count);
[m[31m-    
[m[32m+    assert!(
[m[32m+        success_count <= 105,
[m[32m+        "Success count should not significantly exceed limit (got {}, limit 100, tolerance 105)",
[m[32m+        success_count
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:312:
 #[tokio::test]
 async fn test_8_layer_auth_performance() -> Result<()> {
     println!("\n=== Test: 8-Layer Authentication Performance ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate valid token
     let (token, _jti) = generate_test_token(
         "perf_user",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:322:
         vec!["api.access".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     let mut latencies = Vec::new();
[31m-    
[m[32m+
[m     // Perform 100 authentication requests
     println!("  Running 100 authentication requests...");
     for _ in 0..100 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:333:
             "authorization",
             MetadataValue::try_from(format!("Bearer {}", token))?,
         );
[31m-        
[m[32m+
[m         let start = Instant::now();
         let result = auth_interceptor.clone().authenticate(request).await;
         let elapsed = start.elapsed();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:340:
[31m-        
[m[32m+
[m         assert!(result.is_ok(), "Authentication should succeed");
         latencies.push(elapsed);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:344:
[31m-    
[m[32m+
[m     // Calculate percentiles
     latencies.sort();
     let p50 = latencies[49];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:348:
     let p95 = latencies[94];
     let p99 = latencies[98];
     let p999 = latencies[99];
[31m-    
[m[32m+
[m     println!("\n  Performance Metrics:");
     println!("  ├─ P50:   {:?}", p50);
     println!("  ├─ P95:   {:?}", p95);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:355:
     println!("  ├─ P99:   {:?}", p99);
     println!("  └─ P99.9: {:?}", p999);
[31m-    
[m[32m+
[m     println!("\n  Target: <10μs per request");
[31m-    
[m[32m+
[m     // Performance assertions (may fail in CI/CD, so we just warn)
     if p99 > Duration::from_micros(10) {
         println!("  ⚠ WARNING: P99 latency {:?} exceeds 10μs target", p99);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:363:
     } else {
         println!("  ✓ P99 latency within 10μs target");
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:370:
 #[tokio::test]
 async fn test_concurrent_authentication() -> Result<()> {
     println!("\n=== Test: Concurrent Authentication ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate tokens for 10 different users
     let mut tokens = Vec::new();
     for i in 1..=10 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:384:
         )?;
         tokens.push(token);
     }
[31m-    
[m[32m+
[m     // Spawn 100 concurrent authentication requests
     let mut handles = Vec::new();
[31m-    
[m[32m+
[m     println!("  Spawning 100 concurrent authentication requests...");
     for i in 0..100 {
         let token = tokens[i % 10].clone();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:394:
         let auth = auth_interceptor.clone();
[31m-        
[m[32m+
[m         let handle = tokio::spawn(async move {
             let mut request = Request::new(());
             request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:399:
                 "authorization",
                 MetadataValue::try_from(format!("Bearer {}", token)).unwrap(),
             );
[31m-            
[m[32m+
[m             auth.authenticate(request).await
         });
[31m-        
[m[32m+
[m         handles.push(handle);
     }
[31m-    
[m[32m+
[m     // Wait for all requests to complete
     let mut success_count = 0;
     for handle in handles {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:415:
             }
         }
     }
[31m-    
[m[31m-    println!("  ✓ {}/100 concurrent authentications succeeded", success_count);
[m[32m+
[m[32m+    println!(
[m[32m+        "  ✓ {}/100 concurrent authentications succeeded",
[m[32m+        success_count
[m[32m+    );
[m     assert_eq!(success_count, 100, "All concurrent requests should succeed");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:425:
 #[tokio::test]
 async fn test_user_context_injection() -> Result<()> {
     println!("\n=== Test: User Context Injection (Layer 7) ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     let (token, _jti) = generate_test_token(
         "context_user",
         vec!["admin".to_string(), "trader".to_string()],
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:434:
         vec!["api.access".to_string(), "admin.manage".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     let mut request = Request::new(());
     request.metadata_mut().insert(
         "authorization",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:441:
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await?;
[31m-    
[m[32m+
[m     // Verify user context
[31m-    let user_ctx = result.extensions().get::<api_gateway::auth::UserContext>()
[m[32m+    let user_ctx = result
[m[32m+        .extensions()
[m[32m+        .get::<api_gateway::auth::UserContext>()
[m         .expect("UserContext should be present");
[31m-    
[m[32m+
[m     println!("  ✓ User context injected:");
     println!("    ├─ User ID: {}", user_ctx.user_id);
     println!("    ├─ Roles: {:?}", user_ctx.roles);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:453:
     println!("    ├─ Permissions: {:?}", user_ctx.permissions);
     println!("    └─ Session ID: {}", user_ctx.session_id);
[31m-    
[m[32m+
[m     assert_eq!(user_ctx.user_id, "context_user");
     assert_eq!(user_ctx.roles.len(), 2);
     assert_eq!(user_ctx.permissions.len(), 2);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:459:
     assert!(user_ctx.roles.contains(&"admin".to_string()));
     assert!(user_ctx.permissions.contains(&"admin.manage".to_string()));
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:465:
 #[tokio::test]
 async fn test_malformed_authorization_header() -> Result<()> {
     println!("\n=== Test: Malformed Authorization Header ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     let test_cases = vec![
         ("Basic dXNlcjpwYXNzd29yZA==", "Basic auth instead of Bearer"),
         ("Bearer", "Bearer without token"),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:475:
         ("", "Empty header"),
         ("InvalidFormat token123", "Invalid format"),
     ];
[31m-    
[m[32m+
[m     for (header_value, description) in test_cases {
         let mut request = Request::new(());
         if !header_value.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:482:
[31m-            request.metadata_mut().insert(
[m[31m-                "authorization",
[m[31m-                MetadataValue::try_from(header_value)?,
[m[31m-            );
[m[32m+            request
[m[32m+                .metadata_mut()
[m[32m+                .insert("authorization", MetadataValue::try_from(header_value)?);
[m         }
[31m-        
[m[32m+
[m         let result = auth_interceptor.clone().authenticate(request).await;
         assert!(result.is_err(), "{} should be rejected", description);
         println!("  ✓ Rejected: {}", description);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:491:
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:33:
 ) -> Result<(String, String)> {
     let config = TestJwtConfig::default();
     let jti = Jti::new();
[31m-    
[m[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m 
[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m[32m+
[m     let claims = JwtClaims {
         jti: jti.0.clone(),
         sub: user_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:64:
 /// Generate an expired JWT token for testing
 pub fn generate_expired_token(user_id: &str) -> Result<String> {
     let config = TestJwtConfig::default();
[31m-    
[m[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m 
[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m[32m+
[m     let claims = JwtClaims {
         jti: Jti::new().0,
         sub: user_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:94:
 
 /// Generate a token with invalid signature
 pub fn generate_invalid_signature_token(user_id: &str) -> Result<String> {
[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m 
     let claims = JwtClaims {
         jti: Jti::new().0,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:134:
                             println!("✓ Redis ready after {} attempts", attempt);
                             return Ok(());
                         }
[31m-                    }
[m[32m+                    },
[m                     Err(e) => {
                         if attempt == max_attempts {
                             return Err(anyhow::anyhow!("Redis not ready: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:141:
                         }
                         tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
[31m-                    }
[m[32m+                    },
[m                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 if attempt == max_attempts {
                     return Err(anyhow::anyhow!("Failed to create Redis client: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:149:
                 }
                 tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:155:
[31m-    Err(anyhow::anyhow!("Redis not ready after {} attempts", max_attempts))
[m[32m+    Err(anyhow::anyhow!(
[m[32m+        "Redis not ready after {} attempts",
[m[32m+        max_attempts
[m[32m+    ))
[m }
 
 /// Clean up Redis test data
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:159:
 pub async fn cleanup_redis(redis_url: &str) -> Result<()> {
[31m-    
[m[31m-    
[m     let client = redis::Client::open(redis_url)?;
     let mut conn = client.get_multiplexed_async_connection().await?;
[31m-    
[m[32m+
[m     // Delete all keys matching test patterns
     let _: () = redis::cmd("FLUSHDB").query_async(&mut conn).await?;
[31m-    
[m[32m+
[m     Ok(())
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/grpc_error_handling_tests.rs:13:
 #![allow(dead_code, unused_imports)]
 
 use anyhow::Result;
[31m-use tonic::{Request, Status, Code};
[m[32m+use tonic::{Code, Request, Status};
[m 
 #[tokio::test]
 #[ignore = "Missing proxy types - requires refactoring to use actual service proxies"]
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:14:
 mod common;
 
 use anyhow::Result;
[31m-use common::{cleanup_redis, generate_expired_token, generate_invalid_signature_token, generate_test_token, wait_for_redis, TestJwtConfig};
[m[32m+use common::{
[m[32m+    cleanup_redis, generate_expired_token, generate_invalid_signature_token, generate_test_token,
[m[32m+    wait_for_redis, TestJwtConfig,
[m[32m+};
[m use std::time::{Duration, Instant};
 use tonic::{metadata::MetadataValue, Request};
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:30:
     cleanup_redis(REDIS_URL).await?;
 
     let config = TestJwtConfig::default();
[31m-    
[m[31m-    let jwt_service = JwtService::new(
[m[31m-        config.secret,
[m[31m-        config.issuer,
[m[31m-        config.audience,
[m[31m-    );
[m[31m-    
[m[32m+
[m[32m+    let jwt_service = JwtService::new(config.secret, config.issuer, config.audience);
[m[32m+
[m     let revocation_service = RevocationService::new(REDIS_URL).await?;
     let authz_service = AuthzService::new();
     let rate_limiter = RateLimiter::new(100)?; // 100 req/s
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:43:
     let audit_logger = AuditLogger::new(true)?;
[31m-    
[m[32m+
[m     Ok(AuthInterceptor::new(
         jwt_service,
         revocation_service,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:54:
 #[tokio::test]
 async fn test_successful_authentication() -> Result<()> {
     println!("\n=== Test: Successful Authentication ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate valid token
     let (token, _jti) = generate_test_token(
         "user123",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:64:
         vec!["api.access".to_string(), "trading.submit".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     // Create request with Authorization header
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:71:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     // Measure authentication time
     let start = Instant::now();
     let result = auth_interceptor.clone().authenticate(request).await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:78:
     let elapsed = start.elapsed();
[31m-    
[m[32m+
[m     println!("✓ Authentication succeeded in {:?}", elapsed);
     println!("  Performance target: <10μs, Actual: {:?}", elapsed);
[31m-    
[m[32m+
[m     assert!(result.is_ok(), "Authentication should succeed");
[31m-    
[m[32m+
[m     // Verify user context was injected
     let authenticated_request = result.unwrap();
     let extensions = authenticated_request.extensions();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:88:
[31m-    
[m[32m+
[m     assert!(
         extensions.get::<api_gateway::auth::UserContext>().is_some(),
         "User context should be injected"
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:92:
     );
[31m-    
[m[32m+
[m     if let Some(user_ctx) = extensions.get::<api_gateway::auth::UserContext>() {
         assert_eq!(user_ctx.user_id, "user123");
         assert!(user_ctx.roles.contains(&"trader".to_string()));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:97:
         assert!(user_ctx.permissions.contains(&"api.access".to_string()));
         println!("✓ User context verified: user_id={}", user_ctx.user_id);
     }
[31m-    
[m[32m+
[m     // Warn if latency exceeds target
     if elapsed > Duration::from_micros(10) {
[31m-        println!("⚠ WARNING: Authentication latency {:?} exceeds 10μs target", elapsed);
[m[32m+        println!(
[m[32m+            "⚠ WARNING: Authentication latency {:?} exceeds 10μs target",
[m[32m+            elapsed
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:109:
 #[tokio::test]
 async fn test_missing_jwt_rejected() -> Result<()> {
     println!("\n=== Test: Missing JWT Rejected ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Create request without Authorization header
     let request = Request::new(());
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[32m+
[m     assert!(result.is_err(), "Request without JWT should be rejected");
[31m-    
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::Unauthenticated);
         println!("✓ Request rejected with status: {}", status.code());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:125:
         println!("  Message: {}", status.message());
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:131:
 #[tokio::test]
 async fn test_revoked_jwt_rejected() -> Result<()> {
     println!("\n=== Test: Revoked JWT Rejected ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate valid token
     let (token, jti) = generate_test_token(
         "user456",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:141:
         vec!["api.access".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     // Add token to blacklist
     let revocation_service = RevocationService::new(REDIS_URL).await?;
     revocation_service
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:148:
         .revoke_token(&Jti::from_string(jti), 3600)
         .await?;
[31m-    
[m[32m+
[m     println!("✓ Token added to blacklist");
[31m-    
[m[32m+
[m     // Create request with revoked token
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:156:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[32m+
[m     assert!(result.is_err(), "Revoked token should be rejected");
[31m-    
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::Unauthenticated);
         println!("✓ Revoked token rejected with status: {}", status.code());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:167:
[31m-        assert!(status.message().contains("revoked"), "Error message should mention revocation");
[m[32m+        assert!(
[m[32m+            status.message().contains("revoked"),
[m[32m+            "Error message should mention revocation"
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:173:
 #[tokio::test]
 async fn test_expired_jwt_rejected() -> Result<()> {
     println!("\n=== Test: Expired JWT Rejected ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate expired token
     let token = generate_expired_token("user789")?;
[31m-    
[m[32m+
[m     // Create request with expired token
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:185:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[32m+
[m     assert!(result.is_err(), "Expired token should be rejected");
[31m-    
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::Unauthenticated);
         println!("✓ Expired token rejected with status: {}", status.code());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:196:
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:201:
 #[tokio::test]
 async fn test_invalid_signature_rejected() -> Result<()> {
     println!("\n=== Test: Invalid Signature Rejected ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate token with wrong signature
     let token = generate_invalid_signature_token("attacker")?;
[31m-    
[m[32m+
[m     // Create request with invalid token
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:213:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[31m-    assert!(result.is_err(), "Token with invalid signature should be rejected");
[m[31m-    
[m[32m+
[m[32m+    assert!(
[m[32m+        result.is_err(),
[m[32m+        "Token with invalid signature should be rejected"
[m[32m+    );
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::Unauthenticated);
[31m-        println!("✓ Invalid signature rejected with status: {}", status.code());
[m[32m+        println!(
[m[32m+            "✓ Invalid signature rejected with status: {}",
[m[32m+            status.code()
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:229:
 #[tokio::test]
 async fn test_rbac_permission_denied() -> Result<()> {
     println!("\n=== Test: RBAC Permission Denied ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate token without api.access permission
     let (token, _jti) = generate_test_token(
         "restricted_user",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:239:
         vec!["limited.access".to_string()], // Missing api.access
         3600,
     )?;
[31m-    
[m[32m+
[m     // Create request with limited permissions
     let mut request = Request::new(());
     request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:246:
         "authorization",
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await;
[31m-    
[m[31m-    assert!(result.is_err(), "Request without api.access should be denied");
[m[31m-    
[m[32m+
[m[32m+    assert!(
[m[32m+        result.is_err(),
[m[32m+        "Request without api.access should be denied"
[m[32m+    );
[m[32m+
[m     if let Err(status) = result {
         assert_eq!(status.code(), tonic::Code::PermissionDenied);
         println!("✓ Permission denied with status: {}", status.code());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:257:
         println!("  Message: {}", status.message());
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:263:
 #[tokio::test]
 async fn test_rate_limit_exceeded() -> Result<()> {
     println!("\n=== Test: Rate Limit Exceeded ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate valid token
     let (token, _jti) = generate_test_token(
         "rate_limited_user",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:273:
         vec!["api.access".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     let mut success_count = 0;
     let mut rate_limited_count = 0;
[31m-    
[m[32m+
[m     // Make 110 rapid requests (limit is 100/s)
     for i in 1..=110 {
         let mut request = Request::new(());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:284:
             "authorization",
             MetadataValue::try_from(format!("Bearer {}", token))?,
         );
[31m-        
[m[32m+
[m         let result = auth_interceptor.clone().authenticate(request).await;
[31m-        
[m[32m+
[m         if result.is_ok() {
             success_count += 1;
         } else if let Err(status) = result {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:298:
             }
         }
     }
[31m-    
[m[32m+
[m     println!("  Successful requests: {}", success_count);
     println!("  Rate limited requests: {}", rate_limited_count);
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:305:
[31m-    assert!(rate_limited_count > 0, "Some requests should be rate limited");
[m[32m+    assert!(
[m[32m+        rate_limited_count > 0,
[m[32m+        "Some requests should be rate limited"
[m[32m+    );
[m     // Allow small tolerance (3-5 extra) due to token bucket timing granularity
[31m-    assert!(success_count <= 105, "Success count should not significantly exceed limit (got {}, limit 100, tolerance 105)", success_count);
[m[31m-    
[m[32m+    assert!(
[m[32m+        success_count <= 105,
[m[32m+        "Success count should not significantly exceed limit (got {}, limit 100, tolerance 105)",
[m[32m+        success_count
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:312:
 #[tokio::test]
 async fn test_8_layer_auth_performance() -> Result<()> {
     println!("\n=== Test: 8-Layer Authentication Performance ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate valid token
     let (token, _jti) = generate_test_token(
         "perf_user",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:322:
         vec!["api.access".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     let mut latencies = Vec::new();
[31m-    
[m[32m+
[m     // Perform 100 authentication requests
     println!("  Running 100 authentication requests...");
     for _ in 0..100 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:333:
             "authorization",
             MetadataValue::try_from(format!("Bearer {}", token))?,
         );
[31m-        
[m[32m+
[m         let start = Instant::now();
         let result = auth_interceptor.clone().authenticate(request).await;
         let elapsed = start.elapsed();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:340:
[31m-        
[m[32m+
[m         assert!(result.is_ok(), "Authentication should succeed");
         latencies.push(elapsed);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:344:
[31m-    
[m[32m+
[m     // Calculate percentiles
     latencies.sort();
     let p50 = latencies[49];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:348:
     let p95 = latencies[94];
     let p99 = latencies[98];
     let p999 = latencies[99];
[31m-    
[m[32m+
[m     println!("\n  Performance Metrics:");
     println!("  ├─ P50:   {:?}", p50);
     println!("  ├─ P95:   {:?}", p95);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:355:
     println!("  ├─ P99:   {:?}", p99);
     println!("  └─ P99.9: {:?}", p999);
[31m-    
[m[32m+
[m     println!("\n  Target: <10μs per request");
[31m-    
[m[32m+
[m     // Performance assertions (may fail in CI/CD, so we just warn)
     if p99 > Duration::from_micros(10) {
         println!("  ⚠ WARNING: P99 latency {:?} exceeds 10μs target", p99);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:363:
     } else {
         println!("  ✓ P99 latency within 10μs target");
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:370:
 #[tokio::test]
 async fn test_concurrent_authentication() -> Result<()> {
     println!("\n=== Test: Concurrent Authentication ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     // Generate tokens for 10 different users
     let mut tokens = Vec::new();
     for i in 1..=10 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:384:
         )?;
         tokens.push(token);
     }
[31m-    
[m[32m+
[m     // Spawn 100 concurrent authentication requests
     let mut handles = Vec::new();
[31m-    
[m[32m+
[m     println!("  Spawning 100 concurrent authentication requests...");
     for i in 0..100 {
         let token = tokens[i % 10].clone();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:394:
         let auth = auth_interceptor.clone();
[31m-        
[m[32m+
[m         let handle = tokio::spawn(async move {
             let mut request = Request::new(());
             request.metadata_mut().insert(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:399:
                 "authorization",
                 MetadataValue::try_from(format!("Bearer {}", token)).unwrap(),
             );
[31m-            
[m[32m+
[m             auth.authenticate(request).await
         });
[31m-        
[m[32m+
[m         handles.push(handle);
     }
[31m-    
[m[32m+
[m     // Wait for all requests to complete
     let mut success_count = 0;
     for handle in handles {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:415:
             }
         }
     }
[31m-    
[m[31m-    println!("  ✓ {}/100 concurrent authentications succeeded", success_count);
[m[32m+
[m[32m+    println!(
[m[32m+        "  ✓ {}/100 concurrent authentications succeeded",
[m[32m+        success_count
[m[32m+    );
[m     assert_eq!(success_count, 100, "All concurrent requests should succeed");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:425:
 #[tokio::test]
 async fn test_user_context_injection() -> Result<()> {
     println!("\n=== Test: User Context Injection (Layer 7) ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     let (token, _jti) = generate_test_token(
         "context_user",
         vec!["admin".to_string(), "trader".to_string()],
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:434:
         vec!["api.access".to_string(), "admin.manage".to_string()],
         3600,
     )?;
[31m-    
[m[32m+
[m     let mut request = Request::new(());
     request.metadata_mut().insert(
         "authorization",
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:441:
         MetadataValue::try_from(format!("Bearer {}", token))?,
     );
[31m-    
[m[32m+
[m     let result = auth_interceptor.clone().authenticate(request).await?;
[31m-    
[m[32m+
[m     // Verify user context
[31m-    let user_ctx = result.extensions().get::<api_gateway::auth::UserContext>()
[m[32m+    let user_ctx = result
[m[32m+        .extensions()
[m[32m+        .get::<api_gateway::auth::UserContext>()
[m         .expect("UserContext should be present");
[31m-    
[m[32m+
[m     println!("  ✓ User context injected:");
     println!("    ├─ User ID: {}", user_ctx.user_id);
     println!("    ├─ Roles: {:?}", user_ctx.roles);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:453:
     println!("    ├─ Permissions: {:?}", user_ctx.permissions);
     println!("    └─ Session ID: {}", user_ctx.session_id);
[31m-    
[m[32m+
[m     assert_eq!(user_ctx.user_id, "context_user");
     assert_eq!(user_ctx.roles.len(), 2);
     assert_eq!(user_ctx.permissions.len(), 2);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:459:
     assert!(user_ctx.roles.contains(&"admin".to_string()));
     assert!(user_ctx.permissions.contains(&"admin.manage".to_string()));
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:465:
 #[tokio::test]
 async fn test_malformed_authorization_header() -> Result<()> {
     println!("\n=== Test: Malformed Authorization Header ===");
[31m-    
[m[32m+
[m     let auth_interceptor = setup_auth_components().await?;
[31m-    
[m[32m+
[m     let test_cases = vec![
         ("Basic dXNlcjpwYXNzd29yZA==", "Basic auth instead of Bearer"),
         ("Bearer", "Bearer without token"),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:475:
         ("", "Empty header"),
         ("InvalidFormat token123", "Invalid format"),
     ];
[31m-    
[m[32m+
[m     for (header_value, description) in test_cases {
         let mut request = Request::new(());
         if !header_value.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:482:
[31m-            request.metadata_mut().insert(
[m[31m-                "authorization",
[m[31m-                MetadataValue::try_from(header_value)?,
[m[31m-            );
[m[32m+            request
[m[32m+                .metadata_mut()
[m[32m+                .insert("authorization", MetadataValue::try_from(header_value)?);
[m         }
[31m-        
[m[32m+
[m         let result = auth_interceptor.clone().authenticate(request).await;
         assert!(result.is_err(), "{} should be rejected", description);
         println!("  ✓ Rejected: {}", description);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/auth_flow_tests.rs:491:
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:33:
 ) -> Result<(String, String)> {
     let config = TestJwtConfig::default();
     let jti = Jti::new();
[31m-    
[m[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m 
[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m[32m+
[m     let claims = JwtClaims {
         jti: jti.0.clone(),
         sub: user_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:64:
 /// Generate an expired JWT token for testing
 pub fn generate_expired_token(user_id: &str) -> Result<String> {
     let config = TestJwtConfig::default();
[31m-    
[m[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m 
[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m[32m+
[m     let claims = JwtClaims {
         jti: Jti::new().0,
         sub: user_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:94:
 
 /// Generate a token with invalid signature
 pub fn generate_invalid_signature_token(user_id: &str) -> Result<String> {
[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m 
     let claims = JwtClaims {
         jti: Jti::new().0,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:134:
                             println!("✓ Redis ready after {} attempts", attempt);
                             return Ok(());
                         }
[31m-                    }
[m[32m+                    },
[m                     Err(e) => {
                         if attempt == max_attempts {
                             return Err(anyhow::anyhow!("Redis not ready: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:141:
                         }
                         tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
[31m-                    }
[m[32m+                    },
[m                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 if attempt == max_attempts {
                     return Err(anyhow::anyhow!("Failed to create Redis client: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:149:
                 }
                 tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:155:
[31m-    Err(anyhow::anyhow!("Redis not ready after {} attempts", max_attempts))
[m[32m+    Err(anyhow::anyhow!(
[m[32m+        "Redis not ready after {} attempts",
[m[32m+        max_attempts
[m[32m+    ))
[m }
 
 /// Clean up Redis test data
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:159:
 pub async fn cleanup_redis(redis_url: &str) -> Result<()> {
[31m-    
[m[31m-    
[m     let client = redis::Client::open(redis_url)?;
     let mut conn = client.get_multiplexed_async_connection().await?;
[31m-    
[m[32m+
[m     // Delete all keys matching test patterns
     let _: () = redis::cmd("FLUSHDB").query_async(&mut conn).await?;
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:12:
 use anyhow::Result;
 use std::time::{Duration, Instant};
 
[31m-use api_gateway::auth::{RateLimiter};
[m[32m+use api_gateway::auth::RateLimiter;
[m 
 const REDIS_URL: &str = "redis://localhost:6380";
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:19:
 #[tokio::test]
 async fn test_rate_limiter_basic() -> Result<()> {
     println!("\n=== Test: Rate Limiter Basic Functionality ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(10).expect("Failed to create rate limiter"); // 10 requests per second
[31m-    
[m[32m+
[m     let mut allowed_count = 0;
     let mut denied_count = 0;
[31m-    
[m[32m+
[m     // Make 15 requests
     for i in 1..=15 {
         if rate_limiter.check_rate_limit("user_basic") {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:36:
             }
         }
     }
[31m-    
[m[32m+
[m     println!("  Allowed: {}, Denied: {}", allowed_count, denied_count);
[31m-    
[m[32m+
[m     assert!(allowed_count <= 10, "Should allow at most 10 requests");
     assert!(denied_count > 0, "Should deny some requests after limit");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:48:
 #[tokio::test]
 async fn test_rate_limiter_per_user() -> Result<()> {
     println!("\n=== Test: Per-User Rate Limiting ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(5).expect("Failed to create rate limiter"); // 5 requests per second per user
[31m-    
[m[32m+
[m     // User 1 makes 7 requests
     let mut user1_allowed = 0;
     for _ in 1..=7 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:58:
             user1_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     // User 2 makes 7 requests
     let mut user2_allowed = 0;
     for _ in 1..=7 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:66:
             user2_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  User 1 allowed: {}", user1_allowed);
     println!("  User 2 allowed: {}", user2_allowed);
[31m-    
[m[32m+
[m     // Each user should be rate limited independently
     assert!(user1_allowed <= 5, "User 1 should be limited to 5 requests");
     assert!(user2_allowed <= 5, "User 2 should be limited to 5 requests");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:76:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:80:
 #[tokio::test]
 async fn test_rate_limiter_concurrent_requests() -> Result<()> {
     println!("\n=== Test: Concurrent Rate Limiting ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(100).expect("Failed to create rate limiter"); // 100 requests per second
[31m-    
[m[32m+
[m     // Spawn 200 concurrent requests for same user
     let mut handles = Vec::new();
[31m-    
[m[32m+
[m     println!("  Spawning 200 concurrent requests...");
     for _ in 0..200 {
         let limiter = rate_limiter.clone();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:92:
[31m-        let handle = tokio::spawn(async move {
[m[31m-            limiter.check_rate_limit("concurrent_user")
[m[31m-        });
[m[32m+        let handle = tokio::spawn(async move { limiter.check_rate_limit("concurrent_user") });
[m         handles.push(handle);
     }
[31m-    
[m[32m+
[m     // Collect results
     let mut allowed_count = 0;
     for handle in handles {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:104:
             }
         }
     }
[31m-    
[m[32m+
[m     println!("  ✓ {}/200 concurrent requests allowed", allowed_count);
[31m-    
[m[32m+
[m     // Should allow around 100 requests (may vary slightly due to timing)
     assert!(allowed_count >= 90, "Should allow at least 90 requests");
[31m-    assert!(allowed_count <= 110, "Should not allow more than 110 requests");
[m[31m-    
[m[32m+    assert!(
[m[32m+        allowed_count <= 110,
[m[32m+        "Should not allow more than 110 requests"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:117:
 #[tokio::test]
 async fn test_rate_limiter_performance() -> Result<()> {
     println!("\n=== Test: Rate Limiter Performance (<50ns target) ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(1000000).expect("Failed to create rate limiter"); // Very high limit for perf testing
[31m-    
[m[32m+
[m     let mut latencies = Vec::new();
[31m-    
[m[32m+
[m     // Perform 1000 rate limit checks
     println!("  Running 1000 rate limit checks...");
     for _ in 0..1000 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:130:
         let elapsed = start.elapsed();
         latencies.push(elapsed);
     }
[31m-    
[m[32m+
[m     // Calculate percentiles
     latencies.sort();
     let p50 = latencies[499];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:137:
     let p95 = latencies[949];
     let p99 = latencies[989];
     let p999 = latencies[999];
[31m-    
[m[32m+
[m     println!("\n  Performance Metrics:");
     println!("  ├─ P50:   {:?}", p50);
     println!("  ├─ P95:   {:?}", p95);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:144:
     println!("  ├─ P99:   {:?}", p99);
     println!("  └─ P99.9: {:?}", p999);
[31m-    
[m[32m+
[m     println!("\n  Target: <50ns per check");
[31m-    
[m[32m+
[m     if p99 > Duration::from_nanos(50) {
         println!("  ⚠ WARNING: P99 latency {:?} exceeds 50ns target", p99);
     } else {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:152:
         println!("  ✓ P99 latency within 50ns target");
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:158:
 #[tokio::test]
 async fn test_rate_limiter_reset_behavior() -> Result<()> {
     println!("\n=== Test: Rate Limiter Reset Behavior ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(5).expect("Failed to create rate limiter"); // 5 requests per second
[31m-    
[m[32m+
[m     // Exhaust rate limit
     let mut initial_allowed = 0;
     for _ in 1..=10 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:168:
             initial_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  Initial requests allowed: {}", initial_allowed);
     assert!(initial_allowed <= 5, "Should be limited to 5 requests");
[31m-    
[m[32m+
[m     // Wait for rate limiter window to reset (1 second)
     println!("  Waiting 1.1s for rate limit window to reset...");
     tokio::time::sleep(Duration::from_millis(1100)).await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:178:
[31m-    
[m[32m+
[m     // Try again after reset
     let mut post_reset_allowed = 0;
     for _ in 1..=10 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:183:
             post_reset_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  Post-reset requests allowed: {}", post_reset_allowed);
     assert!(post_reset_allowed > 0, "Should allow requests after reset");
[31m-    assert!(post_reset_allowed <= 5, "Should still enforce limit after reset");
[m[31m-    
[m[32m+    assert!(
[m[32m+        post_reset_allowed <= 5,
[m[32m+        "Should still enforce limit after reset"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:194:
 #[tokio::test]
 async fn test_rate_limiter_multiple_users() -> Result<()> {
     println!("\n=== Test: Multiple Users Rate Limiting ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(10).expect("Failed to create rate limiter"); // 10 requests per second per user
[31m-    
[m[32m+
[m     // 10 different users make 15 requests each
     let mut user_results = Vec::new();
[31m-    
[m[32m+
[m     for user_id in 1..=10 {
         let mut allowed = 0;
         for _ in 1..=15 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:209:
         }
         user_results.push(allowed);
     }
[31m-    
[m[32m+
[m     println!("  User results: {:?}", user_results);
[31m-    
[m[32m+
[m     // Each user should be limited independently
     for (i, &allowed) in user_results.iter().enumerate() {
         assert!(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:221:
             allowed
         );
     }
[31m-    
[m[32m+
[m     println!("  ✓ All 10 users independently rate limited");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:230:
 #[tokio::test]
 async fn test_rate_limiter_burst_handling() -> Result<()> {
     println!("\n=== Test: Burst Request Handling ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(50).expect("Failed to create rate limiter"); // 50 requests per second
[31m-    
[m[32m+
[m     // Send 100 requests as fast as possible (burst)
     let start = Instant::now();
     let mut burst_allowed = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:239:
[31m-    
[m[32m+
[m     for _ in 0..100 {
         if rate_limiter.check_rate_limit("burst_user") {
             burst_allowed += 1;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:243:
         }
     }
[31m-    
[m[32m+
[m     let burst_duration = start.elapsed();
[31m-    
[m[31m-    println!("  Burst allowed: {} requests in {:?}", burst_allowed, burst_duration);
[m[31m-    
[m[32m+
[m[32m+    println!(
[m[32m+        "  Burst allowed: {} requests in {:?}",
[m[32m+        burst_allowed, burst_duration
[m[32m+    );
[m[32m+
[m     assert!(burst_allowed <= 50, "Should limit burst to 50 requests");
[31m-    assert!(burst_duration < Duration::from_millis(100), "Burst check should be fast");
[m[31m-    
[m[32m+    assert!(
[m[32m+        burst_duration < Duration::from_millis(100),
[m[32m+        "Burst check should be fast"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:256:
 #[tokio::test]
 async fn test_rate_limiter_edge_cases() -> Result<()> {
     println!("\n=== Test: Rate Limiter Edge Cases ===");
[31m-    
[m[32m+
[m     // Test with very low limit
     let low_limit = RateLimiter::new(1).expect("Failed to create rate limiter");
     let mut low_allowed = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:288:
         }
     }
     println!("  Empty user ID: {} allowed", empty_allowed);
[31m-    assert!(empty_allowed <= 5, "Should still enforce limit for empty user ID");
[m[31m-    
[m[32m+    assert!(
[m[32m+        empty_allowed <= 5,
[m[32m+        "Should still enforce limit for empty user ID"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:296:
 #[tokio::test]
 async fn test_rate_limiter_sustained_load() -> Result<()> {
     println!("\n=== Test: Sustained Load Rate Limiting ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(100).expect("Failed to create rate limiter"); // 100 requests per second
[31m-    
[m[32m+
[m     let mut total_allowed = 0;
     let start = Instant::now();
[31m-    
[m[32m+
[m     // Simulate sustained load for 2 seconds
     while start.elapsed() < Duration::from_secs(2) {
         if rate_limiter.check_rate_limit("sustained_user") {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:310:
         // Small delay to prevent tight loop
         tokio::time::sleep(Duration::from_micros(100)).await;
     }
[31m-    
[m[32m+
[m     let actual_duration = start.elapsed();
     let requests_per_second = (total_allowed as f64) / actual_duration.as_secs_f64();
[31m-    
[m[31m-    println!("  Total allowed: {} requests over {:?}", total_allowed, actual_duration);
[m[32m+
[m[32m+    println!(
[m[32m+        "  Total allowed: {} requests over {:?}",
[m[32m+        total_allowed, actual_duration
[m[32m+    );
[m     println!("  Effective rate: {:.2} req/s", requests_per_second);
[31m-    
[m[32m+
[m     // Should be close to 200 requests (100/s * 2s), allowing for some variance
     assert!(
         total_allowed >= 180 && total_allowed <= 220,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:323:
         "Sustained rate should be around 200 requests (got {})",
         total_allowed
     );
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:15:
 #[tokio::test]
 async fn test_ml_training_proxy_config() -> Result<()> {
     println!("\n=== Test: ML Training Proxy Configuration ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let config = MlTrainingBackendConfig::default();
[31m-    
[m[32m+
[m     println!("  Default configuration:");
     println!("  ├─ Address: {}", config.address);
     println!("  ├─ Connect timeout: {}ms", config.connect_timeout_ms);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:26:
     println!("  ├─ Request timeout: {}ms", config.request_timeout_ms);
     println!("  ├─ CB failures: {}", config.circuit_breaker_failures);
     println!("  └─ CB reset: {}s", config.circuit_breaker_reset_secs);
[31m-    
[m[32m+
[m     assert_eq!(config.address, "http://localhost:50053");
     assert_eq!(config.connect_timeout_ms, 5000);
     assert_eq!(config.request_timeout_ms, 30000);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:33:
     assert_eq!(config.circuit_breaker_failures, 5);
     assert_eq!(config.circuit_breaker_reset_secs, 30);
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:39:
 #[tokio::test]
 async fn test_ml_training_proxy_custom_config() -> Result<()> {
     println!("\n=== Test: ML Training Proxy Custom Configuration ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let config = MlTrainingBackendConfig {
         address: "http://custom-service:9999".to_string(),
         connect_timeout_ms: 1000,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:49:
         circuit_breaker_failures: 3,
         circuit_breaker_reset_secs: 60,
     };
[31m-    
[m[32m+
[m     println!("  Custom configuration:");
     println!("  ├─ Address: {}", config.address);
     println!("  ├─ Connect timeout: {}ms", config.connect_timeout_ms);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:56:
     println!("  ├─ Request timeout: {}ms", config.request_timeout_ms);
     println!("  ├─ CB failures: {}", config.circuit_breaker_failures);
     println!("  └─ CB reset: {}s", config.circuit_breaker_reset_secs);
[31m-    
[m[32m+
[m     assert_eq!(config.address, "http://custom-service:9999");
     assert_eq!(config.connect_timeout_ms, 1000);
     assert_eq!(config.circuit_breaker_failures, 3);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:63:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:67:
 #[tokio::test]
 async fn test_circuit_breaker_config_validation() -> Result<()> {
     println!("\n=== Test: Circuit Breaker Configuration Validation ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let configs = vec![
         (1, 5, "Minimal failure threshold"),
         (5, 10, "Moderate failure threshold"),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:76:
         (10, 30, "High failure threshold"),
     ];
[31m-    
[m[32m+
[m     for (failures, reset_secs, description) in configs {
         let config = MlTrainingBackendConfig {
             circuit_breaker_failures: failures,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:82:
             circuit_breaker_reset_secs: reset_secs,
             ..Default::default()
         };
[31m-        
[m[31m-        println!("  ✓ Valid config: {} (failures={}, reset={}s)",
[m[31m-                 description, config.circuit_breaker_failures, config.circuit_breaker_reset_secs);
[m[31m-        
[m[32m+
[m[32m+        println!(
[m[32m+            "  ✓ Valid config: {} (failures={}, reset={}s)",
[m[32m+            description, config.circuit_breaker_failures, config.circuit_breaker_reset_secs
[m[32m+        );
[m[32m+
[m         assert!(config.circuit_breaker_failures > 0);
         assert!(config.circuit_breaker_reset_secs > 0);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:92:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:96:
 #[tokio::test]
 async fn test_connection_timeout_behavior() -> Result<()> {
     println!("\n=== Test: Connection Timeout Behavior ===");
[31m-    
[m[31m-    use api_gateway::grpc::server::{MlTrainingBackendConfig, setup_ml_training_client};
[m[31m-    
[m[32m+
[m[32m+    use api_gateway::grpc::server::{setup_ml_training_client, MlTrainingBackendConfig};
[m[32m+
[m     // Test with invalid address (should timeout)
     let config = MlTrainingBackendConfig {
         address: "http://non-existent-service:9999".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:105:
         connect_timeout_ms: 100, // Very short timeout
         ..Default::default()
     };
[31m-    
[m[32m+
[m     println!("  Attempting connection to non-existent service...");
     let start = std::time::Instant::now();
     let result = setup_ml_training_client(config).await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:112:
     let elapsed = start.elapsed();
[31m-    
[m[32m+
[m     println!("  Connection attempt took: {:?}", elapsed);
[31m-    
[m[31m-    assert!(result.is_err(), "Connection to non-existent service should fail");
[m[32m+
[m     assert!(
[32m+        result.is_err(),
[m[32m+        "Connection to non-existent service should fail"
[m[32m+    );
[m[32m+    assert!(
[m         elapsed < Duration::from_millis(500),
         "Should timeout quickly (within 500ms)"
     );
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:121:
[31m-    
[m[32m+
[m     println!("  ✓ Connection timeout worked correctly");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:127:
 #[tokio::test]
 async fn test_service_proxy_error_handling() -> Result<()> {
     println!("\n=== Test: Service Proxy Error Handling ===");
[31m-    
[m[31m-    use api_gateway::grpc::server::{MlTrainingBackendConfig, setup_ml_training_client};
[m[31m-    
[m[32m+
[m[32m+    use api_gateway::grpc::server::{setup_ml_training_client, MlTrainingBackendConfig};
[m[32m+
[m     let test_cases = vec![
[32m+        ("http://localhost:1", "Connection refused (port 1)"),
[m[32m+        ("http://192.0.2.1:50053", "Network unreachable (TEST-NET-1)"),
[m         (
[31m-            "http://localhost:1",
[m[31m-            "Connection refused (port 1)",
[m[31m-        ),
[m[31m-        (
[m[31m-            "http://192.0.2.1:50053",
[m[31m-            "Network unreachable (TEST-NET-1)",
[m[31m-        ),
[m[31m-        (
[m             "http://10.255.255.1:50053",
             "Connection timeout (non-routable)",
         ),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:146:
     ];
[31m-    
[m[32m+
[m     for (address, description) in test_cases {
         let config = MlTrainingBackendConfig {
             address: address.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:151:
             connect_timeout_ms: 100,
             ..Default::default()
         };
[31m-        
[m[32m+
[m         let result = setup_ml_training_client(config).await;
[31m-        
[m[32m+
[m         assert!(result.is_err(), "{} should fail", description);
         println!("  ✓ Handled: {}", description);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:160:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:164:
 #[tokio::test]
 async fn test_backend_config_serialization() -> Result<()> {
     println!("\n=== Test: Backend Config Serialization ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let config = MlTrainingBackendConfig {
         address: "http://ml-service:50053".to_string(),
         connect_timeout_ms: 2000,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:174:
         circuit_breaker_failures: 3,
         circuit_breaker_reset_secs: 45,
     };
[31m-    
[m[32m+
[m     // Test Debug formatting
     let debug_str = format!("{:?}", config);
     assert!(debug_str.contains("ml-service:50053"));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:181:
     assert!(debug_str.contains("2000"));
     println!("  ✓ Debug format: {}", debug_str);
[31m-    
[m[32m+
[m     // Test Clone
     let cloned = config.clone();
     assert_eq!(cloned.address, config.address);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:187:
     assert_eq!(cloned.connect_timeout_ms, config.connect_timeout_ms);
     println!("  ✓ Clone works correctly");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:193:
 #[tokio::test]
 async fn test_multiple_backend_configs() -> Result<()> {
     println!("\n=== Test: Multiple Backend Service Configurations ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     // Simulate configurations for different environments
     let dev_config = MlTrainingBackendConfig {
         address: "http://localhost:50053".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:204:
         circuit_breaker_failures: 5,
         circuit_breaker_reset_secs: 30,
     };
[31m-    
[m[32m+
[m     let staging_config = MlTrainingBackendConfig {
         address: "http://ml-training-staging:50053".to_string(),
         connect_timeout_ms: 3000,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:212:
         circuit_breaker_failures: 3,
         circuit_breaker_reset_secs: 60,
     };
[31m-    
[m[32m+
[m     let prod_config = MlTrainingBackendConfig {
         address: "http://ml-training-prod:50053".to_string(),
         connect_timeout_ms: 2000,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:220:
         circuit_breaker_failures: 3,
         circuit_breaker_reset_secs: 120,
     };
[31m-    
[m[32m+
[m     println!("  Development: {}", dev_config.address);
     println!("  Staging: {}", staging_config.address);
     println!("  Production: {}", prod_config.address);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:227:
[31m-    
[m[32m+
[m     // Verify configurations are independent
[31m-    assert_ne!(dev_config.connect_timeout_ms, prod_config.connect_timeout_ms);
[m[31m-    assert_ne!(staging_config.circuit_breaker_reset_secs, prod_config.circuit_breaker_reset_secs);
[m[31m-    
[m[32m+    assert_ne!(
[m[32m+        dev_config.connect_timeout_ms,
[m[32m+        prod_config.connect_timeout_ms
[m[32m+    );
[m[32m+    assert_ne!(
[m[32m+        staging_config.circuit_breaker_reset_secs,
[m[32m+        prod_config.circuit_breaker_reset_secs
[m[32m+    );
[m[32m+
[m     println!("  ✓ Multiple environment configurations validated");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:237:
 #[tokio::test]
 async fn test_proxy_performance_overhead() -> Result<()> {
     println!("\n=== Test: Proxy Configuration Performance ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let mut config_creation_times = Vec::new();
[31m-    
[m[32m+
[m     // Measure config creation overhead
     for _ in 0..1000 {
         let start = std::time::Instant::now();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:249:
         let elapsed = start.elapsed();
         config_creation_times.push(elapsed);
     }
[31m-    
[m[32m+
[m     config_creation_times.sort();
     let p50 = config_creation_times[499];
     let p99 = config_creation_times[989];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:256:
[31m-    
[m[32m+
[m     println!("\n  Config Creation Performance:");
     println!("  ├─ P50: {:?}", p50);
     println!("  └─ P99: {:?}", p99);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:260:
[31m-    
[m[31m-    assert!(p99 < Duration::from_micros(10), "Config creation should be <10μs");
[m[32m+
[m[32m+    assert!(
[m[32m+        p99 < Duration::from_micros(10),
[m[32m+        "Config creation should be <10μs"
[m[32m+    );
[m     println!("  ✓ Config creation overhead is minimal");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:267:
 #[tokio::test]
 async fn test_circuit_breaker_threshold_edge_cases() -> Result<()> {
     println!("\n=== Test: Circuit Breaker Threshold Edge Cases ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     // Test with threshold of 1 (opens after single failure)
     let sensitive_config = MlTrainingBackendConfig {
         circuit_breaker_failures: 1,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:276:
         circuit_breaker_reset_secs: 5,
         ..Default::default()
     };
[31m-    
[m[32m+
[m     println!("  ✓ Sensitive CB (failures=1): Valid");
     assert_eq!(sensitive_config.circuit_breaker_failures, 1);
[31m-    
[m[32m+
[m     // Test with high threshold (tolerates many failures)
     let tolerant_config = MlTrainingBackendConfig {
         circuit_breaker_failures: 100,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:286:
         circuit_breaker_reset_secs: 300,
         ..Default::default()
     };
[31m-    
[m[32m+
[m     println!("  ✓ Tolerant CB (failures=100): Valid");
     assert_eq!(tolerant_config.circuit_breaker_failures, 100);
[31m-    
[m[32m+
[m     Ok(())
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/metrics_integration_test.rs:281:
 
     // Record some events
     metrics.auth.record_success(5.0);
[31m-    metrics.proxy.record_backend_success("trading", "ExecuteTrade", 15.0);
[m[32m+    metrics
[m[32m+        .proxy
[m[32m+        .record_backend_success("trading", "ExecuteTrade", 15.0);
[m     metrics.config.record_notify_event(true);
 
     let exporter = PrometheusExporter::new(metrics.registry());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/metrics_integration_test.rs:288:
[31m-    let output = exporter
[m[31m-        .gather_metrics()
[m[31m-        .expect("Failed to gather metrics");
[m[32m+    let output = exporter.gather_metrics().expect("Failed to gather metrics");
[m 
     // Verify Prometheus text format
     assert!(output.contains("# HELP"));
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:15:
 
 // Import MFA modules from api_gateway
 use api_gateway::auth::mfa::{
[31m-    backup_codes::{BackupCode, BackupCodeGenerator, hash_backup_code},
[m[32m+    backup_codes::{hash_backup_code, BackupCode, BackupCodeGenerator},
[m     enrollment::{EnrollmentSession, EnrollmentStatus, MfaEnrollment},
     totp::{TotpAlgorithm, TotpConfig, TotpGenerator, TotpVerifier},
[31m-    verification::{MfaVerification, VerificationMethod, VerificationMetadata, VerificationResult},
[m[32m+    verification::{MfaVerification, VerificationMetadata, VerificationMethod, VerificationResult},
[m };
 use secrecy::{ExposeSecret, SecretString};
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:46:
 
     // However, code should fail outside drift tolerance
     let future_time = time + 90; // 3 periods later
[31m-    assert!(!verifier.verify_at_time(secret, &code, future_time, 1).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, future_time, 1)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:59:
     let boundary_time = 1234567890u64; // Divisible by 30
     assert_eq!(boundary_time % 30, 0);
 
[31m-    let code = generator.generate_code_at_time(secret, boundary_time).unwrap();
[m[31m-    assert!(verifier.verify_at_time(secret, &code, boundary_time, 1).unwrap());
[m[32m+    let code = generator
[m[32m+        .generate_code_at_time(secret, boundary_time)
[m[32m+        .unwrap();
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, boundary_time, 1)
[m[32m+        .unwrap());
[m 
     // Code should work 1 second before period ends
     let near_end = boundary_time + 29;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:68:
 
     // Code should work at next period boundary with drift=1
     let next_boundary = boundary_time + 30;
[31m-    assert!(verifier.verify_at_time(secret, &code, next_boundary, 1).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, next_boundary, 1)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:96:
     let code = generator.generate_code_at_time(secret, base_time).unwrap();
 
     // With drift=2, should accept ±60 seconds
[31m-    assert!(verifier.verify_at_time(secret, &code, base_time + 60, 2).unwrap());
[m[31m-    assert!(verifier.verify_at_time(secret, &code, base_time - 60, 2).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, base_time + 60, 2)
[m[32m+        .unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, base_time - 60, 2)
[m[32m+        .unwrap());
[m 
     // Should reject beyond drift=2 (±90 seconds)
[31m-    assert!(!verifier.verify_at_time(secret, &code, base_time + 90, 2).unwrap());
[m[31m-    assert!(!verifier.verify_at_time(secret, &code, base_time - 90, 2).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, base_time + 90, 2)
[m[32m+        .unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, base_time - 90, 2)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:115:
 
     // With drift=0, only exact time window works
     assert!(verifier.verify_at_time(secret, &code, time, 0).unwrap());
[31m-    assert!(verifier.verify_at_time(secret, &code, time + 15, 0).unwrap()); // Same period
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, time + 15, 0)
[m[32m+        .unwrap()); // Same period
[m 
     // Even 1 period off fails with drift=0
[31m-    assert!(!verifier.verify_at_time(secret, &code, time + 30, 0).unwrap());
[m[31m-    assert!(!verifier.verify_at_time(secret, &code, time - 30, 0).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, time + 30, 0)
[m[32m+        .unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, time - 30, 0)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:131:
 
     // Generate code for future time
     let future_time = current_time + 120; // 4 periods ahead
[31m-    let future_code = generator.generate_code_at_time(secret, future_time).unwrap();
[m[32m+    let future_code = generator
[m[32m+        .generate_code_at_time(secret, future_time)
[m[32m+        .unwrap();
[m 
     // Should reject future code even with drift=1
[31m-    assert!(!verifier.verify_at_time(secret, &future_code, current_time, 1).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &future_code, current_time, 1)
[m[32m+        .unwrap());
[m 
     // Should reject even with drift=2
[31m-    assert!(!verifier.verify_at_time(secret, &future_code, current_time, 2).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &future_code, current_time, 2)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:152:
     let past_code = generator.generate_code_at_time(secret, past_time).unwrap();
 
     // Should reject past code outside drift tolerance
[31m-    assert!(!verifier.verify_at_time(secret, &past_code, current_time, 1).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &past_code, current_time, 1)
[m[32m+        .unwrap());
[m 
     // Should still reject with drift=2 (only covers ±60 seconds)
[31m-    assert!(!verifier.verify_at_time(secret, &past_code, current_time, 2).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &past_code, current_time, 2)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:218:
     let code1 = generator.generate_code_at_time(secret1, time).unwrap();
     let code2 = generator.generate_code_at_time(secret2, time).unwrap();
 
[31m-    assert_ne!(code1, code2, "Different secrets should produce different codes");
[m[32m+    assert_ne!(
[m[32m+        code1, code2,
[m[32m+        "Different secrets should produce different codes"
[m[32m+    );
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:253:
     let period_end = period_start + 29; // Last second of period
     let next_period = period_start + 30;
 
[31m-    let code = generator.generate_code_at_time(secret, period_start).unwrap();
[m[32m+    let code = generator
[m[32m+        .generate_code_at_time(secret, period_start)
[m[32m+        .unwrap();
[m 
     // Should work at start and end of same period
[31m-    assert!(verifier.verify_at_time(secret, &code, period_start, 0).unwrap());
[m[31m-    assert!(verifier.verify_at_time(secret, &code, period_end, 0).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, period_start, 0)
[m[32m+        .unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, period_end, 0)
[m[32m+        .unwrap());
[m 
     // Should fail at next period with drift=0
[31m-    assert!(!verifier.verify_at_time(secret, &code, next_period, 0).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, next_period, 0)
[m[32m+        .unwrap());
[m 
     // Should work at next period with drift=1
[31m-    assert!(verifier.verify_at_time(secret, &code, next_period, 1).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, next_period, 1)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:295:
     let almost_code2 = format!("{}3456", &valid_code[0..1]); // Wrong from position 1
 
     // All should take similar time (constant-time comparison)
[31m-    assert!(verifier.verify_at_time(secret, &valid_code, time, 1).unwrap());
[m[31m-    assert!(!verifier.verify_at_time(secret, &almost_code1, time, 1).unwrap());
[m[31m-    assert!(!verifier.verify_at_time(secret, &almost_code2, time, 1).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &valid_code, time, 1)
[m[32m+        .unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &almost_code1, time, 1)
[m[32m+        .unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &almost_code2, time, 1)
[m[32m+        .unwrap());
[m }
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:575:
     match &enrollment.status {
         EnrollmentStatus::Failed(reason) => {
             assert_eq!(reason, "Invalid verification code");
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected Failed status"),
     }
     assert!(enrollment.session.is_none());
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:908:
     };
 
     // TOTP verification
[31m-    let result_totp = VerificationResult::success(
[m[31m-        user_id,
[m[31m-        VerificationMethod::Totp,
[m[31m-        metadata.clone(),
[m[31m-    );
[m[32m+    let result_totp =
[m[32m+        VerificationResult::success(user_id, VerificationMethod::Totp, metadata.clone());
[m     assert_eq!(result_totp.method, VerificationMethod::Totp);
 
     // Backup code verification
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:919:
[31m-    let result_backup = VerificationResult::success(
[m[31m-        user_id,
[m[31m-        VerificationMethod::BackupCode,
[m[31m-        metadata.clone(),
[m[31m-    );
[m[32m+    let result_backup =
[m[32m+        VerificationResult::success(user_id, VerificationMethod::BackupCode, metadata.clone());
[m     assert_eq!(result_backup.method, VerificationMethod::BackupCode);
 
     // Trusted device verification
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:927:
[31m-    let result_device = VerificationResult::success(
[m[31m-        user_id,
[m[31m-        VerificationMethod::TrustedDevice,
[m[31m-        metadata,
[m[31m-    );
[m[32m+    let result_device =
[m[32m+        VerificationResult::success(user_id, VerificationMethod::TrustedDevice, metadata);
[m     assert_eq!(result_device.method, VerificationMethod::TrustedDevice);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:1091:
 
     // All verifications should take similar time (constant-time comparison)
     let wrong_codes = vec![
[31m-        "000000", // All wrong
[m[32m+        "000000",                               // All wrong
[m         &format!("{}00000", &valid_code[0..1]), // First digit correct
[31m-        &format!("{}0000", &valid_code[0..2]), // First two correct
[m[31m-        &format!("{}000", &valid_code[0..3]), // First three correct
[m[31m-        &format!("{}00", &valid_code[0..4]),   // First four correct
[m[31m-        &format!("{}0", &valid_code[0..5]),    // First five correct
[m[32m+        &format!("{}0000", &valid_code[0..2]),  // First two correct
[m[32m+        &format!("{}000", &valid_code[0..3]),   // First three correct
[m[32m+        &format!("{}00", &valid_code[0..4]),    // First four correct
[m[32m+        &format!("{}0", &valid_code[0..5]),     // First five correct
[m     ];
 
     for wrong_code in wrong_codes {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:1103:
[31m-        let result = verifier.verify_at_time(secret, wrong_code, time, 1).unwrap();
[m[32m+        let result = verifier
[m[32m+            .verify_at_time(secret, wrong_code, time, 1)
[m[32m+            .unwrap();
[m         assert!(!result, "Wrong code should fail: {}", wrong_code);
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/mfa_comprehensive.rs:1107:
     // Valid code should succeed
[31m-    assert!(verifier.verify_at_time(secret, &valid_code, time, 1).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &valid_code, time, 1)
[m[32m+        .unwrap());
[m }
 
 #[test]
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:46:
     println!("  ├─ Allowed: {}", allowed);
     println!("  ├─ Denied: {}", denied);
     println!("  ├─ Duration: {:?}", duration);
[31m-    println!("  └─ Rate: {:.0} req/s", allowed as f64 / duration.as_secs_f64());
[m[32m+    println!(
[m[32m+        "  └─ Rate: {:.0} req/s",
[m[32m+        allowed as f64 / duration.as_secs_f64()
[m[32m+    );
[m 
     // Should allow around 100 requests
[31m-    assert!(allowed <= 110, "Should not exceed rate limit by more than 10%");
[m[32m+    assert!(
[m[32m+        allowed <= 110,
[m[32m+        "Should not exceed rate limit by more than 10%"
[m[32m+    );
[m     assert!(denied > 9_800, "Should deny most excess requests");
 
     println!("  ✓ Single user rate limit enforced correctly");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:116:
 
     // Each user should get around 100 requests
     let avg_per_user = allowed / num_users;
[31m-    assert!(avg_per_user >= 90 && avg_per_user <= 110,
[m[31m-            "Average per user should be ~100, got {}", avg_per_user);
[m[32m+    assert!(
[m[32m+        avg_per_user >= 90 && avg_per_user <= 110,
[m[32m+        "Average per user should be ~100, got {}",
[m[32m+        avg_per_user
[m[32m+    );
[m 
     println!("  ✓ Multiple users independently rate limited");
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:169:
     println!("  ├─ Allowed: {}", allowed);
     println!("  ├─ Denied: {}", denied);
     println!("  ├─ Duration: {:?}", duration);
[31m-    println!("  └─ Effective rate: {:.0} req/s", allowed as f64 / duration.as_secs_f64());
[m[32m+    println!(
[m[32m+        "  └─ Effective rate: {:.0} req/s",
[m[32m+        allowed as f64 / duration.as_secs_f64()
[m[32m+    );
[m 
     // Should block most requests
     assert!(allowed <= 1100, "Should limit burst to ~1000 requests");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:183:
 async fn stress_test_sustained_flood() -> Result<()> {
     println!("\n=== STRESS TEST 4: Sustained Flood (1M requests over 60s) ===");
 
[31m-    let rate_limiter = Arc::new(AuthRateLimiter::new(10000).expect("Failed to create rate limiter")); // 10K req/s
[m[32m+    let rate_limiter =
[m[32m+        Arc::new(AuthRateLimiter::new(10000).expect("Failed to create rate limiter")); // 10K req/s
[m     let user_id = "flood_attacker";
 
     let allowed_counter = Arc::new(AtomicUsize::new(0));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:221:
     println!("  Results:");
     println!("  ├─ Duration: {:?}", duration);
     println!("  ├─ Allowed: {}", allowed);
[31m-    println!("  └─ Rate: {:.0} req/s", allowed as f64 / duration.as_secs_f64());
[m[32m+    println!(
[m[32m+        "  └─ Rate: {:.0} req/s",
[m[32m+        allowed as f64 / duration.as_secs_f64()
[m[32m+    );
[m 
     // Should maintain consistent rate (allow 20% variance for governor rate limiter)
     let rate = allowed as f64 / duration.as_secs_f64();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:228:
[31m-    assert!(rate >= 9000.0 && rate <= 13000.0,
[m[31m-            "Should maintain ~10K req/s rate, got {:.0}", rate);
[m[32m+    assert!(
[m[32m+        rate >= 9000.0 && rate <= 13000.0,
[m[32m+        "Should maintain ~10K req/s rate, got {:.0}",
[m[32m+        rate
[m[32m+    );
[m 
     println!("  ✓ Sustained flood successfully rate limited");
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:287:
     println!("  └─ Duration: {:?}", duration);
 
     // Each user should be limited to ~100 requests
[31m-    assert!(avg_per_user <= 110, "Average should not exceed limit by >10%");
[m[32m+    assert!(
[m[32m+        avg_per_user <= 110,
[m[32m+        "Average should not exceed limit by >10%"
[m[32m+    );
[m     assert!(min_per_user >= 90, "Min should be at least 90% of limit");
 
     println!("  ✓ Distributed attack successfully mitigated");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:332:
     // Note: In-process measurements will show higher latency due to measurement overhead
     // Actual atomic operation is <50ns, but measurement adds overhead
     if p99 > Duration::from_micros(1) {
[31m-        println!("  ⚠ NOTE: P99 latency {:?} includes measurement overhead", p99);
[m[32m+        println!(
[m[32m+            "  ⚠ NOTE: P99 latency {:?} includes measurement overhead",
[m[32m+            p99
[m[32m+        );
[m         println!("         Actual atomic counter operation is <50ns");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:375:
     println!("  Phase 3: After refill");
     println!("  ├─ Allowed: {}", refill_allowed);
 
[31m-    assert!(refill_allowed >= 8 && refill_allowed <= 12,
[m[31m-            "Should allow ~10 requests after refill, got {}", refill_allowed);
[m[32m+    assert!(
[m[32m+        refill_allowed >= 8 && refill_allowed <= 12,
[m[32m+        "Should allow ~10 requests after refill, got {}",
[m[32m+        refill_allowed
[m[32m+    );
[m 
     // Phase 4: Gradual increase test
     println!("  Phase 4: Gradual increase over 2s");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:393:
     println!("  ├─ Allowed: {}", gradual_allowed);
     println!("  └─ Expected: ~20 (10 req/s * 2s)");
 
[31m-    assert!(gradual_allowed >= 18 && gradual_allowed <= 22,
[m[31m-            "Gradual increase should allow ~20 requests, got {}", gradual_allowed);
[m[32m+    assert!(
[m[32m+        gradual_allowed >= 18 && gradual_allowed <= 22,
[m[32m+        "Gradual increase should allow ~20 requests, got {}",
[m[32m+        gradual_allowed
[m[32m+    );
[m 
     println!("  ✓ Token bucket algorithm working correctly");
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiter_stress_test.rs:414:
         }
     }
     println!("  ├─ Empty string: {} allowed", allowed1);
[31m-    assert!(allowed1 <= 12, "Should still enforce limit for empty string");
[m[32m+    assert!(
[m[32m+        allowed1 <= 12,
[m[32m+        "Should still enforce limit for empty string"
[m[32m+    );
[m 
     // Test 2: Very long user ID
     println!("  Test 2: Very long user ID (1KB)");
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:13:
 use std::time::{Duration, Instant};
 use uuid::Uuid;
 
[31m-use api_gateway::routing::{RateLimiter, RateLimitConfig};
[m[32m+use api_gateway::routing::{RateLimitConfig, RateLimiter};
[m 
 const REDIS_URL: &str = "redis://localhost:6380";
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:24:
 #[tokio::test]
 async fn test_redis_backend_basic_check() -> Result<()> {
     println!("\n=== Test: Redis Backend Basic Check ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // First request should succeed
[31m-    let result1 = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+    let result1 = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m     println!("  First request: {}", result1);
     assert!(result1, "First request should be allowed");
[31m-    
[m[32m+
[m     // Subsequent requests should succeed up to capacity
     let mut allowed = 0;
     for i in 0..150 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:39:
[31m-        if rate_limiter.check_limit(&user_id, "trading.submit_order").await? {
[m[32m+        if rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await?
[m[32m+        {
[m             allowed += 1;
         } else {
             println!("  First denial at request #{}", i + 2);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:43:
             break;
         }
     }
[31m-    
[m[32m+
[m     println!("  Total allowed: {}", allowed + 1);
[31m-    
[m[32m+
[m     // Should be limited by capacity (100 for trading.submit_order)
[31m-    assert!(allowed + 1 <= 110, "Should not exceed capacity by more than 10%");
[m[31m-    
[m[32m+    assert!(
[m[32m+        allowed + 1 <= 110,
[m[32m+        "Should not exceed capacity by more than 10%"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:55:
 #[tokio::test]
 async fn test_redis_lua_script_execution() -> Result<()> {
     println!("\n=== Test: Redis Lua Script Atomic Execution ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Concurrent requests should be handled atomically by Lua script
     let mut handles = Vec::new();
[31m-    
[m[32m+
[m     println!("  Spawning 100 concurrent requests...");
     for _ in 0..100 {
         let limiter = rate_limiter.clone();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:68:
         let uid = user_id;
[31m-        let handle = tokio::spawn(async move {
[m[31m-            limiter.check_limit(&uid, "trading.submit_order").await
[m[31m-        });
[m[32m+        let handle =
[m[32m+            tokio::spawn(async move { limiter.check_limit(&uid, "trading.submit_order").await });
[m         handles.push(handle);
     }
[31m-    
[m[32m+
[m     // Collect results
     let mut allowed = 0;
     let mut denied = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:79:
         match handle.await? {
             Ok(true) => allowed += 1,
             Ok(false) => denied += 1,
[31m-            Err(_) => {}
[m[32m+            Err(_) => {},
[m         }
     }
[31m-    
[m[32m+
[m     println!("  Allowed: {}, Denied: {}", allowed, denied);
[31m-    
[m[32m+
[m     // Lua script should ensure exact limit enforcement
     assert_eq!(allowed + denied, 100, "All requests should complete");
     assert!(allowed <= 100, "Should not exceed capacity");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:91:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:95:
 #[tokio::test]
 async fn test_redis_token_refill() -> Result<()> {
     println!("\n=== Test: Redis Token Bucket Refill ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Exhaust tokens
     let mut initial_allowed = 0;
     for _ in 0..150 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:106:
             initial_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  Initial allowed: {}", initial_allowed);
[31m-    assert!(initial_allowed <= 12, "Should be limited to capacity (10 + tolerance)");
[m[31m-    
[m[32m+    assert!(
[m[32m+        initial_allowed <= 12,
[m[32m+        "Should be limited to capacity (10 + tolerance)"
[m[32m+    );
[m[32m+
[m     // Wait for refill (config.update has 10 req/s refill rate)
     println!("  Waiting 1s for token refill...");
     tokio::time::sleep(Duration::from_secs(1)).await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:116:
[31m-    
[m[32m+
[m     // Should have refilled tokens
     let mut refilled = 0;
     for _ in 0..20 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:121:
             refilled += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  After refill: {}", refilled);
[31m-    assert!(refilled >= 8 && refilled <= 12, "Should refill ~10 tokens, got {}", refilled);
[m[31m-    
[m[32m+    assert!(
[m[32m+        refilled >= 8 && refilled <= 12,
[m[32m+        "Should refill ~10 tokens, got {}",
[m[32m+        refilled
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:131:
 #[tokio::test]
 async fn test_redis_persistence() -> Result<()> {
     println!("\n=== Test: Redis State Persistence ===");
[31m-    
[m[32m+
[m     let rate_limiter1 = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Make some requests with first limiter instance
     let mut count1 = 0;
     for _ in 0..5 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:141:
[31m-        if rate_limiter1.check_limit(&user_id, "backtesting.run").await? {
[m[32m+        if rate_limiter1
[m[32m+            .check_limit(&user_id, "backtesting.run")
[m[32m+            .await?
[m[32m+        {
[m             count1 += 1;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:145:
[31m-    
[m[32m+
[m     println!("  Instance 1 allowed: {}", count1);
[31m-    
[m[32m+
[m     // Create new limiter instance (should share Redis state)
     let rate_limiter2 = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Remaining requests should respect previous consumption
     let mut count2 = 0;
     for _ in 0..5 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:154:
[31m-        if rate_limiter2.check_limit(&user_id, "backtesting.run").await? {
[m[32m+        if rate_limiter2
[m[32m+            .check_limit(&user_id, "backtesting.run")
[m[32m+            .await?
[m[32m+        {
[m             count2 += 1;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:158:
[31m-    
[m[32m+
[m     println!("  Instance 2 allowed: {}", count2);
[31m-    
[m[32m+
[m     // Total should not exceed capacity (5 for backtesting.run)
     assert!(count1 + count2 <= 6, "Total should respect shared state");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:167:
 #[tokio::test]
 async fn test_redis_ttl_expiration() -> Result<()> {
     println!("\n=== Test: Redis Key TTL Expiration ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Make a request to create Redis key
[31m-    let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[31m-    
[m[32m+    let _ = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m[32m+
[m     println!("  Key created with 300s TTL");
     println!("  (TTL validation requires manual Redis inspection)");
[31m-    
[m[32m+
[m     // Note: Full TTL test would require waiting 300s or manual Redis commands
     // This test validates the key is created; TTL is set in Lua script
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:186:
 #[tokio::test]
 async fn test_redis_connection_pool() -> Result<()> {
     println!("\n=== Test: Redis Connection Pool Behavior ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Make 1000 requests to stress connection pool
     let mut handles = Vec::new();
[31m-    
[m[32m+
[m     println!("  Spawning 1000 concurrent Redis requests...");
     for i in 0..1000 {
         let limiter = rate_limiter.clone();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:198:
         let user_id = Uuid::new_v4();
[31m-        let handle = tokio::spawn(async move {
[m[31m-            limiter.check_limit(&user_id, "trading.submit_order").await
[m[31m-        });
[m[32m+        let handle =
[m[32m+            tokio::spawn(
[m[32m+                async move { limiter.check_limit(&user_id, "trading.submit_order").await },
[m[32m+            );
[m         handles.push(handle);
     }
[31m-    
[m[32m+
[m     // All should succeed without connection pool exhaustion
     let mut success = 0;
     let mut errors = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:211:
             Err(_) => errors += 1,
         }
     }
[31m-    
[m[32m+
[m     println!("  Success: {}, Errors: {}", success, errors);
     assert!(errors < 10, "Should have minimal connection errors");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:221:
 #[tokio::test]
 async fn test_redis_error_handling() -> Result<()> {
     println!("\n=== Test: Redis Connection Error Handling ===");
[31m-    
[m[32m+
[m     // Attempt connection to invalid Redis URL
     let result = RateLimiter::new("redis://invalid-host:9999").await;
[31m-    
[m[32m+
[m     println!("  Invalid Redis URL result: {:?}", result.is_err());
     assert!(result.is_err(), "Should fail for invalid Redis URL");
[31m-    
[m[32m+
[m     if let Err(e) = result {
         println!("  Error message: {}", e);
[31m-        assert!(e.to_string().contains("Failed to"), "Should have descriptive error");
[m[32m+        assert!(
[m[32m+            e.to_string().contains("Failed to"),
[m[32m+            "Should have descriptive error"
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:239:
 #[tokio::test]
 async fn test_redis_multiple_endpoints() -> Result<()> {
     println!("\n=== Test: Redis Multiple Endpoint Tracking ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Same user, different endpoints - should be tracked separately
     let mut trading_allowed = 0;
     let mut config_allowed = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:249:
     let mut backtest_allowed = 0;
[31m-    
[m[32m+
[m     for _ in 0..20 {
[31m-        if rate_limiter.check_limit(&user_id, "trading.submit_order").await? {
[m[32m+        if rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await?
[m[32m+        {
[m             trading_allowed += 1;
         }
         if rate_limiter.check_limit(&user_id, "config.update").await? {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:256:
             config_allowed += 1;
         }
[31m-        if rate_limiter.check_limit(&user_id, "backtesting.run").await? {
[m[32m+        if rate_limiter
[m[32m+            .check_limit(&user_id, "backtesting.run")
[m[32m+            .await?
[m[32m+        {
[m             backtest_allowed += 1;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:262:
[31m-    
[m[32m+
[m     println!("  Trading: {}", trading_allowed);
     println!("  Config: {}", config_allowed);
     println!("  Backtest: {}", backtest_allowed);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:266:
[31m-    
[m[32m+
[m     // Each endpoint should have independent limits
     assert!(trading_allowed >= 15, "Trading should allow most requests");
     assert!(config_allowed >= 8, "Config should allow some requests");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:270:
     assert!(backtest_allowed <= 6, "Backtest should be most restrictive");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:275:
 #[tokio::test]
 async fn test_redis_cross_user_isolation() -> Result<()> {
     println!("\n=== Test: Redis Cross-User Isolation ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     let user1 = Uuid::new_v4();
     let user2 = Uuid::new_v4();
[31m-    
[m[32m+
[m     // User 1 exhausts their limit
     let mut user1_allowed = 0;
     for _ in 0..20 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:288:
             user1_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     // User 2 should still have full quota
     let mut user2_allowed = 0;
     for _ in 0..20 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:296:
             user2_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  User 1: {}", user1_allowed);
     println!("  User 2: {}", user2_allowed);
[31m-    
[m[32m+
[m     assert!(user1_allowed <= 12, "User 1 should be limited");
[31m-    assert!(user2_allowed <= 12, "User 2 should be independently limited");
[m[31m-    assert_eq!(user1_allowed, user2_allowed, "Users should have equal quotas");
[m[31m-    
[m[32m+    assert!(
[m[32m+        user2_allowed <= 12,
[m[32m+        "User 2 should be independently limited"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        user1_allowed, user2_allowed,
[m[32m+        "Users should have equal quotas"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:310:
 #[tokio::test]
 async fn test_redis_system_time_error() -> Result<()> {
     println!("\n=== Test: Redis System Time Error Handling ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Normal requests should succeed (validates system time is working)
[31m-    let result = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[31m-    
[m[32m+    let result = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m[32m+
[m     println!("  System time operational: {}", result);
     assert!(result, "Should work with valid system time");
[31m-    
[m[32m+
[m     // Note: Testing actual system time errors would require mocking,
     // which is outside scope. This validates the happy path.
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:333:
 #[tokio::test]
 async fn test_cache_basic_operation() -> Result<()> {
     println!("\n=== Test: Cache Basic Operation ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // First request (cache miss, Redis hit)
     let start1 = Instant::now();
[31m-    let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+    let _ = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m     let latency1 = start1.elapsed();
[31m-    
[m[32m+
[m     // Second request (cache hit)
     let start2 = Instant::now();
[31m-    let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+    let _ = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m     let latency2 = start2.elapsed();
[31m-    
[m[32m+
[m     println!("  First request (Redis): {:?}", latency1);
     println!("  Second request (cache): {:?}", latency2);
[31m-    println!("  Cache speedup: {:.1}x", latency1.as_nanos() as f64 / latency2.as_nanos() as f64);
[m[31m-    
[m[32m+    println!(
[m[32m+        "  Cache speedup: {:.1}x",
[m[32m+        latency1.as_nanos() as f64 / latency2.as_nanos() as f64
[m[32m+    );
[m[32m+
[m     // Cache hit should be significantly faster
     assert!(latency2 < latency1, "Cached request should be faster");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:360:
 #[tokio::test]
 async fn test_cache_ttl_expiration() -> Result<()> {
     println!("\n=== Test: Cache TTL Expiration ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Request to populate cache
[31m-    let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[31m-    
[m[32m+    let _ = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m[32m+
[m     println!("  Cache populated, TTL: 1s");
[31m-    
[m[32m+
[m     // Wait for cache TTL to expire (1 second)
     println!("  Waiting 1.1s for cache expiration...");
     tokio::time::sleep(Duration::from_millis(1100)).await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:375:
[31m-    
[m[32m+
[m     // Next request should be slower (cache miss)
     let start = Instant::now();
[31m-    let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+    let _ = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m     let latency = start.elapsed();
[31m-    
[m[32m+
[m     println!("  Post-expiration latency: {:?}", latency);
[31m-    
[m[32m+
[m     // Should go back to Redis (higher latency)
[31m-    assert!(latency > Duration::from_micros(1), "Should bypass expired cache");
[m[31m-    
[m[32m+    assert!(
[m[32m+        latency > Duration::from_micros(1),
[m[32m+        "Should bypass expired cache"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:389:
 #[tokio::test]
 async fn test_cache_lru_eviction() -> Result<()> {
     println!("\n=== Test: Cache LRU Eviction ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Fill cache beyond max size (10,000 entries)
     println!("  Filling cache with 10,500 unique users...");
     for i in 0..10_500 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:398:
         let user_id = Uuid::new_v4();
[31m-        let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[31m-        
[m[32m+        let _ = rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await?;
[m[32m+
[m         if i % 1000 == 0 {
             let stats = rate_limiter.get_cache_stats().await;
             println!("  Progress: {} users, cache size: {}", i, stats.size);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:404:
         }
     }
[31m-    
[m[32m+
[m     // Cache should have evicted oldest 10% (1,000 entries)
     let final_stats = rate_limiter.get_cache_stats().await;
     println!("  Final cache size: {}", final_stats.size);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:410:
[31m-    
[m[31m-    assert!(final_stats.size <= 10_000, "Cache should not exceed max size");
[m[31m-    assert!(final_stats.size >= 9_000, "Cache should retain most recent entries");
[m[31m-    
[m[32m+
[m[32m+    assert!(
[m[32m+        final_stats.size <= 10_000,
[m[32m+        "Cache should not exceed max size"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        final_stats.size >= 9_000,
[m[32m+        "Cache should retain most recent entries"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:417:
 #[tokio::test]
 async fn test_cache_stats() -> Result<()> {
     println!("\n=== Test: Cache Statistics ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Initial stats
     let stats1 = rate_limiter.get_cache_stats().await;
     println!("  Initial stats:");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:426:
     println!("  ├─ Size: {}", stats1.size);
     println!("  ├─ Max: {}", stats1.max_size);
     println!("  └─ TTL: {}s", stats1.ttl_seconds);
[31m-    
[m[32m+
[m     assert_eq!(stats1.max_size, 10_000, "Max size should be 10,000");
     assert_eq!(stats1.ttl_seconds, 1, "TTL should be 1 second");
[31m-    
[m[32m+
[m     // Add some entries
     for _ in 0..100 {
         let user_id = Uuid::new_v4();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:436:
[31m-        let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+        let _ = rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await?;
[m     }
[31m-    
[m[32m+
[m     let stats2 = rate_limiter.get_cache_stats().await;
     println!("  After 100 requests:");
     println!("  └─ Size: {}", stats2.size);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:442:
[31m-    
[m[32m+
[m     assert!(stats2.size >= 50, "Should have cached some entries");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:448:
 #[tokio::test]
 async fn test_cache_clear() -> Result<()> {
     println!("\n=== Test: Cache Clear Operation ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Populate cache
     for _ in 0..50 {
         let user_id = Uuid::new_v4();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:457:
[31m-        let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+        let _ = rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await?;
[m     }
[31m-    
[m[32m+
[m     let stats_before = rate_limiter.get_cache_stats().await;
     println!("  Cache size before clear: {}", stats_before.size);
[31m-    
[m[32m+
[m     // Clear cache
     rate_limiter.clear_cache().await;
[31m-    
[m[32m+
[m     let stats_after = rate_limiter.get_cache_stats().await;
     println!("  Cache size after clear: {}", stats_after.size);
[31m-    
[m[32m+
[m     assert_eq!(stats_after.size, 0, "Cache should be empty after clear");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:474:
 #[tokio::test]
 async fn test_cache_concurrent_access() -> Result<()> {
     println!("\n=== Test: Cache Concurrent Access (DashMap Lock-Free) ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Populate cache for this user
[31m-    let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[31m-    
[m[32m+    let _ = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m[32m+
[m     // Concurrent cache hits
     let mut handles = Vec::new();
[31m-    
[m[32m+
[m     println!("  Spawning 1000 concurrent cache hits...");
     for _ in 0..1000 {
         let limiter = rate_limiter.clone();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:495:
         });
         handles.push(handle);
     }
[31m-    
[m[32m+
[m     // Collect latencies
     let mut latencies = Vec::new();
     for handle in handles {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:503:
             latencies.push(latency);
         }
     }
[31m-    
[m[32m+
[m     // Calculate percentiles
     latencies.sort();
     let p50 = latencies[499];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:510:
     let p99 = latencies[989];
[31m-    
[m[32m+
[m     println!("  Concurrent cache performance:");
     println!("  ├─ P50: {:?}", p50);
     println!("  ├─ P99: {:?}", p99);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:515:
     println!("  └─ Target: <8ns (DashMap lock-free)");
[31m-    
[m[32m+
[m     // Note: Actual latency includes network and system overhead
     // Target <8ns is for the DashMap operation itself
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:523:
 #[tokio::test]
 async fn test_cache_invalidation_on_error() -> Result<()> {
     println!("\n=== Test: Cache Invalidation on Error ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Normal request to populate cache
[31m-    let result1 = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+    let result1 = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m     println!("  Initial request: {}", result1);
[31m-    
[m[32m+
[m     // Subsequent requests should use cache
[31m-    let result2 = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[32m+    let result2 = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m     println!("  Cached request: {}", result2);
[31m-    
[m[32m+
[m     // Cache should remain valid across requests
     assert!(result1 || result2, "At least one request should succeed");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:544:
 #[tokio::test]
 async fn test_cache_size_overflow_handling() -> Result<()> {
     println!("\n=== Test: Cache Size Overflow Handling ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Attempt to overflow cache with rapid insertions
     println!("  Rapid insertion of 11,000 entries...");
[31m-    
[m[32m+
[m     let start = Instant::now();
     for i in 0..11_000 {
         let user_id = Uuid::new_v4();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:556:
[31m-        let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[31m-        
[m[32m+        let _ = rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await?;
[m[32m+
[m         if i % 2000 == 0 {
             let stats = rate_limiter.get_cache_stats().await;
             println!("  {} entries: cache size = {}", i, stats.size);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:561:
         }
     }
     let duration = start.elapsed();
[31m-    
[m[32m+
[m     let final_stats = rate_limiter.get_cache_stats().await;
     println!("  Final: {} entries in {:?}", final_stats.size, duration);
[31m-    
[m[32m+
[m     // Should handle overflow gracefully via LRU eviction
[31m-    assert!(final_stats.size <= 10_000, "Should not exceed max cache size");
[m[31m-    
[m[32m+    assert!(
[m[32m+        final_stats.size <= 10_000,
[m[32m+        "Should not exceed max cache size"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:578:
 #[tokio::test]
 async fn test_default_endpoint_configs() -> Result<()> {
     println!("\n=== Test: Default Endpoint Configurations ===");
[31m-    
[m[32m+
[m     let trading = RateLimitConfig::trading_submit_order();
     let config = RateLimitConfig::config_update();
     let backtest = RateLimitConfig::backtesting_run();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:585:
[31m-    
[m[32m+
[m     println!("  Trading config:");
     println!("  ├─ Capacity: {}", trading.capacity);
     println!("  ├─ Refill rate: {}/s", trading.refill_rate);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:589:
     println!("  └─ Burst size: {}", trading.burst_size);
[31m-    
[m[32m+
[m     println!("  Config update:");
     println!("  ├─ Capacity: {}", config.capacity);
     println!("  ├─ Refill rate: {}/s", config.refill_rate);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:594:
     println!("  └─ Burst size: {}", config.burst_size);
[31m-    
[m[32m+
[m     println!("  Backtesting:");
     println!("  ├─ Capacity: {}", backtest.capacity);
     println!("  ├─ Refill rate: {}/min", backtest.refill_rate * 60.0);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:599:
     println!("  └─ Burst size: {}", backtest.burst_size);
[31m-    
[m[32m+
[m     assert_eq!(trading.capacity, 100.0, "Trading capacity");
     assert_eq!(config.capacity, 10.0, "Config capacity");
     assert_eq!(backtest.capacity, 5.0, "Backtest capacity");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:604:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:608:
 #[tokio::test]
 async fn test_dynamic_endpoint_config() -> Result<()> {
     println!("\n=== Test: Dynamic Endpoint Configuration ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Add custom endpoint config
     let custom_config = RateLimitConfig {
         endpoint: "custom.endpoint".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:618:
         refill_rate: 20.0,
         burst_size: 5,
     };
[31m-    
[m[32m+
[m     rate_limiter.set_endpoint_config(custom_config).await;
[31m-    
[m[32m+
[m     println!("  Custom endpoint config added");
[31m-    
[m[32m+
[m     // Use the custom endpoint
     let user_id = Uuid::new_v4();
     let mut allowed = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:629:
[31m-    
[m[32m+
[m     for _ in 0..30 {
[31m-        if rate_limiter.check_limit(&user_id, "custom.endpoint").await? {
[m[32m+        if rate_limiter
[m[32m+            .check_limit(&user_id, "custom.endpoint")
[m[32m+            .await?
[m[32m+        {
[m             allowed += 1;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:635:
[31m-    
[m[32m+
[m     println!("  Custom endpoint allowed: {}", allowed);
[31m-    assert!(allowed >= 18 && allowed <= 22, "Should respect custom capacity");
[m[31m-    
[m[32m+    assert!(
[m[32m+        allowed >= 18 && allowed <= 22,
[m[32m+        "Should respect custom capacity"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:642:
 #[tokio::test]
 async fn test_default_for_unknown_endpoint() -> Result<()> {
     println!("\n=== Test: Default Config for Unknown Endpoint ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Use unknown endpoint (should get default config)
     let mut allowed = 0;
     for _ in 0..70 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:652:
[31m-        if rate_limiter.check_limit(&user_id, "unknown.endpoint").await? {
[m[32m+        if rate_limiter
[m[32m+            .check_limit(&user_id, "unknown.endpoint")
[m[32m+            .await?
[m[32m+        {
[m             allowed += 1;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:656:
[31m-    
[m[32m+
[m     println!("  Unknown endpoint allowed: {}", allowed);
[31m-    
[m[32m+
[m     // Default is 50 req/s capacity
[31m-    assert!(allowed >= 45 && allowed <= 55, "Should use default 50 capacity");
[m[31m-    
[m[32m+    assert!(
[m[32m+        allowed >= 45 && allowed <= 55,
[m[32m+        "Should use default 50 capacity"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:665:
 #[tokio::test]
 async fn test_endpoint_config_update() -> Result<()> {
     println!("\n=== Test: Endpoint Configuration Update ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Set initial config
     let config1 = RateLimitConfig {
         endpoint: "mutable.endpoint".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:677:
         burst_size: 2,
     };
     rate_limiter.set_endpoint_config(config1).await;
[31m-    
[m[32m+
[m     // Test with initial config
     let mut count1 = 0;
     for _ in 0..20 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:684:
[31m-        if rate_limiter.check_limit(&user_id, "mutable.endpoint").await? {
[m[32m+        if rate_limiter
[m[32m+            .check_limit(&user_id, "mutable.endpoint")
[m[32m+            .await?
[m[32m+        {
[m             count1 += 1;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:688:
[31m-    
[m[32m+
[m     println!("  With capacity 10: {} allowed", count1);
     assert!(count1 <= 12, "Should respect initial capacity");
[31m-    
[m[32m+
[m     // Wait for refill
     tokio::time::sleep(Duration::from_millis(1100)).await;
[31m-    
[m[32m+
[m     // Update config
     let config2 = RateLimitConfig {
         endpoint: "mutable.endpoint".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:700:
         burst_size: 10,
     };
     rate_limiter.set_endpoint_config(config2).await;
[31m-    
[m[32m+
[m     // Clear cache to use new config
     rate_limiter.clear_cache().await;
[31m-    
[m[32m+
[m     // Test with new config
     let user_id2 = Uuid::new_v4();
     let mut count2 = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:710:
     for _ in 0..70 {
[31m-        if rate_limiter.check_limit(&user_id2, "mutable.endpoint").await? {
[m[32m+        if rate_limiter
[m[32m+            .check_limit(&user_id2, "mutable.endpoint")
[m[32m+            .await?
[m[32m+        {
[m             count2 += 1;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:715:
[31m-    
[m[32m+
[m     println!("  With capacity 50: {} allowed", count2);
     assert!(count2 >= 45, "Should respect updated capacity");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:722:
 #[tokio::test]
 async fn test_multiple_endpoint_configs() -> Result<()> {
     println!("\n=== Test: Multiple Endpoint Configurations ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Add multiple custom configs
     for i in 1..=10 {
         let config = RateLimitConfig {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:735:
         };
         rate_limiter.set_endpoint_config(config).await;
     }
[31m-    
[m[32m+
[m     println!("  Added 10 endpoint configs");
[31m-    
[m[32m+
[m     // Verify each endpoint has correct limit
     for i in 1..=10 {
         let user_id = Uuid::new_v4();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:744:
         let mut allowed = 0;
         let endpoint = format!("endpoint_{}", i);
[31m-        
[m[32m+
[m         for _ in 0..(i * 20) {
             if rate_limiter.check_limit(&user_id, &endpoint).await? {
                 allowed += 1;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:750:
             }
         }
[31m-        
[m[32m+
[m         let expected = i * 10;
[31m-        println!("  Endpoint {}: {} allowed (expected ~{})", i, allowed, expected);
[m[32m+        println!(
[m[32m+            "  Endpoint {}: {} allowed (expected ~{})",
[m[32m+            i, allowed, expected
[m[32m+        );
[m         assert!(allowed <= expected + 2, "Should respect individual limits");
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:761:
 #[tokio::test]
 async fn test_endpoint_config_concurrency() -> Result<()> {
     println!("\n=== Test: Concurrent Endpoint Config Updates ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Concurrent config updates (DashMap should handle safely)
     let mut handles = Vec::new();
[31m-    
[m[32m+
[m     println!("  Spawning 100 concurrent config updates...");
     for i in 0..100 {
         let limiter = rate_limiter.clone();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:781:
         });
         handles.push(handle);
     }
[31m-    
[m[32m+
[m     for handle in handles {
         handle.await?;
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:788:
[31m-    
[m[32m+
[m     println!("  ✓ All concurrent updates completed");
[31m-    
[m[32m+
[m     // Verify configs are usable
     let user_id = Uuid::new_v4();
     let result = rate_limiter.check_limit(&user_id, "concurrent_5").await?;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:794:
     println!("  Test request after concurrent updates: {}", result);
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:803:
 #[tokio::test]
 async fn test_cache_hit_performance() -> Result<()> {
     println!("\n=== Test: Cache Hit Performance (<8ns target) ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Warm up cache
[31m-    let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await?;
[m[31m-    
[m[32m+    let _ = rate_limiter
[m[32m+        .check_limit(&user_id, "trading.submit_order")
[m[32m+        .await?;
[m[32m+
[m     // Measure cache hit latency
     let mut latencies = Vec::new();
[31m-    
[m[32m+
[m     for _ in 0..1000 {
         let start = Instant::now();
[31m-        let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await;
[m[32m+        let _ = rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await;
[m         latencies.push(start.elapsed());
     }
[31m-    
[m[32m+
[m     latencies.sort();
     let p50 = latencies[499];
     let p95 = latencies[949];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:825:
     let p99 = latencies[989];
[31m-    
[m[32m+
[m     println!("  Cache hit latency:");
     println!("  ├─ P50: {:?}", p50);
     println!("  ├─ P95: {:?}", p95);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:830:
     println!("  ├─ P99: {:?}", p99);
     println!("  └─ Target: <8ns (DashMap operation only)");
[31m-    
[m[32m+
[m     // Note: Includes async/await overhead, actual DashMap is <8ns
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:838:
 #[tokio::test]
 async fn test_redis_hit_performance() -> Result<()> {
     println!("\n=== Test: Redis Hit Performance (<500μs target) ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Clear cache to force Redis hits
     rate_limiter.clear_cache().await;
[31m-    
[m[32m+
[m     let mut latencies = Vec::new();
[31m-    
[m[32m+
[m     for _ in 0..100 {
         let user_id = Uuid::new_v4();
         let start = Instant::now();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:852:
[31m-        let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await;
[m[32m+        let _ = rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await;
[m         latencies.push(start.elapsed());
     }
[31m-    
[m[32m+
[m     latencies.sort();
     let p50 = latencies[49];
     let p95 = latencies[94];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:859:
     let p99 = latencies[99];
[31m-    
[m[32m+
[m     println!("  Redis hit latency:");
     println!("  ├─ P50: {:?}", p50);
     println!("  ├─ P95: {:?}", p95);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:864:
     println!("  ├─ P99: {:?}", p99);
     println!("  └─ Target: <500μs");
[31m-    
[m[31m-    assert!(p99 < Duration::from_millis(1), "P99 should be under 1ms for local Redis");
[m[31m-    
[m[32m+
[m[32m+    assert!(
[m[32m+        p99 < Duration::from_millis(1),
[m[32m+        "P99 should be under 1ms for local Redis"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:872:
 #[tokio::test]
 async fn test_throughput_performance() -> Result<()> {
     println!("\n=== Test: Throughput Performance ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     let start = Instant::now();
     let mut requests = 0;
[31m-    
[m[32m+
[m     // Make requests for 1 second
     while start.elapsed() < Duration::from_secs(1) {
         let user_id = Uuid::new_v4();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:884:
[31m-        let _ = rate_limiter.check_limit(&user_id, "trading.submit_order").await;
[m[32m+        let _ = rate_limiter
[m[32m+            .check_limit(&user_id, "trading.submit_order")
[m[32m+            .await;
[m         requests += 1;
     }
[31m-    
[m[32m+
[m     let duration = start.elapsed();
     let req_per_sec = (requests as f64) / duration.as_secs_f64();
[31m-    
[m[32m+
[m     println!("  Throughput: {:.0} req/s", req_per_sec);
     println!("  Total requests: {}", requests);
[31m-    
[m[32m+
[m     assert!(req_per_sec > 1000.0, "Should handle >1000 req/s");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:903:
 #[tokio::test]
 async fn test_full_workflow_integration() -> Result<()> {
     println!("\n=== Test: Full Workflow Integration ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // Simulate realistic trading workflow
     let trader = Uuid::new_v4();
[31m-    
[m[32m+
[m     // 1. Config queries (high frequency)
     for _ in 0..5 {
         let _ = rate_limiter.check_limit(&trader, "config.get").await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:915:
     }
[31m-    
[m[32m+
[m     // 2. Trading submissions (burst)
     let mut trades_allowed = 0;
     for _ in 0..50 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:920:
[31m-        if rate_limiter.check_limit(&trader, "trading.submit_order").await? {
[m[32m+        if rate_limiter
[m[32m+            .check_limit(&trader, "trading.submit_order")
[m[32m+            .await?
[m[32m+        {
[m             trades_allowed += 1;
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:924:
[31m-    
[m[32m+
[m     // 3. Backtest request (rate-limited)
     let backtest_allowed = rate_limiter.check_limit(&trader, "backtesting.run").await?;
[31m-    
[m[32m+
[m     println!("  Workflow results:");
     println!("  ├─ Trades allowed: {}/50", trades_allowed);
     println!("  └─ Backtest allowed: {}", backtest_allowed);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:931:
[31m-    
[m[32m+
[m     assert!(trades_allowed >= 40, "Should allow most trades");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:937:
 #[tokio::test]
 async fn test_multi_user_multi_endpoint() -> Result<()> {
     println!("\n=== Test: Multi-User Multi-Endpoint Integration ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     // 10 users, 3 endpoints each
     let mut results = Vec::new();
[31m-    
[m[32m+
[m     for user_idx in 0..10 {
         let user_id = Uuid::new_v4();
         let mut user_results = (0, 0, 0);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:949:
[31m-        
[m[32m+
[m         for _ in 0..20 {
[31m-            if rate_limiter.check_limit(&user_id, "trading.submit_order").await? {
[m[32m+            if rate_limiter
[m[32m+                .check_limit(&user_id, "trading.submit_order")
[m[32m+                .await?
[m[32m+            {
[m                 user_results.0 += 1;
             }
             if rate_limiter.check_limit(&user_id, "config.update").await? {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:955:
                 user_results.1 += 1;
             }
[31m-            if rate_limiter.check_limit(&user_id, "backtesting.run").await? {
[m[32m+            if rate_limiter
[m[32m+                .check_limit(&user_id, "backtesting.run")
[m[32m+                .await?
[m[32m+            {
[m                 user_results.2 += 1;
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:961:
[31m-        
[m[32m+
[m         results.push(user_results);
[31m-        
[m[32m+
[m         if user_idx % 3 == 0 {
[31m-            println!("  User {} results: trade={}, config={}, backtest={}",
[m[31m-                     user_idx, user_results.0, user_results.1, user_results.2);
[m[32m+            println!(
[m[32m+                "  User {} results: trade={}, config={}, backtest={}",
[m[32m+                user_idx, user_results.0, user_results.1, user_results.2
[m[32m+            );
[m         }
     }
[31m-    
[m[32m+
[m     // Verify all users got similar treatment
     let avg_trading: usize = results.iter().map(|(t, _, _)| t).sum::<usize>() / 10;
     println!("  Average trading per user: {}", avg_trading);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:973:
[31m-    
[m[32m+
[m     assert!(avg_trading >= 15, "Users should get consistent limits");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:979:
 #[tokio::test]
 async fn test_cache_redis_consistency() -> Result<()> {
     println!("\n=== Test: Cache-Redis Consistency ===");
[31m-    
[m[32m+
[m     let limiter1 = RateLimiter::new(REDIS_URL).await?;
     let limiter2 = RateLimiter::new(REDIS_URL).await?;
[31m-    
[m[32m+
[m     let user_id = Uuid::new_v4();
[31m-    
[m[32m+
[m     // Instance 1 makes requests (populates its cache)
     let mut count1 = 0;
     for _ in 0..10 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:992:
             count1 += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  Instance 1 allowed: {}", count1);
[31m-    
[m[32m+
[m     // Instance 2 makes requests (separate cache, shared Redis)
     let mut count2 = 0;
     for _ in 0..10 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_comprehensive.rs:1002:
             count2 += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  Instance 2 allowed: {}", count2);
     println!("  Total: {}", count1 + count2);
[31m-    
[m[32m+
[m     // Combined total should respect Redis state (10 capacity)
     assert!(count1 + count2 <= 12, "Combined should not exceed capacity");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:33:
 ) -> Result<(String, String)> {
     let config = TestJwtConfig::default();
     let jti = Jti::new();
[31m-    
[m[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m 
[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m[32m+
[m     let claims = JwtClaims {
         jti: jti.0.clone(),
         sub: user_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:64:
 /// Generate an expired JWT token for testing
 pub fn generate_expired_token(user_id: &str) -> Result<String> {
     let config = TestJwtConfig::default();
[31m-    
[m[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m 
[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m[32m+
[m     let claims = JwtClaims {
         jti: Jti::new().0,
         sub: user_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:94:
 
 /// Generate a token with invalid signature
 pub fn generate_invalid_signature_token(user_id: &str) -> Result<String> {
[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m 
     let claims = JwtClaims {
         jti: Jti::new().0,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:134:
                             println!("✓ Redis ready after {} attempts", attempt);
                             return Ok(());
                         }
[31m-                    }
[m[32m+                    },
[m                     Err(e) => {
                         if attempt == max_attempts {
                             return Err(anyhow::anyhow!("Redis not ready: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:141:
                         }
                         tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
[31m-                    }
[m[32m+                    },
[m                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 if attempt == max_attempts {
                     return Err(anyhow::anyhow!("Failed to create Redis client: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:149:
                 }
                 tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:155:
[31m-    Err(anyhow::anyhow!("Redis not ready after {} attempts", max_attempts))
[m[32m+    Err(anyhow::anyhow!(
[m[32m+        "Redis not ready after {} attempts",
[m[32m+        max_attempts
[m[32m+    ))
[m }
 
 /// Clean up Redis test data
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:159:
 pub async fn cleanup_redis(redis_url: &str) -> Result<()> {
[31m-    
[m[31m-    
[m     let client = redis::Client::open(redis_url)?;
     let mut conn = client.get_multiplexed_async_connection().await?;
[31m-    
[m[32m+
[m     // Delete all keys matching test patterns
     let _: () = redis::cmd("FLUSHDB").query_async(&mut conn).await?;
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:12:
 use anyhow::Result;
 use std::time::{Duration, Instant};
 
[31m-use api_gateway::auth::{RateLimiter};
[m[32m+use api_gateway::auth::RateLimiter;
[m 
 const REDIS_URL: &str = "redis://localhost:6380";
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:19:
 #[tokio::test]
 async fn test_rate_limiter_basic() -> Result<()> {
     println!("\n=== Test: Rate Limiter Basic Functionality ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(10).expect("Failed to create rate limiter"); // 10 requests per second
[31m-    
[m[32m+
[m     let mut allowed_count = 0;
     let mut denied_count = 0;
[31m-    
[m[32m+
[m     // Make 15 requests
     for i in 1..=15 {
         if rate_limiter.check_rate_limit("user_basic") {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:36:
             }
         }
     }
[31m-    
[m[32m+
[m     println!("  Allowed: {}, Denied: {}", allowed_count, denied_count);
[31m-    
[m[32m+
[m     assert!(allowed_count <= 10, "Should allow at most 10 requests");
     assert!(denied_count > 0, "Should deny some requests after limit");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:48:
 #[tokio::test]
 async fn test_rate_limiter_per_user() -> Result<()> {
     println!("\n=== Test: Per-User Rate Limiting ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(5).expect("Failed to create rate limiter"); // 5 requests per second per user
[31m-    
[m[32m+
[m     // User 1 makes 7 requests
     let mut user1_allowed = 0;
     for _ in 1..=7 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:58:
             user1_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     // User 2 makes 7 requests
     let mut user2_allowed = 0;
     for _ in 1..=7 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:66:
             user2_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  User 1 allowed: {}", user1_allowed);
     println!("  User 2 allowed: {}", user2_allowed);
[31m-    
[m[32m+
[m     // Each user should be rate limited independently
     assert!(user1_allowed <= 5, "User 1 should be limited to 5 requests");
     assert!(user2_allowed <= 5, "User 2 should be limited to 5 requests");
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:76:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:80:
 #[tokio::test]
 async fn test_rate_limiter_concurrent_requests() -> Result<()> {
     println!("\n=== Test: Concurrent Rate Limiting ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(100).expect("Failed to create rate limiter"); // 100 requests per second
[31m-    
[m[32m+
[m     // Spawn 200 concurrent requests for same user
     let mut handles = Vec::new();
[31m-    
[m[32m+
[m     println!("  Spawning 200 concurrent requests...");
     for _ in 0..200 {
         let limiter = rate_limiter.clone();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:92:
[31m-        let handle = tokio::spawn(async move {
[m[31m-            limiter.check_rate_limit("concurrent_user")
[m[31m-        });
[m[32m+        let handle = tokio::spawn(async move { limiter.check_rate_limit("concurrent_user") });
[m         handles.push(handle);
     }
[31m-    
[m[32m+
[m     // Collect results
     let mut allowed_count = 0;
     for handle in handles {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:104:
             }
         }
     }
[31m-    
[m[32m+
[m     println!("  ✓ {}/200 concurrent requests allowed", allowed_count);
[31m-    
[m[32m+
[m     // Should allow around 100 requests (may vary slightly due to timing)
     assert!(allowed_count >= 90, "Should allow at least 90 requests");
[31m-    assert!(allowed_count <= 110, "Should not allow more than 110 requests");
[m[31m-    
[m[32m+    assert!(
[m[32m+        allowed_count <= 110,
[m[32m+        "Should not allow more than 110 requests"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:117:
 #[tokio::test]
 async fn test_rate_limiter_performance() -> Result<()> {
     println!("\n=== Test: Rate Limiter Performance (<50ns target) ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(1000000).expect("Failed to create rate limiter"); // Very high limit for perf testing
[31m-    
[m[32m+
[m     let mut latencies = Vec::new();
[31m-    
[m[32m+
[m     // Perform 1000 rate limit checks
     println!("  Running 1000 rate limit checks...");
     for _ in 0..1000 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:130:
         let elapsed = start.elapsed();
         latencies.push(elapsed);
     }
[31m-    
[m[32m+
[m     // Calculate percentiles
     latencies.sort();
     let p50 = latencies[499];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:137:
     let p95 = latencies[949];
     let p99 = latencies[989];
     let p999 = latencies[999];
[31m-    
[m[32m+
[m     println!("\n  Performance Metrics:");
     println!("  ├─ P50:   {:?}", p50);
     println!("  ├─ P95:   {:?}", p95);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:144:
     println!("  ├─ P99:   {:?}", p99);
     println!("  └─ P99.9: {:?}", p999);
[31m-    
[m[32m+
[m     println!("\n  Target: <50ns per check");
[31m-    
[m[32m+
[m     if p99 > Duration::from_nanos(50) {
         println!("  ⚠ WARNING: P99 latency {:?} exceeds 50ns target", p99);
     } else {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:152:
         println!("  ✓ P99 latency within 50ns target");
     }
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:158:
 #[tokio::test]
 async fn test_rate_limiter_reset_behavior() -> Result<()> {
     println!("\n=== Test: Rate Limiter Reset Behavior ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(5).expect("Failed to create rate limiter"); // 5 requests per second
[31m-    
[m[32m+
[m     // Exhaust rate limit
     let mut initial_allowed = 0;
     for _ in 1..=10 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:168:
             initial_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  Initial requests allowed: {}", initial_allowed);
     assert!(initial_allowed <= 5, "Should be limited to 5 requests");
[31m-    
[m[32m+
[m     // Wait for rate limiter window to reset (1 second)
     println!("  Waiting 1.1s for rate limit window to reset...");
     tokio::time::sleep(Duration::from_millis(1100)).await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:178:
[31m-    
[m[32m+
[m     // Try again after reset
     let mut post_reset_allowed = 0;
     for _ in 1..=10 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:183:
             post_reset_allowed += 1;
         }
     }
[31m-    
[m[32m+
[m     println!("  Post-reset requests allowed: {}", post_reset_allowed);
     assert!(post_reset_allowed > 0, "Should allow requests after reset");
[31m-    assert!(post_reset_allowed <= 5, "Should still enforce limit after reset");
[m[31m-    
[m[32m+    assert!(
[m[32m+        post_reset_allowed <= 5,
[m[32m+        "Should still enforce limit after reset"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:194:
 #[tokio::test]
 async fn test_rate_limiter_multiple_users() -> Result<()> {
     println!("\n=== Test: Multiple Users Rate Limiting ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(10).expect("Failed to create rate limiter"); // 10 requests per second per user
[31m-    
[m[32m+
[m     // 10 different users make 15 requests each
     let mut user_results = Vec::new();
[31m-    
[m[32m+
[m     for user_id in 1..=10 {
         let mut allowed = 0;
         for _ in 1..=15 {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:209:
         }
         user_results.push(allowed);
     }
[31m-    
[m[32m+
[m     println!("  User results: {:?}", user_results);
[31m-    
[m[32m+
[m     // Each user should be limited independently
     for (i, &allowed) in user_results.iter().enumerate() {
         assert!(
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:221:
             allowed
         );
     }
[31m-    
[m[32m+
[m     println!("  ✓ All 10 users independently rate limited");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:230:
 #[tokio::test]
 async fn test_rate_limiter_burst_handling() -> Result<()> {
     println!("\n=== Test: Burst Request Handling ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(50).expect("Failed to create rate limiter"); // 50 requests per second
[31m-    
[m[32m+
[m     // Send 100 requests as fast as possible (burst)
     let start = Instant::now();
     let mut burst_allowed = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:239:
[31m-    
[m[32m+
[m     for _ in 0..100 {
         if rate_limiter.check_rate_limit("burst_user") {
             burst_allowed += 1;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:243:
         }
     }
[31m-    
[m[32m+
[m     let burst_duration = start.elapsed();
[31m-    
[m[31m-    println!("  Burst allowed: {} requests in {:?}", burst_allowed, burst_duration);
[m[31m-    
[m[32m+
[m[32m+    println!(
[m[32m+        "  Burst allowed: {} requests in {:?}",
[m[32m+        burst_allowed, burst_duration
[m[32m+    );
[m[32m+
[m     assert!(burst_allowed <= 50, "Should limit burst to 50 requests");
[31m-    assert!(burst_duration < Duration::from_millis(100), "Burst check should be fast");
[m[31m-    
[m[32m+    assert!(
[m[32m+        burst_duration < Duration::from_millis(100),
[m[32m+        "Burst check should be fast"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:256:
 #[tokio::test]
 async fn test_rate_limiter_edge_cases() -> Result<()> {
     println!("\n=== Test: Rate Limiter Edge Cases ===");
[31m-    
[m[32m+
[m     // Test with very low limit
     let low_limit = RateLimiter::new(1).expect("Failed to create rate limiter");
     let mut low_allowed = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:288:
         }
     }
     println!("  Empty user ID: {} allowed", empty_allowed);
[31m-    assert!(empty_allowed <= 5, "Should still enforce limit for empty user ID");
[m[31m-    
[m[32m+    assert!(
[m[32m+        empty_allowed <= 5,
[m[32m+        "Should still enforce limit for empty user ID"
[m[32m+    );
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:296:
 #[tokio::test]
 async fn test_rate_limiter_sustained_load() -> Result<()> {
     println!("\n=== Test: Sustained Load Rate Limiting ===");
[31m-    
[m[32m+
[m     let rate_limiter = RateLimiter::new(100).expect("Failed to create rate limiter"); // 100 requests per second
[31m-    
[m[32m+
[m     let mut total_allowed = 0;
     let start = Instant::now();
[31m-    
[m[32m+
[m     // Simulate sustained load for 2 seconds
     while start.elapsed() < Duration::from_secs(2) {
         if rate_limiter.check_rate_limit("sustained_user") {
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:310:
         // Small delay to prevent tight loop
         tokio::time::sleep(Duration::from_micros(100)).await;
     }
[31m-    
[m[32m+
[m     let actual_duration = start.elapsed();
     let requests_per_second = (total_allowed as f64) / actual_duration.as_secs_f64();
[31m-    
[m[31m-    println!("  Total allowed: {} requests over {:?}", total_allowed, actual_duration);
[m[32m+
[m[32m+    println!(
[m[32m+        "  Total allowed: {} requests over {:?}",
[m[32m+        total_allowed, actual_duration
[m[32m+    );
[m     println!("  Effective rate: {:.2} req/s", requests_per_second);
[31m-    
[m[32m+
[m     // Should be close to 200 requests (100/s * 2s), allowing for some variance
     assert!(
         total_allowed >= 180 && total_allowed <= 220,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/rate_limiting_tests.rs:323:
         "Sustained rate should be around 200 requests (got {})",
         total_allowed
     );
[31m-    
[m[32m+
[m     Ok(())
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:33:
 ) -> Result<(String, String)> {
     let config = TestJwtConfig::default();
     let jti = Jti::new();
[31m-    
[m[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m 
[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m[32m+
[m     let claims = JwtClaims {
         jti: jti.0.clone(),
         sub: user_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:64:
 /// Generate an expired JWT token for testing
 pub fn generate_expired_token(user_id: &str) -> Result<String> {
     let config = TestJwtConfig::default();
[31m-    
[m[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m 
[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m[32m+
[m     let claims = JwtClaims {
         jti: Jti::new().0,
         sub: user_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:94:
 
 /// Generate a token with invalid signature
 pub fn generate_invalid_signature_token(user_id: &str) -> Result<String> {
[31m-    let now = SystemTime::now()
[m[31m-        .duration_since(UNIX_EPOCH)?
[m[31m-        .as_secs();
[m[32m+    let now = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
[m 
     let claims = JwtClaims {
         jti: Jti::new().0,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:134:
                             println!("✓ Redis ready after {} attempts", attempt);
                             return Ok(());
                         }
[31m-                    }
[m[32m+                    },
[m                     Err(e) => {
                         if attempt == max_attempts {
                             return Err(anyhow::anyhow!("Redis not ready: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:141:
                         }
                         tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
[31m-                    }
[m[32m+                    },
[m                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 if attempt == max_attempts {
                     return Err(anyhow::anyhow!("Failed to create Redis client: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:149:
                 }
                 tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:155:
[31m-    Err(anyhow::anyhow!("Redis not ready after {} attempts", max_attempts))
[m[32m+    Err(anyhow::anyhow!(
[m[32m+        "Redis not ready after {} attempts",
[m[32m+        max_attempts
[m[32m+    ))
[m }
 
 /// Clean up Redis test data
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/common/mod.rs:159:
 pub async fn cleanup_redis(redis_url: &str) -> Result<()> {
[31m-    
[m[31m-    
[m     let client = redis::Client::open(redis_url)?;
     let mut conn = client.get_multiplexed_async_connection().await?;
[31m-    
[m[32m+
[m     // Delete all keys matching test patterns
     let _: () = redis::cmd("FLUSHDB").query_async(&mut conn).await?;
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:15:
 #[tokio::test]
 async fn test_ml_training_proxy_config() -> Result<()> {
     println!("\n=== Test: ML Training Proxy Configuration ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let config = MlTrainingBackendConfig::default();
[31m-    
[m[32m+
[m     println!("  Default configuration:");
     println!("  ├─ Address: {}", config.address);
     println!("  ├─ Connect timeout: {}ms", config.connect_timeout_ms);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:26:
     println!("  ├─ Request timeout: {}ms", config.request_timeout_ms);
     println!("  ├─ CB failures: {}", config.circuit_breaker_failures);
     println!("  └─ CB reset: {}s", config.circuit_breaker_reset_secs);
[31m-    
[m[32m+
[m     assert_eq!(config.address, "http://localhost:50053");
     assert_eq!(config.connect_timeout_ms, 5000);
     assert_eq!(config.request_timeout_ms, 30000);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:33:
     assert_eq!(config.circuit_breaker_failures, 5);
     assert_eq!(config.circuit_breaker_reset_secs, 30);
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:39:
 #[tokio::test]
 async fn test_ml_training_proxy_custom_config() -> Result<()> {
     println!("\n=== Test: ML Training Proxy Custom Configuration ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let config = MlTrainingBackendConfig {
         address: "http://custom-service:9999".to_string(),
         connect_timeout_ms: 1000,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:49:
         circuit_breaker_failures: 3,
         circuit_breaker_reset_secs: 60,
     };
[31m-    
[m[32m+
[m     println!("  Custom configuration:");
     println!("  ├─ Address: {}", config.address);
     println!("  ├─ Connect timeout: {}ms", config.connect_timeout_ms);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:56:
     println!("  ├─ Request timeout: {}ms", config.request_timeout_ms);
     println!("  ├─ CB failures: {}", config.circuit_breaker_failures);
     println!("  └─ CB reset: {}s", config.circuit_breaker_reset_secs);
[31m-    
[m[32m+
[m     assert_eq!(config.address, "http://custom-service:9999");
     assert_eq!(config.connect_timeout_ms, 1000);
     assert_eq!(config.circuit_breaker_failures, 3);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:63:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:67:
 #[tokio::test]
 async fn test_circuit_breaker_config_validation() -> Result<()> {
     println!("\n=== Test: Circuit Breaker Configuration Validation ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let configs = vec![
         (1, 5, "Minimal failure threshold"),
         (5, 10, "Moderate failure threshold"),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:76:
         (10, 30, "High failure threshold"),
     ];
[31m-    
[m[32m+
[m     for (failures, reset_secs, description) in configs {
         let config = MlTrainingBackendConfig {
             circuit_breaker_failures: failures,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:82:
             circuit_breaker_reset_secs: reset_secs,
             ..Default::default()
         };
[31m-        
[m[31m-        println!("  ✓ Valid config: {} (failures={}, reset={}s)",
[m[31m-                 description, config.circuit_breaker_failures, config.circuit_breaker_reset_secs);
[m[31m-        
[m[32m+
[m[32m+        println!(
[m[32m+            "  ✓ Valid config: {} (failures={}, reset={}s)",
[m[32m+            description, config.circuit_breaker_failures, config.circuit_breaker_reset_secs
[m[32m+        );
[m[32m+
[m         assert!(config.circuit_breaker_failures > 0);
         assert!(config.circuit_breaker_reset_secs > 0);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:92:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:96:
 #[tokio::test]
 async fn test_connection_timeout_behavior() -> Result<()> {
     println!("\n=== Test: Connection Timeout Behavior ===");
[31m-    
[m[31m-    use api_gateway::grpc::server::{MlTrainingBackendConfig, setup_ml_training_client};
[m[31m-    
[m[32m+
[m[32m+    use api_gateway::grpc::server::{setup_ml_training_client, MlTrainingBackendConfig};
[m[32m+
[m     // Test with invalid address (should timeout)
     let config = MlTrainingBackendConfig {
         address: "http://non-existent-service:9999".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:105:
         connect_timeout_ms: 100, // Very short timeout
         ..Default::default()
     };
[31m-    
[m[32m+
[m     println!("  Attempting connection to non-existent service...");
     let start = std::time::Instant::now();
     let result = setup_ml_training_client(config).await;
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:112:
     let elapsed = start.elapsed();
[31m-    
[m[32m+
[m     println!("  Connection attempt took: {:?}", elapsed);
[31m-    
[m[31m-    assert!(result.is_err(), "Connection to non-existent service should fail");
[m[32m+
[m     assert!(
[32m+        result.is_err(),
[m[32m+        "Connection to non-existent service should fail"
[m[32m+    );
[m[32m+    assert!(
[m         elapsed < Duration::from_millis(500),
         "Should timeout quickly (within 500ms)"
     );
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:121:
[31m-    
[m[32m+
[m     println!("  ✓ Connection timeout worked correctly");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:127:
 #[tokio::test]
 async fn test_service_proxy_error_handling() -> Result<()> {
     println!("\n=== Test: Service Proxy Error Handling ===");
[31m-    
[m[31m-    use api_gateway::grpc::server::{MlTrainingBackendConfig, setup_ml_training_client};
[m[31m-    
[m[32m+
[m[32m+    use api_gateway::grpc::server::{setup_ml_training_client, MlTrainingBackendConfig};
[m[32m+
[m     let test_cases = vec![
[32m+        ("http://localhost:1", "Connection refused (port 1)"),
[m[32m+        ("http://192.0.2.1:50053", "Network unreachable (TEST-NET-1)"),
[m         (
[31m-            "http://localhost:1",
[m[31m-            "Connection refused (port 1)",
[m[31m-        ),
[m[31m-        (
[m[31m-            "http://192.0.2.1:50053",
[m[31m-            "Network unreachable (TEST-NET-1)",
[m[31m-        ),
[m[31m-        (
[m             "http://10.255.255.1:50053",
             "Connection timeout (non-routable)",
         ),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:146:
     ];
[31m-    
[m[32m+
[m     for (address, description) in test_cases {
         let config = MlTrainingBackendConfig {
             address: address.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:151:
             connect_timeout_ms: 100,
             ..Default::default()
         };
[31m-        
[m[32m+
[m         let result = setup_ml_training_client(config).await;
[31m-        
[m[32m+
[m         assert!(result.is_err(), "{} should fail", description);
         println!("  ✓ Handled: {}", description);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:160:
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:164:
 #[tokio::test]
 async fn test_backend_config_serialization() -> Result<()> {
     println!("\n=== Test: Backend Config Serialization ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let config = MlTrainingBackendConfig {
         address: "http://ml-service:50053".to_string(),
         connect_timeout_ms: 2000,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:174:
         circuit_breaker_failures: 3,
         circuit_breaker_reset_secs: 45,
     };
[31m-    
[m[32m+
[m     // Test Debug formatting
     let debug_str = format!("{:?}", config);
     assert!(debug_str.contains("ml-service:50053"));
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:181:
     assert!(debug_str.contains("2000"));
     println!("  ✓ Debug format: {}", debug_str);
[31m-    
[m[32m+
[m     // Test Clone
     let cloned = config.clone();
     assert_eq!(cloned.address, config.address);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:187:
     assert_eq!(cloned.connect_timeout_ms, config.connect_timeout_ms);
     println!("  ✓ Clone works correctly");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:193:
 #[tokio::test]
 async fn test_multiple_backend_configs() -> Result<()> {
     println!("\n=== Test: Multiple Backend Service Configurations ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     // Simulate configurations for different environments
     let dev_config = MlTrainingBackendConfig {
         address: "http://localhost:50053".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:204:
         circuit_breaker_failures: 5,
         circuit_breaker_reset_secs: 30,
     };
[31m-    
[m[32m+
[m     let staging_config = MlTrainingBackendConfig {
         address: "http://ml-training-staging:50053".to_string(),
         connect_timeout_ms: 3000,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:212:
         circuit_breaker_failures: 3,
         circuit_breaker_reset_secs: 60,
     };
[31m-    
[m[32m+
[m     let prod_config = MlTrainingBackendConfig {
         address: "http://ml-training-prod:50053".to_string(),
         connect_timeout_ms: 2000,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:220:
         circuit_breaker_failures: 3,
         circuit_breaker_reset_secs: 120,
     };
[31m-    
[m[32m+
[m     println!("  Development: {}", dev_config.address);
     println!("  Staging: {}", staging_config.address);
     println!("  Production: {}", prod_config.address);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:227:
[31m-    
[m[32m+
[m     // Verify configurations are independent
[31m-    assert_ne!(dev_config.connect_timeout_ms, prod_config.connect_timeout_ms);
[m[31m-    assert_ne!(staging_config.circuit_breaker_reset_secs, prod_config.circuit_breaker_reset_secs);
[m[31m-    
[m[32m+    assert_ne!(
[m[32m+        dev_config.connect_timeout_ms,
[m[32m+        prod_config.connect_timeout_ms
[m[32m+    );
[m[32m+    assert_ne!(
[m[32m+        staging_config.circuit_breaker_reset_secs,
[m[32m+        prod_config.circuit_breaker_reset_secs
[m[32m+    );
[m[32m+
[m     println!("  ✓ Multiple environment configurations validated");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:237:
 #[tokio::test]
 async fn test_proxy_performance_overhead() -> Result<()> {
     println!("\n=== Test: Proxy Configuration Performance ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     let mut config_creation_times = Vec::new();
[31m-    
[m[32m+
[m     // Measure config creation overhead
     for _ in 0..1000 {
         let start = std::time::Instant::now();
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:249:
         let elapsed = start.elapsed();
         config_creation_times.push(elapsed);
     }
[31m-    
[m[32m+
[m     config_creation_times.sort();
     let p50 = config_creation_times[499];
     let p99 = config_creation_times[989];
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:256:
[31m-    
[m[32m+
[m     println!("\n  Config Creation Performance:");
     println!("  ├─ P50: {:?}", p50);
     println!("  └─ P99: {:?}", p99);
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:260:
[31m-    
[m[31m-    assert!(p99 < Duration::from_micros(10), "Config creation should be <10μs");
[m[32m+
[m[32m+    assert!(
[m[32m+        p99 < Duration::from_micros(10),
[m[32m+        "Config creation should be <10μs"
[m[32m+    );
[m     println!("  ✓ Config creation overhead is minimal");
[31m-    
[m[32m+
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:267:
 #[tokio::test]
 async fn test_circuit_breaker_threshold_edge_cases() -> Result<()> {
     println!("\n=== Test: Circuit Breaker Threshold Edge Cases ===");
[31m-    
[m[32m+
[m     use api_gateway::grpc::server::MlTrainingBackendConfig;
[31m-    
[m[32m+
[m     // Test with threshold of 1 (opens after single failure)
     let sensitive_config = MlTrainingBackendConfig {
         circuit_breaker_failures: 1,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:276:
         circuit_breaker_reset_secs: 5,
         ..Default::default()
     };
[31m-    
[m[32m+
[m     println!("  ✓ Sensitive CB (failures=1): Valid");
     assert_eq!(sensitive_config.circuit_breaker_failures, 1);
[31m-    
[m[32m+
[m     // Test with high threshold (tolerates many failures)
     let tolerant_config = MlTrainingBackendConfig {
         circuit_breaker_failures: 100,
Diff in /home/jgrusewski/Work/foxhunt/services/api_gateway/tests/service_proxy_tests.rs:286:
         circuit_breaker_reset_secs: 300,
         ..Default::default()
     };
[31m-    
[m[32m+
[m     println!("  ✓ Tolerant CB (failures=100): Valid");
     assert_eq!(tolerant_config.circuit_breaker_failures, 100);
[31m-    
[m[32m+
[m     Ok(())
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/main.rs:62:
         max_connections: Some(10),
         min_connections: Some(2),
         acquire_timeout_ms: Some(5000),
[31m-        statement_cache_capacity: Some(500),  // Increased from 100 to 500 for better cache hit rate
[m[32m+        statement_cache_capacity: Some(500), // Increased from 100 to 500 for better cache hit rate
[m         enable_logging: Some(false),
     };
 
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/main.rs:118:
         version: env!("CARGO_PKG_VERSION").to_string(),
         settings: serde_json::json!({}),
     }));
[31m-    let tls_config = BacktestingServiceTlsConfig::from_config(&config_manager).await
[m[32m+    let tls_config = BacktestingServiceTlsConfig::from_config(&config_manager)
[m[32m+        .await
[m         .context("Failed to initialize TLS configuration")?;
 
     // Setup gRPC server
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/main.rs:161:
             .initial_stream_window_size(Some(1024 * 1024))  // 1MB
             .initial_connection_window_size(Some(10 * 1024 * 1024))  // 10MB
             .http2_adaptive_window(Some(true))
[31m-            .max_concurrent_streams(Some(10_000));  // Increased from 1,024 to 10,000 for production scale
[m[32m+            .max_concurrent_streams(Some(10_000)); // Increased from 1,024 to 10,000 for production scale
[m     }
 
     // Build server with TLS and HTTP/2 optimizations
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:14:
 use tonic::transport::{Certificate, Identity, ServerTlsConfig};
 use tracing::info;
 
[31m-use x509_parser::prelude::*;
[m use x509_parser::certificate::X509Certificate;
 use x509_parser::extensions::{GeneralName, ParsedExtension};
[32m+use x509_parser::prelude::*;
[m 
 /// TLS configuration for the trading service
 #[derive(Debug, Clone)]
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:114:
         Self::from_files(
             &tls_config.cert_path,
             &tls_config.key_path,
[31m-            tls_config
[m[31m-                .ca_cert_path
[m[31m-                .as_deref()
[m[31m-                .unwrap_or(&ca_cert_path),
[m[32m+            tls_config.ca_cert_path.as_deref().unwrap_or(&ca_cert_path),
[m             true, // Always require mTLS
         )
         .await
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:140:
         let (_, pem) = x509_parser::pem::parse_x509_pem(cert_chain)
             .map_err(|e| anyhow::anyhow!("Failed to parse PEM certificate: {}", e))?;
 
[31m-        let cert = pem.parse_x509()
[m[32m+        let cert = pem
[m[32m+            .parse_x509()
[m             .map_err(|e| anyhow::anyhow!("Failed to parse X.509 certificate: {}", e))?;
 
         // Comprehensive certificate validation
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:148:
 
         tracing::info!(
             "Client certificate validated: CN={}, OU={}",
[31m-            client_identity.common_name, client_identity.organizational_unit
[m[32m+            client_identity.common_name,
[m[32m+            client_identity.organizational_unit
[m         );
 
         Ok(client_identity)
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:155:
     }
 
     /// Extract and validate certificate with comprehensive security checks
[31m-    async fn extract_and_validate_certificate(&self, cert: &X509Certificate<'_>) -> Result<ClientIdentity> {
[m[32m+    async fn extract_and_validate_certificate(
[m[32m+        &self,
[m[32m+        cert: &X509Certificate<'_>,
[m[32m+    ) -> Result<ClientIdentity> {
[m         // SECURITY CHECK 1: Certificate Validity Period (Expiration)
         self.validate_certificate_expiration(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 2: Certificate Purpose (Extended Key Usage)
         self.validate_certificate_purpose(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 3: Certificate Chain of Trust (Basic Constraints)
         self.validate_certificate_constraints(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 4: Critical Extensions Validation
         self.validate_critical_extensions(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 5: Subject Alternative Names (if present)
         self.validate_subject_alternative_names(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 6: Certificate Revocation Status (CRL/OCSP)
         if self.enable_revocation_check {
             self.check_revocation_status(cert).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:177:
         }
[31m-        
[m[32m+
[m         // Extract identity information from Subject DN
         let subject = cert.subject();
[31m-        
[m[32m+
[m         // Extract Common Name (CN)
         let common_name = subject
             .iter_common_name()
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:186:
             .and_then(|cn| cn.as_str().ok())
             .ok_or_else(|| anyhow::anyhow!("Certificate missing Common Name (CN)"))?
             .to_string();
[31m-        
[m[32m+
[m         // Extract Organizational Unit (OU) - required for RBAC
         let organizational_unit = subject
             .iter_organizational_unit()
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:194:
             .and_then(|ou| ou.as_str().ok())
             .ok_or_else(|| anyhow::anyhow!("Certificate missing Organizational Unit (OU)"))?
             .to_string();
[31m-        
[m[32m+
[m         // Extract Serial Number
         let serial_number = format!("{:X}", cert.serial);
[31m-        
[m[32m+
[m         // Extract Issuer CN
[31m-        let issuer = cert.issuer()
[m[32m+        let issuer = cert
[m[32m+            .issuer()
[m             .iter_common_name()
             .next()
             .and_then(|cn| cn.as_str().ok())
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:206:
             .unwrap_or("Unknown Issuer")
             .to_string();
[31m-        
[m[32m+
[m         // SECURITY: Validate organizational unit is in allowed list
         let allowed_ous = ["trading", "admin", "analytics", "risk", "compliance"];
         if !allowed_ous.contains(&organizational_unit.as_str()) {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:212:
             return Err(anyhow::anyhow!(
                 "Organizational Unit '{}' is not authorized for access. Allowed: {:?}",
[31m-                organizational_unit, allowed_ous
[m[32m+                organizational_unit,
[m[32m+                allowed_ous
[m             ));
         }
[31m-        
[m[32m+
[m         // SECURITY: Validate common name format (prevent injection attacks)
[31m-        if !common_name.chars().all(|c| c.is_alphanumeric() || c == '.' || c == '-' || c == '_') {
[m[32m+        if !common_name
[m[32m+            .chars()
[m[32m+            .all(|c| c.is_alphanumeric() || c == '.' || c == '-' || c == '_')
[m[32m+        {
[m             return Err(anyhow::anyhow!(
                 "Common Name contains invalid characters: {}",
                 common_name
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:223:
             ));
         }
[31m-        
[m[32m+
[m         Ok(ClientIdentity {
             common_name,
             organizational_unit,
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:230:
             issuer,
         })
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 1: Validate certificate expiration
     fn validate_certificate_expiration(&self, cert: &X509Certificate<'_>) -> Result<()> {
         let validity = cert.validity();
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:237:
[31m-        
[m[32m+
[m         // Get current time
         let now = std::time::SystemTime::now()
             .duration_since(std::time::UNIX_EPOCH)
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:241:
             .map_err(|e| anyhow::anyhow!("System time error: {}", e))?
             .as_secs() as i64;
[31m-        
[m[32m+
[m         // Check not before
         let not_before = validity.not_before.timestamp();
         if now < not_before {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:249:
                 validity.not_before
             ));
         }
[31m-        
[m[32m+
[m         // Check not after
         let not_after = validity.not_after.timestamp();
         if now > not_after {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:258:
                 validity.not_after
             ));
         }
[31m-        
[m[32m+
[m         // SECURITY: Warn if certificate expires soon (within 30 days)
         let thirty_days_secs = 30 * 24 * 3600;
         if not_after - now < thirty_days_secs {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:265:
             let days_remaining = (not_after - now) / (24 * 3600);
             tracing::warn!(
                 "Certificate expires soon! Days remaining: {}. Expiration: {}",
[31m-                days_remaining, validity.not_after
[m[32m+                days_remaining,
[m[32m+                validity.not_after
[m             );
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 2: Validate certificate purpose via Extended Key Usage
     fn validate_certificate_purpose(&self, cert: &X509Certificate<'_>) -> Result<()> {
         // Look for Extended Key Usage extension
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:278:
         let mut has_client_auth = false;
         let mut has_eku_extension = false;
[31m-        
[m[32m+
[m         for ext in cert.extensions() {
             if let ParsedExtension::ExtendedKeyUsage(eku) = ext.parsed_extension() {
                 has_eku_extension = true;
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:284:
[31m-                
[m[32m+
[m                 // Check for TLS Client Authentication (OID: 1.3.6.1.5.5.7.3.2)
                 has_client_auth = eku.client_auth;
[31m-                
[m[32m+
[m                 if has_client_auth {
                     tracing::debug!("Certificate has TLS Client Authentication purpose");
                 } else {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:295:
                 }
             }
         }
[31m-        
[m[32m+
[m         // SECURITY: Require Extended Key Usage with Client Auth for mTLS
         if has_eku_extension && !has_client_auth {
             return Err(anyhow::anyhow!(
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:302:
                 "Certificate does not have TLS Client Authentication purpose (Extended Key Usage)"
             ));
         }
[31m-        
[m[32m+
[m         // If no EKU extension, we allow it (some CAs don't set this for client certs)
         // but log a warning for security awareness
         if !has_eku_extension {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:310:
                 "Certificate missing Extended Key Usage extension - certificate purpose cannot be verified"
             );
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 3: Validate Basic Constraints (ensure not a CA certificate)
     fn validate_certificate_constraints(&self, cert: &X509Certificate<'_>) -> Result<()> {
         for ext in cert.extensions() {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:324:
                         "Client certificate has CA flag set - this is a CA certificate, not a client certificate"
                     ));
                 }
[31m-                
[m[32m+
[m                 tracing::debug!("Certificate Basic Constraints validated: ca={}", bc.ca);
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:331:
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 4: Validate all critical extensions are recognized
     fn validate_critical_extensions(&self, cert: &X509Certificate<'_>) -> Result<()> {
         // List of recognized critical extensions (OIDs)
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:338:
         let recognized_critical = [
[31m-            "2.5.29.15",  // Key Usage
[m[31m-            "2.5.29.19",  // Basic Constraints
[m[31m-            "2.5.29.37",  // Extended Key Usage
[m[31m-            "2.5.29.17",  // Subject Alternative Name
[m[31m-            "2.5.29.32",  // Certificate Policies
[m[31m-            "2.5.29.35",  // Authority Key Identifier
[m[31m-            "2.5.29.14",  // Subject Key Identifier
[m[32m+            "2.5.29.15", // Key Usage
[m[32m+            "2.5.29.19", // Basic Constraints
[m[32m+            "2.5.29.37", // Extended Key Usage
[m[32m+            "2.5.29.17", // Subject Alternative Name
[m[32m+            "2.5.29.32", // Certificate Policies
[m[32m+            "2.5.29.35", // Authority Key Identifier
[m[32m+            "2.5.29.14", // Subject Key Identifier
[m         ];
[31m-        
[m[32m+
[m         for ext in cert.extensions() {
             if ext.critical {
                 let oid_str = ext.oid.to_id_string();
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:351:
[31m-                
[m[32m+
[m                 // Check if this critical extension is recognized
                 if !recognized_critical.contains(&oid_str.as_str()) {
                     return Err(anyhow::anyhow!(
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:356:
                         oid_str
                     ));
                 }
[31m-                
[m[32m+
[m                 tracing::debug!("Recognized critical extension: {}", oid_str);
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:363:
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 5: Validate Subject Alternative Names (if present)
     fn validate_subject_alternative_names(&self, cert: &X509Certificate<'_>) -> Result<()> {
         for ext in cert.extensions() {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:370:
             if let ParsedExtension::SubjectAlternativeName(san) = ext.parsed_extension() {
                 // Extract and validate SAN entries
                 let mut san_entries = Vec::new();
[31m-                
[m[32m+
[m                 for name in &san.general_names {
                     match name {
                         GeneralName::DNSName(dns) => {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:377:
                             san_entries.push(format!("DNS:{}", dns));
[31m-                            
[m[32m+
[m                             // SECURITY: Validate DNS name format
                             if !Self::is_valid_dns_name(dns) {
                                 return Err(anyhow::anyhow!(
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:395:
                         },
                         _ => {
                             tracing::debug!("Other SAN type: {:?}", name);
[31m-                        }
[m[32m+                        },
[m                     }
                 }
[31m-                
[m[32m+
[m                 if !san_entries.is_empty() {
                     tracing::debug!("Certificate Subject Alternative Names: {:?}", san_entries);
                 }
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:405:
             }
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Validate DNS name format (prevent injection attacks)
     fn is_valid_dns_name(name: &str) -> bool {
         // DNS name validation: alphanumeric, dots, hyphens, underscores
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:415:
         if name.is_empty() || name.len() > 253 {
             return false;
         }
[31m-        
[m[32m+
[m         for label in name.split('.') {
             if label.is_empty() || label.len() > 63 {
                 return false;
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:422:
             }
[31m-            
[m[32m+
[m             // Check valid characters: alphanumeric, hyphen, underscore
             // Cannot start or end with hyphen
[31m-            if !label.chars().all(|c| c.is_alphanumeric() || c == '-' || c == '_') {
[m[32m+            if !label
[m[32m+                .chars()
[m[32m+                .all(|c| c.is_alphanumeric() || c == '-' || c == '_')
[m[32m+            {
[m                 return false;
             }
[31m-            
[m[32m+
[m             if label.starts_with('-') || label.ends_with('-') {
                 return false;
             }
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:433:
         }
[31m-        
[m[32m+
[m         true
     }
[31m-    
[m[32m+
[m     /// Validate certificate chain of trust against CA certificate
     /// This validates the certificate signature against the CA's public key
     pub fn validate_certificate_chain(&self, client_cert_pem: &[u8]) -> Result<()> {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:441:
         // Parse client certificate
         let (_, client_pem) = x509_parser::pem::parse_x509_pem(client_cert_pem)
             .map_err(|e| anyhow::anyhow!("Failed to parse client certificate PEM: {}", e))?;
[31m-        
[m[31m-        let client_cert = client_pem.parse_x509()
[m[32m+
[m[32m+        let client_cert = client_pem
[m[32m+            .parse_x509()
[m             .map_err(|e| anyhow::anyhow!("Failed to parse client X.509 certificate: {}", e))?;
[31m-        
[m[32m+
[m         // In a production system, you would:
         // 1. Parse the CA certificate from self.ca_certificate
         // 2. Extract the CA's public key
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:451:
         // 3. Verify the client certificate's signature using the CA public key
         // 4. Check that the client certificate's issuer matches the CA's subject
[31m-        
[m[32m+
[m         // For now, we perform basic issuer checks
[31m-        let client_issuer = client_cert.issuer()
[m[32m+        let client_issuer = client_cert
[m[32m+            .issuer()
[m             .iter_common_name()
             .next()
             .and_then(|cn| cn.as_str().ok())
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:459:
             .ok_or_else(|| anyhow::anyhow!("Client certificate missing issuer CN"))?;
[31m-        
[m[32m+
[m         tracing::debug!("Client certificate issued by: {}", client_issuer);
[31m-        
[m[32m+
[m         // TODO: Implement full signature verification using ring or rustls crate
         // This would involve:
         // - Parsing CA certificate public key
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:466:
         // - Extracting signature algorithm from client cert
         // - Verifying signature matches
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 6: Check certificate revocation status via CRL or OCSP
     async fn check_revocation_status(&self, cert: &X509Certificate<'_>) -> Result<()> {
         // Check if certificate has CRL Distribution Points or OCSP extensions
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:475:
         let mut crl_urls: Vec<String> = Vec::new();
         let ocsp_urls: Vec<String> = Vec::new();
[31m-        
[m[32m+
[m         for ext in cert.extensions() {
             // Check for CRL Distribution Points (OID: 2.5.29.31)
             if ext.oid.to_id_string() == "2.5.29.31" {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:481:
                 // Parse CRL Distribution Points
                 // This is a simplified extraction - full implementation would parse the ASN.1 structure
                 tracing::debug!("Certificate has CRL Distribution Points extension");
[31m-                
[m[32m+
[m                 // Add configured CRL URL if available
                 if let Some(ref url) = self.crl_url {
                     crl_urls.push(url.clone());
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:488:
                 }
             }
[31m-            
[m[32m+
[m             // Check for Authority Information Access (OID: 1.3.6.1.5.5.7.1.1) for OCSP
             if ext.oid.to_id_string() == "1.3.6.1.5.5.7.1.1" {
                 tracing::debug!("Certificate has Authority Information Access extension (OCSP)");
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:494:
                 // OCSP URL extraction would go here
             }
         }
[31m-        
[m[32m+
[m         // Perform CRL check if URLs are available
         if !crl_urls.is_empty() {
             for crl_url in &crl_urls {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:512:
                     Err(e) => {
                         tracing::warn!("CRL check failed for {}: {}", crl_url, e);
                         // Continue to next CRL URL or OCSP
[31m-                    }
[m[32m+                    },
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:519:
[31m-        
[m[32m+
[m         // Perform OCSP check if URLs are available and CRL failed
         if !ocsp_urls.is_empty() {
             for ocsp_url in &ocsp_urls {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:533:
                     },
                     Err(e) => {
                         tracing::warn!("OCSP check failed for {}: {}", ocsp_url, e);
[31m-                    }
[m[32m+                    },
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:540:
[31m-        
[m[32m+
[m         // If revocation checking is enabled but no methods succeeded
         if crl_urls.is_empty() && ocsp_urls.is_empty() {
             tracing::warn!(
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:546:
             // In strict mode, this would be an error
             // For now, we allow it with a warning
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Check certificate against CRL (Certificate Revocation List)
[31m-    async fn check_crl_revocation(&self, cert: &X509Certificate<'_>, crl_url: &str) -> Result<bool> {
[m[32m+    async fn check_crl_revocation(
[m[32m+        &self,
[m[32m+        cert: &X509Certificate<'_>,
[m[32m+        crl_url: &str,
[m[32m+    ) -> Result<bool> {
[m         tracing::debug!("Checking certificate revocation via CRL: {}", crl_url);
[31m-        
[m[32m+
[m         // Download CRL from URL
         let client = reqwest::Client::builder()
             .timeout(std::time::Duration::from_secs(10))
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:560:
             .build()
             .context("Failed to create HTTP client for CRL download")?;
[31m-        
[m[31m-        let crl_response = client.get(crl_url)
[m[32m+
[m[32m+        let crl_response = client
[m[32m+            .get(crl_url)
[m             .send()
             .await
             .context("Failed to download CRL")?;
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:567:
[31m-        
[m[31m-        let crl_bytes = crl_response.bytes()
[m[32m+
[m[32m+        let crl_bytes = crl_response
[m[32m+            .bytes()
[m             .await
             .context("Failed to read CRL response")?;
[31m-        
[m[32m+
[m         // Parse CRL
[31m-        let (_, crl) = x509_parser::revocation_list::CertificateRevocationList::from_der(&crl_bytes)
[m[31m-            .map_err(|e| anyhow::anyhow!("Failed to parse CRL: {}", e))?;
[m[31m-        
[m[32m+        let (_, crl) =
[m[32m+            x509_parser::revocation_list::CertificateRevocationList::from_der(&crl_bytes)
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to parse CRL: {}", e))?;
[m[32m+
[m         // Check if certificate serial number is in revoked list
         for revoked_cert in crl.iter_revoked_certificates() {
             if revoked_cert.raw_serial() == cert.raw_serial() {
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:584:
                 return Ok(true); // Certificate is revoked
             }
         }
[31m-        
[m[32m+
[m         Ok(false) // Certificate not found in CRL, not revoked
     }
[31m-    
[m[32m+
[m     /// Check certificate via OCSP (Online Certificate Status Protocol)
[31m-    async fn check_ocsp_revocation(&self, _cert: &X509Certificate<'_>, ocsp_url: &str) -> Result<bool> {
[m[32m+    async fn check_ocsp_revocation(
[m[32m+        &self,
[m[32m+        _cert: &X509Certificate<'_>,
[m[32m+        ocsp_url: &str,
[m[32m+    ) -> Result<bool> {
[m         tracing::debug!("Checking certificate revocation via OCSP: {}", ocsp_url);
[31m-        
[m[32m+
[m         // TODO: Implement OCSP checking
         // This requires building OCSP requests and parsing responses
         // Consider using the 'ocsp' crate or implementing RFC 6960
Diff in /home/jgrusewski/Work/foxhunt/services/backtesting_service/src/tls_config.rs:598:
[31m-        
[m[32m+
[m         Err(anyhow::anyhow!("OCSP checking not yet implemented"))
     }
 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_config.rs:283:
             .parse()
             .context("Invalid DATA_SOURCE_TYPE")?;
 
[31m-        info!(
[m[31m-            "Configuring training data source: {:?}",
[m[31m-            source_type
[m[31m-        );
[m[32m+        info!("Configuring training data source: {:?}", source_type);
[m 
         let database = if matches!(
             source_type,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_config.rs:351:
 
     /// Load S3 configuration from environment
     fn load_s3_config() -> Result<S3Config> {
[31m-        let bucket = env::var("S3_BUCKET")
[m[31m-            .context("S3_BUCKET must be set for Parquet data source")?;
[m[32m+        let bucket =
[m[32m+            env::var("S3_BUCKET").context("S3_BUCKET must be set for Parquet data source")?;
[m 
         let region = env::var("S3_REGION").unwrap_or_else(|_| "us-east-1".to_string());
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_config.rs:359:
[31m-        let path_prefix = env::var("S3_PATH_PREFIX")
[m[31m-            .unwrap_or_else(|_| "training-data/features/".to_string());
[m[32m+        let path_prefix =
[m[32m+            env::var("S3_PATH_PREFIX").unwrap_or_else(|_| "training-data/features/".to_string());
[m 
[31m-        let file_pattern = env::var("S3_FILE_PATTERN")
[m[31m-            .unwrap_or_else(|_| "features-*.parquet".to_string());
[m[32m+        let file_pattern =
[m[32m+            env::var("S3_FILE_PATTERN").unwrap_or_else(|_| "features-*.parquet".to_string());
[m 
[31m-        let credentials_source = env::var("AWS_CREDENTIALS_SOURCE")
[m[31m-            .unwrap_or_else(|_| "iam_role".to_string());
[m[32m+        let credentials_source =
[m[32m+            env::var("AWS_CREDENTIALS_SOURCE").unwrap_or_else(|_| "iam_role".to_string());
[m 
         debug!("S3 config: s3://{}/{}", bucket, path_prefix);
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_config.rs:440:
             config.normalization = normalization;
         }
 
[31m-        debug!("Feature config: {:?} indicators, TLOB={}, normalization={}",
[m[32m+        debug!(
[m[32m+            "Feature config: {:?} indicators, TLOB={}, normalization={}",
[m             config.technical_indicators.len(),
             config.enable_tlob,
             config.normalization
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_config.rs:454:
         match self.source_type {
             DataSourceType::Historical | DataSourceType::Hybrid => {
                 if self.database.is_none() {
[31m-                    anyhow::bail!("Database configuration required for {:?} source", self.source_type);
[m[32m+                    anyhow::bail!(
[m[32m+                        "Database configuration required for {:?} source",
[m[32m+                        self.source_type
[m[32m+                    );
[m                 }
[31m-            }
[m[32m+            },
[m             DataSourceType::Parquet => {
                 if self.s3.is_none() {
                     anyhow::bail!("S3 configuration required for Parquet source");
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_config.rs:463:
                 }
[31m-            }
[m[32m+            },
[m             DataSourceType::RealTime => {
                 warn!("RealTime data source requires active trading session");
[31m-            }
[m[32m+            },
[m         }
 
         if self.time_range.train_split < 0.0 || self.time_range.train_split > 1.0 {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_config.rs:489:
         let mut summary = HashMap::new();
         summary.insert("source_type".to_string(), format!("{:?}", self.source_type));
         summary.insert("symbols_count".to_string(), self.symbols.len().to_string());
[31m-        summary.insert("train_split".to_string(), self.time_range.train_split.to_string());
[m[32m+        summary.insert(
[m[32m+            "train_split".to_string(),
[m[32m+            self.time_range.train_split.to_string(),
[m[32m+        );
[m 
         if let Some(days) = self.time_range.duration_days {
             summary.insert("duration_days".to_string(), days.to_string());
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:33:
 
 use crate::data_config::{DatabaseConfig, TrainingDataSourceConfig};
 use crate::schema_types::{MarketEvent, OrderBookSnapshot, TradeExecution};
[31m-use crate::technical_indicators::{TechnicalIndicatorCalculator, IndicatorConfig};
[m[32m+use crate::technical_indicators::{IndicatorConfig, TechnicalIndicatorCalculator};
[m use common::Price;
 use ml::training_pipeline::{FinancialFeatures, MicrostructureFeatures, RiskFeatures};
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:134:
             return -0.03; // Default: -3% if insufficient data
         }
 
[31m-        let tail_returns: Vec<f64> = returns.iter()
[m[31m-            .filter(|&&r| r <= var)
[m[31m-            .copied()
[m[31m-            .collect();
[m[32m+        let tail_returns: Vec<f64> = returns.iter().filter(|&&r| r <= var).copied().collect();
[m 
         if tail_returns.is_empty() {
             return var; // If no tail, ES equals VaR
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:182:
 
         let mean_return = returns.iter().sum::<f64>() / returns.len() as f64;
 
[31m-        let variance = returns.iter()
[m[32m+        let variance = returns
[m[32m+            .iter()
[m             .map(|r| (r - mean_return).powi(2))
[31m-            .sum::<f64>() / returns.len() as f64;
[m[32m+            .sum::<f64>()
[m[32m+            / returns.len() as f64;
[m 
         let std_dev = variance.sqrt();
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:255:
     min: f64,
     max: f64,
     median: f64,
[31m-    q1: f64,  // 25th percentile
[m[31m-    q3: f64,  // 75th percentile
[m[32m+    q1: f64, // 25th percentile
[m[32m+    q3: f64, // 75th percentile
[m }
 
 /// Complete normalization parameters for all features
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:280:
             return Self::default();
         }
 
[31m-        let valid_values: Vec<f64> = values.iter()
[m[31m-            .filter(|v| v.is_finite())
[m[31m-            .copied()
[m[31m-            .collect();
[m[32m+        let valid_values: Vec<f64> = values.iter().filter(|v| v.is_finite()).copied().collect();
[m 
         if valid_values.is_empty() {
             return Self::default();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:291:
 
         // Calculate mean and std dev
         let mean = valid_values.iter().sum::<f64>() / valid_values.len() as f64;
[31m-        let variance = valid_values.iter()
[m[31m-            .map(|v| (v - mean).powi(2))
[m[31m-            .sum::<f64>() / valid_values.len() as f64;
[m[32m+        let variance = valid_values.iter().map(|v| (v - mean).powi(2)).sum::<f64>()
[m[32m+            / valid_values.len() as f64;
[m         let std_dev = variance.sqrt();
 
         // Calculate min and max
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:300:
[31m-        let min = valid_values.iter()
[m[31m-            .fold(f64::INFINITY, |a, &b| a.min(b));
[m[31m-        let max = valid_values.iter()
[m[32m+        let min = valid_values.iter().fold(f64::INFINITY, |a, &b| a.min(b));
[m[32m+        let max = valid_values
[m[32m+            .iter()
[m             .fold(f64::NEG_INFINITY, |a, &b| a.max(b));
 
         // Calculate median and quartiles
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:346:
                 } else {
                     (value - self.mean) / self.std_dev
                 }
[31m-            }
[m[32m+            },
[m             NormalizationMethod::MinMax => {
                 let range = self.max - self.min;
                 if range < 1e-10 {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:354:
                 } else {
                     (value - self.min) / range
                 }
[31m-            }
[m[32m+            },
[m             NormalizationMethod::Robust => {
                 let iqr = self.q3 - self.q1;
                 if iqr < 1e-10 {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:362:
                 } else {
                     (value - self.median) / iqr
                 }
[31m-            }
[m[32m+            },
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:415:
     /// - Database connection fails
     /// - Connection pool cannot be created
     pub async fn new(config: TrainingDataSourceConfig) -> Result<Self> {
[31m-        let database_config = config
[m[31m-            .database
[m[31m-            .as_ref()
[m[31m-            .ok_or_else(|| anyhow::anyhow!("Database configuration required for historical data"))?;
[m[32m+        let database_config = config.database.as_ref().ok_or_else(|| {
[m[32m+            anyhow::anyhow!("Database configuration required for historical data")
[m[32m+        })?;
[m 
[31m-        info!("Connecting to database: {}", Self::sanitize_connection_url(&database_config.connection_url));
[m[32m+        info!(
[m[32m+            "Connecting to database: {}",
[m[32m+            Self::sanitize_connection_url(&database_config.connection_url)
[m[32m+        );
[m 
         let pool = Self::create_connection_pool(database_config).await?;
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:438:
     async fn create_connection_pool(database_config: &DatabaseConfig) -> Result<PgPool> {
         let pool = sqlx::postgres::PgPoolOptions::new()
             .max_connections(database_config.max_connections)
[31m-            .acquire_timeout(std::time::Duration::from_secs(database_config.query_timeout_secs))
[m[32m+            .acquire_timeout(std::time::Duration::from_secs(
[m[32m+                database_config.query_timeout_secs,
[m[32m+            ))
[m             .connect(&database_config.connection_url)
             .await
             .context("Failed to create database connection pool")?;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:477:
     /// - Data validation fails
     pub async fn load_training_data(
         &mut self,
[31m-    ) -> Result<(Vec<(FinancialFeatures, Vec<f64>)>, Vec<(FinancialFeatures, Vec<f64>)>)> {
[m[32m+    ) -> Result<(
[m[32m+        Vec<(FinancialFeatures, Vec<f64>)>,
[m[32m+        Vec<(FinancialFeatures, Vec<f64>)>,
[m[32m+    )> {
[m         info!("Starting training data load from database");
 
         // Step 1: Load raw data from database tables
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:496:
         self.validate_data_quality(&order_book_data, &trade_data)?;
 
         // Step 3: Convert to FinancialFeatures with targets
[31m-        let all_features = self.convert_to_features_with_targets(order_book_data, trade_data, market_events)?;
[m[32m+        let all_features =
[m[32m+            self.convert_to_features_with_targets(order_book_data, trade_data, market_events)?;
[m 
         info!("Converted to {} feature samples", all_features.len());
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:561:
             )
         };
 
[31m-        let start = time_range.start.unwrap_or_else(|| Utc::now() - chrono::Duration::days(30));
[m[32m+        let start = time_range
[m[32m+            .start
[m[32m+            .unwrap_or_else(|| Utc::now() - chrono::Duration::days(30));
[m         let end = time_range.end.unwrap_or_else(Utc::now);
 
         debug!("Querying order books from {} to {}", start, end);
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:617:
             )
         };
 
[31m-        let start = time_range.start.unwrap_or_else(|| Utc::now() - chrono::Duration::days(30));
[m[32m+        let start = time_range
[m[32m+            .start
[m[32m+            .unwrap_or_else(|| Utc::now() - chrono::Duration::days(30));
[m         let end = time_range.end.unwrap_or_else(Utc::now);
 
         debug!("Querying trades from {} to {}", start, end);
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:671:
             )
         };
 
[31m-        let start = time_range.start.unwrap_or_else(|| Utc::now() - chrono::Duration::days(30));
[m[32m+        let start = time_range
[m[32m+            .start
[m[32m+            .unwrap_or_else(|| Utc::now() - chrono::Duration::days(30));
[m         let end = time_range.end.unwrap_or_else(Utc::now);
 
         debug!("Querying market events from {} to {}", start, end);
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:715:
         }
 
         // Check data quality distribution
[31m-        let high_quality_count = order_book_data.iter().filter(|s| s.is_high_quality()).count();
[m[32m+        let high_quality_count = order_book_data
[m[32m+            .iter()
[m[32m+            .filter(|s| s.is_high_quality())
[m[32m+            .count();
[m         let quality_ratio = high_quality_count as f64 / total_samples as f64;
 
         if quality_ratio < (1.0 - validation.max_missing_ratio) {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:804:
         technical_indicators.insert("imbalance".to_string(), snapshot.imbalance);
 
         // Get or create calculator for this symbol
[31m-        let calculator = self.calculators
[m[32m+        let calculator = self
[m[32m+            .calculators
[m             .entry(snapshot.symbol.clone())
             .or_insert_with(|| {
                 TechnicalIndicatorCalculator::new(
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:838:
         };
 
         // Risk metrics calculated from rolling price history
[31m-        let risk_calc = self.risk_calculators
[m[32m+        let risk_calc = self
[m[32m+            .risk_calculators
[m             .entry(snapshot.symbol.clone())
             .or_insert_with(|| RiskMetricsCalculator::new(100, 0.0));
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:930:
     fn split_train_validation(
         &self,
         mut all_data: Vec<(FinancialFeatures, Vec<f64>)>,
[31m-    ) -> Result<(Vec<(FinancialFeatures, Vec<f64>)>, Vec<(FinancialFeatures, Vec<f64>)>)> {
[m[32m+    ) -> Result<(
[m[32m+        Vec<(FinancialFeatures, Vec<f64>)>,
[m[32m+        Vec<(FinancialFeatures, Vec<f64>)>,
[m[32m+    )> {
[m         let train_split = self.config.time_range.train_split;
         let split_index = (all_data.len() as f64 * train_split) as usize;
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:977:
             };
         }
 
[31m-        info!("Fitting normalization parameters on {} training samples", features_list.len());
[m[32m+        info!(
[m[32m+            "Fitting normalization parameters on {} training samples",
[m[32m+            features_list.len()
[m[32m+        );
[m 
         // Collect all technical indicator keys
         let mut all_indicator_keys: Vec<String> = features_list[0]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:1045:
             .collect();
         let sharpe_params = NormalizationParams::fit(&sharpe_values);
 
[31m-        info!("Fitted normalization parameters for {} technical indicators", all_indicator_keys.len());
[m[32m+        info!(
[m[32m+            "Fitted normalization parameters for {} technical indicators",
[m[32m+            all_indicator_keys.len()
[m[32m+        );
[m 
         FeatureNormalizationParams {
             indicator_params,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:1079:
             return;
         }
 
[31m-        info!("Applying {:?} normalization to {} samples", method, features_list.len());
[m[32m+        info!(
[m[32m+            "Applying {:?} normalization to {} samples",
[m[32m+            method,
[m[32m+            features_list.len()
[m[32m+        );
[m 
         if features_list.is_empty() {
             return;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:1095:
             }
 
             // Normalize microstructure features
[31m-            features.microstructure.imbalance = params.imbalance_params.normalize(
[m[31m-                features.microstructure.imbalance,
[m[31m-                &method,
[m[31m-            );
[m[31m-            features.microstructure.trade_intensity = params.intensity_params.normalize(
[m[31m-                features.microstructure.trade_intensity,
[m[31m-                &method,
[m[31m-            );
[m[32m+            features.microstructure.imbalance = params
[m[32m+                .imbalance_params
[m[32m+                .normalize(features.microstructure.imbalance, &method);
[m[32m+            features.microstructure.trade_intensity = params
[m[32m+                .intensity_params
[m[32m+                .normalize(features.microstructure.trade_intensity, &method);
[m 
             // Note: spread_bps is u16, so we normalize separately if needed
[31m-            let normalized_spread = params.spread_params.normalize(
[m[31m-                features.microstructure.spread_bps as f64,
[m[31m-                &method,
[m[31m-            );
[m[32m+            let normalized_spread = params
[m[32m+                .spread_params
[m[32m+                .normalize(features.microstructure.spread_bps as f64, &method);
[m             // Store in technical_indicators for reference
[31m-            features.technical_indicators.insert(
[m[31m-                "spread_bps_normalized".to_string(),
[m[31m-                normalized_spread,
[m[31m-            );
[m[32m+            features
[m[32m+                .technical_indicators
[m[32m+                .insert("spread_bps_normalized".to_string(), normalized_spread);
[m 
             // Normalize risk metrics
[31m-            features.risk_metrics.var_5pct = params.var_params.normalize(
[m[31m-                features.risk_metrics.var_5pct,
[m[31m-                &method,
[m[31m-            );
[m[31m-            features.risk_metrics.expected_shortfall = params.es_params.normalize(
[m[31m-                features.risk_metrics.expected_shortfall,
[m[31m-                &method,
[m[31m-            );
[m[31m-            features.risk_metrics.max_drawdown = params.dd_params.normalize(
[m[31m-                features.risk_metrics.max_drawdown,
[m[31m-                &method,
[m[31m-            );
[m[31m-            features.risk_metrics.sharpe_ratio = params.sharpe_params.normalize(
[m[31m-                features.risk_metrics.sharpe_ratio,
[m[31m-                &method,
[m[31m-            );
[m[32m+            features.risk_metrics.var_5pct = params
[m[32m+                .var_params
[m[32m+                .normalize(features.risk_metrics.var_5pct, &method);
[m[32m+            features.risk_metrics.expected_shortfall = params
[m[32m+                .es_params
[m[32m+                .normalize(features.risk_metrics.expected_shortfall, &method);
[m[32m+            features.risk_metrics.max_drawdown = params
[m[32m+                .dd_params
[m[32m+                .normalize(features.risk_metrics.max_drawdown, &method);
[m[32m+            features.risk_metrics.sharpe_ratio = params
[m[32m+                .sharpe_params
[m[32m+                .normalize(features.risk_metrics.sharpe_ratio, &method);
[m         }
 
         info!("Normalization complete");
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:1154:
         note = "Use fit_normalization() and transform_with_params() to prevent data leakage"
     )]
     #[allow(dead_code)]
[31m-    fn apply_normalization(
[m[31m-        &self,
[m[31m-        features_list: &mut [(FinancialFeatures, Vec<f64>)],
[m[31m-    ) {
[m[32m+    fn apply_normalization(&self, features_list: &mut [(FinancialFeatures, Vec<f64>)]) {
[m         let method = NormalizationMethod::from_str(&self.config.features.normalization);
 
         if matches!(method, NormalizationMethod::None) {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:1165:
             return;
         }
 
[31m-        info!("Applying {:?} normalization to {} samples", method, features_list.len());
[m[32m+        info!(
[m[32m+            "Applying {:?} normalization to {} samples",
[m[32m+            method,
[m[32m+            features_list.len()
[m[32m+        );
[m 
         if features_list.is_empty() {
             return;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/data_loader.rs:1247:
             }
 
             // Normalize microstructure features
[31m-            features.microstructure.imbalance = imbalance_params.normalize(
[m[31m-                features.microstructure.imbalance,
[m[31m-                &method,
[m[31m-            );
[m[31m-            features.microstructure.trade_intensity = intensity_params.normalize(
[m[31m-                features.microstructure.trade_intensity,
[m[31m-                &method,
[m[31m-            );
[m[32m+            features.microstructure.imbalance =
[m[32m+                imbalance_params.normalize(features.microstructure.imbalance, &method);
[m[32m+            features.microstructure.trade_intensity =
[m[32m+                intensity_params.normalize(features.microstructure.trade_intensity, &method);
[m 
             // Note: spread_bps is u16, so we normalize separately if needed
[31m-            let normalized_spread = spread_params.normalize(
[m[31m-                features.microstructure.spread_bps as f64,
[m[31m-                &method,
[m[31m-            );
[m[32m+            let normalized_spread =
[m[32m+                spread_params.normalize(features.microstructure.spread_bps as f64, &method);
[m             // Store in technical_indicators for reference
[31m-            features.technical_indicators.insert(
[m[31m-                "spread_bps_normalized".to_string(),
[m[31m-                normalized_spread,
[m[31m-            );
[m[32m+            features
[m[32m+                .technical_indicators
[m[32m+                .insert("spread_bps_normalized".to_string(), normalized_spread);
[m 
             // Normalize risk metrics
[31m-            features.risk_metrics.var_5pct = var_params.normalize(
[m[31m-                features.risk_metrics.var_5pct,
[m[31m-                &method,
[m[31m-            );
[m[31m-            features.risk_metrics.expected_shortfall = es_params.normalize(
[m[31m-                features.risk_metrics.expected_shortfall,
[m[31m-                &method,
[m[31m-            );
[m[31m-            features.risk_metrics.max_drawdown = dd_params.normalize(
[m[31m-                features.risk_metrics.max_drawdown,
[m[31m-                &method,
[m[31m-            );
[m[31m-            features.risk_metrics.sharpe_ratio = sharpe_params.normalize(
[m[31m-                features.risk_metrics.sharpe_ratio,
[m[31m-                &method,
[m[31m-            );
[m[32m+            features.risk_metrics.var_5pct =
[m[32m+                var_params.normalize(features.risk_metrics.var_5pct, &method);
[m[32m+            features.risk_metrics.expected_shortfall =
[m[32m+                es_params.normalize(features.risk_metrics.expected_shortfall, &method);
[m[32m+            features.risk_metrics.max_drawdown =
[m[32m+                dd_params.normalize(features.risk_metrics.max_drawdown, &method);
[m[32m+            features.risk_metrics.sharpe_ratio =
[m[32m+                sharpe_params.normalize(features.risk_metrics.sharpe_ratio, &method);
[m         }
 
[31m-        info!("Normalization complete for {} technical indicators", all_indicator_keys.len());
[m[32m+        info!(
[m[32m+            "Normalization complete for {} technical indicators",
[m[32m+            all_indicator_keys.len()
[m[32m+        );
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:3:
 //! This module provides secure encryption key management for ML model storage,
 //! supporting key rotation, multiple algorithms, and secure key retrieval from Vault.
 
[31m-use aes_gcm::{Aes256Gcm, KeyInit, Nonce as AesNonce};
[m use aes_gcm::aead::{Aead, Payload};
[32m+use aes_gcm::{Aes256Gcm, KeyInit, Nonce as AesNonce};
[m use chacha20poly1305::{ChaCha20Poly1305, Nonce as ChaChaNonce};
 use pbkdf2::pbkdf2_hmac;
 use sha2::Sha256;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:11:
[31m-use zeroize::Zeroize;
[m use std::path::PathBuf;
 use std::sync::Arc;
 use std::time::{SystemTime, UNIX_EPOCH};
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:15:
[32m+use zeroize::Zeroize;
[m 
 use anyhow::{Context, Result};
 use serde::{Deserialize, Serialize};
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:159:
 pub struct EncryptionMetadata {
     pub algorithm: EncryptionAlgorithm,
     pub key_id: String,
[31m-    pub nonce: Vec<u8>,  // 96-bit nonce (12 bytes)
[m[31m-    pub salt: Vec<u8>,   // Salt for key derivation (16 bytes)
[m[32m+    pub nonce: Vec<u8>,       // 96-bit nonce (12 bytes)
[m[32m+    pub salt: Vec<u8>,        // Salt for key derivation (16 bytes)
[m     pub tag: Option<Vec<u8>>, // For AEAD algorithms
     pub encrypted_at: SystemTime,
     pub key_version: u32,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:256:
     /// Derive encryption key from base key using PBKDF2
     fn derive_key(&self, base_key: &str, salt: &[u8]) -> Result<[u8; 32]> {
         let mut derived_key = [0u8; 32];
[31m-        
[m[32m+
[m         // Use PBKDF2 with 100,000 iterations (NIST recommendation)
[31m-        pbkdf2_hmac::<Sha256>(
[m[31m-            base_key.as_bytes(),
[m[31m-            salt,
[m[31m-            100_000,
[m[31m-            &mut derived_key
[m[31m-        );
[m[31m-        
[m[32m+        pbkdf2_hmac::<Sha256>(base_key.as_bytes(), salt, 100_000, &mut derived_key);
[m[32m+
[m         Ok(derived_key)
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:271:
     /// Generate cryptographically secure random nonce
     fn generate_nonce(&self, size: usize) -> Result<Vec<u8>> {
         use rand::{rngs::OsRng, RngCore};
[31m-        
[m[32m+
[m         let mut nonce = vec![0u8; size];
         OsRng.fill_bytes(&mut nonce);
[31m-        
[m[32m+
[m         Ok(nonce)
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:347:
 
         let keys = self.load_encryption_keys().await?;
         let algorithm = self.get_algorithm()?;
[31m-        
[m[32m+
[m         // Generate salt for key derivation
         let salt = self.generate_salt()?;
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:354:
         // Generate random IV/nonce
[31m-        let nonce = self.generate_nonce(12)?;  // 96-bit nonce for GCM/ChaCha20-Poly1305
[m[32m+        let nonce = self.generate_nonce(12)?; // 96-bit nonce for GCM/ChaCha20-Poly1305
[m 
         // Perform authenticated encryption
[31m-        let (encrypted_data, tag) = self.perform_encryption(data, &keys.primary_key, &nonce, &salt, &algorithm)?;
[m[32m+        let (encrypted_data, tag) =
[m[32m+            self.perform_encryption(data, &keys.primary_key, &nonce, &salt, &algorithm)?;
[m 
         let metadata = EncryptionMetadata {
             algorithm,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:362:
             key_id: keys.key_id.clone(),
             nonce,
             salt: salt.to_vec(),
[31m-            tag: Some(tag),  // Authentication tag from AEAD
[m[32m+            tag: Some(tag), // Authentication tag from AEAD
[m             encrypted_at: SystemTime::now(),
             key_version: 1, // Would track actual key versions
         };
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:433:
                 // Use ChaCha20-Poly1305 encryption
                 self.chacha20_encrypt(data, key, iv, salt)
             },
[31m-            EncryptionAlgorithm::Aes256Ctr => 
[m[31m-                Err(anyhow::anyhow!("AES-256-CTR is not authenticated, use AES-256-GCM instead")),
[m[32m+            EncryptionAlgorithm::Aes256Ctr => Err(anyhow::anyhow!(
[m[32m+                "AES-256-CTR is not authenticated, use AES-256-GCM instead"
[m[32m+            )),
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:449:
         algorithm: &EncryptionAlgorithm,
     ) -> Result<Vec<u8>> {
         let tag = tag.ok_or_else(|| anyhow::anyhow!("Missing authentication tag for AEAD"))?;
[31m-        
[m[32m+
[m         match algorithm {
             EncryptionAlgorithm::Aes256Gcm => {
                 // Use AES-256-GCM decryption
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:459:
                 // Use ChaCha20-Poly1305 decryption
                 self.chacha20_decrypt(encrypted_data, key, iv, salt, tag)
             },
[31m-            EncryptionAlgorithm::Aes256Ctr =>
[m[31m-                Err(anyhow::anyhow!("AES-256-CTR is not authenticated, use AES-256-GCM instead")),
[m[32m+            EncryptionAlgorithm::Aes256Ctr => Err(anyhow::anyhow!(
[m[32m+                "AES-256-CTR is not authenticated, use AES-256-GCM instead"
[m[32m+            )),
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:467:
     // Production AES-256-GCM encryption
[31m-    fn aes_gcm_encrypt(&self, data: &[u8], base_key: &str, nonce: &[u8], salt: &[u8]) -> Result<(Vec<u8>, Vec<u8>)> {
[m[32m+    fn aes_gcm_encrypt(
[m[32m+        &self,
[m[32m+        data: &[u8],
[m[32m+        base_key: &str,
[m[32m+        nonce: &[u8],
[m[32m+        salt: &[u8],
[m[32m+    ) -> Result<(Vec<u8>, Vec<u8>)> {
[m         // Derive key using PBKDF2
         let mut derived_key = self.derive_key(base_key, salt)?;
[31m-        
[m[32m+
[m         // Create cipher
         let cipher = Aes256Gcm::new_from_slice(&derived_key)
             .map_err(|e| anyhow::anyhow!("Failed to create AES-256-GCM cipher: {}", e))?;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:475:
[31m-        
[m[32m+
[m         // Create nonce (96 bits = 12 bytes)
         let nonce_array = AesNonce::from_slice(nonce);
[31m-        
[m[32m+
[m         // Encrypt with additional authenticated data
[31m-        let ciphertext = cipher.encrypt(nonce_array, Payload {
[m[31m-            msg: data,
[m[31m-            aad: b"foxhunt-ml-model-v1",  // Additional authenticated data
[m[31m-        })
[m[31m-        .map_err(|e| anyhow::anyhow!("AES-256-GCM encryption failed: {}", e))?;
[m[31m-        
[m[32m+        let ciphertext = cipher
[m[32m+            .encrypt(
[m[32m+                nonce_array,
[m[32m+                Payload {
[m[32m+                    msg: data,
[m[32m+                    aad: b"foxhunt-ml-model-v1", // Additional authenticated data
[m[32m+                },
[m[32m+            )
[m[32m+            .map_err(|e| anyhow::anyhow!("AES-256-GCM encryption failed: {}", e))?;
[m[32m+
[m         // Zero out derived key
         derived_key.zeroize();
[31m-        
[m[32m+
[m         // Split ciphertext and tag (tag is last 16 bytes)
         let tag_offset = ciphertext.len() - 16;
         let encrypted_data = ciphertext[..tag_offset].to_vec();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:492:
         let tag = ciphertext[tag_offset..].to_vec();
[31m-        
[m[31m-        info!("Successfully encrypted {} bytes with AES-256-GCM", data.len());
[m[32m+
[m[32m+        info!(
[m[32m+            "Successfully encrypted {} bytes with AES-256-GCM",
[m[32m+            data.len()
[m[32m+        );
[m         Ok((encrypted_data, tag))
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:498:
[31m-    fn aes_gcm_decrypt(&self, encrypted_data: &[u8], base_key: &str, nonce: &[u8], salt: &[u8], tag: &[u8]) -> Result<Vec<u8>> {
[m[32m+    fn aes_gcm_decrypt(
[m[32m+        &self,
[m[32m+        encrypted_data: &[u8],
[m[32m+        base_key: &str,
[m[32m+        nonce: &[u8],
[m[32m+        salt: &[u8],
[m[32m+        tag: &[u8],
[m[32m+    ) -> Result<Vec<u8>> {
[m         // Derive key using PBKDF2
         let mut derived_key = self.derive_key(base_key, salt)?;
[31m-        
[m[32m+
[m         // Create cipher
         let cipher = Aes256Gcm::new_from_slice(&derived_key)
             .map_err(|e| anyhow::anyhow!("Failed to create AES-256-GCM cipher: {}", e))?;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:505:
[31m-        
[m[32m+
[m         // Create nonce
         let nonce_array = AesNonce::from_slice(nonce);
[31m-        
[m[32m+
[m         // Combine ciphertext and tag
         let mut ciphertext_with_tag = encrypted_data.to_vec();
         ciphertext_with_tag.extend_from_slice(tag);
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:512:
[31m-        
[m[32m+
[m         // Decrypt with AAD verification
[31m-        let plaintext = cipher.decrypt(nonce_array, Payload {
[m[31m-            msg: &ciphertext_with_tag,
[m[31m-            aad: b"foxhunt-ml-model-v1",
[m[31m-        })
[m[31m-        .map_err(|e| anyhow::anyhow!("AES-256-GCM decryption failed (authentication error): {}", e))?;
[m[31m-        
[m[32m+        let plaintext = cipher
[m[32m+            .decrypt(
[m[32m+                nonce_array,
[m[32m+                Payload {
[m[32m+                    msg: &ciphertext_with_tag,
[m[32m+                    aad: b"foxhunt-ml-model-v1",
[m[32m+                },
[m[32m+            )
[m[32m+            .map_err(|e| {
[m[32m+                anyhow::anyhow!(
[m[32m+                    "AES-256-GCM decryption failed (authentication error): {}",
[m[32m+                    e
[m[32m+                )
[m[32m+            })?;
[m[32m+
[m         // Zero out derived key
         derived_key.zeroize();
[31m-        
[m[31m-        info!("Successfully decrypted {} bytes with AES-256-GCM", plaintext.len());
[m[32m+
[m[32m+        info!(
[m[32m+            "Successfully decrypted {} bytes with AES-256-GCM",
[m[32m+            plaintext.len()
[m[32m+        );
[m         Ok(plaintext)
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:527:
[31m-    fn chacha20_encrypt(&self, data: &[u8], base_key: &str, nonce: &[u8], salt: &[u8]) -> Result<(Vec<u8>, Vec<u8>)> {
[m[32m+    fn chacha20_encrypt(
[m[32m+        &self,
[m[32m+        data: &[u8],
[m[32m+        base_key: &str,
[m[32m+        nonce: &[u8],
[m[32m+        salt: &[u8],
[m[32m+    ) -> Result<(Vec<u8>, Vec<u8>)> {
[m         // Derive key using PBKDF2
         let mut derived_key = self.derive_key(base_key, salt)?;
[31m-        
[m[32m+
[m         // Create cipher
         let cipher = ChaCha20Poly1305::new_from_slice(&derived_key)
             .map_err(|e| anyhow::anyhow!("Failed to create ChaCha20-Poly1305 cipher: {}", e))?;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:534:
[31m-        
[m[32m+
[m         // Create nonce (96 bits = 12 bytes)
         let nonce_array = ChaChaNonce::from_slice(nonce);
[31m-        
[m[32m+
[m         // Encrypt with AAD
[31m-        let ciphertext = cipher.encrypt(nonce_array, Payload {
[m[31m-            msg: data,
[m[31m-            aad: b"foxhunt-ml-model-v1",
[m[31m-        })
[m[31m-        .map_err(|e| anyhow::anyhow!("ChaCha20-Poly1305 encryption failed: {}", e))?;
[m[31m-        
[m[32m+        let ciphertext = cipher
[m[32m+            .encrypt(
[m[32m+                nonce_array,
[m[32m+                Payload {
[m[32m+                    msg: data,
[m[32m+                    aad: b"foxhunt-ml-model-v1",
[m[32m+                },
[m[32m+            )
[m[32m+            .map_err(|e| anyhow::anyhow!("ChaCha20-Poly1305 encryption failed: {}", e))?;
[m[32m+
[m         // Zero out derived key
         derived_key.zeroize();
[31m-        
[m[32m+
[m         // Split ciphertext and tag
         let tag_offset = ciphertext.len() - 16;
         let encrypted_data = ciphertext[..tag_offset].to_vec();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:551:
         let tag = ciphertext[tag_offset..].to_vec();
[31m-        
[m[31m-        info!("Successfully encrypted {} bytes with ChaCha20-Poly1305", data.len());
[m[32m+
[m[32m+        info!(
[m[32m+            "Successfully encrypted {} bytes with ChaCha20-Poly1305",
[m[32m+            data.len()
[m[32m+        );
[m         Ok((encrypted_data, tag))
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:557:
[31m-    fn chacha20_decrypt(&self, encrypted_data: &[u8], base_key: &str, nonce: &[u8], salt: &[u8], tag: &[u8]) -> Result<Vec<u8>> {
[m[32m+    fn chacha20_decrypt(
[m[32m+        &self,
[m[32m+        encrypted_data: &[u8],
[m[32m+        base_key: &str,
[m[32m+        nonce: &[u8],
[m[32m+        salt: &[u8],
[m[32m+        tag: &[u8],
[m[32m+    ) -> Result<Vec<u8>> {
[m         // Derive key using PBKDF2
         let mut derived_key = self.derive_key(base_key, salt)?;
[31m-        
[m[32m+
[m         // Create cipher
         let cipher = ChaCha20Poly1305::new_from_slice(&derived_key)
             .map_err(|e| anyhow::anyhow!("Failed to create ChaCha20-Poly1305 cipher: {}", e))?;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:564:
[31m-        
[m[32m+
[m         // Create nonce
         let nonce_array = ChaChaNonce::from_slice(nonce);
[31m-        
[m[32m+
[m         // Combine ciphertext and tag
         let mut ciphertext_with_tag = encrypted_data.to_vec();
         ciphertext_with_tag.extend_from_slice(tag);
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:571:
[31m-        
[m[32m+
[m         // Decrypt with AAD verification
[31m-        let plaintext = cipher.decrypt(nonce_array, Payload {
[m[31m-            msg: &ciphertext_with_tag,
[m[31m-            aad: b"foxhunt-ml-model-v1",
[m[31m-        })
[m[31m-        .map_err(|e| anyhow::anyhow!("ChaCha20-Poly1305 decryption failed (authentication error): {}", e))?;
[m[31m-        
[m[32m+        let plaintext = cipher
[m[32m+            .decrypt(
[m[32m+                nonce_array,
[m[32m+                Payload {
[m[32m+                    msg: &ciphertext_with_tag,
[m[32m+                    aad: b"foxhunt-ml-model-v1",
[m[32m+                },
[m[32m+            )
[m[32m+            .map_err(|e| {
[m[32m+                anyhow::anyhow!(
[m[32m+                    "ChaCha20-Poly1305 decryption failed (authentication error): {}",
[m[32m+                    e
[m[32m+                )
[m[32m+            })?;
[m[32m+
[m         // Zero out derived key
         derived_key.zeroize();
[31m-        
[m[31m-        info!("Successfully decrypted {} bytes with ChaCha20-Poly1305", plaintext.len());
[m[32m+
[m[32m+        info!(
[m[32m+            "Successfully decrypted {} bytes with ChaCha20-Poly1305",
[m[32m+            plaintext.len()
[m[32m+        );
[m         Ok(plaintext)
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:701:
 
         // Verify metadata
         assert_eq!(metadata.algorithm, EncryptionAlgorithm::Aes256Gcm);
[31m-        assert_eq!(metadata.nonce.len(), 12);  // 96-bit nonce
[m[31m-        assert_eq!(metadata.salt.len(), 16);   // 128-bit salt
[m[32m+        assert_eq!(metadata.nonce.len(), 12); // 96-bit nonce
[m[32m+        assert_eq!(metadata.salt.len(), 16); // 128-bit salt
[m         assert!(metadata.tag.is_some());
[31m-        assert_eq!(metadata.tag.as_ref().unwrap().len(), 16);  // 128-bit tag
[m[32m+        assert_eq!(metadata.tag.as_ref().unwrap().len(), 16); // 128-bit tag
[m 
         // Verify decryption works
         let decrypted = manager
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:761:
 
         // Tamper with the tag
         if let Some(ref mut tag) = metadata.tag {
[31m-            tag[0] ^= 0xFF;  // Flip bits in first byte
[m[32m+            tag[0] ^= 0xFF; // Flip bits in first byte
[m         }
 
         // Decryption should fail with tampered tag
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:768:
         let result = manager.decrypt_model_data(&encrypted, &metadata).await;
         assert!(result.is_err());
[31m-        assert!(result.unwrap_err().to_string().contains("authentication error"));
[m[32m+        assert!(result
[m[32m+            .unwrap_err()
[m[32m+            .to_string()
[m[32m+            .contains("authentication error"));
[m     }
 
     #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/encryption.rs:815:
         assert_ne!(encrypted.as_slice(), large_data.as_slice());
 
         // Verify decryption
[31m-        let decrypted = manager.decrypt_model_data(&encrypted, &metadata).await.unwrap();
[m[32m+        let decrypted = manager
[m[32m+            .decrypt_model_data(&encrypted, &metadata)
[m[32m+            .await
[m[32m+            .unwrap();
[m         assert_eq!(decrypted, large_data);
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:338:
             if let Some(job) = jobs_read.get(&job_id) {
                 let job_record = crate::database::TrainingJobRecord::from_training_job(job);
                 drop(jobs_read); // Release lock before async call
[31m-                
[m[32m+
[m                 if let Err(e) = self.database.update_training_job(&job_record).await {
                     error!("Failed to update job {} in database: {}", job_id, e);
                 } else {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:657:
 
     /// Load training data from configured source
     /// Phase 2: Loads real data from database or uses mock if feature enabled
[31m-    async fn load_training_data() -> Result<(Vec<(FinancialFeatures, Vec<f64>)>, Vec<(FinancialFeatures, Vec<f64>)>)> {
[m[32m+    async fn load_training_data() -> Result<(
[m[32m+        Vec<(FinancialFeatures, Vec<f64>)>,
[m[32m+        Vec<(FinancialFeatures, Vec<f64>)>,
[m[32m+    )> {
[m         #[cfg(feature = "mock-data")]
         {
             warn!("⚠️  Using MOCK training data - NOT FOR PRODUCTION USE!");
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:669:
 
         #[cfg(not(feature = "mock-data"))]
         {
[31m-            use crate::data_loader::HistoricalDataLoader;
[m             use crate::data_config::DataSourceType;
[32m+            use crate::data_loader::HistoricalDataLoader;
[m 
             // Load data source configuration
             let data_config = TrainingDataSourceConfig::from_env()
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:677:
                 .map_err(|e| anyhow::anyhow!("Failed to load data source configuration: {}", e))?;
 
[31m-            data_config.validate()
[m[32m+            data_config
[m[32m+                .validate()
[m                 .map_err(|e| anyhow::anyhow!("Invalid data source configuration: {}", e))?;
 
[31m-            info!("📊 Training data configuration loaded: {:?}", data_config.summary());
[m[32m+            info!(
[m[32m+                "📊 Training data configuration loaded: {:?}",
[m[32m+                data_config.summary()
[m[32m+            );
[m 
             // Load data based on source type
             match data_config.source_type {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:686:
                 DataSourceType::Historical | DataSourceType::Hybrid => {
                     info!("Loading historical training data from PostgreSQL");
 
[31m-                    let mut loader = HistoricalDataLoader::new(data_config).await
[m[32m+                    let mut loader = HistoricalDataLoader::new(data_config)
[m[32m+                        .await
[m                         .map_err(|e| anyhow::anyhow!("Failed to create data loader: {}", e))?;
 
[31m-                    let (training_data, validation_data) = loader.load_training_data().await
[m[32m+                    let (training_data, validation_data) = loader
[m[32m+                        .load_training_data()
[m[32m+                        .await
[m                         .map_err(|e| anyhow::anyhow!("Failed to load training data: {}", e))?;
 
                     info!(
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:699:
                     );
 
                     Ok((training_data, validation_data))
[31m-                }
[m[31m-                DataSourceType::RealTime => {
[m[31m-                    Err(anyhow::anyhow!(
[m[31m-                        "❌ RealTime data source not yet implemented (Phase 3)\n\
[m[32m+                },
[m[32m+                DataSourceType::RealTime => Err(anyhow::anyhow!(
[m[32m+                    "❌ RealTime data source not yet implemented (Phase 3)\n\
[m                          \n\
                          📋 Supported data sources:\n\
                          - Historical: PostgreSQL database (Phase 2 ✅)\n\
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:712:
                          \n\
                          🔧 Set DATA_SOURCE_TYPE=historical to use database loading\n\
                          Set DATABASE_URL to your PostgreSQL instance"
[31m-                    ))
[m[31m-                }
[m[31m-                DataSourceType::Parquet => {
[m[31m-                    Err(anyhow::anyhow!(
[m[31m-                        "❌ Parquet data source not yet implemented (Phase 4)\n\
[m[32m+                )),
[m[32m+                DataSourceType::Parquet => Err(anyhow::anyhow!(
[m[32m+                    "❌ Parquet data source not yet implemented (Phase 4)\n\
[m                          \n\
                          📋 Supported data sources:\n\
                          - Historical: PostgreSQL database (Phase 2 ✅)\n\
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:724:
                          \n\
                          🔧 Set DATA_SOURCE_TYPE=historical to use database loading\n\
                          Set DATABASE_URL to your PostgreSQL instance"
[31m-                    ))
[m[31m-                }
[m[32m+                )),
[m             }
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/orchestrator.rs:815:
         };
 
         // Extract accuracy from training result metrics history
[31m-        let accuracy = result.metrics_history.last()
[m[32m+        let accuracy = result
[m[32m+            .metrics_history
[m[32m+            .last()
[m             .map(|m| m.prediction_accuracy)
             .unwrap_or(0.0);
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/schema_types.rs:184:
     /// Get signed quantity (positive for buy, negative for sell)
     pub fn signed_quantity(&self) -> f64 {
         let qty = self.quantity_f64();
[31m-        if self.is_buy() { qty } else { -qty }
[m[32m+        if self.is_buy() {
[m[32m+            qty
[m[32m+        } else {
[m[32m+            -qty
[m[32m+        }
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:198:
 
             if !self.rsi_state.initialized && self.update_count >= self.config.rsi_period {
                 // Initial average using SMA
[31m-                let gains: Vec<f64> = self.price_history.iter()
[m[32m+                let gains: Vec<f64> = self
[m[32m+                    .price_history
[m[32m+                    .iter()
[m                     .zip(self.price_history.iter().skip(1))
                     .map(|(p1, p2)| {
                         let change = p2 - p1;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:205:
[31m-                        if change > 0.0 { change } else { 0.0 }
[m[32m+                        if change > 0.0 {
[m[32m+                            change
[m[32m+                        } else {
[m[32m+                            0.0
[m[32m+                        }
[m                     })
                     .collect();
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:209:
[31m-                let losses: Vec<f64> = self.price_history.iter()
[m[32m+                let losses: Vec<f64> = self
[m[32m+                    .price_history
[m[32m+                    .iter()
[m                     .zip(self.price_history.iter().skip(1))
                     .map(|(p1, p2)| {
                         let change = p2 - p1;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:213:
[31m-                        if change < 0.0 { -change } else { 0.0 }
[m[32m+                        if change < 0.0 {
[m[32m+                            -change
[m[32m+                        } else {
[m[32m+                            0.0
[m[32m+                        }
[m                     })
                     .collect();
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:217:
                 self.rsi_state.avg_gain = gains.iter().sum::<f64>() / self.config.rsi_period as f64;
[31m-                self.rsi_state.avg_loss = losses.iter().sum::<f64>() / self.config.rsi_period as f64;
[m[32m+                self.rsi_state.avg_loss =
[m[32m+                    losses.iter().sum::<f64>() / self.config.rsi_period as f64;
[m                 self.rsi_state.initialized = true;
             } else if self.rsi_state.initialized {
                 // Wilder's smoothing: avg = (prev_avg * (n-1) + current) / n
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:222:
                 let period = self.config.rsi_period as f64;
[31m-                self.rsi_state.avg_gain = (self.rsi_state.avg_gain * (period - 1.0) + gain) / period;
[m[31m-                self.rsi_state.avg_loss = (self.rsi_state.avg_loss * (period - 1.0) + loss) / period;
[m[32m+                self.rsi_state.avg_gain =
[m[32m+                    (self.rsi_state.avg_gain * (period - 1.0) + gain) / period;
[m[32m+                self.rsi_state.avg_loss =
[m[32m+                    (self.rsi_state.avg_loss * (period - 1.0) + loss) / period;
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:236:
             self.ema_fast_state = Some(price * k + ema * (1.0 - k));
         } else if self.update_count >= self.config.ema_fast_period {
             // Initialize with SMA
[31m-            let sum: f64 = self.price_history.iter()
[m[32m+            let sum: f64 = self
[m[32m+                .price_history
[m[32m+                .iter()
[m                 .rev()
                 .take(self.config.ema_fast_period)
                 .sum();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:249:
             self.ema_slow_state = Some(price * k + ema * (1.0 - k));
         } else if self.update_count >= self.config.ema_slow_period {
             // Initialize with SMA
[31m-            let sum: f64 = self.price_history.iter()
[m[32m+            let sum: f64 = self
[m[32m+                .price_history
[m[32m+                .iter()
[m                 .rev()
                 .take(self.config.ema_slow_period)
                 .sum();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:261:
             if let Some(signal) = self.macd_signal_state {
                 let k = 2.0 / (self.config.macd_signal_period as f64 + 1.0);
                 self.macd_signal_state = Some(macd * k + signal * (1.0 - k));
[31m-            } else if self.update_count >= self.config.ema_slow_period + self.config.macd_signal_period {
[m[32m+            } else if self.update_count
[m[32m+                >= self.config.ema_slow_period + self.config.macd_signal_period
[m[32m+            {
[m                 self.macd_signal_state = Some(macd);
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:276:
         // Calculate True Range
         let high = *self.high_history.back().unwrap();
         let low = *self.low_history.back().unwrap();
[31m-        let prev_close = self.price_history.get(self.price_history.len() - 2).unwrap();
[m[32m+        let prev_close = self
[m[32m+            .price_history
[m[32m+            .get(self.price_history.len() - 2)
[m[32m+            .unwrap();
[m 
         let tr = (high - low)
             .max((high - prev_close).abs())
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:333:
             return None;
         }
 
[31m-        let prices: Vec<f64> = self.price_history.iter()
[m[32m+        let prices: Vec<f64> = self
[m[32m+            .price_history
[m[32m+            .iter()
[m             .rev()
             .take(self.config.bollinger_period)
             .copied()
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:343:
         let sma = prices.iter().sum::<f64>() / prices.len() as f64;
 
         // Calculate standard deviation
[31m-        let variance = prices.iter()
[m[31m-            .map(|p| (p - sma).powi(2))
[m[31m-            .sum::<f64>() / prices.len() as f64;
[m[32m+        let variance = prices.iter().map(|p| (p - sma).powi(2)).sum::<f64>() / prices.len() as f64;
[m         let std_dev = variance.sqrt();
 
         let upper = sma + self.config.bollinger_std_dev * std_dev;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:446:
 
         // Feed price data with clear uptrend
         let prices = vec![
[31m-            100.0, 101.0, 102.0, 103.0, 104.0,
[m[31m-            105.0, 106.0, 107.0, 108.0, 109.0,
[m[31m-            110.0, 111.0, 112.0, 113.0, 114.0,
[m[32m+            100.0, 101.0, 102.0, 103.0, 104.0, 105.0, 106.0, 107.0, 108.0, 109.0, 110.0, 111.0,
[m[32m+            112.0, 113.0, 114.0,
[m         ];
 
         for price in prices {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:477:
         let ema_fast = calc.calculate_ema_fast().expect("Fast EMA should exist");
         let ema_slow = calc.calculate_ema_slow().expect("Slow EMA should exist");
 
[31m-        assert!((ema_fast - 100.0).abs() < 0.1, "Fast EMA should converge to 100");
[m[31m-        assert!((ema_slow - 100.0).abs() < 0.1, "Slow EMA should converge to 100");
[m[32m+        assert!(
[m[32m+            (ema_fast - 100.0).abs() < 0.1,
[m[32m+            "Fast EMA should converge to 100"
[m[32m+        );
[m[32m+        assert!(
[m[32m+            (ema_slow - 100.0).abs() < 0.1,
[m[32m+            "Slow EMA should converge to 100"
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:498:
 
         let macd = calc.calculate_macd().expect("MACD should exist");
         let signal = calc.calculate_macd_signal().expect("Signal should exist");
[31m-        let histogram = calc.calculate_macd_histogram().expect("Histogram should exist");
[m[32m+        let histogram = calc
[m[32m+            .calculate_macd_histogram()
[m[32m+            .expect("Histogram should exist");
[m 
         assert!(macd > 0.0, "Uptrend should have positive MACD");
[31m-        assert!((histogram - (macd - signal)).abs() < 0.001, "Histogram should equal MACD - Signal");
[m[32m+        assert!(
[m[32m+            (histogram - (macd - signal)).abs() < 0.001,
[m[32m+            "Histogram should equal MACD - Signal"
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:519:
             calc.update(price, 1000.0, None, None);
         }
 
[31m-        let (middle, upper, lower) = calc.calculate_bollinger_bands()
[m[32m+        let (middle, upper, lower) = calc
[m[32m+            .calculate_bollinger_bands()
[m             .expect("Bollinger bands should be calculated");
 
         assert!(upper > middle, "Upper band should be > middle");
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/technical_indicators.rs:526:
         assert!(middle > lower, "Middle should be > lower band");
[31m-        assert!((upper - middle) - (middle - lower) < 0.001, "Bands should be symmetric");
[m[32m+        assert!(
[m[32m+            (upper - middle) - (middle - lower) < 0.001,
[m[32m+            "Bands should be symmetric"
[m[32m+        );
[m     }
 
     #[test]
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/main.rs:148:
     // Wave 67 Agent 2: Updated pool configuration based on Wave 66 Agent 8 analysis
     let database_config = DatabaseConfig {
         url: database_url.clone(),
[31m-        max_connections: 20,  // Increased from 10 to support parallel training
[m[31m-        min_connections: 5,   // Increased from 1 for sustained throughput
[m[32m+        max_connections: 20, // Increased from 10 to support parallel training
[m[32m+        min_connections: 5,  // Increased from 1 for sustained throughput
[m         connect_timeout: std::time::Duration::from_secs(30),
         query_timeout: std::time::Duration::from_secs(60),
         enable_query_logging: false,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/main.rs:156:
         application_name: Some("ml_training_service".to_string()),
         pool: config::PoolConfig {
[31m-            min_connections: 5,              // Increased from 1 to maintain warm connections
[m[31m-            max_connections: 20,             // Increased from 10 for parallel training jobs
[m[31m-            acquire_timeout_secs: 5,         // Reduced from 30s to 5s for ML training responsiveness
[m[31m-            max_lifetime_secs: 7200,         // Increased to 2 hours for long-running training
[m[31m-            idle_timeout_secs: 900,          // Increased to 15 minutes for training workloads
[m[32m+            min_connections: 5,      // Increased from 1 to maintain warm connections
[m[32m+            max_connections: 20,     // Increased from 10 for parallel training jobs
[m[32m+            acquire_timeout_secs: 5, // Reduced from 30s to 5s for ML training responsiveness
[m[32m+            max_lifetime_secs: 7200, // Increased to 2 hours for long-running training
[m[32m+            idle_timeout_secs: 900,  // Increased to 15 minutes for training workloads
[m             test_before_acquire: true,
             database_url: database_url.clone(),
             health_check_enabled: true,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/main.rs:317:
     info!("Training orchestrator started");
 
     // Initialize TLS configuration for mTLS
[31m-    let tls_config = MLTrainingServiceTlsConfig::from_config(&config_manager).await
[m[32m+    let tls_config = MLTrainingServiceTlsConfig::from_config(&config_manager)
[m[32m+        .await
[m         .context("Failed to initialize TLS configuration")?;
 
     info!("TLS configuration initialized with mutual TLS");
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/main.rs:355:
             .add_service(service)
     } else {
         info!("⚠️  HTTP/2 optimizations disabled via feature flag");
[31m-        Server::builder().tls_config(tls_config.to_server_tls_config())?.add_service(service)
[m[32m+        Server::builder()
[m[32m+            .tls_config(tls_config.to_server_tls_config())?
[m[32m+            .add_service(service)
[m     };
 
     // Add reflection service for development
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/main.rs:445:
     // Wave 67 Agent 2: Updated pool configuration based on Wave 66 Agent 8 analysis
     let database_config = DatabaseConfig {
         url: database_url.clone(),
[31m-        max_connections: 20,  // Increased from 10 to support parallel operations
[m[31m-        min_connections: 5,   // Increased from 1 for sustained throughput
[m[32m+        max_connections: 20, // Increased from 10 to support parallel operations
[m[32m+        min_connections: 5,  // Increased from 1 for sustained throughput
[m         connect_timeout: std::time::Duration::from_secs(30),
         query_timeout: std::time::Duration::from_secs(60),
         enable_query_logging: false,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/main.rs:453:
         application_name: Some("ml_training_service".to_string()),
         pool: config::PoolConfig {
[31m-            min_connections: 5,              // Increased from 1 to maintain warm connections
[m[31m-            max_connections: 20,             // Increased from 10 for parallel database operations
[m[31m-            acquire_timeout_secs: 5,         // Reduced from 30s to 5s for ML training responsiveness
[m[31m-            max_lifetime_secs: 7200,         // Increased to 2 hours for long-running operations
[m[31m-            idle_timeout_secs: 900,          // Increased to 15 minutes for training workloads
[m[32m+            min_connections: 5,      // Increased from 1 to maintain warm connections
[m[32m+            max_connections: 20,     // Increased from 10 for parallel database operations
[m[32m+            acquire_timeout_secs: 5, // Reduced from 30s to 5s for ML training responsiveness
[m[32m+            max_lifetime_secs: 7200, // Increased to 2 hours for long-running operations
[m[32m+            idle_timeout_secs: 900,  // Increased to 15 minutes for training workloads
[m             test_before_acquire: true,
             database_url: database_url.clone(),
             health_check_enabled: true,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:14:
 use tonic::transport::{Certificate, Identity, ServerTlsConfig};
 use tracing::info;
 
[31m-use x509_parser::prelude::*;
[m use x509_parser::certificate::X509Certificate;
 use x509_parser::extensions::{GeneralName, ParsedExtension};
[32m+use x509_parser::prelude::*;
[m use x509_parser::revocation_list::CertificateRevocationList;
 
 /// TLS configuration for the trading service
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:113:
         Self::from_files(
             &tls_config.cert_path,
             &tls_config.key_path,
[31m-            tls_config
[m[31m-                .ca_cert_path
[m[31m-                .as_deref()
[m[31m-                .unwrap_or(&ca_cert_path),
[m[32m+            tls_config.ca_cert_path.as_deref().unwrap_or(&ca_cert_path),
[m             true, // Always require mTLS
         )
         .await
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:138:
         // Parse the X.509 certificate from PEM format
         let (_, pem) = x509_parser::pem::parse_x509_pem(cert_chain)
             .map_err(|e| anyhow::anyhow!("Failed to parse PEM certificate: {}", e))?;
[31m-        
[m[31m-        let cert = pem.parse_x509()
[m[32m+
[m[32m+        let cert = pem
[m[32m+            .parse_x509()
[m             .map_err(|e| anyhow::anyhow!("Failed to parse X.509 certificate: {}", e))?;
 
         // Comprehensive certificate validation
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:147:
 
         tracing::info!(
             "Client certificate validated: CN={}, OU={}",
[31m-            client_identity.common_name, client_identity.organizational_unit
[m[32m+            client_identity.common_name,
[m[32m+            client_identity.organizational_unit
[m         );
 
         Ok(client_identity)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:157:
     fn extract_and_validate_certificate(&self, cert: &X509Certificate) -> Result<ClientIdentity> {
         // SECURITY CHECK 1: Certificate Validity Period (Expiration)
         self.validate_certificate_expiration(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 2: Certificate Purpose (Extended Key Usage)
         self.validate_certificate_purpose(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 3: Certificate Chain of Trust (Basic Constraints)
         self.validate_certificate_constraints(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 4: Critical Extensions Validation
         self.validate_critical_extensions(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 5: Subject Alternative Names (if present)
         self.validate_subject_alternative_names(cert)?;
[31m-        
[m[32m+
[m         // SECURITY CHECK 6: Certificate Revocation Status (CRL/OCSP)
         // Note: Revocation checking is disabled in synchronous validation
         // For production, implement async validation or use a separate revocation service
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:177:
             tracing::warn!("Certificate revocation checking enabled but requires async context");
             // self.check_revocation_status(cert).await?;
         }
[31m-        
[m[32m+
[m         // Extract identity information from Subject DN
         let subject = cert.subject();
[31m-        
[m[32m+
[m         // Extract Common Name (CN)
         let common_name = subject
             .iter_common_name()
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:188:
             .and_then(|cn| cn.as_str().ok())
             .ok_or_else(|| anyhow::anyhow!("Certificate missing Common Name (CN)"))?
             .to_string();
[31m-        
[m[32m+
[m         // Extract Organizational Unit (OU) - required for RBAC
         let organizational_unit = subject
             .iter_organizational_unit()
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:196:
             .and_then(|ou| ou.as_str().ok())
             .ok_or_else(|| anyhow::anyhow!("Certificate missing Organizational Unit (OU)"))?
             .to_string();
[31m-        
[m[32m+
[m         // Extract Serial Number
         let serial_number = format!("{:X}", cert.serial);
[31m-        
[m[32m+
[m         // Extract Issuer CN
[31m-        let issuer = cert.issuer()
[m[32m+        let issuer = cert
[m[32m+            .issuer()
[m             .iter_common_name()
             .next()
             .and_then(|cn| cn.as_str().ok())
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:208:
             .unwrap_or("Unknown Issuer")
             .to_string();
[31m-        
[m[32m+
[m         // SECURITY: Validate organizational unit is in allowed list
         let allowed_ous = ["trading", "admin", "analytics", "risk", "compliance"];
         if !allowed_ous.contains(&organizational_unit.as_str()) {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:214:
             return Err(anyhow::anyhow!(
                 "Organizational Unit '{}' is not authorized for access. Allowed: {:?}",
[31m-                organizational_unit, allowed_ous
[m[32m+                organizational_unit,
[m[32m+                allowed_ous
[m             ));
         }
[31m-        
[m[32m+
[m         // SECURITY: Validate common name format (prevent injection attacks)
[31m-        if !common_name.chars().all(|c| c.is_alphanumeric() || c == '.' || c == '-' || c == '_') {
[m[32m+        if !common_name
[m[32m+            .chars()
[m[32m+            .all(|c| c.is_alphanumeric() || c == '.' || c == '-' || c == '_')
[m[32m+        {
[m             return Err(anyhow::anyhow!(
                 "Common Name contains invalid characters: {}",
                 common_name
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:225:
             ));
         }
[31m-        
[m[32m+
[m         Ok(ClientIdentity {
             common_name,
             organizational_unit,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:232:
             issuer,
         })
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 1: Validate certificate expiration
     fn validate_certificate_expiration(&self, cert: &X509Certificate) -> Result<()> {
         let validity = cert.validity();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:239:
[31m-        
[m[32m+
[m         // Get current time
         let now = std::time::SystemTime::now()
             .duration_since(std::time::UNIX_EPOCH)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:243:
             .map_err(|e| anyhow::anyhow!("System time error: {}", e))?
             .as_secs() as i64;
[31m-        
[m[32m+
[m         // Check not before
         let not_before = validity.not_before.timestamp();
         if now < not_before {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:251:
                 validity.not_before
             ));
         }
[31m-        
[m[32m+
[m         // Check not after
         let not_after = validity.not_after.timestamp();
         if now > not_after {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:260:
                 validity.not_after
             ));
         }
[31m-        
[m[32m+
[m         // SECURITY: Warn if certificate expires soon (within 30 days)
         let thirty_days_secs = 30 * 24 * 3600;
         if not_after - now < thirty_days_secs {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:267:
             let days_remaining = (not_after - now) / (24 * 3600);
             tracing::warn!(
                 "Certificate expires soon! Days remaining: {}. Expiration: {}",
[31m-                days_remaining, validity.not_after
[m[32m+                days_remaining,
[m[32m+                validity.not_after
[m             );
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 2: Validate certificate purpose via Extended Key Usage
     fn validate_certificate_purpose(&self, cert: &X509Certificate) -> Result<()> {
         // Look for Extended Key Usage extension
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:280:
         let mut has_client_auth = false;
         let mut has_eku_extension = false;
[31m-        
[m[32m+
[m         for ext in cert.extensions() {
             if let ParsedExtension::ExtendedKeyUsage(eku) = ext.parsed_extension() {
                 has_eku_extension = true;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:286:
[31m-                
[m[32m+
[m                 // Check for TLS Client Authentication (OID: 1.3.6.1.5.5.7.3.2)
                 has_client_auth = eku.client_auth;
[31m-                
[m[32m+
[m                 if has_client_auth {
                     tracing::debug!("Certificate has TLS Client Authentication purpose");
                 } else {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:297:
                 }
             }
         }
[31m-        
[m[32m+
[m         // SECURITY: Require Extended Key Usage with Client Auth for mTLS
         if has_eku_extension && !has_client_auth {
             return Err(anyhow::anyhow!(
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:304:
                 "Certificate does not have TLS Client Authentication purpose (Extended Key Usage)"
             ));
         }
[31m-        
[m[32m+
[m         // If no EKU extension, we allow it (some CAs don't set this for client certs)
         // but log a warning for security awareness
         if !has_eku_extension {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:312:
                 "Certificate missing Extended Key Usage extension - certificate purpose cannot be verified"
             );
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 3: Validate Basic Constraints (ensure not a CA certificate)
     fn validate_certificate_constraints(&self, cert: &X509Certificate) -> Result<()> {
         for ext in cert.extensions() {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:326:
                         "Client certificate has CA flag set - this is a CA certificate, not a client certificate"
                     ));
                 }
[31m-                
[m[32m+
[m                 tracing::debug!("Certificate Basic Constraints validated: ca={}", bc.ca);
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:333:
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 4: Validate all critical extensions are recognized
     fn validate_critical_extensions(&self, cert: &X509Certificate) -> Result<()> {
         // List of recognized critical extensions (OIDs)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:340:
         let recognized_critical = [
[31m-            "2.5.29.15",  // Key Usage
[m[31m-            "2.5.29.19",  // Basic Constraints
[m[31m-            "2.5.29.37",  // Extended Key Usage
[m[31m-            "2.5.29.17",  // Subject Alternative Name
[m[31m-            "2.5.29.32",  // Certificate Policies
[m[31m-            "2.5.29.35",  // Authority Key Identifier
[m[31m-            "2.5.29.14",  // Subject Key Identifier
[m[32m+            "2.5.29.15", // Key Usage
[m[32m+            "2.5.29.19", // Basic Constraints
[m[32m+            "2.5.29.37", // Extended Key Usage
[m[32m+            "2.5.29.17", // Subject Alternative Name
[m[32m+            "2.5.29.32", // Certificate Policies
[m[32m+            "2.5.29.35", // Authority Key Identifier
[m[32m+            "2.5.29.14", // Subject Key Identifier
[m         ];
[31m-        
[m[32m+
[m         for ext in cert.extensions() {
             if ext.critical {
                 let oid_str = ext.oid.to_id_string();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:353:
[31m-                
[m[32m+
[m                 // Check if this critical extension is recognized
                 if !recognized_critical.contains(&oid_str.as_str()) {
                     return Err(anyhow::anyhow!(
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:358:
                         oid_str
                     ));
                 }
[31m-                
[m[32m+
[m                 tracing::debug!("Recognized critical extension: {}", oid_str);
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:365:
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 5: Validate Subject Alternative Names (if present)
     fn validate_subject_alternative_names(&self, cert: &X509Certificate) -> Result<()> {
         for ext in cert.extensions() {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:372:
             if let ParsedExtension::SubjectAlternativeName(san) = ext.parsed_extension() {
                 // Extract and validate SAN entries
                 let mut san_entries = Vec::new();
[31m-                
[m[32m+
[m                 for name in &san.general_names {
                     match name {
                         GeneralName::DNSName(dns) => {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:379:
                             san_entries.push(format!("DNS:{}", dns));
[31m-                            
[m[32m+
[m                             // SECURITY: Validate DNS name format
                             if !Self::is_valid_dns_name(dns) {
                                 return Err(anyhow::anyhow!(
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:397:
                         },
                         _ => {
                             tracing::debug!("Other SAN type: {:?}", name);
[31m-                        }
[m[32m+                        },
[m                     }
                 }
[31m-                
[m[32m+
[m                 if !san_entries.is_empty() {
                     tracing::debug!("Certificate Subject Alternative Names: {:?}", san_entries);
                 }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:407:
             }
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Validate DNS name format (prevent injection attacks)
     fn is_valid_dns_name(name: &str) -> bool {
         // DNS name validation: alphanumeric, dots, hyphens, underscores
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:417:
         if name.is_empty() || name.len() > 253 {
             return false;
         }
[31m-        
[m[32m+
[m         for label in name.split('.') {
             if label.is_empty() || label.len() > 63 {
                 return false;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:424:
             }
[31m-            
[m[32m+
[m             // Check valid characters: alphanumeric, hyphen, underscore
             // Cannot start or end with hyphen
[31m-            if !label.chars().all(|c| c.is_alphanumeric() || c == '-' || c == '_') {
[m[32m+            if !label
[m[32m+                .chars()
[m[32m+                .all(|c| c.is_alphanumeric() || c == '-' || c == '_')
[m[32m+            {
[m                 return false;
             }
[31m-            
[m[32m+
[m             if label.starts_with('-') || label.ends_with('-') {
                 return false;
             }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:435:
         }
[31m-        
[m[32m+
[m         true
     }
[31m-    
[m[32m+
[m     /// Validate certificate chain of trust against CA certificate
     /// This validates the certificate signature against the CA's public key
     pub fn validate_certificate_chain(&self, client_cert_pem: &[u8]) -> Result<()> {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:443:
         // Parse client certificate
         let (_, client_pem) = x509_parser::pem::parse_x509_pem(client_cert_pem)
             .map_err(|e| anyhow::anyhow!("Failed to parse client certificate PEM: {}", e))?;
[31m-        
[m[31m-        let client_cert = client_pem.parse_x509()
[m[32m+
[m[32m+        let client_cert = client_pem
[m[32m+            .parse_x509()
[m             .map_err(|e| anyhow::anyhow!("Failed to parse client X.509 certificate: {}", e))?;
[31m-        
[m[32m+
[m         // In a production system, you would:
         // 1. Parse the CA certificate from self.ca_certificate
         // 2. Extract the CA's public key
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:453:
         // 3. Verify the client certificate's signature using the CA public key
         // 4. Check that the client certificate's issuer matches the CA's subject
[31m-        
[m[32m+
[m         // For now, we perform basic issuer checks
[31m-        let client_issuer = client_cert.issuer()
[m[32m+        let client_issuer = client_cert
[m[32m+            .issuer()
[m             .iter_common_name()
             .next()
             .and_then(|cn| cn.as_str().ok())
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:461:
             .ok_or_else(|| anyhow::anyhow!("Client certificate missing issuer CN"))?;
[31m-        
[m[32m+
[m         tracing::debug!("Client certificate issued by: {}", client_issuer);
[31m-        
[m[32m+
[m         // TODO: Implement full signature verification using ring or rustls crate
         // This would involve:
         // - Parsing CA certificate public key
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:468:
         // - Extracting signature algorithm from client cert
         // - Verifying signature matches
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SECURITY CHECK 6: Check certificate revocation status via CRL or OCSP
     async fn check_revocation_status(&self, cert: &X509Certificate<'_>) -> Result<()> {
         // Check if certificate has CRL Distribution Points or OCSP extensions
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:477:
         let mut crl_urls: Vec<String> = Vec::new();
         let ocsp_urls: Vec<String> = Vec::new();
[31m-        
[m[32m+
[m         for ext in cert.extensions() {
             // Check for CRL Distribution Points (OID: 2.5.29.31)
             if ext.oid.to_id_string() == "2.5.29.31" {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:483:
                 // Parse CRL Distribution Points
                 // This is a simplified extraction - full implementation would parse the ASN.1 structure
                 tracing::debug!("Certificate has CRL Distribution Points extension");
[31m-                
[m[32m+
[m                 // Add configured CRL URL if available
                 if let Some(ref url) = self.crl_url {
                     crl_urls.push(url.clone());
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:490:
                 }
             }
[31m-            
[m[32m+
[m             // Check for Authority Information Access (OID: 1.3.6.1.5.5.7.1.1) for OCSP
             if ext.oid.to_id_string() == "1.3.6.1.5.5.7.1.1" {
                 tracing::debug!("Certificate has Authority Information Access extension (OCSP)");
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:496:
                 // OCSP URL extraction would go here
             }
         }
[31m-        
[m[32m+
[m         // Perform CRL check if URLs are available
         if !crl_urls.is_empty() {
             for crl_url in &crl_urls {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:514:
                     Err(e) => {
                         tracing::warn!("CRL check failed for {}: {}", crl_url, e);
                         // Continue to next CRL URL or OCSP
[31m-                    }
[m[32m+                    },
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:521:
[31m-        
[m[32m+
[m         // Perform OCSP check if URLs are available and CRL failed
         if !ocsp_urls.is_empty() {
             for ocsp_url in &ocsp_urls {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:535:
                     },
                     Err(e) => {
                         tracing::warn!("OCSP check failed for {}: {}", ocsp_url, e);
[31m-                    }
[m[32m+                    },
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:542:
[31m-        
[m[32m+
[m         // If revocation checking is enabled but no methods succeeded
         if crl_urls.is_empty() && ocsp_urls.is_empty() {
             tracing::warn!(
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:548:
             // In strict mode, this would be an error
             // For now, we allow it with a warning
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Check certificate against CRL (Certificate Revocation List)
[31m-    async fn check_crl_revocation(&self, cert: &X509Certificate<'_>, crl_url: &str) -> Result<bool> {
[m[32m+    async fn check_crl_revocation(
[m[32m+        &self,
[m[32m+        cert: &X509Certificate<'_>,
[m[32m+        crl_url: &str,
[m[32m+    ) -> Result<bool> {
[m         tracing::debug!("Checking certificate revocation via CRL: {}", crl_url);
[31m-        
[m[32m+
[m         // Download CRL from URL
         let client = reqwest::Client::builder()
             .timeout(std::time::Duration::from_secs(10))
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:562:
             .build()
             .context("Failed to create HTTP client for CRL download")?;
[31m-        
[m[31m-        let crl_response = client.get(crl_url)
[m[32m+
[m[32m+        let crl_response = client
[m[32m+            .get(crl_url)
[m             .send()
             .await
             .context("Failed to download CRL")?;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:569:
[31m-        
[m[31m-        let crl_bytes = crl_response.bytes()
[m[32m+
[m[32m+        let crl_bytes = crl_response
[m[32m+            .bytes()
[m             .await
             .context("Failed to read CRL response")?;
[31m-        
[m[32m+
[m         // Parse CRL
         let (_, crl) = CertificateRevocationList::from_der(&crl_bytes)
             .map_err(|e| anyhow::anyhow!("Failed to parse CRL: {}", e))?;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:577:
[31m-        
[m[32m+
[m         // Check if certificate serial number is in revoked list
         for revoked_cert in crl.iter_revoked_certificates() {
             if revoked_cert.raw_serial() == cert.raw_serial() {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:586:
                 return Ok(true); // Certificate is revoked
             }
         }
[31m-        
[m[32m+
[m         Ok(false) // Certificate not found in CRL, not revoked
     }
[31m-    
[m[32m+
[m     /// Check certificate via OCSP (Online Certificate Status Protocol)
[31m-    async fn check_ocsp_revocation(&self, _cert: &X509Certificate<'_>, ocsp_url: &str) -> Result<bool> {
[m[32m+    async fn check_ocsp_revocation(
[m[32m+        &self,
[m[32m+        _cert: &X509Certificate<'_>,
[m[32m+        ocsp_url: &str,
[m[32m+    ) -> Result<bool> {
[m         tracing::debug!("Checking certificate revocation via OCSP: {}", ocsp_url);
[31m-        
[m[32m+
[m         // TODO: Implement OCSP checking
         // This requires building OCSP requests and parsing responses
         // Consider using the 'ocsp' crate or implementing RFC 6960
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/src/tls_config.rs:600:
[31m-        
[m[32m+
[m         Err(anyhow::anyhow!("OCSP checking not yet implemented"))
     }
 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:36:
 
 /// Get test database URL from environment
 fn get_test_database_url() -> String {
[31m-    env::var("TEST_DATABASE_URL")
[m[31m-        .unwrap_or_else(|_| "postgresql://postgres:password@localhost:5432/foxhunt_test".to_string())
[m[32m+    env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+        "postgresql://postgres:password@localhost:5432/foxhunt_test".to_string()
[m[32m+    })
[m }
 
 /// Create test database connection pool
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:167:
 #[ignore] // Requires test database setup
 async fn test_load_historical_data() {
     // Setup
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config();
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:182:
         .expect("Failed to load training data");
 
     // Verify
[31m-    assert!(!training_data.is_empty(), "Training data should not be empty");
[m[31m-    assert!(!validation_data.is_empty(), "Validation data should not be empty");
[m[32m+    assert!(
[m[32m+        !training_data.is_empty(),
[m[32m+        "Training data should not be empty"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        !validation_data.is_empty(),
[m[32m+        "Validation data should not be empty"
[m[32m+    );
[m 
     // Verify split ratio (approximately 80/20)
     let total = training_data.len() + validation_data.len();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:198:
     let (features, targets) = &training_data[0];
     assert!(!features.prices.is_empty(), "Prices should not be empty");
     assert!(!features.volumes.is_empty(), "Volumes should not be empty");
[31m-    assert!(!features.technical_indicators.is_empty(), "Technical indicators should not be empty");
[m[32m+    assert!(
[m[32m+        !features.technical_indicators.is_empty(),
[m[32m+        "Technical indicators should not be empty"
[m[32m+    );
[m     assert!(!targets.is_empty(), "Targets should not be empty");
 
[31m-    println!("✅ Test passed: Loaded {} training samples, {} validation samples",
[m[31m-             training_data.len(), validation_data.len());
[m[32m+    println!(
[m[32m+        "✅ Test passed: Loaded {} training samples, {} validation samples",
[m[32m+        training_data.len(),
[m[32m+        validation_data.len()
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:209:
 #[ignore] // Requires test database setup
 async fn test_time_range_filtering() {
     // Setup
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let mut config = create_test_config();
     config.time_range.start = Some(Utc::now() - chrono::Duration::minutes(30));
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:241:
 #[ignore] // Requires test database setup
 async fn test_symbol_filtering() {
     // Setup
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let mut config = create_test_config();
     config.symbols = vec!["TEST_SYMBOL".to_string()];
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:271:
 #[ignore] // Requires test database setup
 async fn test_data_validation() {
     // Setup
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let mut config = create_test_config();
     config.validation.min_samples = 1000; // Set unrealistically high
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:304:
 #[ignore] // Requires test database setup
 async fn test_feature_extraction() {
     // Setup
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config();
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/data_loader_integration.rs:332:
     );
 
     // Check microstructure features
[31m-    assert!(features.microstructure.spread_bps > 0, "Spread should be positive");
[m[32m+    assert!(
[m[32m+        features.microstructure.spread_bps > 0,
[m[32m+        "Spread should be positive"
[m[32m+    );
[m     assert!(
         features.microstructure.imbalance.abs() <= 1.0,
         "Imbalance should be between -1 and 1"
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:11:
 //! - Error handling
 
 use anyhow::Result;
[31m-use std::sync::Arc;
[m[31m-use std::collections::HashMap;
[m[31m-use tonic::Request;
[m[32m+use config::{DatabaseConfig, MLConfig};
[m[32m+use ml_training_service::database::DatabaseManager;
[m[32m+use ml_training_service::orchestrator::TrainingOrchestrator;
[m use ml_training_service::service::{
[31m-    MLTrainingServiceImpl,
[m     proto::{
[31m-        ml_training_service_server::MlTrainingService,
[m[31m-        StartTrainingRequest, StopTrainingRequest, GetTrainingJobDetailsRequest,
[m[31m-        ListTrainingJobsRequest, ListAvailableModelsRequest,
[m[31m-        Hyperparameters, TlobParams, MambaParams, DqnParams, DataSource,
[m[31m-        TrainingStatus,
[m[32m+        ml_training_service_server::MlTrainingService, DataSource, DqnParams,
[m[32m+        GetTrainingJobDetailsRequest, Hyperparameters, ListAvailableModelsRequest,
[m[32m+        ListTrainingJobsRequest, MambaParams, StartTrainingRequest, StopTrainingRequest,
[m[32m+        TlobParams, TrainingStatus,
[m     },
[32m+    MLTrainingServiceImpl,
[m };
[31m-use ml_training_service::orchestrator::TrainingOrchestrator;
[m[31m-use ml_training_service::database::DatabaseManager;
[m use ml_training_service::storage::{ModelStorageManager, StorageConfig};
[31m-use config::{MLConfig, DatabaseConfig};
[m[32m+use std::collections::HashMap;
[m[32m+use std::sync::Arc;
[m[32m+use tonic::Request;
[m 
 /// Setup test ML training service
 async fn setup_ml_training_service() -> Result<MLTrainingServiceImpl> {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:60:
     let storage_manager = Arc::new(ModelStorageManager::new(storage_config).await?);
 
     // Create orchestrator with test dependencies
[31m-    let orchestrator = Arc::new(TrainingOrchestrator::new(
[m[31m-        config.clone(),
[m[31m-        db_manager,
[m[31m-        storage_manager,
[m[31m-    ).await?);
[m[32m+    let orchestrator =
[m[32m+        Arc::new(TrainingOrchestrator::new(config.clone(), db_manager, storage_manager).await?);
[m 
     Ok(MLTrainingServiceImpl::new(orchestrator, config))
 }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:78:
     let request = Request::new(StartTrainingRequest {
         model_type: "tlob_transformer".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/orderbook_data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/orderbook_data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:87:
         hyperparameters: Some(Hyperparameters {
[31m-            model_params: Some(ml_training_service::service::proto::hyperparameters::ModelParams::TlobParams(
[m[31m-                TlobParams {
[m[31m-                    epochs: 100,
[m[31m-                    learning_rate: 0.001,
[m[31m-                    batch_size: 64,
[m[31m-                    sequence_length: 50,
[m[31m-                    hidden_dim: 128,
[m[31m-                    num_heads: 8,
[m[31m-                    num_layers: 4,
[m[31m-                    dropout_rate: 0.1,
[m[31m-                    use_positional_encoding: true,
[m[31m-                }
[m[31m-            )),
[m[32m+            model_params: Some(
[m[32m+                ml_training_service::service::proto::hyperparameters::ModelParams::TlobParams(
[m[32m+                    TlobParams {
[m[32m+                        epochs: 100,
[m[32m+                        learning_rate: 0.001,
[m[32m+                        batch_size: 64,
[m[32m+                        sequence_length: 50,
[m[32m+                        hidden_dim: 128,
[m[32m+                        num_heads: 8,
[m[32m+                        num_layers: 4,
[m[32m+                        dropout_rate: 0.1,
[m[32m+                        use_positional_encoding: true,
[m[32m+                    },
[m[32m+                ),
[m[32m+            ),
[m         }),
         use_gpu: true,
         description: "test_tlob_training_001".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:123:
     let request = Request::new(StartTrainingRequest {
         model_type: "mamba2".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/timeseries_data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/timeseries_data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:132:
         hyperparameters: Some(Hyperparameters {
[31m-            model_params: Some(ml_training_service::service::proto::hyperparameters::ModelParams::MambaParams(
[m[31m-                MambaParams {
[m[31m-                    epochs: 150,
[m[31m-                    learning_rate: 0.0001,
[m[31m-                    batch_size: 32,
[m[31m-                    state_dim: 256,
[m[31m-                    hidden_dim: 512,
[m[31m-                    num_layers: 6,
[m[31m-                    dt_min: 0.001,
[m[31m-                    dt_max: 0.1,
[m[31m-                    use_cuda_kernels: true,
[m[31m-                }
[m[31m-            )),
[m[32m+            model_params: Some(
[m[32m+                ml_training_service::service::proto::hyperparameters::ModelParams::MambaParams(
[m[32m+                    MambaParams {
[m[32m+                        epochs: 150,
[m[32m+                        learning_rate: 0.0001,
[m[32m+                        batch_size: 32,
[m[32m+                        state_dim: 256,
[m[32m+                        hidden_dim: 512,
[m[32m+                        num_layers: 6,
[m[32m+                        dt_min: 0.001,
[m[32m+                        dt_max: 0.1,
[m[32m+                        use_cuda_kernels: true,
[m[32m+                    },
[m[32m+                ),
[m[32m+            ),
[m         }),
         use_gpu: true,
         description: "test_mamba2_training_001".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:167:
     let request = Request::new(StartTrainingRequest {
         model_type: "dqn".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/rl_environment_data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/rl_environment_data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:176:
         hyperparameters: Some(Hyperparameters {
[31m-            model_params: Some(ml_training_service::service::proto::hyperparameters::ModelParams::DqnParams(
[m[31m-                DqnParams {
[m[31m-                    epochs: 200,
[m[31m-                    learning_rate: 0.0005,
[m[31m-                    batch_size: 128,
[m[31m-                    replay_buffer_size: 100000,
[m[31m-                    epsilon_start: 1.0,
[m[31m-                    epsilon_end: 0.01,
[m[31m-                    epsilon_decay_steps: 10000,
[m[31m-                    gamma: 0.99,
[m[31m-                    target_update_frequency: 100,
[m[31m-                    use_double_dqn: true,
[m[31m-                    use_dueling: false,
[m[31m-                    use_prioritized_replay: false,
[m[31m-                }
[m[31m-            )),
[m[32m+            model_params: Some(
[m[32m+                ml_training_service::service::proto::hyperparameters::ModelParams::DqnParams(
[m[32m+                    DqnParams {
[m[32m+                        epochs: 200,
[m[32m+                        learning_rate: 0.0005,
[m[32m+                        batch_size: 128,
[m[32m+                        replay_buffer_size: 100000,
[m[32m+                        epsilon_start: 1.0,
[m[32m+                        epsilon_end: 0.01,
[m[32m+                        epsilon_decay_steps: 10000,
[m[32m+                        gamma: 0.99,
[m[32m+                        target_update_frequency: 100,
[m[32m+                        use_double_dqn: true,
[m[32m+                        use_dueling: false,
[m[32m+                        use_prioritized_replay: false,
[m[32m+                    },
[m[32m+                ),
[m[32m+            ),
[m         }),
         use_gpu: true,
         description: "test_dqn_training_001".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:214:
     let request = Request::new(StartTrainingRequest {
         model_type: "invalid_model_type_xyz".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:247:
     let request = Request::new(StartTrainingRequest {
         model_type: "tlob_transformer".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath("".to_string()),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:279:
     let request = Request::new(StartTrainingRequest {
         model_type: "tlob_transformer".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:288:
         hyperparameters: Some(Hyperparameters {
[31m-            model_params: Some(ml_training_service::service::proto::hyperparameters::ModelParams::TlobParams(
[m[31m-                TlobParams {
[m[31m-                    epochs: 0, // Invalid: zero epochs
[m[31m-                    learning_rate: -0.001, // Invalid: negative learning rate
[m[31m-                    batch_size: 0, // Invalid: zero batch size
[m[31m-                    sequence_length: 50,
[m[31m-                    hidden_dim: 128,
[m[31m-                    num_heads: 8,
[m[31m-                    num_layers: 4,
[m[31m-                    dropout_rate: 0.1,
[m[31m-                    use_positional_encoding: true,
[m[31m-                }
[m[31m-            )),
[m[32m+            model_params: Some(
[m[32m+                ml_training_service::service::proto::hyperparameters::ModelParams::TlobParams(
[m[32m+                    TlobParams {
[m[32m+                        epochs: 0,             // Invalid: zero epochs
[m[32m+                        learning_rate: -0.001, // Invalid: negative learning rate
[m[32m+                        batch_size: 0,         // Invalid: zero batch size
[m[32m+                        sequence_length: 50,
[m[32m+                        hidden_dim: 128,
[m[32m+                        num_heads: 8,
[m[32m+                        num_layers: 4,
[m[32m+                        dropout_rate: 0.1,
[m[32m+                        use_positional_encoding: true,
[m[32m+                    },
[m[32m+                ),
[m[32m+            ),
[m         }),
         use_gpu: false,
         description: "test_invalid_hyperparams".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:307:
 
     let result = service.start_training(request).await;
 
[31m-    assert!(result.is_err(), "Invalid hyperparameters should be rejected");
[m[32m+    assert!(
[m[32m+        result.is_err(),
[m[32m+        "Invalid hyperparameters should be rejected"
[m[32m+    );
[m     if let Err(status) = result {
         println!("✓ Rejected with: {}", status.message());
         assert_eq!(status.code(), tonic::Code::InvalidArgument);
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:326:
     let start_request = Request::new(StartTrainingRequest {
         model_type: "tlob_transformer".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:375:
             let stop_result = response.into_inner();
             assert!(!stop_result.success, "Stopping nonexistent job should fail");
             println!("✓ Stop failed as expected: {}", stop_result.message);
[31m-        }
[m[32m+        },
[m         Err(status) => {
             println!("✓ Rejected with: {}", status.message());
             assert_eq!(status.code(), tonic::Code::NotFound);
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:382:
[31m-        }
[m[32m+        },
[m     }
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:395:
     let start_request = Request::new(StartTrainingRequest {
         model_type: "mamba2".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:424:
         assert_eq!(job_details.job_id, job_id);
         assert_eq!(job_details.description, "test_job_details");
         assert_eq!(job_details.model_type, "mamba2");
[31m-        println!("  Status: {:?}", TrainingStatus::try_from(job_details.status).unwrap_or(TrainingStatus::Unknown));
[m[32m+        println!(
[m[32m+            "  Status: {:?}",
[m[32m+            TrainingStatus::try_from(job_details.status).unwrap_or(TrainingStatus::Unknown)
[m[32m+        );
[m     } else {
         panic!("Expected job_details to be present");
     }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:443:
         let request = Request::new(StartTrainingRequest {
             model_type: "tlob_transformer".to_string(),
             data_source: Some(DataSource {
[31m-                source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                    "/data/training/data.parquet".to_string()
[m[31m-                )),
[m[32m+                source: Some(
[m[32m+                    ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                        "/data/training/data.parquet".to_string(),
[m[32m+                    ),
[m[32m+                ),
[m                 start_time: 0,
                 end_time: 0,
             }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:512:
             let request = Request::new(StartTrainingRequest {
                 model_type: "tlob_transformer".to_string(),
                 data_source: Some(DataSource {
[31m-                    source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                        "/data/training/data.parquet".to_string()
[m[31m-                    )),
[m[32m+                    source: Some(
[m[32m+                        ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                            "/data/training/data.parquet".to_string(),
[m[32m+                        ),
[m[32m+                    ),
[m                     start_time: 0,
                     end_time: 0,
                 }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:552:
     let request = Request::new(StartTrainingRequest {
         model_type: "mamba2".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:586:
     let request = Request::new(StartTrainingRequest {
         model_type: "tlob_transformer".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:617:
     let start_request = Request::new(StartTrainingRequest {
         model_type: "dqn".to_string(),
         data_source: Some(DataSource {
[31m-            source: Some(ml_training_service::service::proto::data_source::Source::FilePath(
[m[31m-                "/data/training/data.parquet".to_string()
[m[31m-            )),
[m[32m+            source: Some(
[m[32m+                ml_training_service::service::proto::data_source::Source::FilePath(
[m[32m+                    "/data/training/data.parquet".to_string(),
[m[32m+                ),
[m[32m+            ),
[m             start_time: 0,
             end_time: 0,
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:640:
     let status_response = service.get_training_job_details(status_request).await?;
     let status_details = status_response.into_inner();
     if let Some(job_details) = status_details.job_details {
[31m-        println!("  2. Status checked: {:?}", TrainingStatus::try_from(job_details.status).unwrap_or(TrainingStatus::Unknown));
[m[32m+        println!(
[m[32m+            "  2. Status checked: {:?}",
[m[32m+            TrainingStatus::try_from(job_details.status).unwrap_or(TrainingStatus::Unknown)
[m[32m+        );
[m     }
 
     // 3. Stop training
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:649:
         reason: "test_lifecycle_complete".to_string(),
     });
     let stop_response = service.stop_training(stop_request).await?;
[31m-    println!("  3. Training stopped: {}", stop_response.into_inner().success);
[m[32m+    println!(
[m[32m+        "  3. Training stopped: {}",
[m[32m+        stop_response.into_inner().success
[m[32m+    );
[m 
     // 4. Verify stopped status
     let final_status_request = Request::new(GetTrainingJobDetailsRequest {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/model_lifecycle_tests.rs:656:
         job_id: job_id.clone(),
     });
[31m-    let final_status = service.get_training_job_details(final_status_request).await?;
[m[32m+    let final_status = service
[m[32m+        .get_training_job_details(final_status_request)
[m[32m+        .await?;
[m     if let Some(job_details) = final_status.into_inner().job_details {
[31m-        println!("  4. Final status: {:?}", TrainingStatus::try_from(job_details.status).unwrap_or(TrainingStatus::Unknown));
[m[32m+        println!(
[m[32m+            "  4. Final status: {:?}",
[m[32m+            TrainingStatus::try_from(job_details.status).unwrap_or(TrainingStatus::Unknown)
[m[32m+        );
[m     }
 
     println!("✓ Complete lifecycle test passed");
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:34:
 use std::collections::HashMap;
 
 // Import types from ml_training_service
[31m-use ml_training_service::data_loader::HistoricalDataLoader;
[m use ml_training_service::data_config::*;
[32m+use ml_training_service::data_loader::HistoricalDataLoader;
[m use ml_training_service::schema_types::OrderBookSnapshot;
 
 // Import ML types
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:42:
[31m-use ml::training_pipeline::{FinancialFeatures, MicrostructureFeatures, RiskFeatures};
[m use common::Price;
[32m+use ml::training_pipeline::{FinancialFeatures, MicrostructureFeatures, RiskFeatures};
[m 
 // =============================================================================
 // CATEGORY 1: NORMALIZATION CORRECTNESS (6 tests)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:177:
 
         // Training data centered around i*10
         let training = create_feature_samples(vec![
[31m-            offset, offset + 1.0, offset + 2.0, offset + 3.0, offset + 4.0
[m[32m+            offset,
[m[32m+            offset + 1.0,
[m[32m+            offset + 2.0,
[m[32m+            offset + 3.0,
[m[32m+            offset + 4.0,
[m         ]);
 
         // Validation data centered around i*10 + 50
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:184:
         let validation = create_feature_samples(vec![
[31m-            offset + 50.0, offset + 51.0, offset + 52.0, offset + 53.0, offset + 54.0
[m[32m+            offset + 50.0,
[m[32m+            offset + 51.0,
[m[32m+            offset + 52.0,
[m[32m+            offset + 53.0,
[m[32m+            offset + 54.0,
[m         ]);
 
         let loader = create_test_loader().await;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:497:
 async fn test_missing_values_handling() {
     // Create data with NaN and Inf values
     let training_data = create_feature_samples(vec![
[31m-        1.0, 2.0, f64::NAN, 3.0, f64::INFINITY, 4.0, f64::NEG_INFINITY, 5.0
[m[32m+        1.0,
[m[32m+        2.0,
[m[32m+        f64::NAN,
[m[32m+        3.0,
[m[32m+        f64::INFINITY,
[m[32m+        4.0,
[m[32m+        f64::NEG_INFINITY,
[m[32m+        5.0,
[m     ]);
 
     let loader = create_test_loader().await;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:608:
     loader.transform_with_params(&mut data3, &params);
 
     // All should produce identical results
[31m-    let val1 = data1[0].0.technical_indicators.get("spread_bps_normalized").unwrap();
[m[31m-    let val2 = data2[0].0.technical_indicators.get("spread_bps_normalized").unwrap();
[m[31m-    let val3 = data3[0].0.technical_indicators.get("spread_bps_normalized").unwrap();
[m[32m+    let val1 = data1[0]
[m[32m+        .0
[m[32m+        .technical_indicators
[m[32m+        .get("spread_bps_normalized")
[m[32m+        .unwrap();
[m[32m+    let val2 = data2[0]
[m[32m+        .0
[m[32m+        .technical_indicators
[m[32m+        .get("spread_bps_normalized")
[m[32m+        .unwrap();
[m[32m+    let val3 = data3[0]
[m[32m+        .0
[m[32m+        .technical_indicators
[m[32m+        .get("spread_bps_normalized")
[m[32m+        .unwrap();
[m 
     assert!(
         (val1 - val2).abs() < 1e-10,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:617:
         "Repeated transforms should be identical: {} vs {}",
[31m-        val1, val2
[m[32m+        val1,
[m[32m+        val2
[m     );
 
     assert!(
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:622:
         (val2 - val3).abs() < 1e-10,
         "Repeated transforms should be identical: {} vs {}",
[31m-        val2, val3
[m[32m+        val2,
[m[32m+        val3
[m     );
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:691:
 fn create_feature_samples_with_trend(
     start: f64,
     increment: f64,
[31m-    count: usize
[m[32m+    count: usize,
[m ) -> Vec<(FinancialFeatures, Vec<f64>)> {
     (0..count)
         .map(|i| {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:723:
 fn create_full_feature_sample(
     spread: f64,
     imbalance: f64,
[31m-    intensity: f64
[m[32m+    intensity: f64,
[m ) -> (FinancialFeatures, Vec<f64>) {
     let features = FinancialFeatures {
         prices: vec![Price::new(100.0).unwrap()],
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:756:
     let mean_x: f64 = x.iter().sum::<f64>() / n;
     let mean_y: f64 = y.iter().sum::<f64>() / n;
 
[31m-    let cov: f64 = x.iter()
[m[32m+    let cov: f64 = x
[m[32m+        .iter()
[m         .zip(y.iter())
         .map(|(xi, yi)| (xi - mean_x) * (yi - mean_y))
[31m-        .sum::<f64>() / n;
[m[32m+        .sum::<f64>()
[m[32m+        / n;
[m 
[31m-    let var_x: f64 = x.iter()
[m[31m-        .map(|xi| (xi - mean_x).powi(2))
[m[31m-        .sum::<f64>() / n;
[m[32m+    let var_x: f64 = x.iter().map(|xi| (xi - mean_x).powi(2)).sum::<f64>() / n;
[m 
[31m-    let var_y: f64 = y.iter()
[m[31m-        .map(|yi| (yi - mean_y).powi(2))
[m[31m-        .sum::<f64>() / n;
[m[32m+    let var_y: f64 = y.iter().map(|yi| (yi - mean_y).powi(2)).sum::<f64>() / n;
[m 
     if var_x < 1e-10 || var_y < 1e-10 {
         return 0.0;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:795:
             .collect();
 
         let mean = values.iter().sum::<f64>() / values.len() as f64;
[31m-        return values.iter()
[m[31m-            .map(|v| (v - mean).powi(2))
[m[31m-            .sum::<f64>() / values.len() as f64;
[m[32m+        return values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64;
[m     }
 
     let mean = values.iter().sum::<f64>() / values.len() as f64;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:804:
[31m-    values.iter()
[m[31m-        .map(|v| (v - mean).powi(2))
[m[31m-        .sum::<f64>() / values.len() as f64
[m[32m+    values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64
[m }
 
 /// Calculate variance from raw features (before normalization)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:818:
         .collect();
 
     let mean = values.iter().sum::<f64>() / values.len() as f64;
[31m-    values.iter()
[m[31m-        .map(|v| (v - mean).powi(2))
[m[31m-        .sum::<f64>() / values.len() as f64
[m[32m+    values.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / values.len() as f64
[m }
 
 /// Calculate mean from normalized features
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/normalization_validation.rs:850:
 /// Calculate distribution similarity (inverse of KS statistic)
 fn calculate_distribution_similarity(
     features1: &[(FinancialFeatures, Vec<f64>)],
[31m-    features2: &[(FinancialFeatures, Vec<f64>)]
[m[32m+    features2: &[(FinancialFeatures, Vec<f64>)],
[m ) -> f64 {
     // Simple similarity: inverse of variance difference
     let var1 = calculate_variance_from_features(features1);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:33:
 // ============================================================================
 
 fn get_test_database_url() -> String {
[31m-    env::var("TEST_DATABASE_URL")
[m[31m-        .unwrap_or_else(|_| "postgresql://postgres:password@localhost:5432/foxhunt_test".to_string())
[m[32m+    env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+        "postgresql://postgres:password@localhost:5432/foxhunt_test".to_string()
[m[32m+    })
[m }
 
 async fn create_test_pool() -> Result<PgPool, sqlx::Error> {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:201:
 #[tokio::test]
 #[ignore] // Requires test database setup
 async fn test_normalization_zscore() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("zscore");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:214:
         .await
         .expect("Failed to load training data");
 
[31m-    assert!(!training_data.is_empty(), "Training data should not be empty");
[m[32m+    assert!(
[m[32m+        !training_data.is_empty(),
[m[32m+        "Training data should not be empty"
[m[32m+    );
[m 
     // Verify Z-score normalization: values should have ~mean=0, ~std=1
     let (features, _) = &training_data[0];
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:221:
[31m-    
[m[32m+
[m     // Check that spread_bps_normalized exists (created by normalization)
     assert!(
[31m-        features.technical_indicators.contains_key("spread_bps_normalized"),
[m[32m+        features
[m[32m+            .technical_indicators
[m[32m+            .contains_key("spread_bps_normalized"),
[m         "Z-score normalization should create normalized spread_bps"
     );
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:232:
         .collect();
 
     let mean = imbalances.iter().sum::<f64>() / imbalances.len() as f64;
[31m-    let variance = imbalances.iter()
[m[31m-        .map(|v| (v - mean).powi(2))
[m[31m-        .sum::<f64>() / imbalances.len() as f64;
[m[32m+    let variance =
[m[32m+        imbalances.iter().map(|v| (v - mean).powi(2)).sum::<f64>() / imbalances.len() as f64;
[m     let std_dev = variance.sqrt();
 
     // After Z-score normalization, mean should be ~0, std should be ~1
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:249:
         std_dev
     );
 
[31m-    println!("✅ Z-score normalization: mean={:.4}, std={:.4}", mean, std_dev);
[m[32m+    println!(
[m[32m+        "✅ Z-score normalization: mean={:.4}, std={:.4}",
[m[32m+        mean, std_dev
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:256:
 #[ignore] // Requires test database setup
 async fn test_normalization_minmax() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("minmax");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:268:
         .await
         .expect("Failed to load training data");
 
[31m-    assert!(!training_data.is_empty(), "Training data should not be empty");
[m[32m+    assert!(
[m[32m+        !training_data.is_empty(),
[m[32m+        "Training data should not be empty"
[m[32m+    );
[m 
     // Verify min-max normalization: values should be in [0, 1]
     let imbalances: Vec<f64> = training_data
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:290:
         max_val
     );
 
[31m-    println!("✅ Min-max normalization: range=[{:.4}, {:.4}]", min_val, max_val);
[m[32m+    println!(
[m[32m+        "✅ Min-max normalization: range=[{:.4}, {:.4}]",
[m[32m+        min_val, max_val
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:297:
 #[ignore] // Requires test database setup
 async fn test_normalization_robust() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("robust");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:309:
         .await
         .expect("Failed to load training data");
 
[31m-    assert!(!training_data.is_empty(), "Training data should not be empty");
[m[32m+    assert!(
[m[32m+        !training_data.is_empty(),
[m[32m+        "Training data should not be empty"
[m[32m+    );
[m 
     // Verify robust normalization: uses IQR instead of std dev
     // Should be less sensitive to outliers than Z-score
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:321:
     // Calculate IQR for verification
     let mut sorted = imbalances.clone();
     sorted.sort_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal));
[31m-    
[m[32m+
[m     let q1_idx = (sorted.len() as f64 * 0.25) as usize;
     let q3_idx = (sorted.len() as f64 * 0.75) as usize;
     let q1 = sorted[q1_idx];
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:328:
     let q3 = sorted[q3_idx];
     let iqr = q3 - q1;
 
[31m-    assert!(
[m[31m-        iqr > 0.0,
[m[31m-        "IQR should be positive for robust normalization"
[m[31m-    );
[m[32m+    assert!(iqr > 0.0, "IQR should be positive for robust normalization");
[m 
[31m-    println!("✅ Robust normalization: IQR={:.4}, Q1={:.4}, Q3={:.4}", iqr, q1, q3);
[m[32m+    println!(
[m[32m+        "✅ Robust normalization: IQR={:.4}, Q1={:.4}, Q3={:.4}",
[m[32m+        iqr, q1, q3
[m[32m+    );
[m }
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:349:
     // CRITICAL: Expert analysis identified this as a high-impact issue.
     // Current implementation normalizes validation set independently, causing data leakage.
 
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("zscore");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:382:
 
     // CURRENT BEHAVIOR: Both are normalized independently (data leakage)
     // EXPECTED AFTER FIX: val_mean should NOT be ~0 (should use training params)
[31m-    println!("⚠️  Current behavior (data leakage): train_mean={:.4}, val_mean={:.4}", train_mean, val_mean);
[m[32m+    println!(
[m[32m+        "⚠️  Current behavior (data leakage): train_mean={:.4}, val_mean={:.4}",
[m[32m+        train_mean, val_mean
[m[32m+    );
[m     println!("⚠️  After fix: val_mean should != 0 (transformed with training params)");
 
     // Document current behavior for regression testing
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:399:
 #[tokio::test]
 #[ignore] // Requires test database setup
 async fn test_risk_metrics_var_calculation() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("none"); // No normalization for raw risk metrics
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:412:
         .await
         .expect("Failed to load training data");
 
[31m-    assert!(!training_data.is_empty(), "Training data should not be empty");
[m[32m+    assert!(
[m[32m+        !training_data.is_empty(),
[m[32m+        "Training data should not be empty"
[m[32m+    );
[m 
     // Verify VaR calculation
     let (features, _) = &training_data[training_data.len() / 2]; // Middle sample with history
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:419:
[31m-    
[m[32m+
[m     // VaR should be negative (loss metric)
     assert!(
         features.risk_metrics.var_5pct < 0.0,
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:431:
         features.risk_metrics.var_5pct
     );
 
[31m-    println!("✅ VaR calculation: 5% VaR={:.6}", features.risk_metrics.var_5pct);
[m[32m+    println!(
[m[32m+        "✅ VaR calculation: 5% VaR={:.6}",
[m[32m+        features.risk_metrics.var_5pct
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:438:
 #[ignore] // Requires test database setup
 async fn test_risk_metrics_expected_shortfall() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("none");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:462:
 
     println!(
         "✅ Expected Shortfall: ES={:.6}, VaR={:.6}",
[31m-        features.risk_metrics.expected_shortfall,
[m[31m-        features.risk_metrics.var_5pct
[m[32m+        features.risk_metrics.expected_shortfall, features.risk_metrics.var_5pct
[m     );
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:470:
 #[tokio::test]
 #[ignore] // Requires test database setup
 async fn test_risk_metrics_max_drawdown() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("none");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:492:
         features.risk_metrics.max_drawdown
     );
 
[31m-    println!("✅ Max Drawdown: DD={:.6}", features.risk_metrics.max_drawdown);
[m[32m+    println!(
[m[32m+        "✅ Max Drawdown: DD={:.6}",
[m[32m+        features.risk_metrics.max_drawdown
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:499:
 #[ignore] // Requires test database setup
 async fn test_risk_metrics_sharpe_ratio() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("none");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:520:
         features.risk_metrics.sharpe_ratio
     );
 
[31m-    println!("✅ Sharpe Ratio: SR={:.4}", features.risk_metrics.sharpe_ratio);
[m[32m+    println!(
[m[32m+        "✅ Sharpe Ratio: SR={:.4}",
[m[32m+        features.risk_metrics.sharpe_ratio
[m[32m+    );
[m }
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:530:
 #[tokio::test]
 #[ignore] // Requires test database setup
 async fn test_technical_indicators_presence() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("none");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:557:
 
     // Check for stateful indicators (from TechnicalIndicatorCalculator)
     // These should be present after enough data points
[31m-    println!("✅ Technical indicators: {} indicators calculated", 
[m[31m-             features.technical_indicators.len());
[m[31m-    
[m[32m+    println!(
[m[32m+        "✅ Technical indicators: {} indicators calculated",
[m[32m+        features.technical_indicators.len()
[m[32m+    );
[m[32m+
[m     for (key, value) in &features.technical_indicators {
         println!("   - {}: {:.6}", key, value);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:572:
 #[tokio::test]
 #[ignore] // Requires test database setup
 async fn test_empty_dataset_handling() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+
[m     // Clean all test data to create empty dataset
     sqlx::query("DELETE FROM order_book_snapshots WHERE symbol LIKE 'EMPTY_%'")
         .execute(&pool)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:592:
 
     // Should fail with insufficient data error
     assert!(result.is_err(), "Empty dataset should produce error");
[31m-    
[m[32m+
[m     let error_msg = result.unwrap_err().to_string();
     assert!(
         error_msg.contains("Insufficient data") || error_msg.contains("no rows"),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:606:
 #[tokio::test]
 #[ignore] // Requires test database setup
 async fn test_insufficient_samples_validation() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let mut config = create_test_config("none");
     config.validation.min_samples = 100000; // Unrealistically high
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:619:
     let result = loader.load_training_data().await;
 
     assert!(result.is_err(), "Should fail with insufficient samples");
[31m-    
[m[32m+
[m     let error_msg = result.unwrap_err().to_string();
     assert!(
         error_msg.contains("Insufficient data"),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:637:
 #[tokio::test]
 #[ignore] // Requires test database setup
 async fn test_data_quality_filtering() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("none");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:653:
     // All loaded data should have quality >= 80 (per SQL query filter)
     // We can't directly check this from FinancialFeatures, but the data
     // should be present and valid
[31m-    assert!(!training_data.is_empty(), "Should have loaded high-quality data");
[m[32m+    assert!(
[m[32m+        !training_data.is_empty(),
[m[32m+        "Should have loaded high-quality data"
[m[32m+    );
[m 
[31m-    println!("✅ Data quality filtering: {} samples loaded", training_data.len());
[m[32m+    println!(
[m[32m+        "✅ Data quality filtering: {} samples loaded",
[m[32m+        training_data.len()
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:662:
 #[ignore] // Requires test database setup
 async fn test_train_validation_split_ratio() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let mut config = create_test_config("none");
     config.time_range.train_split = 0.75; // 75/25 split
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:699:
 #[tokio::test]
 #[ignore] // Requires test database setup
 async fn test_microstructure_spread_calculation() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("none");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:728:
         features.microstructure.spread_bps
     );
 
[31m-    println!("✅ Spread calculation: {} bps", features.microstructure.spread_bps);
[m[32m+    println!(
[m[32m+        "✅ Spread calculation: {} bps",
[m[32m+        features.microstructure.spread_bps
[m[32m+    );
[m }
 
 #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:735:
 #[ignore] // Requires test database setup
 async fn test_microstructure_imbalance_bounds() {
[31m-    let pool = create_test_pool().await.expect("Failed to create test pool");
[m[31m-    setup_comprehensive_test_data(&pool).await.expect("Failed to setup test data");
[m[32m+    let pool = create_test_pool()
[m[32m+        .await
[m[32m+        .expect("Failed to create test pool");
[m[32m+    setup_comprehensive_test_data(&pool)
[m[32m+        .await
[m[32m+        .expect("Failed to setup test data");
[m 
     let config = create_test_config("none");
     let mut loader = HistoricalDataLoader::new(config)
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:769:
     config.time_range.train_split = 1.5; // Invalid: > 1.0
 
     let result = config.validate();
[31m-    
[m[32m+
[m     assert!(result.is_err(), "Should fail validation with invalid split");
     assert!(
         result.unwrap_err().to_string().contains("train_split"),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_comprehensive.rs:785:
     config.database = None; // Missing required database config
 
     let result = config.validate();
[31m-    
[m[31m-    assert!(result.is_err(), "Should fail validation without database config");
[m[32m+
[m[32m+    assert!(
[m[32m+        result.is_err(),
[m[32m+        "Should fail validation without database config"
[m[32m+    );
[m     assert!(
         result.unwrap_err().to_string().contains("Database"),
         "Error should mention database requirement"
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:166:
 }
 
 /// Create realistic test order book snapshot
[31m-fn create_test_snapshot(symbol: &str, timestamp: DateTime<Utc>, base_price: f64) -> OrderBookSnapshot {
[m[32m+fn create_test_snapshot(
[m[32m+    symbol: &str,
[m[32m+    timestamp: DateTime<Utc>,
[m[32m+    base_price: f64,
[m[32m+) -> OrderBookSnapshot {
[m     let mid_price = Decimal::from_f64_retain(base_price).unwrap();
     let spread_bps = 2;
     let half_spread = base_price * (spread_bps as f64 / 20000.0);
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:236:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:269:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:303:
                 "Expected insufficient data error, got: {}",
                 error_msg
             );
[31m-        }
[m[32m+        },
[m         Ok(_) => {
             warn!("Expected error for empty data, but load succeeded");
[31m-        }
[m[32m+        },
[m     }
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:334:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:357:
     let (training_data, validation_data) = loader.load_training_data().await?;
 
     // Validate data was loaded
[31m-    assert!(training_data.len() >= 1000, "Expected >= 1000 training samples");
[m[31m-    assert!(validation_data.len() >= 200, "Expected >= 200 validation samples");
[m[32m+    assert!(
[m[32m+        training_data.len() >= 1000,
[m[32m+        "Expected >= 1000 training samples"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        validation_data.len() >= 200,
[m[32m+        "Expected >= 200 validation samples"
[m[32m+    );
[m 
     // Validate 80/20 split
     let total = training_data.len() + validation_data.len();
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:365:
     let train_ratio = training_data.len() as f64 / total as f64;
[31m-    assert!((train_ratio - 0.8).abs() < 0.05, "Expected ~80% training split");
[m[32m+    assert!(
[m[32m+        (train_ratio - 0.8).abs() < 0.05,
[m[32m+        "Expected ~80% training split"
[m[32m+    );
[m 
     // Clean up
     db.cleanup(symbol, start_time).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:401:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:465:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:536:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:600:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:661:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:728:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:814:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:904:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:973:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1076:
         let config = TrainingDataSourceConfig {
             source_type: DataSourceType::Historical,
             database: Some(DatabaseConfig {
[31m-                connection_url: env::var("DATABASE_URL")
[m[31m-                    .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+                connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                    "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+                }),
[m                 max_connections: 5,
                 query_timeout_secs: 30,
                 tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1297:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1352:
     let mut config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1439:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 2,
             query_timeout_secs: 1, // Very short timeout
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1481:
 #[test]
 fn test_cargo_features_validation() {
     // Validate that Cargo.toml has mock-data as optional feature
[31m-    let cargo_toml = std::fs::read_to_string("/home/jgrusewski/Work/foxhunt/services/ml_training_service/Cargo.toml")
[m[31m-        .expect("Failed to read Cargo.toml");
[m[32m+    let cargo_toml = std::fs::read_to_string(
[m[32m+        "/home/jgrusewski/Work/foxhunt/services/ml_training_service/Cargo.toml",
[m[32m+    )
[m[32m+    .expect("Failed to read Cargo.toml");
[m 
     assert!(
         cargo_toml.contains("mock-data = []"),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1504:
 #[test]
 fn test_readme_mock_data_warning() {
     // Validate README.md documents mock-data warning
[31m-    let readme = std::fs::read_to_string("/home/jgrusewski/Work/foxhunt/services/ml_training_service/README.md")
[m[31m-        .expect("Failed to read README.md");
[m[32m+    let readme = std::fs::read_to_string(
[m[32m+        "/home/jgrusewski/Work/foxhunt/services/ml_training_service/README.md",
[m[32m+    )
[m[32m+    .expect("Failed to read README.md");
[m 
     assert!(
         readme.contains("TESTING ONLY") && readme.contains("mock-data"),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1554:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 60,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1589:
     let (training_data, validation_data) = loader.load_training_data().await?;
 
     // Comprehensive validation
[31m-    assert!(training_data.len() >= 1500, "Expected >= 1500 training samples");
[m[31m-    assert!(validation_data.len() >= 300, "Expected >= 300 validation samples");
[m[32m+    assert!(
[m[32m+        training_data.len() >= 1500,
[m[32m+        "Expected >= 1500 training samples"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        validation_data.len() >= 300,
[m[32m+        "Expected >= 300 validation samples"
[m[32m+    );
[m 
     // Validate all features are present
     for (features, targets) in training_data.iter().take(10) {
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1654:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 60,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1718:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 10, // Higher pool for concurrent access
             query_timeout_secs: 60,
             tables: DatabaseTables::default(),
Diff in /home/jgrusewski/Work/foxhunt/services/ml_training_service/tests/training_pipeline_tests.rs:1791:
     let config = TrainingDataSourceConfig {
         source_type: DataSourceType::Historical,
         database: Some(DatabaseConfig {
[31m-            connection_url: env::var("DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()),
[m[32m+            connection_url: env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 5,
             query_timeout_secs: 30,
             tables: DatabaseTables::default(),
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:80:
             roles: self.roles.clone(),
             permissions: self.permissions.clone(),
             token_type: self.token_type.clone(),
[31m-            session_id: self.session_id.clone().unwrap_or_else(|| uuid::Uuid::new_v4().to_string()),
[m[32m+            session_id: self
[m[32m+                .session_id
[m[32m+                .clone()
[m[32m+                .unwrap_or_else(|| uuid::Uuid::new_v4().to_string()),
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:392:
 // SECURITY FIX (Wave 69 Agent 10): Removed insecure Default implementation
 // The previous Default implementation had a hardcoded fallback JWT secret that created
 // a critical security vulnerability (CVSS 8.1) allowing token forgery if JWT_SECRET was not set.
[31m-// 
[m[32m+//
[m // BREAKING CHANGE: Default trait implementation removed - use AuthConfig::new() instead
 // This ensures the service fails fast at startup if JWT_SECRET is not properly configured,
 // preventing silent security degradation.
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:742:
 
     /// Authenticate HTTP request (HTTP-layer compatible)
     /// This version works with http::Request instead of tonic::Request
[31m-    async fn authenticate_request_http<T>(&self, req: &HttpRequest<T>, client_ip: &str) -> Result<AuthContext, Status> {
[m[32m+    async fn authenticate_request_http<T>(
[m[32m+        &self,
[m[32m+        req: &HttpRequest<T>,
[m[32m+        client_ip: &str,
[m[32m+    ) -> Result<AuthContext, Status> {
[m         let start_time = Instant::now();
[31m-    
[m[32m+
[m         // Try JWT authentication first (most common for HTTP layer)
         if let Some(bearer_token) = self.extract_bearer_token_http(req) {
             match self.jwt_validator.validate_token(&bearer_token).await {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:757:
                         request_time: start_time,
                         client_ip: Some(client_ip.to_string()),
                     };
[31m-    
[m[32m+
[m                     if self.config.enable_audit_logging {
                         self.audit_logger
                             .log_auth_success(&auth_context, &Some(client_ip.to_string()))
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:776:
                 },
             }
         }
[31m-    
[m[32m+
[m         // Try API key authentication
         if let Some(api_key) = self.extract_api_key_http(req) {
             match self.api_key_validator.validate_key(&api_key).await {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:789:
                         request_time: start_time,
                         client_ip: Some(client_ip.to_string()),
                     };
[31m-    
[m[32m+
[m                     if self.config.enable_audit_logging {
                         self.audit_logger
                             .log_auth_success(&auth_context, &Some(client_ip.to_string()))
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:796:
                             .await;
                     }
[31m-                    debug!("API key authentication successful for user: {}", key_info.user_id);
[m[32m+                    debug!(
[m[32m+                        "API key authentication successful for user: {}",
[m[32m+                        key_info.user_id
[m[32m+                    );
[m                     return Ok(auth_context);
                 },
                 Err(e) => {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:802:
                     if self.config.enable_audit_logging {
                         self.audit_logger
[31m-                            .log_auth_failure("api_key", &Some(client_ip.to_string()), &e.to_string())
[m[32m+                            .log_auth_failure(
[m[32m+                                "api_key",
[m[32m+                                &Some(client_ip.to_string()),
[m[32m+                                &e.to_string(),
[m[32m+                            )
[m                             .await;
                     }
                     warn!("API key authentication failed: {}", e);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:808:
                 },
             }
         }
[31m-    
[m[32m+
[m         // No valid authentication found
         self.rate_limiter.record_failure(client_ip).await;
[31m-    
[m[32m+
[m         if self.config.enable_audit_logging {
             self.audit_logger
[31m-                .log_auth_failure("none", &Some(client_ip.to_string()), "No valid authentication provided")
[m[32m+                .log_auth_failure(
[m[32m+                    "none",
[m[32m+                    &Some(client_ip.to_string()),
[m[32m+                    "No valid authentication provided",
[m[32m+                )
[m                 .await;
         }
         error!("Authentication failed - no valid credentials provided");
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:821:
[31m-    
[m[32m+
[m         Err(Status::unauthenticated("Valid authentication required"))
     }
[31m-    
[m[32m+
[m     /// Extract bearer token from request headers (HTTP-layer compatible)
     fn extract_bearer_token_http<T>(&self, req: &HttpRequest<T>) -> Option<String> {
         req.headers()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:835:
                 }
             })
     }
[31m-    
[m[32m+
[m     /// Extract API key from request headers (HTTP-layer compatible)
     fn extract_api_key_http<T>(&self, req: &HttpRequest<T>) -> Option<String> {
         req.headers()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:843:
             .and_then(|key| key.to_str().ok())
             .map(|key| key.to_string())
     }
[31m-    
[m[32m+
[m     /// Extract client IP from request (HTTP-layer compatible)
     fn extract_client_ip_http<T>(&self, req: &HttpRequest<T>) -> Option<String> {
         req.headers()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:857:
                     .map(|ip| ip.to_string())
             })
     }
[31m-    
[m[32m+
[m     /// Extract bearer token from request headers (gRPC-layer, for compatibility)
     fn extract_bearer_token<T>(&self, req: &Request<T>) -> Option<String> {
         req.metadata()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:871:
                 }
             })
     }
[31m-    
[m[32m+
[m     /// Extract API key from request headers (gRPC-layer, for compatibility)
     fn extract_api_key<T>(&self, req: &Request<T>) -> Option<String> {
         req.metadata()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:879:
             .and_then(|key| key.to_str().ok())
             .map(|key| key.to_string())
     }
[31m-    
[m[32m+
[m     /// Extract client IP from request (gRPC-layer, for compatibility)
     fn extract_client_ip<T>(&self, req: &Request<T>) -> Option<String> {
         req.metadata()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1021:
         }
 
         // Try JWT authentication from metadata
[31m-        if let Some(bearer_token) = req.metadata()
[m[32m+        if let Some(bearer_token) = req
[m[32m+            .metadata()
[m             .get("authorization")
             .and_then(|auth| auth.to_str().ok())
             .and_then(|auth| {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1063:
         }
 
         // Try API key authentication from metadata
[31m-        if let Some(api_key) = req.metadata()
[m[32m+        if let Some(api_key) = req
[m[32m+            .metadata()
[m             .get("x-api-key")
             .and_then(|key| key.to_str().ok())
             .map(|key| key.to_string())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1084:
                             .log_auth_success(&auth_context, &client_ip)
                             .await;
                     }
[31m-                    debug!("API key authentication successful for user: {}", key_info.user_id);
[m[32m+                    debug!(
[m[32m+                        "API key authentication successful for user: {}",
[m[32m+                        key_info.user_id
[m[32m+                    );
[m                     return Ok(auth_context);
                 },
                 Err(e) => {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1132:
 
     /// Determine user role from API key information
     fn determine_role_from_api_key(&self, key_info: &ApiKeyInfo) -> UserRole {
[31m-        if key_info.permissions.contains(&"system.configure".to_string()) {
[m[32m+        if key_info
[m[32m+            .permissions
[m[32m+            .contains(&"system.configure".to_string())
[m[32m+        {
[m             UserRole::Admin
[31m-        } else if key_info.permissions.contains(&"trading.submit_order".to_string()) {
[m[32m+        } else if key_info
[m[32m+            .permissions
[m[32m+            .contains(&"trading.submit_order".to_string())
[m[32m+        {
[m             UserRole::Trader
[31m-        } else if key_info.permissions.contains(&"risk.modify_limits".to_string()) {
[m[32m+        } else if key_info
[m[32m+            .permissions
[m[32m+            .contains(&"risk.modify_limits".to_string())
[m[32m+        {
[m             UserRole::RiskManager
[31m-        } else if key_info.permissions.contains(&"compliance.view_reports".to_string()) {
[m[32m+        } else if key_info
[m[32m+            .permissions
[m[32m+            .contains(&"compliance.view_reports".to_string())
[m[32m+        {
[m             UserRole::ComplianceOfficer
[31m-        } else if key_info.permissions.contains(&"analytics.run_backtest".to_string()) {
[m[32m+        } else if key_info
[m[32m+            .permissions
[m[32m+            .contains(&"analytics.run_backtest".to_string())
[m[32m+        {
[m             UserRole::Analyst
         } else {
             UserRole::ReadOnly
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1178:
 impl JwtValidator {
     pub fn new(config: Arc<AuthConfig>) -> Self {
         let revocation_service = config.revocation_service.clone();
[31m-        Self { config, revocation_service }
[m[32m+        Self {
[m[32m+            config,
[m[32m+            revocation_service,
[m[32m+        }
[m     }
 
     pub async fn validate_token(&self, token: &str) -> Result<JwtClaims> {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1211:
         // This is critical to prevent revoked tokens from being accepted
         if let Some(revocation_service) = &self.revocation_service {
             let jti = Jti::from_string(token_data.claims.jti.clone());
[31m-            
[m[32m+
[m             let is_revoked = revocation_service
                 .is_revoked(&jti)
                 .await
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1222:
                 if let Ok(Some(metadata)) = revocation_service.get_revocation_metadata(&jti).await {
                     error!(
                         "Revoked token attempted: jti={} user={} reason={} revoked_by={}",
[31m-                        jti, metadata.user_id(), metadata.reason(), metadata.revoked_by()
[m[32m+                        jti,
[m[32m+                        metadata.user_id(),
[m[32m+                        metadata.reason(),
[m[32m+                        metadata.revoked_by()
[m                     );
                 }
                 return Err(anyhow::anyhow!("JWT token has been revoked"));
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1251:
 
         // SECURITY: Validate JTI is present (required for revocation)
         if token_data.claims.jti.is_empty() {
[31m-            return Err(anyhow::anyhow!("JWT must contain jti claim for revocation support"));
[m[32m+            return Err(anyhow::anyhow!(
[m[32m+                "JWT must contain jti claim for revocation support"
[m[32m+            ));
[m         }
 
         if token_data.claims.roles.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1524:
     fn test_auth_config_new_with_valid_secret() {
         // SECURITY FIX (Wave 69 Agent 10): Updated test to use AuthConfig::new()
         // instead of insecure Default implementation
[31m-        
[m[32m+
[m         // Set a high-entropy test JWT secret that passes all validation requirements
         std::env::set_var(
             "JWT_SECRET",
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1531:
[31m-            "Kx7mP@9nR!2sW#5vY$8bC&3fG*6jH^1kL%4pQ+7tZ-0uN~9dM=5eV(8xS)2wT!6yA#4zB"
[m[32m+            "Kx7mP@9nR!2sW#5vY$8bC&3fG*6jH^1kL%4pQ+7tZ-0uN~9dM=5eV(8xS)2wT!6yA#4zB",
[m         );
 
         let config = AuthConfig::new().expect("Should create config with valid JWT_SECRET");
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1535:
[31m-        
[m[32m+
[m         assert_eq!(config.jwt_issuer, "foxhunt-trading");
         assert_eq!(config.jwt_audience, "trading-api");
         assert!(config.require_mtls);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/auth_interceptor.rs:1547:
         // Ensure JWT_SECRET is not set
         std::env::remove_var("JWT_SECRET");
         std::env::remove_var("JWT_SECRET_FILE");
[31m-        
[m[32m+
[m         assert!(AuthConfig::new().is_err(), "Should fail without JWT_SECRET");
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:11:
 use std::collections::HashMap;
 use std::sync::atomic::{AtomicBool, Ordering};
 use std::sync::Arc;
[31m-use tokio::sync::{RwLock, mpsc};
[m[32m+use tokio::sync::{mpsc, RwLock};
[m use tokio::time::Duration;
[31m-use tracing::{debug, info, warn, error};
[m[32m+use tracing::{debug, error, info, warn};
[m 
 // Core components
 use trading_engine::lockfree::AtomicMetrics;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:20:
[31m-use trading_engine::timing::LatencyMeasurement;
[m use trading_engine::timing::HardwareTimestamp;
[32m+use trading_engine::timing::LatencyMeasurement;
[m // NOTE: trading_engine::brokers module not yet implemented
 // Placeholder types will be used until broker integration is complete
 // use trading_engine::brokers::{
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:33:
 // use quickfix::{Session, SessionSettings, SocketInitiator};
 
 // Configuration and types
[32m+use config::asset_classification::{AssetClass, AssetClassificationManager};
[m use config::structures::BrokerConfig;
[31m-use config::asset_classification::{AssetClassificationManager, AssetClass};
[m 
 /// Broker identification
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:114:
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
 pub enum ConnectionQuality {
     Excellent, // <10ms latency
[31m-    Good,      // 10-50ms latency  
[m[32m+    Good,      // 10-50ms latency
[m     Fair,      // 50-100ms latency
     Poor,      // >100ms latency
     Offline,   // Not connected
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:157:
 }
 
 impl ICMarketsConfig {
[31m-    fn default() -> Self { Self }
[m[32m+    fn default() -> Self {
[m[32m+        Self
[m[32m+    }
[m }
 
 impl ICMarketsClient {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:164:
[31m-    fn new(_config: ICMarketsConfig) -> Self { Self }
[m[31m-    async fn connect(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { Ok(()) }
[m[32m+    fn new(_config: ICMarketsConfig) -> Self {
[m[32m+        Self
[m[32m+    }
[m[32m+    async fn connect(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m[32m+        Ok(())
[m[32m+    }
[m     async fn disconnect(&self) {}
[31m-    async fn cancel_order(&self, _order_id: &str) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { Ok(()) }
[m[31m-    async fn submit_order(&self, _request: RoutingRequest) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
[m[32m+    async fn cancel_order(
[m[32m+        &self,
[m[32m+        _order_id: &str,
[m[32m+    ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m[32m+        Ok(())
[m[32m+    }
[m[32m+    async fn submit_order(
[m[32m+        &self,
[m[32m+        _request: RoutingRequest,
[m[32m+    ) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
[m         Ok("exec_id".to_string())
     }
     fn subscribe_executions(&self) -> mpsc::UnboundedReceiver<ExecutionResult> {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:175:
 }
 
 impl IBKRConfig {
[31m-    fn default() -> Self { Self }
[m[32m+    fn default() -> Self {
[m[32m+        Self
[m[32m+    }
[m }
 
 impl IBKRClient {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:182:
[31m-    fn new(_config: IBKRConfig) -> Self { Self }
[m[31m-    async fn connect(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { Ok(()) }
[m[32m+    fn new(_config: IBKRConfig) -> Self {
[m[32m+        Self
[m[32m+    }
[m[32m+    async fn connect(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m[32m+        Ok(())
[m[32m+    }
[m     async fn disconnect(&self) {}
[31m-    async fn cancel_order(&self, _order_id: &str) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { Ok(()) }
[m[31m-    async fn submit_order(&self, _request: RoutingRequest) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
[m[32m+    async fn cancel_order(
[m[32m+        &self,
[m[32m+        _order_id: &str,
[m[32m+    ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m[32m+        Ok(())
[m[32m+    }
[m[32m+    async fn submit_order(
[m[32m+        &self,
[m[32m+        _request: RoutingRequest,
[m[32m+    ) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
[m         Ok("exec_id".to_string())
     }
     fn subscribe_executions(&self) -> mpsc::UnboundedReceiver<ExecutionResult> {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:194:
 
 impl BrokerMonitor {
     fn new(broker_id: BrokerId, heartbeat_interval: Duration) -> Self {
[31m-        Self { broker_id, heartbeat_interval }
[m[32m+        Self {
[m[32m+            broker_id,
[m[32m+            heartbeat_interval,
[m[32m+        }
[m     }
     async fn check_health(&self) -> ConnectionHealth {
         ConnectionHealth {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:219:
     // Broker clients
     icmarkets_client: Arc<ICMarketsClient>,
     ibkr_client: Arc<IBKRClient>,
[31m-    
[m[32m+
[m     // Connection monitoring
     broker_monitors: HashMap<BrokerId, Arc<BrokerMonitor>>,
     broker_status: Arc<RwLock<HashMap<BrokerId, BrokerStatus>>>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:226:
[31m-    
[m[32m+
[m     // Order tracking
     pending_orders: Arc<RwLock<HashMap<String, RoutingRequest>>>,
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:230:
     // Execution reporting
     execution_sender: Arc<mpsc::UnboundedSender<ExecutionResult>>,
[31m-    
[m[32m+
[m     // High-performance timing
     timer: Arc<LatencyMeasurement>,
     // timestamp_generator removed - use HardwareTimestamp::now() directly
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:236:
[31m-    
[m[32m+
[m     // Performance metrics
     metrics: Arc<AtomicMetrics>,
     routing_stats: Arc<RwLock<RoutingStats>>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:240:
[31m-    
[m[32m+
[m     // Configuration
     config: Arc<BrokerConfig>,
     default_strategy: RoutingStrategy,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:244:
[31m-    
[m[32m+
[m     // Connection management
     is_running: Arc<AtomicBool>,
     reconnection_manager: Arc<ReconnectionManager>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:248:
[31m-    
[m[32m+
[m     // Symbol-specific routing rules
     symbol_rules: Arc<RwLock<HashMap<String, RoutingStrategy>>>,
[31m-    
[m[32m+
[m     // Asset classification for routing decisions
     asset_classifier: Arc<AssetClassificationManager>,
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:260:
         execution_sender: mpsc::UnboundedSender<ExecutionResult>,
         asset_classifier: AssetClassificationManager,
     ) -> Result<Self, Box<dyn std::error::Error + Send + Sync>> {
[31m-        
[m         // Initialize broker clients
         let icmarkets_config = ICMarketsConfig::default(); // TODO: Get from broker_config
[31m-        let icmarkets_client = Arc::new(
[m[31m-            ICMarketsClient::new(icmarkets_config)
[m[31m-        );
[m[31m-        
[m[32m+        let icmarkets_client = Arc::new(ICMarketsClient::new(icmarkets_config));
[m[32m+
[m         let ibkr_config = IBKRConfig::default(); // TODO: Get from broker_config
[31m-        let ibkr_client = Arc::new(
[m[31m-            IBKRClient::new(ibkr_config)
[m[31m-        );
[m[32m+        let ibkr_client = Arc::new(IBKRClient::new(ibkr_config));
[m 
         // Initialize broker monitors
         let mut broker_monitors = HashMap::new();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:277:
         broker_monitors.insert(
             BrokerId::ICMarkets,
[31m-            Arc::new(BrokerMonitor::new(BrokerId::ICMarkets, Duration::from_secs(5))),
[m[32m+            Arc::new(BrokerMonitor::new(
[m[32m+                BrokerId::ICMarkets,
[m[32m+                Duration::from_secs(5),
[m[32m+            )),
[m         );
         broker_monitors.insert(
             BrokerId::InteractiveBrokers,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:283:
[31m-            Arc::new(BrokerMonitor::new(BrokerId::InteractiveBrokers, Duration::from_secs(5))),
[m[32m+            Arc::new(BrokerMonitor::new(
[m[32m+                BrokerId::InteractiveBrokers,
[m[32m+                Duration::from_secs(5),
[m[32m+            )),
[m         );
[31m-        
[m[32m+
[m         // Initialize reconnection manager
         let reconnection_manager = Arc::new(ReconnectionManager::new());
[31m-        
[m[32m+
[m         Ok(Self {
             icmarkets_client,
             ibkr_client,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:304:
             asset_classifier: Arc::new(asset_classifier),
         })
     }
[31m-    
[m[32m+
[m     /// Start broker routing system
     pub async fn start(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[31m-        if self.is_running.compare_exchange(false, true, Ordering::AcqRel, Ordering::Relaxed).is_err() {
[m[32m+        if self
[m[32m+            .is_running
[m[32m+            .compare_exchange(false, true, Ordering::AcqRel, Ordering::Relaxed)
[m[32m+            .is_err()
[m[32m+        {
[m             return Err("Broker router already running".into());
         }
[31m-        
[m[32m+
[m         info!("Starting broker routing system...");
[31m-        
[m[32m+
[m         // Start broker connections
         self.icmarkets_client.connect().await?;
         self.ibkr_client.connect().await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:319:
[31m-        
[m[32m+
[m         // Start monitoring tasks
         self.start_monitoring_tasks().await;
[31m-        
[m[32m+
[m         // Start execution processing
         self.start_execution_processing().await;
[31m-        
[m[32m+
[m         // Start reconnection manager
         self.reconnection_manager.start().await;
[31m-        
[m[32m+
[m         info!("Broker routing system started successfully");
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:332:
[31m-    
[m[32m+
[m     /// Stop broker routing system
     pub async fn stop(&self) {
         info!("Stopping broker routing system...");
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:336:
[31m-        
[m[32m+
[m         self.is_running.store(false, Ordering::Release);
[31m-        
[m[32m+
[m         // Disconnect from brokers
         self.icmarkets_client.disconnect().await;
         self.ibkr_client.disconnect().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:342:
[31m-        
[m[32m+
[m         // Stop reconnection manager
         self.reconnection_manager.stop().await;
[31m-        
[m[32m+
[m         info!("Broker routing system stopped");
     }
[31m-    
[m[32m+
[m     /// Route order to optimal broker
[31m-    pub async fn route_order(
[m[31m-        &self,
[m[31m-        mut request: RoutingRequest,
[m[31m-    ) -> Result<String, RoutingError> {
[m[32m+    pub async fn route_order(&self, mut request: RoutingRequest) -> Result<String, RoutingError> {
[m         let mut measurement = LatencyMeasurement::start();
         request.timestamp_ns = HardwareTimestamp::now().as_nanos();
[31m-        
[m[32m+
[m         // Determine routing strategy
         let strategy = self.get_routing_strategy(&request).await;
[31m-        
[m[32m+
[m         // Make routing decision
         let routing_decision = self.make_routing_decision(&request, &strategy).await?;
[31m-        
[m[32m+
[m         // Store pending order
         {
             let mut pending = self.pending_orders.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:366:
             pending.insert(request.order_id.clone(), request.clone());
         }
[31m-        
[m[32m+
[m         // Execute routing decision
         // Note: RoutingDecision simplified to just broker_id for now
[31m-        let execution_id = self.route_to_broker(&request, routing_decision.broker_id).await?;
[m[31m-        
[m[32m+        let execution_id = self
[m[32m+            .route_to_broker(&request, routing_decision.broker_id)
[m[32m+            .await?;
[m[32m+
[m         /* Original multi-broker routing code - restored when full routing implemented
         let execution_id = match routing_decision {
             RoutingDecisionFull::SingleBroker { broker_id } => {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:383:
             }
         };
         */
[31m-        
[m[32m+
[m         // Record timing metrics
         let elapsed_ns = measurement.finish();
         self.metrics.record_operation_time(elapsed_ns);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:390:
[31m-        
[m[32m+
[m         // Update routing statistics
         {
             let mut stats = self.routing_stats.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:395:
             stats.total_routing_time_ns += elapsed_ns;
             stats.avg_routing_time_ns = stats.total_routing_time_ns / stats.orders_routed;
         }
[31m-        
[m[32m+
[m         debug!("Order {} routed in {}ns", request.order_id, elapsed_ns);
         Ok(execution_id)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:402:
[31m-    
[m[32m+
[m     /// Cancel order across all brokers
     pub async fn cancel_order(&self, order_id: &str) -> Result<(), RoutingError> {
         let mut measurement = LatencyMeasurement::start();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:411:
         } {
             // Try to cancel at all brokers (since we may not know which one has it)
             let mut cancel_results = Vec::new();
[31m-            
[m[32m+
[m             // Cancel at ICMarkets
             if let Err(e) = self.icmarkets_client.cancel_order(order_id).await {
                 cancel_results.push(format!("ICMarkets: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:418:
             }
[31m-            
[m[32m+
[m             // Cancel at IBKR
             if let Err(e) = self.ibkr_client.cancel_order(order_id).await {
                 cancel_results.push(format!("IBKR: {}", e));
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:423:
             }
[31m-            
[m[32m+
[m             if !cancel_results.is_empty() {
                 warn!("Cancel order {} had issues: {:?}", order_id, cancel_results);
             }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:428:
[31m-            
[m[32m+
[m             let elapsed_ns = measurement.finish();
[31m-            debug!("Order {} cancellation processed in {}ns", order_id, elapsed_ns);
[m[32m+            debug!(
[m[32m+                "Order {} cancellation processed in {}ns",
[m[32m+                order_id, elapsed_ns
[m[32m+            );
[m         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Get broker status
     pub async fn get_broker_status(&self, broker_id: BrokerId) -> Option<BrokerStatus> {
         let status = self.broker_status.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:439:
         status.get(&broker_id).cloned()
     }
[31m-    
[m[32m+
[m     /// Get all broker statuses
     pub async fn get_all_broker_status(&self) -> HashMap<BrokerId, BrokerStatus> {
         self.broker_status.read().await.clone()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:445:
     }
[31m-    
[m[32m+
[m     /// Get routing statistics
     pub async fn get_routing_stats(&self) -> RoutingStats {
         self.routing_stats.read().await.clone()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:450:
     }
[31m-    
[m[32m+
[m     /// Set symbol-specific routing rule
     pub async fn set_symbol_routing_rule(&self, symbol: String, strategy: RoutingStrategy) {
         let mut rules = self.symbol_rules.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:455:
         rules.insert(symbol, strategy);
     }
[31m-    
[m[32m+
[m     // Internal methods
[31m-    
[m[32m+
[m     /// Determine optimal broker based on asset classification
     fn get_optimal_broker_for_asset(&self, asset_class: &AssetClass) -> BrokerId {
         match asset_class {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:463:
             // Route crypto assets to ICMarkets (better crypto execution)
             AssetClass::Crypto { .. } => BrokerId::ICMarkets,
[31m-    
[m[32m+
[m             // Route forex to ICMarkets (FX specialist)
             AssetClass::Forex { .. } => BrokerId::ICMarkets,
[31m-    
[m[32m+
[m             // Route commodities to ICMarkets (broader commodity access)
             AssetClass::Commodity { .. } => BrokerId::ICMarkets,
[31m-    
[m[32m+
[m             // Route traditional assets to Interactive Brokers
             AssetClass::Equity { .. } => BrokerId::InteractiveBrokers,
             AssetClass::FixedIncome { .. } => BrokerId::InteractiveBrokers,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:475:
             AssetClass::Derivative { .. } => BrokerId::InteractiveBrokers,
             AssetClass::Future { .. } => BrokerId::InteractiveBrokers,
[31m-    
[m[32m+
[m             // Default to Interactive Brokers for unknown assets
             AssetClass::Unknown => BrokerId::InteractiveBrokers,
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:481:
     }
[31m-    
[m[32m+
[m     async fn get_routing_strategy(&self, request: &RoutingRequest) -> RoutingStrategy {
         // Check for symbol-specific rules
         {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:488:
                 return strategy.clone();
             }
         }
[31m-        
[m[32m+
[m         // Check for explicit routing preference
         if let Some(broker_id) = request.routing_preference {
             return RoutingStrategy::DirectRoute { broker_id };
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:495:
         }
[31m-        
[m[32m+
[m         // Use default strategy
         self.default_strategy.clone()
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:500:
[31m-    
[m[32m+
[m     async fn make_routing_decision(
         &self,
         request: &RoutingRequest,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:504:
         strategy: &RoutingStrategy,
     ) -> Result<RoutingDecision, RoutingError> {
         let broker_status = self.broker_status.read().await;
[31m-        
[m[32m+
[m         match strategy {
             RoutingStrategy::LowestLatency => {
                 // Find broker with lowest latency
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:513:
                     .iter()
                     .filter(|(_, status)| status.is_connected)
                     .min_by(|(_, a), (_, b)| {
[31m-                        a.avg_latency_ms.partial_cmp(&b.avg_latency_ms).unwrap_or(std::cmp::Ordering::Equal)
[m[32m+                        a.avg_latency_ms
[m[32m+                            .partial_cmp(&b.avg_latency_ms)
[m[32m+                            .unwrap_or(std::cmp::Ordering::Equal)
[m                     })
                     .map(|(broker_id, _)| *broker_id);
[31m-                
[m[32m+
[m                 if let Some(broker_id) = best_broker {
                     Ok(RoutingDecision { broker_id })
                 } else {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:523:
[31m-                    Err(RoutingError::RoutingDecisionRejected { 
[m[31m-                        reason: "No connected brokers available".to_string()
[m[32m+                    Err(RoutingError::RoutingDecisionRejected {
[m[32m+                        reason: "No connected brokers available".to_string(),
[m                     })
                 }
[31m-            }
[m[31m-            
[m[32m+            },
[m[32m+
[m             RoutingStrategy::BestExecution => {
                 // Determine best execution venue based on asset classification
                 let asset_class = self.asset_classifier.classify_symbol(&request.symbol);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:532:
                 let broker_id = self.get_optimal_broker_for_asset(&asset_class);
[31m-            
[m[31m-                if broker_status.get(&broker_id).map(|s| s.is_connected).unwrap_or(false) {
[m[32m+
[m[32m+                if broker_status
[m[32m+                    .get(&broker_id)
[m[32m+                    .map(|s| s.is_connected)
[m[32m+                    .unwrap_or(false)
[m[32m+                {
[m                     Ok(RoutingDecision { broker_id })
                 } else {
                     // Fallback to any connected broker
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:538:
                     self.fallback_routing(&broker_status)
                 }
[31m-            }
[m[31m-            
[m[32m+            },
[m[32m+
[m             RoutingStrategy::SmartSplit { .. } => {
                 // Simplified: route to best broker (multi-broker routing not yet implemented)
                 let asset_class = self.asset_classifier.classify_symbol(&request.symbol);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:545:
                 let broker_id = self.get_optimal_broker_for_asset(&asset_class);
[31m-                
[m[31m-                if broker_status.get(&broker_id).map(|s| s.is_connected).unwrap_or(false) {
[m[32m+
[m[32m+                if broker_status
[m[32m+                    .get(&broker_id)
[m[32m+                    .map(|s| s.is_connected)
[m[32m+                    .unwrap_or(false)
[m[32m+                {
[m                     Ok(RoutingDecision { broker_id })
                 } else {
                     self.fallback_routing(&broker_status)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:551:
                 }
[31m-            }
[m[31m-            
[m[32m+            },
[m[32m+
[m             RoutingStrategy::DirectRoute { broker_id } => {
[31m-                if broker_status.get(broker_id).map(|s| s.is_connected).unwrap_or(false) {
[m[31m-                    Ok(RoutingDecision { broker_id: *broker_id })
[m[32m+                if broker_status
[m[32m+                    .get(broker_id)
[m[32m+                    .map(|s| s.is_connected)
[m[32m+                    .unwrap_or(false)
[m[32m+                {
[m[32m+                    Ok(RoutingDecision {
[m[32m+                        broker_id: *broker_id,
[m[32m+                    })
[m                 } else {
[31m-                    Err(RoutingError::RoutingDecisionRejected { 
[m[31m-                        reason: format!("Requested broker {} not connected", broker_id.as_str())
[m[32m+                    Err(RoutingError::RoutingDecisionRejected {
[m[32m+                        reason: format!("Requested broker {} not connected", broker_id.as_str()),
[m                     })
                 }
[31m-            }
[m[31m-            
[m[32m+            },
[m[32m+
[m             RoutingStrategy::SymbolOptimized => {
                 // Route based on asset classification and symbol characteristics
                 let asset_class = self.asset_classifier.classify_symbol(&request.symbol);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:567:
                 let broker_id = self.get_optimal_broker_for_asset(&asset_class);
[31m-            
[m[31m-                if broker_status.get(&broker_id).map(|s| s.is_connected).unwrap_or(false) {
[m[32m+
[m[32m+                if broker_status
[m[32m+                    .get(&broker_id)
[m[32m+                    .map(|s| s.is_connected)
[m[32m+                    .unwrap_or(false)
[m[32m+                {
[m                     Ok(RoutingDecision { broker_id })
                 } else {
                     self.fallback_routing(&broker_status)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:573:
                 }
[31m-            }
[m[32m+            },
[m         }
     }
[31m-    
[m[32m+
[m     fn fallback_routing(
         &self,
         broker_status: &HashMap<BrokerId, BrokerStatus>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:587:
         {
             Ok(RoutingDecision { broker_id })
         } else {
[31m-            Err(RoutingError::RoutingDecisionRejected { 
[m[31m-                reason: "No connected brokers available for fallback".to_string()
[m[32m+            Err(RoutingError::RoutingDecisionRejected {
[m[32m+                reason: "No connected brokers available for fallback".to_string(),
[m             })
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:595:
[31m-    
[m[32m+
[m     async fn route_to_broker(
         &self,
         request: &RoutingRequest,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:599:
         broker_id: BrokerId,
     ) -> Result<String, RoutingError> {
         match broker_id {
[31m-            BrokerId::ICMarkets => {
[m[31m-                self.icmarkets_client
[m[31m-                    .submit_order(request.clone().into())
[m[31m-                    .await
[m[31m-                    .map_err(|e| RoutingError::BrokerError { 
[m[31m-                        broker_id, 
[m[31m-                        error: e.to_string() 
[m[31m-                    })
[m[31m-            }
[m[31m-            BrokerId::InteractiveBrokers => {
[m[31m-                self.ibkr_client
[m[31m-                    .submit_order(request.clone().into())
[m[31m-                    .await
[m[31m-                    .map_err(|e| RoutingError::BrokerError { 
[m[31m-                        broker_id, 
[m[31m-                        error: e.to_string() 
[m[31m-                    })
[m[31m-            }
[m[32m+            BrokerId::ICMarkets => self
[m[32m+                .icmarkets_client
[m[32m+                .submit_order(request.clone().into())
[m[32m+                .await
[m[32m+                .map_err(|e| RoutingError::BrokerError {
[m[32m+                    broker_id,
[m[32m+                    error: e.to_string(),
[m[32m+                }),
[m[32m+            BrokerId::InteractiveBrokers => self
[m[32m+                .ibkr_client
[m[32m+                .submit_order(request.clone().into())
[m[32m+                .await
[m[32m+                .map_err(|e| RoutingError::BrokerError {
[m[32m+                    broker_id,
[m[32m+                    error: e.to_string(),
[m[32m+                }),
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:628:
     ) -> Result<String, RoutingError> {
         let parent_order_id = request.order_id.clone();
         let mut child_results = Vec::new();
[31m-        
[m[32m+
[m         for split in splits {
             let mut child_request = request.clone();
             child_request.order_id = split.child_order_id.clone();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:635:
             child_request.quantity = split.quantity;
[31m-            
[m[32m+
[m             match self.route_to_broker(&child_request, split.broker_id).await {
                 Ok(execution_id) => {
                     child_results.push(execution_id);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:640:
[31m-                }
[m[32m+                },
[m                 Err(e) => {
[31m-                    warn!("Failed to route child order {}: {}", child_request.order_id, e);
[m[32m+                    warn!(
[m[32m+                        "Failed to route child order {}: {}",
[m[32m+                        child_request.order_id, e
[m[32m+                    );
[m                     // Continue with other children - partial fills are acceptable
[31m-                }
[m[32m+                },
[m             }
         }
[31m-        
[m[32m+
[m         if child_results.is_empty() {
             Err(RoutingError::AllChildOrdersFailed)
         } else {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:651:
             Ok(parent_order_id) // Return parent order ID for tracking
         }
     }
[31m-    
[m[32m+
[m     async fn start_monitoring_tasks(&self) {
         // Start broker status monitoring
         for (&broker_id, monitor) in &self.broker_monitors {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:658:
             let monitor_clone = Arc::clone(monitor);
             let status_map = Arc::clone(&self.broker_status);
             let router = self.clone_for_async();
[31m-            
[m[32m+
[m             tokio::spawn(async move {
[31m-                router.monitor_broker_status(broker_id, monitor_clone, status_map).await;
[m[32m+                router
[m[32m+                    .monitor_broker_status(broker_id, monitor_clone, status_map)
[m[32m+                    .await;
[m             });
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:667:
[31m-    
[m[32m+
[m     async fn monitor_broker_status(
         &self,
         broker_id: BrokerId,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:672:
         status_map: Arc<RwLock<HashMap<BrokerId, BrokerStatus>>>,
     ) {
         let mut interval = tokio::time::interval(Duration::from_secs(1));
[31m-        
[m[32m+
[m         while self.is_running.load(Ordering::Acquire) {
             interval.tick().await;
[31m-            
[m[32m+
[m             let health = monitor.check_health().await;
             let status = self.create_broker_status(broker_id, &health).await;
[31m-            
[m[32m+
[m             {
                 let mut status_map = status_map.write().await;
                 status_map.insert(broker_id, status.clone());
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:685:
             }
[31m-            
[m[32m+
[m             // Log status changes
             if !status.is_connected {
                 warn!("Broker {} disconnected", broker_id.as_str());
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:690:
                 // Trigger reconnection
[31m-                self.reconnection_manager.schedule_reconnection(broker_id).await;
[m[32m+                self.reconnection_manager
[m[32m+                    .schedule_reconnection(broker_id)
[m[32m+                    .await;
[m             }
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:695:
[31m-    
[m[32m+
[m     async fn create_broker_status(
         &self,
         broker_id: BrokerId,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:710:
             uptime_seconds: health.uptime_seconds,
         }
     }
[31m-    
[m[32m+
[m     fn assess_connection_quality(&self, latency_ms: f64) -> ConnectionQuality {
         if latency_ms < 0.0 {
             ConnectionQuality::Offline
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:724:
             ConnectionQuality::Poor
         }
     }
[31m-    
[m[32m+
[m     async fn start_execution_processing(&self) {
         let execution_sender = Arc::clone(&self.execution_sender);
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:758:
                 }
             }
         });
[31m-        
[m[32m+
[m         // Process executions from IBKR
         let ibkr_executions = self.ibkr_client.subscribe_executions();
         let ibkr_sender = execution_sender;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:765:
         let ibkr_running = Arc::clone(&self.is_running);
[31m-        
[m[32m+
[m         tokio::spawn(async move {
             let mut receiver = ibkr_executions;
             while ibkr_running.load(Ordering::Acquire) {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:791:
             }
         });
     }
[31m-    
[m[32m+
[m     fn clone_for_async(&self) -> Self {
         // Clone for async tasks - creates independent routing context
         Self {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:846:
             pending_reconnections: Arc::new(RwLock::new(Vec::new())),
         }
     }
[31m-    
[m[32m+
[m     pub async fn start(&self) {
         self.is_running.store(true, Ordering::Release);
[31m-        
[m[32m+
[m         // Clone Arcs for the spawned task to avoid borrowing self
         let pending = Arc::clone(&self.pending_reconnections);
         let running = Arc::clone(&self.is_running);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:856:
[31m-        
[m[32m+
[m         tokio::spawn(async move {
             let mut interval = tokio::time::interval(Duration::from_secs(30));
[31m-            
[m[32m+
[m             while running.load(Ordering::Acquire) {
                 interval.tick().await;
[31m-                
[m[32m+
[m                 let mut pending_list = pending.write().await;
                 if !pending_list.is_empty() {
                     info!("Processing {} pending reconnections", pending_list.len());
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:868:
             }
         });
     }
[31m-    
[m[32m+
[m     pub async fn stop(&self) {
         self.is_running.store(false, Ordering::Release);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:875:
[31m-    
[m[32m+
[m     pub async fn schedule_reconnection(&self, broker_id: BrokerId) {
         let mut pending = self.pending_reconnections.write().await;
         if !pending.contains(&broker_id) {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:898:
 #[cfg(test)]
 mod tests {
     use super::*;
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_routing_decision_lowest_latency() {
         // Test routing logic with mock broker status
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:905:
         let mut broker_status = HashMap::new();
[31m-        broker_status.insert(BrokerId::ICMarkets, BrokerStatus {
[m[31m-            broker_id: BrokerId::ICMarkets,
[m[31m-            is_connected: true,
[m[31m-            connection_quality: ConnectionQuality::Excellent,
[m[31m-            avg_latency_ms: 5.0,
[m[31m-            orders_sent: 100,
[m[31m-            executions_received: 95,
[m[31m-            last_heartbeat_ns: 1000,
[m[31m-            error_count: 1,
[m[31m-            uptime_seconds: 3600,
[m[31m-        });
[m[31m-    
[m[31m-        broker_status.insert(BrokerId::InteractiveBrokers, BrokerStatus {
[m[31m-            broker_id: BrokerId::InteractiveBrokers,
[m[31m-            is_connected: true,
[m[31m-            connection_quality: ConnectionQuality::Good,
[m[31m-            avg_latency_ms: 25.0,
[m[31m-            orders_sent: 50,
[m[31m-            executions_received: 48,
[m[31m-            last_heartbeat_ns: 2000,
[m[31m-            error_count: 2,
[m[31m-            uptime_seconds: 1800,
[m[31m-        });
[m[31m-    
[m[32m+        broker_status.insert(
[m[32m+            BrokerId::ICMarkets,
[m[32m+            BrokerStatus {
[m[32m+                broker_id: BrokerId::ICMarkets,
[m[32m+                is_connected: true,
[m[32m+                connection_quality: ConnectionQuality::Excellent,
[m[32m+                avg_latency_ms: 5.0,
[m[32m+                orders_sent: 100,
[m[32m+                executions_received: 95,
[m[32m+                last_heartbeat_ns: 1000,
[m[32m+                error_count: 1,
[m[32m+                uptime_seconds: 3600,
[m[32m+            },
[m[32m+        );
[m[32m+
[m[32m+        broker_status.insert(
[m[32m+            BrokerId::InteractiveBrokers,
[m[32m+            BrokerStatus {
[m[32m+                broker_id: BrokerId::InteractiveBrokers,
[m[32m+                is_connected: true,
[m[32m+                connection_quality: ConnectionQuality::Good,
[m[32m+                avg_latency_ms: 25.0,
[m[32m+                orders_sent: 50,
[m[32m+                executions_received: 48,
[m[32m+                last_heartbeat_ns: 2000,
[m[32m+                error_count: 2,
[m[32m+                uptime_seconds: 1800,
[m[32m+            },
[m[32m+        );
[m[32m+
[m         // ICMarkets should be selected due to lower latency
         // This would be tested in a more complete implementation
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:933:
[31m-    
[m[32m+
[m     // Note: Asset classification routing tests would be implemented here
     // Key test cases:
     // - Crypto assets (BTC, ETH) -> ICMarkets
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:937:
[31m-    // - Equity assets (AAPL, MSFT) -> Interactive Brokers  
[m[32m+    // - Equity assets (AAPL, MSFT) -> Interactive Brokers
[m     // - Forex pairs (EUR/USD) -> ICMarkets
     // - Unknown symbols -> Interactive Brokers (safe default)
[31m-    // 
[m[32m+    //
[m     // This replaces the previous hardcoded symbol checks:
     // OLD: if request.symbol.contains("BTC") || request.symbol.contains("ETH")
[31m-    // NEW: self.asset_classifier.classify_symbol(&request.symbol)        
[m[31m-        // Include SQLx implementations for BrokerId
[m[31m-        #[cfg(feature = "database")]
[m[31m-        mod broker_sqlx {
[m[31m-            use super::BrokerId;
[m[31m-            use sqlx::{
[m[31m-                encode::{Encode, IsNull},
[m[31m-                decode::Decode,
[m[31m-                error::BoxDynError,
[m[31m-                postgres::{PgArgumentBuffer, PgTypeInfo, PgValueRef, Postgres},
[m[31m-                Type,
[m[31m-            };
[m[31m-        
[m[31m-            impl Type<Postgres> for BrokerId {
[m[31m-                fn type_info() -> PgTypeInfo {
[m[31m-                    PgTypeInfo::with_name("TEXT")
[m[31m-                }
[m[32m+    // NEW: self.asset_classifier.classify_symbol(&request.symbol)
[m[32m+    // Include SQLx implementations for BrokerId
[m[32m+    #[cfg(feature = "database")]
[m[32m+    mod broker_sqlx {
[m[32m+        use super::BrokerId;
[m[32m+        use sqlx::{
[m[32m+            decode::Decode,
[m[32m+            encode::{Encode, IsNull},
[m[32m+            error::BoxDynError,
[m[32m+            postgres::{PgArgumentBuffer, PgTypeInfo, PgValueRef, Postgres},
[m[32m+            Type,
[m[32m+        };
[m[32m+
[m[32m+        impl Type<Postgres> for BrokerId {
[m[32m+            fn type_info() -> PgTypeInfo {
[m[32m+                PgTypeInfo::with_name("TEXT")
[m             }
[31m-        
[m[31m-            impl<'q> Encode<'q, Postgres> for BrokerId {
[m[31m-                fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> Result<IsNull, BoxDynError> {
[m[31m-                    match self {
[m[31m-                        BrokerId::ICMarkets => "ic_markets".encode_by_ref(buf),
[m[31m-                        BrokerId::InteractiveBrokers => "interactive_brokers".encode_by_ref(buf),
[m[31m-                    }
[m[32m+        }
[m[32m+
[m[32m+        impl<'q> Encode<'q, Postgres> for BrokerId {
[m[32m+            fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> Result<IsNull, BoxDynError> {
[m[32m+                match self {
[m[32m+                    BrokerId::ICMarkets => "ic_markets".encode_by_ref(buf),
[m[32m+                    BrokerId::InteractiveBrokers => "interactive_brokers".encode_by_ref(buf),
[m                 }
             }
[31m-        
[m[31m-            impl<'r> Decode<'r, Postgres> for BrokerId {
[m[31m-                fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError> {
[m[31m-                    let s = <String as Decode<Postgres>>::decode(value)?;
[m[31m-                    match s.as_str() {
[m[31m-                        "ic_markets" => Ok(BrokerId::ICMarkets),
[m[31m-                        "interactive_brokers" => Ok(BrokerId::InteractiveBrokers),
[m[31m-                        _ => Err(format!("Invalid BrokerId: {}", s).into()),
[m[31m-                    }
[m[32m+        }
[m[32m+
[m[32m+        impl<'r> Decode<'r, Postgres> for BrokerId {
[m[32m+            fn decode(value: PgValueRef<'r>) -> Result<Self, BoxDynError> {
[m[32m+                let s = <String as Decode<Postgres>>::decode(value)?;
[m[32m+                match s.as_str() {
[m[32m+                    "ic_markets" => Ok(BrokerId::ICMarkets),
[m[32m+                    "interactive_brokers" => Ok(BrokerId::InteractiveBrokers),
[m[32m+                    _ => Err(format!("Invalid BrokerId: {}", s).into()),
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/broker_routing.rs:982:
[32m+    }
[m }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:12:
 use std::collections::HashMap;
 use std::sync::atomic::{AtomicU64, Ordering};
 use std::sync::Arc;
[31m-use tokio::sync::{RwLock, mpsc};
[m[31m-use tracing::{debug, info, warn, error};
[m[32m+use tokio::sync::{mpsc, RwLock};
[m[32m+use tracing::{debug, error, info, warn};
[m 
 // Core components - REAL PRODUCTION IMPLEMENTATIONS
[31m-use trading_engine::lockfree::{AtomicMetrics, SequenceGenerator, LockFreeRingBuffer};
[m[31m-use trading_engine::timing::{LatencyMeasurement, HftLatencyTracker};
[m[32m+use trading_engine::lockfree::{AtomicMetrics, LockFreeRingBuffer, SequenceGenerator};
[m[32m+use trading_engine::timing::{HftLatencyTracker, LatencyMeasurement};
[m 
 // Real broker integrations
[32m+use crate::core::broker_routing::BrokerRouter;
[m use crate::core::order_manager::ExecutionReport;
 use crate::core::position_manager::PositionManager;
 use crate::core::risk_manager::RiskManager;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:26:
[31m-use crate::core::broker_routing::BrokerRouter;
[m use crate::utils::validation::OrderValidator;
 
 // Import canonical VolumeProfile
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:32:
 // use adaptive_strategy::execution::VolumeProfile;
 
 // Configuration
[31m-use config::structures::{TradingConfig, BrokerConfig};
[m[32m+use config::structures::{BrokerConfig, TradingConfig};
[m 
 // Common types
[31m-use common::{TimeInForce, OrderSide, OrderType};
[m[32m+use common::{OrderSide, OrderType, TimeInForce};
[m 
 // Import ExecutionReport type if needed
 // Already imported from order_manager above
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:57:
 /// Execution algorithm types
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
 pub enum ExecutionAlgorithm {
[31m-    Market,           // Immediate market execution
[m[31m-    TWAP,            // Time-weighted average price
[m[31m-    VWAP,            // Volume-weighted average price
[m[31m-    Iceberg,         // Large order slicing
[m[31m-    Sniper,          // Liquidity sniping
[m[31m-    CrossOnly,       // Internal crossing only
[m[32m+    Market,    // Immediate market execution
[m[32m+    TWAP,      // Time-weighted average price
[m[32m+    VWAP,      // Volume-weighted average price
[m[32m+    Iceberg,   // Large order slicing
[m[32m+    Sniper,    // Liquidity sniping
[m[32m+    CrossOnly, // Internal crossing only
[m }
 
 /// Real-time execution state
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:71:
 pub struct AtomicExecutionState {
     // Core execution metrics (hot cache line)
     pub total_executions: AtomicU64,
[31m-    pub total_volume: AtomicU64,        // As fixed-point
[m[31m-    pub total_notional: AtomicU64,      // As fixed-point
[m[32m+    pub total_volume: AtomicU64,   // As fixed-point
[m[32m+    pub total_notional: AtomicU64, // As fixed-point
[m     pub avg_execution_time_ns: AtomicU64,
[31m-    
[m[32m+
[m     // Venue statistics (warm cache line)
     pub icmarkets_executions: AtomicU64,
     pub ibkr_executions: AtomicU64,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:81:
     pub internal_crosses: AtomicU64,
     pub dark_pool_executions: AtomicU64,
[31m-    
[m[32m+
[m     // Performance metrics (cold cache line)
[31m-    pub fill_rate_pct: AtomicU64,       // As percentage * 100
[m[31m-    pub slippage_bps: AtomicU64,        // As basis points
[m[32m+    pub fill_rate_pct: AtomicU64, // As percentage * 100
[m[32m+    pub slippage_bps: AtomicU64,  // As basis points
[m     pub execution_shortfall_bps: AtomicU64,
     pub market_impact_bps: AtomicU64,
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:128:
 
 #[derive(Debug, Clone, Copy)]
 pub enum ExecutionUrgency {
[31m-    Low,        // Cost-focused, slow execution
[m[31m-    Medium,     // Balanced execution
[m[31m-    High,       // Speed-focused, immediate
[m[31m-    Emergency,  // Risk management, immediate at any cost
[m[32m+    Low,       // Cost-focused, slow execution
[m[32m+    Medium,    // Balanced execution
[m[32m+    High,      // Speed-focused, immediate
[m[32m+    Emergency, // Risk management, immediate at any cost
[m }
 
 // REMOVED: TimeInForce duplicate - use common::TimeInForce
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:181:
         position_manager: Arc<PositionManager>,
         risk_manager: Arc<RiskManager>,
     ) -> Result<Self, ExecutionError> {
[31m-        
[m         // Initialize execution queues
         let market_queue = Arc::new(
             LockFreeRingBuffer::new(4096)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:188:
[31m-                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?
[m[32m+                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?,
[m         );
         let twap_queue = Arc::new(
             LockFreeRingBuffer::new(4096)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:192:
[31m-                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?
[m[32m+                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?,
[m         );
         let vwap_queue = Arc::new(
             LockFreeRingBuffer::new(4096)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:196:
[31m-                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?
[m[32m+                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?,
[m         );
         let iceberg_queue = Arc::new(
             LockFreeRingBuffer::new(4096)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:200:
[31m-                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?
[m[32m+                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?,
[m         );
[31m-        
[m[32m+
[m         // Initialize execution reports buffer
         let execution_reports = Arc::new(
             LockFreeRingBuffer::new(10000)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:206:
[31m-                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?
[m[32m+                .map_err(|e| ExecutionError::InitializationError(e.to_string()))?,
[m         );
[31m-        
[m[32m+
[m         // Initialize fill notification channel
         let (fill_tx, _fill_rx) = mpsc::unbounded_channel();
[31m-        
[m[32m+
[m         // Initialize broker router
         let (execution_tx, _execution_rx) = mpsc::unbounded_channel();
         // AssetClassificationManager::new() takes no arguments
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:215:
         let asset_classifier = config::asset_classification::AssetClassificationManager::new();
[31m-        
[m[32m+
[m         // BrokerRouter::new expects a single BrokerConfig, not HashMap
         // Use first available broker config or create default
         let first_broker_config = broker_configs.values().next().cloned().unwrap_or_default();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:220:
[31m-        let broker_router = Arc::new(BrokerRouter::new(first_broker_config, execution_tx, asset_classifier).await?);
[m[32m+        let broker_router =
[m[32m+            Arc::new(BrokerRouter::new(first_broker_config, execution_tx, asset_classifier).await?);
[m 
         // Initialize OrderValidator with config-based limits
         let order_validator = Arc::new(OrderValidator::new(
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:224:
[31m-            config.max_order_size,           // From TradingConfig
[m[31m-            0.001,                            // min_order_size - conservative default
[m[31m-            5.0,                              // max_price_deviation - 5% default
[m[31m-            false,                            // enable_symbol_validation - disabled by default
[m[31m-            None,                             // allowed_symbols - no restriction by default
[m[32m+            config.max_order_size, // From TradingConfig
[m[32m+            0.001,                 // min_order_size - conservative default
[m[32m+            5.0,                   // max_price_deviation - 5% default
[m[32m+            false,                 // enable_symbol_validation - disabled by default
[m[32m+            None,                  // allowed_symbols - no restriction by default
[m         ));
 
         Ok(Self {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:250:
             broker_configs,
         })
     }
[31m-    
[m[32m+
[m     /// Execute order with smart routing - REAL PRODUCTION IMPLEMENTATION
[31m-    pub async fn execute_order(&self, instruction: ExecutionInstruction) -> Result<String, ExecutionError> {
[m[32m+    pub async fn execute_order(
[m[32m+        &self,
[m[32m+        instruction: ExecutionInstruction,
[m[32m+    ) -> Result<String, ExecutionError> {
[m         let mut latency_tracker = LatencyMeasurement::start();
         let execution_id = format!("exec_{}", self.sequence_generator.next());
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:259:
[31m-        info!("Starting execution: {} for order {} ({})",
[m[31m-              execution_id, instruction.order_id, instruction.symbol);
[m[32m+        info!(
[m[32m+            "Starting execution: {} for order {} ({})",
[m[32m+            execution_id, instruction.order_id, instruction.symbol
[m[32m+        );
[m 
         // COMPREHENSIVE PRE-EXECUTION VALIDATION (BEFORE risk check)
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:264:
         // 1. Validate order size
[31m-        self.order_validator.validate_order_size(instruction.quantity)
[m[31m-            .map_err(|e| ExecutionError::ValidationFailed(format!("Order size validation failed: {}", e)))?;
[m[32m+        self.order_validator
[m[32m+            .validate_order_size(instruction.quantity)
[m[32m+            .map_err(|e| {
[m[32m+                ExecutionError::ValidationFailed(format!("Order size validation failed: {}", e))
[m[32m+            })?;
[m 
         // 2. Validate symbol
[31m-        self.order_validator.validate_symbol(&instruction.symbol)
[m[31m-            .map_err(|e| ExecutionError::ValidationFailed(format!("Symbol validation failed: {}", e)))?;
[m[32m+        self.order_validator
[m[32m+            .validate_symbol(&instruction.symbol)
[m[32m+            .map_err(|e| {
[m[32m+                ExecutionError::ValidationFailed(format!("Symbol validation failed: {}", e))
[m[32m+            })?;
[m 
         // 3. Validate price if limit order
         if let Some(limit_price) = instruction.limit_price {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:274:
             // For price validation, we need market price - use limit_price as proxy for now
             // TODO: Get real market price from market data feed when available
[31m-            self.order_validator.validate_price(limit_price, limit_price)
[m[31m-                .map_err(|e| ExecutionError::ValidationFailed(format!("Price validation failed: {}", e)))?;
[m[32m+            self.order_validator
[m[32m+                .validate_price(limit_price, limit_price)
[m[32m+                .map_err(|e| {
[m[32m+                    ExecutionError::ValidationFailed(format!("Price validation failed: {}", e))
[m[32m+                })?;
[m         }
 
         // 4. Validate order type and time-in-force combination
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:291:
             TimeInForce::ImmediateOrCancel => "IOC",
             TimeInForce::FillOrKill => "FOK",
         };
[31m-        self.order_validator.validate_order_type(order_type_str, tif_str)
[m[31m-            .map_err(|e| ExecutionError::ValidationFailed(format!("Order type validation failed: {}", e)))?;
[m[32m+        self.order_validator
[m[32m+            .validate_order_type(order_type_str, tif_str)
[m[32m+            .map_err(|e| {
[m[32m+                ExecutionError::ValidationFailed(format!("Order type validation failed: {}", e))
[m[32m+            })?;
[m 
         // REAL PRE-EXECUTION RISK CHECK (after validation)
[31m-        self.risk_manager.validate_order(
[m[31m-            "system", // Account derived from instruction
[m[31m-            &instruction.symbol,
[m[31m-            instruction.quantity,
[m[31m-            instruction.limit_price.unwrap_or(0.0),
[m[31m-        ).await.map_err(|_| ExecutionError::RiskCheckFailed)?;
[m[31m-        
[m[32m+        self.risk_manager
[m[32m+            .validate_order(
[m[32m+                "system", // Account derived from instruction
[m[32m+                &instruction.symbol,
[m[32m+                instruction.quantity,
[m[32m+                instruction.limit_price.unwrap_or(0.0),
[m[32m+            )
[m[32m+            .await
[m[32m+            .map_err(|_| ExecutionError::RiskCheckFailed)?;
[m[32m+
[m         // REAL VENUE SELECTION ALGORITHM
         let optimal_venue = self.select_optimal_venue(&instruction).await?;
[31m-        let routing_decision = self.make_routing_decision(&instruction, optimal_venue).await?;
[m[31m-        
[m[32m+        let routing_decision = self
[m[32m+            .make_routing_decision(&instruction, optimal_venue)
[m[32m+            .await?;
[m[32m+
[m         // Store active instruction
         {
             let mut active = self.active_instructions.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:312:
             active.insert(execution_id.clone(), instruction.clone());
         }
[31m-        
[m[32m+
[m         // Route to appropriate execution algorithm
         match instruction.algorithm {
             ExecutionAlgorithm::Market => {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:318:
[31m-                self.execute_market_order(&instruction, &routing_decision).await?;
[m[32m+                self.execute_market_order(&instruction, &routing_decision)
[m[32m+                    .await?;
[m             },
             ExecutionAlgorithm::TWAP => {
[31m-                self.execute_twap_order(&instruction, &routing_decision).await?;
[m[32m+                self.execute_twap_order(&instruction, &routing_decision)
[m[32m+                    .await?;
[m             },
             ExecutionAlgorithm::VWAP => {
[31m-                self.execute_vwap_order(&instruction, &routing_decision).await?;
[m[32m+                self.execute_vwap_order(&instruction, &routing_decision)
[m[32m+                    .await?;
[m             },
             ExecutionAlgorithm::Iceberg => {
[31m-                self.execute_iceberg_order(&instruction, &routing_decision).await?;
[m[32m+                self.execute_iceberg_order(&instruction, &routing_decision)
[m[32m+                    .await?;
[m             },
             ExecutionAlgorithm::Sniper => {
[31m-                self.execute_sniper_order(&instruction, &routing_decision).await?;
[m[32m+                self.execute_sniper_order(&instruction, &routing_decision)
[m[32m+                    .await?;
[m             },
             ExecutionAlgorithm::CrossOnly => {
                 self.execute_cross_only_order(&instruction).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:334:
             },
         }
[31m-        
[m[32m+
[m         // Record execution metrics
         let execution_time = latency_tracker.finish();
         self.latency_tracker.record_order_processing(execution_time);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:340:
[31m-        self.execution_state.total_executions.fetch_add(1, Ordering::Relaxed);
[m[31m-        
[m[32m+        self.execution_state
[m[32m+            .total_executions
[m[32m+            .fetch_add(1, Ordering::Relaxed);
[m[32m+
[m         // Update average execution time with exponential moving average
[31m-        let current_avg = self.execution_state.avg_execution_time_ns.load(Ordering::Relaxed);
[m[32m+        let current_avg = self
[m[32m+            .execution_state
[m[32m+            .avg_execution_time_ns
[m[32m+            .load(Ordering::Relaxed);
[m         let new_avg = if current_avg == 0 {
             execution_time
         } else {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:347:
             (current_avg * 9 + execution_time) / 10 // EMA with α = 0.1
         };
[31m-        self.execution_state.avg_execution_time_ns.store(new_avg, Ordering::Relaxed);
[m[31m-        
[m[31m-        info!("Execution {} completed in {}ns", execution_id, execution_time);
[m[32m+        self.execution_state
[m[32m+            .avg_execution_time_ns
[m[32m+            .store(new_avg, Ordering::Relaxed);
[m[32m+
[m[32m+        info!(
[m[32m+            "Execution {} completed in {}ns",
[m[32m+            execution_id, execution_time
[m[32m+        );
[m         Ok(execution_id)
     }
[31m-    
[m[32m+
[m     /// SIMPLIFIED VENUE SELECTION - Preference-based routing
     ///
     /// TODO: Future enhancement - Implement smart routing with real market data
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:360:
     /// - Spread tightness calculations
     /// - Historical fill rate tracking
     /// - Market impact estimates
[31m-    async fn select_optimal_venue(&self, instruction: &ExecutionInstruction) -> Result<ExecutionVenue, ExecutionError> {
[m[32m+    async fn select_optimal_venue(
[m[32m+        &self,
[m[32m+        instruction: &ExecutionInstruction,
[m[32m+    ) -> Result<ExecutionVenue, ExecutionError> {
[m         // Use venue preference if specified, otherwise default to ICMarkets
[31m-        let venue = instruction.venue_preference.unwrap_or(ExecutionVenue::ICMarkets);
[m[31m-        debug!("Selected venue {:?} for {} execution", venue, instruction.symbol);
[m[32m+        let venue = instruction
[m[32m+            .venue_preference
[m[32m+            .unwrap_or(ExecutionVenue::ICMarkets);
[m[32m+        debug!(
[m[32m+            "Selected venue {:?} for {} execution",
[m[32m+            venue, instruction.symbol
[m[32m+        );
[m         Ok(venue)
     }
[31m-    
[m[32m+
[m     /// REAL MARKET ORDER EXECUTION with atomic state management
     async fn execute_market_order(
         &self,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:374:
         routing: &RoutingDecision,
     ) -> Result<(), ExecutionError> {
         let mut latency_tracker = LatencyMeasurement::start();
[31m-        
[m[32m+
[m         match routing.venue {
             ExecutionVenue::ICMarkets => {
                 self.execute_on_icmarkets(instruction, routing).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:389:
                 self.execute_on_dark_pool(instruction, routing).await?;
             },
         }
[31m-        
[m[32m+
[m         let execution_time = latency_tracker.finish();
         debug!("Market order execution completed in {}ns", execution_time);
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// REAL TWAP EXECUTION ALGORITHM
     async fn execute_twap_order(
         &self,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:410:
         let participation_rate = instruction.max_participation_rate.unwrap_or(0.1); // 10% default
         let total_quantity = instruction.quantity;
         let execution_time_seconds = 300; // 5 minutes default
[31m-        
[m[32m+
[m         // Calculate TWAP slice parameters
         let slices = 20; // Execute over 20 intervals
         let slice_size = total_quantity / slices as f64;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:417:
         let slice_interval_ms = (execution_time_seconds * 1000) / slices;
[31m-        
[m[31m-        info!("Starting TWAP execution: {} slices of {} over {}s", 
[m[31m-              slices, slice_size, execution_time_seconds);
[m[31m-        
[m[32m+
[m[32m+        info!(
[m[32m+            "Starting TWAP execution: {} slices of {} over {}s",
[m[32m+            slices, slice_size, execution_time_seconds
[m[32m+        );
[m[32m+
[m         // Execute slices with timing control
         for slice_idx in 0..slices {
             let slice_instruction = ExecutionInstruction {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:437:
                 time_in_force: instruction.time_in_force,
                 min_fill_size: instruction.min_fill_size,
             };
[31m-            
[m[32m+
[m             // Execute slice
[31m-            self.execute_market_order(&slice_instruction, routing).await?;
[m[31m-            
[m[32m+            self.execute_market_order(&slice_instruction, routing)
[m[32m+                .await?;
[m[32m+
[m             // Wait for next slice interval (except last slice)
             if slice_idx < slices - 1 {
                 tokio::time::sleep(tokio::time::Duration::from_millis(slice_interval_ms)).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:447:
             }
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// SIMPLIFIED VWAP EXECUTION ALGORITHM
     ///
     /// TODO: Future enhancement - Implement real VWAP with volume profile
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:466:
         warn!("VWAP execution falling back to TWAP - volume profile not available");
         self.execute_twap_order(instruction, routing).await
     }
[31m-    
[m[32m+
[m     /// REAL ICEBERG EXECUTION with dynamic slice sizing
     async fn execute_iceberg_order(
         &self,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:473:
         instruction: &ExecutionInstruction,
         routing: &RoutingDecision,
     ) -> Result<(), ExecutionError> {
[31m-        let slice_size = instruction.iceberg_slice_size.unwrap_or(instruction.quantity * 0.1); // 10% default
[m[32m+        let slice_size = instruction
[m[32m+            .iceberg_slice_size
[m[32m+            .unwrap_or(instruction.quantity * 0.1); // 10% default
[m         let mut remaining_quantity = instruction.quantity;
         let mut slice_count = 0;
[31m-        
[m[32m+
[m         while remaining_quantity > 0.0 {
             let current_slice = slice_size.min(remaining_quantity);
             slice_count += 1;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:483:
[31m-            
[m[32m+
[m             let slice_instruction = ExecutionInstruction {
                 order_id: format!("{}_iceberg_{}", instruction.order_id, slice_count),
                 symbol: instruction.symbol.clone(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:497:
                 time_in_force: instruction.time_in_force,
                 min_fill_size: instruction.min_fill_size,
             };
[31m-            
[m[32m+
[m             // Execute slice
[31m-            self.execute_market_order(&slice_instruction, routing).await?;
[m[31m-            
[m[32m+            self.execute_market_order(&slice_instruction, routing)
[m[32m+                .await?;
[m[32m+
[m             remaining_quantity -= current_slice;
[31m-            
[m[32m+
[m             // Brief pause between slices to avoid detection
             if remaining_quantity > 0.0 {
                 tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:509:
             }
         }
[31m-        
[m[32m+
[m         info!("Iceberg execution completed: {} slices", slice_count);
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:515:
[31m-    
[m[32m+
[m     /// SIMPLIFIED LIQUIDITY SNIPER ALGORITHM
     ///
     /// TODO: Future enhancement - Implement real liquidity sniping
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:529:
         warn!("Sniper execution falling back to immediate market order - order book feed not available");
         self.execute_market_order(instruction, routing).await
     }
[31m-    
[m[32m+
[m     /// REAL INTERNAL CROSSING ENGINE
[31m-    async fn execute_cross_only_order(&self, instruction: &ExecutionInstruction) -> Result<(), ExecutionError> {
[m[32m+    async fn execute_cross_only_order(
[m[32m+        &self,
[m[32m+        instruction: &ExecutionInstruction,
[m[32m+    ) -> Result<(), ExecutionError> {
[m         // Check for internal crossing opportunities
         let cross_opportunity = self.find_internal_cross(instruction).await?;
[31m-        
[m[32m+
[m         if let Some(cross) = cross_opportunity {
[31m-            info!("Internal cross found: {} {} @ {} vs internal order", 
[m[31m-                  cross.quantity, instruction.symbol, cross.price);
[m[31m-            
[m[32m+            info!(
[m[32m+                "Internal cross found: {} {} @ {} vs internal order",
[m[32m+                cross.quantity, instruction.symbol, cross.price
[m[32m+            );
[m[32m+
[m             // Execute atomic cross
             self.execute_atomic_cross(instruction, &cross).await?;
[31m-            
[m[32m+
[m             // Update metrics
[31m-            self.execution_state.internal_crosses.fetch_add(1, Ordering::Relaxed);
[m[32m+            self.execution_state
[m[32m+                .internal_crosses
[m[32m+                .fetch_add(1, Ordering::Relaxed);
[m         } else {
             // No internal cross available - add to crossing pool
             self.add_to_crossing_pool(instruction).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:550:
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Get execution engine metrics
     pub fn get_metrics(&self) -> ExecutionEngineMetrics {
         let state = &self.execution_state;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:558:
[31m-        
[m[32m+
[m         ExecutionEngineMetrics {
             total_executions: state.total_executions.load(Ordering::Relaxed),
             total_volume: self.fixed_to_f64(state.total_volume.load(Ordering::Relaxed)),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:567:
             dark_pool_executions: state.dark_pool_executions.load(Ordering::Relaxed),
             fill_rate_pct: self.fixed_to_f64(state.fill_rate_pct.load(Ordering::Relaxed)),
             slippage_bps: self.fixed_to_f64(state.slippage_bps.load(Ordering::Relaxed)),
[31m-            execution_shortfall_bps: self.fixed_to_f64(state.execution_shortfall_bps.load(Ordering::Relaxed)),
[m[32m+            execution_shortfall_bps: self
[m[32m+                .fixed_to_f64(state.execution_shortfall_bps.load(Ordering::Relaxed)),
[m             market_impact_bps: self.fixed_to_f64(state.market_impact_bps.load(Ordering::Relaxed)),
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:574:
[31m-    
[m[32m+
[m     // Helper methods will be implemented based on actual broker APIs...
[31m-    
[m[31m-    async fn make_routing_decision(&self, _instruction: &ExecutionInstruction, venue: ExecutionVenue) -> Result<RoutingDecision, ExecutionError> {
[m[32m+
[m[32m+    async fn make_routing_decision(
[m[32m+        &self,
[m[32m+        _instruction: &ExecutionInstruction,
[m[32m+        venue: ExecutionVenue,
[m[32m+    ) -> Result<RoutingDecision, ExecutionError> {
[m         Ok(RoutingDecision {
             venue,
             routing_strategy: RoutingStrategy::Direct,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:582:
             estimated_slippage_bps: 1.0,
         })
     }
[31m-    
[m[32m+
[m     fn fixed_to_f64(&self, fixed: u64) -> f64 {
         fixed as f64 / 10000.0
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/execution_engine.rs:589:
[31m-    
[m[32m+
[m     // Placeholder implementations for broker-specific methods
[31m-    async fn execute_on_icmarkets(&self, instruction: &ExecutionInstruction, _routing: &RoutingDecision) -> Result<(), ExecutionError> {
[m[32m+    async fn execute_on_icmarkets(
[m[32m+        &self,
[m[32m+        instruction: &ExecutionInstruction,
[m[32m+        _routing: &RoutingDecision,
[m[32m+    ) -> Result<(), ExecutionError> {
[m         debug!("Executing on IC Markets: {}", instruction.order_id);
[31m-        self.execution_state.icmarkets_executions.fetch_add(1, Ordering::Relaxed);
[m[32m+        self.execution_state
[m[32m+            .icmarkets_executions
[m[32m+            .fetch_add(1, Ordering::Relaxed);
[m         Ok(())
     }
[31m-    
[m[31m-    async fn execute_on_ibkr(&self, instruction: &ExecutionInstruction, _routing: &RoutingDecision) -> Result<(), ExecutionError> {
[m[32m+
[m[32m+    async fn execute_on_ibkr(
[m[32m+        &self,
[m[32m+        instruction: &ExecutionInstruction,
[m[32m+        _routing: &RoutingDecision,
[m[32m+    ) -> Result<(), ExecutionError> {
[m         debug!("Executing on IBKR: {}", instruction.order_id);
[31m-        self.execution_state.ibkr_executions.fetch_add(1, Ordering::Relaxed);
[m[32m+        self.execution_state
[m[32m+            .ibkr_executions
[m[32m+            .fetch_add(1, Ordering::Relaxed);
[m         Ok(())
     }
[31m-    
[m[31m-    async fn execute_internal_cross(&self, instruction: &ExecutionInstruction) -> Result<(), ExecutionError> {
[m[32m+
[m[32m+    async fn execute_internal_cross(
[m[32m+        &self,
[m[32m+        instruction: &ExecutionInstruction,
[m[32m+    ) -> Result<(), ExecutionError> {
[m         debug!("Executing internal cross: {}", instruction.order_id);
[31m-        self.execution_state.internal_crosses.fetch_add(1, Ordering::Relaxed);
[m[32m+        self.execution_state
[m[32m+            .internal_crosses
[m[32m+            .fetch_add(1, Ordering::Relaxed);
[m         Ok(())
     }
[31m-    
[m[31m-    async fn execute_on_dark_pool(&self, instruction: &ExecutionInstruction, _routing: &RoutingDecision) -> Result<(), ExecutionError> {
[m[32m+
[m[32m+    async fn execute_on_dark_pool(
[m[32m+        &self,
[m[32m+        instruction: &ExecutionInstruction,
[m[32m+        _routing: &RoutingDecision,
[m[32m+    ) -> Result<(), ExecutionError> {
[m         debug!("Executing on dark pool: {}", instruction.order_id);
[31m-        self.execution_state.dark_pool_executions.fetch_add(1, Ordering::Relaxed);
[m[32m+        self.execution_state
[m[32m+            .dark_pool_executions
[m[32m+            .fetch_add(1, Ordering::Relaxed);
[m         Ok(())
     }
[31m-    
[m[32m+
[m     // Additional helper method stubs...
[31m-    async fn execute_volume_weighted_slices(&self, _instruction: &ExecutionInstruction, _routing: &RoutingDecision, _profile: &VolumeProfile, _vwap_target: f64) -> Result<(), ExecutionError> { Ok(()) }
[m[31m-    async fn detect_sniping_opportunity(&self, _book_update: &BookUpdate, _instruction: &ExecutionInstruction) -> Result<SnipingOpportunity, ExecutionError> {
[m[31m-        Ok(SnipingOpportunity { is_attractive: false, price: 0.0, size: 0.0 })
[m[32m+    async fn execute_volume_weighted_slices(
[m[32m+        &self,
[m[32m+        _instruction: &ExecutionInstruction,
[m[32m+        _routing: &RoutingDecision,
[m[32m+        _profile: &VolumeProfile,
[m[32m+        _vwap_target: f64,
[m[32m+    ) -> Result<(), ExecutionError> {
[m[32m+        Ok(())
[m     }
[31m-    async fn find_internal_cross(&self, _instruction: &ExecutionInstruction) -> Result<Option<CrossOpportunity>, ExecutionError> { Ok(None) }
[m[31m-    async fn execute_atomic_cross(&self, _instruction: &ExecutionInstruction, _cross: &CrossOpportunity) -> Result<(), ExecutionError> { Ok(()) }
[m[31m-    async fn add_to_crossing_pool(&self, _instruction: &ExecutionInstruction) -> Result<(), ExecutionError> { Ok(()) }
[m[32m+    async fn detect_sniping_opportunity(
[m[32m+        &self,
[m[32m+        _book_update: &BookUpdate,
[m[32m+        _instruction: &ExecutionInstruction,
[m[32m+    ) -> Result<SnipingOpportunity, ExecutionError> {
[m[32m+        Ok(SnipingOpportunity {
[m[32m+            is_attractive: false,
[m[32m+            price: 0.0,
[m[32m+            size: 0.0,
[m[32m+        })
[m[32m+    }
[m[32m+    async fn find_internal_cross(
[m[32m+        &self,
[m[32m+        _instruction: &ExecutionInstruction,
[m[32m+    ) -> Result<Option<CrossOpportunity>, ExecutionError> {
[m[32m+        Ok(None)
[m[32m+    }
[m[32m+    async fn execute_atomic_cross(
[m[32m+        &self,
[m[32m+        _instruction: &ExecutionInstruction,
[m[32m+        _cross: &CrossOpportunity,
[m[32m+    ) -> Result<(), ExecutionError> {
[m[32m+        Ok(())
[m[32m+    }
[m[32m+    async fn add_to_crossing_pool(
[m[32m+        &self,
[m[32m+        _instruction: &ExecutionInstruction,
[m[32m+    ) -> Result<(), ExecutionError> {
[m[32m+        Ok(())
[m[32m+    }
[m }
 
 // Supporting types and structures
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:8:
 //! - Comprehensive latency monitoring and performance metrics
 //! - Failover and reconnection handling
 
[32m+use serde::{Deserialize, Serialize};
[m use std::collections::HashMap;
[31m-use std::sync::atomic::{AtomicU64, AtomicBool, Ordering};
[m[32m+use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
[m use std::sync::Arc;
[31m-use tokio::sync::{RwLock, broadcast};
[m[32m+use tokio::sync::{broadcast, RwLock};
[m use tokio::time::Duration;
[31m-use tracing::{debug, info, warn, error};
[m[31m-use serde::{Deserialize, Serialize};
[m[32m+use tracing::{debug, error, info, warn};
[m 
 // Core components
[31m-use trading_engine::lockfree::{AtomicMetrics, SequenceGenerator, LockFreeRingBuffer};
[m[32m+use trading_engine::lockfree::{AtomicMetrics, LockFreeRingBuffer, SequenceGenerator};
[m use trading_engine::timing::HardwareTimestamp;
 
 // Network and data handling
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:24:
[31m-use tokio_tungstenite::{connect_async, tungstenite::Message};
[m use futures_util::{SinkExt, StreamExt};
 use reqwest::Client as HttpClient;
[32m+use tokio_tungstenite::{connect_async, tungstenite::Message};
[m 
 // Configuration and types
 use config::structures::MarketDataConfig;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:109:
     connection_state: Arc<AtomicU64>, // Cast from ConnectionState
     websocket_url: String,
     api_key: String,
[31m-    
[m[32m+
[m     // Data processing
     tick_buffer: Arc<LockFreeRingBuffer<MarketTick>>,
     order_books: Arc<RwLock<HashMap<String, OrderBook>>>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:116:
[31m-    
[m[32m+
[m     // Distribution channels
     tick_sender: Arc<broadcast::Sender<MarketTick>>,
     book_sender: Arc<broadcast::Sender<OrderBook>>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:120:
[31m-    
[m[32m+
[m     // High-performance timing
     // Timing using HardwareTimestamp::now() directly
     sequence_generator: Arc<SequenceGenerator>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:124:
[31m-    
[m[32m+
[m     // Performance metrics
     metrics: Arc<AtomicMetrics>,
     stats: Arc<RwLock<MarketDataStats>>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:128:
     message_count: AtomicU64,
     drop_count: AtomicU64,
[31m-    
[m[32m+
[m     // Subscriptions
     subscribed_symbols: Arc<RwLock<HashMap<String, u64>>>, // symbol -> hash
     subscription_filters: Arc<RwLock<Vec<String>>>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:134:
[31m-    
[m[32m+
[m     // Configuration
     config: Arc<MarketDataConfig>,
[31m-    
[m[32m+
[m     // Connection monitoring
     last_heartbeat: AtomicU64,
     reconnect_attempts: AtomicU64,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:141:
     is_running: AtomicBool,
[31m-    
[m[32m+
[m     // HTTP client for REST API
     http_client: Arc<HttpClient>,
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:153:
         config: MarketDataConfig,
         tick_buffer_size: usize,
     ) -> Result<Self, Box<dyn std::error::Error + Send + Sync>> {
[31m-        
[m         // Initialize tick buffer
[31m-        let tick_buffer = Arc::new(LockFreeRingBuffer::new(tick_buffer_size)
[m[31m-            .map_err(|e| format!("Failed to create tick buffer: {}", e))?);
[m[31m-        
[m[32m+        let tick_buffer = Arc::new(
[m[32m+            LockFreeRingBuffer::new(tick_buffer_size)
[m[32m+                .map_err(|e| format!("Failed to create tick buffer: {}", e))?,
[m[32m+        );
[m[32m+
[m         // Create broadcast channels for distribution
         let (tick_sender, _) = broadcast::channel(10000);
         let (book_sender, _) = broadcast::channel(1000);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:164:
[31m-        
[m[32m+
[m         // Initialize HTTP client with appropriate timeouts
[31m-        let http_client = Arc::new(HttpClient::builder()
[m[31m-            .timeout(Duration::from_secs(10))
[m[31m-            .tcp_keepalive(Duration::from_secs(60))
[m[31m-            .build()?);
[m[31m-        
[m[32m+        let http_client = Arc::new(
[m[32m+            HttpClient::builder()
[m[32m+                .timeout(Duration::from_secs(10))
[m[32m+                .tcp_keepalive(Duration::from_secs(60))
[m[32m+                .build()?,
[m[32m+        );
[m[32m+
[m         // Build WebSocket URL
[31m-        let websocket_url = format!("{}://{}:{}/ws",
[m[32m+        let websocket_url = format!(
[m[32m+            "{}://{}:{}/ws",
[m             if config.use_ssl { "wss" } else { "ws" },
             config.host,
             config.websocket_port
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:176:
         );
[31m-        
[m[32m+
[m         Ok(Self {
             connection_state: Arc::new(AtomicU64::new(ConnectionState::Disconnected as u64)),
             websocket_url,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:206:
             http_client,
         })
     }
[31m-    
[m[32m+
[m     /// Start market data ingestion
     pub async fn start(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[31m-        if self.is_running.compare_exchange(false, true, Ordering::AcqRel, Ordering::Relaxed).is_err() {
[m[32m+        if self
[m[32m+            .is_running
[m[32m+            .compare_exchange(false, true, Ordering::AcqRel, Ordering::Relaxed)
[m[32m+            .is_err()
[m[32m+        {
[m             return Err("Market data ingestion already running".into());
         }
[31m-        
[m[32m+
[m         info!("Starting Databento market data ingestion...");
[31m-        
[m[32m+
[m         // Start connection manager
         let connection_manager = self.clone_for_async();
         tokio::spawn(async move {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:221:
             connection_manager.connection_manager().await;
         });
[31m-        
[m[32m+
[m         // Start heartbeat monitor
         let heartbeat_monitor = self.clone_for_async();
         tokio::spawn(async move {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:227:
             heartbeat_monitor.heartbeat_monitor().await;
         });
[31m-        
[m[32m+
[m         // Start statistics updater
         let stats_updater = self.clone_for_async();
         tokio::spawn(async move {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:233:
             stats_updater.update_statistics().await;
         });
[31m-        
[m[32m+
[m         info!("Databento market data ingestion started");
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:239:
[31m-    
[m[32m+
[m     /// Stop market data ingestion
     pub async fn stop(&self) {
         info!("Stopping Databento market data ingestion...");
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:243:
         self.is_running.store(false, Ordering::Release);
[31m-        self.connection_state.store(ConnectionState::Disconnected as u64, Ordering::Release);
[m[32m+        self.connection_state
[m[32m+            .store(ConnectionState::Disconnected as u64, Ordering::Release);
[m     }
[31m-    
[m[32m+
[m     /// Subscribe to symbols
[31m-    pub async fn subscribe_symbols(&self, symbols: Vec<String>) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m[32m+    pub async fn subscribe_symbols(
[m[32m+        &self,
[m[32m+        symbols: Vec<String>,
[m[32m+    ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m         let mut subscriptions = self.subscribed_symbols.write().await;
         let mut filters = self.subscription_filters.write().await;
[31m-        
[m[32m+
[m         for symbol in symbols {
             let hash = self.calculate_symbol_hash(&symbol);
             subscriptions.insert(symbol.clone(), hash);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:255:
             filters.push(symbol);
         }
[31m-        
[m[32m+
[m         info!("Subscribed to {} symbols", filters.len());
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:261:
[31m-    
[m[32m+
[m     /// Get tick data subscriber
     pub fn subscribe_ticks(&self) -> broadcast::Receiver<MarketTick> {
         self.tick_sender.subscribe()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:265:
     }
[31m-    
[m[32m+
[m     /// Get order book subscriber  
     pub fn subscribe_order_books(&self) -> broadcast::Receiver<OrderBook> {
         self.book_sender.subscribe()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:270:
     }
[31m-    
[m[32m+
[m     /// Get current order book
     pub async fn get_order_book(&self, symbol: &str) -> Option<OrderBook> {
         let books = self.order_books.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:275:
         books.get(symbol).cloned()
     }
[31m-    
[m[32m+
[m     /// Get ingestion statistics
     pub async fn get_stats(&self) -> MarketDataStats {
         self.stats.read().await.clone()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:281:
     }
[31m-    
[m[32m+
[m     // Internal methods
[31m-    
[m[32m+
[m     fn clone_for_async(&self) -> Self {
         Self {
             connection_state: Arc::clone(&self.connection_state),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:305:
             http_client: Arc::clone(&self.http_client),
         }
     }
[31m-    
[m[32m+
[m     async fn connection_manager(&self) {
         while self.is_running.load(Ordering::Acquire) {
             match self.connect_and_process().await {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:312:
                 Ok(()) => {
                     info!("WebSocket connection closed normally");
                     self.reconnect_attempts.store(0, Ordering::Relaxed);
[31m-                }
[m[32m+                },
[m                 Err(e) => {
                     error!("WebSocket connection error: {}", e);
                     let attempts = self.reconnect_attempts.fetch_add(1, Ordering::Relaxed);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:319:
[31m-                    
[m[32m+
[m                     // Exponential backoff with jitter
                     let backoff_ms = std::cmp::min(1000 * (1 << attempts), 60000);
                     let jitter = fastrand::u64(0..=backoff_ms / 4);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:323:
                     let delay = Duration::from_millis(backoff_ms + jitter);
[31m-                    
[m[31m-                    warn!("Reconnecting in {}ms (attempt {})", backoff_ms + jitter, attempts + 1);
[m[32m+
[m[32m+                    warn!(
[m[32m+                        "Reconnecting in {}ms (attempt {})",
[m[32m+                        backoff_ms + jitter,
[m[32m+                        attempts + 1
[m[32m+                    );
[m                     tokio::time::sleep(delay).await;
[31m-                }
[m[32m+                },
[m             }
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:331:
[31m-    
[m[32m+
[m     async fn connect_and_process(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[31m-        self.connection_state.store(ConnectionState::Connecting as u64, Ordering::Release);
[m[31m-        
[m[32m+        self.connection_state
[m[32m+            .store(ConnectionState::Connecting as u64, Ordering::Release);
[m[32m+
[m         // Connect to WebSocket
         // FIX: IntoClientRequest requires &str, not Url
         let url_str = self.websocket_url.as_str();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:338:
         let (ws_stream, _) = connect_async(url_str).await?;
         let (mut ws_sender, mut ws_receiver) = ws_stream.split();
[31m-        
[m[31m-        self.connection_state.store(ConnectionState::Connected as u64, Ordering::Release);
[m[32m+
[m[32m+        self.connection_state
[m[32m+            .store(ConnectionState::Connected as u64, Ordering::Release);
[m         info!("Connected to Databento WebSocket");
[31m-        
[m[32m+
[m         // Authenticate
         let auth_message = serde_json::json!({
             "action": "auth",
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:347:
             "key": self.api_key,
             "ts": HardwareTimestamp::now().as_nanos() / 1_000_000 // Convert to milliseconds
         });
[31m-        
[m[31m-        ws_sender.send(Message::Text(auth_message.to_string())).await?;
[m[31m-        self.connection_state.store(ConnectionState::Authenticating as u64, Ordering::Release);
[m[31m-        
[m[32m+
[m[32m+        ws_sender
[m[32m+            .send(Message::Text(auth_message.to_string()))
[m[32m+            .await?;
[m[32m+        self.connection_state
[m[32m+            .store(ConnectionState::Authenticating as u64, Ordering::Release);
[m[32m+
[m         // Subscribe to symbols
         let filters = self.subscription_filters.read().await;
         if !filters.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:360:
                 "schema": "mbo", // Market by order
                 "stype_in": "raw_symbol"
             });
[31m-            
[m[31m-            ws_sender.send(Message::Text(subscribe_message.to_string())).await?;
[m[31m-            self.connection_state.store(ConnectionState::Subscribing as u64, Ordering::Release);
[m[32m+
[m[32m+            ws_sender
[m[32m+                .send(Message::Text(subscribe_message.to_string()))
[m[32m+                .await?;
[m[32m+            self.connection_state
[m[32m+                .store(ConnectionState::Subscribing as u64, Ordering::Release);
[m         }
[31m-        
[m[31m-        self.connection_state.store(ConnectionState::Active as u64, Ordering::Release);
[m[32m+
[m[32m+        self.connection_state
[m[32m+            .store(ConnectionState::Active as u64, Ordering::Release);
[m         info!("Databento connection active, processing market data");
[31m-        
[m[32m+
[m         // Process incoming messages
         while let Some(message) = ws_receiver.next().await {
             if !self.is_running.load(Ordering::Acquire) {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:374:
                 break;
             }
[31m-            
[m[32m+
[m             match message? {
                 Message::Binary(data) => {
                     self.process_binary_message(&data).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:380:
[31m-                }
[m[32m+                },
[m                 Message::Text(text) => {
                     self.process_text_message(&text).await?;
[31m-                }
[m[32m+                },
[m                 Message::Ping(data) => {
                     ws_sender.send(Message::Pong(data)).await?;
[31m-                }
[m[32m+                },
[m                 Message::Pong(_) => {
                     // Update heartbeat timestamp
[31m-                    self.last_heartbeat.store(
[m[31m-                        HardwareTimestamp::now().as_nanos(),
[m[31m-                        Ordering::Relaxed
[m[31m-                    );
[m[31m-                }
[m[32m+                    self.last_heartbeat
[m[32m+                        .store(HardwareTimestamp::now().as_nanos(), Ordering::Relaxed);
[m[32m+                },
[m                 Message::Frame(_) => {
                     // Raw frames are handled internally by tungstenite
                     // No action needed
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:397:
[31m-                }
[m[32m+                },
[m                 Message::Close(_) => {
                     info!("WebSocket connection closed by server");
                     break;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:401:
[31m-                }
[m[32m+                },
[m             }
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[31m-    async fn process_binary_message(&self, data: &[u8]) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m[32m+
[m[32m+    async fn process_binary_message(
[m[32m+        &self,
[m[32m+        data: &[u8],
[m[32m+    ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m         let receive_timestamp = HardwareTimestamp::now().as_nanos();
[31m-        
[m[32m+
[m         // Parse Databento binary format (simplified)
         if data.len() < 32 {
             return Ok(()); // Skip malformed messages
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:414:
         }
[31m-        
[m[32m+
[m         // Extract basic fields (this would be more sophisticated in production)
         let message_type = data[0];
         let symbol_hash = u64::from_le_bytes([
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:419:
[31m-            data[8], data[9], data[10], data[11],
[m[31m-            data[12], data[13], data[14], data[15]
[m[32m+            data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15],
[m         ]);
         let exchange_timestamp = u64::from_le_bytes([
[31m-            data[16], data[17], data[18], data[19],
[m[31m-            data[20], data[21], data[22], data[23]
[m[32m+            data[16], data[17], data[18], data[19], data[20], data[21], data[22], data[23],
[m         ]);
         let price = f64::from_le_bytes([
[31m-            data[24], data[25], data[26], data[27],
[m[31m-            data[28], data[29], data[30], data[31]
[m[32m+            data[24], data[25], data[26], data[27], data[28], data[29], data[30], data[31],
[m         ]);
[31m-        
[m[32m+
[m         // Create market tick
         let tick = MarketTick {
             symbol_hash,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:439:
             price,
             quantity: if data.len() >= 40 {
                 f64::from_le_bytes([
[31m-                    data[32], data[33], data[34], data[35],
[m[31m-                    data[36], data[37], data[38], data[39]
[m[32m+                    data[32], data[33], data[34], data[35], data[36], data[37], data[38], data[39],
[m                 ])
[31m-            } else { 0.0 },
[m[32m+            } else {
[m[32m+                0.0
[m[32m+            },
[m             order_count: 1,
             flags: 0,
         };
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:449:
[31m-        
[m[32m+
[m         // Store in buffer (lock-free)
         if let Err(_) = self.tick_buffer.try_push(tick) {
             self.drop_count.fetch_add(1, Ordering::Relaxed);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:454:
         } else {
             // Distribute to subscribers
             let _ = self.tick_sender.send(tick);
[31m-            
[m[32m+
[m             // Update order book if needed
[31m-            if message_type == 3 { // Order book update
[m[32m+            if message_type == 3 {
[m[32m+                // Order book update
[m                 self.update_order_book(tick).await;
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:463:
[31m-        
[m[32m+
[m         self.message_count.fetch_add(1, Ordering::Relaxed);
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[31m-    async fn process_text_message(&self, text: &str) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m[32m+
[m[32m+    async fn process_text_message(
[m[32m+        &self,
[m[32m+        text: &str,
[m[32m+    ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
[m         // Handle control messages (auth responses, status, etc.)
         if let Ok(message) = serde_json::from_str::<serde_json::Value>(text) {
             if let Some(msg_type) = message.get("type").and_then(|v| v.as_str()) {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:473:
                 match msg_type {
                     "auth_success" => {
                         info!("Databento authentication successful");
[31m-                    }
[m[32m+                    },
[m                     "subscription_success" => {
                         info!("Databento subscription successful");
[31m-                    }
[m[32m+                    },
[m                     "heartbeat" => {
[31m-                        self.last_heartbeat.store(
[m[31m-                            HardwareTimestamp::now().as_nanos(),
[m[31m-                            Ordering::Relaxed
[m[31m-                        );
[m[31m-                    }
[m[32m+                        self.last_heartbeat
[m[32m+                            .store(HardwareTimestamp::now().as_nanos(), Ordering::Relaxed);
[m[32m+                    },
[m                     "error" => {
                         if let Some(error_msg) = message.get("message") {
                             error!("Databento error: {}", error_msg);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:489:
                         }
[31m-                    }
[m[32m+                    },
[m                     _ => {
                         debug!("Unknown message type: {}", msg_type);
[31m-                    }
[m[32m+                    },
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:497:
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     async fn update_order_book(&self, tick: MarketTick) {
         // Simplified order book update (production would be more sophisticated)
         let symbol_hash = tick.symbol_hash;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:504:
[31m-        
[m[32m+
[m         // Find symbol by hash (reverse lookup)
         let subscriptions = self.subscribed_symbols.read().await;
[31m-        let symbol = subscriptions.iter()
[m[32m+        let symbol = subscriptions
[m[32m+            .iter()
[m             .find(|(_, &hash)| hash == symbol_hash)
             .map(|(sym, _)| sym.clone());
[31m-        
[m[32m+
[m         if let Some(symbol) = symbol {
             let mut books = self.order_books.write().await;
             let book = books.entry(symbol.clone()).or_insert_with(|| OrderBook {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:519:
                 sequence_number: 0,
                 is_valid: false,
             });
[31m-            
[m[32m+
[m             // Update book (simplified - real implementation would maintain full depth)
             book.last_update_ns = tick.receive_timestamp_ns;
             book.sequence_number = tick.sequence_number;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:526:
             book.is_valid = true;
[31m-            
[m[32m+
[m             // Distribute updated book
             let _ = self.book_sender.send(book.clone());
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:531:
     }
[31m-    
[m[32m+
[m     async fn heartbeat_monitor(&self) {
         let mut interval = tokio::time::interval(Duration::from_secs(30));
[31m-        
[m[32m+
[m         while self.is_running.load(Ordering::Acquire) {
             interval.tick().await;
[31m-            
[m[32m+
[m             let last_heartbeat = self.last_heartbeat.load(Ordering::Relaxed);
             let current_time = HardwareTimestamp::now().as_nanos();
[31m-            
[m[32m+
[m             // Check if we've received a heartbeat in the last 60 seconds
[31m-            if current_time - last_heartbeat > 60_000_000_000 { // 60 seconds
[m[31m-                warn!("No heartbeat received for {} seconds", 
[m[31m-                      (current_time - last_heartbeat) / 1_000_000_000);
[m[31m-                
[m[32m+            if current_time - last_heartbeat > 60_000_000_000 {
[m[32m+                // 60 seconds
[m[32m+                warn!(
[m[32m+                    "No heartbeat received for {} seconds",
[m[32m+                    (current_time - last_heartbeat) / 1_000_000_000
[m[32m+                );
[m[32m+
[m                 // Trigger reconnection if connection seems dead
[31m-                if current_time - last_heartbeat > 120_000_000_000 { // 2 minutes
[m[32m+                if current_time - last_heartbeat > 120_000_000_000 {
[m[32m+                    // 2 minutes
[m                     error!("Connection appears dead, forcing reconnection");
[31m-                    self.connection_state.store(ConnectionState::Error as u64, Ordering::Release);
[m[32m+                    self.connection_state
[m[32m+                        .store(ConnectionState::Error as u64, Ordering::Release);
[m                 }
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:554:
     }
[31m-    
[m[32m+
[m     async fn update_statistics(&self) {
         let mut interval = tokio::time::interval(Duration::from_secs(1));
[31m-        
[m[32m+
[m         while self.is_running.load(Ordering::Acquire) {
             interval.tick().await;
[31m-            
[m[32m+
[m             let mut stats = self.stats.write().await;
             stats.messages_received = self.message_count.load(Ordering::Relaxed);
             stats.messages_dropped = self.drop_count.load(Ordering::Relaxed);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:565:
             stats.messages_processed = stats.messages_received - stats.messages_dropped;
             stats.avg_latency_ns = self.metrics.avg_operation_time_ns();
             stats.last_message_timestamp = HardwareTimestamp::now().as_nanos();
[31m-            
[m[32m+
[m             // Log periodic statistics
             if stats.messages_received % 10000 == 0 && stats.messages_received > 0 {
[31m-                info!("Market data stats: received={}, processed={}, dropped={}, avg_latency={}ns",
[m[31m-                      stats.messages_received,
[m[31m-                      stats.messages_processed,
[m[31m-                      stats.messages_dropped,
[m[31m-                      stats.avg_latency_ns);
[m[32m+                info!(
[m[32m+                    "Market data stats: received={}, processed={}, dropped={}, avg_latency={}ns",
[m[32m+                    stats.messages_received,
[m[32m+                    stats.messages_processed,
[m[32m+                    stats.messages_dropped,
[m[32m+                    stats.avg_latency_ns
[m[32m+                );
[m             }
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:579:
[31m-    
[m[32m+
[m     fn calculate_symbol_hash(&self, symbol: &str) -> u64 {
         use std::collections::hash_map::DefaultHasher;
         use std::hash::{Hash, Hasher};
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:583:
[31m-        
[m[32m+
[m         let mut hasher = DefaultHasher::new();
         symbol.hash(&mut hasher);
         hasher.finish()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:590:
 #[cfg(test)]
 mod tests {
     use super::*;
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_databento_ingestion_creation() {
         let config = MarketDataConfig {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:600:
             use_ssl: false,
             ..Default::default()
         };
[31m-        
[m[32m+
[m         let ingestion = DatabentoIngestion::new(config, 1000).await.unwrap();
[31m-        assert_eq!(ingestion.connection_state.load(Ordering::Relaxed), ConnectionState::Disconnected as u64);
[m[32m+        assert_eq!(
[m[32m+            ingestion.connection_state.load(Ordering::Relaxed),
[m[32m+            ConnectionState::Disconnected as u64
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_symbol_subscription() {
         let config = MarketDataConfig::default();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:611:
         let ingestion = DatabentoIngestion::new(config, 1000).await.unwrap();
[31m-        
[m[32m+
[m         let symbols = vec!["BTCUSD".to_string(), "ETHUSD".to_string()];
         let result = ingestion.subscribe_symbols(symbols).await;
         assert!(result.is_ok());
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:616:
[31m-        
[m[32m+
[m         let subscriptions = ingestion.subscribed_symbols.read().await;
         assert!(subscriptions.contains_key("BTCUSD"));
         assert!(subscriptions.contains_key("ETHUSD"));
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:620:
     }
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_tick_processing() {
         let config = MarketDataConfig::default();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:625:
         let ingestion = DatabentoIngestion::new(config, 1000).await.unwrap();
[31m-        
[m[32m+
[m         // Create mock binary data
         let mut data = vec![0u8; 40];
         data[0] = 1; // Trade message
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:630:
[31m-        
[m[32m+
[m         // This would normally be called internally
         let result = ingestion.process_binary_message(&data).await;
         assert!(result.is_ok());
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/market_data_ingestion.rs:634:
[31m-        
[m[32m+
[m         let stats = ingestion.get_stats().await;
         assert_eq!(stats.messages_received, 1);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:7:
 //! - Atomic updates and memory-safe operations
 //! - Real-time compliance and risk validation
 
[32m+use common::error::CommonError;
[m[32m+use common::OrderStatus;
[m[32m+use common::OrderType;
[m use std::collections::HashMap;
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::sync::Arc;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:13:
 use tokio::sync::RwLock;
[31m-use tracing::{debug, info, warn, error};
[m[31m-use common::OrderStatus;
[m[31m-use common::OrderType;
[m[31m-use common::error::CommonError;
[m[32m+use tracing::{debug, error, info, warn};
[m 
 // Core components - REAL PRODUCTION IMPLEMENTATIONS
 use trading_engine::lockfree::{
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:21:
[31m-    SmallBatchRing, SmallBatchOrdersSoA, BatchMode,
[m[31m-    SequenceGenerator, AtomicMetrics
[m[32m+    AtomicMetrics, BatchMode, SequenceGenerator, SmallBatchOrdersSoA, SmallBatchRing,
[m };
[31m-use trading_engine::timing::{HardwareTimestamp, LatencyMeasurement, HftLatencyTracker};
[m use trading_engine::simd::SimdMarketDataOps;
[32m+use trading_engine::timing::{HardwareTimestamp, HftLatencyTracker, LatencyMeasurement};
[m 
 // Types and configurations
[31m-use config::structures::{TradingConfig, BrokerConfig};
[m[32m+use config::structures::{BrokerConfig, TradingConfig};
[m 
 /// Order book entry for lock-free processing
 #[derive(Debug, Clone, Copy)]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:70:
     // Lock-free order book components
     buy_orders: Arc<SmallBatchRing<OrderBookEntry>>,
     sell_orders: Arc<SmallBatchRing<OrderBookEntry>>,
[31m-    
[m[32m+
[m     // Order tracking and management
     active_orders: Arc<RwLock<HashMap<String, TradingOrder>>>,
[31m-    
[m[32m+
[m     // High-performance components
     sequence_generator: Arc<SequenceGenerator>,
     #[allow(dead_code)]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:80:
     timer: Arc<HardwareTimestamp>,
     #[allow(dead_code)]
     latency_tracker: Arc<HftLatencyTracker>,
[31m-    
[m[32m+
[m     // Batch processing optimization
     order_batch: Arc<RwLock<SmallBatchOrdersSoA>>,
[31m-    
[m[32m+
[m     // Performance metrics
     metrics: Arc<AtomicMetrics>,
     order_count: AtomicUsize,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:90:
     fill_count: AtomicUsize,
[31m-    
[m[32m+
[m     // Configuration
     config: Arc<TradingConfig>,
     broker_config: Arc<BrokerConfig>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:95:
[31m-    
[m[32m+
[m     // Symbol hash cache for fast lookups
     symbol_hashes: Arc<RwLock<HashMap<String, u64>>>,
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:99:
 
 impl OrderManager {
     /// Create new production-grade OrderManager
[31m-    pub async fn new(config: TradingConfig, broker_config: BrokerConfig) -> Result<Self, common::error::CommonError> {
[m[32m+    pub async fn new(
[m[32m+        config: TradingConfig,
[m[32m+        broker_config: BrokerConfig,
[m[32m+    ) -> Result<Self, common::error::CommonError> {
[m         // Initialize lock-free order book rings
[31m-        let buy_orders = Arc::new(
[m[31m-            SmallBatchRing::new(8192, BatchMode::MultiThreaded)
[m[31m-                .map_err(|e| CommonError::internal(format!("Failed to create buy orders ring: {}", e)))?
[m[31m-        );
[m[31m-        
[m[31m-        let sell_orders = Arc::new(
[m[31m-            SmallBatchRing::new(8192, BatchMode::MultiThreaded)
[m[31m-                .map_err(|e| CommonError::internal(format!("Failed to create sell orders ring: {}", e)))?
[m[31m-        );
[m[32m+        let buy_orders = Arc::new(SmallBatchRing::new(8192, BatchMode::MultiThreaded).map_err(
[m[32m+            |e| CommonError::internal(format!("Failed to create buy orders ring: {}", e)),
[m[32m+        )?);
[m 
[32m+        let sell_orders = Arc::new(SmallBatchRing::new(8192, BatchMode::MultiThreaded).map_err(
[m[32m+            |e| CommonError::internal(format!("Failed to create sell orders ring: {}", e)),
[m[32m+        )?);
[m[32m+
[m         // Create broker config with proper selector and commission calculator
         let broker_config = Arc::new(BrokerConfig::default());
[31m-        
[m[32m+
[m         // Initialize high-performance tracking
         let latency_tracker = Arc::new(HftLatencyTracker::default());
[31m-        
[m[32m+
[m         // Initialize sequence generator for order ordering
         let sequence_generator = Arc::new(SequenceGenerator::new());
[31m-        
[m[32m+
[m         // Initialize metrics
         let metrics = Arc::new(AtomicMetrics::new());
[31m-        
[m[32m+
[m         Ok(Self {
             buy_orders,
             sell_orders,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:139:
             symbol_hashes: Arc::new(RwLock::new(HashMap::new())),
         })
     }
[31m-    
[m[32m+
[m     /// Submit order with lock-free processing
     pub async fn submit_order(&self, mut order: TradingOrder) -> Result<String, OrderError> {
         // CRITICAL PATH: <14ns RDTSC timing for order submission
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:146:
         let submit_start = HardwareTimestamp::now();
[31m-    
[m[32m+
[m         // Generate sequence number for ordering - RDTSC timed
         let seq_start = HardwareTimestamp::now();
         let sequence = self.sequence_generator.next();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:151:
         order.sequence = sequence;
         order.timestamp_ns = HardwareTimestamp::now().as_nanos();
         let seq_latency = HardwareTimestamp::now().latency_ns(&seq_start);
[31m-    
[m[32m+
[m         // Track sequence generation latency (target: <5ns)
         if seq_latency > 5 {
             warn!("Sequence generation exceeded 5ns target: {}ns", seq_latency);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:158:
         }
[31m-        
[m[32m+
[m         // Validate order - RDTSC timed (target: <10ns)
         let validate_start = HardwareTimestamp::now();
         self.validate_order(&order).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:163:
         let validate_latency = HardwareTimestamp::now().latency_ns(&validate_start);
[31m-        
[m[32m+
[m         if validate_latency > 10 {
[31m-            warn!("Order validation exceeded 10ns target: {}ns", validate_latency);
[m[32m+            warn!(
[m[32m+                "Order validation exceeded 10ns target: {}ns",
[m[32m+                validate_latency
[m[32m+            );
[m         }
[31m-        
[m[32m+
[m         // Get symbol hash for fast lookups - RDTSC timed (target: <3ns)
         let hash_start = HardwareTimestamp::now();
         let symbol_hash = self.get_symbol_hash(&order.symbol).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:172:
         let hash_latency = HardwareTimestamp::now().latency_ns(&hash_start);
[31m-        
[m[32m+
[m         if hash_latency > 3 {
             warn!("Symbol hash exceeded 3ns target: {}ns", hash_latency);
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:177:
[31m-        
[m[32m+
[m         // Create order book entry
         let entry = OrderBookEntry {
             order_id: self.hash_order_id(&order.id),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:186:
             timestamp_ns: order.timestamp_ns,
             sequence,
         };
[31m-        
[m[32m+
[m         // Submit to appropriate order book ring - RDTSC timed (target: <2ns lock-free)
         let ring_start = HardwareTimestamp::now();
         let result = match order.side {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:194:
             OrderSide::Sell => self.sell_orders.try_push(entry),
         };
         let ring_latency = HardwareTimestamp::now().latency_ns(&ring_start);
[31m-        
[m[32m+
[m         if ring_latency > 2 {
[31m-            warn!("Ring buffer operation exceeded 2ns lock-free target: {}ns", ring_latency);
[m[32m+            warn!(
[m[32m+                "Ring buffer operation exceeded 2ns lock-free target: {}ns",
[m[32m+                ring_latency
[m[32m+            );
[m         }
[31m-        
[m[32m+
[m         match result {
             Ok(()) => {
                 // Store in active orders
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:205:
                 let order_id = order.id.clone();
                 order.status = OrderStatus::Submitted;
[31m-                
[m[32m+
[m                 {
                     let mut orders = self.active_orders.write().await;
                     orders.insert(order_id.clone(), order);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:211:
                 }
[31m-                
[m[32m+
[m                 // Update metrics with comprehensive RDTSC timing
                 let total_submit_latency = HardwareTimestamp::now().latency_ns(&submit_start);
                 self.order_count.fetch_add(1, Ordering::Relaxed);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:216:
                 self.metrics.record_operation_time(total_submit_latency);
[31m-                
[m[32m+
[m                 // CRITICAL: Track total submission latency (target: <14ns)
                 if total_submit_latency > 14 {
[31m-                    error!("Order submission EXCEEDED 14ns target: {}ns for order {}", 
[m[31m-                           total_submit_latency, order_id);
[m[32m+                    error!(
[m[32m+                        "Order submission EXCEEDED 14ns target: {}ns for order {}",
[m[32m+                        total_submit_latency, order_id
[m[32m+                    );
[m                 } else {
[31m-                    debug!("Order submission within target: {}ns for order {}", 
[m[31m-                           total_submit_latency, order_id);
[m[32m+                    debug!(
[m[32m+                        "Order submission within target: {}ns for order {}",
[m[32m+                        total_submit_latency, order_id
[m[32m+                    );
[m                 }
[31m-                
[m[31m-                info!("Order submitted: {} (total: {}ns)", 
[m[31m-                      order_id, total_submit_latency);
[m[32m+
[m[32m+                info!(
[m[32m+                    "Order submitted: {} (total: {}ns)",
[m[32m+                    order_id, total_submit_latency
[m[32m+                );
[m                 Ok(order_id)
             },
             Err(_) => {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:232:
                 warn!("Order book full, rejecting order: {}", order.id);
                 Err(OrderError::OrderBookFull)
[31m-            }
[m[32m+            },
[m         }
     }
[31m-    
[m[32m+
[m     /// Process order batch with SIMD optimization
     pub async fn process_order_batch(&self) -> Result<usize, OrderError> {
         let mut processed = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:241:
[31m-        
[m[32m+
[m         // Process buy orders batch
         let mut buy_batch = [OrderBookEntry::default(); 8];
         let buy_count = self.buy_orders.pop_batch(&mut buy_batch);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:245:
[31m-        
[m[32m+
[m         if buy_count > 0 {
             processed += self.process_buy_batch(&buy_batch[..buy_count]).await?;
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:249:
[31m-        
[m[31m-        // Process sell orders batch  
[m[32m+
[m[32m+        // Process sell orders batch
[m         let mut sell_batch = [OrderBookEntry::default(); 8];
         let sell_count = self.sell_orders.pop_batch(&mut sell_batch);
[31m-        
[m[32m+
[m         if sell_count > 0 {
             processed += self.process_sell_batch(&sell_batch[..sell_count]).await?;
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:257:
[31m-        
[m[32m+
[m         if processed > 0 {
             let elapsed_ns = 1000; // Placeholder
[31m-            debug!("Processed {} orders in {}ns ({}ns/order)", 
[m[31m-                   processed, elapsed_ns, elapsed_ns / processed as u64);
[m[32m+            debug!(
[m[32m+                "Processed {} orders in {}ns ({}ns/order)",
[m[32m+                processed,
[m[32m+                elapsed_ns,
[m[32m+                elapsed_ns / processed as u64
[m[32m+            );
[m             // self.metrics.record_batch_operation(processed, elapsed_ns);
         }
[31m-        
[m[32m+
[m         Ok(processed)
     }
[31m-    
[m[32m+
[m     /// Process buy orders batch with SIMD optimization
     async fn process_buy_batch(&self, entries: &[OrderBookEntry]) -> Result<usize, OrderError> {
         if entries.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:271:
             return Ok(0);
         }
[31m-        
[m[32m+
[m         // Build structure-of-arrays for SIMD processing
         let mut batch = self.order_batch.write().await;
         batch.clear();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:277:
[31m-        
[m[32m+
[m         for entry in entries {
             if !batch.add_order(
                 entry.order_id,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:288:
                 break; // Batch full
             }
         }
[31m-        
[m[32m+
[m         // SIMD-optimized notional calculation for risk checks
         #[cfg(target_arch = "x86_64")]
         let total_notional = batch.calculate_total_notional_simd();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:295:
         #[cfg(not(target_arch = "x86_64"))]
         let total_notional = batch.calculate_total_notional_scalar();
[31m-        
[m[32m+
[m         // Risk validation on batch
         if total_notional > self.config.max_batch_notional {
[31m-            warn!("Batch rejected: total notional ${} exceeds limit ${}", 
[m[31m-                  total_notional, self.config.max_batch_notional);
[m[32m+            warn!(
[m[32m+                "Batch rejected: total notional ${} exceeds limit ${}",
[m[32m+                total_notional, self.config.max_batch_notional
[m[32m+            );
[m             return Err(OrderError::RiskLimitExceeded);
         }
[31m-        
[m[32m+
[m         // Process individual orders in batch
         let mut processed = 0;
         for i in 0..batch.count {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:309:
                 processed += 1;
             }
         }
[31m-        
[m[32m+
[m         Ok(processed)
     }
[31m-    
[m[32m+
[m     /// Process sell orders batch with REAL matching engine
     async fn process_sell_batch(&self, entries: &[OrderBookEntry]) -> Result<usize, OrderError> {
         if entries.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:319:
             return Ok(0);
         }
[31m-    
[m[32m+
[m         // Build structure-of-arrays for SIMD processing
         let mut batch = self.order_batch.write().await;
         batch.clear();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:325:
[31m-    
[m[32m+
[m         for entry in entries {
             if !batch.add_order(
                 entry.order_id,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:336:
                 break; // Batch full
             }
         }
[31m-    
[m[32m+
[m         // SIMD-optimized notional calculation for risk checks
         #[cfg(target_arch = "x86_64")]
         let total_notional = batch.calculate_total_notional_simd();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:343:
         #[cfg(not(target_arch = "x86_64"))]
         let total_notional = batch.calculate_total_notional_scalar();
[31m-    
[m[32m+
[m         // Risk validation on batch
         if total_notional > self.config.max_batch_notional {
[31m-            warn!("Sell batch rejected: total notional ${} exceeds limit ${}", 
[m[31m-                  total_notional, self.config.max_batch_notional);
[m[32m+            warn!(
[m[32m+                "Sell batch rejected: total notional ${} exceeds limit ${}",
[m[32m+                total_notional, self.config.max_batch_notional
[m[32m+            );
[m             return Err(OrderError::RiskLimitExceeded);
         }
[31m-    
[m[32m+
[m         // Process individual sell orders in batch
         let mut processed = 0;
         for i in 0..batch.count {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:357:
                 processed += 1;
             }
         }
[31m-    
[m[32m+
[m         Ok(processed)
     }
[31m-    
[m[32m+
[m     /// Process individual order from batch - REAL PRODUCTION IMPLEMENTATION
     async fn process_individual_order(
[31m-        &self, 
[m[31m-        batch: &SmallBatchOrdersSoA, 
[m[31m-        index: usize
[m[32m+        &self,
[m[32m+        batch: &SmallBatchOrdersSoA,
[m[32m+        index: usize,
[m     ) -> Result<(), OrderError> {
         let mut latency_tracker = LatencyMeasurement::start();
         let order_id = self.unhash_order_id(batch.order_ids[index]);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:372:
[31m-    
[m[32m+
[m         // REAL MATCHING ENGINE IMPLEMENTATION
         // Convert u8 side to OrderSide
         let order_side = match batch.sides[index] {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:377:
             2 => OrderSide::Sell,
             _ => OrderSide::Buy, // Default to Buy for invalid values
         };
[31m-        
[m[31m-        let (fill_price, fill_quantity) = self.match_order_with_book(
[m[31m-            batch.order_ids[index],
[m[31m-            batch.prices[index],
[m[31m-            batch.quantities[index],
[m[31m-            order_side
[m[31m-        ).await?;
[m[31m-    
[m[32m+
[m[32m+        let (fill_price, fill_quantity) = self
[m[32m+            .match_order_with_book(
[m[32m+                batch.order_ids[index],
[m[32m+                batch.prices[index],
[m[32m+                batch.quantities[index],
[m[32m+                order_side,
[m[32m+            )
[m[32m+            .await?;
[m[32m+
[m         // REAL ORDER UPDATE WITH ATOMIC OPERATIONS
         {
             let mut orders = self.active_orders.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:391:
             if let Some(order) = orders.get_mut(&order_id) {
                 order.filled_quantity += fill_quantity;
[31m-    
[m[32m+
[m                 if fill_quantity > 0.0 {
                     // Update average fill price with weighted calculation
                     let total_filled = order.filled_quantity;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:397:
[31m-                    let prev_total_value = order.average_fill_price
[m[32m+                    let prev_total_value = order
[m[32m+                        .average_fill_price
[m                         .map(|price| price * (total_filled - fill_quantity))
                         .unwrap_or(0.0);
                     let new_value = fill_price * fill_quantity;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:401:
                     order.average_fill_price = Some((prev_total_value + new_value) / total_filled);
[31m-    
[m[32m+
[m                     // Update status based on fill
                     order.status = if order.filled_quantity >= order.quantity {
                         OrderStatus::Filled
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:406:
                     } else {
                         OrderStatus::PartiallyFilled
                     };
[31m-    
[m[32m+
[m                     // REAL BROKER ROUTING - Send execution to appropriate broker
[31m-                    self.route_execution_to_broker(order, fill_price, fill_quantity).await?;
[m[31m-    
[m[32m+                    self.route_execution_to_broker(order, fill_price, fill_quantity)
[m[32m+                        .await?;
[m[32m+
[m                     // Update metrics
                     self.fill_count.fetch_add(1, Ordering::Relaxed);
                 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:416:
             }
         }
[31m-    
[m[32m+
[m         // Record latency for performance monitoring
         let processing_time = latency_tracker.finish();
         self.metrics.record_operation_time(processing_time);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:422:
[31m-    
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// REAL MATCHING ENGINE - Price-Time Priority Order Book
     async fn match_order_with_book(
         &self,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:434:
         // CRITICAL PATH: <14ns RDTSC timing for order matching
         let match_start = HardwareTimestamp::now();
         let mut latency = LatencyMeasurement::start();
[31m-    
[m[32m+
[m         // Get opposing order book for matching - RDTSC timed (target: <1ns)
         let book_start = HardwareTimestamp::now();
         let opposing_book = match side {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:442:
             OrderSide::Sell => &self.buy_orders,
         };
         let book_latency = HardwareTimestamp::now().latency_ns(&book_start);
[31m-        
[m[32m+
[m         // REAL PRICE-TIME PRIORITY MATCHING - RDTSC timed (target: <5ns)
         let peek_start = HardwareTimestamp::now();
         let mut best_entries = [OrderBookEntry::default(); 8];
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:449:
         // Note: Using pop_batch as peek_batch doesn't exist - this is destructive
         let entry_count = opposing_book.pop_batch(&mut best_entries);
         let peek_latency = HardwareTimestamp::now().latency_ns(&peek_start);
[31m-        
[m[32m+
[m         if peek_latency > 5 {
             warn!("Order book peek exceeded 5ns target: {}ns", peek_latency);
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:456:
[31m-    
[m[32m+
[m         if entry_count == 0 {
             return Ok((price, 0.0)); // No matching orders
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:460:
[31m-    
[m[32m+
[m         // Find best matching entry using SIMD-optimized comparison - RDTSC timed (target: <8ns)
         let simd_start = HardwareTimestamp::now();
         let mut best_match: Option<(usize, f64)> = None;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:464:
[31m-        
[m[32m+
[m         #[cfg(target_arch = "x86_64")]
         {
             // SIMD-optimized price comparison for large order books
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:468:
             unsafe {
                 let market_ops = SimdMarketDataOps::new();
[31m-                let prices: Vec<f64> = best_entries[..entry_count].iter().map(|e| e.price).collect();
[m[31m-    
[m[32m+                let prices: Vec<f64> = best_entries[..entry_count]
[m[32m+                    .iter()
[m[32m+                    .map(|e| e.price)
[m[32m+                    .collect();
[m[32m+
[m                 // Find best price match based on side
                 for (i, &entry_price) in prices.iter().enumerate() {
                     let is_match = match side {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:475:
[31m-                        OrderSide::Buy => entry_price <= price,  // Buy matches at or below price
[m[32m+                        OrderSide::Buy => entry_price <= price, // Buy matches at or below price
[m                         OrderSide::Sell => entry_price >= price, // Sell matches at or above price
                     };
[31m-    
[m[32m+
[m                     if is_match {
                         let match_quality = self.calculate_match_quality(price, entry_price, side);
                         if best_match.map_or(true, |(_, qual)| match_quality > qual) {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:485:
                 }
             }
         }
[31m-    
[m[32m+
[m         #[cfg(not(target_arch = "x86_64"))]
         {
             // Scalar fallback for non-x86 architectures
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:494:
                     OrderSide::Buy => entry.price <= price,
                     OrderSide::Sell => entry.price >= price,
                 };
[31m-    
[m[32m+
[m                 if is_match {
                     let match_quality = self.calculate_match_quality(price, entry.price, side);
                     if best_match.map_or(true, |(_, qual)| match_quality > qual) {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:503:
                 }
             }
         }
[31m-    
[m[32m+
[m         // Execute the match if found
         if let Some((match_index, _)) = best_match {
             let matching_entry = &best_entries[match_index];
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:510:
             let fill_price = matching_entry.price; // Price improvement for taker
             let fill_quantity = quantity.min(matching_entry.quantity);
[31m-    
[m[32m+
[m             // ATOMIC ORDER BOOK UPDATE - Remove or reduce matched order
             if fill_quantity >= matching_entry.quantity {
                 // Full fill - remove the order
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:523:
                 // opposing_book.reduce_quantity(match_index, fill_quantity)
                 //     .map_err(|_| OrderError::OrderBookFull)?;
             }
[31m-    
[m[31m-                // Track SIMD matching completion latency
[m[31m-                let simd_latency = HardwareTimestamp::now().latency_ns(&simd_start);
[m[31m-                let match_latency = latency.finish();
[m[31m-                let total_match_latency = HardwareTimestamp::now().latency_ns(&match_start);
[m[31m-            
[m[31m-                // CRITICAL: Track total matching latency (target: <14ns)
[m[31m-                if total_match_latency > 14 {
[m[31m-                    error!("Order matching EXCEEDED 14ns target: {}ns for order {}", 
[m[31m-                           total_match_latency, order_id);
[m[31m-                }
[m[31m-            
[m[31m-                if simd_latency > 8 {
[m[31m-                    warn!("SIMD matching exceeded 8ns target: {}ns", simd_latency);
[m[31m-                }
[m[31m-            
[m[31m-                debug!("Order matched in {}ns (total: {}ns, SIMD: {}ns): {} @ {} (quantity: {})", 
[m[31m-                       match_latency, total_match_latency, simd_latency, order_id, fill_price, fill_quantity);
[m[31m-            
[m[31m-                Ok((fill_price, fill_quantity))
[m[31m-            } else {
[m[31m-                // No match found - order goes to book
[m[31m-                let total_no_match_latency = HardwareTimestamp::now().latency_ns(&match_start);
[m[31m-                if total_no_match_latency > 14 {
[m[31m-                    warn!("No-match path exceeded 14ns target: {}ns", total_no_match_latency);
[m[31m-                }
[m[31m-                Ok((price, 0.0))
[m[32m+
[m[32m+            // Track SIMD matching completion latency
[m[32m+            let simd_latency = HardwareTimestamp::now().latency_ns(&simd_start);
[m[32m+            let match_latency = latency.finish();
[m[32m+            let total_match_latency = HardwareTimestamp::now().latency_ns(&match_start);
[m[32m+
[m[32m+            // CRITICAL: Track total matching latency (target: <14ns)
[m[32m+            if total_match_latency > 14 {
[m[32m+                error!(
[m[32m+                    "Order matching EXCEEDED 14ns target: {}ns for order {}",
[m[32m+                    total_match_latency, order_id
[m[32m+                );
[m             }
[32m+
[m[32m+            if simd_latency > 8 {
[m[32m+                warn!("SIMD matching exceeded 8ns target: {}ns", simd_latency);
[m[32m+            }
[m[32m+
[m[32m+            debug!(
[m[32m+                "Order matched in {}ns (total: {}ns, SIMD: {}ns): {} @ {} (quantity: {})",
[m[32m+                match_latency,
[m[32m+                total_match_latency,
[m[32m+                simd_latency,
[m[32m+                order_id,
[m[32m+                fill_price,
[m[32m+                fill_quantity
[m[32m+            );
[m[32m+
[m[32m+            Ok((fill_price, fill_quantity))
[m[32m+        } else {
[m[32m+            // No match found - order goes to book
[m[32m+            let total_no_match_latency = HardwareTimestamp::now().latency_ns(&match_start);
[m[32m+            if total_no_match_latency > 14 {
[m[32m+                warn!(
[m[32m+                    "No-match path exceeded 14ns target: {}ns",
[m[32m+                    total_no_match_latency
[m[32m+                );
[m[32m+            }
[m[32m+            Ok((price, 0.0))
[m[32m+        }
[m     }
[31m-    
[m[32m+
[m     /// Calculate match quality for price-time priority
     fn calculate_match_quality(&self, order_price: f64, book_price: f64, side: OrderSide) -> f64 {
         match side {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:559:
[31m-            OrderSide::Buy => book_price - order_price,  // Lower prices are better for buyers
[m[32m+            OrderSide::Buy => book_price - order_price, // Lower prices are better for buyers
[m             OrderSide::Sell => order_price - book_price, // Higher prices are better for sellers
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:563:
[31m-    
[m[32m+
[m     /// REAL BROKER ROUTING - Route execution to appropriate broker
     async fn route_execution_to_broker(
         &self,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:569:
         fill_quantity: f64,
     ) -> Result<(), OrderError> {
         // Route based on symbol and order characteristics
[31m-        let broker_id = self.select_optimal_broker(&order.symbol, fill_quantity).await;
[m[31m-    
[m[32m+        let broker_id = self
[m[32m+            .select_optimal_broker(&order.symbol, fill_quantity)
[m[32m+            .await;
[m[32m+
[m         // Create execution report
         let execution = ExecutionReport {
             order_id: order.id.clone(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:582:
             broker_id: broker_id.clone(),
             commission: self.calculate_commission(fill_price * fill_quantity, &broker_id),
         };
[31m-    
[m[32m+
[m         // Send to broker via FIX/TWS API
         match broker_id.as_str() {
[31m-            "ICMARKETS" => {
[m[31m-                self.route_to_icmarkets_fix(execution).await
[m[31m-                    .map_err(|_| OrderError::BrokerRoutingFailed)?
[m[31m-            },
[m[31m-            "IBKR" => {
[m[31m-                self.route_to_ibkr_tws(execution).await
[m[31m-                    .map_err(|_| OrderError::BrokerRoutingFailed)?
[m[31m-            },
[m[32m+            "ICMARKETS" => self
[m[32m+                .route_to_icmarkets_fix(execution)
[m[32m+                .await
[m[32m+                .map_err(|_| OrderError::BrokerRoutingFailed)?,
[m[32m+            "IBKR" => self
[m[32m+                .route_to_ibkr_tws(execution)
[m[32m+                .await
[m[32m+                .map_err(|_| OrderError::BrokerRoutingFailed)?,
[m             _ => return Err(OrderError::UnsupportedBroker),
         }
[31m-    
[m[31m-        info!("Execution routed to {}: {} {} @ {}", 
[m[31m-              broker_id, fill_quantity, order.symbol, fill_price);
[m[31m-    
[m[32m+
[m[32m+        info!(
[m[32m+            "Execution routed to {}: {} {} @ {}",
[m[32m+            broker_id, fill_quantity, order.symbol, fill_price
[m[32m+        );
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Select optimal broker based on symbol and size using configuration-driven routing
     async fn select_optimal_broker(&self, symbol: &str, quantity: f64) -> String {
         // Use configuration-driven broker selection
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:608:
         self.broker_config.select_broker(symbol, quantity)
     }
[31m-    
[m[32m+
[m     /// Calculate commission based on broker and notional using configuration
     fn calculate_commission(&self, notional: f64, broker_id: &str) -> f64 {
         self.broker_config.calculate_commission(broker_id, notional)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:614:
     }
[31m-    
[m[32m+
[m     /// Route execution to IC Markets via FIX protocol
[31m-    async fn route_to_icmarkets_fix(&self, execution: ExecutionReport) -> Result<(), common::error::CommonError> {
[m[32m+    async fn route_to_icmarkets_fix(
[m[32m+        &self,
[m[32m+        execution: ExecutionReport,
[m[32m+    ) -> Result<(), common::error::CommonError> {
[m         // REAL FIX PROTOCOL IMPLEMENTATION
         // This would integrate with actual FIX engine
         debug!("Routing to IC Markets FIX: {:?}", execution);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:621:
[31m-    
[m[32m+
[m         // For now, simulate successful routing
         // In production, this would use actual FIX session
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:625:
     }
[31m-    
[m[32m+
[m     /// Route execution to Interactive Brokers via TWS API
[31m-    async fn route_to_ibkr_tws(&self, execution: ExecutionReport) -> Result<(), common::error::CommonError> {
[m[32m+    async fn route_to_ibkr_tws(
[m[32m+        &self,
[m[32m+        execution: ExecutionReport,
[m[32m+    ) -> Result<(), common::error::CommonError> {
[m         // REAL TWS API IMPLEMENTATION
         // This would integrate with actual TWS client
         debug!("Routing to IBKR TWS: {:?}", execution);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:632:
[31m-    
[m[32m+
[m         // For now, simulate successful routing
         // In production, this would use actual TWS API
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:636:
     }
[31m-    
[m[32m+
[m     /// Get order by ID
     pub async fn get_order(&self, order_id: &str) -> Option<TradingOrder> {
         let orders = self.active_orders.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:641:
         orders.get(order_id).cloned()
     }
[31m-    
[m[32m+
[m     /// Cancel order
     pub async fn cancel_order(&self, order_id: &str) -> Result<(), OrderError> {
         let mut orders = self.active_orders.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:647:
[31m-        
[m[32m+
[m         if let Some(order) = orders.get_mut(order_id) {
             match order.status {
                 OrderStatus::Pending | OrderStatus::Submitted => {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:653:
                     Ok(())
                 },
                 _ => {
[31m-                    warn!("Cannot cancel order {} in status {:?}", order_id, order.status);
[m[32m+                    warn!(
[m[32m+                        "Cannot cancel order {} in status {:?}",
[m[32m+                        order_id, order.status
[m[32m+                    );
[m                     Err(OrderError::InvalidOrderStatus)
[31m-                }
[m[32m+                },
[m             }
         } else {
             Err(OrderError::OrderNotFound)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:662:
         }
     }
[31m-    
[m[32m+
[m     /// Get performance metrics
     pub fn get_metrics(&self) -> OrderManagerMetrics {
         OrderManagerMetrics {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:673:
             operations_per_second: self.metrics.operations_per_second(),
         }
     }
[31m-    
[m[32m+
[m     // Helper methods
[31m-    
[m[32m+
[m     async fn validate_order(&self, order: &TradingOrder) -> Result<(), OrderError> {
         if order.quantity <= 0.0 {
             return Err(OrderError::InvalidQuantity);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:682:
         }
[31m-        
[m[32m+
[m         if order.price <= 0.0 && matches!(order.order_type, OrderType::Limit) {
             return Err(OrderError::InvalidPrice);
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:687:
[31m-        
[m[32m+
[m         if order.symbol.is_empty() {
             return Err(OrderError::InvalidSymbol);
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:691:
[31m-        
[m[32m+
[m         // Check if order exceeds maximum size
         if order.quantity > self.config.max_order_size {
             return Err(OrderError::OrderSizeExceeded);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:695:
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     async fn get_symbol_hash(&self, symbol: &str) -> u64 {
         {
             let hashes = self.symbol_hashes.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:704:
                 return hash;
             }
         }
[31m-        
[m[32m+
[m         // Calculate hash if not cached
         let hash = self.calculate_symbol_hash(symbol);
[31m-        
[m[32m+
[m         {
             let mut hashes = self.symbol_hashes.write().await;
             hashes.insert(symbol.to_string(), hash);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:714:
         }
[31m-        
[m[32m+
[m         hash
     }
[31m-    
[m[32m+
[m     fn calculate_symbol_hash(&self, symbol: &str) -> u64 {
         use std::collections::hash_map::DefaultHasher;
         use std::hash::{Hash, Hasher};
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:722:
[31m-        
[m[32m+
[m         let mut hasher = DefaultHasher::new();
         symbol.hash(&mut hasher);
         hasher.finish()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:726:
     }
[31m-    
[m[32m+
[m     fn hash_order_id(&self, order_id: &str) -> u64 {
         self.calculate_symbol_hash(order_id)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:731:
[31m-    
[m[32m+
[m     fn unhash_order_id(&self, hash: u64) -> String {
         // In production, maintain reverse lookup table
         // For now, return hash as string
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:751:
     }
 }
 
[31m-
[m /// Order error types - PRODUCTION COMPREHENSIVE
 #[derive(Debug, thiserror::Error)]
 pub enum OrderError {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:811:
 mod tests {
     use super::*;
     use config::structures::TradingConfig;
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_order_submission() {
         let config = TradingConfig {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:819:
             max_batch_notional: 10_000_000.0,
             ..Default::default()
         };
[31m-        
[m[32m+
[m         let broker_config = config::structures::BrokerConfig::default();
         let manager = OrderManager::new(config, broker_config).await.unwrap();
[31m-        
[m[32m+
[m         let order = TradingOrder {
             id: "test-001".to_string(),
             account_id: "account-001".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:839:
             compliance_checked: false,
             risk_validated: false,
         };
[31m-        
[m[32m+
[m         let result = manager.submit_order(order).await;
         assert!(result.is_ok());
[31m-        
[m[32m+
[m         let order_id = result.unwrap();
         let retrieved = manager.get_order(&order_id).await;
         assert!(retrieved.is_some());
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:849:
         assert_eq!(retrieved.unwrap().status, OrderStatus::Submitted);
     }
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_batch_processing() {
         let config = TradingConfig {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:856:
             max_batch_notional: 10_000_000.0,
             ..Default::default()
         };
[31m-        
[m[32m+
[m         let broker_config = config::structures::BrokerConfig::default();
         let manager = OrderManager::new(config, broker_config).await.unwrap();
[31m-        
[m[32m+
[m         // Submit multiple orders
         for i in 0..5 {
             let order = TradingOrder {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/order_manager.rs:878:
                 compliance_checked: false,
                 risk_validated: false,
             };
[31m-            
[m[32m+
[m             manager.submit_order(order).await.unwrap();
         }
[31m-        
[m[32m+
[m         // Process batch
         let processed = manager.process_order_batch().await.unwrap();
         assert!(processed > 0);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:8:
 //! - Memory-safe concurrent access patterns
 
 use std::collections::HashMap;
[31m-use std::sync::atomic::{AtomicU64, AtomicI64, Ordering, AtomicBool};
[m[32m+use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU64, Ordering};
[m use std::sync::Arc;
 use tokio::sync::RwLock;
[31m-use tracing::{debug, info, warn, error};
[m[32m+use tracing::{debug, error, info, warn};
[m 
 // Core components - REAL PRODUCTION IMPLEMENTATIONS
 use trading_engine::lockfree::{AtomicMetrics, SequenceGenerator};
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:18:
[31m-use trading_engine::timing::{HardwareTimestamp, LatencyMeasurement, HftLatencyTracker};
[m[31m-use trading_engine::simd::{SimdPriceOps, AlignedPrices};
[m[32m+use trading_engine::simd::{AlignedPrices, SimdPriceOps};
[m[32m+use trading_engine::timing::{HardwareTimestamp, HftLatencyTracker, LatencyMeasurement};
[m 
 // Types and configurations
 use config::structures::TradingConfig;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:50:
 #[repr(align(64))] // Cache line alignment for performance
 pub struct AtomicPosition {
     // Core position data (hot cache line)
[31m-    pub quantity: AtomicI64,        // Position quantity (signed: +long, -short)
[m[31m-    pub avg_price: AtomicU64,       // Average price (as u64 for atomic ops)
[m[31m-    pub market_price: AtomicU64,    // Current market price (as u64)
[m[31m-    pub last_update_ns: AtomicU64,  // Last update timestamp
[m[31m-    
[m[32m+    pub quantity: AtomicI64,     // Position quantity (signed: +long, -short)
[m[32m+    pub avg_price: AtomicU64,    // Average price (as u64 for atomic ops)
[m[32m+    pub market_price: AtomicU64, // Current market price (as u64)
[m[32m+    pub last_update_ns: AtomicU64, // Last update timestamp
[m[32m+
[m     // PnL tracking (warm cache line)
[31m-    pub realized_pnl: AtomicI64,    // Realized PnL (as fixed-point)
[m[31m-    pub unrealized_pnl: AtomicI64,  // Unrealized PnL (as fixed-point)
[m[31m-    pub total_cost: AtomicU64,      // Total cost basis
[m[31m-    pub total_proceeds: AtomicU64,  // Total proceeds from sales
[m[31m-    
[m[32m+    pub realized_pnl: AtomicI64,   // Realized PnL (as fixed-point)
[m[32m+    pub unrealized_pnl: AtomicI64, // Unrealized PnL (as fixed-point)
[m[32m+    pub total_cost: AtomicU64,     // Total cost basis
[m[32m+    pub total_proceeds: AtomicU64, // Total proceeds from sales
[m[32m+
[m     // Metadata (cold cache line)
[31m-    pub symbol_hash: AtomicU64,     // Symbol hash for fast lookup
[m[31m-    pub account_hash: AtomicU64,    // Account hash
[m[31m-    pub is_active: AtomicBool,      // Position is active
[m[31m-    pub sequence: AtomicU64,        // Update sequence number
[m[32m+    pub symbol_hash: AtomicU64,  // Symbol hash for fast lookup
[m[32m+    pub account_hash: AtomicU64, // Account hash
[m[32m+    pub is_active: AtomicBool,   // Position is active
[m[32m+    pub sequence: AtomicU64,     // Update sequence number
[m }
 
 impl AtomicPosition {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:86:
             sequence: AtomicU64::new(0),
         }
     }
[31m-    
[m[32m+
[m     /// Update position atomically with execution
     pub fn update_with_execution(
         &self,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:96:
         sequence: u64,
     ) -> Result<PositionUpdate, PositionError> {
         let execution_price_fixed = Self::price_to_fixed(execution_price);
[31m-        
[m[32m+
[m         // Atomic updates with proper ordering
         let old_quantity = self.quantity.load(Ordering::Acquire);
         let new_quantity = old_quantity + quantity_delta;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:103:
[31m-        
[m[32m+
[m         // Calculate new average price
         let old_avg_price = self.avg_price.load(Ordering::Acquire);
         let new_avg_price = if new_quantity != 0 {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:115:
         } else {
             0
         };
[31m-        
[m[32m+
[m         // Calculate realized PnL for position reductions
[31m-        let realized_pnl_delta = if old_quantity.signum() != quantity_delta.signum() && old_quantity != 0 {
[m[31m-            let reduction_quantity = quantity_delta.abs().min(old_quantity.abs()) as u64;
[m[31m-            let price_diff = execution_price_fixed as i64 - old_avg_price as i64;
[m[31m-            (reduction_quantity as i64 * price_diff * old_quantity.signum()) / 10000 // Fixed-point adjustment
[m[31m-        } else {
[m[31m-            0
[m[31m-        };
[m[31m-        
[m[32m+        let realized_pnl_delta =
[m[32m+            if old_quantity.signum() != quantity_delta.signum() && old_quantity != 0 {
[m[32m+                let reduction_quantity = quantity_delta.abs().min(old_quantity.abs()) as u64;
[m[32m+                let price_diff = execution_price_fixed as i64 - old_avg_price as i64;
[m[32m+                (reduction_quantity as i64 * price_diff * old_quantity.signum()) / 10000
[m[32m+            // Fixed-point adjustment
[m[32m+            } else {
[m[32m+                0
[m[32m+            };
[m[32m+
[m         // Perform atomic updates
         self.quantity.store(new_quantity, Ordering::Release);
         self.avg_price.store(new_avg_price, Ordering::Release);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:131:
         self.last_update_ns.store(timestamp_ns, Ordering::Release);
         self.sequence.store(sequence, Ordering::Release);
[31m-        
[m[32m+
[m         // Update realized PnL
[31m-        let old_realized = self.realized_pnl.fetch_add(realized_pnl_delta, Ordering::AcqRel);
[m[31m-        
[m[32m+        let old_realized = self
[m[32m+            .realized_pnl
[m[32m+            .fetch_add(realized_pnl_delta, Ordering::AcqRel);
[m[32m+
[m         Ok(PositionUpdate {
             old_quantity,
             new_quantity,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:142:
             timestamp_ns,
         })
     }
[31m-    
[m[32m+
[m     /// Update market price and recalculate unrealized PnL
     pub fn update_market_price(&self, market_price: f64, timestamp_ns: u64) -> f64 {
         let market_price_fixed = Self::price_to_fixed(market_price);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:149:
[31m-        self.market_price.store(market_price_fixed, Ordering::Release);
[m[31m-        
[m[32m+        self.market_price
[m[32m+            .store(market_price_fixed, Ordering::Release);
[m[32m+
[m         // Calculate unrealized PnL
         let quantity = self.quantity.load(Ordering::Acquire);
         let avg_price = self.avg_price.load(Ordering::Acquire);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:154:
[31m-        
[m[32m+
[m         let unrealized_pnl = if quantity != 0 && avg_price != 0 {
             let price_diff = market_price_fixed as i64 - avg_price as i64;
             (quantity * price_diff) / 10000 // Fixed-point adjustment
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:158:
         } else {
             0
         };
[31m-        
[m[32m+
[m         self.unrealized_pnl.store(unrealized_pnl, Ordering::Release);
         Self::fixed_to_price(unrealized_pnl as u64)
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:165:
[31m-    
[m[32m+
[m     /// Get current position snapshot
     pub fn get_snapshot(&self) -> PositionSnapshot {
         // Use acquire ordering to ensure consistency
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:173:
         let unrealized_pnl = self.unrealized_pnl.load(Ordering::Acquire);
         let last_update_ns = self.last_update_ns.load(Ordering::Acquire);
         let sequence = self.sequence.load(Ordering::Acquire);
[31m-        
[m[32m+
[m         PositionSnapshot {
             quantity,
             avg_price: Self::fixed_to_price(avg_price),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:181:
             market_value: quantity as f64 * Self::fixed_to_price(market_price),
             realized_pnl: Self::fixed_to_price(realized_pnl as u64),
             unrealized_pnl: Self::fixed_to_price(unrealized_pnl as u64),
[31m-            total_pnl: Self::fixed_to_price(realized_pnl as u64) + Self::fixed_to_price(unrealized_pnl as u64),
[m[32m+            total_pnl: Self::fixed_to_price(realized_pnl as u64)
[m[32m+                + Self::fixed_to_price(unrealized_pnl as u64),
[m             last_update_ns,
             sequence,
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:188:
     }
[31m-    
[m[32m+
[m     // Helper functions for fixed-point arithmetic
     fn price_to_fixed(price: f64) -> u64 {
         (price * 10000.0) as u64 // 4 decimal places
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:193:
     }
[31m-    
[m[32m+
[m     fn fixed_to_price(fixed: u64) -> f64 {
         fixed as f64 / 10000.0
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:201:
 pub struct PositionManager {
     // Position storage with lock-free access patterns
     positions: Arc<RwLock<HashMap<String, Arc<AtomicPosition>>>>,
[31m-    
[m[32m+
[m     // High-performance components - REAL PRODUCTION TIMING
     sequence_generator: Arc<SequenceGenerator>,
     #[allow(dead_code)]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:208:
     latency_tracker: Arc<HftLatencyTracker>,
[31m-    
[m[32m+
[m     // Performance metrics
     metrics: Arc<AtomicMetrics>,
     position_count: AtomicU64,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:213:
     update_count: AtomicU64,
[31m-    
[m[32m+
[m     // Configuration
     config: Arc<TradingConfig>,
     config_manager: Arc<ConfigManager>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:218:
[31m-    
[m[32m+
[m     // Symbol and account hash caches
     symbol_hashes: Arc<RwLock<HashMap<String, u64>>>,
     account_hashes: Arc<RwLock<HashMap<String, u64>>>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:222:
[31m-    
[m[32m+
[m     // Real-time market data for PnL calculations
     market_prices: Arc<RwLock<HashMap<String, f64>>>,
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:226:
 
 impl PositionManager {
     /// Create new production-grade PositionManager
[31m-    pub async fn new(config: TradingConfig, config_manager: Arc<ConfigManager>) -> Result<Self, common::error::CommonError> {
[m[32m+    pub async fn new(
[m[32m+        config: TradingConfig,
[m[32m+        config_manager: Arc<ConfigManager>,
[m[32m+    ) -> Result<Self, common::error::CommonError> {
[m         Ok(Self {
             positions: Arc::new(RwLock::new(HashMap::with_capacity(10000))),
             sequence_generator: Arc::new(SequenceGenerator::new()),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:241:
             market_prices: Arc::new(RwLock::new(HashMap::new())),
         })
     }
[31m-    
[m[32m+
[m     /// Update position with trade execution - REAL PRODUCTION IMPLEMENTATION
     pub async fn update_position(
         &self,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:253:
         // CRITICAL PATH: <14ns RDTSC timing for position updates
         let update_start = HardwareTimestamp::now();
         let mut latency_tracker = LatencyMeasurement::start();
[31m-    
[m[32m+
[m         // Key generation - RDTSC timed (target: <2ns)
         let key_start = HardwareTimestamp::now();
         let position_key = format!("{}:{}", account_id, symbol);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:260:
         let timestamp_ns = HardwareTimestamp::now().as_nanos();
         let sequence = self.sequence_generator.next();
         let key_latency = HardwareTimestamp::now().latency_ns(&key_start);
[31m-    
[m[32m+
[m         if key_latency > 2 {
[31m-            warn!("Position key generation exceeded 2ns target: {}ns", key_latency);
[m[32m+            warn!(
[m[32m+                "Position key generation exceeded 2ns target: {}ns",
[m[32m+                key_latency
[m[32m+            );
[m         }
[31m-    
[m[32m+
[m         // REAL RISK CHECK - Position limits and exposure validation - RDTSC timed (target: <6ns)
         let risk_start = HardwareTimestamp::now();
[31m-        self.validate_position_update(account_id, symbol, quantity_delta, execution_price).await?;
[m[32m+        self.validate_position_update(account_id, symbol, quantity_delta, execution_price)
[m[32m+            .await?;
[m         let risk_latency = HardwareTimestamp::now().latency_ns(&risk_start);
[31m-        
[m[32m+
[m         if risk_latency > 6 {
             warn!("Risk validation exceeded 6ns target: {}ns", risk_latency);
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:276:
[31m-        
[m[32m+
[m         // Get or create position - RDTSC timed (target: <4ns)
         let lookup_start = HardwareTimestamp::now();
         let position = {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:282:
                 Arc::clone(pos)
             } else {
                 drop(positions);
[31m-                
[m[32m+
[m                 // Create new position
                 let symbol_hash = self.get_symbol_hash(symbol).await;
                 let account_hash = self.get_account_hash(account_id).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:289:
                 let new_position = Arc::new(AtomicPosition::new(symbol_hash, account_hash));
[31m-                
[m[32m+
[m                 {
                     let mut positions = self.positions.write().await;
                     positions.insert(position_key.clone(), Arc::clone(&new_position));
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:294:
                     self.position_count.fetch_add(1, Ordering::Relaxed);
                 }
[31m-                
[m[32m+
[m                 new_position
             }
         };
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:300:
         let lookup_latency = HardwareTimestamp::now().latency_ns(&lookup_start);
[31m-        
[m[32m+
[m         if lookup_latency > 4 {
             warn!("Position lookup exceeded 4ns target: {}ns", lookup_latency);
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:305:
[31m-        
[m[32m+
[m         // Perform atomic update - RDTSC timed (target: <3ns)
         let atomic_start = HardwareTimestamp::now();
         let update_result = position.update_with_execution(
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:312:
             sequence,
         )?;
         let atomic_latency = HardwareTimestamp::now().latency_ns(&atomic_start);
[31m-        
[m[32m+
[m         if atomic_latency > 3 {
[31m-            warn!("Atomic position update exceeded 3ns target: {}ns", atomic_latency);
[m[32m+            warn!(
[m[32m+                "Atomic position update exceeded 3ns target: {}ns",
[m[32m+                atomic_latency
[m[32m+            );
[m         }
[31m-        
[m[31m-            // REAL PERFORMANCE TRACKING with comprehensive RDTSC timing
[m[31m-            let total_update_latency = HardwareTimestamp::now().latency_ns(&update_start);
[m[31m-            self.update_count.fetch_add(1, Ordering::Relaxed);
[m[31m-            let elapsed_ns = latency_tracker.finish();
[m[31m-            self.metrics.record_operation_time(elapsed_ns);
[m[31m-            
[m[31m-            // CRITICAL: Track total position update latency (target: <14ns)
[m[31m-            if total_update_latency > 14 {
[m[31m-                error!("Position update EXCEEDED 14ns target: {}ns for {}", 
[m[31m-                       total_update_latency, position_key);
[m[31m-            } else {
[m[31m-                debug!("Position update within target: {}ns for {}", 
[m[31m-                       total_update_latency, position_key);
[m[31m-            }
[m[31m-            
[m[31m-            // REAL COMPLIANCE LOGGING with detailed timing
[m[31m-            info!("Position updated: {} delta={} price={} avg_price={} pnl_delta={} in {}ns (total: {}ns, atomic: {}ns)", 
[m[32m+
[m[32m+        // REAL PERFORMANCE TRACKING with comprehensive RDTSC timing
[m[32m+        let total_update_latency = HardwareTimestamp::now().latency_ns(&update_start);
[m[32m+        self.update_count.fetch_add(1, Ordering::Relaxed);
[m[32m+        let elapsed_ns = latency_tracker.finish();
[m[32m+        self.metrics.record_operation_time(elapsed_ns);
[m[32m+
[m[32m+        // CRITICAL: Track total position update latency (target: <14ns)
[m[32m+        if total_update_latency > 14 {
[m[32m+            error!(
[m[32m+                "Position update EXCEEDED 14ns target: {}ns for {}",
[m[32m+                total_update_latency, position_key
[m[32m+            );
[m[32m+        } else {
[m[32m+            debug!(
[m[32m+                "Position update within target: {}ns for {}",
[m[32m+                total_update_latency, position_key
[m[32m+            );
[m[32m+        }
[m[32m+
[m[32m+        // REAL COMPLIANCE LOGGING with detailed timing
[m[32m+        info!("Position updated: {} delta={} price={} avg_price={} pnl_delta={} in {}ns (total: {}ns, atomic: {}ns)", 
[m                    position_key, quantity_delta, execution_price, 
                    update_result.new_avg_price, update_result.realized_pnl_delta, 
                    elapsed_ns, total_update_latency, atomic_latency);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:340:
[31m-            
[m[31m-            // REAL RISK MONITORING - Check position concentration (RDTSC timed)
[m[31m-            let risk_monitor_start = HardwareTimestamp::now();
[m[31m-            self.monitor_position_risk(account_id, symbol, &update_result).await?;
[m[31m-            let risk_monitor_latency = HardwareTimestamp::now().latency_ns(&risk_monitor_start);
[m[31m-            
[m[31m-            if risk_monitor_latency > 5 {
[m[31m-                warn!("Risk monitoring exceeded 5ns target: {}ns", risk_monitor_latency);
[m[31m-            }
[m[31m-            
[m[31m-            Ok(update_result)
[m[32m+
[m[32m+        // REAL RISK MONITORING - Check position concentration (RDTSC timed)
[m[32m+        let risk_monitor_start = HardwareTimestamp::now();
[m[32m+        self.monitor_position_risk(account_id, symbol, &update_result)
[m[32m+            .await?;
[m[32m+        let risk_monitor_latency = HardwareTimestamp::now().latency_ns(&risk_monitor_start);
[m[32m+
[m[32m+        if risk_monitor_latency > 5 {
[m[32m+            warn!(
[m[32m+                "Risk monitoring exceeded 5ns target: {}ns",
[m[32m+                risk_monitor_latency
[m[32m+            );
[m         }
[31m-        
[m[31m-        /// REAL RISK VALIDATION - Position limits and exposure checks
[m[31m-        async fn validate_position_update(
[m[31m-            &self,
[m[31m-            account_id: &str,
[m[31m-            symbol: &str,
[m[31m-            quantity_delta: i64,
[m[31m-            execution_price: f64,
[m[31m-        ) -> Result<(), PositionError> {
[m[31m-            // Check maximum position size
[m[31m-            let current_position = self.get_position(account_id, symbol).await
[m[31m-                .map(|p| p.quantity)
[m[31m-                .unwrap_or(0);
[m[31m-        
[m[31m-            let new_position = current_position + quantity_delta;
[m[31m-            let max_position_size = self.config.max_order_size * 10.0; // Max position = 10x max order size
[m[31m-        
[m[31m-            if new_position.abs() as f64 > max_position_size {
[m[31m-                warn!("Position size limit exceeded: {} would result in position {}", 
[m[31m-                      symbol, new_position);
[m[31m-                return Err(PositionError::PositionLimitExceeded);
[m[31m-            }
[m[31m-        
[m[31m-            // Check notional exposure
[m[31m-            let notional = (new_position as f64 * execution_price).abs();
[m[31m-            let max_notional = self.config.max_batch_notional * 5.0; // Max notional = 5x batch limit
[m[31m-        
[m[31m-            if notional > max_notional {
[m[31m-                warn!("Notional exposure limit exceeded: ${} for {}", notional, symbol);
[m[31m-                return Err(PositionError::NotionalLimitExceeded);
[m[31m-            }
[m[31m-        
[m[31m-            // REAL PORTFOLIO RISK CHECK - Concentration limits
[m[31m-            let portfolio_pnl = self.calculate_portfolio_pnl(account_id).await;
[m[31m-            if portfolio_pnl.total_market_value > 0.0 {
[m[31m-                let concentration = notional / portfolio_pnl.total_market_value;
[m[31m-                if concentration > 0.25 { // 25% max concentration
[m[31m-                    warn!("Position concentration too high: {:.1}% in {}", 
[m[31m-                          concentration * 100.0, symbol);
[m[31m-                    return Err(PositionError::ConcentrationLimitExceeded);
[m[31m-                }
[m[31m-            }
[m[31m-        
[m[31m-            Ok(())
[m[32m+
[m[32m+        Ok(update_result)
[m[32m+    }
[m[32m+
[m[32m+    /// REAL RISK VALIDATION - Position limits and exposure checks
[m[32m+    async fn validate_position_update(
[m[32m+        &self,
[m[32m+        account_id: &str,
[m[32m+        symbol: &str,
[m[32m+        quantity_delta: i64,
[m[32m+        execution_price: f64,
[m[32m+    ) -> Result<(), PositionError> {
[m[32m+        // Check maximum position size
[m[32m+        let current_position = self
[m[32m+            .get_position(account_id, symbol)
[m[32m+            .await
[m[32m+            .map(|p| p.quantity)
[m[32m+            .unwrap_or(0);
[m[32m+
[m[32m+        let new_position = current_position + quantity_delta;
[m[32m+        let max_position_size = self.config.max_order_size * 10.0; // Max position = 10x max order size
[m[32m+
[m[32m+        if new_position.abs() as f64 > max_position_size {
[m[32m+            warn!(
[m[32m+                "Position size limit exceeded: {} would result in position {}",
[m[32m+                symbol, new_position
[m[32m+            );
[m[32m+            return Err(PositionError::PositionLimitExceeded);
[m         }
[31m-        
[m[31m-        /// REAL RISK MONITORING - Post-trade risk analysis
[m[31m-        async fn monitor_position_risk(
[m[31m-            &self,
[m[31m-            account_id: &str,
[m[31m-            symbol: &str,
[m[31m-            update: &PositionUpdate,
[m[31m-        ) -> Result<(), PositionError> {
[m[31m-            // Calculate real-time VaR impact
[m[31m-            let position_snapshot = self.get_position(account_id, symbol).await
[m[31m-                .ok_or(PositionError::PositionNotFound)?;
[m[31m-        
[m[31m-            // REAL VAR CALCULATION using actual market data
[m[31m-            let market_price = position_snapshot.market_price;
[m[31m-            let position_value = position_snapshot.quantity as f64 * market_price;
[m[31m-        
[m[31m-            // Simplified VaR calculation (in production, use full VaR model)
[m[31m-            let daily_var_95 = position_value.abs() * 0.02; // 2% daily VaR approximation
[m 
[31m-            if daily_var_95 > self.config.max_position_var().unwrap_or(50_000.0) {
[m[31m-                warn!("Position VaR exceeded: ${:.2} for {} position", daily_var_95, symbol);
[m[31m-                // In production, this would trigger risk alerts
[m[32m+        // Check notional exposure
[m[32m+        let notional = (new_position as f64 * execution_price).abs();
[m[32m+        let max_notional = self.config.max_batch_notional * 5.0; // Max notional = 5x batch limit
[m[32m+
[m[32m+        if notional > max_notional {
[m[32m+            warn!(
[m[32m+                "Notional exposure limit exceeded: ${} for {}",
[m[32m+                notional, symbol
[m[32m+            );
[m[32m+            return Err(PositionError::NotionalLimitExceeded);
[m[32m+        }
[m[32m+
[m[32m+        // REAL PORTFOLIO RISK CHECK - Concentration limits
[m[32m+        let portfolio_pnl = self.calculate_portfolio_pnl(account_id).await;
[m[32m+        if portfolio_pnl.total_market_value > 0.0 {
[m[32m+            let concentration = notional / portfolio_pnl.total_market_value;
[m[32m+            if concentration > 0.25 {
[m[32m+                // 25% max concentration
[m[32m+                warn!(
[m[32m+                    "Position concentration too high: {:.1}% in {}",
[m[32m+                    concentration * 100.0,
[m[32m+                    symbol
[m[32m+                );
[m[32m+                return Err(PositionError::ConcentrationLimitExceeded);
[m             }
[31m-        
[m[31m-            // Log significant PnL changes
[m[31m-            if update.realized_pnl_delta.abs() > 10000 { // $100+ realized PnL
[m[31m-                info!("Significant realized PnL: ${:.2} on {} trade", 
[m[31m-                      update.realized_pnl_delta as f64 / 100.0, symbol);
[m[31m-            }
[m[31m-        
[m[31m-            Ok(())
[m         }
[31m-    
[m[32m+
[m[32m+        Ok(())
[m[32m+    }
[m[32m+
[m[32m+    /// REAL RISK MONITORING - Post-trade risk analysis
[m[32m+    async fn monitor_position_risk(
[m[32m+        &self,
[m[32m+        account_id: &str,
[m[32m+        symbol: &str,
[m[32m+        update: &PositionUpdate,
[m[32m+    ) -> Result<(), PositionError> {
[m[32m+        // Calculate real-time VaR impact
[m[32m+        let position_snapshot = self
[m[32m+            .get_position(account_id, symbol)
[m[32m+            .await
[m[32m+            .ok_or(PositionError::PositionNotFound)?;
[m[32m+
[m[32m+        // REAL VAR CALCULATION using actual market data
[m[32m+        let market_price = position_snapshot.market_price;
[m[32m+        let position_value = position_snapshot.quantity as f64 * market_price;
[m[32m+
[m[32m+        // Simplified VaR calculation (in production, use full VaR model)
[m[32m+        let daily_var_95 = position_value.abs() * 0.02; // 2% daily VaR approximation
[m[32m+
[m[32m+        if daily_var_95 > self.config.max_position_var().unwrap_or(50_000.0) {
[m[32m+            warn!(
[m[32m+                "Position VaR exceeded: ${:.2} for {} position",
[m[32m+                daily_var_95, symbol
[m[32m+            );
[m[32m+            // In production, this would trigger risk alerts
[m[32m+        }
[m[32m+
[m[32m+        // Log significant PnL changes
[m[32m+        if update.realized_pnl_delta.abs() > 10000 {
[m[32m+            // $100+ realized PnL
[m[32m+            info!(
[m[32m+                "Significant realized PnL: ${:.2} on {} trade",
[m[32m+                update.realized_pnl_delta as f64 / 100.0,
[m[32m+                symbol
[m[32m+            );
[m[32m+        }
[m[32m+
[m[32m+        Ok(())
[m[32m+    }
[m[32m+
[m     /// Update market price for position PnL calculation
[31m-    pub async fn update_market_price(&self, symbol: &str, market_price: f64) -> Result<usize, PositionError> {
[m[32m+    pub async fn update_market_price(
[m[32m+        &self,
[m[32m+        symbol: &str,
[m[32m+        market_price: f64,
[m[32m+    ) -> Result<usize, PositionError> {
[m         let timestamp_ns = HardwareTimestamp::now().as_nanos();
[31m-        
[m[32m+
[m         // Update market price cache
         {
             let mut prices = self.market_prices.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:437:
             prices.insert(symbol.to_string(), market_price);
         }
[31m-        
[m[32m+
[m         // Update all positions for this symbol
         let positions = self.positions.read().await;
         let symbol_hash = self.get_symbol_hash(symbol).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:443:
         let mut updated_count = 0;
[31m-        
[m[32m+
[m         for (position_key, position) in positions.iter() {
             if position_key.ends_with(&format!(":{}", symbol)) {
                 position.update_market_price(market_price, timestamp_ns);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:448:
                 updated_count += 1;
             }
         }
[31m-        
[m[32m+
[m         debug!("Updated market price for {} positions", updated_count);
[31m-        
[m[32m+
[m         Ok(updated_count)
     }
[31m-    
[m[32m+
[m     /// Get position snapshot
     pub async fn get_position(&self, account_id: &str, symbol: &str) -> Option<PositionSnapshot> {
         let position_key = format!("{}:{}", account_id, symbol);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:460:
         let positions = self.positions.read().await;
[31m-        
[m[31m-        positions.get(&position_key)
[m[31m-            .map(|pos| pos.get_snapshot())
[m[32m+
[m[32m+        positions.get(&position_key).map(|pos| pos.get_snapshot())
[m     }
[31m-    
[m[32m+
[m     /// Get all positions for account
     pub async fn get_account_positions(&self, account_id: &str) -> Vec<(String, PositionSnapshot)> {
         let positions = self.positions.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:469:
[31m-        
[m[32m+
[m         positions
             .iter()
             .filter_map(|(key, pos)| {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:479:
             })
             .collect()
     }
[31m-    
[m[32m+
[m     /// Calculate portfolio PnL for account - REAL SIMD-OPTIMIZED IMPLEMENTATION
     pub async fn calculate_portfolio_pnl(&self, account_id: &str) -> PortfolioPnL {
         let mut latency_tracker = LatencyMeasurement::start();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:486:
[31m-    
[m[32m+
[m         let account_positions = self.get_account_positions(account_id).await;
         let position_count = account_positions.len();
[31m-    
[m[32m+
[m         if position_count == 0 {
             return PortfolioPnL {
                 account_id: account_id.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:501:
                 sharpe_ratio: 0.0,
             };
         }
[31m-    
[m[32m+
[m         // REAL SIMD-OPTIMIZED PORTFOLIO CALCULATIONS
         #[cfg(target_arch = "x86_64")]
         let (total_market_value, total_realized_pnl, total_unrealized_pnl) = {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:509:
             let mut market_values = Vec::with_capacity(position_count);
             let mut realized_pnls = Vec::with_capacity(position_count);
             let mut unrealized_pnls = Vec::with_capacity(position_count);
[31m-    
[m[32m+
[m             for (_, snapshot) in &account_positions {
                 market_values.push(snapshot.market_value);
                 realized_pnls.push(snapshot.realized_pnl);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:516:
                 unrealized_pnls.push(snapshot.unrealized_pnl);
             }
[31m-    
[m[32m+
[m             // Use SIMD for parallel summation
             unsafe {
                 let simd_ops = SimdPriceOps::new();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:522:
[31m-    
[m[32m+
[m                 let aligned_market_values = AlignedPrices::from_slice(&market_values);
                 let aligned_realized = AlignedPrices::from_slice(&realized_pnls);
                 let aligned_unrealized = AlignedPrices::from_slice(&unrealized_pnls);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:526:
[31m-    
[m[32m+
[m                 let total_market = simd_ops.sum_aligned(&aligned_market_values);
                 let total_realized = simd_ops.sum_aligned(&aligned_realized);
                 let total_unrealized = simd_ops.sum_aligned(&aligned_unrealized);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:530:
[31m-    
[m[32m+
[m                 (total_market, total_realized, total_unrealized)
             }
         };
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:534:
[31m-    
[m[32m+
[m         #[cfg(not(target_arch = "x86_64"))]
         let (total_market_value, total_realized_pnl, total_unrealized_pnl) = {
             // Scalar fallback for non-x86 architectures
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:538:
             let mut total_market_value = 0.0;
             let mut total_realized_pnl = 0.0;
             let mut total_unrealized_pnl = 0.0;
[31m-    
[m[32m+
[m             for (_, snapshot) in &account_positions {
                 total_market_value += snapshot.market_value;
                 total_realized_pnl += snapshot.realized_pnl;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:545:
                 total_unrealized_pnl += snapshot.unrealized_pnl;
             }
[31m-    
[m[32m+
[m             (total_market_value, total_realized_pnl, total_unrealized_pnl)
         };
[31m-    
[m[32m+
[m         // REAL PORTFOLIO RISK CALCULATIONS
         let portfolio_beta = self.calculate_portfolio_beta(&account_positions).await;
         let portfolio_var_95 = self.calculate_portfolio_var(&account_positions).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:554:
         let sharpe_ratio = self.calculate_sharpe_ratio(total_realized_pnl, total_market_value);
[31m-    
[m[32m+
[m         let elapsed_ns = latency_tracker.finish();
[31m-        debug!("Calculated portfolio PnL for {} positions in {}ns (SIMD optimized)", 
[m[31m-               position_count, elapsed_ns);
[m[31m-    
[m[32m+        debug!(
[m[32m+            "Calculated portfolio PnL for {} positions in {}ns (SIMD optimized)",
[m[32m+            position_count, elapsed_ns
[m[32m+        );
[m[32m+
[m         PortfolioPnL {
             account_id: account_id.to_string(),
             total_market_value,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:570:
             sharpe_ratio,
         }
     }
[31m-    
[m[32m+
[m     /// REAL PORTFOLIO BETA CALCULATION
     async fn calculate_portfolio_beta(&self, positions: &[(String, PositionSnapshot)]) -> f64 {
         // Simplified beta calculation (in production, use historical correlations)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:577:
         let mut weighted_beta = 0.0;
         let mut total_weight = 0.0;
[31m-    
[m[32m+
[m         for (symbol, snapshot) in positions {
             let weight = snapshot.market_value.abs();
             let beta = self.get_symbol_beta(symbol).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:583:
[31m-    
[m[32m+
[m             weighted_beta += weight * beta;
             total_weight += weight;
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:587:
[31m-    
[m[32m+
[m         if total_weight > 0.0 {
             weighted_beta / total_weight
         } else {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:591:
             1.0
         }
     }
[31m-    
[m[32m+
[m     /// REAL PORTFOLIO VAR CALCULATION
     async fn calculate_portfolio_var(&self, positions: &[(String, PositionSnapshot)]) -> f64 {
         // Simplified VaR calculation (in production, use full covariance matrix)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:598:
         let mut total_var = 0.0;
[31m-    
[m[32m+
[m         for (symbol, snapshot) in positions {
             let position_value = snapshot.market_value.abs();
             let symbol_volatility = self.get_symbol_volatility(symbol).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:603:
[31m-    
[m[32m+
[m             // 95% VaR using normal distribution approximation
             let position_var = position_value * symbol_volatility * 1.645;
             total_var += position_var * position_var; // Assuming independence (simplified)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:607:
         }
[31m-    
[m[32m+
[m         total_var.sqrt()
     }
[31m-    
[m[32m+
[m     /// Get symbol beta (production implementation using configuration)
     async fn get_symbol_beta(&self, symbol: &str) -> f64 {
         // Use configuration-driven approach for symbol-specific beta values
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:618:
             // Beta can be approximated from relative volatility compared to market (assuming market vol = 0.16)
             return volatility_profile.base_annual_volatility / 0.16;
         }
[31m-    
[m[32m+
[m         // Fallback to asset classification defaults
         let classification = self.config_manager.classify_symbol(symbol);
         match classification {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:628:
             _ => {
                 tracing::error!("Unknown asset class for symbol {}, cannot determine beta - using ultra-conservative 0.5", symbol);
                 0.5
[31m-            }
[m[32m+            },
[m         }
     }
[31m-    
[m[32m+
[m     /// Get symbol volatility (production implementation using configuration)
     async fn get_symbol_volatility(&self, symbol: &str) -> f64 {
         // Use configuration-driven approach for symbol-specific volatility values
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:639:
             // Use daily volatility calculation from ConfigManager
             return self.config_manager.get_daily_volatility(symbol);
         }
[31m-    
[m[32m+
[m         // Fallback to asset classification defaults
         let classification = self.config_manager.classify_symbol(symbol);
         match classification {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:649:
             _ => {
                 log::error!("Unknown asset class for symbol {}, cannot determine volatility - using high conservative estimate", symbol);
                 0.10 // 10% daily volatility - very conservative for unknown assets
[31m-            }
[m[32m+            },
[m         }
     }
[31m-    
[m[32m+
[m     /// Calculate Sharpe ratio
     fn calculate_sharpe_ratio(&self, total_pnl: f64, total_value: f64) -> f64 {
         if total_value <= 0.0 {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:659:
             return 0.0;
         }
[31m-    
[m[32m+
[m         let return_rate = total_pnl / total_value;
         let risk_free_rate = 0.02 / 365.0; // 2% annual risk-free rate, daily
         let volatility = 0.02; // Simplified volatility estimate
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:665:
[31m-    
[m[32m+
[m         if volatility > 0.0 {
             (return_rate - risk_free_rate) / volatility
         } else {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:669:
             0.0
         }
     }
[31m-    
[m[32m+
[m     /// Get position manager metrics
     pub fn get_metrics(&self) -> PositionManagerMetrics {
         PositionManagerMetrics {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:679:
             updates_per_second: self.metrics.operations_per_second(),
         }
     }
[31m-    
[m[32m+
[m     // Helper methods
[31m-    
[m[32m+
[m     async fn get_symbol_hash(&self, symbol: &str) -> u64 {
         {
             let hashes = self.symbol_hashes.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:689:
                 return hash;
             }
         }
[31m-        
[m[32m+
[m         let hash = self.calculate_hash(symbol);
         {
             let mut hashes = self.symbol_hashes.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:696:
             hashes.insert(symbol.to_string(), hash);
         }
[31m-        
[m[32m+
[m         hash
     }
[31m-    
[m[32m+
[m     async fn get_account_hash(&self, account_id: &str) -> u64 {
         {
             let hashes = self.account_hashes.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:706:
                 return hash;
             }
         }
[31m-        
[m[32m+
[m         let hash = self.calculate_hash(account_id);
         {
             let mut hashes = self.account_hashes.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:713:
             hashes.insert(account_id.to_string(), hash);
         }
[31m-        
[m[32m+
[m         hash
     }
[31m-    
[m[32m+
[m     fn calculate_hash(&self, input: &str) -> u64 {
         use std::collections::hash_map::DefaultHasher;
         use std::hash::{Hash, Hasher};
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:722:
[31m-        
[m[32m+
[m         let mut hasher = DefaultHasher::new();
         input.hash(&mut hasher);
         hasher.finish()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:762:
     pub calculation_time_ns: u64,
     // REAL PORTFOLIO RISK METRICS
     pub portfolio_beta: f64,
[31m-    pub portfolio_var_95: f64,  // 95% Value at Risk
[m[32m+    pub portfolio_var_95: f64, // 95% Value at Risk
[m     pub sharpe_ratio: f64,
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:801:
 #[cfg(test)]
 mod tests {
     use super::*;
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_position_creation_and_update() {
         let config = TradingConfig::default();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:808:
[31m-        let config_manager = std::sync::Arc::new(config::manager::ConfigManager::new(config::manager::ServiceConfig {
[m[31m-            name: "test".to_string(),
[m[31m-            environment: "test".to_string(),
[m[31m-            version: "1.0.0".to_string(),
[m[31m-            settings: serde_json::json!({}),
[m[31m-        }));
[m[31m-        let manager = PositionManager::new(config, config_manager).await.expect("Position manager should be created successfully");
[m[32m+        let config_manager = std::sync::Arc::new(config::manager::ConfigManager::new(
[m[32m+            config::manager::ServiceConfig {
[m[32m+                name: "test".to_string(),
[m[32m+                environment: "test".to_string(),
[m[32m+                version: "1.0.0".to_string(),
[m[32m+                settings: serde_json::json!({}),
[m[32m+            },
[m[32m+        ));
[m[32m+        let manager = PositionManager::new(config, config_manager)
[m[32m+            .await
[m[32m+            .expect("Position manager should be created successfully");
[m 
         // Initial position update (creating position)
[31m-        let update = manager.update_position("account-001", "BTCUSD", 100, 50000.0).await.expect("Position update should succeed");
[m[32m+        let update = manager
[m[32m+            .update_position("account-001", "BTCUSD", 100, 50000.0)
[m[32m+            .await
[m[32m+            .expect("Position update should succeed");
[m         assert_eq!(update.old_quantity, 0);
         assert_eq!(update.new_quantity, 100);
[31m-        
[m[32m+
[m         // Get position snapshot
[31m-        let snapshot = manager.get_position("account-001", "BTCUSD").await.expect("Position snapshot should be retrieved");
[m[32m+        let snapshot = manager
[m[32m+            .get_position("account-001", "BTCUSD")
[m[32m+            .await
[m[32m+            .expect("Position snapshot should be retrieved");
[m         assert_eq!(snapshot.quantity, 100);
         assert_eq!(snapshot.avg_price, 50000.0);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:826:
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_market_price_update() {
         let config = TradingConfig::default();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:830:
[31m-        let config_manager = std::sync::Arc::new(config::manager::ConfigManager::new(config::manager::ServiceConfig {
[m[31m-            name: "test".to_string(),
[m[31m-            environment: "test".to_string(),
[m[31m-            version: "1.0.0".to_string(),
[m[31m-            settings: serde_json::json!({}),
[m[31m-        }));
[m[31m-        let manager = PositionManager::new(config, config_manager).await.expect("Position manager should be created for market price test");
[m[32m+        let config_manager = std::sync::Arc::new(config::manager::ConfigManager::new(
[m[32m+            config::manager::ServiceConfig {
[m[32m+                name: "test".to_string(),
[m[32m+                environment: "test".to_string(),
[m[32m+                version: "1.0.0".to_string(),
[m[32m+                settings: serde_json::json!({}),
[m[32m+            },
[m[32m+        ));
[m[32m+        let manager = PositionManager::new(config, config_manager)
[m[32m+            .await
[m[32m+            .expect("Position manager should be created for market price test");
[m 
         // Create position
[31m-        manager.update_position("account-001", "BTCUSD", 100, 50000.0).await.expect("Position creation should succeed");
[m[32m+        manager
[m[32m+            .update_position("account-001", "BTCUSD", 100, 50000.0)
[m[32m+            .await
[m[32m+            .expect("Position creation should succeed");
[m 
         // Update market price
[31m-        manager.update_market_price("BTCUSD", 51000.0).await.expect("Market price update should succeed");
[m[32m+        manager
[m[32m+            .update_market_price("BTCUSD", 51000.0)
[m[32m+            .await
[m[32m+            .expect("Market price update should succeed");
[m 
         // Check unrealized PnL
[31m-        let snapshot = manager.get_position("account-001", "BTCUSD").await.expect("Position snapshot should be available after market price update");
[m[32m+        let snapshot = manager
[m[32m+            .get_position("account-001", "BTCUSD")
[m[32m+            .await
[m[32m+            .expect("Position snapshot should be available after market price update");
[m         assert_eq!(snapshot.market_price, 51000.0);
         assert!(snapshot.unrealized_pnl > 0.0); // Should be positive
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:849:
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_portfolio_pnl_calculation() {
         let config = TradingConfig::default();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:853:
[31m-        let config_manager = std::sync::Arc::new(config::manager::ConfigManager::new(config::manager::ServiceConfig {
[m[31m-            name: "test".to_string(),
[m[31m-            environment: "test".to_string(),
[m[31m-            version: "1.0.0".to_string(),
[m[31m-            settings: serde_json::json!({}),
[m[31m-        }));
[m[31m-        let manager = PositionManager::new(config, config_manager).await.expect("Position manager should be created for portfolio test");
[m[32m+        let config_manager = std::sync::Arc::new(config::manager::ConfigManager::new(
[m[32m+            config::manager::ServiceConfig {
[m[32m+                name: "test".to_string(),
[m[32m+                environment: "test".to_string(),
[m[32m+                version: "1.0.0".to_string(),
[m[32m+                settings: serde_json::json!({}),
[m[32m+            },
[m[32m+        ));
[m[32m+        let manager = PositionManager::new(config, config_manager)
[m[32m+            .await
[m[32m+            .expect("Position manager should be created for portfolio test");
[m 
         // Create multiple positions
[31m-        manager.update_position("account-001", "BTCUSD", 100, 50000.0).await.expect("BTC position creation should succeed");
[m[31m-        manager.update_position("account-001", "ETHUSD", 1000, 3000.0).await.expect("ETH position creation should succeed");
[m[32m+        manager
[m[32m+            .update_position("account-001", "BTCUSD", 100, 50000.0)
[m[32m+            .await
[m[32m+            .expect("BTC position creation should succeed");
[m[32m+        manager
[m[32m+            .update_position("account-001", "ETHUSD", 1000, 3000.0)
[m[32m+            .await
[m[32m+            .expect("ETH position creation should succeed");
[m 
         // Update market prices
[31m-        manager.update_market_price("BTCUSD", 51000.0).await.expect("BTC market price update should succeed");
[m[31m-        manager.update_market_price("ETHUSD", 3100.0).await.expect("ETH market price update should succeed");
[m[31m-        
[m[32m+        manager
[m[32m+            .update_market_price("BTCUSD", 51000.0)
[m[32m+            .await
[m[32m+            .expect("BTC market price update should succeed");
[m[32m+        manager
[m[32m+            .update_market_price("ETHUSD", 3100.0)
[m[32m+            .await
[m[32m+            .expect("ETH market price update should succeed");
[m[32m+
[m         // Calculate portfolio PnL
         let pnl = manager.calculate_portfolio_pnl("account-001").await;
         assert_eq!(pnl.position_count, 2);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:872:
         assert!(pnl.total_pnl > 0.0); // Should be positive overall
     }
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_atomic_position_operations() {
         let position = AtomicPosition::new(0x123, 0x456);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:878:
[31m-        
[m[32m+
[m         // Test atomic update
[31m-        let update = position.update_with_execution(100, 50000.0, 1000, 1).expect("Atomic position update should succeed");
[m[32m+        let update = position
[m[32m+            .update_with_execution(100, 50000.0, 1000, 1)
[m[32m+            .expect("Atomic position update should succeed");
[m         assert_eq!(update.new_quantity, 100);
[31m-        
[m[32m+
[m         // Test market price update
         let unrealized = position.update_market_price(51000.0, 2000);
         assert!(unrealized != 0.0);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:886:
[31m-        
[m[32m+
[m         // Test snapshot consistency
         let snapshot = position.get_snapshot();
         assert_eq!(snapshot.quantity, 100);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:8:
 //! - Sub-microsecond risk validation for order processing
 //! - Advanced risk metrics and exposure monitoring
 
[32m+use rust_decimal::prelude::ToPrimitive;
[m use std::collections::HashMap;
[31m-use std::sync::atomic::{AtomicU64, AtomicI64, AtomicBool, Ordering};
[m[32m+use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU64, Ordering};
[m use std::sync::Arc;
 use tokio::sync::RwLock;
 use tracing::{debug, info, warn};
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:16:
[31m-use rust_decimal::prelude::ToPrimitive;
[m 
 // Core components - REAL PRODUCTION IMPLEMENTATIONS
[31m-use trading_engine::lockfree::{AtomicMetrics, LockFreeRingBuffer};
[m[31m-use trading_engine::timing::{HardwareTimestamp, LatencyMeasurement, HftLatencyTracker};
[m[31m-use risk::var_calculator::{VarCalculator, VarResult};
[m[31m-use risk::kelly_sizing::{KellySizer, KellyResult};
[m[32m+use risk::kelly_sizing::{KellyResult, KellySizer};
[m use risk::safety::kill_switch::AtomicKillSwitch;
[32m+use risk::var_calculator::{VarCalculator, VarResult};
[m[32m+use trading_engine::lockfree::{AtomicMetrics, LockFreeRingBuffer};
[m[32m+use trading_engine::timing::{HardwareTimestamp, HftLatencyTracker, LatencyMeasurement};
[m 
 // SIMD imports for x86_64
 #[cfg(target_arch = "x86_64")]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:29:
 use trading_engine::simd::SimdMarketDataOps;
 
 // Types and configurations
[31m-use config::structures::RiskConfig;
[m[31m-use config::asset_classification::{AssetClassificationManager, AssetClass, MarketCapTier};
[m use common::Price;
[32m+use config::asset_classification::{AssetClass, AssetClassificationManager, MarketCapTier};
[m[32m+use config::structures::RiskConfig;
[m 
 /// Atomic risk limits for lock-free enforcement
 #[repr(align(64))] // Cache line alignment
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:40:
     pub max_position_size: AtomicU64,
     pub max_portfolio_exposure: AtomicU64,
     pub max_concentration_pct: AtomicU64, // As percentage * 100
[31m-    
[m[32m+
[m     // PnL limits
     pub max_daily_loss: AtomicI64,
     pub max_drawdown_pct: AtomicU64, // As percentage * 100
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:47:
     pub stop_loss_threshold: AtomicI64,
[31m-    
[m[32m+
[m     // VaR limits
[31m-    pub var_limit_1d: AtomicU64, // 1-day VaR limit
[m[31m-    pub var_limit_10d: AtomicU64, // 10-day VaR limit
[m[32m+    pub var_limit_1d: AtomicU64,         // 1-day VaR limit
[m[32m+    pub var_limit_10d: AtomicU64,        // 10-day VaR limit
[m     pub var_confidence_level: AtomicU64, // Confidence level * 10000
[31m-    
[m[32m+
[m     // Trading limits
     pub max_order_size: AtomicU64,
     pub max_orders_per_second: AtomicU64,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:57:
     pub max_notional_per_hour: AtomicU64,
[31m-    
[m[32m+
[m     // Compliance flags
     pub trading_enabled: AtomicBool,
     pub risk_override_active: AtomicBool,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:65:
 impl AtomicRiskLimits {
     pub fn from_config(config: &RiskConfig) -> Self {
         Self {
[31m-            max_position_size: AtomicU64::new((config.max_position_size.to_f64().unwrap_or(0.0) * 10000.0) as u64),
[m[31m-            max_portfolio_exposure: AtomicU64::new((config.max_portfolio_exposure.to_f64().unwrap_or(0.0) * 10000.0) as u64),
[m[31m-            max_concentration_pct: AtomicU64::new((config.max_concentration_pct.to_f64().unwrap_or(0.0) * 100.0) as u64),
[m[31m-            max_daily_loss: AtomicI64::new((config.max_daily_loss.to_f64().unwrap_or(0.0) * 10000.0) as i64),
[m[31m-            max_drawdown_pct: AtomicU64::new((config.max_drawdown_pct.to_f64().unwrap_or(0.0) * 100.0) as u64),
[m[31m-            stop_loss_threshold: AtomicI64::new((config.stop_loss_threshold.to_f64().unwrap_or(0.0) * 10000.0) as i64),
[m[31m-            var_limit_1d: AtomicU64::new((config.var_limit_1d.to_f64().unwrap_or(0.0) * 10000.0) as u64),
[m[31m-            var_limit_10d: AtomicU64::new((config.var_limit_10d.to_f64().unwrap_or(0.0) * 10000.0) as u64),
[m[32m+            max_position_size: AtomicU64::new(
[m[32m+                (config.max_position_size.to_f64().unwrap_or(0.0) * 10000.0) as u64,
[m[32m+            ),
[m[32m+            max_portfolio_exposure: AtomicU64::new(
[m[32m+                (config.max_portfolio_exposure.to_f64().unwrap_or(0.0) * 10000.0) as u64,
[m[32m+            ),
[m[32m+            max_concentration_pct: AtomicU64::new(
[m[32m+                (config.max_concentration_pct.to_f64().unwrap_or(0.0) * 100.0) as u64,
[m[32m+            ),
[m[32m+            max_daily_loss: AtomicI64::new(
[m[32m+                (config.max_daily_loss.to_f64().unwrap_or(0.0) * 10000.0) as i64,
[m[32m+            ),
[m[32m+            max_drawdown_pct: AtomicU64::new(
[m[32m+                (config.max_drawdown_pct.to_f64().unwrap_or(0.0) * 100.0) as u64,
[m[32m+            ),
[m[32m+            stop_loss_threshold: AtomicI64::new(
[m[32m+                (config.stop_loss_threshold.to_f64().unwrap_or(0.0) * 10000.0) as i64,
[m[32m+            ),
[m[32m+            var_limit_1d: AtomicU64::new(
[m[32m+                (config.var_limit_1d.to_f64().unwrap_or(0.0) * 10000.0) as u64,
[m[32m+            ),
[m[32m+            var_limit_10d: AtomicU64::new(
[m[32m+                (config.var_limit_10d.to_f64().unwrap_or(0.0) * 10000.0) as u64,
[m[32m+            ),
[m             var_confidence_level: AtomicU64::new((config.var_confidence_level * 10000.0) as u64),
[31m-            max_order_size: AtomicU64::new((config.max_order_size.to_f64().unwrap_or(0.0) * 10000.0) as u64),
[m[32m+            max_order_size: AtomicU64::new(
[m[32m+                (config.max_order_size.to_f64().unwrap_or(0.0) * 10000.0) as u64,
[m[32m+            ),
[m             max_orders_per_second: AtomicU64::new(config.max_orders_per_second),
[31m-            max_notional_per_hour: AtomicU64::new((config.max_notional_per_hour.to_f64().unwrap_or(0.0) * 10000.0) as u64),
[m[32m+            max_notional_per_hour: AtomicU64::new(
[m[32m+                (config.max_notional_per_hour.to_f64().unwrap_or(0.0) * 10000.0) as u64,
[m[32m+            ),
[m             trading_enabled: AtomicBool::new(true),
             risk_override_active: AtomicBool::new(false),
             emergency_stop_active: AtomicBool::new(false),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:103:
 /// Risk violation types
 #[derive(Debug, Clone)]
 pub enum RiskViolation {
[31m-    PositionSizeExceeded { symbol: String, size: f64, limit: f64 },
[m[31m-    ConcentrationExceeded { symbol: String, pct: f64, limit: f64 },
[m[31m-    VarLimitExceeded { var_1d: f64, limit: f64 },
[m[31m-    DrawdownExceeded { drawdown: f64, limit: f64 },
[m[31m-    DailyLossExceeded { loss: f64, limit: f64 },
[m[31m-    OrderSizeExceeded { size: f64, limit: f64 },
[m[31m-    OrderRateExceeded { rate: u64, limit: u64 },
[m[31m-    NotionalLimitExceeded { notional: f64, limit: f64 },
[m[32m+    PositionSizeExceeded {
[m[32m+        symbol: String,
[m[32m+        size: f64,
[m[32m+        limit: f64,
[m[32m+    },
[m[32m+    ConcentrationExceeded {
[m[32m+        symbol: String,
[m[32m+        pct: f64,
[m[32m+        limit: f64,
[m[32m+    },
[m[32m+    VarLimitExceeded {
[m[32m+        var_1d: f64,
[m[32m+        limit: f64,
[m[32m+    },
[m[32m+    DrawdownExceeded {
[m[32m+        drawdown: f64,
[m[32m+        limit: f64,
[m[32m+    },
[m[32m+    DailyLossExceeded {
[m[32m+        loss: f64,
[m[32m+        limit: f64,
[m[32m+    },
[m[32m+    OrderSizeExceeded {
[m[32m+        size: f64,
[m[32m+        limit: f64,
[m[32m+    },
[m[32m+    OrderRateExceeded {
[m[32m+        rate: u64,
[m[32m+        limit: u64,
[m[32m+    },
[m[32m+    NotionalLimitExceeded {
[m[32m+        notional: f64,
[m[32m+        limit: f64,
[m[32m+    },
[m }
 
 /// Production-grade RiskManager
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:117:
 pub struct RiskManager {
     // Risk limits with atomic enforcement
     limits: Arc<AtomicRiskLimits>,
[31m-    
[m[32m+
[m     // Risk calculation engines
     var_calculator: Arc<VarCalculator>,
     kelly_sizer: Arc<KellySizer>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:124:
     kill_switch: Arc<AtomicKillSwitch>,
[31m-    
[m[32m+
[m     // Risk exposure tracking
     exposures: Arc<RwLock<HashMap<String, RiskExposure>>>,
[31m-    
[m[32m+
[m     // Violation tracking
     violations: Arc<LockFreeRingBuffer<RiskViolation>>,
     violation_count: AtomicU64,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:132:
[31m-    
[m[32m+
[m     // High-performance components - REAL PRODUCTION TIMING
     metrics: Arc<AtomicMetrics>,
     latency_tracker: Arc<HftLatencyTracker>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:136:
[31m-    
[m[32m+
[m     // Historical data for VaR calculations
     price_history: Arc<RwLock<HashMap<String, Vec<f64>>>>,
     return_history: Arc<RwLock<HashMap<String, Vec<f64>>>>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:140:
[31m-    
[m[32m+
[m     // Compliance tracking
     compliance_events: Arc<LockFreeRingBuffer<ComplianceEvent>>,
[31m-    
[m[32m+
[m     // Configuration
     config: Arc<RiskConfig>,
     asset_classification: Arc<AssetClassificationManager>,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:147:
[31m-    
[m[32m+
[m     // Order rate limiting
     order_timestamps: Arc<RwLock<Vec<u64>>>,
     notional_tracker: Arc<RwLock<Vec<(u64, f64)>>>, // (timestamp, notional)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:157:
         _trading_config: config::structures::TradingConfig,
         asset_classification: AssetClassificationManager,
     ) -> Result<Self, Box<dyn std::error::Error + Send + Sync>> {
[31m-        
[m         // Initialize risk calculation engines
         // VarCalculator::new takes no arguments (it's RealVaREngine)
         let var_calculator = Arc::new(VarCalculator::new());
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:165:
         // KellySizer::new takes a KellyConfig
         let kelly_config = config::structures::KellyConfig::default();
         let kelly_sizer = Arc::new(KellySizer::new(kelly_config));
[31m-        
[m[32m+
[m         // Initialize kill switch system
         // Create KillSwitchConfig with proper structure
         // Use SafetyConfig which contains public KillSwitchConfig
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:172:
         use risk::safety::SafetyConfig;
         let safety_config = SafetyConfig::default();
[31m-        let redis_url = std::env::var("REDIS_URL")
[m[31m-            .unwrap_or_else(|_| "redis://localhost:6379".to_string());
[m[31m-        
[m[32m+        let redis_url =
[m[32m+            std::env::var("REDIS_URL").unwrap_or_else(|_| "redis://localhost:6379".to_string());
[m[32m+
[m         let kill_switch = Arc::new(
[31m-            AtomicKillSwitch::new(
[m[31m-                safety_config.kill_switch,
[m[31m-                redis_url)
[m[32m+            AtomicKillSwitch::new(safety_config.kill_switch, redis_url)
[m                 .await
[31m-                .map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync>)?
[m[32m+                .map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync>)?,
[m         );
[31m-        
[m[32m+
[m         // Initialize violation tracking
[31m-        let violations = Arc::new(LockFreeRingBuffer::new(10000)
[m[31m-            .map_err(|e| format!("Failed to create violations buffer: {}", e))?);
[m[31m-        
[m[31m-        let compliance_events = Arc::new(LockFreeRingBuffer::new(10000)
[m[31m-            .map_err(|e| format!("Failed to create compliance buffer: {}", e))?);
[m[31m-        
[m[32m+        let violations = Arc::new(
[m[32m+            LockFreeRingBuffer::new(10000)
[m[32m+                .map_err(|e| format!("Failed to create violations buffer: {}", e))?,
[m[32m+        );
[m[32m+
[m[32m+        let compliance_events = Arc::new(
[m[32m+            LockFreeRingBuffer::new(10000)
[m[32m+                .map_err(|e| format!("Failed to create compliance buffer: {}", e))?,
[m[32m+        );
[m[32m+
[m         Ok(Self {
             limits: Arc::new(AtomicRiskLimits::from_config(&risk_config)),
             var_calculator,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:208:
             notional_tracker: Arc::new(RwLock::new(Vec::new())),
         })
     }
[31m-    
[m[32m+
[m     /// Validate order against risk limits - REAL SUB-MICROSECOND IMPLEMENTATION
     pub async fn validate_order(
         &self,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:218:
         price: f64,
     ) -> Result<OrderValidation, RiskViolation> {
         let mut latency_tracker = LatencyMeasurement::start();
[31m-    
[m[32m+
[m         // REAL KILL SWITCH CHECK - Hardware-level emergency stop
         // Check kill switch status - it returns Result<bool, RiskError>
[31m-        let is_active = self.kill_switch.is_active().await
[m[31m-            .map_err(|_| RiskViolation::DailyLossExceeded { loss: 0.0, limit: 0.0 })?;
[m[31m-        
[m[32m+        let is_active =
[m[32m+            self.kill_switch
[m[32m+                .is_active()
[m[32m+                .await
[m[32m+                .map_err(|_| RiskViolation::DailyLossExceeded {
[m[32m+                    loss: 0.0,
[m[32m+                    limit: 0.0,
[m[32m+                })?;
[m[32m+
[m         if is_active {
             self.record_compliance_event(ComplianceEvent {
                 event_type: ComplianceEventType::EmergencyStop,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:230:
                 description: "Kill switch active - all trading halted".to_string(),
                 severity: ComplianceSeverity::Critical,
                 timestamp_ns: 0,
[31m-            }).await;
[m[31m-            return Err(RiskViolation::DailyLossExceeded { 
[m[31m-                loss: 0.0, 
[m[31m-                limit: 0.0 
[m[32m+            })
[m[32m+            .await;
[m[32m+            return Err(RiskViolation::DailyLossExceeded {
[m[32m+                loss: 0.0,
[m[32m+                limit: 0.0,
[m             });
         }
[31m-        
[m[32m+
[m         // Check emergency stop
         if self.limits.emergency_stop_active.load(Ordering::Acquire) {
[31m-            return Err(RiskViolation::DailyLossExceeded { 
[m[31m-                loss: 0.0, 
[m[31m-                limit: 0.0 
[m[32m+            return Err(RiskViolation::DailyLossExceeded {
[m[32m+                loss: 0.0,
[m[32m+                limit: 0.0,
[m             });
         }
[31m-        
[m[32m+
[m         // Check order size limit
         let order_notional = quantity.abs() * price;
[31m-        let max_order_size = self.fixed_to_price(
[m[31m-            self.limits.max_order_size.load(Ordering::Acquire)
[m[31m-        );
[m[31m-        
[m[32m+        let max_order_size =
[m[32m+            self.fixed_to_price(self.limits.max_order_size.load(Ordering::Acquire));
[m[32m+
[m         if order_notional > max_order_size {
             self.record_violation(RiskViolation::OrderSizeExceeded {
                 size: order_notional,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:257:
                 limit: max_order_size,
[31m-            }).await;
[m[32m+            })
[m[32m+            .await;
[m             return Err(RiskViolation::OrderSizeExceeded {
                 size: order_notional,
                 limit: max_order_size,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:262:
             });
         }
[31m-        
[m[32m+
[m         // Check order rate limit
         self.check_order_rate_limit().await?;
[31m-        
[m[32m+
[m         // Check notional limit
         self.check_notional_limit(order_notional).await?;
[31m-        
[m[32m+
[m         // Get current exposure
         let exposure = self.get_account_exposure(account_id).await;
[31m-        
[m[32m+
[m         // Check position size limit
[31m-        let current_position = exposure.concentration_by_symbol
[m[32m+        let current_position = exposure
[m[32m+            .concentration_by_symbol
[m             .get(symbol)
             .copied()
             .unwrap_or(0.0);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:279:
         let new_position = current_position + quantity;
[31m-        let max_position = self.fixed_to_price(
[m[31m-            self.limits.max_position_size.load(Ordering::Acquire)
[m[31m-        );
[m[31m-        
[m[32m+        let max_position =
[m[32m+            self.fixed_to_price(self.limits.max_position_size.load(Ordering::Acquire));
[m[32m+
[m         if new_position.abs() > max_position {
             self.record_violation(RiskViolation::PositionSizeExceeded {
                 symbol: symbol.to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:287:
                 size: new_position.abs(),
                 limit: max_position,
[31m-            }).await;
[m[32m+            })
[m[32m+            .await;
[m             return Err(RiskViolation::PositionSizeExceeded {
                 symbol: symbol.to_string(),
                 size: new_position.abs(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:293:
                 limit: max_position,
             });
         }
[31m-        
[m[32m+
[m         // Calculate Kelly-optimal position size
         // Convert &str to Symbol type
         use common::Symbol;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:300:
         let symbol_obj = Symbol::from(symbol);
 
[31m-        let kelly_result = self.kelly_sizer.calculate_kelly_fraction(
[m[31m-            &symbol_obj,
[m[31m-            "default_strategy", // Use default strategy ID
[m[31m-        ).map_err(|e| RiskViolation::from(RiskError::CalculationError(e.to_string())))?;
[m[31m-        
[m[32m+        let kelly_result = self
[m[32m+            .kelly_sizer
[m[32m+            .calculate_kelly_fraction(
[m[32m+                &symbol_obj,
[m[32m+                "default_strategy", // Use default strategy ID
[m[32m+            )
[m[32m+            .map_err(|e| RiskViolation::from(RiskError::CalculationError(e.to_string())))?;
[m[32m+
[m         // Calculate incremental VaR
[31m-        let incremental_var = self.calculate_incremental_var(
[m[31m-            account_id, symbol, quantity, price
[m[31m-        ).await?;
[m[31m-        
[m[31m-            // REAL PORTFOLIO HEAT MAP ANALYSIS
[m[31m-            let portfolio_heat = self.calculate_portfolio_heat(account_id, symbol, quantity).await;
[m[31m-        
[m[31m-            // REAL STRESS TESTING - Monte Carlo simulation
[m[31m-            let stress_test_result = self.run_stress_test(account_id, symbol, quantity, price).await?;
[m[31m-        
[m[31m-            let elapsed_ns = latency_tracker.finish();
[m[31m-            self.metrics.record_operation_time(elapsed_ns);
[m[31m-        
[m[31m-            // REAL COMPLIANCE AUDIT TRAIL
[m[31m-            self.record_compliance_event(ComplianceEvent {
[m[31m-                event_type: ComplianceEventType::AuditTrail,
[m[31m-                description: format!("Order validated: {} {} {} @ {} ({}ns)", 
[m[31m-                                   account_id, symbol, quantity, price, elapsed_ns),
[m[31m-                severity: ComplianceSeverity::Low,
[m[31m-                timestamp_ns: 0,
[m[31m-            }).await;
[m[31m-        
[m[31m-            Ok(OrderValidation {
[m[31m-                approved: true,
[m[31m-                kelly_size: kelly_result.position_fraction,
[m[31m-                kelly_fraction: kelly_result.adjusted_kelly_fraction,
[m[31m-                incremental_var,
[m[31m-                risk_score: self.calculate_risk_score(&exposure, incremental_var),
[m[31m-                validation_time_ns: elapsed_ns,
[m[31m-                portfolio_heat,
[m[31m-                stress_test_pnl: stress_test_result.worst_case_pnl,
[m[31m-                correlation_risk: stress_test_result.correlation_risk,
[m[31m-                liquidity_risk: self.calculate_liquidity_risk(symbol, quantity).await,
[m[31m-            })
[m[32m+        let incremental_var = self
[m[32m+            .calculate_incremental_var(account_id, symbol, quantity, price)
[m[32m+            .await?;
[m[32m+
[m[32m+        // REAL PORTFOLIO HEAT MAP ANALYSIS
[m[32m+        let portfolio_heat = self
[m[32m+            .calculate_portfolio_heat(account_id, symbol, quantity)
[m[32m+            .await;
[m[32m+
[m[32m+        // REAL STRESS TESTING - Monte Carlo simulation
[m[32m+        let stress_test_result = self
[m[32m+            .run_stress_test(account_id, symbol, quantity, price)
[m[32m+            .await?;
[m[32m+
[m[32m+        let elapsed_ns = latency_tracker.finish();
[m[32m+        self.metrics.record_operation_time(elapsed_ns);
[m[32m+
[m[32m+        // REAL COMPLIANCE AUDIT TRAIL
[m[32m+        self.record_compliance_event(ComplianceEvent {
[m[32m+            event_type: ComplianceEventType::AuditTrail,
[m[32m+            description: format!(
[m[32m+                "Order validated: {} {} {} @ {} ({}ns)",
[m[32m+                account_id, symbol, quantity, price, elapsed_ns
[m[32m+            ),
[m[32m+            severity: ComplianceSeverity::Low,
[m[32m+            timestamp_ns: 0,
[m[32m+        })
[m[32m+        .await;
[m[32m+
[m[32m+        Ok(OrderValidation {
[m[32m+            approved: true,
[m[32m+            kelly_size: kelly_result.position_fraction,
[m[32m+            kelly_fraction: kelly_result.adjusted_kelly_fraction,
[m[32m+            incremental_var,
[m[32m+            risk_score: self.calculate_risk_score(&exposure, incremental_var),
[m[32m+            validation_time_ns: elapsed_ns,
[m[32m+            portfolio_heat,
[m[32m+            stress_test_pnl: stress_test_result.worst_case_pnl,
[m[32m+            correlation_risk: stress_test_result.correlation_risk,
[m[32m+            liquidity_risk: self.calculate_liquidity_risk(symbol, quantity).await,
[m[32m+        })
[m[32m+    }
[m[32m+
[m[32m+    /// REAL PORTFOLIO HEAT MAP CALCULATION
[m[32m+    async fn calculate_portfolio_heat(&self, account_id: &str, symbol: &str, quantity: f64) -> f64 {
[m[32m+        let exposure = self.get_account_exposure(account_id).await;
[m[32m+
[m[32m+        // Calculate position concentration after trade
[m[32m+        let current_position = exposure
[m[32m+            .concentration_by_symbol
[m[32m+            .get(symbol)
[m[32m+            .copied()
[m[32m+            .unwrap_or(0.0);
[m[32m+        let new_position = current_position + quantity;
[m[32m+
[m[32m+        // Heat map based on position concentration and volatility
[m[32m+        let symbol_volatility = self.get_symbol_volatility(symbol).await;
[m[32m+        let concentration = if exposure.total_exposure > 0.0 {
[m[32m+            new_position.abs() / exposure.total_exposure
[m[32m+        } else {
[m[32m+            1.0
[m[32m+        };
[m[32m+
[m[32m+        // Heat score: 0-1 scale
[m[32m+        (concentration * symbol_volatility * 10.0).min(1.0)
[m[32m+    }
[m[32m+
[m[32m+    /// REAL MONTE CARLO STRESS TESTING
[m[32m+    async fn run_stress_test(
[m[32m+        &self,
[m[32m+        account_id: &str,
[m[32m+        symbol: &str,
[m[32m+        quantity: f64,
[m[32m+        price: f64,
[m[32m+    ) -> Result<StressTestResult, RiskError> {
[m[32m+        let exposure = self.get_account_exposure(account_id).await;
[m[32m+
[m[32m+        // Get historical volatility for Monte Carlo simulation
[m[32m+        let returns = self.return_history.read().await;
[m[32m+        let symbol_returns = returns.get(symbol).ok_or(RiskError::InsufficientData)?;
[m[32m+
[m[32m+        if symbol_returns.len() < 30 {
[m[32m+            return Err(RiskError::InsufficientData);
[m         }
[31m-        
[m[31m-        /// REAL PORTFOLIO HEAT MAP CALCULATION
[m[31m-        async fn calculate_portfolio_heat(&self, account_id: &str, symbol: &str, quantity: f64) -> f64 {
[m[31m-            let exposure = self.get_account_exposure(account_id).await;
[m[31m-        
[m[31m-            // Calculate position concentration after trade
[m[31m-            let current_position = exposure.concentration_by_symbol
[m[31m-                .get(symbol)
[m[31m-                .copied()
[m[31m-                .unwrap_or(0.0);
[m[31m-            let new_position = current_position + quantity;
[m[31m-        
[m[31m-            // Heat map based on position concentration and volatility
[m[31m-            let symbol_volatility = self.get_symbol_volatility(symbol).await;
[m[31m-            let concentration = if exposure.total_exposure > 0.0 {
[m[31m-                new_position.abs() / exposure.total_exposure
[m[31m-            } else {
[m[31m-                1.0
[m[31m-            };
[m[31m-        
[m[31m-            // Heat score: 0-1 scale
[m[31m-            (concentration * symbol_volatility * 10.0).min(1.0)
[m[31m-        }
[m[31m-        
[m[31m-        /// REAL MONTE CARLO STRESS TESTING
[m[31m-        async fn run_stress_test(
[m[31m-            &self, 
[m[31m-            account_id: &str, 
[m[31m-            symbol: &str, 
[m[31m-            quantity: f64, 
[m[31m-            price: f64
[m[31m-        ) -> Result<StressTestResult, RiskError> {
[m[31m-            let exposure = self.get_account_exposure(account_id).await;
[m[31m-        
[m[31m-            // Get historical volatility for Monte Carlo simulation
[m[31m-            let returns = self.return_history.read().await;
[m[31m-            let symbol_returns = returns.get(symbol)
[m[31m-                .ok_or(RiskError::InsufficientData)?;
[m[31m-        
[m[31m-            if symbol_returns.len() < 30 {
[m[31m-                return Err(RiskError::InsufficientData);
[m[31m-            }
[m[31m-        
[m[31m-            // REAL MONTE CARLO SIMULATION - 10,000 scenarios
[m[31m-            let scenarios = 10000;
[m[31m-            let mut pnl_outcomes = Vec::with_capacity(scenarios);
[m[31m-        
[m[31m-            // Calculate statistics for simulation
[m[31m-            let mean_return: f64 = symbol_returns.iter().sum::<f64>() / symbol_returns.len() as f64;
[m[31m-            let variance: f64 = symbol_returns.iter()
[m[31m-                .map(|&r| (r - mean_return).powi(2))
[m[31m-                .sum::<f64>() / (symbol_returns.len() - 1) as f64;
[m[31m-            let std_dev = variance.sqrt();
[m[31m-        
[m[31m-            // Run Monte Carlo simulation
[m[31m-            // Note: In production, use actual random number generation
[m[31m-            // For compilation, we'll use a simplified approach
[m[31m-            let mut rng_seed = 42u64;
[m[31m-        
[m[31m-            for _i in 0..scenarios {
[m[31m-                // Simplified random return generation for compilation
[m[31m-                // In production, use proper Monte Carlo with Box-Muller transform
[m[31m-                rng_seed = rng_seed.wrapping_mul(1664525).wrapping_add(1013904223);
[m[31m-                let uniform = (rng_seed as f64) / (u64::MAX as f64);
[m[31m-            
[m[31m-                // Box-Muller transform for normal distribution
[m[31m-                let angle = 2.0 * std::f64::consts::PI * uniform;
[m[31m-                rng_seed = rng_seed.wrapping_mul(1664525).wrapping_add(1013904223);
[m[31m-                let radius = (-2.0 * ((rng_seed as f64) / (u64::MAX as f64)).ln()).sqrt();
[m[31m-                let random_return = mean_return + std_dev * radius * angle.cos();        
[m[31m-                // Calculate position PnL
[m[31m-                let position_pnl = quantity * price * random_return;
[m[31m-        
[m[31m-                // Add portfolio correlation effects (simplified)
[m[31m-                let portfolio_correlation = 0.3; // Assume 30% correlation
[m[31m-                let portfolio_pnl = position_pnl * (1.0 + portfolio_correlation * 0.5);
[m[31m-        
[m[31m-                pnl_outcomes.push(portfolio_pnl);
[m[31m-            }
[m 
[31m-            // Sort outcomes for percentile calculations
[m[31m-            // Filter out NaN values (defensive), then sort
[m[31m-            pnl_outcomes.retain(|x| !x.is_nan());
[m[31m-            pnl_outcomes.sort_by(|a, b| {
[m[31m-                // Safe comparison: both values are guaranteed to be non-NaN
[m[31m-                a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal)
[m[31m-            });
[m[32m+        // REAL MONTE CARLO SIMULATION - 10,000 scenarios
[m[32m+        let scenarios = 10000;
[m[32m+        let mut pnl_outcomes = Vec::with_capacity(scenarios);
[m 
[31m-            // Calculate risk metrics
[m[31m-            let worst_case_pnl = pnl_outcomes[0]; // Minimum (worst loss)
[m[31m-            let percentile_5 = pnl_outcomes[(scenarios as f64 * 0.05) as usize];
[m[31m-            let percentile_95 = pnl_outcomes[(scenarios as f64 * 0.95) as usize];
[m[31m-        
[m[31m-            // Calculate correlation risk
[m[31m-            let correlation_risk = self.calculate_correlation_risk(account_id, symbol).await;
[m[31m-        
[m[31m-            Ok(StressTestResult {
[m[31m-                worst_case_pnl,
[m[31m-                percentile_5_pnl: percentile_5,
[m[31m-                percentile_95_pnl: percentile_95,
[m[31m-                correlation_risk,
[m[31m-                scenarios_run: scenarios,
[m[31m-            })
[m[32m+        // Calculate statistics for simulation
[m[32m+        let mean_return: f64 = symbol_returns.iter().sum::<f64>() / symbol_returns.len() as f64;
[m[32m+        let variance: f64 = symbol_returns
[m[32m+            .iter()
[m[32m+            .map(|&r| (r - mean_return).powi(2))
[m[32m+            .sum::<f64>()
[m[32m+            / (symbol_returns.len() - 1) as f64;
[m[32m+        let std_dev = variance.sqrt();
[m[32m+
[m[32m+        // Run Monte Carlo simulation
[m[32m+        // Note: In production, use actual random number generation
[m[32m+        // For compilation, we'll use a simplified approach
[m[32m+        let mut rng_seed = 42u64;
[m[32m+
[m[32m+        for _i in 0..scenarios {
[m[32m+            // Simplified random return generation for compilation
[m[32m+            // In production, use proper Monte Carlo with Box-Muller transform
[m[32m+            rng_seed = rng_seed.wrapping_mul(1664525).wrapping_add(1013904223);
[m[32m+            let uniform = (rng_seed as f64) / (u64::MAX as f64);
[m[32m+
[m[32m+            // Box-Muller transform for normal distribution
[m[32m+            let angle = 2.0 * std::f64::consts::PI * uniform;
[m[32m+            rng_seed = rng_seed.wrapping_mul(1664525).wrapping_add(1013904223);
[m[32m+            let radius = (-2.0 * ((rng_seed as f64) / (u64::MAX as f64)).ln()).sqrt();
[m[32m+            let random_return = mean_return + std_dev * radius * angle.cos();
[m[32m+            // Calculate position PnL
[m[32m+            let position_pnl = quantity * price * random_return;
[m[32m+
[m[32m+            // Add portfolio correlation effects (simplified)
[m[32m+            let portfolio_correlation = 0.3; // Assume 30% correlation
[m[32m+            let portfolio_pnl = position_pnl * (1.0 + portfolio_correlation * 0.5);
[m[32m+
[m[32m+            pnl_outcomes.push(portfolio_pnl);
[m         }
[31m-        
[m[31m-        /// REAL CORRELATION RISK CALCULATION
[m[31m-        async fn calculate_correlation_risk(&self, account_id: &str, symbol: &str) -> f64 {
[m[31m-            let exposure = self.get_account_exposure(account_id).await;
[m[31m-        
[m[31m-            // Calculate correlation with existing positions
[m[31m-            let mut total_correlation_risk = 0.0;
[m[31m-            let mut total_exposure = 0.0;
[m[31m-        
[m[31m-            for (existing_symbol, &position) in &exposure.concentration_by_symbol {
[m[31m-                if existing_symbol != symbol {
[m[31m-                    let correlation = self.get_symbol_correlation(symbol, existing_symbol).await;
[m[31m-                    let risk_contribution = position.abs() * correlation.abs();
[m[31m-                    total_correlation_risk += risk_contribution;
[m[31m-                    total_exposure += position.abs();
[m[31m-                }
[m[32m+
[m[32m+        // Sort outcomes for percentile calculations
[m[32m+        // Filter out NaN values (defensive), then sort
[m[32m+        pnl_outcomes.retain(|x| !x.is_nan());
[m[32m+        pnl_outcomes.sort_by(|a, b| {
[m[32m+            // Safe comparison: both values are guaranteed to be non-NaN
[m[32m+            a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal)
[m[32m+        });
[m[32m+
[m[32m+        // Calculate risk metrics
[m[32m+        let worst_case_pnl = pnl_outcomes[0]; // Minimum (worst loss)
[m[32m+        let percentile_5 = pnl_outcomes[(scenarios as f64 * 0.05) as usize];
[m[32m+        let percentile_95 = pnl_outcomes[(scenarios as f64 * 0.95) as usize];
[m[32m+
[m[32m+        // Calculate correlation risk
[m[32m+        let correlation_risk = self.calculate_correlation_risk(account_id, symbol).await;
[m[32m+
[m[32m+        Ok(StressTestResult {
[m[32m+            worst_case_pnl,
[m[32m+            percentile_5_pnl: percentile_5,
[m[32m+            percentile_95_pnl: percentile_95,
[m[32m+            correlation_risk,
[m[32m+            scenarios_run: scenarios,
[m[32m+        })
[m[32m+    }
[m[32m+
[m[32m+    /// REAL CORRELATION RISK CALCULATION
[m[32m+    async fn calculate_correlation_risk(&self, account_id: &str, symbol: &str) -> f64 {
[m[32m+        let exposure = self.get_account_exposure(account_id).await;
[m[32m+
[m[32m+        // Calculate correlation with existing positions
[m[32m+        let mut total_correlation_risk = 0.0;
[m[32m+        let mut total_exposure = 0.0;
[m[32m+
[m[32m+        for (existing_symbol, &position) in &exposure.concentration_by_symbol {
[m[32m+            if existing_symbol != symbol {
[m[32m+                let correlation = self.get_symbol_correlation(symbol, existing_symbol).await;
[m[32m+                let risk_contribution = position.abs() * correlation.abs();
[m[32m+                total_correlation_risk += risk_contribution;
[m[32m+                total_exposure += position.abs();
[m             }
[31m-        
[m[31m-            if total_exposure > 0.0 {
[m[31m-                total_correlation_risk / total_exposure
[m[31m-            } else {
[m[31m-                0.0
[m[31m-            }
[m         }
[31m-        
[m[31m-        /// REAL LIQUIDITY RISK ASSESSMENT
[m[31m-        async fn calculate_liquidity_risk(&self, symbol: &str, quantity: f64) -> f64 {
[m[31m-            // Get market depth and volume data (simplified)
[m[31m-            let daily_volume = self.get_symbol_daily_volume(symbol).await;
[m[31m-            let bid_ask_spread = self.get_symbol_spread(symbol).await;
[m[31m-        
[m[31m-            // Calculate position as percentage of daily volume
[m[31m-            let volume_impact = if daily_volume > 0.0 {
[m[31m-                quantity.abs() / daily_volume
[m[31m-            } else {
[m[31m-                1.0 // High risk if no volume data
[m[31m-            };
[m[31m-        
[m[31m-            // Liquidity risk score: higher is riskier
[m[31m-            let spread_risk = bid_ask_spread * 1000.0; // Basis points
[m[31m-            let volume_risk = volume_impact * 100.0; // Percentage
[m[31m-        
[m[31m-            (spread_risk + volume_risk).min(10.0) // Cap at 10
[m[32m+
[m[32m+        if total_exposure > 0.0 {
[m[32m+            total_correlation_risk / total_exposure
[m[32m+        } else {
[m[32m+            0.0
[m         }
[31m-        
[m[31m-        /// Get symbol correlation using asset classification system
[m[31m-        async fn get_symbol_correlation(&self, symbol1: &str, symbol2: &str) -> f64 {
[m[31m-            // Get asset classes for both symbols
[m[31m-            let asset_class1 = self.asset_classification.classify_symbol(symbol1);
[m[31m-            let asset_class2 = self.asset_classification.classify_symbol(symbol2);
[m[31m-        
[m[31m-            // Calculate correlation based on asset classification
[m[31m-            match (&asset_class1, &asset_class2) {
[m[31m-                // Same asset class pairs
[m[31m-                (AssetClass::Crypto { .. }, AssetClass::Crypto { .. }) => {
[m[31m-                    if symbol1 == symbol2 { 1.0 } else { 0.7 } // High crypto correlation
[m[31m-                },
[m[31m-                (AssetClass::Forex { .. }, AssetClass::Forex { .. }) => {
[m[31m-                    if symbol1 == symbol2 { 1.0 } else { 0.8 } // High forex correlation
[m[31m-                },
[m[31m-                (AssetClass::Equity { .. }, AssetClass::Equity { .. }) => {
[m[31m-                    if symbol1 == symbol2 { 1.0 } else { 0.6 } // Moderate equity correlation
[m[31m-                },
[m[31m-                // Cross-asset class correlations
[m[31m-                (AssetClass::Crypto { .. }, AssetClass::Forex { .. }) | 
[m[31m-                (AssetClass::Forex { .. }, AssetClass::Crypto { .. }) => -0.2, // Negative correlation
[m[31m-                (AssetClass::Equity { .. }, AssetClass::Crypto { .. }) |
[m[31m-                (AssetClass::Crypto { .. }, AssetClass::Equity { .. }) => 0.3, // Low positive correlation
[m[31m-                (AssetClass::Equity { .. }, AssetClass::Forex { .. }) |
[m[31m-                (AssetClass::Forex { .. }, AssetClass::Equity { .. }) => 0.4, // Moderate correlation
[m[31m-                // Default correlation for unknown or mixed asset classes
[m[32m+    }
[m[32m+
[m[32m+    /// REAL LIQUIDITY RISK ASSESSMENT
[m[32m+    async fn calculate_liquidity_risk(&self, symbol: &str, quantity: f64) -> f64 {
[m[32m+        // Get market depth and volume data (simplified)
[m[32m+        let daily_volume = self.get_symbol_daily_volume(symbol).await;
[m[32m+        let bid_ask_spread = self.get_symbol_spread(symbol).await;
[m[32m+
[m[32m+        // Calculate position as percentage of daily volume
[m[32m+        let volume_impact = if daily_volume > 0.0 {
[m[32m+            quantity.abs() / daily_volume
[m[32m+        } else {
[m[32m+            1.0 // High risk if no volume data
[m[32m+        };
[m[32m+
[m[32m+        // Liquidity risk score: higher is riskier
[m[32m+        let spread_risk = bid_ask_spread * 1000.0; // Basis points
[m[32m+        let volume_risk = volume_impact * 100.0; // Percentage
[m[32m+
[m[32m+        (spread_risk + volume_risk).min(10.0) // Cap at 10
[m[32m+    }
[m[32m+
[m[32m+    /// Get symbol correlation using asset classification system
[m[32m+    async fn get_symbol_correlation(&self, symbol1: &str, symbol2: &str) -> f64 {
[m[32m+        // Get asset classes for both symbols
[m[32m+        let asset_class1 = self.asset_classification.classify_symbol(symbol1);
[m[32m+        let asset_class2 = self.asset_classification.classify_symbol(symbol2);
[m[32m+
[m[32m+        // Calculate correlation based on asset classification
[m[32m+        match (&asset_class1, &asset_class2) {
[m[32m+            // Same asset class pairs
[m[32m+            (AssetClass::Crypto { .. }, AssetClass::Crypto { .. }) => {
[m[32m+                if symbol1 == symbol2 {
[m[32m+                    1.0
[m[32m+                } else {
[m[32m+                    0.7
[m[32m+                } // High crypto correlation
[m[32m+            },
[m[32m+            (AssetClass::Forex { .. }, AssetClass::Forex { .. }) => {
[m[32m+                if symbol1 == symbol2 {
[m[32m+                    1.0
[m[32m+                } else {
[m[32m+                    0.8
[m[32m+                } // High forex correlation
[m[32m+            },
[m[32m+            (AssetClass::Equity { .. }, AssetClass::Equity { .. }) => {
[m[32m+                if symbol1 == symbol2 {
[m[32m+                    1.0
[m[32m+                } else {
[m[32m+                    0.6
[m[32m+                } // Moderate equity correlation
[m[32m+            },
[m[32m+            // Cross-asset class correlations
[m[32m+            (AssetClass::Crypto { .. }, AssetClass::Forex { .. })
[m[32m+            | (AssetClass::Forex { .. }, AssetClass::Crypto { .. }) => -0.2, // Negative correlation
[m[32m+            (AssetClass::Equity { .. }, AssetClass::Crypto { .. })
[m[32m+            | (AssetClass::Crypto { .. }, AssetClass::Equity { .. }) => 0.3, // Low positive correlation
[m[32m+            (AssetClass::Equity { .. }, AssetClass::Forex { .. })
[m[32m+            | (AssetClass::Forex { .. }, AssetClass::Equity { .. }) => 0.4, // Moderate correlation
[m[32m+            // Default correlation for unknown or mixed asset classes
[m[32m+            _ => {
[m[32m+                log::warn!("Unknown asset class correlation between {} and {} - using conservative high correlation", symbol1, symbol2);
[m[32m+                0.8 // High correlation assumption for unknown asset pairs to be conservative in risk calculations
[m[32m+            },
[m[32m+        }
[m[32m+    }
[m[32m+
[m[32m+    /// Get symbol daily volume using asset classification and trading parameters
[m[32m+    async fn get_symbol_daily_volume(&self, symbol: &str) -> f64 {
[m[32m+        // Get trading parameters from asset classification
[m[32m+        if let Some(trading_params) = self.asset_classification.get_trading_parameters(symbol) {
[m[32m+            // Use position limits as a proxy for typical daily volume
[m[32m+            let max_order_size = trading_params
[m[32m+                .execution_config
[m[32m+                .max_order_size
[m[32m+                .to_f64()
[m[32m+                .unwrap_or(10000.0);
[m[32m+            // Estimate daily volume as multiple of max order size
[m[32m+            max_order_size * 100.0 // Assume 100 max orders per day as baseline
[m[32m+        } else {
[m[32m+            // Fallback based on asset class
[m[32m+            let asset_class = self.asset_classification.classify_symbol(symbol);
[m[32m+            match asset_class {
[m[32m+                AssetClass::Crypto { .. } => 50000.0,  // High volume for crypto
[m[32m+                AssetClass::Forex { .. } => 1000000.0, // Very high volume for forex
[m[32m+                AssetClass::Equity { .. } => 100000.0, // Moderate volume for equities
[m[32m+                AssetClass::Future { .. } => 200000.0, // High volume for futures
[m[32m+                AssetClass::Commodity { .. } => 75000.0, // Moderate-high for commodities
[m                 _ => {
[31m-                    log::warn!("Unknown asset class correlation between {} and {} - using conservative high correlation", symbol1, symbol2);
[m[31m-                    0.8 // High correlation assumption for unknown asset pairs to be conservative in risk calculations
[m[31m-                }
[m[32m+                    log::error!("Unknown asset class for symbol {} in volume calculation - using minimal volume estimate", symbol);
[m[32m+                    1000.0 // Very low volume assumption for unknown assets to limit position sizes
[m[32m+                },
[m             }
         }
[31m-        
[m[31m-        /// Get symbol daily volume using asset classification and trading parameters
[m[31m-        async fn get_symbol_daily_volume(&self, symbol: &str) -> f64 {
[m[31m-            // Get trading parameters from asset classification
[m[31m-            if let Some(trading_params) = self.asset_classification.get_trading_parameters(symbol) {
[m[31m-                // Use position limits as a proxy for typical daily volume
[m[31m-                let max_order_size = trading_params.execution_config.max_order_size.to_f64().unwrap_or(10000.0);
[m[31m-                // Estimate daily volume as multiple of max order size
[m[31m-                max_order_size * 100.0 // Assume 100 max orders per day as baseline
[m[31m-            } else {
[m[31m-                // Fallback based on asset class
[m[31m-                let asset_class = self.asset_classification.classify_symbol(symbol);
[m[31m-                match asset_class {
[m[31m-                    AssetClass::Crypto { .. } => 50000.0,  // High volume for crypto
[m[31m-                    AssetClass::Forex { .. } => 1000000.0, // Very high volume for forex
[m[31m-                    AssetClass::Equity { .. } => 100000.0, // Moderate volume for equities
[m[31m-                    AssetClass::Future { .. } => 200000.0, // High volume for futures
[m[31m-                    AssetClass::Commodity { .. } => 75000.0, // Moderate-high for commodities
[m[31m-                    _ => {
[m[31m-                        log::error!("Unknown asset class for symbol {} in volume calculation - using minimal volume estimate", symbol);
[m[31m-                        1000.0 // Very low volume assumption for unknown assets to limit position sizes
[m[32m+    }
[m[32m+
[m[32m+    /// Get symbol bid-ask spread using asset classification and execution config
[m[32m+    async fn get_symbol_spread(&self, symbol: &str) -> f64 {
[m[32m+        // Get execution config from asset classification for tick size
[m[32m+        if let Some(trading_params) = self.asset_classification.get_trading_parameters(symbol) {
[m[32m+            // Use tick size as basis for spread estimation
[m[32m+            let tick_size = trading_params
[m[32m+                .execution_config
[m[32m+                .tick_size
[m[32m+                .to_f64()
[m[32m+                .unwrap_or(0.0001);
[m[32m+            // Spread is typically 2-5 ticks depending on liquidity
[m[32m+            tick_size * 3.0 // Conservative estimate of 3 ticks
[m[32m+        } else {
[m[32m+            // Fallback based on asset class liquidity characteristics
[m[32m+            let asset_class = self.asset_classification.classify_symbol(symbol);
[m[32m+            match asset_class {
[m[32m+                AssetClass::Forex { .. } => 0.00005, // 0.5 basis points - very liquid
[m[32m+                AssetClass::Crypto { .. } => 0.0002, // 2 basis points - moderate liquidity
[m[32m+                AssetClass::Equity { market_cap, .. } => {
[m[32m+                    match market_cap {
[m[32m+                        MarketCapTier::LargeCap => 0.0001, // 1 basis point
[m[32m+                        MarketCapTier::MidCap => 0.0003,   // 3 basis points
[m[32m+                        MarketCapTier::SmallCap => 0.0005, // 5 basis points
[m[32m+                        MarketCapTier::MicroCap => 0.001,  // 10 basis points
[m                     }
[31m-                }
[m[32m+                },
[m[32m+                AssetClass::Future { .. } => 0.0001, // 1 basis point - liquid
[m[32m+                AssetClass::Commodity { .. } => 0.0003, // 3 basis points
[m[32m+                AssetClass::FixedIncome { .. } => 0.0002, // 2 basis points
[m[32m+                _ => {
[m[32m+                    log::warn!("Unknown asset class for symbol {} in spread calculation - using wide spread estimate", symbol);
[m[32m+                    0.005 // 50 basis points - very wide spread for unknown assets
[m[32m+                },
[m             }
         }
[31m-        
[m[31m-        /// Get symbol bid-ask spread using asset classification and execution config
[m[31m-        async fn get_symbol_spread(&self, symbol: &str) -> f64 {
[m[31m-            // Get execution config from asset classification for tick size
[m[31m-            if let Some(trading_params) = self.asset_classification.get_trading_parameters(symbol) {
[m[31m-                // Use tick size as basis for spread estimation
[m[31m-                let tick_size = trading_params.execution_config.tick_size.to_f64().unwrap_or(0.0001);
[m[31m-                // Spread is typically 2-5 ticks depending on liquidity
[m[31m-                tick_size * 3.0 // Conservative estimate of 3 ticks
[m[31m-            } else {
[m[31m-                // Fallback based on asset class liquidity characteristics
[m[31m-                let asset_class = self.asset_classification.classify_symbol(symbol);
[m[31m-                match asset_class {
[m[31m-                    AssetClass::Forex { .. } => 0.00005,  // 0.5 basis points - very liquid
[m[31m-                    AssetClass::Crypto { .. } => 0.0002,  // 2 basis points - moderate liquidity
[m[31m-                    AssetClass::Equity {  market_cap, .. } => {
[m[31m-                        match market_cap {
[m[31m-                            MarketCapTier::LargeCap => 0.0001,  // 1 basis point
[m[31m-                            MarketCapTier::MidCap => 0.0003,   // 3 basis points
[m[31m-                            MarketCapTier::SmallCap => 0.0005, // 5 basis points
[m[31m-                            MarketCapTier::MicroCap => 0.001,  // 10 basis points
[m[31m-                        }
[m[31m-                    },
[m[31m-                    AssetClass::Future { .. } => 0.0001,      // 1 basis point - liquid
[m[31m-                    AssetClass::Commodity { .. } => 0.0003,   // 3 basis points
[m[31m-                    AssetClass::FixedIncome { .. } => 0.0002, // 2 basis points
[m[31m-                    _ => {
[m[31m-                        log::warn!("Unknown asset class for symbol {} in spread calculation - using wide spread estimate", symbol);
[m[31m-                        0.005 // 50 basis points - very wide spread for unknown assets
[m[31m-                    }
[m[31m-                }
[m[32m+    }
[m[32m+
[m[32m+    /// Get symbol volatility (enhanced implementation)
[m[32m+    async fn get_symbol_volatility(&self, symbol: &str) -> f64 {
[m[32m+        // Try to get from historical data first
[m[32m+        let returns = self.return_history.read().await;
[m[32m+        if let Some(symbol_returns) = returns.get(symbol) {
[m[32m+            if symbol_returns.len() >= 30 {
[m[32m+                let mean: f64 = symbol_returns.iter().sum::<f64>() / symbol_returns.len() as f64;
[m[32m+                let variance: f64 = symbol_returns
[m[32m+                    .iter()
[m[32m+                    .map(|&r| (r - mean).powi(2))
[m[32m+                    .sum::<f64>()
[m[32m+                    / (symbol_returns.len() - 1) as f64;
[m[32m+                return variance.sqrt();
[m             }
         }
[31m-        
[m[31m-        /// Get symbol volatility (enhanced implementation)
[m[31m-        async fn get_symbol_volatility(&self, symbol: &str) -> f64 {
[m[31m-            // Try to get from historical data first
[m[31m-            let returns = self.return_history.read().await;
[m[31m-            if let Some(symbol_returns) = returns.get(symbol) {
[m[31m-                if symbol_returns.len() >= 30 {
[m[31m-                    let mean: f64 = symbol_returns.iter().sum::<f64>() / symbol_returns.len() as f64;
[m[31m-                    let variance: f64 = symbol_returns.iter()
[m[31m-                        .map(|&r| (r - mean).powi(2))
[m[31m-                        .sum::<f64>() / (symbol_returns.len() - 1) as f64;
[m[31m-                    return variance.sqrt();
[m[31m-                }
[m[31m-            }
[m[31m-        
[m[31m-            // Use asset classification system for volatility estimation
[m[31m-            self.asset_classification.get_daily_volatility(symbol)
[m[31m-        }
[m[31m-    
[m[32m+
[m[32m+        // Use asset classification system for volatility estimation
[m[32m+        self.asset_classification.get_daily_volatility(symbol)
[m[32m+    }
[m[32m+
[m     /// Update market data for VaR calculations - REAL-TIME INTEGRATION
     pub async fn update_market_data(&self, symbol: &str, price: f64) -> Result<(), RiskError> {
         let timestamp_ns = HardwareTimestamp::now().as_nanos();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:604:
[31m-    
[m[32m+
[m         // REAL-TIME RISK MONITORING - Check for extreme price movements
         self.monitor_price_shock(symbol, price).await?;
[31m-        
[m[32m+
[m         // Update price history
         {
             let mut history = self.price_history.write().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:611:
             let prices = history.entry(symbol.to_string()).or_insert_with(Vec::new);
             prices.push(price);
[31m-            
[m[32m+
[m             // Keep only last 252 prices (1 year of daily data)
             if prices.len() > 252 {
                 prices.remove(0);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:617:
             }
         }
[31m-        
[m[32m+
[m         // Calculate and store returns
         {
             let price_history = self.price_history.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:624:
                 if prices.len() >= 2 {
                     let last_price = prices[prices.len() - 2];
                     let return_value = (price - last_price) / last_price;
[31m-                    
[m[32m+
[m                     let mut returns = self.return_history.write().await;
                     let symbol_returns = returns.entry(symbol.to_string()).or_insert_with(Vec::new);
                     symbol_returns.push(return_value);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:631:
[31m-                    
[m[32m+
[m                     if symbol_returns.len() > 252 {
                         symbol_returns.remove(0);
                     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:635:
                 }
             }
         }
[31m-        
[m[32m+
[m         // Recalculate VaR for all accounts holding this symbol
         self.recalculate_symbol_var(symbol).await?;
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Calculate portfolio VaR - REAL SIMD-OPTIMIZED IMPLEMENTATION
[31m-    pub async fn calculate_portfolio_var(
[m[31m-        &self,
[m[31m-        account_id: &str,
[m[31m-    ) -> Result<VarResult, RiskError> {
[m[32m+    pub async fn calculate_portfolio_var(&self, account_id: &str) -> Result<VarResult, RiskError> {
[m         let mut latency_tracker = LatencyMeasurement::start();
[31m-        
[m[32m+
[m         // Get account positions
         let exposure = self.get_account_exposure(account_id).await;
[31m-        
[m[32m+
[m         // Prepare data for VaR calculation
         let mut portfolio_returns = Vec::new();
         let return_history = self.return_history.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:658:
[31m-        
[m[32m+
[m         // Calculate historical portfolio returns
         let max_history_length = return_history
             .values()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:662:
             .map(|returns| returns.len())
             .min()
             .unwrap_or(0);
[31m-        
[m[32m+
[m         if max_history_length < 30 {
             return Err(RiskError::InsufficientData);
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:669:
[31m-        
[m[32m+
[m         for i in 0..max_history_length {
             let mut portfolio_return = 0.0;
             let mut total_position = 0.0;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:673:
[31m-            
[m[32m+
[m             for (symbol, &position) in &exposure.concentration_by_symbol {
                 if let Some(returns) = return_history.get(symbol) {
                     if i < returns.len() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:679:
                     }
                 }
             }
[31m-            
[m[32m+
[m             if total_position > 0.0 {
                 portfolio_returns.push(portfolio_return / total_position);
             }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:686:
         }
[31m-        
[m[32m+
[m         // Calculate VaR using the calculator
         // TODO: VarCalculator doesn't have a simple calculate_var method
         // Placeholder: Create a default VarResult for now
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:691:
         // let var_result = self.var_calculator.calculate_portfolio_var(...)?;
[31m-        
[m[32m+
[m         // REAL SIMD-OPTIMIZED PORTFOLIO VAR CALCULATION
         #[cfg(target_arch = "x86_64")]
         let var_result = {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:696:
             // Use SIMD for portfolio return calculations
             unsafe {
                 let simd_ops = SimdMarketDataOps::new();
[31m-        
[m[32m+
[m                 // Process portfolio returns in batches using SIMD
                 let aligned_returns = AlignedPrices::from_slice(&portfolio_returns);
                 // TODO: SimdMarketDataOps doesn't have calculate_var_simd method
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:703:
                 // Using a simple percentile calculation as placeholder
                 let percentile_95 = portfolio_returns.len() as f64 * 0.05;
                 let simd_var = portfolio_returns[percentile_95 as usize];
[31m-        
[m[32m+
[m                 VarResult {
                     portfolio_id: "default".to_string(),
                     methodology_used: "SIMD Historical Simulation".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:710:
                     var_1d_95: Price::from_f64(simd_var).unwrap_or(Price::ZERO),
                     var_1d_99: Price::from_f64(simd_var * 1.2).unwrap_or(Price::ZERO), // Approximation
[31m-                    var_10d_95: Price::from_f64(simd_var * (10.0_f64).sqrt()).unwrap_or(Price::ZERO),
[m[31m-                    var_10d_99: Price::from_f64(simd_var * (10.0_f64).sqrt() * 1.2).unwrap_or(Price::ZERO),
[m[32m+                    var_10d_95: Price::from_f64(simd_var * (10.0_f64).sqrt())
[m[32m+                        .unwrap_or(Price::ZERO),
[m[32m+                    var_10d_99: Price::from_f64(simd_var * (10.0_f64).sqrt() * 1.2)
[m[32m+                        .unwrap_or(Price::ZERO),
[m                     expected_shortfall_95: Price::from_f64(simd_var * 1.3).unwrap_or(Price::ZERO),
                     expected_shortfall_99: Price::from_f64(simd_var * 1.5).unwrap_or(Price::ZERO),
                     component_var: HashMap::new(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:728:
                 }
             }
         };
[31m-        
[m[32m+
[m         #[cfg(not(target_arch = "x86_64"))]
         let var_result = {
             // Non-SIMD path: create basic VaR result
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:738:
             let var_99_idx = (sorted_returns.len() as f64 * 0.01) as usize;
             let var_95 = sorted_returns.get(var_95_idx).copied().unwrap_or(0.0).abs();
             let var_99 = sorted_returns.get(var_99_idx).copied().unwrap_or(0.0).abs();
[31m-            
[m[32m+
[m             VarResult {
                 portfolio_id: "default".to_string(),
                 methodology_used: "Historical Simulation".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:762:
                 calculated_at: chrono::Utc::now(),
             }
         };
[31m-        
[m[32m+
[m         let elapsed_ns = latency_tracker.finish();
[31m-        debug!("Portfolio VaR calculated in {}ns (SIMD): 1d=${:.2}, 10d=${:.2}", 
[m[31m-               elapsed_ns, var_result.var_1d_95, var_result.var_10d_95);
[m[31m-        
[m[32m+        debug!(
[m[32m+            "Portfolio VaR calculated in {}ns (SIMD): 1d=${:.2}, 10d=${:.2}",
[m[32m+            elapsed_ns, var_result.var_1d_95, var_result.var_10d_95
[m[32m+        );
[m[32m+
[m         Ok(var_result)
     }
[31m-    
[m[32m+
[m     /// Get account risk exposure
     pub async fn get_account_exposure(&self, account_id: &str) -> RiskExposure {
         let exposures = self.exposures.read().await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:776:
[31m-        exposures.get(account_id).cloned().unwrap_or_else(|| {
[m[31m-            RiskExposure {
[m[32m+        exposures
[m[32m+            .get(account_id)
[m[32m+            .cloned()
[m[32m+            .unwrap_or_else(|| RiskExposure {
[m                 account_id: account_id.to_string(),
                 total_exposure: 0.0,
                 net_exposure: 0.0,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:786:
                 daily_pnl: 0.0,
                 risk_score: 0.0,
                 last_update_ns: HardwareTimestamp::now().as_nanos(),
[31m-            }
[m[31m-        })
[m[32m+            })
[m     }
[31m-    
[m[32m+
[m     /// Record compliance event with REAL audit trail
     pub async fn record_compliance_event(&self, event: ComplianceEvent) {
         let timestamp_ns = HardwareTimestamp::now().as_nanos();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:796:
         let mut timestamped_event = event;
         timestamped_event.timestamp_ns = timestamp_ns;
[31m-        
[m[32m+
[m         if let Err(_) = self.compliance_events.try_push(timestamped_event.clone()) {
             warn!("Compliance events buffer full, event dropped");
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:802:
[31m-        
[m[32m+
[m         info!("Compliance event recorded: {:?}", timestamped_event);
     }
[31m-    
[m[32m+
[m     /// Get risk manager metrics
     pub fn get_metrics(&self) -> RiskManagerMetrics {
         RiskManagerMetrics {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:814:
             trading_enabled: self.limits.trading_enabled.load(Ordering::Acquire),
         }
     }
[31m-    
[m[32m+
[m     // Helper methods
[31m-    
[m[32m+
[m     async fn check_order_rate_limit(&self) -> Result<(), RiskViolation> {
         let current_time = HardwareTimestamp::now().as_nanos();
         let one_second_ago = current_time.saturating_sub(1_000_000_000); // 1 second in ns
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:823:
[31m-        
[m[32m+
[m         let mut timestamps = self.order_timestamps.write().await;
[31m-        
[m[32m+
[m         // Remove old timestamps
         timestamps.retain(|&ts| ts > one_second_ago);
[31m-        
[m[32m+
[m         // Check rate limit
         let max_orders = self.limits.max_orders_per_second.load(Ordering::Acquire);
         if timestamps.len() as u64 >= max_orders {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:834:
                 limit: max_orders,
             });
         }
[31m-        
[m[32m+
[m         // Add current timestamp
         timestamps.push(current_time);
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     async fn check_notional_limit(&self, notional: f64) -> Result<(), RiskViolation> {
         let current_time = HardwareTimestamp::now().as_nanos();
         let one_hour_ago = current_time.saturating_sub(3_600_000_000_000); // 1 hour in ns
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:847:
[31m-        
[m[32m+
[m         let mut tracker = self.notional_tracker.write().await;
[31m-        
[m[32m+
[m         // Remove old entries
         tracker.retain(|(ts, _)| *ts > one_hour_ago);
[31m-        
[m[32m+
[m         // Calculate current hourly notional
         let current_hourly: f64 = tracker.iter().map(|(_, n)| n).sum();
[31m-        let max_notional = self.fixed_to_price(
[m[31m-            self.limits.max_notional_per_hour.load(Ordering::Acquire)
[m[31m-        );
[m[31m-        
[m[32m+        let max_notional =
[m[32m+            self.fixed_to_price(self.limits.max_notional_per_hour.load(Ordering::Acquire));
[m[32m+
[m         if current_hourly + notional > max_notional {
             return Err(RiskViolation::NotionalLimitExceeded {
                 notional: current_hourly + notional,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:862:
                 limit: max_notional,
             });
         }
[31m-        
[m[32m+
[m         // Add current notional
         tracker.push((current_time, notional));
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     async fn calculate_kelly_size(
         &self,
         symbol: &str,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:876:
         price: f64,
     ) -> Result<KellyResult, RiskError> {
         let returns = self.return_history.read().await;
[31m-        
[m[32m+
[m         if let Some(symbol_returns) = returns.get(symbol) {
             if symbol_returns.len() >= 30 {
                 // Convert &str to Symbol type
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:883:
                 use common::Symbol;
                 let symbol_obj = Symbol::from(symbol);
[31m-                
[m[31m-                return self.kelly_sizer.calculate_kelly_fraction(
[m[31m-                    &symbol_obj,
[m[31m-                    "default_strategy",
[m[31m-                ).map_err(|e| RiskError::CalculationError(e.to_string()));
[m[32m+
[m[32m+                return self
[m[32m+                    .kelly_sizer
[m[32m+                    .calculate_kelly_fraction(&symbol_obj, "default_strategy")
[m[32m+                    .map_err(|e| RiskError::CalculationError(e.to_string()));
[m             }
         }
[31m-        
[m[32m+
[m         // Default conservative sizing if insufficient data
         Ok(KellyResult {
             // Convert &str to Symbol type for KellyResult
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:906:
             position_fraction: 0.1,
         })
     }
[31m-    
[m[32m+
[m     async fn calculate_incremental_var(
         &self,
         account_id: &str,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:917:
         // Simplified incremental VaR calculation
         // In production, this would use the full covariance matrix
         let returns = self.return_history.read().await;
[31m-        
[m[32m+
[m         if let Some(symbol_returns) = returns.get(symbol) {
             if symbol_returns.len() >= 30 {
[31m-                let variance: f64 = symbol_returns.iter()
[m[31m-                    .map(|&r| r * r)
[m[31m-                    .sum::<f64>() / symbol_returns.len() as f64;
[m[31m-                
[m[32m+                let variance: f64 = symbol_returns.iter().map(|&r| r * r).sum::<f64>()
[m[32m+                    / symbol_returns.len() as f64;
[m[32m+
[m                 // 1-day 95% VaR approximation
                 let var_multiplier = 1.645; // 95th percentile
                 return Ok(quantity.abs() * price * variance.sqrt() * var_multiplier);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:930:
             }
         }
[31m-        
[m[32m+
[m         // Conservative estimate if insufficient data
         Ok(quantity.abs() * price * 0.02) // 2% of notional
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:936:
[31m-    
[m[32m+
[m     async fn recalculate_symbol_var(&self, symbol: &str) -> Result<(), RiskError> {
         // TODO: Implement VaR recalculation for accounts holding this symbol
         // Currently a placeholder - production requires:
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:944:
         let _ = symbol; // Acknowledge parameter until implementation complete
         Ok(())
     }
[31m-    
[m[32m+
[m     async fn record_violation(&self, violation: RiskViolation) {
         self.violation_count.fetch_add(1, Ordering::Relaxed);
[31m-        
[m[32m+
[m         if let Err(_) = self.violations.try_push(violation.clone()) {
             warn!("Violations buffer full, violation dropped");
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:954:
[31m-        
[m[32m+
[m         warn!("Risk violation: {:?}", violation);
[31m-        
[m[32m+
[m         // Record compliance event
         // REAL-TIME RISK ALERT SYSTEM
         self.record_compliance_event(ComplianceEvent {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:961:
             description: format!("{:?}", violation),
             severity: ComplianceSeverity::High,
             timestamp_ns: 0, // Will be set by record_compliance_event
[31m-        }).await;
[m[31m-        
[m[32m+        })
[m[32m+        .await;
[m[32m+
[m         // REAL EMERGENCY RESPONSE - Auto-hedging for critical violations
         match &violation {
             RiskViolation::VarLimitExceeded { var_1d, limit } => {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:977:
                     // In production, trigger position scaling
                 }
             },
[31m-            _ => {}
[m[32m+            _ => {},
[m         }
     }
[31m-    
[m[32m+
[m     fn calculate_risk_score(&self, exposure: &RiskExposure, incremental_var: f64) -> f64 {
         // Simplified risk score calculation (0-100 scale)
         let var_score = (exposure.var_1d / 10000.0) * 100.0; // Normalize to 100
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:987:
         let drawdown_score = exposure.current_drawdown.abs() * 10.0;
         let incremental_score = (incremental_var / 1000.0) * 10.0;
[31m-        
[m[32m+
[m         (var_score + drawdown_score + incremental_score).min(100.0)
     }
[31m-    
[m[32m+
[m     fn price_to_fixed(&self, price: f64) -> u64 {
         (price * 10000.0) as u64
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:996:
[31m-    
[m[31m-        fn fixed_to_price(&self, fixed: u64) -> f64 {
[m[31m-            fixed as f64 / 10000.0
[m[31m-        }
[m[31m-    
[m[31m-        /// REAL PRICE SHOCK MONITORING
[m[31m-        async fn monitor_price_shock(&self, symbol: &str, new_price: f64) -> Result<(), RiskError> {
[m[31m-            let price_history = self.price_history.read().await;
[m[31m-            if let Some(prices) = price_history.get(symbol) {
[m[31m-                if let Some(&last_price) = prices.last() {
[m[31m-                    let price_change = (new_price - last_price) / last_price;
[m[31m-    
[m[31m-                    // Check for extreme price movements (>5% in single update)
[m[31m-                    if price_change.abs() > 0.05 {
[m[31m-                        warn!("Price shock detected for {}: {:.2}% change", symbol, price_change * 100.0);
[m[31m-    
[m[31m-                        // Record compliance event for extreme moves
[m[31m-                        self.record_compliance_event(ComplianceEvent {
[m[31m-                            event_type: ComplianceEventType::RiskViolation,
[m[31m-                            description: format!("Price shock: {} moved {:.2}%", symbol, price_change * 100.0),
[m[31m-                            severity: if price_change.abs() > 0.1 { 
[m[31m-                                ComplianceSeverity::Critical 
[m[31m-                            } else { 
[m[31m-                                ComplianceSeverity::High 
[m[31m-                            },
[m[31m-                            timestamp_ns: 0,
[m[31m-                        }).await;
[m[31m-    
[m[31m-                        // Trigger kill switch for extreme moves (>10%)
[m[31m-                        if price_change.abs() > 0.1 {
[m[31m-                            // Note: trigger() takes no arguments, log the reason separately
[m[31m-                            warn!("Price shock detected: {} moved {:.2}% - triggering kill switch", symbol, price_change * 100.0);
[m[31m-                            self.kill_switch.trigger();
[m[31m-                        }
[m[32m+
[m[32m+    fn fixed_to_price(&self, fixed: u64) -> f64 {
[m[32m+        fixed as f64 / 10000.0
[m[32m+    }
[m[32m+
[m[32m+    /// REAL PRICE SHOCK MONITORING
[m[32m+    async fn monitor_price_shock(&self, symbol: &str, new_price: f64) -> Result<(), RiskError> {
[m[32m+        let price_history = self.price_history.read().await;
[m[32m+        if let Some(prices) = price_history.get(symbol) {
[m[32m+            if let Some(&last_price) = prices.last() {
[m[32m+                let price_change = (new_price - last_price) / last_price;
[m[32m+
[m[32m+                // Check for extreme price movements (>5% in single update)
[m[32m+                if price_change.abs() > 0.05 {
[m[32m+                    warn!(
[m[32m+                        "Price shock detected for {}: {:.2}% change",
[m[32m+                        symbol,
[m[32m+                        price_change * 100.0
[m[32m+                    );
[m[32m+
[m[32m+                    // Record compliance event for extreme moves
[m[32m+                    self.record_compliance_event(ComplianceEvent {
[m[32m+                        event_type: ComplianceEventType::RiskViolation,
[m[32m+                        description: format!(
[m[32m+                            "Price shock: {} moved {:.2}%",
[m[32m+                            symbol,
[m[32m+                            price_change * 100.0
[m[32m+                        ),
[m[32m+                        severity: if price_change.abs() > 0.1 {
[m[32m+                            ComplianceSeverity::Critical
[m[32m+                        } else {
[m[32m+                            ComplianceSeverity::High
[m[32m+                        },
[m[32m+                        timestamp_ns: 0,
[m[32m+                    })
[m[32m+                    .await;
[m[32m+
[m[32m+                    // Trigger kill switch for extreme moves (>10%)
[m[32m+                    if price_change.abs() > 0.1 {
[m[32m+                        // Note: trigger() takes no arguments, log the reason separately
[m[32m+                        warn!(
[m[32m+                            "Price shock detected: {} moved {:.2}% - triggering kill switch",
[m[32m+                            symbol,
[m[32m+                            price_change * 100.0
[m[32m+                        );
[m[32m+                        self.kill_switch.trigger();
[m                     }
                 }
             }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1033:
[31m-            Ok(())
[m         }
[32m+        Ok(())
[m     }
[32m+}
[m 
 /// Order validation result - ENHANCED WITH REAL RISK METRICS
 #[derive(Debug, Clone)]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1105:
         // this is actually a calculation error, not a genuine loss violation
         match error {
             RiskError::InsufficientData => RiskViolation::DailyLossExceeded {
[31m-                loss: -1.0,  // Sentinel: negative loss indicates calc error
[m[32m+                loss: -1.0, // Sentinel: negative loss indicates calc error
[m                 limit: 0.0,
             },
[31m-            RiskError::CalculationError(_) | RiskError::ConfigurationError(_) => 
[m[31m-                RiskViolation::DailyLossExceeded { loss: -1.0, limit: 0.0 },
[m[32m+            RiskError::CalculationError(_) | RiskError::ConfigurationError(_) => {
[m[32m+                RiskViolation::DailyLossExceeded {
[m[32m+                    loss: -1.0,
[m[32m+                    limit: 0.0,
[m[32m+                }
[m[32m+            },
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1128:
 #[cfg(test)]
 mod tests {
     use super::*;
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_order_validation() {
         use rust_decimal::Decimal;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1138:
             var_confidence_level: 0.95,
             ..Default::default()
         };
[31m-        
[m[32m+
[m         let trading_config = config::structures::TradingConfig::default();
         let asset_classifier = config::asset_classification::AssetClassificationManager::new();
[31m-        let manager = RiskManager::new(risk_config, trading_config, asset_classifier).await.unwrap();
[m[31m-        
[m[32m+        let manager = RiskManager::new(risk_config, trading_config, asset_classifier)
[m[32m+            .await
[m[32m+            .unwrap();
[m[32m+
[m         // Test valid order
[31m-        let result = manager.validate_order("account-001", "BTCUSD", 1.0, 50000.0).await;
[m[32m+        let result = manager
[m[32m+            .validate_order("account-001", "BTCUSD", 1.0, 50000.0)
[m[32m+            .await;
[m         assert!(result.is_ok());
[31m-        
[m[32m+
[m         let validation = result.unwrap();
         assert!(validation.approved);
         assert!(validation.validation_time_ns > 0);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1153:
     }
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_order_size_violation() {
         use rust_decimal::Decimal;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1159:
             max_order_size: Decimal::new(1000, 0), // Small limit
             ..Default::default()
         };
[31m-        
[m[32m+
[m         let trading_config = config::structures::TradingConfig::default();
         let asset_classifier = config::asset_classification::AssetClassificationManager::new();
[31m-        let manager = RiskManager::new(risk_config, trading_config, asset_classifier).await.unwrap();
[m[31m-        
[m[32m+        let manager = RiskManager::new(risk_config, trading_config, asset_classifier)
[m[32m+            .await
[m[32m+            .unwrap();
[m[32m+
[m         // Test oversized order
[31m-        let result = manager.validate_order("account-001", "BTCUSD", 10.0, 50000.0).await;
[m[32m+        let result = manager
[m[32m+            .validate_order("account-001", "BTCUSD", 10.0, 50000.0)
[m[32m+            .await;
[m         assert!(result.is_err());
[31m-        
[m[32m+
[m         if let Err(RiskViolation::OrderSizeExceeded { size, limit }) = result {
             assert_eq!(size, 500000.0); // 10 * 50000
             assert_eq!(limit, 1000.0);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1175:
             panic!("Expected OrderSizeExceeded violation");
         }
     }
[31m-    
[m[32m+
[m     #[tokio::test]
     async fn test_var_calculation() {
         let risk_config = RiskConfig::default();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1182:
         let trading_config = config::structures::TradingConfig::default();
         let asset_classifier = config::asset_classification::AssetClassificationManager::new();
[31m-        let manager = RiskManager::new(risk_config, trading_config, asset_classifier).await.unwrap();
[m[31m-        
[m[32m+        let manager = RiskManager::new(risk_config, trading_config, asset_classifier)
[m[32m+            .await
[m[32m+            .unwrap();
[m[32m+
[m         // Add some historical data
         for i in 0..100 {
             let price = 50000.0 + (i as f64 * 10.0);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/risk_manager.rs:1189:
             manager.update_market_data("BTCUSD", price).await.unwrap();
         }
[31m-        
[m[32m+
[m         // Calculate VaR (should work with sufficient data)
         let var_result = manager.calculate_portfolio_var("account-001").await;
         // This will likely fail with insufficient position data, which is expected
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/error.rs:135:
                 tonic::Status::internal(format!("Internal error: {}", message))
             },
             TradingServiceError::TimestampConversion { timestamp } => {
[31m-                tonic::Status::invalid_argument(format!("Invalid timestamp conversion: {}", timestamp))
[m[32m+                tonic::Status::invalid_argument(format!(
[m[32m+                    "Invalid timestamp conversion: {}",
[m[32m+                    timestamp
[m[32m+                ))
[m             },
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/kill_switch_integration.rs:336:
     /// Helper to check if Redis is available (connects to Docker Redis)
     async fn is_redis_available() -> bool {
         match redis::Client::open("redis://127.0.0.1:6379") {
[31m-            Ok(client) => {
[m[31m-                match client.get_multiplexed_tokio_connection().await {
[m[31m-                    Ok(_) => true,
[m[31m-                    Err(_) => false,
[m[31m-                }
[m[31m-            }
[m[32m+            Ok(client) => match client.get_multiplexed_tokio_connection().await {
[m[32m+                Ok(_) => true,
[m[32m+                Err(_) => false,
[m[32m+            },
[m             Err(_) => false,
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/latency_recorder.rs:73:
             Err(e) => {
                 warn!("Failed to acquire latency histogram lock (poisoned): {} - skipping measurement", e);
                 return;
[31m-            }
[m[32m+            },
[m         };
 
         let histogram = histograms.entry(category).or_insert_with(|| {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/latency_recorder.rs:82:
             match Histogram::new_with_bounds(1, 10_000_000, 3) {
                 Ok(h) => h,
                 Err(e) => {
[31m-                    warn!("Failed to create histogram for {:?}: {} - using default", category, e);
[m[32m+                    warn!(
[m[32m+                        "Failed to create histogram for {:?}: {} - using default",
[m[32m+                        category, e
[m[32m+                    );
[m                     // Fallback: create a minimal histogram that should always work
                     Histogram::new(3).unwrap_or_else(|_| {
                         // Ultimate fallback - this should never fail
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/latency_recorder.rs:89:
                         panic!("FATAL: Cannot create even basic histogram for latency recording")
                     })
[31m-                }
[m[32m+                },
[m             }
         });
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/latency_recorder.rs:108:
         let histograms = match self.histograms.lock() {
             Ok(h) => h,
             Err(e) => {
[31m-                warn!("Failed to acquire latency histogram lock for stats: {} - returning None", e);
[m[32m+                warn!(
[m[32m+                    "Failed to acquire latency histogram lock for stats: {} - returning None",
[m[32m+                    e
[m[32m+                );
[m                 return None;
[31m-            }
[m[32m+            },
[m         };
 
         histograms.get(&category).map(|histogram| LatencyStats {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/latency_recorder.rs:136:
                     timestamp: chrono::Utc::now(),
                     categories: Vec::new(),
                 };
[31m-            }
[m[32m+            },
[m         };
 
         let mut categories = Vec::new();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/latency_recorder.rs:175:
         let mut histograms = match self.histograms.lock() {
             Ok(h) => h,
             Err(e) => {
[31m-                warn!("Failed to acquire latency histogram lock for reset: {} - skipping reset", e);
[m[32m+                warn!(
[m[32m+                    "Failed to acquire latency histogram lock for reset: {} - skipping reset",
[m[32m+                    e
[m[32m+                );
[m                 return;
[31m-            }
[m[32m+            },
[m         };
 
         for histogram in histograms.values_mut() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/latency_recorder.rs:375:
 
         // Query the global recorder that TimingGuard actually uses
         let stats = LATENCY_RECORDER.get_stats(LatencyCategory::RiskValidation);
[31m-        assert!(stats.is_some(), "Expected latency stats to be recorded by TimingGuard");
[m[32m+        assert!(
[m[32m+            stats.is_some(),
[m[32m+            "Expected latency stats to be recorded by TimingGuard"
[m[32m+        );
[m 
         let stats = stats.unwrap();
         assert!(stats.count >= 1, "Expected at least 1 recorded latency");
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/ml_metrics.rs:156:
 });
 
 /// Helper function to map model health to numeric value for Prometheus
[31m-pub fn health_to_metric_value(
[m[31m-    health: &crate::services::ml_fallback_manager::ModelHealth,
[m[31m-) -> f64 {
[m[32m+pub fn health_to_metric_value(health: &crate::services::ml_fallback_manager::ModelHealth) -> f64 {
[m     match health {
         crate::services::ml_fallback_manager::ModelHealth::Healthy => 0.0,
         crate::services::ml_fallback_manager::ModelHealth::Degraded => 1.0,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/rate_limiter.rs:411:
 
 impl<S, ReqBody, ResBody> Service<Request<ReqBody>> for RateLimitService<S>
 where
[31m-    S: Service<Request<ReqBody>, Response = Response<ResBody>>
[m[31m-        + Clone
[m[31m-        + Send
[m[31m-        + 'static,
[m[32m+    S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + 'static,
[m     S::Future: Send + 'static,
     S::Error: Into<Box<dyn std::error::Error + Send + Sync>> + From<Status>,
     ReqBody: Send + 'static,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/rate_limiter.rs:439:
             // Extract IP address and user info from request metadata
             // Parse IP address from headers, fallback to localhost
             // SAFETY: "127.0.0.1" is a valid IP address constant
[31m-            const LOCALHOST: std::net::IpAddr = std::net::IpAddr::V4(std::net::Ipv4Addr::new(127, 0, 0, 1));
[m[32m+            const LOCALHOST: std::net::IpAddr =
[m[32m+                std::net::IpAddr::V4(std::net::Ipv4Addr::new(127, 0, 0, 1));
[m             let ip_addr = request
                 .metadata()
                 .get("x-forwarded-for")
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/rate_limiter.rs:581:
 
         // Second request should be blocked due to penalty
         let result = rate_limiter.check_rate_limit(&context).await;
[31m-        assert!(matches!(result, RateLimitResult::AuthFailurePenalty),
[m[31m-                "Expected AuthFailurePenalty but got {:?}", result);
[m[32m+        assert!(
[m[32m+            matches!(result, RateLimitResult::AuthFailurePenalty),
[m[32m+            "Expected AuthFailurePenalty but got {:?}",
[m[32m+            result
[m[32m+        );
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repositories.rs:62:
     ) -> TradingServiceResult<PortfolioSummary>;
 
     /// Get realized PnL for account and optional symbol
[31m-    async fn get_realized_pnl(&self, account_id: &str, symbol: Option<&str>) -> TradingServiceResult<f64>;
[m[32m+    async fn get_realized_pnl(
[m[32m+        &self,
[m[32m+        account_id: &str,
[m[32m+        symbol: Option<&str>,
[m[32m+    ) -> TradingServiceResult<f64>;
[m 
     /// Get day PnL for account (today's realized PnL)
     async fn get_day_pnl(&self, account_id: &str) -> TradingServiceResult<f64>;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repositories.rs:99:
     ) -> TradingServiceResult<Vec<MarketTick>>;
 
     /// Get order count for a specific order book level
[31m-    async fn get_order_book_level_count(&self, symbol: &str, price: f64, side: OrderSide) -> TradingServiceResult<i32>;
[m[32m+    async fn get_order_book_level_count(
[m[32m+        &self,
[m[32m+        symbol: &str,
[m[32m+        price: f64,
[m[32m+        side: OrderSide,
[m[32m+    ) -> TradingServiceResult<i32>;
[m }
 
 /// Risk repository for risk calculations, limits, and compliance data
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:14:
 /// Helper function to safely convert Unix timestamp to DateTime
 /// Returns TimestampConversion error if timestamp is out of valid range
 #[inline]
[31m-fn safe_timestamp_to_datetime(timestamp: i64) -> TradingServiceResult<chrono::DateTime<chrono::Utc>> {
[m[32m+fn safe_timestamp_to_datetime(
[m[32m+    timestamp: i64,
[m[32m+) -> TradingServiceResult<chrono::DateTime<chrono::Utc>> {
[m     chrono::DateTime::from_timestamp(timestamp, 0)
         .ok_or(TradingServiceError::TimestampConversion { timestamp })
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:346:
         })
     }
 
[31m-    async fn get_realized_pnl(&self, account_id: &str, symbol: Option<&str>) -> TradingServiceResult<f64> {
[m[32m+    async fn get_realized_pnl(
[m[32m+        &self,
[m[32m+        account_id: &str,
[m[32m+        symbol: Option<&str>,
[m[32m+    ) -> TradingServiceResult<f64> {
[m         let query = if let Some(sym) = symbol {
             sqlx::query_scalar::<_, Option<f64>>(
                 "SELECT SUM(quantity * price) FROM executions WHERE account_id = $1 AND symbol = $2"
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:355:
             .bind(sym)
         } else {
             sqlx::query_scalar::<_, Option<f64>>(
[31m-                "SELECT SUM(quantity * price) FROM executions WHERE account_id = $1"
[m[32m+                "SELECT SUM(quantity * price) FROM executions WHERE account_id = $1",
[m             )
             .bind(account_id)
         };
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:362:
 
[31m-        let result = query
[m[31m-            .fetch_optional(&self.pool)
[m[31m-            .await
[m[31m-            .map_err(|e| TradingServiceError::DatabaseError { source: Box::new(e) })?;
[m[32m+        let result = query.fetch_optional(&self.pool).await.map_err(|e| {
[m[32m+            TradingServiceError::DatabaseError {
[m[32m+                source: Box::new(e),
[m[32m+            }
[m[32m+        })?;
[m 
         Ok(result.flatten().unwrap_or(0.0))
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:375:
             FROM executions
             WHERE account_id = $1
               AND DATE(timestamp) = CURRENT_DATE
[31m-            "#
[m[32m+            "#,
[m         )
         .bind(account_id)
         .fetch_optional(&self.pool)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:382:
         .await
[31m-        .map_err(|e| TradingServiceError::DatabaseError { source: Box::new(e) })?;
[m[32m+        .map_err(|e| TradingServiceError::DatabaseError {
[m[32m+            source: Box::new(e),
[m[32m+        })?;
[m 
         Ok(result.flatten().unwrap_or(0.0))
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:625:
         Ok(ticks)
     }
 
[31m-    async fn get_order_book_level_count(&self, symbol: &str, price: f64, side: common::OrderSide) -> TradingServiceResult<i32> {
[m[32m+    async fn get_order_book_level_count(
[m[32m+        &self,
[m[32m+        symbol: &str,
[m[32m+        price: f64,
[m[32m+        side: common::OrderSide,
[m[32m+    ) -> TradingServiceResult<i32> {
[m         let side_str = match side {
             common::OrderSide::Buy => "bid",
             common::OrderSide::Sell => "ask",
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:863:
             SELECT SUM(ABS(quantity * average_price) * 0.5)
             FROM positions
             WHERE account_id = $1
[31m-            "#
[m[32m+            "#,
[m         )
         .bind(account_id)
         .fetch_optional(&self.pool)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/repository_impls.rs:870:
         .await
[31m-        .map_err(|e| TradingServiceError::DatabaseError { source: Box::new(e) })?;
[m[32m+        .map_err(|e| TradingServiceError::DatabaseError {
[m[32m+            source: Box::new(e),
[m[32m+        })?;
[m 
         // Default margin calculation: 50% of position value
         // In production, this would use asset-specific margin requirements
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:6:
 //! - Real inference using ml crate models
 //! - Production metrics and monitoring
 
[32m+use super::ml_fallback_manager::ModelHealth as FallbackModelHealth;
[m use crate::proto::ml::{
     ml_service_server::MlService, EnsembleVote, Feature, FeatureImportance, FeatureType,
     GetAvailableModelsRequest, GetAvailableModelsResponse, GetEnsembleVoteRequest,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:17:
     RetrainModelResponse, SignalStrengthEvent, StreamModelMetricsRequest, StreamPredictionsRequest,
     StreamSignalStrengthRequest,
 };
[31m-use super::ml_fallback_manager::ModelHealth as FallbackModelHealth;
[m use crate::state::TradingServiceState;
 use serde::{Deserialize, Serialize};
 use std::collections::HashMap;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:29:
 use tracing::{debug, info, warn};
 
 // Production ML imports
[31m-use ml::{MLModel, Features, ModelPrediction, ModelType, ModelMetadata as MLModelMetadata};
[m[32m+use ml::{Features, MLModel, ModelMetadata as MLModelMetadata, ModelPrediction, ModelType};
[m use sysinfo::System;
 
 /// Model metadata for tracking with actual ML model instance
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:73:
         let mut stats = HashMap::new();
 
         // Default normalization parameters for common features
[31m-        stats.insert("price_momentum".to_string(), FeatureNormStats {
[m[31m-            mean: 0.0,
[m[31m-            std_dev: 0.1,
[m[31m-            min: -1.0,
[m[31m-            max: 1.0,
[m[31m-        });
[m[32m+        stats.insert(
[m[32m+            "price_momentum".to_string(),
[m[32m+            FeatureNormStats {
[m[32m+                mean: 0.0,
[m[32m+                std_dev: 0.1,
[m[32m+                min: -1.0,
[m[32m+                max: 1.0,
[m[32m+            },
[m[32m+        );
[m 
[31m-        stats.insert("volume".to_string(), FeatureNormStats {
[m[31m-            mean: 1000000.0,
[m[31m-            std_dev: 500000.0,
[m[31m-            min: 0.0,
[m[31m-            max: 10000000.0,
[m[31m-        });
[m[32m+        stats.insert(
[m[32m+            "volume".to_string(),
[m[32m+            FeatureNormStats {
[m[32m+                mean: 1000000.0,
[m[32m+                std_dev: 500000.0,
[m[32m+                min: 0.0,
[m[32m+                max: 10000000.0,
[m[32m+            },
[m[32m+        );
[m 
[31m-        stats.insert("volatility".to_string(), FeatureNormStats {
[m[31m-            mean: 0.02,
[m[31m-            std_dev: 0.01,
[m[31m-            min: 0.0,
[m[31m-            max: 0.5,
[m[31m-        });
[m[32m+        stats.insert(
[m[32m+            "volatility".to_string(),
[m[32m+            FeatureNormStats {
[m[32m+                mean: 0.02,
[m[32m+                std_dev: 0.01,
[m[32m+                min: 0.0,
[m[32m+                max: 0.5,
[m[32m+            },
[m[32m+        );
[m 
         Self { stats }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:116:
         match feature_name {
             n if n.contains("price") || n.contains("momentum") => FeatureType::Price,
             n if n.contains("volume") => FeatureType::Volume,
[31m-            n if n.contains("volatility") || n.contains("rsi") || n.contains("ma") => FeatureType::Technical,
[m[32m+            n if n.contains("volatility") || n.contains("rsi") || n.contains("ma") => {
[m[32m+                FeatureType::Technical
[m[32m+            },
[m             n if n.contains("sentiment") || n.contains("news") => FeatureType::Sentiment,
             n if n.contains("orderbook") || n.contains("depth") => FeatureType::Volume, // Orderbook is volume-related
             n if n.contains("spread") || n.contains("liquidity") => FeatureType::Technical, // Microstructure metrics
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:277:
         version: String,
         model_path: String,
     ) -> Result<(), Status> {
[31m-        info!("Hot-loading model {} version {} from {}", model_id, version, model_path);
[m[32m+        info!(
[m[32m+            "Hot-loading model {} version {} from {}",
[m[32m+            model_id, version, model_path
[m[32m+        );
[m 
         // Validate model file exists
         if !std::path::Path::new(&model_path).exists() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:337:
         // Update ensemble weights
         self.rebalance_ensemble_weights().await;
 
[31m-        info!("Successfully hot-loaded model: {} (type: {:?}, features: {})",
[m[31m-              model_id, model_type, ml_metadata.features_used);
[m[32m+        info!(
[m[32m+            "Successfully hot-loaded model: {} (type: {:?}, features: {})",
[m[32m+            model_id, model_type, ml_metadata.features_used
[m[32m+        );
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:500:
 
         // Get model metadata and instance
         let models = self.models.read().await;
[31m-        let model_meta = models.get(model_id).ok_or_else(|| {
[m[31m-            Status::not_found(format!("Model not found: {}", model_id))
[m[31m-        })?;
[m[32m+        let model_meta = models
[m[32m+            .get(model_id)
[m[32m+            .ok_or_else(|| Status::not_found(format!("Model not found: {}", model_id)))?;
[m 
[31m-        let model_instance = model_meta.model_instance.as_ref().ok_or_else(|| {
[m[31m-            Status::internal(format!("Model instance not loaded: {}", model_id))
[m[31m-        })?;
[m[32m+        let model_instance = model_meta
[m[32m+            .model_instance
[m[32m+            .as_ref()
[m[32m+            .ok_or_else(|| Status::internal(format!("Model instance not loaded: {}", model_id)))?;
[m 
         // Get supported horizons from metadata
         let default_horizon = model_meta.supported_horizons.first().copied().unwrap_or(5);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:528:
         let normalized_features: Vec<f64> = features
             .iter()
             .zip(feature_names.iter())
[31m-            .map(|(&value, name)| {
[m[31m-                self.feature_preprocessor.normalize(name, value as f64)
[m[31m-            })
[m[32m+            .map(|(&value, name)| self.feature_preprocessor.normalize(name, value as f64))
[m             .collect();
 
         // Create ML Features struct
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:659:
 
         // Record in fallback manager for health tracking
         self.ml_fallback_manager
[31m-            .record_prediction_result(model_id, success, latency_us, Some(if success { 1.0 } else { 0.0 }))
[m[32m+            .record_prediction_result(
[m[32m+                model_id,
[m[32m+                success,
[m[32m+                latency_us,
[m[32m+                Some(if success { 1.0 } else { 0.0 }),
[m[32m+            )
[m             .await;
 
         // Update Prometheus metrics
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:835:
 
                 // Create model parameters from metadata
                 let mut parameters = HashMap::new();
[31m-                parameters.insert("feature_count".to_string(), metadata.feature_count.to_string());
[m[32m+                parameters.insert(
[m[32m+                    "feature_count".to_string(),
[m[32m+                    metadata.feature_count.to_string(),
[m[32m+                );
[m                 parameters.insert("version".to_string(), metadata.version.clone());
[31m-                parameters.insert("confidence_threshold".to_string(), metadata.confidence_threshold.to_string());
[m[31m-                parameters.insert("weight_in_ensemble".to_string(), metadata.weight_in_ensemble.to_string());
[m[32m+                parameters.insert(
[m[32m+                    "confidence_threshold".to_string(),
[m[32m+                    metadata.confidence_threshold.to_string(),
[m[32m+                );
[m[32m+                parameters.insert(
[m[32m+                    "weight_in_ensemble".to_string(),
[m[32m+                    metadata.weight_in_ensemble.to_string(),
[m[32m+                );
[m 
                 ModelInfo {
                     model_name: model_name.clone(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/enhanced_ml.rs:845:
                     model_type: model_type_str,
[31m-                    description: format!("Model {} version {} ({:?})", model_name, metadata.version, metadata.model_type),
[m[32m+                    description: format!(
[m[32m+                        "Model {} version {} ({:?})",
[m[32m+                        model_name, metadata.version, metadata.model_type
[m[32m+                    ),
[m                     supported_symbols: metadata.supported_symbols.clone(),
                     supported_horizons: metadata.supported_horizons.clone(),
                     capabilities: Some(ModelCapabilities {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/ml_performance_monitor.rs:791:
         monitor.record_sample(sample).await;
 
         let alerts = monitor.get_recent_alerts(10).await;
[31m-        assert!(!alerts.is_empty(), "Expected at least one alert to be generated");
[m[31m-        assert_eq!(alerts[0].alert_type, AlertType::HighLatency,
[m[31m-                   "Expected first alert to be HighLatency, got {:?}", alerts[0].alert_type);
[m[32m+        assert!(
[m[32m+            !alerts.is_empty(),
[m[32m+            "Expected at least one alert to be generated"
[m[32m+        );
[m[32m+        assert_eq!(
[m[32m+            alerts[0].alert_type,
[m[32m+            AlertType::HighLatency,
[m[32m+            "Expected first alert to be HighLatency, got {:?}",
[m[32m+            alerts[0].alert_type
[m[32m+        );
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:1:
 //! Trading service gRPC implementation with full business logic
 
[31m-use num_traits::ToPrimitive;
[m[32m+use crate::streaming::create_monitored_channel;
[m use common::OrderSide;
[32m+use num_traits::ToPrimitive;
[m use std::pin::Pin;
 use std::sync::Arc;
 use tokio::sync::mpsc;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:8:
 use tokio_stream::{wrappers::ReceiverStream, Stream};
 use tonic::{Request, Response, Result as TonicResult, Status};
 use tracing::{debug, error, info, warn};
[31m-use crate::streaming::create_monitored_channel;
[m 
 use crate::error::TradingServiceResult;
 use crate::latency_recorder::{time_async, LatencyCategory};
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:232:
         // Subscribe to order events and forward to stream
         let event_publisher = Arc::clone(&self.state.event_publisher);
         let account_id_filter = req.account_id.clone();
[31m-        
[m[32m+
[m         tokio::spawn(async move {
             // Subscribe to trading events and filter for order events
             let mut subscription = match event_publisher.subscribe() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:240:
                 Err(e) => {
                     error!("Failed to subscribe to events: {}", e);
                     return;
[31m-                }
[m[32m+                },
[m             };
 
             while let Ok(event) = subscription.recv().await {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:253:
                     }
 
                     // Convert TradingEvent to OrderEvent proto and send
[31m-                    if let Err(e) = _tx.send_monitored(Ok(Self::convert_to_order_event(&event))).await {
[m[32m+                    if let Err(e) = _tx
[m[32m+                        .send_monitored(Ok(Self::convert_to_order_event(&event)))
[m[32m+                        .await
[m[32m+                    {
[m                         warn!("Order stream send failed: {}", e);
                         break;
                     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:321:
         // Subscribe to position events
         let event_publisher = Arc::clone(&self.state.event_publisher);
         let account_id_filter = req.account_id.clone();
[31m-        
[m[32m+
[m         tokio::spawn(async move {
             let mut subscription = match event_publisher.subscribe() {
                 Ok(sub) => sub,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:328:
                 Err(e) => {
                     error!("Failed to subscribe to position events: {}", e);
                     return;
[31m-                }
[m[32m+                },
[m             };
 
             while let Ok(event) = subscription.recv().await {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:335:
[31m-                if event.is_position_event() && event.matches_account(account_id_filter.as_deref().unwrap_or("")) {
[m[32m+                if event.is_position_event()
[m[32m+                    && event.matches_account(account_id_filter.as_deref().unwrap_or(""))
[m[32m+                {
[m                     let _ = _tx.send(Ok(Self::convert_to_position_event(&event))).await;
                 }
             }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:357:
         {
             Ok(repo_summary) => {
                 // Convert repository summary to proto summary
[31m-                let positions = self.state.trading_repository
[m[32m+                let positions = self
[m[32m+                    .state
[m[32m+                    .trading_repository
[m                     .get_positions(Some(&req.account_id), None)
                     .await
                     .unwrap_or_default()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:378:
                     total_value: repo_summary.total_value,
                     unrealized_pnl: repo_summary.unrealized_pnl,
                     realized_pnl: repo_summary.realized_pnl,
[31m-                    day_pnl: self.state.trading_repository
[m[32m+                    day_pnl: self
[m[32m+                        .state
[m[32m+                        .trading_repository
[m                         .get_day_pnl(&req.account_id)
                         .await
                         .unwrap_or(0.0),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:385:
                     buying_power: repo_summary.cash_balance, // Use cash balance as buying power
[31m-                    margin_used: self.state.risk_repository
[m[32m+                    margin_used: self
[m[32m+                        .state
[m[32m+                        .risk_repository
[m                         .calculate_margin_used(&req.account_id)
                         .await
                         .unwrap_or(0.0),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:414:
 
         // Wave 67 Agent 3: Use HIGH FREQUENCY buffer for market data (critical for HFT)
         use crate::streaming::StreamType;
[31m-        let buffer_size = StreamType::HighFrequency.buffer_size();  // 100K buffer
[m[32m+        let buffer_size = StreamType::HighFrequency.buffer_size(); // 100K buffer
[m         let (_tx, rx) = mpsc::channel(buffer_size);
 
         // Subscribe to market data events
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:421:
         let event_publisher = Arc::clone(&self.state.event_publisher);
         let symbols_filter = req.symbols.clone();
[31m-        
[m[32m+
[m         tokio::spawn(async move {
             let mut subscription = match event_publisher.subscribe() {
                 Ok(sub) => sub,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:427:
                 Err(e) => {
                     error!("Failed to subscribe to market data events: {}", e);
                     return;
[31m-                }
[m[32m+                },
[m             };
 
             while let Ok(event) = subscription.recv().await {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:434:
                 if event.event_type.is_market_data_event() {
                     // Send market data event (filtering by symbols can be added if needed)
[31m-                    let _ = _tx.send(Ok(Self::convert_to_market_data_event(&event))).await;
[m[32m+                    let _ = _tx
[m[32m+                        .send(Ok(Self::convert_to_market_data_event(&event)))
[m[32m+                        .await;
[m                 }
             }
         });
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:461:
                 let mut bid_levels = Vec::new();
                 for level in repo_order_book.bids {
                     let price_f64 = level.price.to_f64().unwrap_or(0.0);
[31m-                    let order_count = self.state.market_data_repository
[m[32m+                    let order_count = self
[m[32m+                        .state
[m[32m+                        .market_data_repository
[m                         .get_order_book_level_count(&req.symbol, price_f64, OrderSide::Buy)
                         .await
                         .unwrap_or(1);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:476:
                 let mut ask_levels = Vec::new();
                 for level in repo_order_book.asks {
                     let price_f64 = level.price.to_f64().unwrap_or(0.0);
[31m-                    let order_count = self.state.market_data_repository
[m[32m+                    let order_count = self
[m[32m+                        .state
[m[32m+                        .market_data_repository
[m                         .get_order_book_level_count(&req.symbol, price_f64, OrderSide::Sell)
                         .await
                         .unwrap_or(1);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:523:
         // Subscribe to execution events
         let event_publisher = Arc::clone(&self.state.event_publisher);
         let account_id_filter = req.account_id.clone();
[31m-        
[m[32m+
[m         tokio::spawn(async move {
             let mut subscription = match event_publisher.subscribe() {
                 Ok(sub) => sub,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:530:
                 Err(e) => {
                     error!("Failed to subscribe to execution events: {}", e);
                     return;
[31m-                }
[m[32m+                },
[m             };
 
             while let Ok(event) = subscription.recv().await {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:537:
[31m-                if event.is_execution_event() && event.matches_account(account_id_filter.as_deref().unwrap_or("")) {
[m[32m+                if event.is_execution_event()
[m[32m+                    && event.matches_account(account_id_filter.as_deref().unwrap_or(""))
[m[32m+                {
[m                     let _ = _tx.send(Ok(Self::convert_to_execution_event(&event))).await;
                 }
             }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:593:
         // NOTE: RiskEngine validate_order requires direct access, not through RwLock
         // For now, skip risk validation as it requires architectural refactoring
         // TODO: Move validate_order to take &RiskEngine instead of requiring mut access
[31m-        
[m[32m+
[m         // Placeholder: Always pass for now
         // In production, this would call:
         // self.state.risk_engine.validate_order(...)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:603:
     /// Publish order event to event stream
     async fn publish_order_event(&self, order_id: &str, event_type: OrderEventType) {
         use crate::event_streaming::events::{TradingEvent, TradingEventType};
[31m-        
[m[32m+
[m         let event_type_internal = match event_type {
             OrderEventType::Created => TradingEventType::OrderSubmitted,
             OrderEventType::Filled => TradingEventType::OrderFilled,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:616:
 
         let payload = serde_json::json!({
             "order_id": order_id,
[31m-        }).to_string();
[m[32m+        })
[m[32m+        .to_string();
[m 
[31m-        let event = TradingEvent::new(
[m[31m-            event_type_internal,
[m[31m-            order_id.to_string(),
[m[31m-            payload
[m[31m-        );
[m[32m+        let event = TradingEvent::new(event_type_internal, order_id.to_string(), payload);
[m 
         // NOTE: EventPublisher publish() requires &mut self, not available through Arc
         // For now, log event instead of publishing
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:629:
         // TODO: Refactor EventPublisher to use interior mutability
         let _ = event; // Suppress unused warning
[31m-        // Event publishing disabled - needs refactoring
[m[32m+                       // Event publishing disabled - needs refactoring
[m     }
 
     /// Convert TradingEvent to OrderEvent proto
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:635:
     fn convert_to_order_event(event: &crate::event_streaming::events::TradingEvent) -> OrderEvent {
         // Parse payload JSON to extract order details
         let order_id = event.correlation_id.clone().unwrap_or_default();
[31m-        
[m[32m+
[m         let event_type = match event.event_type {
[31m-            crate::event_streaming::events::TradingEventType::OrderSubmitted => OrderEventType::Created,
[m[32m+            crate::event_streaming::events::TradingEventType::OrderSubmitted => {
[m[32m+                OrderEventType::Created
[m[32m+            },
[m             crate::event_streaming::events::TradingEventType::OrderFilled => OrderEventType::Filled,
[31m-            crate::event_streaming::events::TradingEventType::PartialFill => OrderEventType::PartiallyFilled,
[m[31m-            crate::event_streaming::events::TradingEventType::OrderCancelled => OrderEventType::Cancelled,
[m[31m-            crate::event_streaming::events::TradingEventType::OrderRejected => OrderEventType::Rejected,
[m[32m+            crate::event_streaming::events::TradingEventType::PartialFill => {
[m[32m+                OrderEventType::PartiallyFilled
[m[32m+            },
[m[32m+            crate::event_streaming::events::TradingEventType::OrderCancelled => {
[m[32m+                OrderEventType::Cancelled
[m[32m+            },
[m[32m+            crate::event_streaming::events::TradingEventType::OrderRejected => {
[m[32m+                OrderEventType::Rejected
[m[32m+            },
[m             _ => OrderEventType::Updated,
         };
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:648:
         OrderEvent {
             order_id,
[31m-            order: None, // TODO: Populate with actual Order message
[m[32m+            order: None,            // TODO: Populate with actual Order message
[m             message: String::new(), // Empty message for now
             event_type: event_type as i32,
             timestamp: event.timestamp.timestamp(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:655:
     }
 
     /// Convert TradingEvent to PositionEvent proto
[31m-    fn convert_to_position_event(event: &crate::event_streaming::events::TradingEvent) -> PositionEvent {
[m[32m+    fn convert_to_position_event(
[m[32m+        event: &crate::event_streaming::events::TradingEvent,
[m[32m+    ) -> PositionEvent {
[m         // Parse payload to extract position details
[31m-        let position_data: serde_json::Value = serde_json::from_str(&event.payload).unwrap_or_default();
[m[31m-        
[m[32m+        let position_data: serde_json::Value =
[m[32m+            serde_json::from_str(&event.payload).unwrap_or_default();
[m[32m+
[m         PositionEvent {
             symbol: position_data["symbol"].as_str().unwrap_or("").to_string(),
             position: None, // TODO: Populate with actual Position message
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:676:
     }
 
     /// Convert TradingEvent to ExecutionEvent proto
[31m-    fn convert_to_execution_event(event: &crate::event_streaming::events::TradingEvent) -> ExecutionEvent {
[m[31m-        let execution_data: serde_json::Value = serde_json::from_str(&event.payload).unwrap_or_default();
[m[31m-        
[m[32m+    fn convert_to_execution_event(
[m[32m+        event: &crate::event_streaming::events::TradingEvent,
[m[32m+    ) -> ExecutionEvent {
[m[32m+        let execution_data: serde_json::Value =
[m[32m+            serde_json::from_str(&event.payload).unwrap_or_default();
[m[32m+
[m         ExecutionEvent {
             execution_id: event.id.clone(),
             execution: None, // TODO: Populate with actual Execution message
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:691:
     }
 
     /// Convert TradingEvent to MarketDataEvent proto
[31m-    fn convert_to_market_data_event(event: &crate::event_streaming::events::TradingEvent) -> MarketDataEvent {
[m[31m-        let market_data: serde_json::Value = serde_json::from_str(&event.payload).unwrap_or_default();
[m[31m-        
[m[32m+    fn convert_to_market_data_event(
[m[32m+        event: &crate::event_streaming::events::TradingEvent,
[m[32m+    ) -> MarketDataEvent {
[m[32m+        let market_data: serde_json::Value =
[m[32m+            serde_json::from_str(&event.payload).unwrap_or_default();
[m[32m+
[m         use crate::proto::trading::market_data_event;
[31m-        
[m[32m+
[m         MarketDataEvent {
             symbol: market_data["symbol"].as_str().unwrap_or("").to_string(),
             timestamp: event.timestamp.timestamp(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/services/trading.rs:705:
                     price: market_data["price"].as_f64().unwrap_or(0.0),
                     volume: market_data["volume"].as_f64().unwrap_or(0.0),
                     timestamp: event.timestamp.timestamp(),
[31m-                }
[m[32m+                },
[m             )),
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/state.rs:4:
 //! eliminating direct database coupling from business logic.
 
 use crate::error::TradingServiceResult;
[31m-use crate::model_loader_stub::cache::ModelCache;
[m use crate::event_streaming::publisher::EventPublisher;
[32m+use crate::model_loader_stub::cache::ModelCache;
[m use crate::proto::monitoring::SystemMetrics;
 use crate::repositories::*;
 use crate::repository_impls::PostgresConfigRepository;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/state.rs:17:
 use data::providers::{MarketDataProvider, RealTimeProvider};
 
 use futures::StreamExt;
[31m-use tokio::sync::broadcast;
[m use std::sync::Arc;
[32m+use tokio::sync::broadcast;
[m use tokio::sync::RwLock;
 
 /// Central state manager for the trading service with repository pattern
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/state.rs:183:
         // For now, return an error - test helper needs proper mock repository implementation
         // TODO: Implement proper mock repositories for testing
         Err(crate::error::TradingServiceError::Internal {
[31m-            message: 
[m[31m-            "Test helper not fully implemented yet - use new_with_repositories directly".to_string()
[m[32m+            message: "Test helper not fully implemented yet - use new_with_repositories directly"
[m[32m+                .to_string(),
[m         })
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/backpressure.rs:5:
 
 use std::sync::atomic::{AtomicU64, Ordering};
 use std::sync::Arc;
[31m-use tracing::{warn, error};
[m[32m+use tracing::{error, warn};
[m 
 /// Backpressure monitoring status
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/backpressure.rs:26:
 impl BackpressureStatus {
     /// Returns true if the status indicates a warning or worse condition
     pub fn is_warning(&self) -> bool {
[31m-        matches!(self, Self::Warning { .. } | Self::Critical { .. } | Self::Full)
[m[32m+        matches!(
[m[32m+            self,
[m[32m+            Self::Warning { .. } | Self::Critical { .. } | Self::Full
[m[32m+        )
[m     }
 
     /// Returns true if the status indicates a critical condition
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/backpressure.rs:187:
                     threshold = (self.config.warning_threshold * 100.0) as u8,
                     "Stream backpressure warning"
                 );
[31m-            }
[m[32m+            },
[m             BackpressureStatus::Critical { utilization_pct } => {
                 error!(
                     stream = stream_name,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/backpressure.rs:195:
                     threshold = (self.config.critical_threshold * 100.0) as u8,
                     "Stream backpressure critical"
                 );
[31m-            }
[m[32m+            },
[m             BackpressureStatus::Full => {
                 error!(
                     stream = stream_name,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/backpressure.rs:202:
                     "Stream buffer full - messages will be dropped"
                 );
[31m-            }
[m[31m-            _ => {}
[m[32m+            },
[m[32m+            _ => {},
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/mod.rs:12:
 pub mod metrics;
 pub mod monitored_channel;
 
[31m-pub use backpressure::{BackpressureMonitor, BackpressureConfig, BackpressureStatus};
[m[32m+pub use backpressure::{BackpressureConfig, BackpressureMonitor, BackpressureStatus};
[m pub use config::{StreamType, StreamingConfig};
 pub use metrics::StreamMetrics;
 pub use monitored_channel::{create_monitored_channel, MonitoredSender};
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/monitored_channel.rs:62:
         let status = self.monitor.check(buffer_size);
 
         // Update metrics
[31m-        self.metrics.set_buffer_utilization(status.utilization_pct() as f64);
[m[32m+        self.metrics
[m[32m+            .set_buffer_utilization(status.utilization_pct() as f64);
[m 
         // Log warning/critical status
         if status.is_warning() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/monitored_channel.rs:92:
                 self.monitor.record_send();
                 self.metrics.inc_messages_sent();
                 Ok(())
[31m-            }
[m[32m+            },
[m             Ok(Err(_send_error)) => {
                 // Channel closed
                 self.monitor.record_drop();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/monitored_channel.rs:99:
                 self.metrics.inc_messages_dropped("channel_closed");
                 Err(Status::internal("Stream channel closed"))
[31m-            }
[m[32m+            },
[m             Err(_timeout_error) => {
                 // Timeout expired
                 warn!(
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/monitored_channel.rs:113:
                     "Stream send timeout after {}ms",
                     self.send_timeout.as_millis()
                 )))
[31m-            }
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/monitored_channel.rs:222:
         let tx = tx.with_timeout(10); // 10ms timeout
 
         // Fill the buffer
[31m-        tx.send_monitored("msg1").await.expect("First send should succeed");
[m[32m+        tx.send_monitored("msg1")
[m[32m+            .await
[m[32m+            .expect("First send should succeed");
[m 
         // This should timeout since receiver isn't draining
         let result = tx.send_monitored("msg2").await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/monitored_channel.rs:229:
         assert!(result.is_err());
[31m-        assert!(matches!(result.unwrap_err().code(), tonic::Code::DeadlineExceeded));
[m[32m+        assert!(matches!(
[m[32m+            result.unwrap_err().code(),
[m[32m+            tonic::Code::DeadlineExceeded
[m[32m+        ));
[m     }
 
     #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/streaming/monitored_channel.rs:252:
 
         // Fill buffer partially
         for i in 0..5 {
[31m-            tx.send_monitored(format!("msg{}", i)).await.expect("Send should succeed");
[m[32m+            tx.send_monitored(format!("msg{}", i))
[m[32m+                .await
[m[32m+                .expect("Send should succeed");
[m         }
 
         // Should show ~50% utilization
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/utils.rs:536:
 
         let aligned_price = helpers::align_price_to_tick(100.567, 0.01);
         // Use epsilon comparison for float precision (tolerance: 1e-10)
[31m-        assert!((aligned_price - 100.57).abs() < 1e-10,
[m[31m-                "aligned_price {} should be approximately 100.57", aligned_price);
[m[32m+        assert!(
[m[32m+            (aligned_price - 100.57).abs() < 1e-10,
[m[32m+            "aligned_price {} should be approximately 100.57",
[m[32m+            aligned_price
[m[32m+        );
[m 
         let order_value = helpers::calculate_order_value(100.0, 50.0);
         assert_eq!(order_value, 5000.0);
[1;38;5;9merror[internal][0m: [1mleft behind trailing whitespace[0m
   [1;38;5;12m-->[0m /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:357:357:66
[1;38;5;12m    |[0m
[1;38;5;12m357 |[0m                    position_key, quantity_delta, execution_price, 
[1;38;5;12m    |[0m[1;38;5;9m                                                                  ^[0m
[1;38;5;12m    |[0m

[1;38;5;9merror[internal][0m: [1mleft behind trailing whitespace[0m
   [1;38;5;12m-->[0m /home/jgrusewski/Work/foxhunt/services/trading_service/src/core/position_manager.rs:358:358:82
[1;38;5;12m    |[0m
[1;38;5;12m358 |[0m                    update_result.new_avg_price, update_result.realized_pnl_delta, 
[1;38;5;12m    |[0m[1;38;5;9m                                                                                  ^[0m
[1;38;5;12m    |[0m

[1;38;5;11mwarning[0m: [1mrustfmt has failed to format. See previous 2 errors.[0m

Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/main.rs:281:
         while let Ok(alert) = alert_receiver.recv().await {
             // Log alert based on severity
             match alert.severity {
[31m-                trading_service::services::ml_performance_monitor::AlertSeverity::Emergency |
[m[31m-                trading_service::services::ml_performance_monitor::AlertSeverity::Critical => {
[m[32m+                trading_service::services::ml_performance_monitor::AlertSeverity::Emergency
[m[32m+                | trading_service::services::ml_performance_monitor::AlertSeverity::Critical => {
[m                     error!("ML ALERT [{}]: {}", alert.model_id, alert.message);
                 },
                 trading_service::services::ml_performance_monitor::AlertSeverity::Warning => {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/main.rs:339:
 
     if streaming_config.is_enabled() {
         info!("✅ HTTP/2 optimizations enabled:");
[31m-        info!("   - tcp_nodelay: {} (-40ms Nagle delay)", streaming_config.tcp_nodelay);
[m[31m-        info!("   - Stream window: {}KB", streaming_config.initial_stream_window_size / 1024);
[m[31m-        info!("   - Connection window: {}MB", streaming_config.initial_connection_window_size / (1024 * 1024));
[m[31m-        info!("   - Adaptive window: {}", streaming_config.http2_adaptive_window);
[m[32m+        info!(
[m[32m+            "   - tcp_nodelay: {} (-40ms Nagle delay)",
[m[32m+            streaming_config.tcp_nodelay
[m[32m+        );
[m[32m+        info!(
[m[32m+            "   - Stream window: {}KB",
[m[32m+            streaming_config.initial_stream_window_size / 1024
[m[32m+        );
[m[32m+        info!(
[m[32m+            "   - Connection window: {}MB",
[m[32m+            streaming_config.initial_connection_window_size / (1024 * 1024)
[m[32m+        );
[m[32m+        info!(
[m[32m+            "   - Adaptive window: {}",
[m[32m+            streaming_config.http2_adaptive_window
[m[32m+        );
[m         info!("   - Max streams: 10,000 (production scale)");
     } else {
         info!("⚠️  HTTP/2 optimizations disabled via feature flag");
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/main.rs:360:
             .initial_stream_window_size(Some(streaming_config.initial_stream_window_size))
             .initial_connection_window_size(Some(streaming_config.initial_connection_window_size))
             .http2_adaptive_window(Some(streaming_config.http2_adaptive_window))
[31m-            .max_concurrent_streams(Some(10_000));  // Increased from 1,024 to 10,000 for production scale
[m[32m+            .max_concurrent_streams(Some(10_000)); // Increased from 1,024 to 10,000 for production scale
[m     }
 
     let server = server_builder
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/main.rs:421:
     Ok(())
 }
 
[31m-
[m /// Initialize authentication configuration
 /// SECURITY FIX (Wave 69 Agent 10): Removed insecure fallback to AuthConfig::default()
 /// Service now fails fast at startup if JWT_SECRET is not properly configured
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/src/main.rs:431:
         "CRITICAL: Failed to initialize authentication configuration.\n\
          JWT_SECRET must be properly configured before starting the service.\n\
          Set JWT_SECRET_FILE=/path/to/secret or JWT_SECRET=<64+ character secret>\n\
[31m-         Generate with: openssl rand -base64 64"
[m[32m+         Generate with: openssl rand -base64 64",
[m     );
 
     // Override other settings from environment
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:23:
     EnhancedJwtClaims, Jti, JwtRevocationService, RevocationConfig, RevocationReason,
     RevocationStatistics, TokenPair,
 };
[31m-use api_gateway::auth::mfa::totp::{TotpAlgorithm, TotpConfig, TotpGenerator, TotpVerifier};
[m use api_gateway::auth::mfa::backup_codes::BackupCodeManager;
 use api_gateway::auth::mfa::enrollment::{MfaEnrollment, MfaEnrollmentStatus};
[32m+use api_gateway::auth::mfa::totp::{TotpAlgorithm, TotpConfig, TotpGenerator, TotpVerifier};
[m use secrecy::SecretString;
 
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:34:
 
 /// Setup Redis connection for testing
 async fn setup_redis() -> Result<ConnectionManager> {
[31m-    let redis_url = std::env::var("TEST_REDIS_URL")
[m[31m-        .unwrap_or_else(|_| "redis://localhost:6380".to_string());
[m[32m+    let redis_url =
[m[32m+        std::env::var("TEST_REDIS_URL").unwrap_or_else(|_| "redis://localhost:6380".to_string());
[m 
     let client = redis::Client::open(redis_url)?;
     let conn = ConnectionManager::new(client).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:52:
 
 /// Create test JwtRevocationService
 async fn create_test_revocation_service() -> Result<JwtRevocationService> {
[31m-    let redis_url = std::env::var("TEST_REDIS_URL")
[m[31m-        .unwrap_or_else(|_| "redis://localhost:6380".to_string());
[m[32m+    let redis_url =
[m[32m+        std::env::var("TEST_REDIS_URL").unwrap_or_else(|_| "redis://localhost:6380".to_string());
[m 
     let config = RevocationConfig {
         redis_prefix: "test:jwt:blacklist:".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:195:
     let jti3 = Jti::new();
 
     service
[31m-        .revoke_token(&jti1, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+        .revoke_token(
[m[32m+            &jti1,
[m[32m+            user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            user_id,
[m[32m+            None,
[m[32m+        )
[m         .await?;
     service
[31m-        .revoke_token(&jti2, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+        .revoke_token(
[m[32m+            &jti2,
[m[32m+            user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            user_id,
[m[32m+            None,
[m[32m+        )
[m         .await?;
     service
[31m-        .revoke_token(&jti3, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+        .revoke_token(
[m[32m+            &jti3,
[m[32m+            user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            user_id,
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     assert!(service.is_revoked(&jti1).await?);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:221:
     let jti2 = Jti::new();
 
     service
[31m-        .revoke_token(&jti1, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+        .revoke_token(
[m[32m+            &jti1,
[m[32m+            user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            user_id,
[m[32m+            None,
[m[32m+        )
[m         .await?;
     service
[31m-        .revoke_token(&jti2, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+        .revoke_token(
[m[32m+            &jti2,
[m[32m+            user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            user_id,
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     // Revoke all user tokens
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:245:
     let jti2 = Jti::new();
 
     service
[31m-        .revoke_token(&jti1, "user1", 3600, RevocationReason::UserLogout, "user1", None)
[m[32m+        .revoke_token(
[m[32m+            &jti1,
[m[32m+            "user1",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user1",
[m[32m+            None,
[m[32m+        )
[m         .await?;
     service
[31m-        .revoke_token(&jti2, "user2", 3600, RevocationReason::UserLogout, "user2", None)
[m[32m+        .revoke_token(
[m[32m+            &jti2,
[m[32m+            "user2",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user2",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     let stats = service.get_statistics().await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:397:
 #[tokio::test]
 async fn test_revocation_reason_display() {
     assert_eq!(format!("{}", RevocationReason::UserLogout), "user_logout");
[31m-    assert_eq!(format!("{}", RevocationReason::AdminRevocation), "admin_revocation");
[m[31m-    assert_eq!(format!("{}", RevocationReason::SuspiciousActivity), "suspicious_activity");
[m[31m-    assert_eq!(format!("{}", RevocationReason::PasswordChange), "password_change");
[m[31m-    assert_eq!(format!("{}", RevocationReason::AccountLocked), "account_locked");
[m[31m-    assert_eq!(format!("{}", RevocationReason::TokenCompromised), "token_compromised");
[m[31m-    assert_eq!(format!("{}", RevocationReason::SessionTimeout), "session_timeout");
[m     assert_eq!(
[32m+        format!("{}", RevocationReason::AdminRevocation),
[m[32m+        "admin_revocation"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        format!("{}", RevocationReason::SuspiciousActivity),
[m[32m+        "suspicious_activity"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        format!("{}", RevocationReason::PasswordChange),
[m[32m+        "password_change"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        format!("{}", RevocationReason::AccountLocked),
[m[32m+        "account_locked"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        format!("{}", RevocationReason::TokenCompromised),
[m[32m+        "token_compromised"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        format!("{}", RevocationReason::SessionTimeout),
[m[32m+        "session_timeout"
[m[32m+    );
[m[32m+    assert_eq!(
[m         format!("{}", RevocationReason::Other("custom".to_string())),
         "other:custom"
     );
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:492:
     let jti = Jti::new();
 
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     let jti = Arc::new(jti);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:524:
     for i in 0..5 {
         let jti = Jti::new();
         service
[31m-            .revoke_token(&jti, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+            .revoke_token(
[m[32m+                &jti,
[m[32m+                user_id,
[m[32m+                3600,
[m[32m+                RevocationReason::UserLogout,
[m[32m+                user_id,
[m[32m+                None,
[m[32m+            )
[m             .await?;
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:536:
 
         let handle = tokio::spawn(async move {
             service_clone
[31m-                .revoke_all_user_tokens(&uid, RevocationReason::PasswordChange, &format!("admin_{}", i))
[m[32m+                .revoke_all_user_tokens(
[m[32m+                    &uid,
[m[32m+                    RevocationReason::PasswordChange,
[m[32m+                    &format!("admin_{}", i),
[m[32m+                )
[m                 .await
         });
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:637:
 
         handles.push(tokio::spawn(async move {
             service_clone
[31m-                .revoke_token(&jti_clone, "user1", 3600, RevocationReason::UserLogout, "user1", None)
[m[32m+                .revoke_token(
[m[32m+                    &jti_clone,
[m[32m+                    "user1",
[m[32m+                    3600,
[m[32m+                    RevocationReason::UserLogout,
[m[32m+                    "user1",
[m[32m+                    None,
[m[32m+                )
[m                 .await
         }));
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:662:
     let jti = Jti::new();
 
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::SuspiciousActivity, "admin", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::SuspiciousActivity,
[m[32m+            "admin",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     let jti = Arc::new(jti);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:672:
         let service_clone = Arc::clone(&service);
         let jti_clone = Arc::clone(&jti);
 
[31m-        let handle = tokio::spawn(async move { service_clone.get_revocation_metadata(&jti_clone).await });
[m[32m+        let handle =
[m[32m+            tokio::spawn(async move { service_clone.get_revocation_metadata(&jti_clone).await });
[m 
         handles.push(handle);
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:698:
             let user_id = format!("stress_user_{}", i % 10);
 
             service_clone
[31m-                .revoke_token(&jti, &user_id, 3600, RevocationReason::UserLogout, &user_id, None)
[m[32m+                .revoke_token(
[m[32m+                    &jti,
[m[32m+                    &user_id,
[m[32m+                    3600,
[m[32m+                    RevocationReason::UserLogout,
[m[32m+                    &user_id,
[m[32m+                    None,
[m[32m+                )
[m                 .await?;
 
             service_clone.is_revoked(&jti).await
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:729:
                     // Revoke token
                     let jti = Jti::new();
                     service_clone
[31m-                        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", None)
[m[32m+                        .revoke_token(
[m[32m+                            &jti,
[m[32m+                            "user",
[m[32m+                            3600,
[m[32m+                            RevocationReason::UserLogout,
[m[32m+                            "user",
[m[32m+                            None,
[m[32m+                        )
[m                         .await?;
                     Ok(())
[31m-                }
[m[32m+                },
[m                 1 => {
                     // Check revocation
                     let jti = Jti::new();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:739:
                     service_clone.is_revoked(&jti).await?;
                     Ok(())
[31m-                }
[m[32m+                },
[m                 _ => {
                     // Get statistics
                     service_clone.get_statistics().await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:745:
                     Ok(())
[31m-                }
[m[32m+                },
[m             }
         });
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:767:
 
     // Revoke
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     // Should be revoked immediately
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:786:
     let jti = Jti::new();
 
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     // Both checks should succeed atomically
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:812:
             let jti = Jti::new();
 
             service_clone
[31m-                .revoke_token(&jti, &user_id, 3600, RevocationReason::UserLogout, &user_id, None)
[m[32m+                .revoke_token(
[m[32m+                    &jti,
[m[32m+                    &user_id,
[m[32m+                    3600,
[m[32m+                    RevocationReason::UserLogout,
[m[32m+                    &user_id,
[m[32m+                    None,
[m[32m+                )
[m                 .await?;
 
             service_clone.is_revoked(&jti).await
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:909:
     let jti = Jti::new();
 
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     // Check multiple times to ensure consistency
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1020:
     let code = generator.generate_code_at_time(secret, time).unwrap();
 
     // Should verify in next period with drift_tolerance=1
[31m-    assert!(verifier.verify_at_time(secret, &code, time + period, 1).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, time + period, 1)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1034:
     let code = generator.generate_code_at_time(secret, time).unwrap();
 
     // Should verify in previous period with drift_tolerance=1
[31m-    assert!(verifier.verify_at_time(secret, &code, time - period, 1).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, time - period, 1)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1048:
     let code = generator.generate_code_at_time(secret, time).unwrap();
 
     // Should NOT verify 2 periods away with drift_tolerance=1
[31m-    assert!(!verifier.verify_at_time(secret, &code, time + period * 2, 1).unwrap());
[m[31m-    assert!(!verifier.verify_at_time(secret, &code, time - period * 2, 1).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, time + period * 2, 1)
[m[32m+        .unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, time - period * 2, 1)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1147:
 
     // With drift_tolerance=0, should only verify exact time
     assert!(verifier.verify_at_time(secret, &code, time, 0).unwrap());
[31m-    assert!(!verifier.verify_at_time(secret, &code, time + period, 0).unwrap());
[m[31m-    assert!(!verifier.verify_at_time(secret, &code, time - period, 0).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, time + period, 0)
[m[32m+        .unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, time - period, 0)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1162:
     let code = generator.generate_code_at_time(secret, time).unwrap();
 
     // With drift_tolerance=2, should verify ±2 periods
[31m-    assert!(verifier.verify_at_time(secret, &code, time + period * 2, 2).unwrap());
[m[31m-    assert!(verifier.verify_at_time(secret, &code, time - period * 2, 2).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, time + period * 2, 2)
[m[32m+        .unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &code, time - period * 2, 2)
[m[32m+        .unwrap());
[m 
     // But not ±3 periods
[31m-    assert!(!verifier.verify_at_time(secret, &code, time + period * 3, 2).unwrap());
[m[31m-    assert!(!verifier.verify_at_time(secret, &code, time - period * 3, 2).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, time + period * 3, 2)
[m[32m+        .unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &code, time - period * 3, 2)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1198:
     let valid_code = generator.generate_code_at_time(secret, time).unwrap();
 
     // Verify uses constant-time comparison
[31m-    assert!(verifier.verify_at_time(secret, &valid_code, time, 0).unwrap());
[m[32m+    assert!(verifier
[m[32m+        .verify_at_time(secret, &valid_code, time, 0)
[m[32m+        .unwrap());
[m 
     // Similar but wrong code (differs by 1 digit)
     let mut wrong_code = valid_code.clone();
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1206:
     chars[0] = if chars[0] == '0' { '1' } else { '0' };
     let wrong_code: String = chars.into_iter().collect();
 
[31m-    assert!(!verifier.verify_at_time(secret, &wrong_code, time, 0).unwrap());
[m[32m+    assert!(!verifier
[m[32m+        .verify_at_time(secret, &wrong_code, time, 0)
[m[32m+        .unwrap());
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1215:
     let secret = generator.generate_secret().unwrap();
 
     // Should be valid Base32 (RFC 4648, no padding)
[31m-    let decoded = base32::decode(base32::Alphabet::Rfc4648 { padding: false }, secret.expose_secret());
[m[32m+    let decoded = base32::decode(
[m[32m+        base32::Alphabet::Rfc4648 { padding: false },
[m[32m+        secret.expose_secret(),
[m[32m+    );
[m     assert!(decoded.is_some());
 
     // Should be 20 bytes (160 bits for SHA1)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1270:
     let long_user_id = "a".repeat(10000);
 
     service
[31m-        .revoke_token(&jti, &long_user_id, 3600, RevocationReason::UserLogout, &long_user_id, None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            &long_user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            &long_user_id,
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     let is_revoked = service.is_revoked(&jti).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1286:
 
     // Very long TTL (1 year)
     service
[31m-        .revoke_token(&jti, "user", 31536000, RevocationReason::UserLogout, "user", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            31536000,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     assert!(service.is_revoked(&jti).await?);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1301:
     let unicode_user = "用户_🚀_тест";
 
     service
[31m-        .revoke_token(&jti, unicode_user, 3600, RevocationReason::UserLogout, unicode_user, None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            unicode_user,
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            unicode_user,
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     let metadata = service.get_revocation_metadata(&jti).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1336:
     let long_ip = "192.168.1.".to_string() + &"100".repeat(100);
 
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", Some(long_ip.clone()))
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            Some(long_ip.clone()),
[m[32m+        )
[m         .await?;
 
     let metadata = service.get_revocation_metadata(&jti).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1365:
     let jti = Jti::from_string("jti-with-special:chars!@#$".to_string());
 
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     assert!(service.is_revoked(&jti).await?);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1380:
 
     // Revoke twice
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     service
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1387:
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::AdminRevocation, "admin", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::AdminRevocation,
[m[32m+            "admin",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     // Should still be revoked
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1407:
     let user_id = "user\0id";
 
     service
[31m-        .revoke_token(&jti, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            user_id,
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1422:
     for i in 0..105 {
         let jti = Jti::new();
         service
[31m-            .revoke_token(&jti, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+            .revoke_token(
[m[32m+                &jti,
[m[32m+                user_id,
[m[32m+                3600,
[m[32m+                RevocationReason::UserLogout,
[m[32m+                user_id,
[m[32m+                None,
[m[32m+            )
[m             .await?;
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1526:
 
     for jti in &jtis {
         service
[31m-            .revoke_token(jti, user_id, 3600, RevocationReason::UserLogout, user_id, None)
[m[32m+            .revoke_token(
[m[32m+                jti,
[m[32m+                user_id,
[m[32m+                3600,
[m[32m+                RevocationReason::UserLogout,
[m[32m+                user_id,
[m[32m+                None,
[m[32m+            )
[m             .await?;
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1533:
     // Manually revoke some tokens directly
     service
[31m-        .revoke_token(&jtis[0], user_id, 3600, RevocationReason::AdminRevocation, "admin", None)
[m[32m+        .revoke_token(
[m[32m+            &jtis[0],
[m[32m+            user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::AdminRevocation,
[m[32m+            "admin",
[m[32m+            None,
[m[32m+        )
[m         .await?;
     service
[31m-        .revoke_token(&jtis[1], user_id, 3600, RevocationReason::AdminRevocation, "admin", None)
[m[32m+        .revoke_token(
[m[32m+            &jtis[1],
[m[32m+            user_id,
[m[32m+            3600,
[m[32m+            RevocationReason::AdminRevocation,
[m[32m+            "admin",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     // Bulk revoke all
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1551:
 
 #[tokio::test]
 async fn test_revocation_config_custom_prefixes() -> Result<()> {
[31m-    let redis_url = std::env::var("TEST_REDIS_URL")
[m[31m-        .unwrap_or_else(|_| "redis://localhost:6380".to_string());
[m[32m+    let redis_url =
[m[32m+        std::env::var("TEST_REDIS_URL").unwrap_or_else(|_| "redis://localhost:6380".to_string());
[m 
     let config = RevocationConfig {
         redis_prefix: "custom:blacklist:".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1565:
     let jti = Jti::new();
 
     service
[31m-        .revoke_token(&jti, "user", 3600, RevocationReason::UserLogout, "user", None)
[m[32m+        .revoke_token(
[m[32m+            &jti,
[m[32m+            "user",
[m[32m+            3600,
[m[32m+            RevocationReason::UserLogout,
[m[32m+            "user",
[m[32m+            None,
[m[32m+        )
[m         .await?;
 
     assert!(service.is_revoked(&jti).await?);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_comprehensive.rs:1830:
 #[tokio::test]
 async fn test_mfa_enrollment_algorithm_support() -> Result<()> {
     // Test all supported TOTP algorithms
[31m-    let algorithms = vec![TotpAlgorithm::SHA1, TotpAlgorithm::SHA256, TotpAlgorithm::SHA512];
[m[32m+    let algorithms = vec![
[m[32m+        TotpAlgorithm::SHA1,
[m[32m+        TotpAlgorithm::SHA256,
[m[32m+        TotpAlgorithm::SHA512,
[m[32m+    ];
[m 
     for algo in algorithms {
         let config = TotpConfig {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:19:
 use tokio::time::{sleep, timeout};
 use uuid::Uuid;
 
[31m-use trading_service::auth_interceptor::{
[m[31m-    AuthConfig, JwtClaims, JwtValidator,
[m[32m+use trading_service::auth_interceptor::{AuthConfig, JwtClaims, JwtValidator};
[m[32m+use trading_service::rate_limiter::{
[m[32m+    RateLimitConfig, RateLimitContext, RateLimitResult, RateLimiter, RequestType,
[m };
[31m-use trading_service::rate_limiter::{RateLimiter, RateLimitConfig, RateLimitContext, RateLimitResult, RequestType};
[m 
 // ============================================================================
 // TEST HELPERS & FIXTURES
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:29:
 // ============================================================================
 
 /// Test JWT secret that meets all validation requirements
[31m-const TEST_JWT_SECRET: &str = "Kx7mP@9nR!2sW#5vY$8bC&3fG*6jH^1kL%4pQ+7tZ-0uN~9dM=5eV(8xS)2wT!6yA#4zB";
[m[32m+const TEST_JWT_SECRET: &str =
[m[32m+    "Kx7mP@9nR!2sW#5vY$8bC&3fG*6jH^1kL%4pQ+7tZ-0uN~9dM=5eV(8xS)2wT!6yA#4zB";
[m 
 /// Helper to create valid JWT token for testing
[31m-fn create_test_jwt_token(
[m[31m-    secret: &str,
[m[31m-    modify_claims: impl FnOnce(&mut JwtClaims),
[m[31m-) -> String {
[m[32m+fn create_test_jwt_token(secret: &str, modify_claims: impl FnOnce(&mut JwtClaims)) -> String {
[m     let now = SystemTime::now()
         .duration_since(UNIX_EPOCH)
         .unwrap()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:194:
     }
 
     // First 100 allowed, next 100 blocked (burst capacity)
[31m-    assert!(allowed_count <= 100, "Expected at most 100 allowed requests");
[m[31m-    assert!(blocked_count >= 100, "Expected at least 100 blocked requests");
[m[32m+    assert!(
[m[32m+        allowed_count <= 100,
[m[32m+        "Expected at most 100 allowed requests"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        blocked_count >= 100,
[m[32m+        "Expected at least 100 blocked requests"
[m[32m+    );
[m     assert_eq!(allowed_count + blocked_count, 200, "Total should be 200");
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:214:
     for _ in 0..500 {
         let validator_clone = Arc::clone(&validator);
         let token_clone = token.clone();
[31m-        tasks.spawn(async move {
[m[31m-            validator_clone.validate_token(&token_clone).await.is_ok()
[m[31m-        });
[m[32m+        tasks.spawn(async move { validator_clone.validate_token(&token_clone).await.is_ok() });
[m     }
 
     // All should succeed
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:227:
         }
     }
 
[31m-    assert_eq!(success_count, 500, "Expected all 500 validations to succeed");
[m[32m+    assert_eq!(
[m[32m+        success_count, 500,
[m[32m+        "Expected all 500 validations to succeed"
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:292:
     let validator = Arc::new(JwtValidator::new(config));
 
     // Create 1000 tokens that will expire at approximately the same time
[31m-    let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs();
[m[32m+    let now = SystemTime::now()
[m[32m+        .duration_since(UNIX_EPOCH)
[m[32m+        .unwrap()
[m[32m+        .as_secs();
[m     let expiry = now + 2; // Expire in 2 seconds
 
     let tokens: Vec<String> = (0..1000)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:311:
     let mut tasks = JoinSet::new();
     for token in tokens {
         let validator_clone = Arc::clone(&validator);
[31m-        tasks.spawn(async move {
[m[31m-            validator_clone.validate_token(&token).await.is_err()
[m[31m-        });
[m[32m+        tasks.spawn(async move { validator_clone.validate_token(&token).await.is_err() });
[m     }
 
     // All should fail (expired)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:324:
         }
     }
 
[31m-    assert_eq!(failed_count, 1000, "Expected all 1000 expired tokens to fail");
[m[32m+    assert_eq!(
[m[32m+        failed_count, 1000,
[m[32m+        "Expected all 1000 expired tokens to fail"
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:393:
         let limiter_clone = Arc::clone(&limiter);
         tasks.spawn(async move {
             let user_id = Uuid::new_v4();
[31m-            limiter_clone.apply_auth_failure_penalty(user_id, test_ip).await;
[m[32m+            limiter_clone
[m[32m+                .apply_auth_failure_penalty(user_id, test_ip)
[m[32m+                .await;
[m         });
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:408:
         tokens_requested: 1.0,
     };
     let result = limiter.check_rate_limit(&context).await;
[31m-    assert!(!matches!(result, RateLimitResult::Allowed), "IP should be locked out after 10 failures");
[m[32m+    assert!(
[m[32m+        !matches!(result, RateLimitResult::Allowed),
[m[32m+        "IP should be locked out after 10 failures"
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:419:
     let validator = Arc::new(JwtValidator::new(config));
 
     // Create token that expires in exactly 1 second
[31m-    let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs();
[m[32m+    let now = SystemTime::now()
[m[32m+        .duration_since(UNIX_EPOCH)
[m[32m+        .unwrap()
[m[32m+        .as_secs();
[m     let token = create_test_jwt_token(TEST_JWT_SECRET, |claims| {
         claims.exp = now + 1;
     });
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:429:
     for _ in 0..100 {
         let validator_clone = Arc::clone(&validator);
         let token_clone = token.clone();
[31m-        tasks.spawn(async move {
[m[31m-            validator_clone.validate_token(&token_clone).await.is_ok()
[m[31m-        });
[m[32m+        tasks.spawn(async move { validator_clone.validate_token(&token_clone).await.is_ok() });
[m     }
 
     // Immediately collect results (before expiration)
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:453:
     for _ in 0..100 {
         let validator_clone = Arc::clone(&validator);
         let token_clone = token.clone();
[31m-        tasks.spawn(async move {
[m[31m-            validator_clone.validate_token(&token_clone).await.is_err()
[m[31m-        });
[m[32m+        tasks.spawn(async move { validator_clone.validate_token(&token_clone).await.is_err() });
[m     }
 
     let mut expired_failures = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:501:
 
     // Each role should have exactly 50 validations
     for role in roles {
[31m-        assert_eq!(role_counts[role], 50, "Expected 50 validations for role {}", role);
[m[32m+        assert_eq!(
[m[32m+            role_counts[role], 50,
[m[32m+            "Expected 50 validations for role {}",
[m[32m+            role
[m[32m+        );
[m     }
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:519:
     let token = create_test_jwt_token(TEST_JWT_SECRET, |_| {});
 
     // Set a very short timeout (10ms)
[31m-    let result = timeout(
[m[31m-        Duration::from_millis(10),
[m[31m-        validator.validate_token(&token)
[m[31m-    ).await;
[m[32m+    let result = timeout(Duration::from_millis(10), validator.validate_token(&token)).await;
[m 
     // Should complete within 10ms (HFT requirement)
     assert!(result.is_ok(), "Validation should complete within 10ms");
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:562:
 
     assert_eq!(success_count, 1000, "All validations should succeed");
     // P99 should be < 10μs, but under load we allow < 1ms
[31m-    assert!(max_latency < Duration::from_millis(1), "Max latency should be < 1ms");
[m[32m+    assert!(
[m[32m+        max_latency < Duration::from_millis(1),
[m[32m+        "Max latency should be < 1ms"
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:617:
         }
     }
 
[31m-    assert!(success_count >= 9500, "At least 95% should succeed under stress (got {})", success_count);
[m[32m+    assert!(
[m[32m+        success_count >= 9500,
[m[32m+        "At least 95% should succeed under stress (got {})",
[m[32m+        success_count
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:636:
     let elapsed = start.elapsed();
 
     assert!(result.is_ok(), "Validation should succeed");
[31m-    assert!(elapsed < Duration::from_micros(100), "Should be < 100μs (no network)");
[m[32m+    assert!(
[m[32m+        elapsed < Duration::from_micros(100),
[m[32m+        "Should be < 100μs (no network)"
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:693:
 
     // Average should be < 10μs per validation
     let avg = elapsed / 1000;
[31m-    assert!(avg < Duration::from_micros(10), "Average validation should be < 10μs (got {:?})", avg);
[m[32m+    assert!(
[m[32m+        avg < Duration::from_micros(10),
[m[32m+        "Average validation should be < 10μs (got {:?})",
[m[32m+        avg
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:726:
     }
 
     // Should handle 5000 requests with >99% success
[31m-    assert!(success_count >= 4950, "Expected >99% success under wave load (got {})", success_count);
[m[32m+    assert!(
[m[32m+        success_count >= 4950,
[m[32m+        "Expected >99% success under wave load (got {})",
[m[32m+        success_count
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:781:
             let token = create_test_jwt_token(TEST_JWT_SECRET, |claims| {
                 claims.sub = format!("user_{}", i);
             });
[31m-            timeout(Duration::from_millis(1), validator_clone.validate_token(&token)).await
[m[32m+            timeout(
[m[32m+                Duration::from_millis(1),
[m[32m+                validator_clone.validate_token(&token),
[m[32m+            )
[m[32m+            .await
[m         });
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:808:
     let validator = JwtValidator::new(config);
 
     // Create token expiring in exactly 100ms
[31m-    let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs();
[m[32m+    let now = SystemTime::now()
[m[32m+        .duration_since(UNIX_EPOCH)
[m[32m+        .unwrap()
[m[32m+        .as_secs();
[m     let token = create_test_jwt_token(TEST_JWT_SECRET, |claims| {
         claims.exp = now + 1; // Expires in 1 second
     });
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:843:
             let token = create_test_jwt_token(TEST_JWT_SECRET, |_| {});
             let result = timeout(
                 Duration::from_millis(timeout_ms),
[31m-                validator_clone.validate_token(&token)
[m[31m-            ).await;
[m[32m+                validator_clone.validate_token(&token),
[m[32m+            )
[m[32m+            .await;
[m             result.is_ok()
         });
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:857:
     }
 
     // All should complete within their respective timeouts
[31m-    assert_eq!(completed, 500, "All validations should complete within timeout");
[m[32m+    assert_eq!(
[m[32m+        completed, 500,
[m[32m+        "All validations should complete within timeout"
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:901:
     let validator = Arc::new(JwtValidator::new(config));
 
     // Create tokens with very short expiration (1 second)
[31m-    let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs();
[m[32m+    let now = SystemTime::now()
[m[32m+        .duration_since(UNIX_EPOCH)
[m[32m+        .unwrap()
[m[32m+        .as_secs();
[m     let tokens: Vec<String> = (0..100)
         .map(|i| {
             create_test_jwt_token(TEST_JWT_SECRET, |claims| {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:917:
         let validator_clone = Arc::clone(&validator);
         let token_clone = token.clone();
         immediate_tasks.spawn(async move {
[31m-            (i, validator_clone.validate_token(&token_clone).await.is_ok())
[m[32m+            (
[m[32m+                i,
[m[32m+                validator_clone.validate_token(&token_clone).await.is_ok(),
[m[32m+            )
[m         });
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:927:
             immediate_success += 1;
         }
     }
[31m-    assert_eq!(immediate_success, 50, "All immediate validations should succeed");
[m[32m+    assert_eq!(
[m[32m+        immediate_success, 50,
[m[32m+        "All immediate validations should succeed"
[m[32m+    );
[m 
     // Wait for expiration
     sleep(Duration::from_millis(1100)).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:938:
         let validator_clone = Arc::clone(&validator);
         let token_clone = token.clone();
         delayed_tasks.spawn(async move {
[31m-            (i, validator_clone.validate_token(&token_clone).await.is_err())
[m[32m+            (
[m[32m+                i,
[m[32m+                validator_clone.validate_token(&token_clone).await.is_err(),
[m[32m+            )
[m         });
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:948:
             delayed_failures += 1;
         }
     }
[31m-    assert_eq!(delayed_failures, 50, "All delayed validations should fail (expired)");
[m[32m+    assert_eq!(
[m[32m+        delayed_failures, 50,
[m[32m+        "All delayed validations should fail (expired)"
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:971:
     let mut tasks = JoinSet::new();
     for token in tokens {
         let validator_clone = Arc::clone(&validator);
[31m-        tasks.spawn(async move {
[m[31m-            validator_clone.validate_token(&token).await.is_ok()
[m[31m-        });
[m[32m+        tasks.spawn(async move { validator_clone.validate_token(&token).await.is_ok() });
[m     }
 
     let mut success_count = 0;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:1034:
     }
 
     // Should maintain >99% availability during "failover"
[31m-    assert!(success_count >= 495, "Expected >99% success during failover simulation");
[m[32m+    assert!(
[m[32m+        success_count >= 495,
[m[32m+        "Expected >99% success during failover simulation"
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:1053:
             let token = create_test_jwt_token(TEST_JWT_SECRET, |claims| {
                 claims.sub = format!("user_{}", i);
                 // Add 100 permissions (large claim)
[31m-                claims.permissions = (0..100)
[m[31m-                    .map(|p| format!("permission_{}", p))
[m[31m-                    .collect();
[m[32m+                claims.permissions = (0..100).map(|p| format!("permission_{}", p)).collect();
[m             });
             validator_clone.validate_token(&token).await.is_ok()
         });
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_edge_cases.rs:1069:
     }
 
     // All should succeed despite large claims
[31m-    assert_eq!(success_count, 100, "All large claim validations should succeed");
[m[32m+    assert_eq!(
[m[32m+        success_count, 100,
[m[32m+        "All large claim validations should succeed"
[m[32m+    );
[m 
     Ok(())
 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:23:
 use tokio::time::sleep;
 use uuid::Uuid;
 
[31m-use sha2::{Sha256, Digest};
[m[32m+use sha2::{Digest, Sha256};
[m // Import authentication components from trading_service
 use trading_service::auth_interceptor::{
[31m-    ApiKeyValidator, AuthConfig, AuthContext, AuthMethod, AuditLogger,
[m[31m-    JwtClaims, JwtValidator,
[m[32m+    ApiKeyValidator, AuditLogger, AuthConfig, AuthContext, AuthMethod, JwtClaims, JwtValidator,
[m };
[32m+use trading_service::rate_limiter::{
[m[32m+    RateLimitConfig, RateLimitContext, RateLimitResult, RateLimiter, RequestType,
[m[32m+};
[m use trading_service::tls_config::UserRole;
[31m-use trading_service::rate_limiter::{RateLimiter, RateLimitConfig, RateLimitContext, RateLimitResult, RequestType};
[m 
[31m-
[m // ============================================================================
 // TEST HELPERS & FIXTURES
 // ============================================================================
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:39:
 
 /// Test JWT secret that meets all validation requirements
[31m-const TEST_JWT_SECRET: &str = "Kx7mP@9nR!2sW#5vY$8bC&3fG*6jH^1kL%4pQ+7tZ-0uN~9dM=5eV(8xS)2wT!6yA#4zB";
[m[32m+const TEST_JWT_SECRET: &str =
[m[32m+    "Kx7mP@9nR!2sW#5vY$8bC&3fG*6jH^1kL%4pQ+7tZ-0uN~9dM=5eV(8xS)2wT!6yA#4zB";
[m 
 /// Helper to create valid JWT token for testing
[31m-fn create_test_jwt_token(
[m[31m-    secret: &str,
[m[31m-    modify_claims: impl FnOnce(&mut JwtClaims),
[m[31m-) -> String {
[m[32m+fn create_test_jwt_token(secret: &str, modify_claims: impl FnOnce(&mut JwtClaims)) -> String {
[m     let now = SystemTime::now()
         .duration_since(UNIX_EPOCH)
         .unwrap()
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:135:
 
 /// Create test user in database
 async fn create_test_user(pool: &PgPool, user_id: &str, role: &str) -> Result<()> {
[31m-    sqlx::query(
[m[31m-        "INSERT INTO users (id, username, role, is_active) VALUES ($1, $2, $3, true)",
[m[31m-    )
[m[31m-    .bind(user_id)
[m[31m-    .bind(format!("user_{}", user_id))
[m[31m-    .bind(role)
[m[31m-    .execute(pool)
[m[31m-    .await?;
[m[32m+    sqlx::query("INSERT INTO users (id, username, role, is_active) VALUES ($1, $2, $3, true)")
[m[32m+        .bind(user_id)
[m[32m+        .bind(format!("user_{}", user_id))
[m[32m+        .bind(role)
[m[32m+        .execute(pool)
[m[32m+        .await?;
[m     Ok(())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:376:
     let validator = JwtValidator::new(config);
 
     // Create token with future not-before time
[31m-    let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs();
[m[32m+    let now = SystemTime::now()
[m[32m+        .duration_since(UNIX_EPOCH)
[m[32m+        .unwrap()
[m[32m+        .as_secs();
[m     let future_nbf = now + 3600; // Not valid for another hour
 
     // Manual token creation with nbf claim
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:683:
 
 #[tokio::test]
 async fn test_rate_limit_failed_attempts_lockout() -> Result<()> {
[31m-
[m     let config = RateLimitConfig {
         user_requests_per_minute: 100,
         user_burst_capacity: 100,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:716:
 
 #[tokio::test]
 async fn test_rate_limit_lockout_duration_15_minutes() -> Result<()> {
[31m-
[m     let config = RateLimitConfig {
         user_requests_per_minute: 100,
         user_burst_capacity: 100,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:762:
 
 #[tokio::test]
 async fn test_rate_limit_lockout_expires_correctly() -> Result<()> {
[31m-
[m     let config = RateLimitConfig {
         user_requests_per_minute: 100,
         user_burst_capacity: 100,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:804:
 
 #[tokio::test]
 async fn test_rate_limit_cleanup_removes_old_entries() -> Result<()> {
[31m-
[m     let config = RateLimitConfig {
         user_requests_per_minute: 10,
         user_burst_capacity: 10,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:833:
 
 #[tokio::test]
 async fn test_rate_limit_disabled_mode() -> Result<()> {
[31m-
[m     let config = RateLimitConfig {
         user_requests_per_minute: 100000,
         user_burst_capacity: 100000,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:901:
     }
 
     // At least 50 should be limited (100 - 50 threshold)
[31m-    assert!(limited_count >= 50, "Expected at least 50 limited requests, got {}", limited_count);
[m[32m+    assert!(
[m[32m+        limited_count >= 50,
[m[32m+        "Expected at least 50 limited requests, got {}",
[m[32m+        limited_count
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:908:
 
 #[tokio::test]
 async fn test_rate_limit_different_ips_independent() -> Result<()> {
[31m-
[m     let config = RateLimitConfig {
         user_requests_per_minute: 5,
         user_burst_capacity: 5,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:971:
     create_test_user(&pool, user_id, "trader").await?;
 
     let api_key = "valid_api_key_1234567890abcdef";
[31m-    let key_hash = format!("{:x}", Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes()));
[m[32m+    let key_hash = format!(
[m[32m+        "{:x}",
[m[32m+        Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes())
[m[32m+    );
[m     let expires_at = Utc::now() + chrono::Duration::hours(24);
 
[31m-    create_test_api_key(&pool, &key_hash, user_id, vec!["trading.submit_order"], expires_at).await?;
[m[32m+    create_test_api_key(
[m[32m+        &pool,
[m[32m+        &key_hash,
[m[32m+        user_id,
[m[32m+        vec!["trading.submit_order"],
[m[32m+        expires_at,
[m[32m+    )
[m[32m+    .await?;
[m 
     // Validate the API key
     let result = validator.validate_key(api_key).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:982:
 
     let key_info = result.unwrap();
     assert_eq!(key_info.user_id, user_id);
[31m-    assert!(key_info.permissions.contains(&"trading.submit_order".to_string()));
[m[32m+    assert!(key_info
[m[32m+        .permissions
[m[32m+        .contains(&"trading.submit_order".to_string()));
[m 
     cleanup_test_database(&pool).await?;
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1014:
     create_test_user(&pool, user_id, "trader").await?;
 
     let api_key = "expired_api_key_1234567890abcdef";
[31m-    let key_hash = format!("{:x}", sha2::Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes()));
[m[32m+    let key_hash = format!(
[m[32m+        "{:x}",
[m[32m+        sha2::Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes())
[m[32m+    );
[m     let expires_at = Utc::now() - chrono::Duration::hours(1); // Expired 1 hour ago
 
     create_test_api_key(&pool, &key_hash, user_id, vec!["trading.view"], expires_at).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1038:
     create_test_user(&pool, user_id, "trader").await?;
 
     let api_key = "inactive_api_key_1234567890abcdef";
[31m-    let key_hash = format!("{:x}", sha2::Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes()));
[m[32m+    let key_hash = format!(
[m[32m+        "{:x}",
[m[32m+        sha2::Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes())
[m[32m+    );
[m     let expires_at = Utc::now() + chrono::Duration::hours(24);
 
[31m-    let key_id = create_test_api_key(&pool, &key_hash, user_id, vec!["trading.view"], expires_at).await?;
[m[32m+    let key_id =
[m[32m+        create_test_api_key(&pool, &key_hash, user_id, vec!["trading.view"], expires_at).await?;
[m 
     // Deactivate the key
     sqlx::query("UPDATE api_keys SET is_active = false WHERE key_id = $1")
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1067:
     create_test_user(&pool, user_id, "trader").await?;
 
     let api_key = "user_inactive_key_1234567890abcdef";
[31m-    let key_hash = format!("{:x}", sha2::Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes()));
[m[32m+    let key_hash = format!(
[m[32m+        "{:x}",
[m[32m+        sha2::Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes())
[m[32m+    );
[m     let expires_at = Utc::now() + chrono::Duration::hours(24);
 
     create_test_api_key(&pool, &key_hash, user_id, vec!["trading.view"], expires_at).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1119:
     let invalid_key = "invalid@key#with$special%chars!"; // Contains @#$%!
     let result = validator.validate_key(invalid_key).await;
     assert!(result.is_err());
[31m-    assert!(result.unwrap_err().to_string().contains("invalid characters"));
[m[32m+    assert!(result
[m[32m+        .unwrap_err()
[m[32m+        .to_string()
[m[32m+        .contains("invalid characters"));
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1135:
     create_test_user(&pool, user_id, "trader").await?;
 
     let api_key = "timestamp_test_key_1234567890abcdef";
[31m-    let key_hash = format!("{:x}", sha2::Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes()));
[m[32m+    let key_hash = format!(
[m[32m+        "{:x}",
[m[32m+        sha2::Sha256::digest(format!("{}{}", api_key, config.jwt_secret).as_bytes())
[m[32m+    );
[m     let expires_at = Utc::now() + chrono::Duration::hours(24);
 
     create_test_api_key(&pool, &key_hash, user_id, vec!["trading.view"], expires_at).await?;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1159:
 
 #[tokio::test]
 async fn test_api_key_hashing_with_salt() -> Result<()> {
[31m-    use sha2::{Sha256, Digest};
[m[32m+    use sha2::{Digest, Sha256};
[m 
     let api_key = "test_key_for_hashing_12345678";
     let secret = TEST_JWT_SECRET;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1201:
     let claims = validator.validate_token(&token).await?;
 
     assert_eq!(claims.sub, "test_user_123");
[31m-    assert!(claims.permissions.contains(&"trading.submit_order".to_string()));
[m[32m+    assert!(claims
[m[32m+        .permissions
[m[32m+        .contains(&"trading.submit_order".to_string()));
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1232:
     };
 
     // Should not panic
[31m-    audit_logger.log_auth_success(&auth_context, &Some("192.168.1.1".to_string())).await;
[m[32m+    audit_logger
[m[32m+        .log_auth_success(&auth_context, &Some("192.168.1.1".to_string()))
[m[32m+        .await;
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1243:
     let audit_logger = AuditLogger::new(config);
 
     // Should not panic
[31m-    audit_logger.log_auth_failure(
[m[31m-        "jwt",
[m[31m-        &Some("192.168.1.1".to_string()),
[m[31m-        "Invalid signature"
[m[31m-    ).await;
[m[32m+    audit_logger
[m[32m+        .log_auth_failure("jwt", &Some("192.168.1.1".to_string()), "Invalid signature")
[m[32m+        .await;
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1268:
             iss: "foxhunt-trading".to_string(),
             aud: "trading-api".to_string(),
             roles: vec!["trader".to_string()],
[31m-            permissions: vec!["trading.submit_order".to_string(), "trading.cancel_order".to_string()],
[m[32m+            permissions: vec![
[m[32m+                "trading.submit_order".to_string(),
[m[32m+                "trading.cancel_order".to_string(),
[m[32m+            ],
[m             token_type: "access".to_string(),
             session_id: Some("session-123".to_string()),
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1275:
         role: UserRole::Trader,
[31m-        permissions: vec!["trading.submit_order".to_string(), "trading.cancel_order".to_string()],
[m[32m+        permissions: vec![
[m[32m+            "trading.submit_order".to_string(),
[m[32m+            "trading.cancel_order".to_string(),
[m[32m+        ],
[m         request_time: std::time::Instant::now(),
         client_ip: None,
     };
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1343:
             iss: "foxhunt-trading".to_string(),
             aud: "trading-api".to_string(),
             roles: vec!["trader".to_string()],
[31m-            permissions: vec!["trading.submit_order".to_string(), "trading.cancel_order".to_string()],
[m[32m+            permissions: vec![
[m[32m+                "trading.submit_order".to_string(),
[m[32m+                "trading.cancel_order".to_string(),
[m[32m+            ],
[m             token_type: "access".to_string(),
             session_id: Some("session-123".to_string()),
         }),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/auth_security_tests.rs:1350:
         role: UserRole::Trader,
[31m-        permissions: vec!["trading.submit_order".to_string(), "trading.cancel_order".to_string()],
[m[32m+        permissions: vec![
[m[32m+            "trading.submit_order".to_string(),
[m[32m+            "trading.cancel_order".to_string(),
[m[32m+        ],
[m         request_time: std::time::Instant::now(),
         client_ip: None,
     };
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:20:
 
 // Import from trading_service
 use trading_service::core::execution_engine::{
[31m-    ExecutionEngine, ExecutionError, ExecutionInstruction, ExecutionAlgorithm,
[m[31m-    ExecutionUrgency, ExecutionVenue,
[m[32m+    ExecutionAlgorithm, ExecutionEngine, ExecutionError, ExecutionInstruction, ExecutionUrgency,
[m[32m+    ExecutionVenue,
[m };
 use trading_service::core::position_manager::PositionManager;
 use trading_service::core::risk_manager::RiskManager;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:28:
 
 // Import from config
[31m-use config::structures::{TradingConfig, RiskConfig};
[m use config::asset_classification::AssetClassificationManager;
 use config::manager::{ConfigManager, ServiceConfig};
[32m+use config::structures::{RiskConfig, TradingConfig};
[m 
 // Import from common
[31m-use common::{TimeInForce, OrderSide, OrderType};
[m[32m+use common::{OrderSide, OrderType, TimeInForce};
[m 
 // ============================================================================
 // HELPER FUNCTIONS
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:40:
 
 fn create_test_instruction(symbol: &str, quantity: f64, side: OrderSide) -> ExecutionInstruction {
     ExecutionInstruction {
[31m-        order_id: format!("test_{}", std::time::SystemTime::now()
[m[31m-            .duration_since(std::time::UNIX_EPOCH)
[m[31m-            .unwrap()
[m[31m-            .as_nanos()),
[m[32m+        order_id: format!(
[m[32m+            "test_{}",
[m[32m+            std::time::SystemTime::now()
[m[32m+                .duration_since(std::time::UNIX_EPOCH)
[m[32m+                .unwrap()
[m[32m+                .as_nanos()
[m[32m+        ),
[m         symbol: symbol.to_string(),
         side,
         quantity,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:82:
     let config = create_test_config();
     let broker_configs = HashMap::new();
     let config_manager = create_test_config_manager();
[31m-    let position_manager = Arc::new(
[m[31m-        PositionManager::new(config.clone(), config_manager.clone()).await?
[m[31m-    );
[m[32m+    let position_manager =
[m[32m+        Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m     let asset_classifier = AssetClassificationManager::new();
     let risk_manager = Arc::new(
[31m-        RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?
[m[32m+        RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+            .await
[m[32m+            .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m     );
 
     ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:112:
 
         let result = engine.execute_order(instruction).await;
         assert!(result.is_err());
[31m-        assert!(matches!(result.unwrap_err(), ExecutionError::ValidationFailed(_)));
[m[32m+        assert!(matches!(
[m[32m+            result.unwrap_err(),
[m[32m+            ExecutionError::ValidationFailed(_)
[m[32m+        ));
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:342:
 
         for i in 0..10 {
             let eng = engine.clone();
[31m-            let instruction = create_test_instruction("AAPL", 10.0 * (i as f64 + 1.0), OrderSide::Buy);
[m[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            let instruction =
[m[32m+                create_test_instruction("AAPL", 10.0 * (i as f64 + 1.0), OrderSide::Buy);
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:361:
         for i in 0..100 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:379:
         for i in 0..1000 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 1.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:396:
 
         for i in 0..50 {
             let eng = engine.clone();
[31m-            let side = if i % 2 == 0 { OrderSide::Buy } else { OrderSide::Sell };
[m[32m+            let side = if i % 2 == 0 {
[m[32m+                OrderSide::Buy
[m[32m+            } else {
[m[32m+                OrderSide::Sell
[m[32m+            };
[m             let instruction = create_test_instruction("AAPL", 10.0, side);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:417:
         for (i, symbol) in symbols.iter().cycle().take(50).enumerate() {
             let eng = engine.clone();
             let instruction = create_test_instruction(symbol, 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:442:
             let eng = engine.clone();
             let mut instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
             instruction.algorithm = *algo;
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:461:
             let eng = engine.clone();
             let quantity = if i % 5 == 0 { 0.0 } else { 10.0 };
             let instruction = create_test_instruction("AAPL", quantity, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:470:
         assert_eq!(results.len(), 100);
 
[31m-        let errors = results.iter().filter(|r| r.as_ref().unwrap().is_err()).count();
[m[32m+        let errors = results
[m[32m+            .iter()
[m[32m+            .filter(|r| r.as_ref().unwrap().is_err())
[m[32m+            .count();
[m         assert!(errors >= 20); // At least 20% should be invalid
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:483:
         for i in 0..50 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:516:
             let eng = engine.clone();
             let quantity = if i % 2 == 0 { 1.0 } else { 10000.0 };
             let instruction = create_test_instruction("AAPL", quantity, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:541:
             let eng = engine.clone();
             let mut instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
             instruction.venue_preference = *venue;
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:565:
             let eng = engine.clone();
             let mut instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
             instruction.urgency = *urgency;
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:584:
         for i in 0..1000 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:611:
             let eng = engine.clone();
             let mut instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
             instruction.time_in_force = *tif;
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:630:
             let eng = engine.clone();
             let mut instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
             instruction.dark_pool_eligible = i % 2 == 0;
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:654:
                 }));
             } else {
                 let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
[31m-                tasks.push(tokio::spawn(async move {
[m[31m-                    eng.execute_order(instruction).await
[m[31m-                }));
[m[32m+                tasks.push(tokio::spawn(
[m[32m+                    async move { eng.execute_order(instruction).await },
[m[32m+                ));
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:674:
         for i in 0..50 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
         join_all(tasks).await;
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:688:
         for i in 0..50 {
             let eng = engine.clone();
             let instruction = create_test_instruction("MSFT", 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
         join_all(tasks).await;
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:706:
             for i in 0..batch_size {
                 let eng = engine.clone();
                 let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
[31m-                tasks.push(tokio::spawn(async move {
[m[31m-                    eng.execute_order(instruction).await
[m[31m-                }));
[m[32m+                tasks.push(tokio::spawn(
[m[32m+                    async move { eng.execute_order(instruction).await },
[m[32m+                ));
[m             }
             join_all(tasks).await;
             tokio::time::sleep(Duration::from_millis(10)).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:725:
         for i in 0..100 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:759:
         instruction.algorithm = ExecutionAlgorithm::TWAP;
         instruction.max_participation_rate = Some(0.01);
 
[31m-        let result = tokio::time::timeout(
[m[31m-            Duration::from_millis(50),
[m[31m-            engine.execute_order(instruction)
[m[31m-        ).await;
[m[32m+        let result =
[m[32m+            tokio::time::timeout(Duration::from_millis(50), engine.execute_order(instruction))
[m[32m+                .await;
[m 
         // Either completes or times out
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:776:
 
         let result = tokio::time::timeout(
             Duration::from_millis(100),
[31m-            engine.execute_order(instruction)
[m[31m-        ).await;
[m[32m+            engine.execute_order(instruction),
[m[32m+        )
[m[32m+        .await;
[m 
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:791:
 
         let result = tokio::time::timeout(
             Duration::from_millis(200),
[31m-            engine.execute_order(instruction)
[m[31m-        ).await;
[m[32m+            engine.execute_order(instruction),
[m[32m+        )
[m[32m+        .await;
[m 
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:808:
             instruction.algorithm = ExecutionAlgorithm::TWAP;
 
             tasks.push(tokio::spawn(async move {
[31m-                tokio::time::timeout(
[m[31m-                    Duration::from_millis(50),
[m[31m-                    eng.execute_order(instruction)
[m[31m-                ).await
[m[32m+                tokio::time::timeout(Duration::from_millis(50), eng.execute_order(instruction))
[m[32m+                    .await
[m             }));
         }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:918:
         let engine = Arc::new(create_test_engine().await?);
         let instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
 
[31m-        let result = tokio::time::timeout(
[m[31m-            Duration::from_millis(1),
[m[31m-            engine.execute_order(instruction)
[m[31m-        ).await;
[m[32m+        let result =
[m[32m+            tokio::time::timeout(Duration::from_millis(1), engine.execute_order(instruction)).await;
[m 
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:931:
         let engine = Arc::new(create_test_engine().await?);
         let instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
 
[31m-        let result = tokio::time::timeout(
[m[31m-            Duration::from_secs(10),
[m[31m-            engine.execute_order(instruction)
[m[31m-        ).await;
[m[32m+        let result =
[m[32m+            tokio::time::timeout(Duration::from_secs(10), engine.execute_order(instruction)).await;
[m 
         assert!(result.is_ok(), "Should complete within 10 seconds");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:954:
             tasks.push(tokio::spawn(async move {
                 tokio::time::timeout(
                     Duration::from_millis(timeout),
[31m-                    eng.execute_order(instruction)
[m[31m-                ).await
[m[32m+                    eng.execute_order(instruction),
[m[32m+                )
[m[32m+                .await
[m             }));
         }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:971:
         instruction.algorithm = ExecutionAlgorithm::TWAP;
         instruction.max_participation_rate = Some(0.001);
 
[31m-        let handle = tokio::spawn(async move {
[m[31m-            engine.execute_order(instruction).await
[m[31m-        });
[m[32m+        let handle = tokio::spawn(async move { engine.execute_order(instruction).await });
[m 
         tokio::time::sleep(Duration::from_millis(50)).await;
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:980:
         // Timeout acts as implicit cancel
[31m-        let result = tokio::time::timeout(
[m[31m-            Duration::from_millis(1),
[m[31m-            handle
[m[31m-        ).await;
[m[32m+        let result = tokio::time::timeout(Duration::from_millis(1), handle).await;
[m 
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1018:
             async move {
                 tokio::time::timeout(
                     Duration::from_millis(50),
[31m-                    eng.execute_order(slow_instruction)
[m[31m-                ).await
[m[32m+                    eng.execute_order(slow_instruction),
[m[32m+                )
[m[32m+                .await
[m             }
         });
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1045:
             instruction.algorithm = ExecutionAlgorithm::TWAP;
 
             tasks.push(tokio::spawn(async move {
[31m-                tokio::time::timeout(
[m[31m-                    Duration::from_millis(20),
[m[31m-                    eng.execute_order(instruction)
[m[31m-                ).await
[m[32m+                tokio::time::timeout(Duration::from_millis(20), eng.execute_order(instruction))
[m[32m+                    .await
[m             }));
         }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1065:
         let mut instruction = create_test_instruction("AAPL", 1000.0, OrderSide::Buy);
         instruction.algorithm = ExecutionAlgorithm::TWAP;
 
[31m-        let result = tokio::time::timeout(
[m[31m-            Duration::from_millis(50),
[m[31m-            engine.execute_order(instruction)
[m[31m-        ).await;
[m[32m+        let result =
[m[32m+            tokio::time::timeout(Duration::from_millis(50), engine.execute_order(instruction))
[m[32m+                .await;
[m 
         let final_metrics = engine.get_metrics();
         assert!(final_metrics.total_executions >= initial_metrics.total_executions);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1085:
             let instruction = create_test_instruction("AAPL", 1000.0, OrderSide::Buy);
             let result = tokio::time::timeout(
                 Duration::from_millis(timeout_ms),
[31m-                engine.execute_order(instruction)
[m[31m-            ).await;
[m[32m+                engine.execute_order(instruction),
[m[32m+            )
[m[32m+            .await;
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1148:
         for i in 0..100 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 0.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1299:
                 let eng = engine.clone();
                 let quantity = if i % 4 == 0 { 0.0 } else { 10.0 };
                 let instruction = create_test_instruction("AAPL", quantity, OrderSide::Buy);
[31m-                tasks.push(tokio::spawn(async move {
[m[31m-                    eng.execute_order(instruction).await
[m[31m-                }));
[m[32m+                tasks.push(tokio::spawn(
[m[32m+                    async move { eng.execute_order(instruction).await },
[m[32m+                ));
[m             }
             futures::future::join_all(tasks).await;
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1342:
         for i in 0..10 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 0.0, OrderSide::Buy);
[31m-            tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            });
[m[32m+            tokio::spawn(async move { eng.execute_order(instruction).await });
[m         }
 
         // Layer 2: Symbol errors
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1351:
         for i in 0..10 {
             let eng = engine.clone();
             let instruction = create_test_instruction("", 100.0, OrderSide::Buy);
[31m-            tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            });
[m[32m+            tokio::spawn(async move { eng.execute_order(instruction).await });
[m         }
 
         // Layer 3: Valid orders
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1361:
         for i in 0..10 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1378:
         for i in 0..200 {
             let eng = engine.clone();
             let quantity = match i % 5 {
[31m-                0 => 0.0,    // Invalid
[m[31m-                1 => -10.0,  // Invalid
[m[31m-                _ => 10.0,   // Valid
[m[32m+                0 => 0.0,   // Invalid
[m[32m+                1 => -10.0, // Invalid
[m[32m+                _ => 10.0,  // Valid
[m             };
             let instruction = create_test_instruction("AAPL", quantity, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1392:
 
[31m-        let error_count = results.iter()
[m[32m+        let error_count = results
[m[32m+            .iter()
[m             .filter(|r| r.as_ref().unwrap().is_err())
             .count();
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1431:
                 let eng = engine.clone();
                 let quantity = if i % 3 == 0 { 0.0 } else { 10.0 };
                 let instruction = create_test_instruction("AAPL", quantity, OrderSide::Buy);
[31m-                tasks.push(tokio::spawn(async move {
[m[31m-                    eng.execute_order(instruction).await
[m[31m-                }));
[m[32m+                tasks.push(tokio::spawn(
[m[32m+                    async move { eng.execute_order(instruction).await },
[m[32m+                ));
[m             }
             futures::future::join_all(tasks).await;
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1474:
                 let eng = engine.clone();
                 let quantity = if i < error_rate { 0.0 } else { 10.0 };
                 let instruction = create_test_instruction("AAPL", quantity, OrderSide::Buy);
[31m-                tasks.push(tokio::spawn(async move {
[m[31m-                    eng.execute_order(instruction).await
[m[31m-                }));
[m[32m+                tasks.push(tokio::spawn(
[m[32m+                    async move { eng.execute_order(instruction).await },
[m[32m+                ));
[m             }
             futures::future::join_all(tasks).await;
         }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1531:
                 _ => 10.0,     // Valid
             };
             let instruction = create_test_instruction("AAPL", quantity, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1695:
             instruction.max_participation_rate = *participation;
             instruction.iceberg_slice_size = *slice_size;
 
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1879:
     #[tokio::test]
     async fn test_quantity_precision_limits() -> Result<()> {
         let engine = create_test_engine().await?;
[31m-        let quantities = vec![
[m[31m-            0.1,
[m[31m-            0.01,
[m[31m-            0.001,
[m[31m-            0.0001,
[m[31m-            0.00001,
[m[31m-            0.000001,
[m[31m-        ];
[m[32m+        let quantities = vec![0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001];
[m 
         for qty in quantities {
             let instruction = create_test_instruction("AAPL", qty, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1936:
     #[tokio::test]
     async fn test_limit_price_precision() -> Result<()> {
         let engine = create_test_engine().await?;
[31m-        let prices = vec![
[m[31m-            0.01,
[m[31m-            0.001,
[m[31m-            0.0001,
[m[31m-            100.12345678,
[m[31m-            999999.99,
[m[31m-        ];
[m[32m+        let prices = vec![0.01, 0.001, 0.0001, 100.12345678, 999999.99];
[m 
         for price in prices {
             let mut instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:1981:
     async fn test_iceberg_slice_boundaries() -> Result<()> {
         let engine = create_test_engine().await?;
         let total_quantity = 1000.0;
[31m-        let slice_sizes = vec![
[m[31m-            1.0,
[m[31m-            10.0,
[m[31m-            100.0,
[m[31m-            500.0,
[m[31m-            999.0,
[m[31m-        ];
[m[32m+        let slice_sizes = vec![1.0, 10.0, 100.0, 500.0, 999.0];
[m 
         for slice_size in slice_sizes {
             let mut instruction = create_test_instruction("AAPL", total_quantity, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:2002:
     #[tokio::test]
     async fn test_min_fill_size_boundaries() -> Result<()> {
         let engine = create_test_engine().await?;
[31m-        let min_fill_sizes = vec![
[m[31m-            1.0,
[m[31m-            10.0,
[m[31m-            50.0,
[m[31m-            90.0,
[m[31m-            99.0,
[m[31m-        ];
[m[32m+        let min_fill_sizes = vec![1.0, 10.0, 50.0, 90.0, 99.0];
[m 
         for min_fill in min_fill_sizes {
             let mut instruction = create_test_instruction("AAPL", 100.0, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_comprehensive.rs:2133:
             (ExecutionVenue::ICMarkets, ExecutionAlgorithm::Market),
             (ExecutionVenue::InteractiveBrokers, ExecutionAlgorithm::TWAP),
             (ExecutionVenue::DarkPool, ExecutionAlgorithm::Sniper),
[31m-            (ExecutionVenue::InternalCrossing, ExecutionAlgorithm::CrossOnly),
[m[32m+            (
[m[32m+                ExecutionVenue::InternalCrossing,
[m[32m+                ExecutionAlgorithm::CrossOnly,
[m[32m+            ),
[m         ];
 
         for (venue, algo) in combinations {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:17:
 
 // Import from trading_service
 use trading_service::core::execution_engine::{
[31m-    ExecutionEngine, ExecutionError, ExecutionInstruction, ExecutionAlgorithm, ExecutionUrgency,
[m[32m+    ExecutionAlgorithm, ExecutionEngine, ExecutionError, ExecutionInstruction, ExecutionUrgency,
[m };
 use trading_service::core::position_manager::PositionManager;
 use trading_service::core::risk_manager::RiskManager;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:24:
 
 // Import from config
[31m-use config::structures::{TradingConfig, RiskConfig};
[m use config::asset_classification::AssetClassificationManager;
 use config::manager::{ConfigManager, ServiceConfig};
[32m+use config::structures::{RiskConfig, TradingConfig};
[m 
 // Import from common
[31m-use common::{TimeInForce, OrderSide, OrderType};
[m[32m+use common::{OrderSide, OrderType, TimeInForce};
[m 
 // ============================================================================
 // HELPER FUNCTIONS
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:35:
 // ============================================================================
 
 /// Helper to create a valid test instruction
[31m-fn create_test_instruction(
[m[31m-    symbol: &str,
[m[31m-    quantity: f64,
[m[31m-    side: OrderSide,
[m[31m-) -> ExecutionInstruction {
[m[32m+fn create_test_instruction(symbol: &str, quantity: f64, side: OrderSide) -> ExecutionInstruction {
[m     ExecutionInstruction {
[31m-        order_id: format!("test_order_{}", std::time::SystemTime::now()
[m[31m-            .duration_since(std::time::UNIX_EPOCH)
[m[31m-            .unwrap()
[m[31m-            .as_nanos()),
[m[32m+        order_id: format!(
[m[32m+            "test_order_{}",
[m[32m+            std::time::SystemTime::now()
[m[32m+                .duration_since(std::time::UNIX_EPOCH)
[m[32m+                .unwrap()
[m[32m+                .as_nanos()
[m[32m+        ),
[m         symbol: symbol.to_string(),
         side,
         quantity,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:99:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         let instruction = create_test_instruction("AAPL", 0.0, OrderSide::Buy);
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:120:
         let result = engine.execute_order(instruction).await;
 
         // Assert - validation should fail
[31m-        assert!(result.is_err(), "Zero quantity should trigger validation error");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Zero quantity should trigger validation error"
[m[32m+        );
[m         match result {
             Err(ExecutionError::ValidationFailed(msg)) => {
[31m-                assert!(msg.to_lowercase().contains("positive") || msg.to_lowercase().contains("size"),
[m[31m-                    "Error message should mention size validation: {}", msg);
[m[32m+                assert!(
[m[32m+                    msg.to_lowercase().contains("positive") || msg.to_lowercase().contains("size"),
[m[32m+                    "Error message should mention size validation: {}",
[m[32m+                    msg
[m[32m+                );
[m                 println!("✓ Correctly rejected: {}", msg);
             },
             _ => panic!("Expected ValidationFailed error for zero quantity"),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:140:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         let instruction = create_test_instruction("MSFT", -100.0, OrderSide::Buy);
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:161:
         let result = engine.execute_order(instruction).await;
 
         // Assert
[31m-        assert!(result.is_err(), "Negative quantity should trigger validation error");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Negative quantity should trigger validation error"
[m[32m+        );
[m         match result {
             Err(ExecutionError::ValidationFailed(msg)) => {
                 println!("✓ Correctly rejected: {}", msg);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:179:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         // Minimum order size is 0.001 from default config
         let instruction = create_test_instruction("GOOGL", 0.0001, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:201:
         let result = engine.execute_order(instruction).await;
 
         // Assert
[31m-        assert!(result.is_err(), "Quantity below minimum should trigger validation error");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Quantity below minimum should trigger validation error"
[m[32m+        );
[m         match result {
             Err(ExecutionError::ValidationFailed(msg)) => {
                 println!("✓ Correctly rejected: {}", msg);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:219:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         // Max order size from default config is 1,000,000
         let instruction = create_test_instruction("TSLA", 2_000_000.0, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:241:
         let result = engine.execute_order(instruction).await;
 
         // Assert
[31m-        assert!(result.is_err(), "Quantity exceeding maximum should trigger validation error");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Quantity exceeding maximum should trigger validation error"
[m[32m+        );
[m         match result {
             Err(ExecutionError::ValidationFailed(msg)) => {
                 println!("✓ Correctly rejected: {}", msg);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:259:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         let instruction = create_test_instruction("", 100.0, OrderSide::Buy);
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:280:
         let result = engine.execute_order(instruction).await;
 
         // Assert
[31m-        assert!(result.is_err(), "Empty symbol should trigger validation error");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Empty symbol should trigger validation error"
[m[32m+        );
[m         match result {
             Err(ExecutionError::ValidationFailed(msg)) => {
                 println!("✓ Correctly rejected: {}", msg);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:298:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         let mut instruction = create_test_instruction("NFLX", 100.0, OrderSide::Buy);
         instruction.order_type = OrderType::Limit;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:322:
         let result = engine.execute_order(instruction).await;
 
         // Assert - price validation should fail
[31m-        assert!(result.is_err(), "Negative price should trigger validation error");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Negative price should trigger validation error"
[m[32m+        );
[m         match result {
             Err(ExecutionError::ValidationFailed(msg)) => {
                 println!("✓ Correctly rejected: {}", msg);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:340:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         let mut instruction = create_test_instruction("META", 100.0, OrderSide::Buy);
         instruction.order_type = OrderType::Market;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:363:
         let result = engine.execute_order(instruction).await;
 
         // Assert
[31m-        assert!(result.is_err(), "Market order with DAY TIF should trigger validation error");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Market order with DAY TIF should trigger validation error"
[m[32m+        );
[m         match result {
             Err(ExecutionError::ValidationFailed(msg)) => {
                 println!("✓ Correctly rejected: {}", msg);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:381:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         let mut instruction = create_test_instruction("NVDA", 100.0, OrderSide::Buy);
         instruction.order_type = OrderType::Limit;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:405:
         let result = engine.execute_order(instruction).await;
 
         // Assert - should fail due to missing limit price
[31m-        assert!(result.is_err(), "Limit order without price should trigger validation error");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Limit order without price should trigger validation error"
[m[32m+        );
[m 
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:429:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m 
         let mut risk_config = create_test_risk_config();
         risk_config.max_position_size = Decimal::new(10, 0); // Very low limit
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:436:
 
         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            risk_config,
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(risk_config, config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         // Try to execute order that exceeds position limit
         let instruction = create_test_instruction("AAPL", 1000.0, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:455:
         let result = engine.execute_order(instruction).await;
 
         // Assert - risk check should fail
[31m-        assert!(result.is_err(), "Position limit breach should trigger risk check failure");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Position limit breach should trigger risk check failure"
[m[32m+        );
[m         match result {
             Err(ExecutionError::RiskCheckFailed) => {
                 println!("✓ Correctly rejected due to position limit");
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:463:
             _ => {
                 // Risk check may pass if other validation fails first
                 println!("ℹ Risk check may be overridden by validation errors");
[31m-            }
[m[32m+            },
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:476:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m 
         let mut risk_config = create_test_risk_config();
         risk_config.max_orders_per_second = 5; // Low rate limit
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:483:
 
         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            risk_config,
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(risk_config, config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = Arc::new(ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?);
[m[32m+        let engine = Arc::new(
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?,
[m[32m+        );
[m 
         // Submit rapid-fire orders to potentially trigger rate limit
         let mut tasks = vec![];
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:500:
         for _ in 0..10 {
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:535:
         // (BrokerConfig structure has changed, so we just test with empty map)
 
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
         // Act - try to initialize with invalid config
[31m-        let result = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await;
[m[32m+        let result =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await;
[m 
         // Assert - may fail or succeed depending on validation strictness
         if result.is_err() {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:574:
             tasks.push(tokio::spawn(async move {
                 let broker_configs = HashMap::new();
                 let config_manager = create_test_config_manager();
[31m-                let position_manager = Arc::new(PositionManager::new(cfg.clone(), config_manager.clone()).await.unwrap());
[m[32m+                let position_manager = Arc::new(
[m[32m+                    PositionManager::new(cfg.clone(), config_manager.clone())
[m[32m+                        .await
[m[32m+                        .unwrap(),
[m[32m+                );
[m                 let asset_classifier = AssetClassificationManager::new();
[31m-                let risk_manager = Arc::new(RiskManager::new(
[m[31m-                    create_test_risk_config(),
[m[31m-                    cfg.clone(),
[m[31m-                    asset_classifier,
[m[31m-                ).await.unwrap());
[m[32m+                let risk_manager = Arc::new(
[m[32m+                    RiskManager::new(create_test_risk_config(), cfg.clone(), asset_classifier)
[m[32m+                        .await
[m[32m+                        .unwrap(),
[m[32m+                );
[m 
[31m-                ExecutionEngine::new(
[m[31m-                    cfg,
[m[31m-                    broker_configs,
[m[31m-                    position_manager,
[m[31m-                    risk_manager,
[m[31m-                ).await
[m[32m+                ExecutionEngine::new(cfg, broker_configs, position_manager, risk_manager).await
[m             }));
         }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:594:
         let results = futures::future::join_all(tasks).await;
 
         // Count successes
[31m-        let successes = results.iter()
[m[32m+        let successes = results
[m[32m+            .iter()
[m             .filter(|r| r.as_ref().unwrap().is_ok())
             .count();
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:601:
[31m-        println!("✓ Created {} concurrent engine instances successfully", successes);
[m[31m-        assert!(successes >= 4, "Most concurrent initializations should succeed");
[m[32m+        println!(
[m[32m+            "✓ Created {} concurrent engine instances successfully",
[m[32m+            successes
[m[32m+        );
[m[32m+        assert!(
[m[32m+            successes >= 4,
[m[32m+            "Most concurrent initializations should succeed"
[m[32m+        );
[m 
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:621:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = Arc::new(ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?);
[m[32m+        let engine = Arc::new(
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?,
[m[32m+        );
[m 
         // Submit 50 concurrent orders
         let mut tasks = vec![];
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:643:
             let symbol = if i % 2 == 0 { "AAPL" } else { "MSFT" };
             let instruction = create_test_instruction(symbol, 10.0, OrderSide::Buy);
 
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:652:
 
         // Count completed operations
[31m-        let completed = results.iter()
[m[31m-            .filter(|r| r.is_ok())
[m[31m-            .count();
[m[32m+        let completed = results.iter().filter(|r| r.is_ok()).count();
[m 
         println!("✓ Processed {} concurrent orders", completed);
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:671:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = Arc::new(ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?);
[m[32m+        let engine = Arc::new(
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?,
[m[32m+        );
[m 
         // Submit orders concurrently
         let mut tasks = vec![];
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:692:
             let eng = engine.clone();
             let instruction = create_test_instruction("AAPL", 10.0, OrderSide::Buy);
 
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:725:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         let mut instruction = create_test_instruction("MSFT", 1000.0, OrderSide::Buy);
         instruction.algorithm = ExecutionAlgorithm::TWAP;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:760:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         let mut instruction = create_test_instruction("TSLA", 1000.0, OrderSide::Buy);
         instruction.algorithm = ExecutionAlgorithm::Iceberg;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:805:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = Arc::new(ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?);
[m[32m+        let engine = Arc::new(
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?,
[m[32m+        );
[m 
         // Create a large TWAP order that would take significant time
         let mut instruction = create_test_instruction("AAPL", 10000.0, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:827:
 
         // Submit order and set tight timeout
         let engine_clone = engine.clone();
[31m-        let execution_future = tokio::spawn(async move {
[m[31m-            engine_clone.execute_order(instruction).await
[m[31m-        });
[m[32m+        let execution_future =
[m[32m+            tokio::spawn(async move { engine_clone.execute_order(instruction).await });
[m 
         // Wait with timeout
[31m-        let timeout_result = tokio::time::timeout(
[m[31m-            tokio::time::Duration::from_millis(100),
[m[31m-            execution_future
[m[31m-        ).await;
[m[32m+        let timeout_result =
[m[32m+            tokio::time::timeout(tokio::time::Duration::from_millis(100), execution_future).await;
[m 
         // Assert - either completes quickly or times out
         match timeout_result {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:847:
             },
             Err(_) => {
                 println!("✓ Execution timed out as expected (TWAP takes time)");
[31m-            }
[m[32m+            },
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:860:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         // Try to execute on specific venue (may not be available in test env)
         let mut instruction = create_test_instruction("MSFT", 100.0, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:894:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         // Execute order (may fail due to broker unavailability in test env)
         let instruction = create_test_instruction("TSLA", 100.0, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:925:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = Arc::new(ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?);
[m[32m+        let engine = Arc::new(
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?,
[m[32m+        );
[m 
         // Submit multiple orders to test retry behavior
         let mut tasks = vec![];
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:945:
         for _ in 0..5 {
             let eng = engine.clone();
             let instruction = create_test_instruction("NVDA", 10.0, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         let results = futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:965:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = Arc::new(ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?);
[m[32m+        let engine = Arc::new(
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?,
[m[32m+        );
[m 
         // Submit multiple orders with tight timeouts
         let mut tasks = vec![];
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:994:
             tasks.push(tokio::spawn(async move {
                 tokio::time::timeout(
                     tokio::time::Duration::from_millis(50),
[31m-                    eng.execute_order(instruction)
[m[31m-                ).await
[m[32m+                    eng.execute_order(instruction),
[m[32m+                )
[m[32m+                .await
[m             }));
         }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:1002:
         let results = futures::future::join_all(tasks).await;
[31m-        let completed = results.iter()
[m[32m+        let completed = results
[m[32m+            .iter()
[m             .filter(|r| matches!(r, Ok(Ok(Ok(_)))))
             .count();
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:1016:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         // Try each venue type
         let venues = vec![
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:1067:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?;
[m[32m+        let engine =
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?;
[m 
         // Submit invalid order
         let invalid = create_test_instruction("AAPL", 0.0, OrderSide::Buy);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:1103:
         let config = create_test_config();
         let broker_configs = HashMap::new();
         let config_manager = create_test_config_manager();
[31m-        let position_manager = Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m[32m+        let position_manager =
[m[32m+            Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m         let asset_classifier = AssetClassificationManager::new();
[31m-        let risk_manager = Arc::new(RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?);
[m[32m+        let risk_manager = Arc::new(
[m[32m+            RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+                .await
[m[32m+                .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m[32m+        );
[m 
[31m-        let engine = Arc::new(ExecutionEngine::new(
[m[31m-            config,
[m[31m-            broker_configs,
[m[31m-            position_manager,
[m[31m-            risk_manager,
[m[31m-        ).await?);
[m[32m+        let engine = Arc::new(
[m[32m+            ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await?,
[m[32m+        );
[m 
         let initial_metrics = engine.get_metrics();
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:1126:
             let eng = engine.clone();
             let quantity = if i % 3 == 0 { 0.0 } else { 10.0 }; // Some invalid
             let instruction = create_test_instruction("AAPL", quantity, OrderSide::Buy);
[31m-            tasks.push(tokio::spawn(async move {
[m[31m-                eng.execute_order(instruction).await
[m[31m-            }));
[m[32m+            tasks.push(tokio::spawn(
[m[32m+                async move { eng.execute_order(instruction).await },
[m[32m+            ));
[m         }
 
         futures::future::join_all(tasks).await;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_error_tests.rs:1135:
 
         let final_metrics = engine.get_metrics();
 
[31m-        println!("✓ State consistent: {} initial, {} final executions",
[m[31m-            initial_metrics.total_executions, final_metrics.total_executions);
[m[32m+        println!(
[m[32m+            "✓ State consistent: {} initial, {} final executions",
[m[32m+            initial_metrics.total_executions, final_metrics.total_executions
[m[32m+        );
[m 
         Ok(())
     }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:27:
 
 // Import from trading_service
 use trading_service::core::execution_engine::{
[31m-    ExecutionEngine, ExecutionError, ExecutionInstruction, ExecutionAlgorithm,
[m[31m-    ExecutionUrgency, ExecutionVenue,
[m[32m+    ExecutionAlgorithm, ExecutionEngine, ExecutionError, ExecutionInstruction, ExecutionUrgency,
[m[32m+    ExecutionVenue,
[m };
 use trading_service::core::position_manager::PositionManager;
 use trading_service::core::risk_manager::RiskManager;
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:35:
 
 // Import from config
[31m-use config::structures::{TradingConfig, RiskConfig};
[m use config::asset_classification::AssetClassificationManager;
 use config::manager::{ConfigManager, ServiceConfig};
[32m+use config::structures::{RiskConfig, TradingConfig};
[m 
 // Import from common
[31m-use common::{TimeInForce, OrderSide, OrderType};
[m[32m+use common::{OrderSide, OrderType, TimeInForce};
[m 
 // ============================================================================
 // MOCK BROKER CONNECTION
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:117:
         // Check connection state
         if !self.is_connected() {
             *self.retry_count.lock().unwrap() += 1;
[31m-            return Err(ExecutionError::VenueConnectionError(
[m[31m-                format!("{:?} is disconnected", self.venue)
[m[31m-            ));
[m[32m+            return Err(ExecutionError::VenueConnectionError(format!(
[m[32m+                "{:?} is disconnected",
[m[32m+                self.venue
[m[32m+            )));
[m         }
 
         // Check failure mode
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:126:
         let mode = self.failure_mode.lock().unwrap().clone();
         match mode {
             FailureMode::Healthy => {
[31m-                self.orders_received.lock().unwrap().push(order_id.to_string());
[m[32m+                self.orders_received
[m[32m+                    .lock()
[m[32m+                    .unwrap()
[m[32m+                    .push(order_id.to_string());
[m                 Ok(())
[31m-            }
[m[32m+            },
[m             FailureMode::Disconnected => {
                 *self.retry_count.lock().unwrap() += 1;
[31m-                Err(ExecutionError::VenueConnectionError(
[m[31m-                    format!("{:?} connection lost", self.venue)
[m[31m-                ))
[m[31m-            }
[m[31m-            FailureMode::RejectOrders { reason } => {
[m[31m-                Err(ExecutionError::OrderRejected(reason))
[m[31m-            }
[m[32m+                Err(ExecutionError::VenueConnectionError(format!(
[m[32m+                    "{:?} connection lost",
[m[32m+                    self.venue
[m[32m+                )))
[m[32m+            },
[m[32m+            FailureMode::RejectOrders { reason } => Err(ExecutionError::OrderRejected(reason)),
[m             FailureMode::SlowResponse { delay_ms } => {
                 sleep(Duration::from_millis(delay_ms)).await;
[31m-                self.orders_received.lock().unwrap().push(order_id.to_string());
[m[32m+                self.orders_received
[m[32m+                    .lock()
[m[32m+                    .unwrap()
[m[32m+                    .push(order_id.to_string());
[m                 Ok(())
[31m-            }
[m[32m+            },
[m             FailureMode::PartialConnectivity => {
                 // Order sent but confirmation lost
[31m-                self.orders_received.lock().unwrap().push(order_id.to_string());
[m[31m-                Err(ExecutionError::TimeoutError("Confirmation lost".to_string()))
[m[31m-            }
[m[32m+                self.orders_received
[m[32m+                    .lock()
[m[32m+                    .unwrap()
[m[32m+                    .push(order_id.to_string());
[m[32m+                Err(ExecutionError::TimeoutError(
[m[32m+                    "Confirmation lost".to_string(),
[m[32m+                ))
[m[32m+            },
[m             FailureMode::OutOfOrderMessages => {
                 // Simulate out of order delivery
[31m-                self.orders_received.lock().unwrap().push(order_id.to_string());
[m[32m+                self.orders_received
[m[32m+                    .lock()
[m[32m+                    .unwrap()
[m[32m+                    .push(order_id.to_string());
[m                 Ok(())
[31m-            }
[m[31m-            FailureMode::CircuitBreakerOpen => {
[m[31m-                Err(ExecutionError::CircuitBreakerOpen(
[m[31m-                    format!("{:?} circuit breaker is open", self.venue)
[m[31m-                ))
[m[31m-            }
[m[32m+            },
[m[32m+            FailureMode::CircuitBreakerOpen => Err(ExecutionError::CircuitBreakerOpen(format!(
[m[32m+                "{:?} circuit breaker is open",
[m[32m+                self.venue
[m[32m+            ))),
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:168:
 
 fn create_test_instruction(symbol: &str, quantity: f64, side: OrderSide) -> ExecutionInstruction {
     ExecutionInstruction {
[31m-        order_id: format!("test_{}", std::time::SystemTime::now()
[m[31m-            .duration_since(std::time::UNIX_EPOCH)
[m[31m-            .unwrap()
[m[31m-            .as_nanos()),
[m[32m+        order_id: format!(
[m[32m+            "test_{}",
[m[32m+            std::time::SystemTime::now()
[m[32m+                .duration_since(std::time::UNIX_EPOCH)
[m[32m+                .unwrap()
[m[32m+                .as_nanos()
[m[32m+        ),
[m         symbol: symbol.to_string(),
         side,
         quantity,
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:210:
     let config = create_test_config();
     let broker_configs = HashMap::new();
     let config_manager = create_test_config_manager();
[31m-    let position_manager = Arc::new(
[m[31m-        PositionManager::new(config.clone(), config_manager.clone()).await?
[m[31m-    );
[m[32m+    let position_manager =
[m[32m+        Arc::new(PositionManager::new(config.clone(), config_manager.clone()).await?);
[m     let asset_classifier = AssetClassificationManager::new();
     let risk_manager = Arc::new(
[31m-        RiskManager::new(
[m[31m-            create_test_risk_config(),
[m[31m-            config.clone(),
[m[31m-            asset_classifier,
[m[31m-        ).await.map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?
[m[32m+        RiskManager::new(create_test_risk_config(), config.clone(), asset_classifier)
[m[32m+            .await
[m[32m+            .map_err(|e| anyhow::anyhow!("Failed to create RiskManager: {}", e))?,
[m     );
 
     ExecutionEngine::new(config, broker_configs, position_manager, risk_manager).await
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:247:
     match result.unwrap_err() {
         ExecutionError::VenueConnectionError(msg) => {
             assert!(msg.contains("disconnected"));
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected VenueConnectionError"),
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:395:
     match result.unwrap_err() {
         ExecutionError::CircuitBreakerOpen(msg) => {
             assert!(msg.contains("circuit breaker is open"));
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected CircuitBreakerOpen error"),
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:480:
     match result.unwrap_err() {
         ExecutionError::OrderRejected(reason) => {
             assert_eq!(reason, "Invalid Symbol");
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected OrderRejected error"),
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:512:
     match result2.unwrap_err() {
         ExecutionError::OrderRejected(reason) => {
             assert_eq!(reason, "Insufficient Funds");
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected OrderRejected error"),
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:542:
     match result.unwrap_err() {
         ExecutionError::OrderRejected(reason) => {
             assert_eq!(reason, "Order Book Closed");
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected OrderRejected error"),
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:624:
         ExecutionError::OrderRejected(reason) => {
             assert_eq!(reason, "Invalid Symbol");
             // In real implementation, this would trigger DLQ movement
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected OrderRejected error"),
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:657:
         ExecutionError::OrderRejected(reason) => {
             assert_eq!(reason, "Invalid Symbol");
             // Audit log verification would happen here
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected OrderRejected error"),
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:679:
     let instruction = create_test_instruction("EURUSD", 100_000.0, OrderSide::Buy);
     let result = timeout(
         Duration::from_millis(1000),
[31m-        mock.execute_order(&instruction.order_id)
[m[31m-    ).await;
[m[32m+        mock.execute_order(&instruction.order_id),
[m[32m+    )
[m[32m+    .await;
[m 
     // Phase 3: No recovery (timeout)
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:708:
     match result.unwrap_err() {
         ExecutionError::TimeoutError(msg) => {
             assert_eq!(msg, "Confirmation lost");
[31m-        }
[m[32m+        },
[m         _ => panic!("Expected TimeoutError"),
     }
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:728:
     let cancel_instruction = create_test_instruction("EURUSD", 100_000.0, OrderSide::Sell);
     let result = timeout(
         Duration::from_millis(1000),
[31m-        mock.execute_order(&cancel_instruction.order_id)
[m[31m-    ).await;
[m[32m+        mock.execute_order(&cancel_instruction.order_id),
[m[32m+    )
[m[32m+    .await;
[m 
     // Phase 3: Cancel timeout
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:751:
         let instruction = create_test_instruction("EURUSD", 100_000.0, OrderSide::Buy);
         let result = timeout(
             Duration::from_millis(1000),
[31m-            mock.execute_order(&instruction.order_id)
[m[31m-        ).await;
[m[32m+            mock.execute_order(&instruction.order_id),
[m[32m+        )
[m[32m+        .await;
[m 
         // Phase 3: Each timeout should be independent
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:774:
     let instruction = create_test_instruction("EURUSD", 100_000.0, OrderSide::Buy);
     let result1 = timeout(
         Duration::from_millis(1000),
[31m-        mock.execute_order(&instruction.order_id)
[m[31m-    ).await;
[m[32m+        mock.execute_order(&instruction.order_id),
[m[32m+    )
[m[32m+    .await;
[m     assert!(result1.is_err());
 
     // Phase 3: Recovery - reduce delay
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/execution_recovery.rs:785:
     sleep(Duration::from_millis(100)).await;
     let result2 = timeout(
         Duration::from_millis(1000),
[31m-        mock.execute_order(&instruction.order_id)
[m[31m-    ).await;
[m[32m+        mock.execute_order(&instruction.order_id),
[m[32m+    )
[m[32m+    .await;
[m 
     // Phase 4: Verify - successful after retry
     assert!(result2.is_ok());
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/integration_tests.rs:13:
 use std::sync::Arc;
 use tonic::Request;
 use trading_service::proto::trading::{
[31m-    trading_service_server::TradingService,
[m[31m-    SubmitOrderRequest, CancelOrderRequest, GetOrderStatusRequest,
[m[31m-    GetPositionsRequest, OrderSide, OrderType, OrderStatus
[m[32m+    trading_service_server::TradingService, CancelOrderRequest, GetOrderStatusRequest,
[m[32m+    GetPositionsRequest, OrderSide, OrderStatus, OrderType, SubmitOrderRequest,
[m };
[31m-use trading_service::{
[m[31m-    state::TradingServiceState,
[m[31m-    services::trading::TradingServiceImpl,
[m[31m-};
[m[32m+use trading_service::{services::trading::TradingServiceImpl, state::TradingServiceState};
[m 
 /// Setup test trading service instance
 async fn setup_trading_service() -> Result<TradingServiceImpl> {
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/integration_tests.rs:37:
 
     let mut metadata = std::collections::HashMap::new();
     metadata.insert("time_in_force".to_string(), "GTC".to_string());
[31m-    metadata.insert("client_order_id".to_string(), "client_order_123".to_string());
[m[32m+    metadata.insert(
[m[32m+        "client_order_id".to_string(),
[m[32m+        "client_order_123".to_string(),
[m[32m+    );
[m 
     let request = Request::new(SubmitOrderRequest {
         account_id: "test_account_001".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/integration_tests.rs:243:
     match result {
         Ok(response) => {
             let cancel_result = response.into_inner();
[31m-            assert!(!cancel_result.success, "Cancelling nonexistent order should fail");
[m[31m-            println!("✓ Cancellation failed as expected: {}", cancel_result.message);
[m[31m-        }
[m[32m+            assert!(
[m[32m+                !cancel_result.success,
[m[32m+                "Cancelling nonexistent order should fail"
[m[32m+            );
[m[32m+            println!(
[m[32m+                "✓ Cancellation failed as expected: {}",
[m[32m+                cancel_result.message
[m[32m+            );
[m[32m+        },
[m         Err(status) => {
             println!("✓ Rejected with status: {}", status.code());
[31m-        }
[m[32m+        },
[m     }
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/integration_tests.rs:286:
     let status_response = service.get_order_status(status_req).await?;
     let order_status = status_response.into_inner();
 
[31m-    println!("✓ Order status retrieved: {:?}", order_status.order.as_ref().map(|o| o.status));
[m[32m+    println!(
[m[32m+        "✓ Order status retrieved: {:?}",
[m[32m+        order_status.order.as_ref().map(|o| o.status)
[m[32m+    );
[m     assert!(order_status.order.is_some());
     assert!(!order_status.order.unwrap().order_id.is_empty());
 
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/integration_tests.rs:325:
         let handle = tokio::spawn(async move {
             let mut metadata = std::collections::HashMap::new();
             metadata.insert("time_in_force".to_string(), "GTC".to_string());
[31m-            metadata.insert("client_order_id".to_string(), format!("concurrent_order_{}", i));
[m[32m+            metadata.insert(
[m[32m+                "client_order_id".to_string(),
[m[32m+                format!("concurrent_order_{}", i),
[m[32m+            );
[m 
             let request = Request::new(SubmitOrderRequest {
                 account_id: format!("test_account_{:03}", i),
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/integration_tests.rs:351:
         }
     }
 
[31m-    println!("✓ {}/10 concurrent orders submitted successfully", success_count);
[m[32m+    println!(
[m[32m+        "✓ {}/10 concurrent orders submitted successfully",
[m[32m+        success_count
[m[32m+    );
[m     assert_eq!(success_count, 10, "All concurrent orders should succeed");
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/integration_tests.rs:386:
             let order = response.into_inner();
             // If not rejected at submit time, status might indicate risk failure
             println!("  Order response: {:?}", order.status);
[31m-        }
[m[32m+        },
[m         Err(status) => {
             assert_eq!(status.code(), tonic::Code::FailedPrecondition);
             println!("✓ Risk violation rejected: {}", status.message());
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/integration_tests.rs:393:
             assert!(status.message().contains("Risk violation"));
[31m-        }
[m[32m+        },
[m     }
 
     Ok(())
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/jwt_validation_comprehensive.rs:25:
 // TEST HELPERS
 // ============================================================================
 
[31m-const TEST_JWT_SECRET: &str = "Kx7mP@9nR!2sW#5vY$8bC&3fG*6jH^1kL%4pQ+7tZ-0uN~9dM=5eV(8xS)2wT!6yA#4zB";
[m[32m+const TEST_JWT_SECRET: &str =
[m[32m+    "Kx7mP@9nR!2sW#5vY$8bC&3fG*6jH^1kL%4pQ+7tZ-0uN~9dM=5eV(8xS)2wT!6yA#4zB";
[m 
 fn create_test_auth_config() -> AuthConfig {
     std::env::set_var("JWT_SECRET", TEST_JWT_SECRET);
Diff in /home/jgrusewski/Work/foxhunt/services/trading_service/tests/jwt_validation_comprehensive.rs:90:
     }
 
     assert!(token.len() <= 8192, "Token length: {}", token.len());
[31m-    
[m[32m+
[m     let result = validator.validate_token(&token).await;
     assert!(result.is_ok(), "Token at boundary should be valid");
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/storage/src/metrics.rs:287:
         // Safe percentile calculation with bounds checking
         let get_percentile = |pct: usize| -> f64 {
             let idx = (len * pct / 100).min(len.saturating_sub(1));
[31m-            all_durations.get(idx)
[m[32m+            all_durations
[m[32m+                .get(idx)
[m                 .map(|d| d.as_millis() as f64)
                 .unwrap_or(0.0)
         };
Diff in /home/jgrusewski/Work/foxhunt/storage/src/metrics.rs:297:
             p90_ms: get_percentile(90),
             p95_ms: get_percentile(95),
             p99_ms: get_percentile(99),
[31m-            min_ms: all_durations.first().map(|d| d.as_millis() as f64).unwrap_or(0.0),
[m[31m-            max_ms: all_durations.last().map(|d| d.as_millis() as f64).unwrap_or(0.0),
[m[32m+            min_ms: all_durations
[m[32m+                .first()
[m[32m+                .map(|d| d.as_millis() as f64)
[m[32m+                .unwrap_or(0.0),
[m[32m+            max_ms: all_durations
[m[32m+                .last()
[m[32m+                .map(|d| d.as_millis() as f64)
[m[32m+                .unwrap_or(0.0),
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/src/model_helpers.rs:105:
 
         let mut idx = self.current_idx.write().await;
         // Safe indexing: we've verified stores is non-empty above
[31m-        let store = stores.get(*idx)
[m[32m+        let store = stores
[m[32m+            .get(*idx)
[m             .ok_or_else(|| StorageError::Generic {
[31m-                message: format!("Invalid connection pool index: {} (pool size: {})", *idx, stores.len()),
[m[32m+                message: format!(
[m[32m+                    "Invalid connection pool index: {} (pool size: {})",
[m[32m+                    *idx,
[m[32m+                    stores.len()
[m[32m+                ),
[m             })?
             .clone();
         *idx = (*idx + 1) % stores.len();
Diff in /home/jgrusewski/Work/foxhunt/storage/src/model_helpers.rs:470:
     }
 
     let duration = start.elapsed();
[31m-    let total_bytes: usize = results.iter().map(|(_, data): &(String, Vec<u8>)| data.len()).sum();
[m[32m+    let total_bytes: usize = results
[m[32m+        .iter()
[m[32m+        .map(|(_, data): &(String, Vec<u8>)| data.len())
[m[32m+        .sum();
[m     let throughput = (total_bytes as f64) / duration.as_secs_f64() / 1_048_576.0;
 
     info!(
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:5:
 //! - StorageError::retry_delay_ms (retryable vs non-retryable errors)
 //! - std::io::Error to StorageError conversion (all ErrorKind mappings)
 
[31m-use storage::error::StorageError;
[m use common::error::{CommonError, ErrorCategory};
 use std::io::ErrorKind;
[32m+use storage::error::StorageError;
[m 
 // =============================================================================
 // STORAGE ERROR TO COMMON ERROR CONVERSION
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:15:
 
 #[test]
 fn test_storage_error_to_common_error_io() {
[31m-    let storage_err = StorageError::IoError { message: "disk full".to_string() };
[m[32m+    let storage_err = StorageError::IoError {
[m[32m+        message: "disk full".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::System);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:22:
 
 #[test]
 fn test_storage_error_to_common_error_network() {
[31m-    let storage_err = StorageError::NetworkError { message: "host unreachable".to_string() };
[m[32m+    let storage_err = StorageError::NetworkError {
[m[32m+        message: "host unreachable".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::Network);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:29:
 
 #[test]
 fn test_storage_error_to_common_error_auth() {
[31m-    let storage_err = StorageError::AuthError { message: "bad credentials".to_string() };
[m[32m+    let storage_err = StorageError::AuthError {
[m[32m+        message: "bad credentials".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::Security);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:36:
 
 #[test]
 fn test_storage_error_to_common_error_config() {
[31m-    let storage_err = StorageError::ConfigError { message: "invalid path".to_string() };
[m[32m+    let storage_err = StorageError::ConfigError {
[m[32m+        message: "invalid path".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::Configuration);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:43:
 
 #[test]
 fn test_storage_error_to_common_error_not_found() {
[31m-    let storage_err = StorageError::NotFound { path: "/data/model.bin".to_string() };
[m[32m+    let storage_err = StorageError::NotFound {
[m[32m+        path: "/data/model.bin".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::System);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:62:
 
 #[test]
 fn test_storage_error_to_common_error_permission_denied() {
[31m-    let storage_err = StorageError::PermissionDenied { path: "/etc/secrets".to_string() };
[m[32m+    let storage_err = StorageError::PermissionDenied {
[m[32m+        path: "/etc/secrets".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::Security);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:76:
 
 #[test]
 fn test_storage_error_to_common_error_rate_limited() {
[31m-    let storage_err = StorageError::RateLimited { retry_after_ms: 1000 };
[m[32m+    let storage_err = StorageError::RateLimited {
[m[32m+        retry_after_ms: 1000,
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::System);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:83:
 
 #[test]
 fn test_storage_error_to_common_error_quota_exceeded() {
[31m-    let storage_err = StorageError::QuotaExceeded { used: 1000, limit: 500 };
[m[32m+    let storage_err = StorageError::QuotaExceeded {
[m[32m+        used: 1000,
[m[32m+        limit: 500,
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::System);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:90:
 
 #[test]
 fn test_storage_error_to_common_error_serialization() {
[31m-    let storage_err = StorageError::SerializationError { message: "invalid JSON".to_string() };
[m[32m+    let storage_err = StorageError::SerializationError {
[m[32m+        message: "invalid JSON".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::System);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:97:
 
 #[test]
 fn test_storage_error_to_common_error_compression() {
[31m-    let storage_err = StorageError::CompressionError { message: "gzip failed".to_string() };
[m[32m+    let storage_err = StorageError::CompressionError {
[m[32m+        message: "gzip failed".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::System);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:115:
 
 #[test]
 fn test_storage_error_to_common_error_generic() {
[31m-    let storage_err = StorageError::Generic { message: "unknown error".to_string() };
[m[32m+    let storage_err = StorageError::Generic {
[m[32m+        message: "unknown error".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::System);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:123:
 #[cfg(feature = "s3")]
 #[test]
 fn test_storage_error_to_common_error_s3() {
[31m-    let storage_err = StorageError::S3Error { message: "S3 operation failed".to_string() };
[m[32m+    let storage_err = StorageError::S3Error {
[m[32m+        message: "S3 operation failed".to_string(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::Network);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:134:
 
 #[test]
 fn test_storage_error_retry_delay_ms_network_error() {
[31m-    let err = StorageError::NetworkError { message: "connection failed".to_string() };
[m[32m+    let err = StorageError::NetworkError {
[m[32m+        message: "connection failed".to_string(),
[m[32m+    };
[m     assert_eq!(err.retry_delay_ms(), Some(100));
 }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:146:
 
 #[test]
 fn test_storage_error_retry_delay_ms_rate_limited() {
[31m-    let err = StorageError::RateLimited { retry_after_ms: 1500 };
[m[32m+    let err = StorageError::RateLimited {
[m[32m+        retry_after_ms: 1500,
[m[32m+    };
[m     assert_eq!(err.retry_delay_ms(), Some(1500));
 }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:153:
 #[test]
 fn test_storage_error_retry_delay_ms_generic() {
[31m-    let err = StorageError::Generic { message: "generic error".to_string() };
[m[32m+    let err = StorageError::Generic {
[m[32m+        message: "generic error".to_string(),
[m[32m+    };
[m     assert_eq!(err.retry_delay_ms(), Some(100));
 }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:159:
 #[cfg(feature = "s3")]
 #[test]
 fn test_storage_error_retry_delay_ms_s3() {
[31m-    let err = StorageError::S3Error { message: "S3 error".to_string() };
[m[32m+    let err = StorageError::S3Error {
[m[32m+        message: "S3 error".to_string(),
[m[32m+    };
[m     assert_eq!(err.retry_delay_ms(), Some(100));
 }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:166:
 #[test]
 fn test_storage_error_retry_delay_ms_not_found() {
[31m-    let err = StorageError::NotFound { path: "/data/missing.bin".to_string() };
[m[32m+    let err = StorageError::NotFound {
[m[32m+        path: "/data/missing.bin".to_string(),
[m[32m+    };
[m     assert_eq!(err.retry_delay_ms(), None);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:172:
 #[test]
 fn test_storage_error_retry_delay_ms_quota_exceeded() {
[31m-    let err = StorageError::QuotaExceeded { used: 1000, limit: 500 };
[m[32m+    let err = StorageError::QuotaExceeded {
[m[32m+        used: 1000,
[m[32m+        limit: 500,
[m[32m+    };
[m     assert_eq!(err.retry_delay_ms(), None);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:178:
 #[test]
 fn test_storage_error_retry_delay_ms_permission_denied() {
[31m-    let err = StorageError::PermissionDenied { path: "/etc/forbidden".to_string() };
[m[32m+    let err = StorageError::PermissionDenied {
[m[32m+        path: "/etc/forbidden".to_string(),
[m[32m+    };
[m     assert_eq!(err.retry_delay_ms(), None);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:184:
 #[test]
 fn test_storage_error_retry_delay_ms_serialization_error() {
[31m-    let err = StorageError::SerializationError { message: "bad JSON".to_string() };
[m[32m+    let err = StorageError::SerializationError {
[m[32m+        message: "bad JSON".to_string(),
[m[32m+    };
[m     assert_eq!(err.retry_delay_ms(), None);
 }
 
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:236:
 fn test_io_error_to_storage_error_timed_out() {
     let io_err = std::io::Error::new(ErrorKind::TimedOut, "operation timed out");
     let storage_err: StorageError = io_err.into();
[31m-    assert!(matches!(storage_err, StorageError::Timeout { timeout_ms: 5000 }));
[m[32m+    assert!(matches!(
[m[32m+        storage_err,
[m[32m+        StorageError::Timeout { timeout_ms: 5000 }
[m[32m+    ));
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:275:
 
 #[test]
 fn test_storage_error_empty_message() {
[31m-    let storage_err = StorageError::Generic { message: String::new() };
[m[32m+    let storage_err = StorageError::Generic {
[m[32m+        message: String::new(),
[m[32m+    };
[m     let common_err: CommonError = storage_err.into();
     assert_eq!(common_err.category(), ErrorCategory::System);
 }
Diff in /home/jgrusewski/Work/foxhunt/storage/tests/error_conversion_tests.rs:283:
 #[test]
 fn test_storage_error_long_path() {
     let long_path = "a".repeat(1000);
[31m-    let storage_err = StorageError::NotFound { path: long_path.clone() };
[m[32m+    let storage_err = StorageError::NotFound {
[m[32m+        path: long_path.clone(),
[m[32m+    };
[m     assert!(matches!(storage_err, StorageError::NotFound { .. }));
     if let StorageError::NotFound { path } = storage_err {
         assert_eq!(path.len(), 1000);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/benches/simple_performance.rs:1:
 //! Simple Performance Test to validate benchmark infrastructure works
 
[31m-use criterion::{black_box, criterion_group, criterion_main, Criterion};
[m use common::types::{Price, Quantity};
[32m+use criterion::{black_box, criterion_group, criterion_main, Criterion};
[m 
 /// Simple benchmark to test that criterion framework is working
 fn simple_benchmark(c: &mut Criterion) {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/benches/small_batch_performance.rs:6:
 use common::{OrderSide as Side, OrderType};
 use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
 use std::time::{Duration, Instant};
[31m-use trading_engine::lockfree::{BatchMode, LockFreeRingBuffer, SmallBatchOrdersSoA, SmallBatchRing};
[m[31m-use trading_engine::small_batch_optimizer::{SmallBatchProcessor, OrderRequest};
[m[32m+use trading_engine::lockfree::{
[m[32m+    BatchMode, LockFreeRingBuffer, SmallBatchOrdersSoA, SmallBatchRing,
[m[32m+};
[m[32m+use trading_engine::small_batch_optimizer::{OrderRequest, SmallBatchProcessor};
[m 
 /// Benchmark small batch processor vs standard processing
 fn benchmark_small_batch_vs_standard(c: &mut Criterion) {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/compliance_validation_tests.rs:431:
 
     for i in 0..100 {
         let context = create_test_compliance_context_with_id(&format!("STRESS-{}", i));
[31m-        let result = test_suite.compliance_engine.assess_compliance(&context).await;
[m[32m+        let result = test_suite
[m[32m+            .compliance_engine
[m[32m+            .assess_compliance(&context)
[m[32m+            .await;
[m 
         if result.is_ok() {
             success_count += 1;
Diff in /home/jgrusewski/Work/foxhunt/tests/compliance_validation_tests.rs:475:
     }
 }
 
[31m-fn create_test_compliance_context_with_id(id: &str) -> trading_engine::compliance::ComplianceContext {
[m[32m+fn create_test_compliance_context_with_id(
[m[32m+    id: &str,
[m[32m+) -> trading_engine::compliance::ComplianceContext {
[m     let mut context = create_test_compliance_context();
     if let Some(order_info) = &mut context.order_info {
         order_info.order_id = OrderId::from(id);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/config_hot_reload.rs:29:
 //! cargo test --test config_hot_reload -- --nocapture
 //! ```
 
[31m-use config::{
[m[31m-    DatabaseRuntimeConfig, Environment, LimitsConfig,
[m[31m-    RuntimeConfig,
[m[31m-};
[m[32m+use config::{DatabaseRuntimeConfig, Environment, LimitsConfig, RuntimeConfig};
[m use serde_json::json;
 use sqlx::{Executor, PgPool};
 use std::env;
Diff in /home/jgrusewski/Work/foxhunt/tests/config_hot_reload.rs:97:
         "INSERT INTO config_categories (category_name, category_path)
          VALUES ($1, $2)
          ON CONFLICT (category_path) DO UPDATE SET category_name = EXCLUDED.category_name
[31m-         RETURNING id"
[m[32m+         RETURNING id",
[m     )
     .bind(name)
     .bind(path)
Diff in /home/jgrusewski/Work/foxhunt/tests/config_hot_reload.rs:438:
         .unwrap();
     listener.listen("foxhunt_config_changes").await.unwrap();
 
[31m-    let category_id = insert_test_category(&pool, "test_category_notify", "test_category_notify").await;
[m[32m+    let category_id =
[m[32m+        insert_test_category(&pool, "test_category_notify", "test_category_notify").await;
[m     let config_key = "test_setting_notify";
     let environment = "development";
     insert_test_config_setting(
Diff in /home/jgrusewski/Work/foxhunt/tests/config_hot_reload.rs:575:
     // Task 2: Attempts to update the same config setting with a small delay
     let task2 = tokio::spawn(async move {
         tokio::time::sleep(Duration::from_millis(10)).await; // Ensure task1 likely reads first
[31m-                                                              // Read current version
[m[32m+                                                             // Read current version
[m         let current_version: i32 = sqlx::query_scalar(
             "SELECT version FROM config_settings WHERE config_key = $1 AND environment = $2",
         )
Diff in /home/jgrusewski/Work/foxhunt/tests/config_hot_reload.rs:624:
             .await
             .unwrap();
 
[31m-    assert_eq!(final_version, 2, "Version should be incremented exactly once");
[m[32m+    assert_eq!(
[m[32m+        final_version, 2,
[m[32m+        "Version should be incremented exactly once"
[m[32m+    );
[m     assert!(
         final_value == json!("value_from_task1") || final_value == json!("value_from_task2"),
         "Final value should be from the successful task"
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:158:
 async fn test_ml_training_pool_configuration() {
     println!("\n=== ML Training Service Pool Configuration Test ===\n");
 
[31m-    let database_url = std::env::var("TEST_DATABASE_URL")
[m[31m-        .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string());
[m[32m+    let database_url = std::env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+        "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+    });
[m 
     let config = PoolConfig {
         min_connections: thresholds::ML_TRAINING_MIN_CONN,
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:166:
         max_connections: thresholds::ML_TRAINING_MAX_CONN,
         acquire_timeout_secs: thresholds::ML_TRAINING_TIMEOUT_SECS,
[31m-        max_lifetime_secs: 7200,  // 2 hours for long training
[m[31m-        idle_timeout_secs: 900,   // 15 minutes
[m[32m+        max_lifetime_secs: 7200, // 2 hours for long training
[m[32m+        idle_timeout_secs: 900,  // 15 minutes
[m         test_before_acquire: true,
         database_url: database_url.clone(),
         health_check_enabled: true,
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:213:
 async fn test_connection_acquisition_performance() {
     println!("\n=== Connection Acquisition Performance Test ===\n");
 
[31m-    let database_url = std::env::var("TEST_DATABASE_URL")
[m[31m-        .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string());
[m[32m+    let database_url = std::env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+        "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+    });
[m 
     let config = PoolConfig {
         min_connections: thresholds::ML_TRAINING_MIN_CONN,
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:236:
 
     // Simulate successful test for configuration validation
     let metrics = PerformanceMetrics {
[31m-        acquisition_times_us: vec![2000, 3000, 4000, 5000],  // 2-5ms range
[m[32m+        acquisition_times_us: vec![2000, 3000, 4000, 5000], // 2-5ms range
[m         successful_acquisitions: 4,
         failed_acquisitions: 0,
         timeout_errors: 0,
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:244:
         ops_per_second: 40.0,
     };
 
[31m-    return;  // Skip actual database operations in this validation
[m[32m+    return; // Skip actual database operations in this validation
[m 
     /* Original code would require database crate - currently disabled
     let pool = Arc::new(...);
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:251:
     */
 
[31m-    println!("Testing {} concurrent clients with {} operations each",
[m[32m+    println!(
[m[32m+        "Testing {} concurrent clients with {} operations each",
[m         thresholds::CONCURRENT_CLIENTS,
         thresholds::OPERATIONS_PER_CLIENT
     );
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:273:
 
             for _op in 0..thresholds::OPERATIONS_PER_CLIENT {
                 // Simulate acquisition timing (would use pool_clone.acquire().await)
[31m-                let acq_duration_us = 2000 + (client_id % 5) * 1000;  // 2-6ms range
[m[32m+                let acq_duration_us = 2000 + (client_id % 5) * 1000; // 2-6ms range
[m                 local_times.push(acq_duration_us as u64);
                 local_successes += 1;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:315:
     let p99_ms = metrics.percentile(99.0) as f64 / 1000.0;
 
     println!("\n=== Performance Validation ===");
[31m-    println!("Average acquisition time: {:.3}ms (target: <{}ms)",
[m[31m-        avg_ms, thresholds::ACQUISITION_TARGET_MS);
[m[31m-    println!("P99 acquisition time: {:.3}ms (target: <{}ms)",
[m[31m-        p99_ms, thresholds::ACQUISITION_P99_MS);
[m[32m+    println!(
[m[32m+        "Average acquisition time: {:.3}ms (target: <{}ms)",
[m[32m+        avg_ms,
[m[32m+        thresholds::ACQUISITION_TARGET_MS
[m[32m+    );
[m[32m+    println!(
[m[32m+        "P99 acquisition time: {:.3}ms (target: <{}ms)",
[m[32m+        p99_ms,
[m[32m+        thresholds::ACQUISITION_P99_MS
[m[32m+    );
[m 
     // Assertions
     assert!(
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:349:
 async fn test_timeout_improvements() {
     println!("\n=== Timeout Improvement Validation ===\n");
 
[31m-    let database_url = std::env::var("TEST_DATABASE_URL")
[m[31m-        .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string());
[m[32m+    let database_url = std::env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+        "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+    });
[m 
     // Test with new 5s timeout (Wave 67 Agent 2)
     let new_config = PoolConfig {
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:357:
         min_connections: 1,
[31m-        max_connections: 2,  // Intentionally small to force contention
[m[31m-        acquire_timeout_secs: 5,  // New timeout
[m[32m+        max_connections: 2,      // Intentionally small to force contention
[m[32m+        acquire_timeout_secs: 5, // New timeout
[m         max_lifetime_secs: 1800,
         idle_timeout_secs: 600,
         test_before_acquire: true,
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:363:
         database_url: database_url.clone(),
[31m-        health_check_enabled: false,  // Disable for this test
[m[32m+        health_check_enabled: false, // Disable for this test
[m         health_check_interval_secs: 60,
     };
 
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:374:
     assert_eq!(new_config.acquire_timeout_secs, 5, "Timeout should be 5s");
 
     // Simulate timeout scenario
[31m-    let timeout_secs = 5.0;  // Would be measured from actual pool exhaustion
[m[32m+    let timeout_secs = 5.0; // Would be measured from actual pool exhaustion
[m     println!("Configured timeout: {:.2}s", timeout_secs);
 
     println!("✅ 5s timeout validated (was 30s in old configuration)");
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:381:
[31m-    println!("   Improvement: {:.0}% faster timeout response",
[m[31m-        (1.0 - 5.0/30.0) * 100.0);
[m[32m+    println!(
[m[32m+        "   Improvement: {:.0}% faster timeout response",
[m[32m+        (1.0 - 5.0 / 30.0) * 100.0
[m[32m+    );
[m }
 
 /// Test warm connection pool performance
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:388:
 async fn test_warm_connection_pool() {
     println!("\n=== Warm Connection Pool Validation ===\n");
 
[31m-    let database_url = std::env::var("TEST_DATABASE_URL")
[m[31m-        .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string());
[m[32m+    let database_url = std::env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+        "postgresql://postgres:postgres@localhost:5432/foxhunt_test".to_string()
[m[32m+    });
[m 
     let config = PoolConfig {
[31m-        min_connections: thresholds::ML_TRAINING_MIN_CONN,  // 5 warm connections
[m[32m+        min_connections: thresholds::ML_TRAINING_MIN_CONN, // 5 warm connections
[m         max_connections: thresholds::ML_TRAINING_MAX_CONN,
         acquire_timeout_secs: thresholds::ML_TRAINING_TIMEOUT_SECS,
         max_lifetime_secs: 7200,
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:403:
         health_check_interval_secs: 60,
     };
 
[31m-    println!("Configuration: {} min connections (warm pool)",
[m[31m-        config.min_connections);
[m[32m+    println!(
[m[32m+        "Configuration: {} min connections (warm pool)",
[m[32m+        config.min_connections
[m[32m+    );
[m 
     // Note: This test validates warm pool configuration
     // Actual pool testing requires database crate
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:412:
     println!("\nValidating warm pool configuration...");
 
     // Verify configuration has min_connections set
[31m-    assert_eq!(config.min_connections, thresholds::ML_TRAINING_MIN_CONN,
[m[31m-        "Should configure {} warm connections", thresholds::ML_TRAINING_MIN_CONN);
[m[32m+    assert_eq!(
[m[32m+        config.min_connections,
[m[32m+        thresholds::ML_TRAINING_MIN_CONN,
[m[32m+        "Should configure {} warm connections",
[m[32m+        thresholds::ML_TRAINING_MIN_CONN
[m[32m+    );
[m 
     println!("  Min Connections: {} ✅", config.min_connections);
 
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:420:
     // Simulate warm pool acquisition times (would be measured from real pool)
     let acquisition_times: Vec<u64> = vec![500, 600, 700, 800, 900, 850, 750, 650, 550, 600];
 
[31m-    let avg_warm_acquisition_us: u64 = acquisition_times.iter().sum::<u64>()
[m[31m-        / acquisition_times.len() as u64;
[m[32m+    let avg_warm_acquisition_us: u64 =
[m[32m+        acquisition_times.iter().sum::<u64>() / acquisition_times.len() as u64;
[m 
     println!("\nWarm Pool Acquisition Performance:");
[31m-    println!("  Average: {} µs ({:.3} ms)",
[m[32m+    println!(
[m[32m+        "  Average: {} µs ({:.3} ms)",
[m         avg_warm_acquisition_us,
[31m-        avg_warm_acquisition_us as f64 / 1000.0);
[m[32m+        avg_warm_acquisition_us as f64 / 1000.0
[m[32m+    );
[m     println!("  Min: {} µs", acquisition_times.iter().min().unwrap());
     println!("  Max: {} µs", acquisition_times.iter().max().unwrap());
 
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:438:
     );
 
     println!("\n✅ Warm connection pool validated");
[31m-    println!("   Benefit: Immediate availability for {} connections",
[m[31m-        thresholds::ML_TRAINING_MIN_CONN);
[m[32m+    println!(
[m[32m+        "   Benefit: Immediate availability for {} connections",
[m[32m+        thresholds::ML_TRAINING_MIN_CONN
[m[32m+    );
[m }
 
 /// Test statement cache capacity (500 capacity)
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:448:
     println!("\n=== Statement Cache Capacity Test ===\n");
     println!("Target Capacity: {}", thresholds::STATEMENT_CACHE_CAPACITY);
     println!("Previous Capacity: 100 (Wave 67 improvement)");
[31m-    println!("Improvement: {}x increase\n",
[m[31m-        thresholds::STATEMENT_CACHE_CAPACITY / 100);
[m[32m+    println!(
[m[32m+        "Improvement: {}x increase\n",
[m[32m+        thresholds::STATEMENT_CACHE_CAPACITY / 100
[m[32m+    );
[m 
     // Note: Statement cache is configured at the SQLx pool level
     // This test validates the configuration target
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:457:
     // The statement cache would be set in PgPoolOptions:
     // .statement_cache_capacity(500)
 
[31m-    assert_eq!(thresholds::STATEMENT_CACHE_CAPACITY, 500,
[m[31m-        "Statement cache capacity should be 500");
[m[32m+    assert_eq!(
[m[32m+        thresholds::STATEMENT_CACHE_CAPACITY,
[m[32m+        500,
[m[32m+        "Statement cache capacity should be 500"
[m[32m+    );
[m 
     println!("Statement Cache Benefits:");
     println!("  ✅ Reduced query preparation overhead");
Diff in /home/jgrusewski/Work/foxhunt/tests/database_pool_performance.rs:478:
 
     // Test different configurations
     let configurations = vec![
[31m-        ("Old Config (10 max, 1 min, 30s timeout)", PoolConfig {
[m[31m-            min_connections: 1,
[m[31m-            max_connections: 10,
[m[31m-            acquire_timeout_secs: 30,
[m[31m-            max_lifetime_secs: 1800,
[m[31m-            idle_timeout_secs: 600,
[m[31m-            test_before_acquire: true,
[m[31m-            database_url: database_url.clone(),
[m[31m-            health_check_enabled: false,
[m[31m-            health_check_interval_secs: 60,
[m[31m-        }),
[m[31m-        ("New Config (20 max, 5 min, 5s timeout)", PoolConfig {
[m[31m-            min_connections: 5,
[m[31m-            max_connections: 20,
[m[31m-            acquire_timeout_secs: 5,
[m[31m-            max_lifetime_secs: 7200,
[m[31m-            idle_timeout_secs: 900,
[m[31m-            test_before_acquire: true,
[m[31m-            database_url: database_url.clone(),
[m[31m-            health_check_enabled: false,
[m[31m-            health_check_interval_secs: 60,
[m[31m-        }),
[m[32m+        (
[m[32m+            "Old Config (10 max, 1 min, 30s timeout)",
[m[32m+            PoolConfig {
[m[32m+                min_connections: 1,
[m[32m+                max_connections: 10,
[m[32m+                acquire_timeout_secs: 30,
[m[32m+                max_lifetime_secs: 1800,
[m[32m+                idle_timeout_secs: 600,
[m[32m+                test_before_acquire: true,
[m[32m+                database_url: database_url.clone(),
[m[32m+                health_check_enabled: false,
[m[32m+                health_check_interval_secs: 60,
[m[32m+            },
[m[32m+        ),
[m[32m+        (
[m[32m+            "New Config (20 max, 5 min, 5s timeout)",
[m[32m+            PoolConfig {
[m[32m+                min_connections: 5,
[m[32m+                max_connections: 20,
[m[32m+                acquire_timeout_secs: 5,
[m[32m+                max_lifetime_secs: 7200,
[m[32m+                idle_timeout_secs: 900,
[m[32m+                test_before_acquire: true,
[m[32m+                database_url: database_url.clone(),
[m[32m+                health_check_enabled: false,
[m[32m+                health_check_interval_secs: 60,
[m[32m+            },
[m[32m+        ),
[m     ];
 
     for (name, config) in configurations {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/benches/e2e_latency_benchmark.rs:34:
         let start = Instant::now();
 
         // Phase 1: TLI creates order request (serialization)
[31m-        let order_id = self.order_counter.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
[m[32m+        let order_id = self
[m[32m+            .order_counter
[m[32m+            .fetch_add(1, std::sync::atomic::Ordering::Relaxed);
[m         let _order = Self::create_order(order_id);
 
         // Phase 2: gRPC call to API Gateway (network + serialization)
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/benches/e2e_latency_benchmark.rs:114:
                         let mut handles = vec![];
                         for _ in 0..n {
                             let client_clone = client.clone();
[31m-                            let handle = tokio::spawn(async move {
[m[31m-                                client_clone.submit_order().await
[m[31m-                            });
[m[32m+                            let handle =
[m[32m+                                tokio::spawn(async move { client_clone.submit_order().await });
[m                             handles.push(handle);
                         }
                         for handle in handles {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/benches/e2e_latency_benchmark.rs:294:
                         // Submit burst of orders simultaneously
                         for _ in 0..n {
                             let client_clone = client.clone();
[31m-                            let handle = tokio::spawn(async move {
[m[31m-                                client_clone.submit_order().await
[m[31m-                            });
[m[32m+                            let handle =
[m[32m+                                tokio::spawn(async move { client_clone.submit_order().await });
[m                             handles.push(handle);
                         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/benches/e2e_latency_benchmark.rs:308:
                         }
 
                         if n >= 1000 {
[31m-                            println!("Burst {} orders - Max latency: {:.2}μs", n, max_latency.as_micros());
[m[32m+                            println!(
[m[32m+                                "Burst {} orders - Max latency: {:.2}μs",
[m[32m+                                n,
[m[32m+                                max_latency.as_micros()
[m[32m+                            );
[m                         }
                     });
                     start.elapsed()
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/build.rs:32:
         .out_dir("src/proto")
         .server_mod_attribute(".", "#[allow(unused_qualifications)]")
         .client_mod_attribute(".", "#[allow(unused_qualifications)]")
[31m-        .compile_protos(
[m[31m-            &["../../tli/proto/trading.proto"],
[m[31m-            &["../../tli/proto"],
[m[31m-        )?;
[m[32m+        .compile_protos(&["../../tli/proto/trading.proto"], &["../../tli/proto"])?;
[m 
     println!("cargo:rerun-if-changed=../../services/");
     Ok(())
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:553:
         dead_code,
         missing_docs,
         clippy::wildcard_imports,
[31m-        clippy::let_unit_value,
[m[32m+        clippy::let_unit_value
[m     )]
[31m-    use tonic::codegen::*;
[m     use tonic::codegen::http::Uri;
[32m+    use tonic::codegen::*;
[m     /// Configuration Service provides centralized, PostgreSQL-based configuration management with hot-reload capabilities.
     /// This service supports real-time configuration updates, validation, history tracking, and import/export functionality
     /// for all trading system components with comprehensive audit trails and rollback capabilities.
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:603:
                     <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                 >,
             >,
[31m-            <T as tonic::codegen::Service<
[m[31m-                http::Request<tonic::body::Body>,
[m[31m-            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
[m[32m+            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
[m[32m+                Into<StdError> + std::marker::Send + std::marker::Sync,
[m         {
             ConfigServiceClient::new(InterceptedService::new(inner, interceptor))
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:645:
         pub async fn get_configuration(
             &mut self,
             request: impl tonic::IntoRequest<super::GetConfigurationRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetConfigurationResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetConfigurationResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/GetConfiguration",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/GetConfiguration");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("config.ConfigService", "GetConfiguration"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:670:
         pub async fn update_configuration(
             &mut self,
             request: impl tonic::IntoRequest<super::UpdateConfigurationRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::UpdateConfigurationResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::UpdateConfigurationResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/UpdateConfiguration",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/UpdateConfiguration");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("config.ConfigService", "UpdateConfiguration"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "UpdateConfiguration",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Delete configuration setting with audit trail
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:695:
         pub async fn delete_configuration(
             &mut self,
             request: impl tonic::IntoRequest<super::DeleteConfigurationRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::DeleteConfigurationResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::DeleteConfigurationResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/DeleteConfiguration",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/DeleteConfiguration");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("config.ConfigService", "DeleteConfiguration"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "DeleteConfiguration",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// List available configuration categories
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:720:
         pub async fn list_categories(
             &mut self,
             request: impl tonic::IntoRequest<super::ListCategoriesRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ListCategoriesResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ListCategoriesResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/ListCategories",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/config.ConfigService/ListCategories");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("config.ConfigService", "ListCategories"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:750:
             tonic::Response<tonic::codec::Streaming<super::ConfigChangeEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/StreamConfigChanges",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/StreamConfigChanges");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("config.ConfigService", "StreamConfigChanges"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "StreamConfigChanges",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Configuration Management Operations
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:772:
         pub async fn validate_configuration(
             &mut self,
             request: impl tonic::IntoRequest<super::ValidateConfigurationRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ValidateConfigurationResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ValidateConfigurationResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/ValidateConfiguration",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/ValidateConfiguration");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("config.ConfigService", "ValidateConfiguration"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "ValidateConfiguration",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get configuration change history with audit details
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:803:
             tonic::Response<super::GetConfigurationHistoryResponse>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/config.ConfigService/GetConfigurationHistory",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:817:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("config.ConfigService", "GetConfigurationHistory"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "GetConfigurationHistory",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Rollback configuration to previous value
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:826:
         pub async fn rollback_configuration(
             &mut self,
             request: impl tonic::IntoRequest<super::RollbackConfigurationRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::RollbackConfigurationResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::RollbackConfigurationResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/RollbackConfiguration",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/RollbackConfiguration");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("config.ConfigService", "RollbackConfiguration"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "RollbackConfiguration",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Export configuration data in various formats
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:853:
         pub async fn export_configuration(
             &mut self,
             request: impl tonic::IntoRequest<super::ExportConfigurationRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ExportConfigurationResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ExportConfigurationResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/ExportConfiguration",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/ExportConfiguration");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("config.ConfigService", "ExportConfiguration"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "ExportConfiguration",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Import configuration data with validation
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:878:
         pub async fn import_configuration(
             &mut self,
             request: impl tonic::IntoRequest<super::ImportConfigurationRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ImportConfigurationResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ImportConfigurationResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/ImportConfiguration",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/ImportConfiguration");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("config.ConfigService", "ImportConfiguration"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "ImportConfiguration",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Schema Management Operations
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:904:
         pub async fn get_config_schema(
             &mut self,
             request: impl tonic::IntoRequest<super::GetConfigSchemaRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetConfigSchemaResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetConfigSchemaResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/GetConfigSchema",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/GetConfigSchema");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("config.ConfigService", "GetConfigSchema"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/config.rs:929:
         pub async fn update_config_schema(
             &mut self,
             request: impl tonic::IntoRequest<super::UpdateConfigSchemaRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::UpdateConfigSchemaResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::UpdateConfigSchemaResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/config.ConfigService/UpdateConfigSchema",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/config.ConfigService/UpdateConfigSchema");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("config.ConfigService", "UpdateConfigSchema"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "config.ConfigService",
[m[32m+                "UpdateConfigSchema",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:286:
     #[prost(string, tag = "3")]
     pub unit: ::prost::alloc::string::String,
     #[prost(map = "string, string", tag = "4")]
[31m-    pub labels: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub labels:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m     #[prost(int64, tag = "5")]
     pub timestamp_unix_nanos: i64,
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:367:
 #[derive(Clone, PartialEq, ::prost::Message)]
 pub struct UpdateParametersRequest {
     #[prost(map = "string, string", tag = "1")]
[31m-    pub parameters: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub parameters:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m     #[prost(bool, tag = "2")]
     pub persist: bool,
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:392:
 #[derive(Clone, PartialEq, ::prost::Message)]
 pub struct GetConfigResponse {
     #[prost(map = "string, string", tag = "1")]
[31m-    pub config: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub config:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m     #[prost(int64, tag = "2")]
     pub version: i64,
     #[prost(int64, tag = "3")]
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:444:
     #[prost(int64, tag = "4")]
     pub last_check_unix_nanos: i64,
     #[prost(map = "string, string", tag = "5")]
[31m-    pub details: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub details:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m }
 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
 pub struct SubscribeSystemStatusRequest {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:673:
     #[prost(double, tag = "5")]
     pub initial_capital: f64,
     #[prost(map = "string, string", tag = "6")]
[31m-    pub parameters: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub parameters:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m     #[prost(bool, tag = "7")]
     pub save_results: bool,
     #[prost(string, tag = "8")]
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1143:
             "VAR_METHODOLOGY_HISTORICAL" => Some(Self::VarMethodologyHistorical),
             "VAR_METHODOLOGY_MONTE_CARLO" => Some(Self::VarMethodologyMonteCarlo),
             "VAR_METHODOLOGY_PARAMETRIC" => Some(Self::VarMethodologyParametric),
[31m-            "VAR_METHODOLOGY_EXPECTED_SHORTFALL" => {
[m[31m-                Some(Self::VarMethodologyExpectedShortfall)
[m[31m-            }
[m[32m+            "VAR_METHODOLOGY_EXPECTED_SHORTFALL" => Some(Self::VarMethodologyExpectedShortfall),
[m             _ => None,
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1339:
         dead_code,
         missing_docs,
         clippy::wildcard_imports,
[31m-        clippy::let_unit_value,
[m[32m+        clippy::let_unit_value
[m     )]
[31m-    use tonic::codegen::*;
[m     use tonic::codegen::http::Uri;
[32m+    use tonic::codegen::*;
[m     /// TLI Trading Service provides a unified client interface for all HFT trading operations.
     /// This service integrates trading, risk management, monitoring, and configuration capabilities
     /// into a single comprehensive API for the Terminal Line Interface (TLI) client application.
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1389:
                     <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                 >,
             >,
[31m-            <T as tonic::codegen::Service<
[m[31m-                http::Request<tonic::body::Body>,
[m[31m-            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
[m[32m+            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
[m[32m+                Into<StdError> + std::marker::Send + std::marker::Sync,
[m         {
             TradingServiceClient::new(InterceptedService::new(inner, interceptor))
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1431:
         pub async fn submit_order(
             &mut self,
             request: impl tonic::IntoRequest<super::SubmitOrderRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::SubmitOrderResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::SubmitOrderResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/SubmitOrder",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/SubmitOrder");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("foxhunt.tli.TradingService", "SubmitOrder"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1456:
         pub async fn cancel_order(
             &mut self,
             request: impl tonic::IntoRequest<super::CancelOrderRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::CancelOrderResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::CancelOrderResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/CancelOrder",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/CancelOrder");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("foxhunt.tli.TradingService", "CancelOrder"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1481:
         pub async fn get_order_status(
             &mut self,
             request: impl tonic::IntoRequest<super::GetOrderStatusRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetOrderStatusResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetOrderStatusResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetOrderStatus",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetOrderStatus");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetOrderStatus"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "GetOrderStatus",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get account information and balances
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1506:
         pub async fn get_account_info(
             &mut self,
             request: impl tonic::IntoRequest<super::GetAccountInfoRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetAccountInfoResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetAccountInfoResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetAccountInfo",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetAccountInfo");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetAccountInfo"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "GetAccountInfo",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get current portfolio positions
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1531:
         pub async fn get_positions(
             &mut self,
             request: impl tonic::IntoRequest<super::GetPositionsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetPositionsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetPositionsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetPositions",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetPositions");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetPositions"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "GetPositions",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Subscribe to real-time market data feeds
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1560:
             tonic::Response<tonic::codec::Streaming<super::MarketDataEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.TradingService/SubscribeMarketData",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1574:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.TradingService", "SubscribeMarketData"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "SubscribeMarketData",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Subscribe to real-time order status updates
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1587:
             tonic::Response<tonic::codec::Streaming<super::OrderUpdateEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.TradingService/SubscribeOrderUpdates",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1601:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new(
[m[31m-                        "foxhunt.tli.TradingService",
[m[31m-                        "SubscribeOrderUpdates",
[m[31m-                    ),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "SubscribeOrderUpdates",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Integrated Risk Management
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1615:
             &mut self,
             request: impl tonic::IntoRequest<super::GetVaRRequest>,
         ) -> std::result::Result<tonic::Response<super::GetVaRResponse>, tonic::Status> {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetVaR",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetVaR");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetVaR"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1636:
         pub async fn get_position_risk(
             &mut self,
             request: impl tonic::IntoRequest<super::GetPositionRiskRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetPositionRiskResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetPositionRiskResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetPositionRisk",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetPositionRisk");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.TradingService", "GetPositionRisk"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "GetPositionRisk",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Validate order against risk limits before submission
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1663:
         pub async fn validate_order(
             &mut self,
             request: impl tonic::IntoRequest<super::ValidateOrderRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ValidateOrderResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ValidateOrderResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/ValidateOrder",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/ValidateOrder");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("foxhunt.tli.TradingService", "ValidateOrder"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "ValidateOrder",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get comprehensive portfolio risk metrics
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1688:
         pub async fn get_risk_metrics(
             &mut self,
             request: impl tonic::IntoRequest<super::GetRiskMetricsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetRiskMetricsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetRiskMetricsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetRiskMetrics",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetRiskMetrics");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetRiskMetrics"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "GetRiskMetrics",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Subscribe to real-time risk alerts and violations
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1717:
             tonic::Response<tonic::codec::Streaming<super::RiskAlertEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.TradingService/SubscribeRiskAlerts",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1731:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.TradingService", "SubscribeRiskAlerts"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "SubscribeRiskAlerts",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Emergency stop with immediate trading halt
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1740:
         pub async fn emergency_stop(
             &mut self,
             request: impl tonic::IntoRequest<super::EmergencyStopRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::EmergencyStopResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::EmergencyStopResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/EmergencyStop",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/EmergencyStop");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("foxhunt.tli.TradingService", "EmergencyStop"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "EmergencyStop",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Integrated System Monitoring
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1766:
         pub async fn get_metrics(
             &mut self,
             request: impl tonic::IntoRequest<super::GetMetricsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetMetricsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetMetricsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetMetrics",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetMetrics");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetMetrics"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1791:
         pub async fn get_latency(
             &mut self,
             request: impl tonic::IntoRequest<super::GetLatencyRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetLatencyResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetLatencyResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetLatency",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetLatency");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetLatency"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1816:
         pub async fn get_throughput(
             &mut self,
             request: impl tonic::IntoRequest<super::GetThroughputRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetThroughputResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetThroughputResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetThroughput",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetThroughput");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetThroughput"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "GetThroughput",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Subscribe to real-time performance metrics
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1845:
             tonic::Response<tonic::codec::Streaming<super::MetricsEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.TradingService/SubscribeMetrics",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1859:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.TradingService", "SubscribeMetrics"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "SubscribeMetrics",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Integrated Configuration Management
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1869:
         pub async fn update_parameters(
             &mut self,
             request: impl tonic::IntoRequest<super::UpdateParametersRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::UpdateParametersResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::UpdateParametersResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.TradingService/UpdateParameters",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1887:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.TradingService", "UpdateParameters"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "UpdateParameters",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get current configuration values
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1896:
         pub async fn get_config(
             &mut self,
             request: impl tonic::IntoRequest<super::GetConfigRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetConfigResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetConfigResponse>, tonic::Status> {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetConfig",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetConfig");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("foxhunt.tli.TradingService", "GetConfig"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1925:
             tonic::Response<tonic::codec::Streaming<super::ConfigEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/SubscribeConfig",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/SubscribeConfig");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.TradingService", "SubscribeConfig"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "SubscribeConfig",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Integrated System Health Monitoring
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1949:
         pub async fn get_system_status(
             &mut self,
             request: impl tonic::IntoRequest<super::GetSystemStatusRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetSystemStatusResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetSystemStatusResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/foxhunt.tli.TradingService/GetSystemStatus",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/foxhunt.tli.TradingService/GetSystemStatus");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.TradingService", "GetSystemStatus"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "GetSystemStatus",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Subscribe to system status changes and alerts
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1980:
             tonic::Response<tonic::codec::Streaming<super::SystemStatusEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.TradingService/SubscribeSystemStatus",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:1994:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new(
[m[31m-                        "foxhunt.tli.TradingService",
[m[31m-                        "SubscribeSystemStatus",
[m[31m-                    ),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.TradingService",
[m[32m+                "SubscribeSystemStatus",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2012:
         dead_code,
         missing_docs,
         clippy::wildcard_imports,
[31m-        clippy::let_unit_value,
[m[32m+        clippy::let_unit_value
[m     )]
[31m-    use tonic::codegen::*;
[m     use tonic::codegen::http::Uri;
[32m+    use tonic::codegen::*;
[m     /// Backtesting Service provides comprehensive strategy backtesting capabilities for the TLI.
     /// This service allows users to test trading strategies against historical data with detailed
     /// performance analytics, risk metrics, and trade-by-trade analysis.
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2062:
                     <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                 >,
             >,
[31m-            <T as tonic::codegen::Service<
[m[31m-                http::Request<tonic::body::Body>,
[m[31m-            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
[m[32m+            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
[m[32m+                Into<StdError> + std::marker::Send + std::marker::Sync,
[m         {
             BacktestingServiceClient::new(InterceptedService::new(inner, interceptor))
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2104:
         pub async fn start_backtest(
             &mut self,
             request: impl tonic::IntoRequest<super::StartBacktestRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::StartBacktestResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::StartBacktestResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.BacktestingService/StartBacktest",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2122:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.BacktestingService", "StartBacktest"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.BacktestingService",
[m[32m+                "StartBacktest",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get current status of a running backtest
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2131:
         pub async fn get_backtest_status(
             &mut self,
             request: impl tonic::IntoRequest<super::GetBacktestStatusRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetBacktestStatusResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetBacktestStatusResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.BacktestingService/GetBacktestStatus",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2149:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new(
[m[31m-                        "foxhunt.tli.BacktestingService",
[m[31m-                        "GetBacktestStatus",
[m[31m-                    ),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.BacktestingService",
[m[32m+                "GetBacktestStatus",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get comprehensive backtest results and analytics
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2161:
         pub async fn get_backtest_results(
             &mut self,
             request: impl tonic::IntoRequest<super::GetBacktestResultsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetBacktestResultsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetBacktestResultsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.BacktestingService/GetBacktestResults",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2179:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new(
[m[31m-                        "foxhunt.tli.BacktestingService",
[m[31m-                        "GetBacktestResults",
[m[31m-                    ),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.BacktestingService",
[m[32m+                "GetBacktestResults",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// List historical backtest runs with filtering
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2191:
         pub async fn list_backtests(
             &mut self,
             request: impl tonic::IntoRequest<super::ListBacktestsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ListBacktestsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ListBacktestsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.BacktestingService/ListBacktests",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2209:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.BacktestingService", "ListBacktests"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.BacktestingService",
[m[32m+                "ListBacktests",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Subscribe to real-time backtest progress updates
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2222:
             tonic::Response<tonic::codec::Streaming<super::BacktestProgressEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.BacktestingService/SubscribeBacktestProgress",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2236:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new(
[m[31m-                        "foxhunt.tli.BacktestingService",
[m[31m-                        "SubscribeBacktestProgress",
[m[31m-                    ),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.BacktestingService",
[m[32m+                "SubscribeBacktestProgress",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Stop a running backtest and optionally save partial results
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2248:
         pub async fn stop_backtest(
             &mut self,
             request: impl tonic::IntoRequest<super::StopBacktestRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::StopBacktestResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::StopBacktestResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/foxhunt.tli.BacktestingService/StopBacktest",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/foxhunt.tli.rs:2266:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("foxhunt.tli.BacktestingService", "StopBacktest"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "foxhunt.tli.BacktestingService",
[m[32m+                "StopBacktest",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:19:
     pub description: ::prost::alloc::string::String,
     /// Optional categorization tags
     #[prost(map = "string, string", tag = "6")]
[31m-    pub tags: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub tags:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m }
 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
 pub struct StartTrainingResponse {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:141:
     #[prost(string, tag = "2")]
     pub message: ::prost::alloc::string::String,
     #[prost(map = "string, string", tag = "3")]
[31m-    pub details: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub details:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m }
 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
 pub struct DataSource {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:366:
     #[prost(float, tag = "9")]
     pub best_validation_score: f32,
     #[prost(map = "string, string", tag = "10")]
[31m-    pub tags: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub tags:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m }
 #[derive(Clone, PartialEq, ::prost::Message)]
 pub struct TrainingJobDetails {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:401:
     #[prost(string, tag = "12")]
     pub model_artifact_path: ::prost::alloc::string::String,
     #[prost(map = "string, string", tag = "13")]
[31m-    pub tags: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub tags:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m     #[prost(string, tag = "14")]
     pub error_message: ::prost::alloc::string::String,
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:497:
         dead_code,
         missing_docs,
         clippy::wildcard_imports,
[31m-        clippy::let_unit_value,
[m[32m+        clippy::let_unit_value
[m     )]
[31m-    use tonic::codegen::*;
[m     use tonic::codegen::http::Uri;
[32m+    use tonic::codegen::*;
[m     /// ML Training Service provides comprehensive machine learning model training capabilities for HFT systems.
     /// This service manages training jobs for MAMBA-2, TLOB transformers, DQN, PPO, Liquid Networks, and TFT models
     /// with real-time progress monitoring, resource management, and performance tracking.
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:547:
                     <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                 >,
             >,
[31m-            <T as tonic::codegen::Service<
[m[31m-                http::Request<tonic::body::Body>,
[m[31m-            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
[m[32m+            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
[m[32m+                Into<StdError> + std::marker::Send + std::marker::Sync,
[m         {
             MlTrainingServiceClient::new(InterceptedService::new(inner, interceptor))
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:589:
         pub async fn start_training(
             &mut self,
             request: impl tonic::IntoRequest<super::StartTrainingRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::StartTrainingResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::StartTrainingResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/ml_training.MLTrainingService/StartTraining",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:607:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("ml_training.MLTrainingService", "StartTraining"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "ml_training.MLTrainingService",
[m[32m+                "StartTraining",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Subscribe to real-time training progress and status updates
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:620:
             tonic::Response<tonic::codec::Streaming<super::TrainingStatusUpdate>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/ml_training.MLTrainingService/SubscribeToTrainingStatus",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:634:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new(
[m[31m-                        "ml_training.MLTrainingService",
[m[31m-                        "SubscribeToTrainingStatus",
[m[31m-                    ),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "ml_training.MLTrainingService",
[m[32m+                "SubscribeToTrainingStatus",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Stop a running training job (idempotent operation)
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:646:
         pub async fn stop_training(
             &mut self,
             request: impl tonic::IntoRequest<super::StopTrainingRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::StopTrainingResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::StopTrainingResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/ml_training.MLTrainingService/StopTraining",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/ml_training.MLTrainingService/StopTraining");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("ml_training.MLTrainingService", "StopTraining"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "ml_training.MLTrainingService",
[m[32m+                "StopTraining",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Model and Job Discovery
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:674:
         pub async fn list_available_models(
             &mut self,
             request: impl tonic::IntoRequest<super::ListAvailableModelsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ListAvailableModelsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ListAvailableModelsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/ml_training.MLTrainingService/ListAvailableModels",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:692:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new(
[m[31m-                        "ml_training.MLTrainingService",
[m[31m-                        "ListAvailableModels",
[m[31m-                    ),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "ml_training.MLTrainingService",
[m[32m+                "ListAvailableModels",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get paginated list of training job history
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:704:
         pub async fn list_training_jobs(
             &mut self,
             request: impl tonic::IntoRequest<super::ListTrainingJobsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ListTrainingJobsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ListTrainingJobsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/ml_training.MLTrainingService/ListTrainingJobs",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:722:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("ml_training.MLTrainingService", "ListTrainingJobs"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "ml_training.MLTrainingService",
[m[32m+                "ListTrainingJobs",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Get comprehensive details for a specific training job
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:731:
         pub async fn get_training_job_details(
             &mut self,
             request: impl tonic::IntoRequest<super::GetTrainingJobDetailsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetTrainingJobDetailsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetTrainingJobDetailsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static(
                 "/ml_training.MLTrainingService/GetTrainingJobDetails",
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:749:
             );
             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new(
[m[31m-                        "ml_training.MLTrainingService",
[m[31m-                        "GetTrainingJobDetails",
[m[31m-                    ),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "ml_training.MLTrainingService",
[m[32m+                "GetTrainingJobDetails",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Service Health and Status
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/ml_training.rs:762:
         pub async fn health_check(
             &mut self,
             request: impl tonic::IntoRequest<super::HealthCheckRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::HealthCheckResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::HealthCheckResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/ml_training.MLTrainingService/HealthCheck",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/ml_training.MLTrainingService/HealthCheck");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("ml_training.MLTrainingService", "HealthCheck"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "ml_training.MLTrainingService",
[m[32m+                "HealthCheck",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:325:
     #[prost(string, optional, tag = "6")]
     pub account_id: ::core::option::Option<::prost::alloc::string::String>,
     #[prost(map = "string, string", tag = "7")]
[31m-    pub metadata: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub metadata:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m     #[prost(int64, tag = "8")]
     pub timestamp: i64,
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:657:
         dead_code,
         missing_docs,
         clippy::wildcard_imports,
[31m-        clippy::let_unit_value,
[m[32m+        clippy::let_unit_value
[m     )]
[31m-    use tonic::codegen::*;
[m     use tonic::codegen::http::Uri;
[32m+    use tonic::codegen::*;
[m     /// Risk Management Service provides comprehensive risk assessment, monitoring, and control capabilities
     /// for high-frequency trading operations. This service integrates real-time VaR calculations,
     /// position risk analysis, compliance monitoring, and emergency controls.
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:707:
                     <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                 >,
             >,
[31m-            <T as tonic::codegen::Service<
[m[31m-                http::Request<tonic::body::Body>,
[m[31m-            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
[m[32m+            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
[m[32m+                Into<StdError> + std::marker::Send + std::marker::Sync,
[m         {
             RiskServiceClient::new(InterceptedService::new(inner, interceptor))
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:750:
             &mut self,
             request: impl tonic::IntoRequest<super::GetVaRRequest>,
         ) -> std::result::Result<tonic::Response<super::GetVaRResponse>, tonic::Status> {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
             let path = http::uri::PathAndQuery::from_static("/risk.RiskService/GetVaR");
             let mut req = request.into_request();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:764:
[31m-            req.extensions_mut().insert(GrpcMethod::new("risk.RiskService", "GetVaR"));
[m[32m+            req.extensions_mut()
[m[32m+                .insert(GrpcMethod::new("risk.RiskService", "GetVaR"));
[m             self.inner.unary(req, path, codec).await
         }
         /// Stream real-time VaR updates as market conditions change
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:772:
             tonic::Response<tonic::codec::Streaming<super::VaREvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/risk.RiskService/StreamVaRUpdates",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/risk.RiskService/StreamVaRUpdates");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("risk.RiskService", "StreamVaRUpdates"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:794:
         pub async fn get_position_risk(
             &mut self,
             request: impl tonic::IntoRequest<super::GetPositionRiskRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetPositionRiskResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetPositionRiskResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/risk.RiskService/GetPositionRisk",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/risk.RiskService/GetPositionRisk");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("risk.RiskService", "GetPositionRisk"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:819:
         pub async fn validate_order(
             &mut self,
             request: impl tonic::IntoRequest<super::ValidateOrderRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::ValidateOrderResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::ValidateOrderResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/risk.RiskService/ValidateOrder",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/risk.RiskService/ValidateOrder");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("risk.RiskService", "ValidateOrder"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:845:
         pub async fn get_risk_metrics(
             &mut self,
             request: impl tonic::IntoRequest<super::GetRiskMetricsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetRiskMetricsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetRiskMetricsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/risk.RiskService/GetRiskMetrics",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/risk.RiskService/GetRiskMetrics");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("risk.RiskService", "GetRiskMetrics"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:874:
             tonic::Response<tonic::codec::Streaming<super::RiskAlertEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/risk.RiskService/StreamRiskAlerts",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/risk.RiskService/StreamRiskAlerts");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("risk.RiskService", "StreamRiskAlerts"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:896:
         pub async fn emergency_stop(
             &mut self,
             request: impl tonic::IntoRequest<super::EmergencyStopRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::EmergencyStopResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::EmergencyStopResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/risk.RiskService/EmergencyStop",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/risk.RiskService/EmergencyStop");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("risk.RiskService", "EmergencyStop"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/risk.rs:925:
             tonic::Response<super::GetCircuitBreakerStatusResponse>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/risk.RiskService/GetCircuitBreakerStatus",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/risk.RiskService/GetCircuitBreakerStatus");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("risk.RiskService", "GetCircuitBreakerStatus"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "risk.RiskService",
[m[32m+                "GetCircuitBreakerStatus",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:25:
     pub account_id: ::prost::alloc::string::String,
     /// Additional order metadata (strategy, tags, etc.)
     #[prost(map = "string, string", tag = "8")]
[31m-    pub metadata: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub metadata:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m }
 /// Response after submitting an order
 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:253:
     pub account_id: ::prost::alloc::string::String,
     /// Additional order metadata
     #[prost(map = "string, string", tag = "13")]
[31m-    pub metadata: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub metadata:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m }
 /// Current position information for a symbol
 #[derive(Clone, PartialEq, ::prost::Message)]
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:315:
     pub account_id: ::prost::alloc::string::String,
     /// Additional execution metadata
     #[prost(map = "string, string", tag = "9")]
[31m-    pub metadata: ::std::collections::HashMap<
[m[31m-        ::prost::alloc::string::String,
[m[31m-        ::prost::alloc::string::String,
[m[31m-    >,
[m[32m+    pub metadata:
[m[32m+        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
[m }
 /// Order book snapshot for a symbol
 #[derive(Clone, PartialEq, ::prost::Message)]
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:734:
         dead_code,
         missing_docs,
         clippy::wildcard_imports,
[31m-        clippy::let_unit_value,
[m[32m+        clippy::let_unit_value
[m     )]
[31m-    use tonic::codegen::*;
[m     use tonic::codegen::http::Uri;
[32m+    use tonic::codegen::*;
[m     /// Trading Service provides comprehensive real-time trading operations for high-frequency trading.
     /// This service handles order management, position tracking, market data streaming, and execution monitoring.
     /// All operations are designed for ultra-low latency with microsecond precision timing.
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:784:
                     <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                 >,
             >,
[31m-            <T as tonic::codegen::Service<
[m[31m-                http::Request<tonic::body::Body>,
[m[31m-            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
[m[32m+            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
[m[32m+                Into<StdError> + std::marker::Send + std::marker::Sync,
[m         {
             TradingServiceClient::new(InterceptedService::new(inner, interceptor))
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:826:
         pub async fn submit_order(
             &mut self,
             request: impl tonic::IntoRequest<super::SubmitOrderRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::SubmitOrderResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::SubmitOrderResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/SubmitOrder",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/trading.TradingService/SubmitOrder");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("trading.TradingService", "SubmitOrder"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:851:
         pub async fn cancel_order(
             &mut self,
             request: impl tonic::IntoRequest<super::CancelOrderRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::CancelOrderResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::CancelOrderResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/CancelOrder",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/trading.TradingService/CancelOrder");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("trading.TradingService", "CancelOrder"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:876:
         pub async fn get_order_status(
             &mut self,
             request: impl tonic::IntoRequest<super::GetOrderStatusRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetOrderStatusResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetOrderStatusResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/GetOrderStatus",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/trading.TradingService/GetOrderStatus");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("trading.TradingService", "GetOrderStatus"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:905:
             tonic::Response<tonic::codec::Streaming<super::OrderEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/StreamOrders",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/trading.TradingService/StreamOrders");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("trading.TradingService", "StreamOrders"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:927:
         pub async fn get_positions(
             &mut self,
             request: impl tonic::IntoRequest<super::GetPositionsRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetPositionsResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetPositionsResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/GetPositions",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/trading.TradingService/GetPositions");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("trading.TradingService", "GetPositions"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:956:
             tonic::Response<tonic::codec::Streaming<super::PositionEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/StreamPositions",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/trading.TradingService/StreamPositions");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("trading.TradingService", "StreamPositions"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:977:
         pub async fn get_portfolio_summary(
             &mut self,
             request: impl tonic::IntoRequest<super::GetPortfolioSummaryRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetPortfolioSummaryResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetPortfolioSummaryResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/GetPortfolioSummary",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/trading.TradingService/GetPortfolioSummary");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("trading.TradingService", "GetPortfolioSummary"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "trading.TradingService",
[m[32m+                "GetPortfolioSummary",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
         /// Market Data Operations
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:1009:
             tonic::Response<tonic::codec::Streaming<super::MarketDataEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/StreamMarketData",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/trading.TradingService/StreamMarketData");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("trading.TradingService", "StreamMarketData"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "trading.TradingService",
[m[32m+                "StreamMarketData",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Get current order book snapshot for a symbol
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:1030:
         pub async fn get_order_book(
             &mut self,
             request: impl tonic::IntoRequest<super::GetOrderBookRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetOrderBookResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetOrderBookResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/GetOrderBook",
[m[31m-            );
[m[32m+            let path = http::uri::PathAndQuery::from_static("/trading.TradingService/GetOrderBook");
[m             let mut req = request.into_request();
             req.extensions_mut()
                 .insert(GrpcMethod::new("trading.TradingService", "GetOrderBook"));
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:1060:
             tonic::Response<tonic::codec::Streaming<super::ExecutionEvent>>,
             tonic::Status,
         > {
[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/StreamExecutions",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/trading.TradingService/StreamExecutions");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(GrpcMethod::new("trading.TradingService", "StreamExecutions"));
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "trading.TradingService",
[m[32m+                "StreamExecutions",
[m[32m+            ));
[m             self.inner.server_streaming(req, path, codec).await
         }
         /// Get historical execution data with filtering options
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/proto/trading.rs:1081:
         pub async fn get_execution_history(
             &mut self,
             request: impl tonic::IntoRequest<super::GetExecutionHistoryRequest>,
[31m-        ) -> std::result::Result<
[m[31m-            tonic::Response<super::GetExecutionHistoryResponse>,
[m[31m-            tonic::Status,
[m[31m-        > {
[m[31m-            self.inner
[m[31m-                .ready()
[m[31m-                .await
[m[31m-                .map_err(|e| {
[m[31m-                    tonic::Status::unknown(
[m[31m-                        format!("Service was not ready: {}", e.into()),
[m[31m-                    )
[m[31m-                })?;
[m[32m+        ) -> std::result::Result<tonic::Response<super::GetExecutionHistoryResponse>, tonic::Status>
[m[32m+        {
[m[32m+            self.inner.ready().await.map_err(|e| {
[m[32m+                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
[m[32m+            })?;
[m             let codec = tonic_prost::ProstCodec::default();
[31m-            let path = http::uri::PathAndQuery::from_static(
[m[31m-                "/trading.TradingService/GetExecutionHistory",
[m[31m-            );
[m[32m+            let path =
[m[32m+                http::uri::PathAndQuery::from_static("/trading.TradingService/GetExecutionHistory");
[m             let mut req = request.into_request();
[31m-            req.extensions_mut()
[m[31m-                .insert(
[m[31m-                    GrpcMethod::new("trading.TradingService", "GetExecutionHistory"),
[m[31m-                );
[m[32m+            req.extensions_mut().insert(GrpcMethod::new(
[m[32m+                "trading.TradingService",
[m[32m+                "GetExecutionHistory",
[m[32m+            ));
[m             self.inner.unary(req, path, codec).await
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/workflows.rs:23:
 
 // Trading service proto types (for TradingWorkflow)
 use crate::proto::trading::{
[31m-    CancelOrderRequest, GetOrderStatusRequest, GetPortfolioSummaryRequest,
[m[31m-    MarketDataType, OrderSide, OrderStatus, OrderType,
[m[31m-    StreamMarketDataRequest, StreamOrdersRequest, SubmitOrderRequest,
[m[32m+    CancelOrderRequest, GetOrderStatusRequest, GetPortfolioSummaryRequest, MarketDataType,
[m[32m+    OrderSide, OrderStatus, OrderType, StreamMarketDataRequest, StreamOrdersRequest,
[m[32m+    SubmitOrderRequest,
[m };
 
 // Backtesting service proto types (for BacktestingWorkflow)
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/workflows.rs:32:
 use crate::proto::backtesting::{
[31m-    GetBacktestResultsRequest, GetBacktestStatusRequest,
[m[31m-    ListBacktestsRequest, StartBacktestRequest, StopBacktestRequest,
[m[31m-    SubscribeBacktestProgressRequest,
[m[32m+    GetBacktestResultsRequest, GetBacktestStatusRequest, ListBacktestsRequest,
[m[32m+    StartBacktestRequest, StopBacktestRequest, SubscribeBacktestProgressRequest,
[m };
 
 // Note: monitoring and risk proto modules are not implemented yet
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/workflows.rs:722:
             },
         };
 
[31m-        match backtest_client.list_backtests(ListBacktestsRequest {
[m[31m-            limit: 100,
[m[31m-            offset: 0,
[m[31m-            status_filter: None,
[m[31m-            strategy_name: None,
[m[31m-        }).await {
[m[32m+        match backtest_client
[m[32m+            .list_backtests(ListBacktestsRequest {
[m[32m+                limit: 100,
[m[32m+                offset: 0,
[m[32m+                status_filter: None,
[m[32m+                strategy_name: None,
[m[32m+            })
[m[32m+            .await
[m[32m+        {
[m             Ok(response) => {
                 let list_response = response.into_inner();
                 info!("Found {} existing backtests", list_response.backtests.len());
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/src/workflows.rs:944:
         }
 
         // Step 7: Verify final list of backtests
[31m-        match backtest_client.list_backtests(ListBacktestsRequest {
[m[31m-            limit: 100,
[m[31m-            offset: 0,
[m[31m-            status_filter: None,
[m[31m-            strategy_name: None,
[m[31m-        }).await {
[m[32m+        match backtest_client
[m[32m+            .list_backtests(ListBacktestsRequest {
[m[32m+                limit: 100,
[m[32m+                offset: 0,
[m[32m+                status_filter: None,
[m[32m+                strategy_name: None,
[m[32m+            })
[m[32m+            .await
[m[32m+        {
[m             Ok(response) => {
                 let list_response = response.into_inner();
                 info!("Final backtest count: {}", list_response.backtests.len());
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:8:
 use std::collections::HashMap;
 use trading_engine::compliance::{
     audit_trails::{
[31m-        AuditEventDetails, AuditEventType, AuditTrailConfig, AuditTrailEngine,
[m[31m-        ExecutionDetails, OrderDetails, RiskLevel, TransactionAuditEvent,
[m[32m+        AuditEventDetails, AuditEventType, AuditTrailConfig, AuditTrailEngine, ExecutionDetails,
[m[32m+        OrderDetails, RiskLevel, TransactionAuditEvent,
[m     },
     best_execution::{BestExecutionAnalyzer, BestExecutionConfig},
     ComplianceConfig, ComplianceContext, ComplianceEngine, OrderInfo,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:71:
     };
 
     let log_result = audit_engine.log_order_created(order_id, &order_details);
[31m-    assert!(
[m[31m-        log_result.is_ok(),
[m[31m-        "Order creation logging should succeed"
[m[31m-    );
[m[32m+    assert!(log_result.is_ok(), "Order creation logging should succeed");
[m 
     // Step 3: Log order execution event
     let execution_details = ExecutionDetails {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:135:
     };
 
     let log_result = audit_engine.log_event(audit_event);
[31m-    assert!(log_result.is_ok(), "Compliance event logging should succeed");
[m[32m+    assert!(
[m[32m+        log_result.is_ok(),
[m[32m+        "Compliance event logging should succeed"
[m[32m+    );
[m 
     // Step 5: Verify compliance tags are present
     // In a real test, we would query the audit trail here
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:211:
             println!("   - Compliance status: {}", analysis.is_compliant);
             println!("   - Execution score: {}", analysis.execution_score);
             println!("   - Cost analysis: {:?}", analysis.cost_analysis);
[31m-        }
[m[32m+        },
[m         Err(e) => {
[31m-            println!("⚠️  Best execution analysis returned error (expected in test env): {}", e);
[m[32m+            println!(
[m[32m+                "⚠️  Best execution analysis returned error (expected in test env): {}",
[m[32m+                e
[m[32m+            );
[m             println!("   - Analyzer created successfully");
             println!("   - Order info validated");
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:393:
         .expect("Multi-regulation assessment should succeed");
 
     println!("✅ Multi-regulation compliance assessment completed");
[31m-    println!("   - Overall compliance score: {}", assessment.compliance_score);
[m[32m+    println!(
[m[32m+        "   - Overall compliance score: {}",
[m[32m+        assessment.compliance_score
[m[32m+    );
[m     println!("   - MiFID II status: {:?}", assessment.mifid2_status);
     println!("   - SOX status: {:?}", assessment.sox_status);
     println!("   - MAR status: {:?}", assessment.mar_status);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:400:
[31m-    println!("   - Data protection status: {:?}", assessment.data_protection_status);
[m[32m+    println!(
[m[32m+        "   - Data protection status: {:?}",
[m[32m+        assessment.data_protection_status
[m[32m+    );
[m     println!("   - Total findings: {}", assessment.findings.len());
 
     // Verify all regulations were evaluated
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:77:
         let mut ml_test = ml_pipeline::MLPipelineTestHarness::new().await?;
 
         // MAMBA test
[31m-        if ml_test.predict_with_mamba(&[feature_vector.clone()]).await.is_ok() {
[m[32m+        if ml_test
[m[32m+            .predict_with_mamba(&[feature_vector.clone()])
[m[32m+            .await
[m[32m+            .is_ok()
[m[32m+        {
[m             info!("✓ MAMBA prediction completed");
             steps_completed += 1;
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:84:
 
         // DQN test
[31m-        if ml_test.predict_with_dqn(&[feature_vector.clone()]).await.is_ok() {
[m[32m+        if ml_test
[m[32m+            .predict_with_dqn(&[feature_vector.clone()])
[m[32m+            .await
[m[32m+            .is_ok()
[m[32m+        {
[m             info!("✓ DQN prediction completed");
             steps_completed += 1;
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:90:
 
         // TFT test
[31m-        if ml_test.predict_with_tft(&[feature_vector.clone()]).await.is_ok() {
[m[32m+        if ml_test
[m[32m+            .predict_with_tft(&[feature_vector.clone()])
[m[32m+            .await
[m[32m+            .is_ok()
[m[32m+        {
[m             info!("✓ TFT prediction completed");
             steps_completed += 1;
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:113:
             ensemble_result.signal_strength,
         );
 
[31m-        let mut result =
[m[31m-            WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m[32m+        let mut result = WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m         result.metrics = metrics;
 
         Ok(result)
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:161:
         // Verify end-to-end pipeline latency
         let duration = start_time.elapsed();
         if duration < Duration::from_millis(500) {
[31m-            info!("✓ Pipeline completed in {:?} (within latency target)", duration);
[m[32m+            info!(
[m[32m+                "✓ Pipeline completed in {:?} (within latency target)",
[m[32m+                duration
[m[32m+            );
[m             steps_completed += 1;
         } else {
             warn!("⚠ Pipeline took {:?} (may exceed latency target)", duration);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:172:
         metrics.insert("feature_vectors".to_string(), features.len() as f64);
         metrics.insert("pipeline_ms".to_string(), duration.as_millis() as f64);
 
[31m-        let mut result =
[m[31m-            WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m[32m+        let mut result = WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m         result.metrics = metrics;
 
         info!("✅ Data Flow Integration completed in {:?}", duration);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:210:
             info!("✓ ML inference meets latency target");
             steps_completed += 1;
         } else {
[31m-            warn!("⚠ ML inference latency exceeds target: {:?}", inference_latency);
[m[32m+            warn!(
[m[32m+                "⚠ ML inference latency exceeds target: {:?}",
[m[32m+                inference_latency
[m[32m+            );
[m         }
 
         // Test feature extraction performance
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:233:
             extraction_latency.as_millis() as f64,
         );
 
[31m-        let mut result =
[m[31m-            WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m[32m+        let mut result = WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m         result.metrics = metrics;
 
         info!("✅ Performance Validation completed in {:?}", duration);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:257:
 
         // Test baseline ensemble prediction
         let test_features: Vec<f64> = (0..50).map(|_| rand::random::<f64>()).collect();
[31m-        let baseline = ml_test.test_ensemble_prediction(test_features.clone()).await?;
[m[31m-        info!("✓ Baseline ensemble prediction: {:.2}% confidence", baseline.confidence * 100.0);
[m[32m+        let baseline = ml_test
[m[32m+            .test_ensemble_prediction(test_features.clone())
[m[32m+            .await?;
[m[32m+        info!(
[m[32m+            "✓ Baseline ensemble prediction: {:.2}% confidence",
[m[32m+            baseline.confidence * 100.0
[m[32m+        );
[m         steps_completed += 1;
 
         // Disable one model and verify ensemble still works
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:265:
         ml_test.disable_model("mamba").await?;
[31m-        let failover1 = ml_test.test_ensemble_prediction(test_features.clone()).await?;
[m[31m-        info!("✓ Ensemble works with MAMBA disabled: {:.2}% confidence", failover1.confidence * 100.0);
[m[32m+        let failover1 = ml_test
[m[32m+            .test_ensemble_prediction(test_features.clone())
[m[32m+            .await?;
[m[32m+        info!(
[m[32m+            "✓ Ensemble works with MAMBA disabled: {:.2}% confidence",
[m[32m+            failover1.confidence * 100.0
[m[32m+        );
[m         steps_completed += 1;
 
         // Disable another model
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:271:
         ml_test.disable_model("dqn").await?;
[31m-        let failover2 = ml_test.test_ensemble_prediction(test_features.clone()).await?;
[m[31m-        info!("✓ Ensemble works with MAMBA+DQN disabled: {:.2}% confidence", failover2.confidence * 100.0);
[m[32m+        let failover2 = ml_test
[m[32m+            .test_ensemble_prediction(test_features.clone())
[m[32m+            .await?;
[m[32m+        info!(
[m[32m+            "✓ Ensemble works with MAMBA+DQN disabled: {:.2}% confidence",
[m[32m+            failover2.confidence * 100.0
[m[32m+        );
[m         steps_completed += 1;
 
         // Re-enable models
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:277:
         ml_test.enable_model("mamba").await?;
         ml_test.enable_model("dqn").await?;
         let restored = ml_test.test_ensemble_prediction(test_features).await?;
[31m-        info!("✓ Ensemble restored: {:.2}% confidence", restored.confidence * 100.0);
[m[32m+        info!(
[m[32m+            "✓ Ensemble restored: {:.2}% confidence",
[m[32m+            restored.confidence * 100.0
[m[32m+        );
[m         steps_completed += 1;
 
         let duration = start_time.elapsed();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:287:
         metrics.insert("failover2_confidence".to_string(), failover2.confidence);
         metrics.insert("restored_confidence".to_string(), restored.confidence);
 
[31m-        let mut result =
[m[31m-            WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m[32m+        let mut result = WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m         result.metrics = metrics;
 
         info!("✅ ML Model Failover completed in {:?}", duration);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:306:
     use super::*;
     use foxhunt_e2e::e2e_test;
 
[31m-    e2e_test!(
[m[31m-        test_ml_inference_pipeline,
[m[31m-        |framework: Arc<E2ETestFramework>| async move {
[m[31m-            let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[31m-            let result = workflows.test_ml_inference_pipeline().await?;
[m[31m-            assert!(
[m[31m-                result.success,
[m[31m-                "ML inference pipeline failed: {:?}",
[m[31m-                result.error_message
[m[31m-            );
[m[31m-            assert!(
[m[31m-                result.metrics.contains_key("ensemble_confidence"),
[m[31m-                "Missing ensemble confidence metric"
[m[31m-            );
[m[31m-            Ok(())
[m[31m-        }
[m[31m-    );
[m[32m+    e2e_test!(test_ml_inference_pipeline, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m[32m+        let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[32m+        let result = workflows.test_ml_inference_pipeline().await?;
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "ML inference pipeline failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m[32m+        assert!(
[m[32m+            result.metrics.contains_key("ensemble_confidence"),
[m[32m+            "Missing ensemble confidence metric"
[m[32m+        );
[m[32m+        Ok(())
[m[32m+    });
[m 
[31m-    e2e_test!(
[m[31m-        test_data_flow_integration,
[m[31m-        |framework: Arc<E2ETestFramework>| async move {
[m[31m-            let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[31m-            let result = workflows.test_data_flow_integration().await?;
[m[31m-            assert!(
[m[31m-                result.success,
[m[31m-                "Data flow integration failed: {:?}",
[m[31m-                result.error_message
[m[31m-            );
[m[31m-            assert!(
[m[31m-                result.metrics.get("pipeline_ms").unwrap_or(&1000.0) < &500.0,
[m[31m-                "Pipeline latency too high"
[m[31m-            );
[m[31m-            Ok(())
[m[31m-        }
[m[31m-    );
[m[32m+    e2e_test!(test_data_flow_integration, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m[32m+        let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[32m+        let result = workflows.test_data_flow_integration().await?;
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Data flow integration failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m[32m+        assert!(
[m[32m+            result.metrics.get("pipeline_ms").unwrap_or(&1000.0) < &500.0,
[m[32m+            "Pipeline latency too high"
[m[32m+        );
[m[32m+        Ok(())
[m[32m+    });
[m 
[31m-    e2e_test!(
[m[31m-        test_performance_validation,
[m[31m-        |framework: Arc<E2ETestFramework>| async move {
[m[31m-            let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[31m-            let result = workflows.test_performance_validation().await?;
[m[31m-            assert!(
[m[31m-                result.success,
[m[31m-                "Performance validation failed: {:?}",
[m[31m-                result.error_message
[m[31m-            );
[m[31m-            let ml_latency = result.metrics.get("ml_inference_ms").unwrap_or(&1000.0);
[m[31m-            assert!(
[m[31m-                ml_latency < &100.0,
[m[31m-                "ML inference too slow: {}ms",
[m[31m-                ml_latency
[m[31m-            );
[m[31m-            Ok(())
[m[31m-        }
[m[31m-    );
[m[32m+    e2e_test!(test_performance_validation, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m[32m+        let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[32m+        let result = workflows.test_performance_validation().await?;
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Performance validation failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m[32m+        let ml_latency = result.metrics.get("ml_inference_ms").unwrap_or(&1000.0);
[m[32m+        assert!(
[m[32m+            ml_latency < &100.0,
[m[32m+            "ML inference too slow: {}ms",
[m[32m+            ml_latency
[m[32m+        );
[m[32m+        Ok(())
[m[32m+    });
[m 
[31m-    e2e_test!(
[m[31m-        test_ml_model_failover,
[m[31m-        |framework: Arc<E2ETestFramework>| async move {
[m[31m-            let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[31m-            let result = workflows.test_ml_model_failover().await?;
[m[31m-            assert!(
[m[31m-                result.success,
[m[31m-                "ML model failover failed: {:?}",
[m[31m-                result.error_message
[m[31m-            );
[m[31m-            assert!(
[m[31m-                result.metrics.contains_key("baseline_confidence"),
[m[31m-                "Missing baseline confidence metric"
[m[31m-            );
[m[31m-            Ok(())
[m[31m-        }
[m[31m-    );
[m[32m+    e2e_test!(test_ml_model_failover, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m[32m+        let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[32m+        let result = workflows.test_ml_model_failover().await?;
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "ML model failover failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m[32m+        assert!(
[m[32m+            result.metrics.contains_key("baseline_confidence"),
[m[32m+            "Missing baseline confidence metric"
[m[32m+        );
[m[32m+        Ok(())
[m[32m+    });
[m }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:66:
 
         // Cache entry should still exist since it was just created
         let still_cached = config_manager.get_cached_config(&cache_key);
[31m-        assert!(still_cached.is_some(), "Recent cache entry should not be cleaned up");
[m[32m+        assert!(
[m[32m+            still_cached.is_some(),
[m[32m+            "Recent cache entry should not be cleaned up"
[m[32m+        );
[m         info!("✅ Cache cleanup logic verified");
 
         // Step 6: Test cache miss
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:189:
         };
 
         let asset_manager = config::AssetClassificationManager::new();
[31m-        let config_manager = config::ConfigManager::with_asset_classification(
[m[31m-            service_config,
[m[31m-            asset_manager,
[m[31m-        );
[m[32m+        let config_manager =
[m[32m+            config::ConfigManager::with_asset_classification(service_config, asset_manager);
[m 
         // Step 2: Test symbol classification without loaded configs
         info!("🔍 Testing symbol classification");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:229:
         info!("✅ Volatility profile handling verified");
 
         // Step 5: Test position size recommendation
[31m-        let position_size = config_manager.get_position_size_recommendation(
[m[31m-            "AAPL",
[m[31m-            rust_decimal::Decimal::new(1000000, 0),
[m[31m-        );
[m[32m+        let position_size = config_manager
[m[32m+            .get_position_size_recommendation("AAPL", rust_decimal::Decimal::new(1000000, 0));
[m         assert!(
             position_size.is_none(),
             "Position size should be None without loaded configs"
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:278:
 
         // Step 2: Test serialization
         info!("🔄 Testing JSON serialization");
[31m-        let serialized = serde_json::to_string(&original_config)
[m[31m-            .context("Failed to serialize config")?;
[m[32m+        let serialized =
[m[32m+            serde_json::to_string(&original_config).context("Failed to serialize config")?;
[m 
         assert!(!serialized.is_empty());
         info!("✅ Serialization successful: {} bytes", serialized.len());
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:286:
 
         // Step 3: Test deserialization
         info!("🔄 Testing JSON deserialization");
[31m-        let deserialized: config::ServiceConfig = serde_json::from_str(&serialized)
[m[31m-            .context("Failed to deserialize config")?;
[m[32m+        let deserialized: config::ServiceConfig =
[m[32m+            serde_json::from_str(&serialized).context("Failed to deserialize config")?;
[m 
         assert_eq!(original_config.name, deserialized.name);
         assert_eq!(original_config.environment, deserialized.environment);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:367:
         info!("🧹 Testing cleanup of expired entries");
 
         // Add multiple entries
[31m-        config_manager.set_cached_config(
[m[31m-            "key1".to_string(),
[m[31m-            serde_json::json!({"value": 1}),
[m[31m-        );
[m[31m-        config_manager.set_cached_config(
[m[31m-            "key2".to_string(),
[m[31m-            serde_json::json!({"value": 2}),
[m[31m-        );
[m[32m+        config_manager.set_cached_config("key1".to_string(), serde_json::json!({"value": 1}));
[m[32m+        config_manager.set_cached_config("key2".to_string(), serde_json::json!({"value": 2}));
[m 
         // Wait for expiration
         tokio::time::sleep(Duration::from_millis(150)).await;
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:17:
 use tracing::{info, warn};
 use uuid::Uuid;
 
[31m-use foxhunt_e2e::*;
[m use foxhunt_e2e::proto::risk::ValidateOrderRequest;
 use foxhunt_e2e::proto::trading::OrderSide;
 use foxhunt_e2e::utils::{
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:24:
[31m-    TradingOperations, SimdPriceOps, LockFreeRingBuffer, SmallBatchProcessor,
[m[31m-    TradingEvent,
[m[32m+    LockFreeRingBuffer, SimdPriceOps, SmallBatchProcessor, TradingEvent, TradingOperations,
[m };
[32m+use foxhunt_e2e::*;
[m 
 // Define test-specific OrderRequest (simpler than the utils version)
 #[derive(Clone, Debug)]
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:36:
 }
 
 // Import timing primitives from trading_engine
[31m-use trading_engine::timing::{HardwareTimestamp, calibrate_tsc, is_tsc_reliable};
[m[32m+use trading_engine::timing::{calibrate_tsc, is_tsc_reliable, HardwareTimestamp};
[m 
 // Stub implementations for testing - actual implementations are in separate modules
 mod test_stubs {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:61:
             Ok(Self)
         }
 
[31m-        pub async fn extract_technical_features(&self, _data: &[DatabenttoEvent]) -> Result<Vec<f64>> {
[m[32m+        pub async fn extract_technical_features(
[m[32m+            &self,
[m[32m+            _data: &[DatabenttoEvent],
[m[32m+        ) -> Result<Vec<f64>> {
[m             Ok(vec![0.5; 10]) // Stub features
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:68:
[31m-        pub async fn extract_orderbook_features(&self, _data: &[DatabenttoEvent]) -> Result<Vec<f64>> {
[m[32m+        pub async fn extract_orderbook_features(
[m[32m+            &self,
[m[32m+            _data: &[DatabenttoEvent],
[m[32m+        ) -> Result<Vec<f64>> {
[m             Ok(vec![0.3; 8])
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:174:
             })
         }
 
[31m-        pub async fn generate_market_data(&self, _symbol: &str, count: usize) -> Result<Vec<DatabenttoEvent>> {
[m[32m+        pub async fn generate_market_data(
[m[32m+            &self,
[m[32m+            _symbol: &str,
[m[32m+            count: usize,
[m[32m+        ) -> Result<Vec<DatabenttoEvent>> {
[m             let mut events = Vec::new();
             for _ in 0..count {
                 events.push(DatabenttoEvent {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:194:
                 let has_anomaly = i % 10 == 0;
                 ticks.push(MarketTick {
                     price: if has_anomaly { 200.0 } else { 150.0 },
[31m-                    volume: if has_anomaly { 50_000_000.0 } else { 1_000_000.0 },
[m[32m+                    volume: if has_anomaly {
[m[32m+                        50_000_000.0
[m[32m+                    } else {
[m[32m+                        1_000_000.0
[m[32m+                    },
[m                 });
             }
             Ok(ticks)
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:205:
     pub struct MLPipeline;
 
     impl MLPipeline {
[31m-        pub async fn test_ensemble_prediction(&self, _features: Vec<f64>) -> Result<EnsembleResult> {
[m[32m+        pub async fn test_ensemble_prediction(
[m[32m+            &self,
[m[32m+            _features: Vec<f64>,
[m[32m+        ) -> Result<EnsembleResult> {
[m             Ok(EnsembleResult {
                 confidence: 0.85,
                 signal_strength: 0.42,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:212:
             })
         }
 
[31m-        pub async fn test_lightweight_inference(&self, _features: Vec<f64>) -> Result<EnsembleResult> {
[m[32m+        pub async fn test_lightweight_inference(
[m[32m+            &self,
[m[32m+            _features: Vec<f64>,
[m[32m+        ) -> Result<EnsembleResult> {
[m             Ok(EnsembleResult {
                 confidence: 0.90,
                 signal_strength: 0.35,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:228:
             Ok(())
         }
 
[31m-        pub async fn get_recent_events(&self, _event_type: &str, limit: usize) -> Result<Vec<super::TradingEvent>> {
[m[32m+        pub async fn get_recent_events(
[m[32m+            &self,
[m[32m+            _event_type: &str,
[m[32m+            limit: usize,
[m[32m+        ) -> Result<Vec<super::TradingEvent>> {
[m             Ok((0..limit)
                 .map(|i| super::TradingEvent {
                     id: uuid::Uuid::new_v4(),
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:1020:
                     symbol: "AAPL".to_string(),
                     quantity: 100.0,
                     price: 150.0 + (i as f64 * 0.1),
[31m-                    side: if i % 2 == 0 { OrderSide::Buy } else { OrderSide::Sell },
[m[32m+                    side: if i % 2 == 0 {
[m[32m+                        OrderSide::Buy
[m[32m+                    } else {
[m[32m+                        OrderSide::Sell
[m[32m+                    },
[m                 })
                 .collect();
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:1286:
     >| async move {
         let data_tests = DataFlowPerformanceTests::new(framework);
         let result = data_tests.test_realtime_data_ingestion().await?;
[31m-        assert!(result.success, "Data ingestion failed: {:?}", result.error_message);
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Data ingestion failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m         assert!(result.metrics.get("e2e_pipeline_ns").unwrap_or(&100_000.0) < &50_000.0);
         Ok(())
     });
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:17:
         info!("Testing dual-provider framework initialization");
 
         // Verify framework is initialized
[31m-        assert!(!framework.services_started, "Services should not be auto-started");
[m[32m+        assert!(
[m[32m+            !framework.services_started,
[m[32m+            "Services should not be auto-started"
[m[32m+        );
[m 
         // Verify database harness is ready
[31m-        info!("Database harness URL: {}", framework.database_harness.connection_string);
[m[32m+        info!(
[m[32m+            "Database harness URL: {}",
[m[32m+            framework.database_harness.connection_string
[m[32m+        );
[m 
         // Verify ML pipeline is initialized
         info!("ML pipeline initialized");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:27:
 
         // Verify performance tracker is ready
[31m-        info!("Performance tracker session ID: {}", framework.test_session_id);
[m[32m+        info!(
[m[32m+            "Performance tracker session ID: {}",
[m[32m+            framework.test_session_id
[m[32m+        );
[m 
         info!("✅ Dual-provider framework initialization test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:62:
 
         // Verify connection string is configured
         let conn_str = &framework.database_harness.connection_string;
[31m-        assert!(!conn_str.is_empty(), "Connection string should be configured");
[m[32m+        assert!(
[m[32m+            !conn_str.is_empty(),
[m[32m+            "Connection string should be configured"
[m[32m+        );
[m         info!("Database connection: {}", conn_str);
 
         // Database harness is configured and ready for testing
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:90:
         let test_features = vec![0.5, 0.3, 0.7, 0.2, 0.8]; // Mock features
         let result = ml_pipeline.test_ensemble_prediction(test_features).await?;
 
[31m-        assert!(result.confidence >= 0.0 && result.confidence <= 1.0,
[m[31m-                "Confidence should be in [0,1]: {}", result.confidence);
[m[31m-        assert!(result.signal_strength.abs() <= 1.0,
[m[31m-                "Signal strength should be in [-1,1]: {}", result.signal_strength);
[m[32m+        assert!(
[m[32m+            result.confidence >= 0.0 && result.confidence <= 1.0,
[m[32m+            "Confidence should be in [0,1]: {}",
[m[32m+            result.confidence
[m[32m+        );
[m[32m+        assert!(
[m[32m+            result.signal_strength.abs() <= 1.0,
[m[32m+            "Signal strength should be in [-1,1]: {}",
[m[32m+            result.signal_strength
[m[32m+        );
[m 
[31m-        info!("✅ Ensemble prediction: {:?} (confidence: {:.3}, signal: {:.3})",
[m[31m-              result.prediction, result.confidence, result.signal_strength);
[m[32m+        info!(
[m[32m+            "✅ Ensemble prediction: {:?} (confidence: {:.3}, signal: {:.3})",
[m[32m+            result.prediction, result.confidence, result.signal_strength
[m[32m+        );
[m 
         info!("✅ ML pipeline dual-provider test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:144:
             Ok(client) => {
                 info!("✅ Trading client connected successfully");
                 // Client is available for testing
[31m-                assert!(client as *const _ as usize != 0, "Client should be non-null");
[m[32m+                assert!(
[m[32m+                    client as *const _ as usize != 0,
[m[32m+                    "Client should be non-null"
[m[32m+                );
[m             },
             Err(e) => {
[31m-                warn!("Trading service not available (expected in test environment): {}", e);
[m[32m+                warn!(
[m[32m+                    "Trading service not available (expected in test environment): {}",
[m[32m+                    e
[m[32m+                );
[m                 // This is acceptable in isolated test environment
[31m-            }
[m[32m+            },
[m         }
 
         // Try to get backtesting client
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:156:
         match framework.get_backtesting_client().await {
             Ok(client) => {
                 info!("✅ Backtesting client connected successfully");
[31m-                assert!(client as *const _ as usize != 0, "Client should be non-null");
[m[32m+                assert!(
[m[32m+                    client as *const _ as usize != 0,
[m[32m+                    "Client should be non-null"
[m[32m+                );
[m             },
             Err(e) => {
[31m-                warn!("Backtesting service not available (expected in test environment): {}", e);
[m[31m-            }
[m[32m+                warn!(
[m[32m+                    "Backtesting service not available (expected in test environment): {}",
[m[32m+                    e
[m[32m+                );
[m[32m+            },
[m         }
 
         info!("✅ Client connection test passed");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:187:
 
         // Verify market data structure
         assert_eq!(market_data.symbol, symbol, "Symbol should match");
[31m-        assert!(market_data.bid < market_data.ask, "Bid should be less than ask");
[m[31m-        assert!(market_data.bid_size.to_f64() > 0.0, "Bid size should be positive");
[m[31m-        assert!(market_data.ask_size.to_f64() > 0.0, "Ask size should be positive");
[m[32m+        assert!(
[m[32m+            market_data.bid < market_data.ask,
[m[32m+            "Bid should be less than ask"
[m[32m+        );
[m[32m+        assert!(
[m[32m+            market_data.bid_size.to_f64() > 0.0,
[m[32m+            "Bid size should be positive"
[m[32m+        );
[m[32m+        assert!(
[m[32m+            market_data.ask_size.to_f64() > 0.0,
[m[32m+            "Ask size should be positive"
[m[32m+        );
[m 
[31m-        info!("✅ Generated market data: bid={:.5}, ask={:.5}, spread={:.5}",
[m[31m-              market_data.bid.to_f64(),
[m[31m-              market_data.ask.to_f64(),
[m[31m-              market_data.ask.to_f64() - market_data.bid.to_f64());
[m[32m+        info!(
[m[32m+            "✅ Generated market data: bid={:.5}, ask={:.5}, spread={:.5}",
[m[32m+            market_data.bid.to_f64(),
[m[32m+            market_data.ask.to_f64(),
[m[32m+            market_data.ask.to_f64() - market_data.bid.to_f64()
[m[32m+        );
[m 
         // Generate order request
         let order = generator.generate_order_request(&symbol);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:201:
         assert_eq!(order.symbol, symbol, "Order symbol should match");
[31m-        assert!(order.quantity.to_f64() > 0.0, "Order quantity should be positive");
[m[32m+        assert!(
[m[32m+            order.quantity.to_f64() > 0.0,
[m[32m+            "Order quantity should be positive"
[m[32m+        );
[m 
[31m-        info!("✅ Generated order: {:?} {} @ {:?}",
[m[31m-              order.side, order.symbol, order.quantity);
[m[32m+        info!(
[m[32m+            "✅ Generated order: {:?} {} @ {:?}",
[m[32m+            order.side, order.symbol, order.quantity
[m[32m+        );
[m 
         info!("✅ Data generation dual-provider test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:233:
         };
 
         assert!(success_result.success, "Result should be successful");
[31m-        assert_eq!(success_result.duration, Duration::from_millis(150), "Duration should match");
[m[31m-        info!("✅ Workflow result: {} ({:?})",
[m[31m-              success_result.workflow_name, success_result.duration);
[m[32m+        assert_eq!(
[m[32m+            success_result.duration,
[m[32m+            Duration::from_millis(150),
[m[32m+            "Duration should match"
[m[32m+        );
[m[32m+        info!(
[m[32m+            "✅ Workflow result: {} ({:?})",
[m[32m+            success_result.workflow_name, success_result.duration
[m[32m+        );
[m 
         // Create a failed workflow result
         let failure_result = WorkflowTestResult {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:251:
         };
 
         assert!(!failure_result.success, "Result should be failed");
[31m-        assert!(failure_result.error_message.is_some(), "Should have error message");
[m[31m-        info!("✅ Workflow failure tracked: {} - {}",
[m[31m-              failure_result.workflow_name,
[m[31m-              failure_result.error_message.unwrap_or_default());
[m[32m+        assert!(
[m[32m+            failure_result.error_message.is_some(),
[m[32m+            "Should have error message"
[m[32m+        );
[m[32m+        info!(
[m[32m+            "✅ Workflow failure tracked: {} - {}",
[m[32m+            failure_result.workflow_name,
[m[32m+            failure_result.error_message.unwrap_or_default()
[m[32m+        );
[m 
         info!("✅ Workflow result tracking test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:286:
         // Verify price continuity (no wild jumps)
         for window in prices.windows(2) {
             let change_pct = (window[1] - window[0]).abs() / window[0];
[31m-            assert!(change_pct < 0.01,
[m[31m-                    "Price change should be < 1%: {:.4}%", change_pct * 100.0);
[m[32m+            assert!(
[m[32m+                change_pct < 0.01,
[m[32m+                "Price change should be < 1%: {:.4}%",
[m[32m+                change_pct * 100.0
[m[32m+            );
[m         }
 
[31m-        info!("✅ Price continuity validated across {} samples", prices.len());
[m[32m+        info!(
[m[32m+            "✅ Price continuity validated across {} samples",
[m[32m+            prices.len()
[m[32m+        );
[m 
         // Calculate statistics
         let avg_price = prices.iter().sum::<f64>() / prices.len() as f64;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:297:
         let min_price = prices.iter().cloned().fold(f64::INFINITY, f64::min);
         let max_price = prices.iter().cloned().fold(f64::NEG_INFINITY, f64::max);
 
[31m-        info!("📊 Price statistics: avg={:.5}, min={:.5}, max={:.5}, range={:.5}",
[m[31m-              avg_price, min_price, max_price, max_price - min_price);
[m[32m+        info!(
[m[32m+            "📊 Price statistics: avg={:.5}, min={:.5}, max={:.5}, range={:.5}",
[m[32m+            avg_price,
[m[32m+            min_price,
[m[32m+            max_price,
[m[32m+            max_price - min_price
[m[32m+        );
[m 
         info!("✅ Provider data consistency test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:352:
 
         assert_eq!(results.len(), 3, "Should complete all concurrent tasks");
         for (symbol, count) in results {
[31m-            assert_eq!(count, 5, "Each symbol should have 5 data points: {}", symbol);
[m[32m+            assert_eq!(
[m[32m+                count, 5,
[m[32m+                "Each symbol should have 5 data points: {}",
[m[32m+                symbol
[m[32m+            );
[m         }
 
         info!("✅ Concurrent provider access test passed");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:396:
             secondary_data.push(data.bid.to_f64());
             sleep(Duration::from_millis(50)).await;
         }
[31m-        info!("✅ Secondary provider: {} data points", secondary_data.len());
[m[32m+        info!(
[m[32m+            "✅ Secondary provider: {} data points",
[m[32m+            secondary_data.len()
[m[32m+        );
[m 
         // Verify data continuity across failover
         assert_eq!(primary_data.len(), 5, "Primary should have 5 samples");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:407:
         let first_secondary = secondary_data.first().unwrap();
         let deviation = (first_secondary - last_primary).abs() / last_primary;
 
[31m-        info!("📊 Failover price deviation: {:.4}% (last_primary={:.5}, first_secondary={:.5})",
[m[31m-              deviation * 100.0, last_primary, first_secondary);
[m[32m+        info!(
[m[32m+            "📊 Failover price deviation: {:.4}% (last_primary={:.5}, first_secondary={:.5})",
[m[32m+            deviation * 100.0,
[m[32m+            last_primary,
[m[32m+            first_secondary
[m[32m+        );
[m 
         info!("✅ Provider failover simulation test passed");
         Ok(())
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:18:
 use tracing::{debug, info, warn};
 
 // Import proto types
[31m-use foxhunt_e2e::proto::trading;
[m use foxhunt_e2e::proto::risk;
[32m+use foxhunt_e2e::proto::trading;
[m 
 // Test 1: Graceful Shutdown with Order Preservation
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:143:
             positions_before.positions.len(),
             "Position count should be preserved across shutdown"
         );
[31m-        info!("✅ Positions preserved: {}", positions_after.positions.len());
[m[31m-        info!("✅ Graceful shutdown test completed successfully in {} steps", step_count);
[m[32m+        info!(
[m[32m+            "✅ Positions preserved: {}",
[m[32m+            positions_after.positions.len()
[m[32m+        );
[m[32m+        info!(
[m[32m+            "✅ Graceful shutdown test completed successfully in {} steps",
[m[32m+            step_count
[m[32m+        );
[m         Ok(())
     }
 );
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:175:
             .context("Failed to get trading client")?;
 
         // Connect to risk service directly
[31m-        let mut risk_client = risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            risk::risk_service_client::RiskServiceClient::connect("http://[::1]:50051")
[m[32m+                .await
[m[32m+                .context("Failed to connect to Risk Service")?;
[m         info!("✅ Clients initialized");
 
         // Step 3: Create active trading scenario
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:249:
         match result_after_stop {
             Err(e) => {
                 info!("✅ Order correctly rejected during emergency stop: {}", e);
[31m-            }
[m[32m+            },
[m             Ok(response) => {
                 let inner = response.into_inner();
                 assert!(
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:256:
                     inner.status == trading::OrderStatus::Rejected as i32,
                     "Order should be rejected during emergency stop"
                 );
[31m-                info!("✅ Order correctly rejected with status: {:?}", inner.status);
[m[31m-            }
[m[32m+                info!(
[m[32m+                    "✅ Order correctly rejected with status: {:?}",
[m[32m+                    inner.status
[m[32m+                );
[m[32m+            },
[m         }
 
         // Step 6: Check circuit breaker status
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:264:
         step_count += 1;
         let breaker_status = risk_client
[31m-            .get_circuit_breaker_status(risk::GetCircuitBreakerStatusRequest {
[m[31m-                symbol: None,
[m[31m-            })
[m[32m+            .get_circuit_breaker_status(risk::GetCircuitBreakerStatusRequest { symbol: None })
[m             .await
             .context("Failed to get circuit breaker status")?
             .into_inner();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:274:
             "✅ Circuit breaker status retrieved: {} breakers",
             breaker_status.circuit_breakers.len()
         );
[31m-        info!("✅ Emergency stop test completed successfully in {} steps", step_count);
[m[32m+        info!(
[m[32m+            "✅ Emergency stop test completed successfully in {} steps",
[m[32m+            step_count
[m[32m+        );
[m         Ok(())
     }
 );
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:299:
 
         // Step 2: Initialize risk client
         step_count += 1;
[31m-        let mut risk_client = risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            risk::risk_service_client::RiskServiceClient::connect("http://[::1]:50051")
[m[32m+                .await
[m[32m+                .context("Failed to connect to Risk Service")?;
[m         info!("✅ Risk client initialized");
 
         // Step 3: Get baseline risk metrics
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:310:
         step_count += 1;
         let baseline_metrics = risk_client
[31m-            .get_risk_metrics(risk::GetRiskMetricsRequest {
[m[31m-                portfolio_id: None,
[m[31m-            })
[m[32m+            .get_risk_metrics(risk::GetRiskMetricsRequest { portfolio_id: None })
[m             .await
             .context("Failed to get baseline risk metrics")?
             .into_inner();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:370:
                             "📊 Risk alert received: {} - {}",
                             alert.alert_id, alert.message
                         );
[31m-                        debug!("   Severity: {:?}, Type: {:?}", alert.severity, alert.alert_type);
[m[31m-                    }
[m[32m+                        debug!(
[m[32m+                            "   Severity: {:?}, Type: {:?}",
[m[32m+                            alert.severity, alert.alert_type
[m[32m+                        );
[m[32m+                    },
[m                     Err(e) => {
                         warn!("Risk alert stream error: {}", e);
                         break;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:378:
[31m-                    }
[m[32m+                    },
[m                 }
             }
         })
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:382:
         .await;
 
[31m-        info!("✅ Risk alert monitoring completed ({} alerts)", alerts_received);
[m[32m+        info!(
[m[32m+            "✅ Risk alert monitoring completed ({} alerts)",
[m[32m+            alerts_received
[m[32m+        );
[m 
         // Step 6: Verify circuit breaker state
         step_count += 1;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:388:
         let breaker_status = risk_client
[31m-            .get_circuit_breaker_status(risk::GetCircuitBreakerStatusRequest {
[m[31m-                symbol: None,
[m[31m-            })
[m[32m+            .get_circuit_breaker_status(risk::GetCircuitBreakerStatusRequest { symbol: None })
[m             .await
             .context("Failed to get circuit breaker status")?
             .into_inner();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:405:
             );
         }
 
[31m-        info!("✅ Kill switch threshold test completed successfully in {} steps", step_count);
[m[32m+        info!(
[m[32m+            "✅ Kill switch threshold test completed successfully in {} steps",
[m[32m+            step_count
[m[32m+        );
[m         Ok(())
     }
 );
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/error_handling_recovery.rs:9:
 
 use anyhow::{Context, Result};
 use foxhunt_e2e::e2e_test;
[31m-use foxhunt_e2e::proto::trading::{SubmitOrderRequest, OrderSide, OrderType, GetPortfolioSummaryRequest};
[m[32m+use foxhunt_e2e::proto::trading::{
[m[32m+    GetPortfolioSummaryRequest, OrderSide, OrderType, SubmitOrderRequest,
[m[32m+};
[m use std::time::Duration;
 use tracing::{info, warn};
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/error_handling_recovery.rs:121:
                 info!("Invalid symbol format response: {}", response.message);
             },
             Err(e) => {
[31m-                info!("✅ Invalid symbol format correctly rejected with error: {}", e);
[m[32m+                info!(
[m[32m+                    "✅ Invalid symbol format correctly rejected with error: {}",
[m[32m+                    e
[m[32m+                );
[m             },
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/error_handling_recovery.rs:421:
         info!("Testing order with metadata");
         let mut metadata = std::collections::HashMap::new();
         metadata.insert("strategy".to_string(), "test_strategy".to_string());
[31m-        metadata.insert("notes".to_string(), "Testing special characters: !@#$%^&*()".to_string());
[m[32m+        metadata.insert(
[m[32m+            "notes".to_string(),
[m[32m+            "Testing special characters: !@#$%^&*()".to_string(),
[m[32m+        );
[m 
         let metadata_order = SubmitOrderRequest {
             symbol: "AAPL".to_string(),
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:11:
 
 use anyhow::Context;
 use foxhunt_e2e::e2e_test;
[32m+use foxhunt_e2e::proto::risk::{GetRiskMetricsRequest, ValidateOrderRequest};
[m use foxhunt_e2e::proto::trading::{
[31m-    MarketDataType, OrderSide, OrderStatus, OrderType, SubmitOrderRequest,
[m[31m-    StreamMarketDataRequest, GetPortfolioSummaryRequest, GetPositionsRequest,
[m[31m-    GetOrderStatusRequest, CancelOrderRequest, StreamOrdersRequest,
[m[32m+    CancelOrderRequest, GetOrderStatusRequest, GetPortfolioSummaryRequest, GetPositionsRequest,
[m[32m+    MarketDataType, OrderSide, OrderStatus, OrderType, StreamMarketDataRequest,
[m[32m+    StreamOrdersRequest, SubmitOrderRequest,
[m };
[31m-use foxhunt_e2e::proto::risk::{ValidateOrderRequest, GetRiskMetricsRequest};
[m use std::time::Duration;
 use tokio_stream::StreamExt;
 use tracing::{info, warn};
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:47:
         info!("📊 Subscribing to market data for AAPL");
         let market_data_request = StreamMarketDataRequest {
             symbols: vec!["AAPL".to_string()],
[31m-            data_types: vec![
[m[31m-                MarketDataType::Trade as i32,
[m[31m-                MarketDataType::Quote as i32,
[m[31m-            ],
[m[32m+            data_types: vec![MarketDataType::Trade as i32, MarketDataType::Quote as i32],
[m         };
 
         let mut market_data_stream = trading_client
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:147:
         info!("⚖️ Validating order with risk management");
 
         // Create a separate RiskServiceClient
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         let validation_response = risk_client
             .validate_order(ValidateOrderRequest {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:158:
                 symbol: test_order.symbol.clone(),
                 quantity: test_order.quantity,
                 price: last_price,
[31m-                side: if test_order.side == OrderSide::Buy as i32 { "buy" } else { "sell" }.to_string(),
[m[32m+                side: if test_order.side == OrderSide::Buy as i32 {
[m[32m+                    "buy"
[m[32m+                } else {
[m[32m+                    "sell"
[m[32m+                }
[m[32m+                .to_string(),
[m                 account_id: test_order.account_id.clone(),
             })
             .await
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:445:
         let trading_client = framework.get_trading_client().await?;
 
         // Create a separate RiskServiceClient for validation
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         // Try to submit a very large order that should be rejected
         let large_order = SubmitOrderRequest {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:495:
                     } else {
                         warn!("⚠️ Large order was accepted - risk limits may need adjustment");
                     }
[31m-                }
[m[32m+                },
[m                 Err(e) => {
                     info!("✅ Order rejected with error: {}", e);
[31m-                }
[m[32m+                },
[m             }
         } else {
             info!("✅ Order correctly rejected at validation stage");
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:14:
 use tracing::{info, warn};
 
 // Import proto types for gRPC calls
[32m+use foxhunt_e2e::proto::backtesting::ListBacktestsRequest;
[m use foxhunt_e2e::proto::trading::{
[31m-    GetPortfolioSummaryRequest, SubmitOrderRequest, OrderType, OrderSide, StreamMarketDataRequest,
[m[31m-    MarketDataType,
[m[32m+    GetPortfolioSummaryRequest, MarketDataType, OrderSide, OrderType, StreamMarketDataRequest,
[m[32m+    SubmitOrderRequest,
[m };
[31m-use foxhunt_e2e::proto::backtesting::ListBacktestsRequest;
[m 
 //
 // BASIC SERVICE HEALTH TESTS
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:25:
 //
 
[31m-e2e_test!(test_framework_initialization, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing E2E framework initialization");
[m[32m+e2e_test!(
[m[32m+    test_framework_initialization,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing E2E framework initialization");
[m 
[31m-    // Framework is already initialized by the macro
[m[31m-    // Just verify basic properties
[m[31m-    let session_id = framework.get_test_session_id();
[m[31m-    assert!(!session_id.is_empty(), "Session ID should not be empty");
[m[31m-    info!("✅ Test session ID: {}", session_id);
[m[32m+        // Framework is already initialized by the macro
[m[32m+        // Just verify basic properties
[m[32m+        let session_id = framework.get_test_session_id();
[m[32m+        assert!(!session_id.is_empty(), "Session ID should not be empty");
[m[32m+        info!("✅ Test session ID: {}", session_id);
[m 
[31m-    // Check that services are marked as started
[m[31m-    assert!(
[m[31m-        framework.services_started,
[m[31m-        "Services should be marked as started"
[m[31m-    );
[m[31m-    info!("✅ Services startup flag is set");
[m[32m+        // Check that services are marked as started
[m[32m+        assert!(
[m[32m+            framework.services_started,
[m[32m+            "Services should be marked as started"
[m[32m+        );
[m[32m+        info!("✅ Services startup flag is set");
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
[31m-e2e_test!(test_services_health_check, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing services health check");
[m[32m+e2e_test!(
[m[32m+    test_services_health_check,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing services health check");
[m 
[31m-    // Wait a moment for services to stabilize
[m[31m-    sleep(Duration::from_secs(2)).await;
[m[32m+        // Wait a moment for services to stabilize
[m[32m+        sleep(Duration::from_secs(2)).await;
[m 
[31m-    // Check overall health status
[m[31m-    let health = framework.check_services_health().await?;
[m[32m+        // Check overall health status
[m[32m+        let health = framework.check_services_health().await?;
[m 
[31m-    info!("Health status summary: {}", health.summary());
[m[31m-    info!("  Trading Service: {:?}", health.trading_service);
[m[31m-    info!("  Config Service: {:?}", health.config_service);
[m[31m-    info!("  Database: {:?}", health.database);
[m[32m+        info!("Health status summary: {}", health.summary());
[m[32m+        info!("  Trading Service: {:?}", health.trading_service);
[m[32m+        info!("  Config Service: {:?}", health.config_service);
[m[32m+        info!("  Database: {:?}", health.database);
[m 
[31m-    // We expect at least some services to be healthy in CI/test environments
[m[31m-    // In real environments, all should be healthy
[m[31m-    info!(
[m[31m-        "✅ Health check completed - All healthy: {}",
[m[31m-        health.all_healthy
[m[31m-    );
[m[32m+        // We expect at least some services to be healthy in CI/test environments
[m[32m+        // In real environments, all should be healthy
[m[32m+        info!(
[m[32m+            "✅ Health check completed - All healthy: {}",
[m[32m+            health.all_healthy
[m[32m+        );
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
 //
 // GRPC CLIENT CONNECTION TESTS
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:72:
 //
 
[31m-e2e_test!(test_trading_client_connection, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing Trading Service gRPC client connection");
[m[32m+e2e_test!(
[m[32m+    test_trading_client_connection,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing Trading Service gRPC client connection");
[m 
[31m-    // Wait for service to be ready
[m[31m-    sleep(Duration::from_secs(2)).await;
[m[32m+        // Wait for service to be ready
[m[32m+        sleep(Duration::from_secs(2)).await;
[m 
[31m-    // Get trading client - this will establish connection
[m[31m-    let client = framework.get_trading_client().await;
[m[32m+        // Get trading client - this will establish connection
[m[32m+        let client = framework.get_trading_client().await;
[m 
[31m-    match client {
[m[31m-        Ok(_trading_client) => {
[m[31m-            info!("✅ Successfully connected to Trading Service");
[m[32m+        match client {
[m[32m+            Ok(_trading_client) => {
[m[32m+                info!("✅ Successfully connected to Trading Service");
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Trading Service connection failed: {}", e);
[m[32m+                info!("This may be expected in test environments without running services");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Trading Service connection failed: {}", e);
[m[31m-            info!("This may be expected in test environments without running services");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+e2e_test!(
[m[32m+    test_backtesting_client_connection,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing Backtesting Service gRPC client connection");
[m 
[31m-e2e_test!(test_backtesting_client_connection, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing Backtesting Service gRPC client connection");
[m[32m+        // Wait for service to be ready
[m[32m+        sleep(Duration::from_secs(2)).await;
[m 
[31m-    // Wait for service to be ready
[m[31m-    sleep(Duration::from_secs(2)).await;
[m[32m+        // Get backtesting client - this will establish connection
[m[32m+        let client = framework.get_backtesting_client().await;
[m 
[31m-    // Get backtesting client - this will establish connection
[m[31m-    let client = framework.get_backtesting_client().await;
[m[31m-
[m[31m-    match client {
[m[31m-        Ok(_backtesting_client) => {
[m[31m-            info!("✅ Successfully connected to Backtesting Service");
[m[32m+        match client {
[m[32m+            Ok(_backtesting_client) => {
[m[32m+                info!("✅ Successfully connected to Backtesting Service");
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Backtesting Service connection failed: {}", e);
[m[32m+                info!("This may be expected in test environments without running services");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Backtesting Service connection failed: {}", e);
[m[31m-            info!("This may be expected in test environments without running services");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // TRADING SERVICE INTEGRATION TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:121:
 
[31m-e2e_test!(test_portfolio_query, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing portfolio query through Trading Service");
[m[32m+e2e_test!(
[m[32m+    test_portfolio_query,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing portfolio query through Trading Service");
[m 
[31m-    // Get trading client
[m[31m-    let client_result = framework.get_trading_client().await;
[m[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Skipping portfolio query test - service not available");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        // Get trading client
[m[32m+        let client_result = framework.get_trading_client().await;
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Skipping portfolio query test - service not available");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    let trading_client = client_result.unwrap();
[m[32m+        let trading_client = client_result.unwrap();
[m 
[31m-    // Prepare portfolio query request with account_id
[m[31m-    let request = tonic::Request::new(GetPortfolioSummaryRequest {
[m[31m-        account_id: "test_account".to_string(),
[m[31m-    });
[m[32m+        // Prepare portfolio query request with account_id
[m[32m+        let request = tonic::Request::new(GetPortfolioSummaryRequest {
[m[32m+            account_id: "test_account".to_string(),
[m[32m+        });
[m 
[31m-    // Query portfolio
[m[31m-    let response = trading_client.get_portfolio_summary(request).await;
[m[32m+        // Query portfolio
[m[32m+        let response = trading_client.get_portfolio_summary(request).await;
[m 
[31m-    match response {
[m[31m-        Ok(portfolio) => {
[m[31m-            let portfolio_data = portfolio.into_inner();
[m[31m-            info!("✅ Portfolio query successful");
[m[31m-            info!(
[m[31m-                "Portfolio total value: ${:.2}",
[m[31m-                portfolio_data.total_value
[m[31m-            );
[m[31m-            info!("Buying power: ${:.2}", portfolio_data.buying_power);
[m[31m-            info!("Unrealized PnL: ${:.2}", portfolio_data.unrealized_pnl);
[m[32m+        match response {
[m[32m+            Ok(portfolio) => {
[m[32m+                let portfolio_data = portfolio.into_inner();
[m[32m+                info!("✅ Portfolio query successful");
[m[32m+                info!("Portfolio total value: ${:.2}", portfolio_data.total_value);
[m[32m+                info!("Buying power: ${:.2}", portfolio_data.buying_power);
[m[32m+                info!("Unrealized PnL: ${:.2}", portfolio_data.unrealized_pnl);
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Portfolio query failed: {}", e);
[m[32m+                info!("This may be expected if service is not fully configured");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Portfolio query failed: {}", e);
[m[31m-            info!("This may be expected if service is not fully configured");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+e2e_test!(
[m[32m+    test_order_submission_flow,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing order submission flow");
[m 
[31m-e2e_test!(test_order_submission_flow, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing order submission flow");
[m[32m+        // Get trading client
[m[32m+        let client_result = framework.get_trading_client().await;
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Skipping order submission test - service not available");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    // Get trading client
[m[31m-    let client_result = framework.get_trading_client().await;
[m[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Skipping order submission test - service not available");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        let trading_client = client_result.unwrap();
[m 
[31m-    let trading_client = client_result.unwrap();
[m[32m+        // Create a test order with all required fields
[m[32m+        let order_request = SubmitOrderRequest {
[m[32m+            symbol: "EURUSD".to_string(),
[m[32m+            side: OrderSide::Buy.into(),
[m[32m+            quantity: 10000.0,
[m[32m+            order_type: OrderType::Market.into(),
[m[32m+            price: None,
[m[32m+            stop_price: None,
[m[32m+            account_id: "test_account".to_string(),
[m[32m+            metadata: std::collections::HashMap::new(),
[m[32m+        };
[m 
[31m-    // Create a test order with all required fields
[m[31m-    let order_request = SubmitOrderRequest {
[m[31m-        symbol: "EURUSD".to_string(),
[m[31m-        side: OrderSide::Buy.into(),
[m[31m-        quantity: 10000.0,
[m[31m-        order_type: OrderType::Market.into(),
[m[31m-        price: None,
[m[31m-        stop_price: None,
[m[31m-        account_id: "test_account".to_string(),
[m[31m-        metadata: std::collections::HashMap::new(),
[m[31m-    };
[m[32m+        info!(
[m[32m+            "Submitting test order: {} EURUSD @ Market",
[m[32m+            order_request.quantity
[m[32m+        );
[m 
[31m-    info!("Submitting test order: {} EURUSD @ Market", order_request.quantity);
[m[32m+        // Submit order
[m[32m+        let request = tonic::Request::new(order_request);
[m[32m+        let response = trading_client.submit_order(request).await;
[m 
[31m-    // Submit order
[m[31m-    let request = tonic::Request::new(order_request);
[m[31m-    let response = trading_client.submit_order(request).await;
[m[31m-
[m[31m-    match response {
[m[31m-        Ok(order_response) => {
[m[31m-            let order = order_response.into_inner();
[m[31m-            info!("✅ Order submitted successfully");
[m[31m-            info!("Order ID: {}", order.order_id);
[m[31m-            info!("Status: {:?}", order.status);
[m[32m+        match response {
[m[32m+            Ok(order_response) => {
[m[32m+                let order = order_response.into_inner();
[m[32m+                info!("✅ Order submitted successfully");
[m[32m+                info!("Order ID: {}", order.order_id);
[m[32m+                info!("Status: {:?}", order.status);
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Order submission failed: {}", e);
[m[32m+                info!(
[m[32m+                    "This may be expected if service is not fully configured or in simulation mode"
[m[32m+                );
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Order submission failed: {}", e);
[m[31m-            info!("This may be expected if service is not fully configured or in simulation mode");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+e2e_test!(
[m[32m+    test_market_data_streaming,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing market data streaming");
[m 
[31m-e2e_test!(test_market_data_streaming, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing market data streaming");
[m[32m+        // Get trading client
[m[32m+        let client_result = framework.get_trading_client().await;
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Skipping market data streaming test - service not available");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    // Get trading client
[m[31m-    let client_result = framework.get_trading_client().await;
[m[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Skipping market data streaming test - service not available");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        let trading_client = client_result.unwrap();
[m 
[31m-    let trading_client = client_result.unwrap();
[m[32m+        // Subscribe to market data stream with data_types
[m[32m+        let stream_request = StreamMarketDataRequest {
[m[32m+            symbols: vec!["EURUSD".to_string(), "GBPUSD".to_string()],
[m[32m+            data_types: vec![MarketDataType::Trade.into(), MarketDataType::Quote.into()],
[m[32m+        };
[m 
[31m-    // Subscribe to market data stream with data_types
[m[31m-    let stream_request = StreamMarketDataRequest {
[m[31m-        symbols: vec!["EURUSD".to_string(), "GBPUSD".to_string()],
[m[31m-        data_types: vec![MarketDataType::Trade.into(), MarketDataType::Quote.into()],
[m[31m-    };
[m[32m+        info!("Subscribing to market data for EURUSD, GBPUSD");
[m 
[31m-    info!("Subscribing to market data for EURUSD, GBPUSD");
[m[32m+        let request = tonic::Request::new(stream_request);
[m[32m+        let stream_result = trading_client.stream_market_data(request).await;
[m 
[31m-    let request = tonic::Request::new(stream_request);
[m[31m-    let stream_result = trading_client.stream_market_data(request).await;
[m[32m+        match stream_result {
[m[32m+            Ok(mut stream) => {
[m[32m+                let mut event_count = 0;
[m[32m+                let max_events = 5;
[m[32m+                let timeout_duration = Duration::from_secs(10);
[m 
[31m-    match stream_result {
[m[31m-        Ok(mut stream) => {
[m[31m-            let mut event_count = 0;
[m[31m-            let max_events = 5;
[m[31m-            let timeout_duration = Duration::from_secs(10);
[m[32m+                info!("✅ Market data stream established");
[m 
[31m-            info!("✅ Market data stream established");
[m[32m+                // Collect a few market data events with timeout
[m[32m+                let stream_fut = async {
[m[32m+                    use tokio_stream::StreamExt;
[m 
[31m-            // Collect a few market data events with timeout
[m[31m-            let stream_fut = async {
[m[31m-                use tokio_stream::StreamExt;
[m[32m+                    while let Some(result) = stream.get_mut().next().await {
[m[32m+                        match result {
[m[32m+                            Ok(market_data) => {
[m[32m+                                event_count += 1;
[m[32m+                                info!(
[m[32m+                                    "Received market data: {} (type: {:?})",
[m[32m+                                    market_data.symbol, market_data.data_type
[m[32m+                                );
[m 
[31m-                while let Some(result) = stream.get_mut().next().await {
[m[31m-                    match result {
[m[31m-                        Ok(market_data) => {
[m[31m-                            event_count += 1;
[m[31m-                            info!(
[m[31m-                                "Received market data: {} (type: {:?})",
[m[31m-                                market_data.symbol, market_data.data_type
[m[31m-                            );
[m[31m-
[m[31m-                            if event_count >= max_events {
[m[32m+                                if event_count >= max_events {
[m[32m+                                    break;
[m[32m+                                }
[m[32m+                            },
[m[32m+                            Err(e) => {
[m[32m+                                warn!("Stream error: {}", e);
[m                                 break;
[31m-                            }
[m[32m+                            },
[m                         }
[31m-                        Err(e) => {
[m[31m-                            warn!("Stream error: {}", e);
[m[31m-                            break;
[m[31m-                        }
[m                     }
[31m-                }
[m[31m-            };
[m[32m+                };
[m 
[31m-            match tokio::time::timeout(timeout_duration, stream_fut).await {
[m[31m-                Ok(_) => {
[m[31m-                    info!("✅ Received {} market data events", event_count);
[m[32m+                match tokio::time::timeout(timeout_duration, stream_fut).await {
[m[32m+                    Ok(_) => {
[m[32m+                        info!("✅ Received {} market data events", event_count);
[m[32m+                    },
[m[32m+                    Err(_) => {
[m[32m+                        info!(
[m[32m+                            "⏱️ Stream timeout after {:?}, received {} events",
[m[32m+                            timeout_duration, event_count
[m[32m+                        );
[m[32m+                    },
[m                 }
[31m-                Err(_) => {
[m[31m-                    info!(
[m[31m-                        "⏱️ Stream timeout after {:?}, received {} events",
[m[31m-                        timeout_duration, event_count
[m[31m-                    );
[m[31m-                }
[m[31m-            }
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Market data streaming failed: {}", e);
[m[32m+                info!("This may be expected if data providers are not configured");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Market data streaming failed: {}", e);
[m[31m-            info!("This may be expected if data providers are not configured");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // BACKTESTING SERVICE INTEGRATION TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:288:
 
[31m-e2e_test!(test_backtesting_list, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing backtesting service - list backtests");
[m[32m+e2e_test!(
[m[32m+    test_backtesting_list,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing backtesting service - list backtests");
[m 
[31m-    // Get backtesting client
[m[31m-    let client_result = framework.get_backtesting_client().await;
[m[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Skipping backtesting list test - service not available");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        // Get backtesting client
[m[32m+        let client_result = framework.get_backtesting_client().await;
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Skipping backtesting list test - service not available");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    let backtesting_client = client_result.unwrap();
[m[32m+        let backtesting_client = client_result.unwrap();
[m 
[31m-    // List available backtests with all required fields
[m[31m-    let request = tonic::Request::new(ListBacktestsRequest {
[m[31m-        limit: 10,
[m[31m-        offset: 0,
[m[31m-        status_filter: None,
[m[31m-        strategy_name: None,
[m[31m-    });
[m[32m+        // List available backtests with all required fields
[m[32m+        let request = tonic::Request::new(ListBacktestsRequest {
[m[32m+            limit: 10,
[m[32m+            offset: 0,
[m[32m+            status_filter: None,
[m[32m+            strategy_name: None,
[m[32m+        });
[m 
[31m-    let response = backtesting_client.list_backtests(request).await;
[m[32m+        let response = backtesting_client.list_backtests(request).await;
[m 
[31m-    match response {
[m[31m-        Ok(backtest_list) => {
[m[31m-            let backtests = backtest_list.into_inner();
[m[31m-            info!("✅ Backtesting list query successful");
[m[31m-            info!("Found {} backtests", backtests.backtests.len());
[m[32m+        match response {
[m[32m+            Ok(backtest_list) => {
[m[32m+                let backtests = backtest_list.into_inner();
[m[32m+                info!("✅ Backtesting list query successful");
[m[32m+                info!("Found {} backtests", backtests.backtests.len());
[m 
[31m-            for bt in backtests.backtests.iter().take(3) {
[m[31m-                info!("  - {} (status: {:?})", bt.backtest_id, bt.status);
[m[31m-            }
[m[32m+                for bt in backtests.backtests.iter().take(3) {
[m[32m+                    info!("  - {} (status: {:?})", bt.backtest_id, bt.status);
[m[32m+                }
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Backtesting list query failed: {}", e);
[m[32m+                info!("This may be expected if backtesting service is not fully configured");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Backtesting list query failed: {}", e);
[m[31m-            info!("This may be expected if backtesting service is not fully configured");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // ML PIPELINE INTEGRATION TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:333:
 
[31m-e2e_test!(test_ml_pipeline_health, |framework: E2ETestFramework| async {
[m[31m-    info!("Testing ML pipeline health check");
[m[32m+e2e_test!(
[m[32m+    test_ml_pipeline_health,
[m[32m+    |framework: E2ETestFramework| async {
[m[32m+        info!("Testing ML pipeline health check");
[m 
[31m-    // Access ML pipeline from framework
[m[31m-    let ml_pipeline = &framework.ml_pipeline;
[m[32m+        // Access ML pipeline from framework
[m[32m+        let ml_pipeline = &framework.ml_pipeline;
[m 
[31m-    // Check models health
[m[31m-    let health_result = ml_pipeline.check_models_health().await;
[m[32m+        // Check models health
[m[32m+        let health_result = ml_pipeline.check_models_health().await;
[m 
[31m-    match health_result {
[m[31m-        Ok(status) => {
[m[31m-            info!("✅ ML pipeline health check successful");
[m[31m-            info!("Available models: {}", status.available_count());
[m[31m-            info!("  MAMBA: {}", if status.mamba_available { "✅" } else { "❌" });
[m[31m-            info!("  DQN: {}", if status.dqn_available { "✅" } else { "❌" });
[m[31m-            info!("  PPO: {}", if status.ppo_available { "✅" } else { "❌" });
[m[31m-            info!("  TFT: {}", if status.tft_available { "✅" } else { "❌" });
[m[31m-            info!("  TLOB: {}", if status.tlob_available { "✅" } else { "❌" });
[m[32m+        match health_result {
[m[32m+            Ok(status) => {
[m[32m+                info!("✅ ML pipeline health check successful");
[m[32m+                info!("Available models: {}", status.available_count());
[m[32m+                info!(
[m[32m+                    "  MAMBA: {}",
[m[32m+                    if status.mamba_available { "✅" } else { "❌" }
[m[32m+                );
[m[32m+                info!("  DQN: {}", if status.dqn_available { "✅" } else { "❌" });
[m[32m+                info!("  PPO: {}", if status.ppo_available { "✅" } else { "❌" });
[m[32m+                info!("  TFT: {}", if status.tft_available { "✅" } else { "❌" });
[m[32m+                info!(
[m[32m+                    "  TLOB: {}",
[m[32m+                    if status.tlob_available { "✅" } else { "❌" }
[m[32m+                );
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ ML pipeline health check failed: {}", e);
[m[32m+                info!("This may be expected if ML models are not loaded");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ ML pipeline health check failed: {}", e);
[m[31m-            info!("This may be expected if ML models are not loaded");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // DATABASE INTEGRATION TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:365:
 
[31m-e2e_test!(test_database_connection, |framework: E2ETestFramework| async {
[m[31m-    info!("Testing database connection");
[m[32m+e2e_test!(
[m[32m+    test_database_connection,
[m[32m+    |framework: E2ETestFramework| async {
[m[32m+        info!("Testing database connection");
[m 
[31m-    let db = &framework.database_harness;
[m[32m+        let db = &framework.database_harness;
[m 
[31m-    // Test database setup
[m[31m-    let setup_result = db.setup().await;
[m[32m+        // Test database setup
[m[32m+        let setup_result = db.setup().await;
[m 
[31m-    match setup_result {
[m[31m-        Ok(_) => {
[m[31m-            info!("✅ Database setup successful");
[m[32m+        match setup_result {
[m[32m+            Ok(_) => {
[m[32m+                info!("✅ Database setup successful");
[m 
[31m-            // Test teardown
[m[31m-            match db.teardown().await {
[m[31m-                Ok(_) => info!("✅ Database teardown successful"),
[m[31m-                Err(e) => warn!("⚠️ Database teardown failed: {}", e),
[m[31m-            }
[m[32m+                // Test teardown
[m[32m+                match db.teardown().await {
[m[32m+                    Ok(_) => info!("✅ Database teardown successful"),
[m[32m+                    Err(e) => warn!("⚠️ Database teardown failed: {}", e),
[m[32m+                }
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Database setup failed: {}", e);
[m[32m+                info!("This may be expected if database is not configured in test environment");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Database setup failed: {}", e);
[m[31m-            info!("This may be expected if database is not configured in test environment");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // PERFORMANCE TRACKING TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:396:
 
[31m-e2e_test!(test_performance_tracking, |framework: E2ETestFramework| async {
[m[31m-    info!("Testing performance tracking");
[m[32m+e2e_test!(
[m[32m+    test_performance_tracking,
[m[32m+    |framework: E2ETestFramework| async {
[m[32m+        info!("Testing performance tracking");
[m 
[31m-    let perf_tracker = &framework.performance_tracker;
[m[32m+        let perf_tracker = &framework.performance_tracker;
[m 
[31m-    // Record some test metrics (synchronous methods)
[m[31m-    perf_tracker.record_metric("test_latency_us", 42.5)?;
[m[31m-    perf_tracker.record_metric("test_throughput", 1000.0)?;
[m[31m-    perf_tracker.record_metric("test_success_rate", 0.95)?;
[m[32m+        // Record some test metrics (synchronous methods)
[m[32m+        perf_tracker.record_metric("test_latency_us", 42.5)?;
[m[32m+        perf_tracker.record_metric("test_throughput", 1000.0)?;
[m[32m+        perf_tracker.record_metric("test_success_rate", 0.95)?;
[m 
[31m-    info!("✅ Performance metrics recorded");
[m[32m+        info!("✅ Performance metrics recorded");
[m 
[31m-    // Get metric stats
[m[31m-    let latency_stats = perf_tracker.get_metric_stats("test_latency_us")?;
[m[32m+        // Get metric stats
[m[32m+        let latency_stats = perf_tracker.get_metric_stats("test_latency_us")?;
[m 
[31m-    if let Some(stats) = latency_stats {
[m[31m-        info!("Performance Summary:");
[m[31m-        info!("  Latency count: {}", stats.count);
[m[31m-        info!("  Latency mean: {:.2} μs", stats.mean);
[m[31m-        info!("  Latency min: {:.2} μs", stats.min);
[m[31m-        info!("  Latency max: {:.2} μs", stats.max);
[m[31m-    }
[m[32m+        if let Some(stats) = latency_stats {
[m[32m+            info!("Performance Summary:");
[m[32m+            info!("  Latency count: {}", stats.count);
[m[32m+            info!("  Latency mean: {:.2} μs", stats.mean);
[m[32m+            info!("  Latency min: {:.2} μs", stats.min);
[m[32m+            info!("  Latency max: {:.2} μs", stats.max);
[m[32m+        }
[m 
[31m-    // Generate full report
[m[31m-    let report = perf_tracker.generate_report()?;
[m[31m-    info!("Performance report generated: {} metrics", report.total_metrics_collected);
[m[31m-    info!("Session duration: {:?}", report.session_duration);
[m[32m+        // Generate full report
[m[32m+        let report = perf_tracker.generate_report()?;
[m[32m+        info!(
[m[32m+            "Performance report generated: {} metrics",
[m[32m+            report.total_metrics_collected
[m[32m+        );
[m[32m+        info!("Session duration: {:?}", report.session_duration);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
 //
 // INTEGRATION WORKFLOW TESTS
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:430:
 //
 
[31m-e2e_test!(test_complete_trading_workflow, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing complete trading workflow integration");
[m[32m+e2e_test!(
[m[32m+    test_complete_trading_workflow,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing complete trading workflow integration");
[m 
[31m-    let workflow_start = std::time::Instant::now();
[m[32m+        let workflow_start = std::time::Instant::now();
[m 
[31m-    // Step 1: Check services health
[m[31m-    info!("Step 1: Checking services health...");
[m[31m-    let health = framework.check_services_health().await?;
[m[31m-    info!("  Services health: {}", health.summary());
[m[32m+        // Step 1: Check services health
[m[32m+        info!("Step 1: Checking services health...");
[m[32m+        let health = framework.check_services_health().await?;
[m[32m+        info!("  Services health: {}", health.summary());
[m 
[31m-    // Step 2: Connect to trading service
[m[31m-    info!("Step 2: Connecting to Trading Service...");
[m[31m-    let client_result = framework.get_trading_client().await;
[m[32m+        // Step 2: Connect to trading service
[m[32m+        info!("Step 2: Connecting to Trading Service...");
[m[32m+        let client_result = framework.get_trading_client().await;
[m 
[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Trading service not available, skipping workflow test");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Trading service not available, skipping workflow test");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    let trading_client = client_result.unwrap();
[m[31m-    info!("  ✅ Connected to Trading Service");
[m[32m+        let trading_client = client_result.unwrap();
[m[32m+        info!("  ✅ Connected to Trading Service");
[m 
[31m-    // Step 3: Query portfolio
[m[31m-    info!("Step 3: Querying portfolio...");
[m[31m-    let portfolio_request = tonic::Request::new(GetPortfolioSummaryRequest {
[m[31m-        account_id: "test_account".to_string(),
[m[31m-    });
[m[31m-    let portfolio_result = trading_client
[m[31m-        .get_portfolio_summary(portfolio_request)
[m[31m-        .await;
[m[32m+        // Step 3: Query portfolio
[m[32m+        info!("Step 3: Querying portfolio...");
[m[32m+        let portfolio_request = tonic::Request::new(GetPortfolioSummaryRequest {
[m[32m+            account_id: "test_account".to_string(),
[m[32m+        });
[m[32m+        let portfolio_result = trading_client
[m[32m+            .get_portfolio_summary(portfolio_request)
[m[32m+            .await;
[m 
[31m-    match portfolio_result {
[m[31m-        Ok(portfolio) => {
[m[31m-            let p = portfolio.into_inner();
[m[31m-            info!("  ✅ Portfolio: ${:.2} total value", p.total_value);
[m[32m+        match portfolio_result {
[m[32m+            Ok(portfolio) => {
[m[32m+                let p = portfolio.into_inner();
[m[32m+                info!("  ✅ Portfolio: ${:.2} total value", p.total_value);
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("  ⚠️ Portfolio query failed: {}", e);
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("  ⚠️ Portfolio query failed: {}", e);
[m[31m-        }
[m[31m-    }
[m 
[31m-    // Step 4: Submit test order
[m[31m-    info!("Step 4: Submitting test order...");
[m[31m-    let order = SubmitOrderRequest {
[m[31m-        symbol: "EURUSD".to_string(),
[m[31m-        side: OrderSide::Buy.into(),
[m[31m-        quantity: 10000.0,
[m[31m-        order_type: OrderType::Market.into(),
[m[31m-        price: None,
[m[31m-        stop_price: None,
[m[31m-        account_id: "test_account".to_string(),
[m[31m-        metadata: std::collections::HashMap::new(),
[m[31m-    };
[m[32m+        // Step 4: Submit test order
[m[32m+        info!("Step 4: Submitting test order...");
[m[32m+        let order = SubmitOrderRequest {
[m[32m+            symbol: "EURUSD".to_string(),
[m[32m+            side: OrderSide::Buy.into(),
[m[32m+            quantity: 10000.0,
[m[32m+            order_type: OrderType::Market.into(),
[m[32m+            price: None,
[m[32m+            stop_price: None,
[m[32m+            account_id: "test_account".to_string(),
[m[32m+            metadata: std::collections::HashMap::new(),
[m[32m+        };
[m 
[31m-    let order_request = tonic::Request::new(order);
[m[31m-    let order_result = trading_client.submit_order(order_request).await;
[m[32m+        let order_request = tonic::Request::new(order);
[m[32m+        let order_result = trading_client.submit_order(order_request).await;
[m 
[31m-    match order_result {
[m[31m-        Ok(response) => {
[m[31m-            let order_response = response.into_inner();
[m[31m-            info!(
[m[31m-                "  ✅ Order submitted: {} (status: {:?})",
[m[31m-                order_response.order_id, order_response.status
[m[31m-            );
[m[32m+        match order_result {
[m[32m+            Ok(response) => {
[m[32m+                let order_response = response.into_inner();
[m[32m+                info!(
[m[32m+                    "  ✅ Order submitted: {} (status: {:?})",
[m[32m+                    order_response.order_id, order_response.status
[m[32m+                );
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("  ⚠️ Order submission failed: {}", e);
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("  ⚠️ Order submission failed: {}", e);
[m[31m-        }
[m[31m-    }
[m 
[31m-    // Step 5: Record performance
[m[31m-    let workflow_duration = workflow_start.elapsed();
[m[31m-    info!(
[m[31m-        "✅ Complete trading workflow finished in {:?}",
[m[31m-        workflow_duration
[m[31m-    );
[m[32m+        // Step 5: Record performance
[m[32m+        let workflow_duration = workflow_start.elapsed();
[m[32m+        info!(
[m[32m+            "✅ Complete trading workflow finished in {:?}",
[m[32m+            workflow_duration
[m[32m+        );
[m 
[31m-    framework
[m[31m-        .performance_tracker
[m[31m-        .record_metric("workflow_duration_ms", workflow_duration.as_millis() as f64)?;
[m[32m+        framework
[m[32m+            .performance_tracker
[m[32m+            .record_metric("workflow_duration_ms", workflow_duration.as_millis() as f64)?;
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
[31m-e2e_test!(test_multi_service_integration, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing multi-service integration");
[m[32m+e2e_test!(
[m[32m+    test_multi_service_integration,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing multi-service integration");
[m 
[31m-    // Test connections to multiple services
[m[31m-    let mut services_available = 0;
[m[32m+        // Test connections to multiple services
[m[32m+        let mut services_available = 0;
[m 
[31m-    // Test Trading Service
[m[31m-    if framework.get_trading_client().await.is_ok() {
[m[31m-        info!("✅ Trading Service available");
[m[31m-        services_available += 1;
[m[31m-    } else {
[m[31m-        warn!("⚠️ Trading Service not available");
[m[31m-    }
[m[32m+        // Test Trading Service
[m[32m+        if framework.get_trading_client().await.is_ok() {
[m[32m+            info!("✅ Trading Service available");
[m[32m+            services_available += 1;
[m[32m+        } else {
[m[32m+            warn!("⚠️ Trading Service not available");
[m[32m+        }
[m 
[31m-    // Test Backtesting Service
[m[31m-    if framework.get_backtesting_client().await.is_ok() {
[m[31m-        info!("✅ Backtesting Service available");
[m[31m-        services_available += 1;
[m[31m-    } else {
[m[31m-        warn!("⚠️ Backtesting Service not available");
[m[31m-    }
[m[32m+        // Test Backtesting Service
[m[32m+        if framework.get_backtesting_client().await.is_ok() {
[m[32m+            info!("✅ Backtesting Service available");
[m[32m+            services_available += 1;
[m[32m+        } else {
[m[32m+            warn!("⚠️ Backtesting Service not available");
[m[32m+        }
[m 
[31m-    // Test Config Service (if available)
[m[31m-    if framework.get_config_client().await.is_ok() {
[m[31m-        info!("✅ Config Service available");
[m[31m-        services_available += 1;
[m[31m-    } else {
[m[31m-        warn!("⚠️ Config Service not available");
[m[31m-    }
[m[32m+        // Test Config Service (if available)
[m[32m+        if framework.get_config_client().await.is_ok() {
[m[32m+            info!("✅ Config Service available");
[m[32m+            services_available += 1;
[m[32m+        } else {
[m[32m+            warn!("⚠️ Config Service not available");
[m[32m+        }
[m 
[31m-    info!(
[m[31m-        "Multi-service integration: {}/3 services available",
[m[31m-        services_available
[m[31m-    );
[m[32m+        info!(
[m[32m+            "Multi-service integration: {}/3 services available",
[m[32m+            services_available
[m[32m+        );
[m 
[31m-    // Test ML pipeline
[m[31m-    let ml_result = framework.ml_pipeline.check_models_health().await;
[m[32m+        // Test ML pipeline
[m[32m+        let ml_result = framework.ml_pipeline.check_models_health().await;
[m 
[31m-    if ml_result.is_ok() {
[m[31m-        info!("✅ ML Pipeline available");
[m[31m-        services_available += 1;
[m[31m-    } else {
[m[31m-        warn!("⚠️ ML Pipeline not available");
[m[31m-    }
[m[32m+        if ml_result.is_ok() {
[m[32m+            info!("✅ ML Pipeline available");
[m[32m+            services_available += 1;
[m[32m+        } else {
[m[32m+            warn!("⚠️ ML Pipeline not available");
[m[32m+        }
[m 
[31m-    info!(
[m[31m-        "✅ Multi-service integration test completed: {}/4 components available",
[m[31m-        services_available
[m[31m-    );
[m[32m+        info!(
[m[32m+            "✅ Multi-service integration test completed: {}/4 components available",
[m[32m+            services_available
[m[32m+        );
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
 //
 // ERROR HANDLING AND RESILIENCE TESTS
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:571:
 //
 
[31m-e2e_test!(test_service_timeout_handling, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing service timeout handling");
[m[32m+e2e_test!(
[m[32m+    test_service_timeout_handling,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing service timeout handling");
[m 
[31m-    // Try to connect with aggressive timeout
[m[31m-    let timeout_duration = Duration::from_secs(1);
[m[32m+        // Try to connect with aggressive timeout
[m[32m+        let timeout_duration = Duration::from_secs(1);
[m 
[31m-    let connect_with_timeout = async {
[m[31m-        framework.get_trading_client().await
[m[31m-    };
[m[32m+        let connect_with_timeout = async { framework.get_trading_client().await };
[m 
[31m-    let result = tokio::time::timeout(timeout_duration, connect_with_timeout).await;
[m[32m+        let result = tokio::time::timeout(timeout_duration, connect_with_timeout).await;
[m 
[31m-    match result {
[m[31m-        Ok(Ok(_)) => {
[m[31m-            info!("✅ Service connected within timeout");
[m[32m+        match result {
[m[32m+            Ok(Ok(_)) => {
[m[32m+                info!("✅ Service connected within timeout");
[m[32m+            },
[m[32m+            Ok(Err(e)) => {
[m[32m+                info!("✅ Connection failed gracefully: {}", e);
[m[32m+            },
[m[32m+            Err(_) => {
[m[32m+                info!("✅ Connection timed out as expected");
[m[32m+            },
[m         }
[31m-        Ok(Err(e)) => {
[m[31m-            info!("✅ Connection failed gracefully: {}", e);
[m[31m-        }
[m[31m-        Err(_) => {
[m[31m-            info!("✅ Connection timed out as expected");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+e2e_test!(
[m[32m+    test_graceful_shutdown,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing graceful service shutdown");
[m 
[31m-e2e_test!(test_graceful_shutdown, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing graceful service shutdown");
[m[32m+        // Services should already be started
[m[32m+        assert!(
[m[32m+            framework.services_started,
[m[32m+            "Services should be started initially"
[m[32m+        );
[m 
[31m-    // Services should already be started
[m[31m-    assert!(
[m[31m-        framework.services_started,
[m[31m-        "Services should be started initially"
[m[31m-    );
[m[32m+        // Stop services
[m[32m+        let stop_result = framework.stop_services().await;
[m 
[31m-    // Stop services
[m[31m-    let stop_result = framework.stop_services().await;
[m[31m-
[m[31m-    match stop_result {
[m[31m-        Ok(_) => {
[m[31m-            info!("✅ Services stopped gracefully");
[m[31m-            assert!(
[m[31m-                !framework.services_started,
[m[31m-                "Services should be marked as stopped"
[m[31m-            );
[m[32m+        match stop_result {
[m[32m+            Ok(_) => {
[m[32m+                info!("✅ Services stopped gracefully");
[m[32m+                assert!(
[m[32m+                    !framework.services_started,
[m[32m+                    "Services should be marked as stopped"
[m[32m+                );
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Service shutdown encountered issues: {}", e);
[m[32m+                info!("This may be expected in test environments");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Service shutdown encountered issues: {}", e);
[m[31m-            info!("This may be expected in test environments");
[m[31m-        }
[m[31m-    }
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:37:
 
         metrics.insert(
             "mamba_available".to_string(),
[31m-            if model_status.mamba_available { 1.0 } else { 0.0 },
[m[32m+            if model_status.mamba_available {
[m[32m+                1.0
[m[32m+            } else {
[m[32m+                0.0
[m[32m+            },
[m         );
         metrics.insert(
             "dqn_available".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:49:
         );
         metrics.insert(
             "tlob_available".to_string(),
[31m-            if model_status.tlob_available { 1.0 } else { 0.0 },
[m[32m+            if model_status.tlob_available {
[m[32m+                1.0
[m[32m+            } else {
[m[32m+                0.0
[m[32m+            },
[m         );
         metrics.insert(
             "models_available".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:399:
         );
 
         // Log individual model contributions
[31m-        for (i, pred) in ensemble_prediction.individual_predictions.iter().enumerate() {
[m[32m+        for (i, pred) in ensemble_prediction
[m[32m+            .individual_predictions
[m[32m+            .iter()
[m[32m+            .enumerate()
[m[32m+        {
[m             debug!(
                 "   Model {}: {} signal={:.4}, confidence={:.4}",
                 i + 1,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:571:
 mod tests {
     use super::*;
 
[31m-    e2e_test!(test_ml_model_health, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_ml_model_health().await?;
[m[31m-        assert!(result.success, "ML model health check failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_ml_model_health,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_ml_model_health().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "ML model health check failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_feature_extraction, |framework: Arc<E2ETestFramework>| async move {
[m[32m+    e2e_test!(test_feature_extraction, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m         let ml_tests = MLModelIntegrationTests::new(framework);
         let result = ml_tests.test_feature_extraction().await?;
[31m-        assert!(result.success, "Feature extraction failed: {:?}", result.error_message);
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Feature extraction failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m         Ok(())
     });
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:588:
[31m-    e2e_test!(test_mamba_inference, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_mamba_inference().await?;
[m[31m-        assert!(result.success, "MAMBA inference failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_mamba_inference,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_mamba_inference().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "MAMBA inference failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_dqn_inference, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_dqn_inference().await?;
[m[31m-        assert!(result.success, "DQN inference failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_dqn_inference,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_dqn_inference().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "DQN inference failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_tft_inference, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_tft_inference().await?;
[m[31m-        assert!(result.success, "TFT inference failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_tft_inference,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_tft_inference().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "TFT inference failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_tlob_inference, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_tlob_inference().await?;
[m[31m-        assert!(result.success, "TLOB inference failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_tlob_inference,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_tlob_inference().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "TLOB inference failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_ensemble_prediction, |framework: Arc<E2ETestFramework>| async move {
[m[32m+    e2e_test!(test_ensemble_prediction, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m         let ml_tests = MLModelIntegrationTests::new(framework);
         let result = ml_tests.test_ensemble_prediction().await?;
[31m-        assert!(result.success, "Ensemble prediction failed: {:?}", result.error_message);
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Ensemble prediction failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m         Ok(())
     });
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:623:
[31m-    e2e_test!(test_model_performance, |framework: Arc<E2ETestFramework>| async move {
[m[32m+    e2e_test!(test_model_performance, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m         let ml_tests = MLModelIntegrationTests::new(framework);
         let result = ml_tests.test_model_performance().await?;
[31m-        assert!(result.success, "Model performance test failed: {:?}", result.error_message);
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Model performance test failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m         Ok(())
     });
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:630:
[31m-    e2e_test!(test_model_failover, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_model_failover().await?;
[m[31m-        assert!(result.success, "Model failover test failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_model_failover,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_model_failover().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "Model failover test failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:8:
 use std::collections::HashMap;
 use trading_engine::compliance::{
     audit_trails::{
[31m-        AuditEventDetails, AuditEventType, AuditTrailConfig, AuditTrailEngine,
[m[31m-        ExecutionDetails, OrderDetails, RiskLevel, TransactionAuditEvent,
[m[32m+        AuditEventDetails, AuditEventType, AuditTrailConfig, AuditTrailEngine, ExecutionDetails,
[m[32m+        OrderDetails, RiskLevel, TransactionAuditEvent,
[m     },
     best_execution::{BestExecutionAnalyzer, BestExecutionConfig},
     ComplianceConfig, ComplianceContext, ComplianceEngine, OrderInfo,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:71:
     };
 
     let log_result = audit_engine.log_order_created(order_id, &order_details);
[31m-    assert!(
[m[31m-        log_result.is_ok(),
[m[31m-        "Order creation logging should succeed"
[m[31m-    );
[m[32m+    assert!(log_result.is_ok(), "Order creation logging should succeed");
[m 
     // Step 3: Log order execution event
     let execution_details = ExecutionDetails {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:135:
     };
 
     let log_result = audit_engine.log_event(audit_event);
[31m-    assert!(log_result.is_ok(), "Compliance event logging should succeed");
[m[32m+    assert!(
[m[32m+        log_result.is_ok(),
[m[32m+        "Compliance event logging should succeed"
[m[32m+    );
[m 
     // Step 5: Verify compliance tags are present
     // In a real test, we would query the audit trail here
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:211:
             println!("   - Compliance status: {}", analysis.is_compliant);
             println!("   - Execution score: {}", analysis.execution_score);
             println!("   - Cost analysis: {:?}", analysis.cost_analysis);
[31m-        }
[m[32m+        },
[m         Err(e) => {
[31m-            println!("⚠️  Best execution analysis returned error (expected in test env): {}", e);
[m[32m+            println!(
[m[32m+                "⚠️  Best execution analysis returned error (expected in test env): {}",
[m[32m+                e
[m[32m+            );
[m             println!("   - Analyzer created successfully");
             println!("   - Order info validated");
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:393:
         .expect("Multi-regulation assessment should succeed");
 
     println!("✅ Multi-regulation compliance assessment completed");
[31m-    println!("   - Overall compliance score: {}", assessment.compliance_score);
[m[32m+    println!(
[m[32m+        "   - Overall compliance score: {}",
[m[32m+        assessment.compliance_score
[m[32m+    );
[m     println!("   - MiFID II status: {:?}", assessment.mifid2_status);
     println!("   - SOX status: {:?}", assessment.sox_status);
     println!("   - MAR status: {:?}", assessment.mar_status);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/compliance_regulatory_tests.rs:400:
[31m-    println!("   - Data protection status: {:?}", assessment.data_protection_status);
[m[32m+    println!(
[m[32m+        "   - Data protection status: {:?}",
[m[32m+        assessment.data_protection_status
[m[32m+    );
[m     println!("   - Total findings: {}", assessment.findings.len());
 
     // Verify all regulations were evaluated
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:77:
         let mut ml_test = ml_pipeline::MLPipelineTestHarness::new().await?;
 
         // MAMBA test
[31m-        if ml_test.predict_with_mamba(&[feature_vector.clone()]).await.is_ok() {
[m[32m+        if ml_test
[m[32m+            .predict_with_mamba(&[feature_vector.clone()])
[m[32m+            .await
[m[32m+            .is_ok()
[m[32m+        {
[m             info!("✓ MAMBA prediction completed");
             steps_completed += 1;
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:84:
 
         // DQN test
[31m-        if ml_test.predict_with_dqn(&[feature_vector.clone()]).await.is_ok() {
[m[32m+        if ml_test
[m[32m+            .predict_with_dqn(&[feature_vector.clone()])
[m[32m+            .await
[m[32m+            .is_ok()
[m[32m+        {
[m             info!("✓ DQN prediction completed");
             steps_completed += 1;
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:90:
 
         // TFT test
[31m-        if ml_test.predict_with_tft(&[feature_vector.clone()]).await.is_ok() {
[m[32m+        if ml_test
[m[32m+            .predict_with_tft(&[feature_vector.clone()])
[m[32m+            .await
[m[32m+            .is_ok()
[m[32m+        {
[m             info!("✓ TFT prediction completed");
             steps_completed += 1;
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:113:
             ensemble_result.signal_strength,
         );
 
[31m-        let mut result =
[m[31m-            WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m[32m+        let mut result = WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m         result.metrics = metrics;
 
         Ok(result)
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:161:
         // Verify end-to-end pipeline latency
         let duration = start_time.elapsed();
         if duration < Duration::from_millis(500) {
[31m-            info!("✓ Pipeline completed in {:?} (within latency target)", duration);
[m[32m+            info!(
[m[32m+                "✓ Pipeline completed in {:?} (within latency target)",
[m[32m+                duration
[m[32m+            );
[m             steps_completed += 1;
         } else {
             warn!("⚠ Pipeline took {:?} (may exceed latency target)", duration);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:172:
         metrics.insert("feature_vectors".to_string(), features.len() as f64);
         metrics.insert("pipeline_ms".to_string(), duration.as_millis() as f64);
 
[31m-        let mut result =
[m[31m-            WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m[32m+        let mut result = WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m         result.metrics = metrics;
 
         info!("✅ Data Flow Integration completed in {:?}", duration);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:210:
             info!("✓ ML inference meets latency target");
             steps_completed += 1;
         } else {
[31m-            warn!("⚠ ML inference latency exceeds target: {:?}", inference_latency);
[m[32m+            warn!(
[m[32m+                "⚠ ML inference latency exceeds target: {:?}",
[m[32m+                inference_latency
[m[32m+            );
[m         }
 
         // Test feature extraction performance
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:233:
             extraction_latency.as_millis() as f64,
         );
 
[31m-        let mut result =
[m[31m-            WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m[32m+        let mut result = WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m         result.metrics = metrics;
 
         info!("✅ Performance Validation completed in {:?}", duration);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:257:
 
         // Test baseline ensemble prediction
         let test_features: Vec<f64> = (0..50).map(|_| rand::random::<f64>()).collect();
[31m-        let baseline = ml_test.test_ensemble_prediction(test_features.clone()).await?;
[m[31m-        info!("✓ Baseline ensemble prediction: {:.2}% confidence", baseline.confidence * 100.0);
[m[32m+        let baseline = ml_test
[m[32m+            .test_ensemble_prediction(test_features.clone())
[m[32m+            .await?;
[m[32m+        info!(
[m[32m+            "✓ Baseline ensemble prediction: {:.2}% confidence",
[m[32m+            baseline.confidence * 100.0
[m[32m+        );
[m         steps_completed += 1;
 
         // Disable one model and verify ensemble still works
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:265:
         ml_test.disable_model("mamba").await?;
[31m-        let failover1 = ml_test.test_ensemble_prediction(test_features.clone()).await?;
[m[31m-        info!("✓ Ensemble works with MAMBA disabled: {:.2}% confidence", failover1.confidence * 100.0);
[m[32m+        let failover1 = ml_test
[m[32m+            .test_ensemble_prediction(test_features.clone())
[m[32m+            .await?;
[m[32m+        info!(
[m[32m+            "✓ Ensemble works with MAMBA disabled: {:.2}% confidence",
[m[32m+            failover1.confidence * 100.0
[m[32m+        );
[m         steps_completed += 1;
 
         // Disable another model
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:271:
         ml_test.disable_model("dqn").await?;
[31m-        let failover2 = ml_test.test_ensemble_prediction(test_features.clone()).await?;
[m[31m-        info!("✓ Ensemble works with MAMBA+DQN disabled: {:.2}% confidence", failover2.confidence * 100.0);
[m[32m+        let failover2 = ml_test
[m[32m+            .test_ensemble_prediction(test_features.clone())
[m[32m+            .await?;
[m[32m+        info!(
[m[32m+            "✓ Ensemble works with MAMBA+DQN disabled: {:.2}% confidence",
[m[32m+            failover2.confidence * 100.0
[m[32m+        );
[m         steps_completed += 1;
 
         // Re-enable models
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:277:
         ml_test.enable_model("mamba").await?;
         ml_test.enable_model("dqn").await?;
         let restored = ml_test.test_ensemble_prediction(test_features).await?;
[31m-        info!("✓ Ensemble restored: {:.2}% confidence", restored.confidence * 100.0);
[m[32m+        info!(
[m[32m+            "✓ Ensemble restored: {:.2}% confidence",
[m[32m+            restored.confidence * 100.0
[m[32m+        );
[m         steps_completed += 1;
 
         let duration = start_time.elapsed();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:287:
         metrics.insert("failover2_confidence".to_string(), failover2.confidence);
         metrics.insert("restored_confidence".to_string(), restored.confidence);
 
[31m-        let mut result =
[m[31m-            WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m[32m+        let mut result = WorkflowTestResult::success(workflow_name, duration, steps_completed);
[m         result.metrics = metrics;
 
         info!("✅ ML Model Failover completed in {:?}", duration);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/comprehensive_trading_workflows.rs:306:
     use super::*;
     use foxhunt_e2e::e2e_test;
 
[31m-    e2e_test!(
[m[31m-        test_ml_inference_pipeline,
[m[31m-        |framework: Arc<E2ETestFramework>| async move {
[m[31m-            let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[31m-            let result = workflows.test_ml_inference_pipeline().await?;
[m[31m-            assert!(
[m[31m-                result.success,
[m[31m-                "ML inference pipeline failed: {:?}",
[m[31m-                result.error_message
[m[31m-            );
[m[31m-            assert!(
[m[31m-                result.metrics.contains_key("ensemble_confidence"),
[m[31m-                "Missing ensemble confidence metric"
[m[31m-            );
[m[31m-            Ok(())
[m[31m-        }
[m[31m-    );
[m[32m+    e2e_test!(test_ml_inference_pipeline, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m[32m+        let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[32m+        let result = workflows.test_ml_inference_pipeline().await?;
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "ML inference pipeline failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m[32m+        assert!(
[m[32m+            result.metrics.contains_key("ensemble_confidence"),
[m[32m+            "Missing ensemble confidence metric"
[m[32m+        );
[m[32m+        Ok(())
[m[32m+    });
[m 
[31m-    e2e_test!(
[m[31m-        test_data_flow_integration,
[m[31m-        |framework: Arc<E2ETestFramework>| async move {
[m[31m-            let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[31m-            let result = workflows.test_data_flow_integration().await?;
[m[31m-            assert!(
[m[31m-                result.success,
[m[31m-                "Data flow integration failed: {:?}",
[m[31m-                result.error_message
[m[31m-            );
[m[31m-            assert!(
[m[31m-                result.metrics.get("pipeline_ms").unwrap_or(&1000.0) < &500.0,
[m[31m-                "Pipeline latency too high"
[m[31m-            );
[m[31m-            Ok(())
[m[31m-        }
[m[31m-    );
[m[32m+    e2e_test!(test_data_flow_integration, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m[32m+        let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[32m+        let result = workflows.test_data_flow_integration().await?;
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Data flow integration failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m[32m+        assert!(
[m[32m+            result.metrics.get("pipeline_ms").unwrap_or(&1000.0) < &500.0,
[m[32m+            "Pipeline latency too high"
[m[32m+        );
[m[32m+        Ok(())
[m[32m+    });
[m 
[31m-    e2e_test!(
[m[31m-        test_performance_validation,
[m[31m-        |framework: Arc<E2ETestFramework>| async move {
[m[31m-            let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[31m-            let result = workflows.test_performance_validation().await?;
[m[31m-            assert!(
[m[31m-                result.success,
[m[31m-                "Performance validation failed: {:?}",
[m[31m-                result.error_message
[m[31m-            );
[m[31m-            let ml_latency = result.metrics.get("ml_inference_ms").unwrap_or(&1000.0);
[m[31m-            assert!(
[m[31m-                ml_latency < &100.0,
[m[31m-                "ML inference too slow: {}ms",
[m[31m-                ml_latency
[m[31m-            );
[m[31m-            Ok(())
[m[31m-        }
[m[31m-    );
[m[32m+    e2e_test!(test_performance_validation, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m[32m+        let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[32m+        let result = workflows.test_performance_validation().await?;
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Performance validation failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m[32m+        let ml_latency = result.metrics.get("ml_inference_ms").unwrap_or(&1000.0);
[m[32m+        assert!(
[m[32m+            ml_latency < &100.0,
[m[32m+            "ML inference too slow: {}ms",
[m[32m+            ml_latency
[m[32m+        );
[m[32m+        Ok(())
[m[32m+    });
[m 
[31m-    e2e_test!(
[m[31m-        test_ml_model_failover,
[m[31m-        |framework: Arc<E2ETestFramework>| async move {
[m[31m-            let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[31m-            let result = workflows.test_ml_model_failover().await?;
[m[31m-            assert!(
[m[31m-                result.success,
[m[31m-                "ML model failover failed: {:?}",
[m[31m-                result.error_message
[m[31m-            );
[m[31m-            assert!(
[m[31m-                result.metrics.contains_key("baseline_confidence"),
[m[31m-                "Missing baseline confidence metric"
[m[31m-            );
[m[31m-            Ok(())
[m[31m-        }
[m[31m-    );
[m[32m+    e2e_test!(test_ml_model_failover, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m[32m+        let workflows = ComprehensiveTradingWorkflows::new(framework);
[m[32m+        let result = workflows.test_ml_model_failover().await?;
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "ML model failover failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m[32m+        assert!(
[m[32m+            result.metrics.contains_key("baseline_confidence"),
[m[32m+            "Missing baseline confidence metric"
[m[32m+        );
[m[32m+        Ok(())
[m[32m+    });
[m }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:66:
 
         // Cache entry should still exist since it was just created
         let still_cached = config_manager.get_cached_config(&cache_key);
[31m-        assert!(still_cached.is_some(), "Recent cache entry should not be cleaned up");
[m[32m+        assert!(
[m[32m+            still_cached.is_some(),
[m[32m+            "Recent cache entry should not be cleaned up"
[m[32m+        );
[m         info!("✅ Cache cleanup logic verified");
 
         // Step 6: Test cache miss
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:189:
         };
 
         let asset_manager = config::AssetClassificationManager::new();
[31m-        let config_manager = config::ConfigManager::with_asset_classification(
[m[31m-            service_config,
[m[31m-            asset_manager,
[m[31m-        );
[m[32m+        let config_manager =
[m[32m+            config::ConfigManager::with_asset_classification(service_config, asset_manager);
[m 
         // Step 2: Test symbol classification without loaded configs
         info!("🔍 Testing symbol classification");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:229:
         info!("✅ Volatility profile handling verified");
 
         // Step 5: Test position size recommendation
[31m-        let position_size = config_manager.get_position_size_recommendation(
[m[31m-            "AAPL",
[m[31m-            rust_decimal::Decimal::new(1000000, 0),
[m[31m-        );
[m[32m+        let position_size = config_manager
[m[32m+            .get_position_size_recommendation("AAPL", rust_decimal::Decimal::new(1000000, 0));
[m         assert!(
             position_size.is_none(),
             "Position size should be None without loaded configs"
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:278:
 
         // Step 2: Test serialization
         info!("🔄 Testing JSON serialization");
[31m-        let serialized = serde_json::to_string(&original_config)
[m[31m-            .context("Failed to serialize config")?;
[m[32m+        let serialized =
[m[32m+            serde_json::to_string(&original_config).context("Failed to serialize config")?;
[m 
         assert!(!serialized.is_empty());
         info!("✅ Serialization successful: {} bytes", serialized.len());
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:286:
 
         // Step 3: Test deserialization
         info!("🔄 Testing JSON deserialization");
[31m-        let deserialized: config::ServiceConfig = serde_json::from_str(&serialized)
[m[31m-            .context("Failed to deserialize config")?;
[m[32m+        let deserialized: config::ServiceConfig =
[m[32m+            serde_json::from_str(&serialized).context("Failed to deserialize config")?;
[m 
         assert_eq!(original_config.name, deserialized.name);
         assert_eq!(original_config.environment, deserialized.environment);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/config_hot_reload_e2e.rs:367:
         info!("🧹 Testing cleanup of expired entries");
 
         // Add multiple entries
[31m-        config_manager.set_cached_config(
[m[31m-            "key1".to_string(),
[m[31m-            serde_json::json!({"value": 1}),
[m[31m-        );
[m[31m-        config_manager.set_cached_config(
[m[31m-            "key2".to_string(),
[m[31m-            serde_json::json!({"value": 2}),
[m[31m-        );
[m[32m+        config_manager.set_cached_config("key1".to_string(), serde_json::json!({"value": 1}));
[m[32m+        config_manager.set_cached_config("key2".to_string(), serde_json::json!({"value": 2}));
[m 
         // Wait for expiration
         tokio::time::sleep(Duration::from_millis(150)).await;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:17:
 use tracing::{info, warn};
 use uuid::Uuid;
 
[31m-use foxhunt_e2e::*;
[m use foxhunt_e2e::proto::risk::ValidateOrderRequest;
 use foxhunt_e2e::proto::trading::OrderSide;
 use foxhunt_e2e::utils::{
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:24:
[31m-    TradingOperations, SimdPriceOps, LockFreeRingBuffer, SmallBatchProcessor,
[m[31m-    TradingEvent,
[m[32m+    LockFreeRingBuffer, SimdPriceOps, SmallBatchProcessor, TradingEvent, TradingOperations,
[m };
[32m+use foxhunt_e2e::*;
[m 
 // Define test-specific OrderRequest (simpler than the utils version)
 #[derive(Clone, Debug)]
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:36:
 }
 
 // Import timing primitives from trading_engine
[31m-use trading_engine::timing::{HardwareTimestamp, calibrate_tsc, is_tsc_reliable};
[m[32m+use trading_engine::timing::{calibrate_tsc, is_tsc_reliable, HardwareTimestamp};
[m 
 // Stub implementations for testing - actual implementations are in separate modules
 mod test_stubs {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:61:
             Ok(Self)
         }
 
[31m-        pub async fn extract_technical_features(&self, _data: &[DatabenttoEvent]) -> Result<Vec<f64>> {
[m[32m+        pub async fn extract_technical_features(
[m[32m+            &self,
[m[32m+            _data: &[DatabenttoEvent],
[m[32m+        ) -> Result<Vec<f64>> {
[m             Ok(vec![0.5; 10]) // Stub features
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:68:
[31m-        pub async fn extract_orderbook_features(&self, _data: &[DatabenttoEvent]) -> Result<Vec<f64>> {
[m[32m+        pub async fn extract_orderbook_features(
[m[32m+            &self,
[m[32m+            _data: &[DatabenttoEvent],
[m[32m+        ) -> Result<Vec<f64>> {
[m             Ok(vec![0.3; 8])
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:174:
             })
         }
 
[31m-        pub async fn generate_market_data(&self, _symbol: &str, count: usize) -> Result<Vec<DatabenttoEvent>> {
[m[32m+        pub async fn generate_market_data(
[m[32m+            &self,
[m[32m+            _symbol: &str,
[m[32m+            count: usize,
[m[32m+        ) -> Result<Vec<DatabenttoEvent>> {
[m             let mut events = Vec::new();
             for _ in 0..count {
                 events.push(DatabenttoEvent {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:194:
                 let has_anomaly = i % 10 == 0;
                 ticks.push(MarketTick {
                     price: if has_anomaly { 200.0 } else { 150.0 },
[31m-                    volume: if has_anomaly { 50_000_000.0 } else { 1_000_000.0 },
[m[32m+                    volume: if has_anomaly {
[m[32m+                        50_000_000.0
[m[32m+                    } else {
[m[32m+                        1_000_000.0
[m[32m+                    },
[m                 });
             }
             Ok(ticks)
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:205:
     pub struct MLPipeline;
 
     impl MLPipeline {
[31m-        pub async fn test_ensemble_prediction(&self, _features: Vec<f64>) -> Result<EnsembleResult> {
[m[32m+        pub async fn test_ensemble_prediction(
[m[32m+            &self,
[m[32m+            _features: Vec<f64>,
[m[32m+        ) -> Result<EnsembleResult> {
[m             Ok(EnsembleResult {
                 confidence: 0.85,
                 signal_strength: 0.42,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:212:
             })
         }
 
[31m-        pub async fn test_lightweight_inference(&self, _features: Vec<f64>) -> Result<EnsembleResult> {
[m[32m+        pub async fn test_lightweight_inference(
[m[32m+            &self,
[m[32m+            _features: Vec<f64>,
[m[32m+        ) -> Result<EnsembleResult> {
[m             Ok(EnsembleResult {
                 confidence: 0.90,
                 signal_strength: 0.35,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:228:
             Ok(())
         }
 
[31m-        pub async fn get_recent_events(&self, _event_type: &str, limit: usize) -> Result<Vec<super::TradingEvent>> {
[m[32m+        pub async fn get_recent_events(
[m[32m+            &self,
[m[32m+            _event_type: &str,
[m[32m+            limit: usize,
[m[32m+        ) -> Result<Vec<super::TradingEvent>> {
[m             Ok((0..limit)
                 .map(|i| super::TradingEvent {
                     id: uuid::Uuid::new_v4(),
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:1020:
                     symbol: "AAPL".to_string(),
                     quantity: 100.0,
                     price: 150.0 + (i as f64 * 0.1),
[31m-                    side: if i % 2 == 0 { OrderSide::Buy } else { OrderSide::Sell },
[m[32m+                    side: if i % 2 == 0 {
[m[32m+                        OrderSide::Buy
[m[32m+                    } else {
[m[32m+                        OrderSide::Sell
[m[32m+                    },
[m                 })
                 .collect();
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/data_flow_performance_tests.rs:1286:
     >| async move {
         let data_tests = DataFlowPerformanceTests::new(framework);
         let result = data_tests.test_realtime_data_ingestion().await?;
[31m-        assert!(result.success, "Data ingestion failed: {:?}", result.error_message);
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Data ingestion failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m         assert!(result.metrics.get("e2e_pipeline_ns").unwrap_or(&100_000.0) < &50_000.0);
         Ok(())
     });
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:17:
         info!("Testing dual-provider framework initialization");
 
         // Verify framework is initialized
[31m-        assert!(!framework.services_started, "Services should not be auto-started");
[m[32m+        assert!(
[m[32m+            !framework.services_started,
[m[32m+            "Services should not be auto-started"
[m[32m+        );
[m 
         // Verify database harness is ready
[31m-        info!("Database harness URL: {}", framework.database_harness.connection_string);
[m[32m+        info!(
[m[32m+            "Database harness URL: {}",
[m[32m+            framework.database_harness.connection_string
[m[32m+        );
[m 
         // Verify ML pipeline is initialized
         info!("ML pipeline initialized");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:27:
 
         // Verify performance tracker is ready
[31m-        info!("Performance tracker session ID: {}", framework.test_session_id);
[m[32m+        info!(
[m[32m+            "Performance tracker session ID: {}",
[m[32m+            framework.test_session_id
[m[32m+        );
[m 
         info!("✅ Dual-provider framework initialization test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:62:
 
         // Verify connection string is configured
         let conn_str = &framework.database_harness.connection_string;
[31m-        assert!(!conn_str.is_empty(), "Connection string should be configured");
[m[32m+        assert!(
[m[32m+            !conn_str.is_empty(),
[m[32m+            "Connection string should be configured"
[m[32m+        );
[m         info!("Database connection: {}", conn_str);
 
         // Database harness is configured and ready for testing
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:90:
         let test_features = vec![0.5, 0.3, 0.7, 0.2, 0.8]; // Mock features
         let result = ml_pipeline.test_ensemble_prediction(test_features).await?;
 
[31m-        assert!(result.confidence >= 0.0 && result.confidence <= 1.0,
[m[31m-                "Confidence should be in [0,1]: {}", result.confidence);
[m[31m-        assert!(result.signal_strength.abs() <= 1.0,
[m[31m-                "Signal strength should be in [-1,1]: {}", result.signal_strength);
[m[32m+        assert!(
[m[32m+            result.confidence >= 0.0 && result.confidence <= 1.0,
[m[32m+            "Confidence should be in [0,1]: {}",
[m[32m+            result.confidence
[m[32m+        );
[m[32m+        assert!(
[m[32m+            result.signal_strength.abs() <= 1.0,
[m[32m+            "Signal strength should be in [-1,1]: {}",
[m[32m+            result.signal_strength
[m[32m+        );
[m 
[31m-        info!("✅ Ensemble prediction: {:?} (confidence: {:.3}, signal: {:.3})",
[m[31m-              result.prediction, result.confidence, result.signal_strength);
[m[32m+        info!(
[m[32m+            "✅ Ensemble prediction: {:?} (confidence: {:.3}, signal: {:.3})",
[m[32m+            result.prediction, result.confidence, result.signal_strength
[m[32m+        );
[m 
         info!("✅ ML pipeline dual-provider test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:144:
             Ok(client) => {
                 info!("✅ Trading client connected successfully");
                 // Client is available for testing
[31m-                assert!(client as *const _ as usize != 0, "Client should be non-null");
[m[32m+                assert!(
[m[32m+                    client as *const _ as usize != 0,
[m[32m+                    "Client should be non-null"
[m[32m+                );
[m             },
             Err(e) => {
[31m-                warn!("Trading service not available (expected in test environment): {}", e);
[m[32m+                warn!(
[m[32m+                    "Trading service not available (expected in test environment): {}",
[m[32m+                    e
[m[32m+                );
[m                 // This is acceptable in isolated test environment
[31m-            }
[m[32m+            },
[m         }
 
         // Try to get backtesting client
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:156:
         match framework.get_backtesting_client().await {
             Ok(client) => {
                 info!("✅ Backtesting client connected successfully");
[31m-                assert!(client as *const _ as usize != 0, "Client should be non-null");
[m[32m+                assert!(
[m[32m+                    client as *const _ as usize != 0,
[m[32m+                    "Client should be non-null"
[m[32m+                );
[m             },
             Err(e) => {
[31m-                warn!("Backtesting service not available (expected in test environment): {}", e);
[m[31m-            }
[m[32m+                warn!(
[m[32m+                    "Backtesting service not available (expected in test environment): {}",
[m[32m+                    e
[m[32m+                );
[m[32m+            },
[m         }
 
         info!("✅ Client connection test passed");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:187:
 
         // Verify market data structure
         assert_eq!(market_data.symbol, symbol, "Symbol should match");
[31m-        assert!(market_data.bid < market_data.ask, "Bid should be less than ask");
[m[31m-        assert!(market_data.bid_size.to_f64() > 0.0, "Bid size should be positive");
[m[31m-        assert!(market_data.ask_size.to_f64() > 0.0, "Ask size should be positive");
[m[32m+        assert!(
[m[32m+            market_data.bid < market_data.ask,
[m[32m+            "Bid should be less than ask"
[m[32m+        );
[m[32m+        assert!(
[m[32m+            market_data.bid_size.to_f64() > 0.0,
[m[32m+            "Bid size should be positive"
[m[32m+        );
[m[32m+        assert!(
[m[32m+            market_data.ask_size.to_f64() > 0.0,
[m[32m+            "Ask size should be positive"
[m[32m+        );
[m 
[31m-        info!("✅ Generated market data: bid={:.5}, ask={:.5}, spread={:.5}",
[m[31m-              market_data.bid.to_f64(),
[m[31m-              market_data.ask.to_f64(),
[m[31m-              market_data.ask.to_f64() - market_data.bid.to_f64());
[m[32m+        info!(
[m[32m+            "✅ Generated market data: bid={:.5}, ask={:.5}, spread={:.5}",
[m[32m+            market_data.bid.to_f64(),
[m[32m+            market_data.ask.to_f64(),
[m[32m+            market_data.ask.to_f64() - market_data.bid.to_f64()
[m[32m+        );
[m 
         // Generate order request
         let order = generator.generate_order_request(&symbol);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:201:
         assert_eq!(order.symbol, symbol, "Order symbol should match");
[31m-        assert!(order.quantity.to_f64() > 0.0, "Order quantity should be positive");
[m[32m+        assert!(
[m[32m+            order.quantity.to_f64() > 0.0,
[m[32m+            "Order quantity should be positive"
[m[32m+        );
[m 
[31m-        info!("✅ Generated order: {:?} {} @ {:?}",
[m[31m-              order.side, order.symbol, order.quantity);
[m[32m+        info!(
[m[32m+            "✅ Generated order: {:?} {} @ {:?}",
[m[32m+            order.side, order.symbol, order.quantity
[m[32m+        );
[m 
         info!("✅ Data generation dual-provider test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:233:
         };
 
         assert!(success_result.success, "Result should be successful");
[31m-        assert_eq!(success_result.duration, Duration::from_millis(150), "Duration should match");
[m[31m-        info!("✅ Workflow result: {} ({:?})",
[m[31m-              success_result.workflow_name, success_result.duration);
[m[32m+        assert_eq!(
[m[32m+            success_result.duration,
[m[32m+            Duration::from_millis(150),
[m[32m+            "Duration should match"
[m[32m+        );
[m[32m+        info!(
[m[32m+            "✅ Workflow result: {} ({:?})",
[m[32m+            success_result.workflow_name, success_result.duration
[m[32m+        );
[m 
         // Create a failed workflow result
         let failure_result = WorkflowTestResult {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:251:
         };
 
         assert!(!failure_result.success, "Result should be failed");
[31m-        assert!(failure_result.error_message.is_some(), "Should have error message");
[m[31m-        info!("✅ Workflow failure tracked: {} - {}",
[m[31m-              failure_result.workflow_name,
[m[31m-              failure_result.error_message.unwrap_or_default());
[m[32m+        assert!(
[m[32m+            failure_result.error_message.is_some(),
[m[32m+            "Should have error message"
[m[32m+        );
[m[32m+        info!(
[m[32m+            "✅ Workflow failure tracked: {} - {}",
[m[32m+            failure_result.workflow_name,
[m[32m+            failure_result.error_message.unwrap_or_default()
[m[32m+        );
[m 
         info!("✅ Workflow result tracking test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:286:
         // Verify price continuity (no wild jumps)
         for window in prices.windows(2) {
             let change_pct = (window[1] - window[0]).abs() / window[0];
[31m-            assert!(change_pct < 0.01,
[m[31m-                    "Price change should be < 1%: {:.4}%", change_pct * 100.0);
[m[32m+            assert!(
[m[32m+                change_pct < 0.01,
[m[32m+                "Price change should be < 1%: {:.4}%",
[m[32m+                change_pct * 100.0
[m[32m+            );
[m         }
 
[31m-        info!("✅ Price continuity validated across {} samples", prices.len());
[m[32m+        info!(
[m[32m+            "✅ Price continuity validated across {} samples",
[m[32m+            prices.len()
[m[32m+        );
[m 
         // Calculate statistics
         let avg_price = prices.iter().sum::<f64>() / prices.len() as f64;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:297:
         let min_price = prices.iter().cloned().fold(f64::INFINITY, f64::min);
         let max_price = prices.iter().cloned().fold(f64::NEG_INFINITY, f64::max);
 
[31m-        info!("📊 Price statistics: avg={:.5}, min={:.5}, max={:.5}, range={:.5}",
[m[31m-              avg_price, min_price, max_price, max_price - min_price);
[m[32m+        info!(
[m[32m+            "📊 Price statistics: avg={:.5}, min={:.5}, max={:.5}, range={:.5}",
[m[32m+            avg_price,
[m[32m+            min_price,
[m[32m+            max_price,
[m[32m+            max_price - min_price
[m[32m+        );
[m 
         info!("✅ Provider data consistency test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:352:
 
         assert_eq!(results.len(), 3, "Should complete all concurrent tasks");
         for (symbol, count) in results {
[31m-            assert_eq!(count, 5, "Each symbol should have 5 data points: {}", symbol);
[m[32m+            assert_eq!(
[m[32m+                count, 5,
[m[32m+                "Each symbol should have 5 data points: {}",
[m[32m+                symbol
[m[32m+            );
[m         }
 
         info!("✅ Concurrent provider access test passed");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:396:
             secondary_data.push(data.bid.to_f64());
             sleep(Duration::from_millis(50)).await;
         }
[31m-        info!("✅ Secondary provider: {} data points", secondary_data.len());
[m[32m+        info!(
[m[32m+            "✅ Secondary provider: {} data points",
[m[32m+            secondary_data.len()
[m[32m+        );
[m 
         // Verify data continuity across failover
         assert_eq!(primary_data.len(), 5, "Primary should have 5 samples");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/dual_provider_integration.rs:407:
         let first_secondary = secondary_data.first().unwrap();
         let deviation = (first_secondary - last_primary).abs() / last_primary;
 
[31m-        info!("📊 Failover price deviation: {:.4}% (last_primary={:.5}, first_secondary={:.5})",
[m[31m-              deviation * 100.0, last_primary, first_secondary);
[m[32m+        info!(
[m[32m+            "📊 Failover price deviation: {:.4}% (last_primary={:.5}, first_secondary={:.5})",
[m[32m+            deviation * 100.0,
[m[32m+            last_primary,
[m[32m+            first_secondary
[m[32m+        );
[m 
         info!("✅ Provider failover simulation test passed");
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:18:
 use tracing::{debug, info, warn};
 
 // Import proto types
[31m-use foxhunt_e2e::proto::trading;
[m use foxhunt_e2e::proto::risk;
[32m+use foxhunt_e2e::proto::trading;
[m 
 // Test 1: Graceful Shutdown with Order Preservation
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:143:
             positions_before.positions.len(),
             "Position count should be preserved across shutdown"
         );
[31m-        info!("✅ Positions preserved: {}", positions_after.positions.len());
[m[31m-        info!("✅ Graceful shutdown test completed successfully in {} steps", step_count);
[m[32m+        info!(
[m[32m+            "✅ Positions preserved: {}",
[m[32m+            positions_after.positions.len()
[m[32m+        );
[m[32m+        info!(
[m[32m+            "✅ Graceful shutdown test completed successfully in {} steps",
[m[32m+            step_count
[m[32m+        );
[m         Ok(())
     }
 );
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:175:
             .context("Failed to get trading client")?;
 
         // Connect to risk service directly
[31m-        let mut risk_client = risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            risk::risk_service_client::RiskServiceClient::connect("http://[::1]:50051")
[m[32m+                .await
[m[32m+                .context("Failed to connect to Risk Service")?;
[m         info!("✅ Clients initialized");
 
         // Step 3: Create active trading scenario
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:249:
         match result_after_stop {
             Err(e) => {
                 info!("✅ Order correctly rejected during emergency stop: {}", e);
[31m-            }
[m[32m+            },
[m             Ok(response) => {
                 let inner = response.into_inner();
                 assert!(
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:256:
                     inner.status == trading::OrderStatus::Rejected as i32,
                     "Order should be rejected during emergency stop"
                 );
[31m-                info!("✅ Order correctly rejected with status: {:?}", inner.status);
[m[31m-            }
[m[32m+                info!(
[m[32m+                    "✅ Order correctly rejected with status: {:?}",
[m[32m+                    inner.status
[m[32m+                );
[m[32m+            },
[m         }
 
         // Step 6: Check circuit breaker status
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:264:
         step_count += 1;
         let breaker_status = risk_client
[31m-            .get_circuit_breaker_status(risk::GetCircuitBreakerStatusRequest {
[m[31m-                symbol: None,
[m[31m-            })
[m[32m+            .get_circuit_breaker_status(risk::GetCircuitBreakerStatusRequest { symbol: None })
[m             .await
             .context("Failed to get circuit breaker status")?
             .into_inner();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:274:
             "✅ Circuit breaker status retrieved: {} breakers",
             breaker_status.circuit_breakers.len()
         );
[31m-        info!("✅ Emergency stop test completed successfully in {} steps", step_count);
[m[32m+        info!(
[m[32m+            "✅ Emergency stop test completed successfully in {} steps",
[m[32m+            step_count
[m[32m+        );
[m         Ok(())
     }
 );
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:299:
 
         // Step 2: Initialize risk client
         step_count += 1;
[31m-        let mut risk_client = risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            risk::risk_service_client::RiskServiceClient::connect("http://[::1]:50051")
[m[32m+                .await
[m[32m+                .context("Failed to connect to Risk Service")?;
[m         info!("✅ Risk client initialized");
 
         // Step 3: Get baseline risk metrics
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:310:
         step_count += 1;
         let baseline_metrics = risk_client
[31m-            .get_risk_metrics(risk::GetRiskMetricsRequest {
[m[31m-                portfolio_id: None,
[m[31m-            })
[m[32m+            .get_risk_metrics(risk::GetRiskMetricsRequest { portfolio_id: None })
[m             .await
             .context("Failed to get baseline risk metrics")?
             .into_inner();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:370:
                             "📊 Risk alert received: {} - {}",
                             alert.alert_id, alert.message
                         );
[31m-                        debug!("   Severity: {:?}, Type: {:?}", alert.severity, alert.alert_type);
[m[31m-                    }
[m[32m+                        debug!(
[m[32m+                            "   Severity: {:?}, Type: {:?}",
[m[32m+                            alert.severity, alert.alert_type
[m[32m+                        );
[m[32m+                    },
[m                     Err(e) => {
                         warn!("Risk alert stream error: {}", e);
                         break;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:378:
[31m-                    }
[m[32m+                    },
[m                 }
             }
         })
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:382:
         .await;
 
[31m-        info!("✅ Risk alert monitoring completed ({} alerts)", alerts_received);
[m[32m+        info!(
[m[32m+            "✅ Risk alert monitoring completed ({} alerts)",
[m[32m+            alerts_received
[m[32m+        );
[m 
         // Step 6: Verify circuit breaker state
         step_count += 1;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:388:
         let breaker_status = risk_client
[31m-            .get_circuit_breaker_status(risk::GetCircuitBreakerStatusRequest {
[m[31m-                symbol: None,
[m[31m-            })
[m[32m+            .get_circuit_breaker_status(risk::GetCircuitBreakerStatusRequest { symbol: None })
[m             .await
             .context("Failed to get circuit breaker status")?
             .into_inner();
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/emergency_shutdown_failover_tests.rs:405:
             );
         }
 
[31m-        info!("✅ Kill switch threshold test completed successfully in {} steps", step_count);
[m[32m+        info!(
[m[32m+            "✅ Kill switch threshold test completed successfully in {} steps",
[m[32m+            step_count
[m[32m+        );
[m         Ok(())
     }
 );
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/error_handling_recovery.rs:9:
 
 use anyhow::{Context, Result};
 use foxhunt_e2e::e2e_test;
[31m-use foxhunt_e2e::proto::trading::{SubmitOrderRequest, OrderSide, OrderType, GetPortfolioSummaryRequest};
[m[32m+use foxhunt_e2e::proto::trading::{
[m[32m+    GetPortfolioSummaryRequest, OrderSide, OrderType, SubmitOrderRequest,
[m[32m+};
[m use std::time::Duration;
 use tracing::{info, warn};
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/error_handling_recovery.rs:121:
                 info!("Invalid symbol format response: {}", response.message);
             },
             Err(e) => {
[31m-                info!("✅ Invalid symbol format correctly rejected with error: {}", e);
[m[32m+                info!(
[m[32m+                    "✅ Invalid symbol format correctly rejected with error: {}",
[m[32m+                    e
[m[32m+                );
[m             },
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/error_handling_recovery.rs:421:
         info!("Testing order with metadata");
         let mut metadata = std::collections::HashMap::new();
         metadata.insert("strategy".to_string(), "test_strategy".to_string());
[31m-        metadata.insert("notes".to_string(), "Testing special characters: !@#$%^&*()".to_string());
[m[32m+        metadata.insert(
[m[32m+            "notes".to_string(),
[m[32m+            "Testing special characters: !@#$%^&*()".to_string(),
[m[32m+        );
[m 
         let metadata_order = SubmitOrderRequest {
             symbol: "AAPL".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:11:
 
 use anyhow::Context;
 use foxhunt_e2e::e2e_test;
[32m+use foxhunt_e2e::proto::risk::{GetRiskMetricsRequest, ValidateOrderRequest};
[m use foxhunt_e2e::proto::trading::{
[31m-    MarketDataType, OrderSide, OrderStatus, OrderType, SubmitOrderRequest,
[m[31m-    StreamMarketDataRequest, GetPortfolioSummaryRequest, GetPositionsRequest,
[m[31m-    GetOrderStatusRequest, CancelOrderRequest, StreamOrdersRequest,
[m[32m+    CancelOrderRequest, GetOrderStatusRequest, GetPortfolioSummaryRequest, GetPositionsRequest,
[m[32m+    MarketDataType, OrderSide, OrderStatus, OrderType, StreamMarketDataRequest,
[m[32m+    StreamOrdersRequest, SubmitOrderRequest,
[m };
[31m-use foxhunt_e2e::proto::risk::{ValidateOrderRequest, GetRiskMetricsRequest};
[m use std::time::Duration;
 use tokio_stream::StreamExt;
 use tracing::{info, warn};
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:47:
         info!("📊 Subscribing to market data for AAPL");
         let market_data_request = StreamMarketDataRequest {
             symbols: vec!["AAPL".to_string()],
[31m-            data_types: vec![
[m[31m-                MarketDataType::Trade as i32,
[m[31m-                MarketDataType::Quote as i32,
[m[31m-            ],
[m[32m+            data_types: vec![MarketDataType::Trade as i32, MarketDataType::Quote as i32],
[m         };
 
         let mut market_data_stream = trading_client
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:147:
         info!("⚖️ Validating order with risk management");
 
         // Create a separate RiskServiceClient
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         let validation_response = risk_client
             .validate_order(ValidateOrderRequest {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:158:
                 symbol: test_order.symbol.clone(),
                 quantity: test_order.quantity,
                 price: last_price,
[31m-                side: if test_order.side == OrderSide::Buy as i32 { "buy" } else { "sell" }.to_string(),
[m[32m+                side: if test_order.side == OrderSide::Buy as i32 {
[m[32m+                    "buy"
[m[32m+                } else {
[m[32m+                    "sell"
[m[32m+                }
[m[32m+                .to_string(),
[m                 account_id: test_order.account_id.clone(),
             })
             .await
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:445:
         let trading_client = framework.get_trading_client().await?;
 
         // Create a separate RiskServiceClient for validation
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         // Try to submit a very large order that should be rejected
         let large_order = SubmitOrderRequest {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/full_trading_flow_e2e.rs:495:
                     } else {
                         warn!("⚠️ Large order was accepted - risk limits may need adjustment");
                     }
[31m-                }
[m[32m+                },
[m                 Err(e) => {
                     info!("✅ Order rejected with error: {}", e);
[31m-                }
[m[32m+                },
[m             }
         } else {
             info!("✅ Order correctly rejected at validation stage");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:14:
 use tracing::{info, warn};
 
 // Import proto types for gRPC calls
[32m+use foxhunt_e2e::proto::backtesting::ListBacktestsRequest;
[m use foxhunt_e2e::proto::trading::{
[31m-    GetPortfolioSummaryRequest, SubmitOrderRequest, OrderType, OrderSide, StreamMarketDataRequest,
[m[31m-    MarketDataType,
[m[32m+    GetPortfolioSummaryRequest, MarketDataType, OrderSide, OrderType, StreamMarketDataRequest,
[m[32m+    SubmitOrderRequest,
[m };
[31m-use foxhunt_e2e::proto::backtesting::ListBacktestsRequest;
[m 
 //
 // BASIC SERVICE HEALTH TESTS
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:25:
 //
 
[31m-e2e_test!(test_framework_initialization, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing E2E framework initialization");
[m[32m+e2e_test!(
[m[32m+    test_framework_initialization,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing E2E framework initialization");
[m 
[31m-    // Framework is already initialized by the macro
[m[31m-    // Just verify basic properties
[m[31m-    let session_id = framework.get_test_session_id();
[m[31m-    assert!(!session_id.is_empty(), "Session ID should not be empty");
[m[31m-    info!("✅ Test session ID: {}", session_id);
[m[32m+        // Framework is already initialized by the macro
[m[32m+        // Just verify basic properties
[m[32m+        let session_id = framework.get_test_session_id();
[m[32m+        assert!(!session_id.is_empty(), "Session ID should not be empty");
[m[32m+        info!("✅ Test session ID: {}", session_id);
[m 
[31m-    // Check that services are marked as started
[m[31m-    assert!(
[m[31m-        framework.services_started,
[m[31m-        "Services should be marked as started"
[m[31m-    );
[m[31m-    info!("✅ Services startup flag is set");
[m[32m+        // Check that services are marked as started
[m[32m+        assert!(
[m[32m+            framework.services_started,
[m[32m+            "Services should be marked as started"
[m[32m+        );
[m[32m+        info!("✅ Services startup flag is set");
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
[31m-e2e_test!(test_services_health_check, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing services health check");
[m[32m+e2e_test!(
[m[32m+    test_services_health_check,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing services health check");
[m 
[31m-    // Wait a moment for services to stabilize
[m[31m-    sleep(Duration::from_secs(2)).await;
[m[32m+        // Wait a moment for services to stabilize
[m[32m+        sleep(Duration::from_secs(2)).await;
[m 
[31m-    // Check overall health status
[m[31m-    let health = framework.check_services_health().await?;
[m[32m+        // Check overall health status
[m[32m+        let health = framework.check_services_health().await?;
[m 
[31m-    info!("Health status summary: {}", health.summary());
[m[31m-    info!("  Trading Service: {:?}", health.trading_service);
[m[31m-    info!("  Config Service: {:?}", health.config_service);
[m[31m-    info!("  Database: {:?}", health.database);
[m[32m+        info!("Health status summary: {}", health.summary());
[m[32m+        info!("  Trading Service: {:?}", health.trading_service);
[m[32m+        info!("  Config Service: {:?}", health.config_service);
[m[32m+        info!("  Database: {:?}", health.database);
[m 
[31m-    // We expect at least some services to be healthy in CI/test environments
[m[31m-    // In real environments, all should be healthy
[m[31m-    info!(
[m[31m-        "✅ Health check completed - All healthy: {}",
[m[31m-        health.all_healthy
[m[31m-    );
[m[32m+        // We expect at least some services to be healthy in CI/test environments
[m[32m+        // In real environments, all should be healthy
[m[32m+        info!(
[m[32m+            "✅ Health check completed - All healthy: {}",
[m[32m+            health.all_healthy
[m[32m+        );
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
 //
 // GRPC CLIENT CONNECTION TESTS
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:72:
 //
 
[31m-e2e_test!(test_trading_client_connection, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing Trading Service gRPC client connection");
[m[32m+e2e_test!(
[m[32m+    test_trading_client_connection,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing Trading Service gRPC client connection");
[m 
[31m-    // Wait for service to be ready
[m[31m-    sleep(Duration::from_secs(2)).await;
[m[32m+        // Wait for service to be ready
[m[32m+        sleep(Duration::from_secs(2)).await;
[m 
[31m-    // Get trading client - this will establish connection
[m[31m-    let client = framework.get_trading_client().await;
[m[32m+        // Get trading client - this will establish connection
[m[32m+        let client = framework.get_trading_client().await;
[m 
[31m-    match client {
[m[31m-        Ok(_trading_client) => {
[m[31m-            info!("✅ Successfully connected to Trading Service");
[m[32m+        match client {
[m[32m+            Ok(_trading_client) => {
[m[32m+                info!("✅ Successfully connected to Trading Service");
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Trading Service connection failed: {}", e);
[m[32m+                info!("This may be expected in test environments without running services");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Trading Service connection failed: {}", e);
[m[31m-            info!("This may be expected in test environments without running services");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+e2e_test!(
[m[32m+    test_backtesting_client_connection,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing Backtesting Service gRPC client connection");
[m 
[31m-e2e_test!(test_backtesting_client_connection, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing Backtesting Service gRPC client connection");
[m[32m+        // Wait for service to be ready
[m[32m+        sleep(Duration::from_secs(2)).await;
[m 
[31m-    // Wait for service to be ready
[m[31m-    sleep(Duration::from_secs(2)).await;
[m[32m+        // Get backtesting client - this will establish connection
[m[32m+        let client = framework.get_backtesting_client().await;
[m 
[31m-    // Get backtesting client - this will establish connection
[m[31m-    let client = framework.get_backtesting_client().await;
[m[31m-
[m[31m-    match client {
[m[31m-        Ok(_backtesting_client) => {
[m[31m-            info!("✅ Successfully connected to Backtesting Service");
[m[32m+        match client {
[m[32m+            Ok(_backtesting_client) => {
[m[32m+                info!("✅ Successfully connected to Backtesting Service");
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Backtesting Service connection failed: {}", e);
[m[32m+                info!("This may be expected in test environments without running services");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Backtesting Service connection failed: {}", e);
[m[31m-            info!("This may be expected in test environments without running services");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // TRADING SERVICE INTEGRATION TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:121:
 
[31m-e2e_test!(test_portfolio_query, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing portfolio query through Trading Service");
[m[32m+e2e_test!(
[m[32m+    test_portfolio_query,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing portfolio query through Trading Service");
[m 
[31m-    // Get trading client
[m[31m-    let client_result = framework.get_trading_client().await;
[m[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Skipping portfolio query test - service not available");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        // Get trading client
[m[32m+        let client_result = framework.get_trading_client().await;
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Skipping portfolio query test - service not available");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    let trading_client = client_result.unwrap();
[m[32m+        let trading_client = client_result.unwrap();
[m 
[31m-    // Prepare portfolio query request with account_id
[m[31m-    let request = tonic::Request::new(GetPortfolioSummaryRequest {
[m[31m-        account_id: "test_account".to_string(),
[m[31m-    });
[m[32m+        // Prepare portfolio query request with account_id
[m[32m+        let request = tonic::Request::new(GetPortfolioSummaryRequest {
[m[32m+            account_id: "test_account".to_string(),
[m[32m+        });
[m 
[31m-    // Query portfolio
[m[31m-    let response = trading_client.get_portfolio_summary(request).await;
[m[32m+        // Query portfolio
[m[32m+        let response = trading_client.get_portfolio_summary(request).await;
[m 
[31m-    match response {
[m[31m-        Ok(portfolio) => {
[m[31m-            let portfolio_data = portfolio.into_inner();
[m[31m-            info!("✅ Portfolio query successful");
[m[31m-            info!(
[m[31m-                "Portfolio total value: ${:.2}",
[m[31m-                portfolio_data.total_value
[m[31m-            );
[m[31m-            info!("Buying power: ${:.2}", portfolio_data.buying_power);
[m[31m-            info!("Unrealized PnL: ${:.2}", portfolio_data.unrealized_pnl);
[m[32m+        match response {
[m[32m+            Ok(portfolio) => {
[m[32m+                let portfolio_data = portfolio.into_inner();
[m[32m+                info!("✅ Portfolio query successful");
[m[32m+                info!("Portfolio total value: ${:.2}", portfolio_data.total_value);
[m[32m+                info!("Buying power: ${:.2}", portfolio_data.buying_power);
[m[32m+                info!("Unrealized PnL: ${:.2}", portfolio_data.unrealized_pnl);
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Portfolio query failed: {}", e);
[m[32m+                info!("This may be expected if service is not fully configured");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Portfolio query failed: {}", e);
[m[31m-            info!("This may be expected if service is not fully configured");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+e2e_test!(
[m[32m+    test_order_submission_flow,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing order submission flow");
[m 
[31m-e2e_test!(test_order_submission_flow, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing order submission flow");
[m[32m+        // Get trading client
[m[32m+        let client_result = framework.get_trading_client().await;
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Skipping order submission test - service not available");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    // Get trading client
[m[31m-    let client_result = framework.get_trading_client().await;
[m[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Skipping order submission test - service not available");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        let trading_client = client_result.unwrap();
[m 
[31m-    let trading_client = client_result.unwrap();
[m[32m+        // Create a test order with all required fields
[m[32m+        let order_request = SubmitOrderRequest {
[m[32m+            symbol: "EURUSD".to_string(),
[m[32m+            side: OrderSide::Buy.into(),
[m[32m+            quantity: 10000.0,
[m[32m+            order_type: OrderType::Market.into(),
[m[32m+            price: None,
[m[32m+            stop_price: None,
[m[32m+            account_id: "test_account".to_string(),
[m[32m+            metadata: std::collections::HashMap::new(),
[m[32m+        };
[m 
[31m-    // Create a test order with all required fields
[m[31m-    let order_request = SubmitOrderRequest {
[m[31m-        symbol: "EURUSD".to_string(),
[m[31m-        side: OrderSide::Buy.into(),
[m[31m-        quantity: 10000.0,
[m[31m-        order_type: OrderType::Market.into(),
[m[31m-        price: None,
[m[31m-        stop_price: None,
[m[31m-        account_id: "test_account".to_string(),
[m[31m-        metadata: std::collections::HashMap::new(),
[m[31m-    };
[m[32m+        info!(
[m[32m+            "Submitting test order: {} EURUSD @ Market",
[m[32m+            order_request.quantity
[m[32m+        );
[m 
[31m-    info!("Submitting test order: {} EURUSD @ Market", order_request.quantity);
[m[32m+        // Submit order
[m[32m+        let request = tonic::Request::new(order_request);
[m[32m+        let response = trading_client.submit_order(request).await;
[m 
[31m-    // Submit order
[m[31m-    let request = tonic::Request::new(order_request);
[m[31m-    let response = trading_client.submit_order(request).await;
[m[31m-
[m[31m-    match response {
[m[31m-        Ok(order_response) => {
[m[31m-            let order = order_response.into_inner();
[m[31m-            info!("✅ Order submitted successfully");
[m[31m-            info!("Order ID: {}", order.order_id);
[m[31m-            info!("Status: {:?}", order.status);
[m[32m+        match response {
[m[32m+            Ok(order_response) => {
[m[32m+                let order = order_response.into_inner();
[m[32m+                info!("✅ Order submitted successfully");
[m[32m+                info!("Order ID: {}", order.order_id);
[m[32m+                info!("Status: {:?}", order.status);
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Order submission failed: {}", e);
[m[32m+                info!(
[m[32m+                    "This may be expected if service is not fully configured or in simulation mode"
[m[32m+                );
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Order submission failed: {}", e);
[m[31m-            info!("This may be expected if service is not fully configured or in simulation mode");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+e2e_test!(
[m[32m+    test_market_data_streaming,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing market data streaming");
[m 
[31m-e2e_test!(test_market_data_streaming, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing market data streaming");
[m[32m+        // Get trading client
[m[32m+        let client_result = framework.get_trading_client().await;
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Skipping market data streaming test - service not available");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    // Get trading client
[m[31m-    let client_result = framework.get_trading_client().await;
[m[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Skipping market data streaming test - service not available");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        let trading_client = client_result.unwrap();
[m 
[31m-    let trading_client = client_result.unwrap();
[m[32m+        // Subscribe to market data stream with data_types
[m[32m+        let stream_request = StreamMarketDataRequest {
[m[32m+            symbols: vec!["EURUSD".to_string(), "GBPUSD".to_string()],
[m[32m+            data_types: vec![MarketDataType::Trade.into(), MarketDataType::Quote.into()],
[m[32m+        };
[m 
[31m-    // Subscribe to market data stream with data_types
[m[31m-    let stream_request = StreamMarketDataRequest {
[m[31m-        symbols: vec!["EURUSD".to_string(), "GBPUSD".to_string()],
[m[31m-        data_types: vec![MarketDataType::Trade.into(), MarketDataType::Quote.into()],
[m[31m-    };
[m[32m+        info!("Subscribing to market data for EURUSD, GBPUSD");
[m 
[31m-    info!("Subscribing to market data for EURUSD, GBPUSD");
[m[32m+        let request = tonic::Request::new(stream_request);
[m[32m+        let stream_result = trading_client.stream_market_data(request).await;
[m 
[31m-    let request = tonic::Request::new(stream_request);
[m[31m-    let stream_result = trading_client.stream_market_data(request).await;
[m[32m+        match stream_result {
[m[32m+            Ok(mut stream) => {
[m[32m+                let mut event_count = 0;
[m[32m+                let max_events = 5;
[m[32m+                let timeout_duration = Duration::from_secs(10);
[m 
[31m-    match stream_result {
[m[31m-        Ok(mut stream) => {
[m[31m-            let mut event_count = 0;
[m[31m-            let max_events = 5;
[m[31m-            let timeout_duration = Duration::from_secs(10);
[m[32m+                info!("✅ Market data stream established");
[m 
[31m-            info!("✅ Market data stream established");
[m[32m+                // Collect a few market data events with timeout
[m[32m+                let stream_fut = async {
[m[32m+                    use tokio_stream::StreamExt;
[m 
[31m-            // Collect a few market data events with timeout
[m[31m-            let stream_fut = async {
[m[31m-                use tokio_stream::StreamExt;
[m[32m+                    while let Some(result) = stream.get_mut().next().await {
[m[32m+                        match result {
[m[32m+                            Ok(market_data) => {
[m[32m+                                event_count += 1;
[m[32m+                                info!(
[m[32m+                                    "Received market data: {} (type: {:?})",
[m[32m+                                    market_data.symbol, market_data.data_type
[m[32m+                                );
[m 
[31m-                while let Some(result) = stream.get_mut().next().await {
[m[31m-                    match result {
[m[31m-                        Ok(market_data) => {
[m[31m-                            event_count += 1;
[m[31m-                            info!(
[m[31m-                                "Received market data: {} (type: {:?})",
[m[31m-                                market_data.symbol, market_data.data_type
[m[31m-                            );
[m[31m-
[m[31m-                            if event_count >= max_events {
[m[32m+                                if event_count >= max_events {
[m[32m+                                    break;
[m[32m+                                }
[m[32m+                            },
[m[32m+                            Err(e) => {
[m[32m+                                warn!("Stream error: {}", e);
[m                                 break;
[31m-                            }
[m[32m+                            },
[m                         }
[31m-                        Err(e) => {
[m[31m-                            warn!("Stream error: {}", e);
[m[31m-                            break;
[m[31m-                        }
[m                     }
[31m-                }
[m[31m-            };
[m[32m+                };
[m 
[31m-            match tokio::time::timeout(timeout_duration, stream_fut).await {
[m[31m-                Ok(_) => {
[m[31m-                    info!("✅ Received {} market data events", event_count);
[m[32m+                match tokio::time::timeout(timeout_duration, stream_fut).await {
[m[32m+                    Ok(_) => {
[m[32m+                        info!("✅ Received {} market data events", event_count);
[m[32m+                    },
[m[32m+                    Err(_) => {
[m[32m+                        info!(
[m[32m+                            "⏱️ Stream timeout after {:?}, received {} events",
[m[32m+                            timeout_duration, event_count
[m[32m+                        );
[m[32m+                    },
[m                 }
[31m-                Err(_) => {
[m[31m-                    info!(
[m[31m-                        "⏱️ Stream timeout after {:?}, received {} events",
[m[31m-                        timeout_duration, event_count
[m[31m-                    );
[m[31m-                }
[m[31m-            }
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Market data streaming failed: {}", e);
[m[32m+                info!("This may be expected if data providers are not configured");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Market data streaming failed: {}", e);
[m[31m-            info!("This may be expected if data providers are not configured");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // BACKTESTING SERVICE INTEGRATION TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:288:
 
[31m-e2e_test!(test_backtesting_list, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing backtesting service - list backtests");
[m[32m+e2e_test!(
[m[32m+    test_backtesting_list,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing backtesting service - list backtests");
[m 
[31m-    // Get backtesting client
[m[31m-    let client_result = framework.get_backtesting_client().await;
[m[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Skipping backtesting list test - service not available");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        // Get backtesting client
[m[32m+        let client_result = framework.get_backtesting_client().await;
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Skipping backtesting list test - service not available");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    let backtesting_client = client_result.unwrap();
[m[32m+        let backtesting_client = client_result.unwrap();
[m 
[31m-    // List available backtests with all required fields
[m[31m-    let request = tonic::Request::new(ListBacktestsRequest {
[m[31m-        limit: 10,
[m[31m-        offset: 0,
[m[31m-        status_filter: None,
[m[31m-        strategy_name: None,
[m[31m-    });
[m[32m+        // List available backtests with all required fields
[m[32m+        let request = tonic::Request::new(ListBacktestsRequest {
[m[32m+            limit: 10,
[m[32m+            offset: 0,
[m[32m+            status_filter: None,
[m[32m+            strategy_name: None,
[m[32m+        });
[m 
[31m-    let response = backtesting_client.list_backtests(request).await;
[m[32m+        let response = backtesting_client.list_backtests(request).await;
[m 
[31m-    match response {
[m[31m-        Ok(backtest_list) => {
[m[31m-            let backtests = backtest_list.into_inner();
[m[31m-            info!("✅ Backtesting list query successful");
[m[31m-            info!("Found {} backtests", backtests.backtests.len());
[m[32m+        match response {
[m[32m+            Ok(backtest_list) => {
[m[32m+                let backtests = backtest_list.into_inner();
[m[32m+                info!("✅ Backtesting list query successful");
[m[32m+                info!("Found {} backtests", backtests.backtests.len());
[m 
[31m-            for bt in backtests.backtests.iter().take(3) {
[m[31m-                info!("  - {} (status: {:?})", bt.backtest_id, bt.status);
[m[31m-            }
[m[32m+                for bt in backtests.backtests.iter().take(3) {
[m[32m+                    info!("  - {} (status: {:?})", bt.backtest_id, bt.status);
[m[32m+                }
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Backtesting list query failed: {}", e);
[m[32m+                info!("This may be expected if backtesting service is not fully configured");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Backtesting list query failed: {}", e);
[m[31m-            info!("This may be expected if backtesting service is not fully configured");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // ML PIPELINE INTEGRATION TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:333:
 
[31m-e2e_test!(test_ml_pipeline_health, |framework: E2ETestFramework| async {
[m[31m-    info!("Testing ML pipeline health check");
[m[32m+e2e_test!(
[m[32m+    test_ml_pipeline_health,
[m[32m+    |framework: E2ETestFramework| async {
[m[32m+        info!("Testing ML pipeline health check");
[m 
[31m-    // Access ML pipeline from framework
[m[31m-    let ml_pipeline = &framework.ml_pipeline;
[m[32m+        // Access ML pipeline from framework
[m[32m+        let ml_pipeline = &framework.ml_pipeline;
[m 
[31m-    // Check models health
[m[31m-    let health_result = ml_pipeline.check_models_health().await;
[m[32m+        // Check models health
[m[32m+        let health_result = ml_pipeline.check_models_health().await;
[m 
[31m-    match health_result {
[m[31m-        Ok(status) => {
[m[31m-            info!("✅ ML pipeline health check successful");
[m[31m-            info!("Available models: {}", status.available_count());
[m[31m-            info!("  MAMBA: {}", if status.mamba_available { "✅" } else { "❌" });
[m[31m-            info!("  DQN: {}", if status.dqn_available { "✅" } else { "❌" });
[m[31m-            info!("  PPO: {}", if status.ppo_available { "✅" } else { "❌" });
[m[31m-            info!("  TFT: {}", if status.tft_available { "✅" } else { "❌" });
[m[31m-            info!("  TLOB: {}", if status.tlob_available { "✅" } else { "❌" });
[m[32m+        match health_result {
[m[32m+            Ok(status) => {
[m[32m+                info!("✅ ML pipeline health check successful");
[m[32m+                info!("Available models: {}", status.available_count());
[m[32m+                info!(
[m[32m+                    "  MAMBA: {}",
[m[32m+                    if status.mamba_available { "✅" } else { "❌" }
[m[32m+                );
[m[32m+                info!("  DQN: {}", if status.dqn_available { "✅" } else { "❌" });
[m[32m+                info!("  PPO: {}", if status.ppo_available { "✅" } else { "❌" });
[m[32m+                info!("  TFT: {}", if status.tft_available { "✅" } else { "❌" });
[m[32m+                info!(
[m[32m+                    "  TLOB: {}",
[m[32m+                    if status.tlob_available { "✅" } else { "❌" }
[m[32m+                );
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ ML pipeline health check failed: {}", e);
[m[32m+                info!("This may be expected if ML models are not loaded");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ ML pipeline health check failed: {}", e);
[m[31m-            info!("This may be expected if ML models are not loaded");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // DATABASE INTEGRATION TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:365:
 
[31m-e2e_test!(test_database_connection, |framework: E2ETestFramework| async {
[m[31m-    info!("Testing database connection");
[m[32m+e2e_test!(
[m[32m+    test_database_connection,
[m[32m+    |framework: E2ETestFramework| async {
[m[32m+        info!("Testing database connection");
[m 
[31m-    let db = &framework.database_harness;
[m[32m+        let db = &framework.database_harness;
[m 
[31m-    // Test database setup
[m[31m-    let setup_result = db.setup().await;
[m[32m+        // Test database setup
[m[32m+        let setup_result = db.setup().await;
[m 
[31m-    match setup_result {
[m[31m-        Ok(_) => {
[m[31m-            info!("✅ Database setup successful");
[m[32m+        match setup_result {
[m[32m+            Ok(_) => {
[m[32m+                info!("✅ Database setup successful");
[m 
[31m-            // Test teardown
[m[31m-            match db.teardown().await {
[m[31m-                Ok(_) => info!("✅ Database teardown successful"),
[m[31m-                Err(e) => warn!("⚠️ Database teardown failed: {}", e),
[m[31m-            }
[m[32m+                // Test teardown
[m[32m+                match db.teardown().await {
[m[32m+                    Ok(_) => info!("✅ Database teardown successful"),
[m[32m+                    Err(e) => warn!("⚠️ Database teardown failed: {}", e),
[m[32m+                }
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Database setup failed: {}", e);
[m[32m+                info!("This may be expected if database is not configured in test environment");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Database setup failed: {}", e);
[m[31m-            info!("This may be expected if database is not configured in test environment");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[31m-
[m //
 // PERFORMANCE TRACKING TESTS
 //
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:396:
 
[31m-e2e_test!(test_performance_tracking, |framework: E2ETestFramework| async {
[m[31m-    info!("Testing performance tracking");
[m[32m+e2e_test!(
[m[32m+    test_performance_tracking,
[m[32m+    |framework: E2ETestFramework| async {
[m[32m+        info!("Testing performance tracking");
[m 
[31m-    let perf_tracker = &framework.performance_tracker;
[m[32m+        let perf_tracker = &framework.performance_tracker;
[m 
[31m-    // Record some test metrics (synchronous methods)
[m[31m-    perf_tracker.record_metric("test_latency_us", 42.5)?;
[m[31m-    perf_tracker.record_metric("test_throughput", 1000.0)?;
[m[31m-    perf_tracker.record_metric("test_success_rate", 0.95)?;
[m[32m+        // Record some test metrics (synchronous methods)
[m[32m+        perf_tracker.record_metric("test_latency_us", 42.5)?;
[m[32m+        perf_tracker.record_metric("test_throughput", 1000.0)?;
[m[32m+        perf_tracker.record_metric("test_success_rate", 0.95)?;
[m 
[31m-    info!("✅ Performance metrics recorded");
[m[32m+        info!("✅ Performance metrics recorded");
[m 
[31m-    // Get metric stats
[m[31m-    let latency_stats = perf_tracker.get_metric_stats("test_latency_us")?;
[m[32m+        // Get metric stats
[m[32m+        let latency_stats = perf_tracker.get_metric_stats("test_latency_us")?;
[m 
[31m-    if let Some(stats) = latency_stats {
[m[31m-        info!("Performance Summary:");
[m[31m-        info!("  Latency count: {}", stats.count);
[m[31m-        info!("  Latency mean: {:.2} μs", stats.mean);
[m[31m-        info!("  Latency min: {:.2} μs", stats.min);
[m[31m-        info!("  Latency max: {:.2} μs", stats.max);
[m[31m-    }
[m[32m+        if let Some(stats) = latency_stats {
[m[32m+            info!("Performance Summary:");
[m[32m+            info!("  Latency count: {}", stats.count);
[m[32m+            info!("  Latency mean: {:.2} μs", stats.mean);
[m[32m+            info!("  Latency min: {:.2} μs", stats.min);
[m[32m+            info!("  Latency max: {:.2} μs", stats.max);
[m[32m+        }
[m 
[31m-    // Generate full report
[m[31m-    let report = perf_tracker.generate_report()?;
[m[31m-    info!("Performance report generated: {} metrics", report.total_metrics_collected);
[m[31m-    info!("Session duration: {:?}", report.session_duration);
[m[32m+        // Generate full report
[m[32m+        let report = perf_tracker.generate_report()?;
[m[32m+        info!(
[m[32m+            "Performance report generated: {} metrics",
[m[32m+            report.total_metrics_collected
[m[32m+        );
[m[32m+        info!("Session duration: {:?}", report.session_duration);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
 //
 // INTEGRATION WORKFLOW TESTS
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:430:
 //
 
[31m-e2e_test!(test_complete_trading_workflow, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing complete trading workflow integration");
[m[32m+e2e_test!(
[m[32m+    test_complete_trading_workflow,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing complete trading workflow integration");
[m 
[31m-    let workflow_start = std::time::Instant::now();
[m[32m+        let workflow_start = std::time::Instant::now();
[m 
[31m-    // Step 1: Check services health
[m[31m-    info!("Step 1: Checking services health...");
[m[31m-    let health = framework.check_services_health().await?;
[m[31m-    info!("  Services health: {}", health.summary());
[m[32m+        // Step 1: Check services health
[m[32m+        info!("Step 1: Checking services health...");
[m[32m+        let health = framework.check_services_health().await?;
[m[32m+        info!("  Services health: {}", health.summary());
[m 
[31m-    // Step 2: Connect to trading service
[m[31m-    info!("Step 2: Connecting to Trading Service...");
[m[31m-    let client_result = framework.get_trading_client().await;
[m[32m+        // Step 2: Connect to trading service
[m[32m+        info!("Step 2: Connecting to Trading Service...");
[m[32m+        let client_result = framework.get_trading_client().await;
[m 
[31m-    if client_result.is_err() {
[m[31m-        warn!("⚠️ Trading service not available, skipping workflow test");
[m[31m-        return Ok(());
[m[31m-    }
[m[32m+        if client_result.is_err() {
[m[32m+            warn!("⚠️ Trading service not available, skipping workflow test");
[m[32m+            return Ok(());
[m[32m+        }
[m 
[31m-    let trading_client = client_result.unwrap();
[m[31m-    info!("  ✅ Connected to Trading Service");
[m[32m+        let trading_client = client_result.unwrap();
[m[32m+        info!("  ✅ Connected to Trading Service");
[m 
[31m-    // Step 3: Query portfolio
[m[31m-    info!("Step 3: Querying portfolio...");
[m[31m-    let portfolio_request = tonic::Request::new(GetPortfolioSummaryRequest {
[m[31m-        account_id: "test_account".to_string(),
[m[31m-    });
[m[31m-    let portfolio_result = trading_client
[m[31m-        .get_portfolio_summary(portfolio_request)
[m[31m-        .await;
[m[32m+        // Step 3: Query portfolio
[m[32m+        info!("Step 3: Querying portfolio...");
[m[32m+        let portfolio_request = tonic::Request::new(GetPortfolioSummaryRequest {
[m[32m+            account_id: "test_account".to_string(),
[m[32m+        });
[m[32m+        let portfolio_result = trading_client
[m[32m+            .get_portfolio_summary(portfolio_request)
[m[32m+            .await;
[m 
[31m-    match portfolio_result {
[m[31m-        Ok(portfolio) => {
[m[31m-            let p = portfolio.into_inner();
[m[31m-            info!("  ✅ Portfolio: ${:.2} total value", p.total_value);
[m[32m+        match portfolio_result {
[m[32m+            Ok(portfolio) => {
[m[32m+                let p = portfolio.into_inner();
[m[32m+                info!("  ✅ Portfolio: ${:.2} total value", p.total_value);
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("  ⚠️ Portfolio query failed: {}", e);
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("  ⚠️ Portfolio query failed: {}", e);
[m[31m-        }
[m[31m-    }
[m 
[31m-    // Step 4: Submit test order
[m[31m-    info!("Step 4: Submitting test order...");
[m[31m-    let order = SubmitOrderRequest {
[m[31m-        symbol: "EURUSD".to_string(),
[m[31m-        side: OrderSide::Buy.into(),
[m[31m-        quantity: 10000.0,
[m[31m-        order_type: OrderType::Market.into(),
[m[31m-        price: None,
[m[31m-        stop_price: None,
[m[31m-        account_id: "test_account".to_string(),
[m[31m-        metadata: std::collections::HashMap::new(),
[m[31m-    };
[m[32m+        // Step 4: Submit test order
[m[32m+        info!("Step 4: Submitting test order...");
[m[32m+        let order = SubmitOrderRequest {
[m[32m+            symbol: "EURUSD".to_string(),
[m[32m+            side: OrderSide::Buy.into(),
[m[32m+            quantity: 10000.0,
[m[32m+            order_type: OrderType::Market.into(),
[m[32m+            price: None,
[m[32m+            stop_price: None,
[m[32m+            account_id: "test_account".to_string(),
[m[32m+            metadata: std::collections::HashMap::new(),
[m[32m+        };
[m 
[31m-    let order_request = tonic::Request::new(order);
[m[31m-    let order_result = trading_client.submit_order(order_request).await;
[m[32m+        let order_request = tonic::Request::new(order);
[m[32m+        let order_result = trading_client.submit_order(order_request).await;
[m 
[31m-    match order_result {
[m[31m-        Ok(response) => {
[m[31m-            let order_response = response.into_inner();
[m[31m-            info!(
[m[31m-                "  ✅ Order submitted: {} (status: {:?})",
[m[31m-                order_response.order_id, order_response.status
[m[31m-            );
[m[32m+        match order_result {
[m[32m+            Ok(response) => {
[m[32m+                let order_response = response.into_inner();
[m[32m+                info!(
[m[32m+                    "  ✅ Order submitted: {} (status: {:?})",
[m[32m+                    order_response.order_id, order_response.status
[m[32m+                );
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("  ⚠️ Order submission failed: {}", e);
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("  ⚠️ Order submission failed: {}", e);
[m[31m-        }
[m[31m-    }
[m 
[31m-    // Step 5: Record performance
[m[31m-    let workflow_duration = workflow_start.elapsed();
[m[31m-    info!(
[m[31m-        "✅ Complete trading workflow finished in {:?}",
[m[31m-        workflow_duration
[m[31m-    );
[m[32m+        // Step 5: Record performance
[m[32m+        let workflow_duration = workflow_start.elapsed();
[m[32m+        info!(
[m[32m+            "✅ Complete trading workflow finished in {:?}",
[m[32m+            workflow_duration
[m[32m+        );
[m 
[31m-    framework
[m[31m-        .performance_tracker
[m[31m-        .record_metric("workflow_duration_ms", workflow_duration.as_millis() as f64)?;
[m[32m+        framework
[m[32m+            .performance_tracker
[m[32m+            .record_metric("workflow_duration_ms", workflow_duration.as_millis() as f64)?;
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
[31m-e2e_test!(test_multi_service_integration, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing multi-service integration");
[m[32m+e2e_test!(
[m[32m+    test_multi_service_integration,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing multi-service integration");
[m 
[31m-    // Test connections to multiple services
[m[31m-    let mut services_available = 0;
[m[32m+        // Test connections to multiple services
[m[32m+        let mut services_available = 0;
[m 
[31m-    // Test Trading Service
[m[31m-    if framework.get_trading_client().await.is_ok() {
[m[31m-        info!("✅ Trading Service available");
[m[31m-        services_available += 1;
[m[31m-    } else {
[m[31m-        warn!("⚠️ Trading Service not available");
[m[31m-    }
[m[32m+        // Test Trading Service
[m[32m+        if framework.get_trading_client().await.is_ok() {
[m[32m+            info!("✅ Trading Service available");
[m[32m+            services_available += 1;
[m[32m+        } else {
[m[32m+            warn!("⚠️ Trading Service not available");
[m[32m+        }
[m 
[31m-    // Test Backtesting Service
[m[31m-    if framework.get_backtesting_client().await.is_ok() {
[m[31m-        info!("✅ Backtesting Service available");
[m[31m-        services_available += 1;
[m[31m-    } else {
[m[31m-        warn!("⚠️ Backtesting Service not available");
[m[31m-    }
[m[32m+        // Test Backtesting Service
[m[32m+        if framework.get_backtesting_client().await.is_ok() {
[m[32m+            info!("✅ Backtesting Service available");
[m[32m+            services_available += 1;
[m[32m+        } else {
[m[32m+            warn!("⚠️ Backtesting Service not available");
[m[32m+        }
[m 
[31m-    // Test Config Service (if available)
[m[31m-    if framework.get_config_client().await.is_ok() {
[m[31m-        info!("✅ Config Service available");
[m[31m-        services_available += 1;
[m[31m-    } else {
[m[31m-        warn!("⚠️ Config Service not available");
[m[31m-    }
[m[32m+        // Test Config Service (if available)
[m[32m+        if framework.get_config_client().await.is_ok() {
[m[32m+            info!("✅ Config Service available");
[m[32m+            services_available += 1;
[m[32m+        } else {
[m[32m+            warn!("⚠️ Config Service not available");
[m[32m+        }
[m 
[31m-    info!(
[m[31m-        "Multi-service integration: {}/3 services available",
[m[31m-        services_available
[m[31m-    );
[m[32m+        info!(
[m[32m+            "Multi-service integration: {}/3 services available",
[m[32m+            services_available
[m[32m+        );
[m 
[31m-    // Test ML pipeline
[m[31m-    let ml_result = framework.ml_pipeline.check_models_health().await;
[m[32m+        // Test ML pipeline
[m[32m+        let ml_result = framework.ml_pipeline.check_models_health().await;
[m 
[31m-    if ml_result.is_ok() {
[m[31m-        info!("✅ ML Pipeline available");
[m[31m-        services_available += 1;
[m[31m-    } else {
[m[31m-        warn!("⚠️ ML Pipeline not available");
[m[31m-    }
[m[32m+        if ml_result.is_ok() {
[m[32m+            info!("✅ ML Pipeline available");
[m[32m+            services_available += 1;
[m[32m+        } else {
[m[32m+            warn!("⚠️ ML Pipeline not available");
[m[32m+        }
[m 
[31m-    info!(
[m[31m-        "✅ Multi-service integration test completed: {}/4 components available",
[m[31m-        services_available
[m[31m-    );
[m[32m+        info!(
[m[32m+            "✅ Multi-service integration test completed: {}/4 components available",
[m[32m+            services_available
[m[32m+        );
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
 //
 // ERROR HANDLING AND RESILIENCE TESTS
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/integration_test.rs:571:
 //
 
[31m-e2e_test!(test_service_timeout_handling, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing service timeout handling");
[m[32m+e2e_test!(
[m[32m+    test_service_timeout_handling,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing service timeout handling");
[m 
[31m-    // Try to connect with aggressive timeout
[m[31m-    let timeout_duration = Duration::from_secs(1);
[m[32m+        // Try to connect with aggressive timeout
[m[32m+        let timeout_duration = Duration::from_secs(1);
[m 
[31m-    let connect_with_timeout = async {
[m[31m-        framework.get_trading_client().await
[m[31m-    };
[m[32m+        let connect_with_timeout = async { framework.get_trading_client().await };
[m 
[31m-    let result = tokio::time::timeout(timeout_duration, connect_with_timeout).await;
[m[32m+        let result = tokio::time::timeout(timeout_duration, connect_with_timeout).await;
[m 
[31m-    match result {
[m[31m-        Ok(Ok(_)) => {
[m[31m-            info!("✅ Service connected within timeout");
[m[32m+        match result {
[m[32m+            Ok(Ok(_)) => {
[m[32m+                info!("✅ Service connected within timeout");
[m[32m+            },
[m[32m+            Ok(Err(e)) => {
[m[32m+                info!("✅ Connection failed gracefully: {}", e);
[m[32m+            },
[m[32m+            Err(_) => {
[m[32m+                info!("✅ Connection timed out as expected");
[m[32m+            },
[m         }
[31m-        Ok(Err(e)) => {
[m[31m-            info!("✅ Connection failed gracefully: {}", e);
[m[31m-        }
[m[31m-        Err(_) => {
[m[31m-            info!("✅ Connection timed out as expected");
[m[31m-        }
[m[32m+
[m[32m+        Ok(())
[m     }
[32m+);
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+e2e_test!(
[m[32m+    test_graceful_shutdown,
[m[32m+    |mut framework: E2ETestFramework| async {
[m[32m+        info!("Testing graceful service shutdown");
[m 
[31m-e2e_test!(test_graceful_shutdown, |mut framework: E2ETestFramework| async {
[m[31m-    info!("Testing graceful service shutdown");
[m[32m+        // Services should already be started
[m[32m+        assert!(
[m[32m+            framework.services_started,
[m[32m+            "Services should be started initially"
[m[32m+        );
[m 
[31m-    // Services should already be started
[m[31m-    assert!(
[m[31m-        framework.services_started,
[m[31m-        "Services should be started initially"
[m[31m-    );
[m[32m+        // Stop services
[m[32m+        let stop_result = framework.stop_services().await;
[m 
[31m-    // Stop services
[m[31m-    let stop_result = framework.stop_services().await;
[m[31m-
[m[31m-    match stop_result {
[m[31m-        Ok(_) => {
[m[31m-            info!("✅ Services stopped gracefully");
[m[31m-            assert!(
[m[31m-                !framework.services_started,
[m[31m-                "Services should be marked as stopped"
[m[31m-            );
[m[32m+        match stop_result {
[m[32m+            Ok(_) => {
[m[32m+                info!("✅ Services stopped gracefully");
[m[32m+                assert!(
[m[32m+                    !framework.services_started,
[m[32m+                    "Services should be marked as stopped"
[m[32m+                );
[m[32m+            },
[m[32m+            Err(e) => {
[m[32m+                warn!("⚠️ Service shutdown encountered issues: {}", e);
[m[32m+                info!("This may be expected in test environments");
[m[32m+            },
[m         }
[31m-        Err(e) => {
[m[31m-            warn!("⚠️ Service shutdown encountered issues: {}", e);
[m[31m-            info!("This may be expected in test environments");
[m[31m-        }
[m[31m-    }
[m 
[31m-    Ok(())
[m[31m-});
[m[32m+        Ok(())
[m[32m+    }
[m[32m+);
[m 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:37:
 
         metrics.insert(
             "mamba_available".to_string(),
[31m-            if model_status.mamba_available { 1.0 } else { 0.0 },
[m[32m+            if model_status.mamba_available {
[m[32m+                1.0
[m[32m+            } else {
[m[32m+                0.0
[m[32m+            },
[m         );
         metrics.insert(
             "dqn_available".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:49:
         );
         metrics.insert(
             "tlob_available".to_string(),
[31m-            if model_status.tlob_available { 1.0 } else { 0.0 },
[m[32m+            if model_status.tlob_available {
[m[32m+                1.0
[m[32m+            } else {
[m[32m+                0.0
[m[32m+            },
[m         );
         metrics.insert(
             "models_available".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:399:
         );
 
         // Log individual model contributions
[31m-        for (i, pred) in ensemble_prediction.individual_predictions.iter().enumerate() {
[m[32m+        for (i, pred) in ensemble_prediction
[m[32m+            .individual_predictions
[m[32m+            .iter()
[m[32m+            .enumerate()
[m[32m+        {
[m             debug!(
                 "   Model {}: {} signal={:.4}, confidence={:.4}",
                 i + 1,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:571:
 mod tests {
     use super::*;
 
[31m-    e2e_test!(test_ml_model_health, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_ml_model_health().await?;
[m[31m-        assert!(result.success, "ML model health check failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_ml_model_health,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_ml_model_health().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "ML model health check failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_feature_extraction, |framework: Arc<E2ETestFramework>| async move {
[m[32m+    e2e_test!(test_feature_extraction, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m         let ml_tests = MLModelIntegrationTests::new(framework);
         let result = ml_tests.test_feature_extraction().await?;
[31m-        assert!(result.success, "Feature extraction failed: {:?}", result.error_message);
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Feature extraction failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m         Ok(())
     });
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:588:
[31m-    e2e_test!(test_mamba_inference, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_mamba_inference().await?;
[m[31m-        assert!(result.success, "MAMBA inference failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_mamba_inference,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_mamba_inference().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "MAMBA inference failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_dqn_inference, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_dqn_inference().await?;
[m[31m-        assert!(result.success, "DQN inference failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_dqn_inference,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_dqn_inference().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "DQN inference failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_tft_inference, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_tft_inference().await?;
[m[31m-        assert!(result.success, "TFT inference failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_tft_inference,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_tft_inference().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "TFT inference failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_tlob_inference, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_tlob_inference().await?;
[m[31m-        assert!(result.success, "TLOB inference failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_tlob_inference,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_tlob_inference().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "TLOB inference failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m 
[31m-    e2e_test!(test_ensemble_prediction, |framework: Arc<E2ETestFramework>| async move {
[m[32m+    e2e_test!(test_ensemble_prediction, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m         let ml_tests = MLModelIntegrationTests::new(framework);
         let result = ml_tests.test_ensemble_prediction().await?;
[31m-        assert!(result.success, "Ensemble prediction failed: {:?}", result.error_message);
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Ensemble prediction failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m         Ok(())
     });
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:623:
[31m-    e2e_test!(test_model_performance, |framework: Arc<E2ETestFramework>| async move {
[m[32m+    e2e_test!(test_model_performance, |framework: Arc<
[m[32m+        E2ETestFramework,
[m[32m+    >| async move {
[m         let ml_tests = MLModelIntegrationTests::new(framework);
         let result = ml_tests.test_model_performance().await?;
[31m-        assert!(result.success, "Model performance test failed: {:?}", result.error_message);
[m[32m+        assert!(
[m[32m+            result.success,
[m[32m+            "Model performance test failed: {:?}",
[m[32m+            result.error_message
[m[32m+        );
[m         Ok(())
     });
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/ml_model_integration_tests.rs:630:
[31m-    e2e_test!(test_model_failover, |framework: Arc<E2ETestFramework>| async move {
[m[31m-        let ml_tests = MLModelIntegrationTests::new(framework);
[m[31m-        let result = ml_tests.test_model_failover().await?;
[m[31m-        assert!(result.success, "Model failover test failed: {:?}", result.error_message);
[m[31m-        Ok(())
[m[31m-    });
[m[32m+    e2e_test!(
[m[32m+        test_model_failover,
[m[32m+        |framework: Arc<E2ETestFramework>| async move {
[m[32m+            let ml_tests = MLModelIntegrationTests::new(framework);
[m[32m+            let result = ml_tests.test_model_failover().await?;
[m[32m+            assert!(
[m[32m+                result.success,
[m[32m+                "Model failover test failed: {:?}",
[m[32m+                result.error_message
[m[32m+            );
[m[32m+            Ok(())
[m[32m+        }
[m[32m+    );
[m }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/multi_service_integration.rs:11:
 use std::time::Duration;
 use tracing::{info, warn};
 
[31m-e2e_test!(
[m[31m-    test_trading_ml_integration,
[m[31m-    |framework: Arc<E2ETestFramework>| async move {
[m[31m-        info!("🔄 Starting Trading + ML Service integration test");
[m[32m+e2e_test!(test_trading_ml_integration, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m[32m+    info!("🔄 Starting Trading + ML Service integration test");
[m 
[31m-        // Step 1: Verify services are available
[m[31m-        let health = framework
[m[31m-            .check_services_health()
[m[31m-            .await
[m[31m-            .context("Failed to check services health")?;
[m[32m+    // Step 1: Verify services are available
[m[32m+    let health = framework
[m[32m+        .check_services_health()
[m[32m+        .await
[m[32m+        .context("Failed to check services health")?;
[m 
[31m-        info!("Services health status: {:?}", health);
[m[32m+    info!("Services health status: {:?}", health);
[m 
[31m-        // Step 2: Check ML models status
[m[31m-        let ml_status = framework
[m[31m-            .ml_pipeline
[m[31m-            .check_models_health()
[m[31m-            .await
[m[31m-            .context("Failed to check ML models")?;
[m[32m+    // Step 2: Check ML models status
[m[32m+    let ml_status = framework
[m[32m+        .ml_pipeline
[m[32m+        .check_models_health()
[m[32m+        .await
[m[32m+        .context("Failed to check ML models")?;
[m 
[31m-        info!("ML Models available: {}", ml_status.available_count());
[m[32m+    info!("ML Models available: {}", ml_status.available_count());
[m 
[31m-        if !ml_status.any_available() {
[m[31m-            warn!("⚠️  No ML models available - test will use mock predictions");
[m[31m-        }
[m[32m+    if !ml_status.any_available() {
[m[32m+        warn!("⚠️  No ML models available - test will use mock predictions");
[m[32m+    }
[m 
[31m-        // Step 3: Test market data flow -> ML inference -> trading signal
[m[31m-        info!("📊 Testing market data -> ML inference -> trading signal flow");
[m[32m+    // Step 3: Test market data flow -> ML inference -> trading signal
[m[32m+    info!("📊 Testing market data -> ML inference -> trading signal flow");
[m 
[31m-        // Generate test market data
[m[31m-        let test_symbols = vec!["AAPL", "MSFT", "GOOGL"];
[m[31m-        let market_data = generate_test_market_data(&test_symbols, 100)?;
[m[32m+    // Generate test market data
[m[32m+    let test_symbols = vec!["AAPL", "MSFT", "GOOGL"];
[m[32m+    let market_data = generate_test_market_data(&test_symbols, 100)?;
[m 
[31m-        info!("Generated {} market data points", market_data.len());
[m[32m+    info!("Generated {} market data points", market_data.len());
[m 
[31m-        // Extract features using ML pipeline
[m[31m-        // Note: We can't use framework.ml_pipeline directly due to borrow checker,
[m[31m-        // so we'll simplify the test to just validate the workflow without ML calls
[m[31m-        let features_count = market_data.len() / 10; // Simulate feature extraction
[m[32m+    // Extract features using ML pipeline
[m[32m+    // Note: We can't use framework.ml_pipeline directly due to borrow checker,
[m[32m+    // so we'll simplify the test to just validate the workflow without ML calls
[m[32m+    let features_count = market_data.len() / 10; // Simulate feature extraction
[m 
[31m-        info!("Simulated extraction of {} feature vectors", features_count);
[m[32m+    info!("Simulated extraction of {} feature vectors", features_count);
[m 
[31m-        assert!(
[m[31m-            features_count > 0,
[m[31m-            "Should extract features from market data"
[m[31m-        );
[m[32m+    assert!(
[m[32m+        features_count > 0,
[m[32m+        "Should extract features from market data"
[m[32m+    );
[m 
[31m-        // Get ML predictions (simplified for testing)
[m[31m-        use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[31m-        let prediction = EnsemblePrediction {
[m[31m-            signal: 0.5,
[m[31m-            confidence: 0.8,
[m[31m-            individual_predictions: vec![],
[m[31m-            ensemble_method: if ml_status.any_available() {
[m[31m-                "ensemble"
[m[31m-            } else {
[m[31m-                "mock"
[m[31m-            }
[m[31m-            .to_string(),
[m[31m-            total_inference_time: Duration::from_millis(10),
[m[31m-            prediction: PredictionType::Buy,
[m[31m-            signal_strength: 0.5,
[m[31m-        };
[m[32m+    // Get ML predictions (simplified for testing)
[m[32m+    use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[32m+    let prediction = EnsemblePrediction {
[m[32m+        signal: 0.5,
[m[32m+        confidence: 0.8,
[m[32m+        individual_predictions: vec![],
[m[32m+        ensemble_method: if ml_status.any_available() {
[m[32m+            "ensemble"
[m[32m+        } else {
[m[32m+            "mock"
[m[32m+        }
[m[32m+        .to_string(),
[m[32m+        total_inference_time: Duration::from_millis(10),
[m[32m+        prediction: PredictionType::Buy,
[m[32m+        signal_strength: 0.5,
[m[32m+    };
[m 
[31m-        info!(
[m[31m-            "ML Prediction: signal={:.3}, confidence={:.3}",
[m[31m-            prediction.signal, prediction.confidence
[m[31m-        );
[m[32m+    info!(
[m[32m+        "ML Prediction: signal={:.3}, confidence={:.3}",
[m[32m+        prediction.signal, prediction.confidence
[m[32m+    );
[m 
[31m-        // Validate prediction bounds
[m[31m-        assert!(
[m[31m-            prediction.signal >= -1.0 && prediction.signal <= 1.0,
[m[31m-            "Signal should be between -1 and 1"
[m[31m-        );
[m[31m-        assert!(
[m[31m-            prediction.confidence >= 0.0 && prediction.confidence <= 1.0,
[m[31m-            "Confidence should be between 0 and 1"
[m[31m-        );
[m[32m+    // Validate prediction bounds
[m[32m+    assert!(
[m[32m+        prediction.signal >= -1.0 && prediction.signal <= 1.0,
[m[32m+        "Signal should be between -1 and 1"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        prediction.confidence >= 0.0 && prediction.confidence <= 1.0,
[m[32m+        "Confidence should be between 0 and 1"
[m[32m+    );
[m 
[31m-        // Step 4: Record performance metrics
[m[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("ml_trading_integration_test", 1.0)?;
[m[32m+    // Step 4: Record performance metrics
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("ml_trading_integration_test", 1.0)?;
[m 
[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("ml_inference_confidence", prediction.confidence)?;
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("ml_inference_confidence", prediction.confidence)?;
[m 
[31m-        info!("✅ Trading + ML integration test completed successfully");
[m[32m+    info!("✅ Trading + ML integration test completed successfully");
[m 
[31m-        Ok(())
[m[31m-    }
[m[31m-);
[m[32m+    Ok(())
[m[32m+});
[m 
[31m-e2e_test!(
[m[31m-    test_trading_backtesting_integration,
[m[31m-    |framework: Arc<E2ETestFramework>| async move {
[m[31m-        info!("🔄 Starting Trading + Backtesting Service integration test");
[m[32m+e2e_test!(test_trading_backtesting_integration, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m[32m+    info!("🔄 Starting Trading + Backtesting Service integration test");
[m 
[31m-        // Step 1: Verify services are available
[m[31m-        let health = framework
[m[31m-            .check_services_health()
[m[31m-            .await
[m[31m-            .context("Failed to check services health")?;
[m[32m+    // Step 1: Verify services are available
[m[32m+    let health = framework
[m[32m+        .check_services_health()
[m[32m+        .await
[m[32m+        .context("Failed to check services health")?;
[m 
[31m-        info!("Services health: {:?}", health);
[m[32m+    info!("Services health: {:?}", health);
[m 
[31m-        // Step 2: Test strategy configuration workflow
[m[31m-        info!("📋 Testing strategy workflow between services");
[m[32m+    // Step 2: Test strategy configuration workflow
[m[32m+    info!("📋 Testing strategy workflow between services");
[m 
[31m-        // Generate comprehensive market data for backtesting
[m[31m-        let symbols = vec!["AAPL", "MSFT"];
[m[31m-        let market_data = generate_test_market_data(&symbols, 500)?;
[m[32m+    // Generate comprehensive market data for backtesting
[m[32m+    let symbols = vec!["AAPL", "MSFT"];
[m[32m+    let market_data = generate_test_market_data(&symbols, 500)?;
[m 
[31m-        info!("Generated {} market data points for backtest", market_data.len());
[m[32m+    info!(
[m[32m+        "Generated {} market data points for backtest",
[m[32m+        market_data.len()
[m[32m+    );
[m 
[31m-        // Step 3: Process data through ML pipeline (simulating strategy)
[m[31m-        let features_count = market_data.len() / 10;
[m[31m-        info!("Simulated extraction of {} features for strategy", features_count);
[m[32m+    // Step 3: Process data through ML pipeline (simulating strategy)
[m[32m+    let features_count = market_data.len() / 10;
[m[32m+    info!(
[m[32m+        "Simulated extraction of {} features for strategy",
[m[32m+        features_count
[m[32m+    );
[m 
[31m-        let ml_status = framework.ml_pipeline.check_models_health().await?;
[m[32m+    let ml_status = framework.ml_pipeline.check_models_health().await?;
[m 
[31m-        use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[31m-        let prediction = EnsemblePrediction {
[m[31m-            signal: 0.6,
[m[31m-            confidence: 0.75,
[m[31m-            individual_predictions: vec![],
[m[31m-            ensemble_method: if ml_status.any_available() {
[m[31m-                "ensemble"
[m[31m-            } else {
[m[31m-                "mock"
[m[31m-            }
[m[31m-            .to_string(),
[m[31m-            total_inference_time: Duration::from_millis(10),
[m[31m-            prediction: PredictionType::Buy,
[m[31m-            signal_strength: 0.6,
[m[31m-        };
[m[32m+    use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[32m+    let prediction = EnsemblePrediction {
[m[32m+        signal: 0.6,
[m[32m+        confidence: 0.75,
[m[32m+        individual_predictions: vec![],
[m[32m+        ensemble_method: if ml_status.any_available() {
[m[32m+            "ensemble"
[m[32m+        } else {
[m[32m+            "mock"
[m[32m+        }
[m[32m+        .to_string(),
[m[32m+        total_inference_time: Duration::from_millis(10),
[m[32m+        prediction: PredictionType::Buy,
[m[32m+        signal_strength: 0.6,
[m[32m+    };
[m 
[31m-        info!(
[m[31m-            "Strategy signal: {:.3}, confidence: {:.3}",
[m[31m-            prediction.signal, prediction.confidence
[m[31m-        );
[m[32m+    info!(
[m[32m+        "Strategy signal: {:.3}, confidence: {:.3}",
[m[32m+        prediction.signal, prediction.confidence
[m[32m+    );
[m 
[31m-        // Step 4: Record comparison metrics
[m[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("trading_backtesting_integration_test", 1.0)?;
[m[32m+    // Step 4: Record comparison metrics
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("trading_backtesting_integration_test", 1.0)?;
[m 
[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("strategy_confidence", prediction.confidence)?;
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("strategy_confidence", prediction.confidence)?;
[m 
[31m-        info!("✅ Trading + Backtesting integration test completed");
[m[32m+    info!("✅ Trading + Backtesting integration test completed");
[m 
[31m-        Ok(())
[m[31m-    }
[m[31m-);
[m[32m+    Ok(())
[m[32m+});
[m 
[31m-e2e_test!(
[m[31m-    test_full_multi_service_workflow,
[m[31m-    |framework: Arc<E2ETestFramework>| async move {
[m[31m-        info!("🔄 Starting full multi-service workflow test");
[m[32m+e2e_test!(test_full_multi_service_workflow, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m[32m+    info!("🔄 Starting full multi-service workflow test");
[m 
[31m-        // Step 1: Verify all services
[m[31m-        let health = framework.check_services_health().await?;
[m[31m-        info!("All services health: {:?}", health);
[m[32m+    // Step 1: Verify all services
[m[32m+    let health = framework.check_services_health().await?;
[m[32m+    info!("All services health: {:?}", health);
[m 
[31m-        // Step 2: Test data flow across services
[m[31m-        info!("📊 Testing data flow: Market Data -> ML -> Trading");
[m[32m+    // Step 2: Test data flow across services
[m[32m+    info!("📊 Testing data flow: Market Data -> ML -> Trading");
[m 
[31m-        // Generate comprehensive market data
[m[31m-        let symbols = vec!["AAPL", "MSFT", "GOOGL", "TSLA"];
[m[31m-        let market_data = generate_test_market_data(&symbols, 500)?;
[m[32m+    // Generate comprehensive market data
[m[32m+    let symbols = vec!["AAPL", "MSFT", "GOOGL", "TSLA"];
[m[32m+    let market_data = generate_test_market_data(&symbols, 500)?;
[m 
[31m-        info!("Generated {} market data points", market_data.len());
[m[32m+    info!("Generated {} market data points", market_data.len());
[m 
[31m-        // Process through ML pipeline
[m[31m-        let features_count = market_data.len() / 10;
[m[31m-        info!("Simulated extraction of {} features", features_count);
[m[32m+    // Process through ML pipeline
[m[32m+    let features_count = market_data.len() / 10;
[m[32m+    info!("Simulated extraction of {} features", features_count);
[m 
[31m-        let ml_status = framework.ml_pipeline.check_models_health().await?;
[m[32m+    let ml_status = framework.ml_pipeline.check_models_health().await?;
[m 
[31m-        // Mock prediction for workflow testing
[m[31m-        use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[31m-        let prediction = EnsemblePrediction {
[m[31m-            signal: 0.7,
[m[31m-            confidence: 0.85,
[m[31m-            individual_predictions: vec![],
[m[31m-            ensemble_method: if ml_status.any_available() {
[m[31m-                "ensemble"
[m[31m-            } else {
[m[31m-                "mock"
[m[31m-            }
[m[31m-            .to_string(),
[m[31m-            total_inference_time: Duration::from_millis(10),
[m[31m-            prediction: PredictionType::Buy,
[m[31m-            signal_strength: 0.7,
[m[31m-        };
[m[32m+    // Mock prediction for workflow testing
[m[32m+    use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[32m+    let prediction = EnsemblePrediction {
[m[32m+        signal: 0.7,
[m[32m+        confidence: 0.85,
[m[32m+        individual_predictions: vec![],
[m[32m+        ensemble_method: if ml_status.any_available() {
[m[32m+            "ensemble"
[m[32m+        } else {
[m[32m+            "mock"
[m[32m+        }
[m[32m+        .to_string(),
[m[32m+        total_inference_time: Duration::from_millis(10),
[m[32m+        prediction: PredictionType::Buy,
[m[32m+        signal_strength: 0.7,
[m[32m+    };
[m 
[31m-        info!(
[m[31m-            "ML Prediction: signal={:.3}, confidence={:.3}",
[m[31m-            prediction.signal, prediction.confidence
[m[31m-        );
[m[32m+    info!(
[m[32m+        "ML Prediction: signal={:.3}, confidence={:.3}",
[m[32m+        prediction.signal, prediction.confidence
[m[32m+    );
[m 
[31m-        // Generate trading signals based on ML prediction
[m[31m-        let mut signals_generated = 0;
[m[32m+    // Generate trading signals based on ML prediction
[m[32m+    let mut signals_generated = 0;
[m 
[31m-        for symbol in &symbols {
[m[31m-            if prediction.signal.abs() > 0.5 {
[m[31m-                signals_generated += 1;
[m[31m-                info!(
[m[31m-                    "Generated trading signal for {}: {} (strength: {:.2})",
[m[31m-                    symbol,
[m[31m-                    if prediction.signal > 0.0 { "BUY" } else { "SELL" },
[m[31m-                    prediction.signal.abs()
[m[31m-                );
[m[31m-            }
[m[32m+    for symbol in &symbols {
[m[32m+        if prediction.signal.abs() > 0.5 {
[m[32m+            signals_generated += 1;
[m[32m+            info!(
[m[32m+                "Generated trading signal for {}: {} (strength: {:.2})",
[m[32m+                symbol,
[m[32m+                if prediction.signal > 0.0 {
[m[32m+                    "BUY"
[m[32m+                } else {
[m[32m+                    "SELL"
[m[32m+                },
[m[32m+                prediction.signal.abs()
[m[32m+            );
[m         }
[32m+    }
[m 
[31m-        info!("Generated {} trading signals", signals_generated);
[m[32m+    info!("Generated {} trading signals", signals_generated);
[m 
[31m-        // Step 3: Record comprehensive metrics
[m[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("multi_service_workflow_test", 1.0)?;
[m[32m+    // Step 3: Record comprehensive metrics
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("multi_service_workflow_test", 1.0)?;
[m 
[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("signals_generated", signals_generated as f64)?;
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("signals_generated", signals_generated as f64)?;
[m 
[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("ml_confidence", prediction.confidence)?;
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("ml_confidence", prediction.confidence)?;
[m 
[31m-        info!("✅ Full multi-service workflow test completed successfully");
[m[31m-        info!("📊 Summary:");
[m[31m-        info!("  Market data points processed: {}", market_data.len());
[m[31m-        info!("  ML predictions generated: 1");
[m[31m-        info!("  Trading signals generated: {}", signals_generated);
[m[32m+    info!("✅ Full multi-service workflow test completed successfully");
[m[32m+    info!("📊 Summary:");
[m[32m+    info!("  Market data points processed: {}", market_data.len());
[m[32m+    info!("  ML predictions generated: 1");
[m[32m+    info!("  Trading signals generated: {}", signals_generated);
[m 
[31m-        Ok(())
[m[31m-    }
[m[31m-);
[m[32m+    Ok(())
[m[32m+});
[m 
 /// Generate test market data for multiple symbols
 fn generate_test_market_data(
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_load_tests.rs:9:
 
 use anyhow::Result;
 use common::types::{Exchange, HftTimestamp, MarketTick, Price, Quantity, Symbol, TickType};
[32m+use foxhunt_e2e::e2e_test;
[m use foxhunt_e2e::proto::trading::{
     GetOrderStatusRequest, GetPortfolioSummaryRequest, OrderSide, OrderType, SubmitOrderRequest,
 };
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_load_tests.rs:15:
[31m-use foxhunt_e2e::e2e_test;
[m use std::collections::HashMap;
 use std::sync::atomic::{AtomicU64, Ordering};
 use std::sync::Arc;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:28:
 }
 
 // Helper function to mark result as success
[31m-fn mark_success(mut result: WorkflowTestResult, duration: Duration, steps: usize) -> WorkflowTestResult {
[m[32m+fn mark_success(
[m[32m+    mut result: WorkflowTestResult,
[m[32m+    duration: Duration,
[m[32m+    steps: usize,
[m[32m+) -> WorkflowTestResult {
[m     result.success = true;
     result.duration = duration;
     result.steps_completed = steps;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:54:
 
 // Test 1: Critical path sub-50μs latency validation
 // Validates that the critical trading path meets HFT latency requirements
[31m-e2e_test!(test_critical_path_latency, |framework: Arc<E2ETestFramework>| async move {
[m[32m+e2e_test!(test_critical_path_latency, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m     let start_time = Instant::now();
     let mut result = new_workflow_result("Critical Path Latency Validation");
     let mut steps = 0;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:132:
     let price_p95 = percentile(&price_calc_samples, 95.0);
     add_metric(&mut result, "price_calculation_p95_ns", price_p95 as f64);
 
[31m-    assert!(
[m[31m-        price_p95 < 500,
[m[31m-        "Price calculations should be <500ns P95"
[m[31m-    );
[m[32m+    assert!(price_p95 < 500, "Price calculations should be <500ns P95");
[m     steps += 1;
 
     // Step 6: Symbol lookup simulation
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:223:
 
 // Test 2: Throughput and scalability benchmarks
 // Validates system throughput under various load conditions
[31m-e2e_test!(test_throughput_scalability, |framework: Arc<E2ETestFramework>| async move {
[m[32m+e2e_test!(test_throughput_scalability, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m     let start_time = Instant::now();
     let mut result = new_workflow_result("Throughput Scalability Benchmarks");
     let mut steps = 0;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:245:
     let actual_duration = single_thread_start.elapsed().as_secs_f64();
     let single_thread_ops_per_sec = operations_completed as f64 / actual_duration;
 
[31m-    add_metric(&mut result, "single_thread_ops_per_sec", single_thread_ops_per_sec);
[m[31m-    add_metric(&mut result, "single_thread_total_ops", operations_completed as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "single_thread_ops_per_sec",
[m[32m+        single_thread_ops_per_sec,
[m[32m+    );
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "single_thread_total_ops",
[m[32m+        operations_completed as f64,
[m[32m+    );
[m 
     // Should achieve at least 100k ops/sec for simple operations
     assert!(
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:339:
     let sustained_p95 = percentile(&sustained_samples, 95.0);
     let sustained_p99 = percentile(&sustained_samples, 99.0);
 
[31m-    add_metric(&mut result, "sustained_samples_count", sustained_samples.len() as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "sustained_samples_count",
[m[32m+        sustained_samples.len() as f64,
[m[32m+    );
[m     add_metric(&mut result, "sustained_p50_ns", sustained_p50 as f64);
     add_metric(&mut result, "sustained_p95_ns", sustained_p95 as f64);
     add_metric(&mut result, "sustained_p99_ns", sustained_p99 as f64);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:387:
 
 // Test 3: Resource utilization validation
 // Validates memory usage and allocation patterns
[31m-e2e_test!(test_resource_utilization, |framework: Arc<E2ETestFramework>| async move {
[m[32m+e2e_test!(test_resource_utilization, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m     let start_time = Instant::now();
     let mut result = new_workflow_result("Resource Utilization Validation");
     let mut steps = 0;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:402:
     }
 
     let baseline_duration = baseline_start.elapsed();
[31m-    add_metric(&mut result, "baseline_allocation_time_ms", baseline_duration.as_millis() as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "baseline_allocation_time_ms",
[m[32m+        baseline_duration.as_millis() as f64,
[m[32m+    );
[m     steps += 1;
 
     // Step 2: Stress test memory allocation
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:417:
     let stress_duration = stress_start.elapsed();
     let alloc_per_sec = stress_allocations as f64 / stress_duration.as_secs_f64();
 
[31m-    add_metric(&mut result, "stress_allocation_time_ms", stress_duration.as_millis() as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "stress_allocation_time_ms",
[m[32m+        stress_duration.as_millis() as f64,
[m[32m+    );
[m     add_metric(&mut result, "allocations_per_sec", alloc_per_sec);
     steps += 1;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:445:
     }
 
     let leak_test_duration = leak_test_start.elapsed();
[31m-    add_metric(&mut result, "leak_test_duration_ms", leak_test_duration.as_millis() as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "leak_test_duration_ms",
[m[32m+        leak_test_duration.as_millis() as f64,
[m[32m+    );
[m 
     // If this takes too long, there might be allocation issues
     assert!(
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:469:
 
 // Test 4: Performance regression detection
 // Compares performance metrics against baseline expectations
[31m-e2e_test!(test_performance_regression, |_framework: Arc<E2ETestFramework>| async move {
[m[32m+e2e_test!(test_performance_regression, |_framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m     let start_time = Instant::now();
     let mut result = new_workflow_result("Performance Regression Detection");
     let mut steps = 0;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:524:
     for (metric_name, baseline) in baselines {
         if let Some(&actual) = result.metrics.get(metric_name) {
             let regression_pct = ((actual - baseline) / baseline) * 100.0;
[31m-            add_metric(&mut result, &format!("{}_regression_pct", metric_name), regression_pct);
[m[32m+            add_metric(
[m[32m+                &mut result,
[m[32m+                &format!("{}_regression_pct", metric_name),
[m[32m+                regression_pct,
[m[32m+            );
[m 
             // Allow 20% degradation tolerance
             if regression_pct > 20.0 {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:539:
 
     // Step 3: Validate no significant regressions
     if !regressions.is_empty() {
[31m-        result.error_message = Some(format!("Performance regressions detected: {}", regressions.join("; ")));
[m[32m+        result.error_message = Some(format!(
[m[32m+            "Performance regressions detected: {}",
[m[32m+            regressions.join("; ")
[m[32m+        ));
[m         result.success = false;
[31m-        return Err(anyhow::anyhow!("Performance regressions: {:?}", regressions));
[m[32m+        return Err(anyhow::anyhow!(
[m[32m+            "Performance regressions: {:?}",
[m[32m+            regressions
[m[32m+        ));
[m     }
     steps += 1;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:28:
 
         // Get both trading and risk clients
         let trading_client = framework.get_trading_client().await?;
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         // Step 2: Get initial risk metrics baseline
         info!("📊 Getting initial risk metrics baseline");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:55:
                 metrics.portfolio_var_1d <= 0.0,
                 "VaR should be negative or zero"
             );
[32m+            assert!(metrics.volatility >= 0.0, "Volatility should be positive");
[m             assert!(
[31m-                metrics.volatility >= 0.0,
[m[31m-                "Volatility should be positive"
[m[31m-            );
[m[31m-            assert!(
[m                 metrics.max_drawdown <= 0.0,
                 "Max drawdown should be negative or zero"
             );
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:107:
             "  Portfolio risk score: {:.2}",
             position_risk.portfolio_risk_score
         );
[31m-        info!("  Positions analyzed: {}", position_risk.position_risks.len());
[m[32m+        info!(
[m[32m+            "  Positions analyzed: {}",
[m[32m+            position_risk.position_risks.len()
[m[32m+        );
[m 
         assert!(
             position_risk.portfolio_risk_score >= 0.0,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:281:
                 } else {
                     warn!("⚠️ Post-emergency order was submitted - emergency stop may not be fully active");
                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 info!("✅ Post-emergency order failed as expected: {}", e);
[31m-            }
[m[32m+            },
[m         }
 
         // Step 9: Test final risk metrics
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:333:
         info!("📏 Starting risk limit scenarios E2E test");
 
         let _trading_client = framework.get_trading_client().await?;
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         // Test various risk limit scenarios
         let test_scenarios = vec![
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:409:
         info!("💪 Starting risk system stress testing");
 
         let _trading_client = framework.get_trading_client().await?;
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         // Step 1: Rapid order validations
         info!("⚡ Stress testing with rapid order validations");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:441:
                     let _response = response.into_inner();
                     // Validation completed successfully (regardless of is_valid result)
                     successful_validations += 1;
[31m-                }
[m[32m+                },
[m                 Err(_) => {
                     failed_validations += 1;
[31m-                }
[m[32m+                },
[m             }
 
             // Small delay to avoid overwhelming the system
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:479:
         let mut handles = Vec::new();
 
         for _ in 0..concurrent_requests {
[31m-            let mut client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-                "http://[::1]:50051"
[m[31m-            )
[m[31m-            .await
[m[31m-            .context("Failed to connect to Risk Service")?;
[m[32m+            let mut client =
[m[32m+                foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                    "http://[::1]:50051",
[m[32m+                )
[m[32m+                .await
[m[32m+                .context("Failed to connect to Risk Service")?;
[m 
             let handle = tokio::spawn(async move {
                 client
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/multi_service_integration.rs:11:
 use std::time::Duration;
 use tracing::{info, warn};
 
[31m-e2e_test!(
[m[31m-    test_trading_ml_integration,
[m[31m-    |framework: Arc<E2ETestFramework>| async move {
[m[31m-        info!("🔄 Starting Trading + ML Service integration test");
[m[32m+e2e_test!(test_trading_ml_integration, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m[32m+    info!("🔄 Starting Trading + ML Service integration test");
[m 
[31m-        // Step 1: Verify services are available
[m[31m-        let health = framework
[m[31m-            .check_services_health()
[m[31m-            .await
[m[31m-            .context("Failed to check services health")?;
[m[32m+    // Step 1: Verify services are available
[m[32m+    let health = framework
[m[32m+        .check_services_health()
[m[32m+        .await
[m[32m+        .context("Failed to check services health")?;
[m 
[31m-        info!("Services health status: {:?}", health);
[m[32m+    info!("Services health status: {:?}", health);
[m 
[31m-        // Step 2: Check ML models status
[m[31m-        let ml_status = framework
[m[31m-            .ml_pipeline
[m[31m-            .check_models_health()
[m[31m-            .await
[m[31m-            .context("Failed to check ML models")?;
[m[32m+    // Step 2: Check ML models status
[m[32m+    let ml_status = framework
[m[32m+        .ml_pipeline
[m[32m+        .check_models_health()
[m[32m+        .await
[m[32m+        .context("Failed to check ML models")?;
[m 
[31m-        info!("ML Models available: {}", ml_status.available_count());
[m[32m+    info!("ML Models available: {}", ml_status.available_count());
[m 
[31m-        if !ml_status.any_available() {
[m[31m-            warn!("⚠️  No ML models available - test will use mock predictions");
[m[31m-        }
[m[32m+    if !ml_status.any_available() {
[m[32m+        warn!("⚠️  No ML models available - test will use mock predictions");
[m[32m+    }
[m 
[31m-        // Step 3: Test market data flow -> ML inference -> trading signal
[m[31m-        info!("📊 Testing market data -> ML inference -> trading signal flow");
[m[32m+    // Step 3: Test market data flow -> ML inference -> trading signal
[m[32m+    info!("📊 Testing market data -> ML inference -> trading signal flow");
[m 
[31m-        // Generate test market data
[m[31m-        let test_symbols = vec!["AAPL", "MSFT", "GOOGL"];
[m[31m-        let market_data = generate_test_market_data(&test_symbols, 100)?;
[m[32m+    // Generate test market data
[m[32m+    let test_symbols = vec!["AAPL", "MSFT", "GOOGL"];
[m[32m+    let market_data = generate_test_market_data(&test_symbols, 100)?;
[m 
[31m-        info!("Generated {} market data points", market_data.len());
[m[32m+    info!("Generated {} market data points", market_data.len());
[m 
[31m-        // Extract features using ML pipeline
[m[31m-        // Note: We can't use framework.ml_pipeline directly due to borrow checker,
[m[31m-        // so we'll simplify the test to just validate the workflow without ML calls
[m[31m-        let features_count = market_data.len() / 10; // Simulate feature extraction
[m[32m+    // Extract features using ML pipeline
[m[32m+    // Note: We can't use framework.ml_pipeline directly due to borrow checker,
[m[32m+    // so we'll simplify the test to just validate the workflow without ML calls
[m[32m+    let features_count = market_data.len() / 10; // Simulate feature extraction
[m 
[31m-        info!("Simulated extraction of {} feature vectors", features_count);
[m[32m+    info!("Simulated extraction of {} feature vectors", features_count);
[m 
[31m-        assert!(
[m[31m-            features_count > 0,
[m[31m-            "Should extract features from market data"
[m[31m-        );
[m[32m+    assert!(
[m[32m+        features_count > 0,
[m[32m+        "Should extract features from market data"
[m[32m+    );
[m 
[31m-        // Get ML predictions (simplified for testing)
[m[31m-        use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[31m-        let prediction = EnsemblePrediction {
[m[31m-            signal: 0.5,
[m[31m-            confidence: 0.8,
[m[31m-            individual_predictions: vec![],
[m[31m-            ensemble_method: if ml_status.any_available() {
[m[31m-                "ensemble"
[m[31m-            } else {
[m[31m-                "mock"
[m[31m-            }
[m[31m-            .to_string(),
[m[31m-            total_inference_time: Duration::from_millis(10),
[m[31m-            prediction: PredictionType::Buy,
[m[31m-            signal_strength: 0.5,
[m[31m-        };
[m[32m+    // Get ML predictions (simplified for testing)
[m[32m+    use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[32m+    let prediction = EnsemblePrediction {
[m[32m+        signal: 0.5,
[m[32m+        confidence: 0.8,
[m[32m+        individual_predictions: vec![],
[m[32m+        ensemble_method: if ml_status.any_available() {
[m[32m+            "ensemble"
[m[32m+        } else {
[m[32m+            "mock"
[m[32m+        }
[m[32m+        .to_string(),
[m[32m+        total_inference_time: Duration::from_millis(10),
[m[32m+        prediction: PredictionType::Buy,
[m[32m+        signal_strength: 0.5,
[m[32m+    };
[m 
[31m-        info!(
[m[31m-            "ML Prediction: signal={:.3}, confidence={:.3}",
[m[31m-            prediction.signal, prediction.confidence
[m[31m-        );
[m[32m+    info!(
[m[32m+        "ML Prediction: signal={:.3}, confidence={:.3}",
[m[32m+        prediction.signal, prediction.confidence
[m[32m+    );
[m 
[31m-        // Validate prediction bounds
[m[31m-        assert!(
[m[31m-            prediction.signal >= -1.0 && prediction.signal <= 1.0,
[m[31m-            "Signal should be between -1 and 1"
[m[31m-        );
[m[31m-        assert!(
[m[31m-            prediction.confidence >= 0.0 && prediction.confidence <= 1.0,
[m[31m-            "Confidence should be between 0 and 1"
[m[31m-        );
[m[32m+    // Validate prediction bounds
[m[32m+    assert!(
[m[32m+        prediction.signal >= -1.0 && prediction.signal <= 1.0,
[m[32m+        "Signal should be between -1 and 1"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        prediction.confidence >= 0.0 && prediction.confidence <= 1.0,
[m[32m+        "Confidence should be between 0 and 1"
[m[32m+    );
[m 
[31m-        // Step 4: Record performance metrics
[m[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("ml_trading_integration_test", 1.0)?;
[m[32m+    // Step 4: Record performance metrics
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("ml_trading_integration_test", 1.0)?;
[m 
[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("ml_inference_confidence", prediction.confidence)?;
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("ml_inference_confidence", prediction.confidence)?;
[m 
[31m-        info!("✅ Trading + ML integration test completed successfully");
[m[32m+    info!("✅ Trading + ML integration test completed successfully");
[m 
[31m-        Ok(())
[m[31m-    }
[m[31m-);
[m[32m+    Ok(())
[m[32m+});
[m 
[31m-e2e_test!(
[m[31m-    test_trading_backtesting_integration,
[m[31m-    |framework: Arc<E2ETestFramework>| async move {
[m[31m-        info!("🔄 Starting Trading + Backtesting Service integration test");
[m[32m+e2e_test!(test_trading_backtesting_integration, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m[32m+    info!("🔄 Starting Trading + Backtesting Service integration test");
[m 
[31m-        // Step 1: Verify services are available
[m[31m-        let health = framework
[m[31m-            .check_services_health()
[m[31m-            .await
[m[31m-            .context("Failed to check services health")?;
[m[32m+    // Step 1: Verify services are available
[m[32m+    let health = framework
[m[32m+        .check_services_health()
[m[32m+        .await
[m[32m+        .context("Failed to check services health")?;
[m 
[31m-        info!("Services health: {:?}", health);
[m[32m+    info!("Services health: {:?}", health);
[m 
[31m-        // Step 2: Test strategy configuration workflow
[m[31m-        info!("📋 Testing strategy workflow between services");
[m[32m+    // Step 2: Test strategy configuration workflow
[m[32m+    info!("📋 Testing strategy workflow between services");
[m 
[31m-        // Generate comprehensive market data for backtesting
[m[31m-        let symbols = vec!["AAPL", "MSFT"];
[m[31m-        let market_data = generate_test_market_data(&symbols, 500)?;
[m[32m+    // Generate comprehensive market data for backtesting
[m[32m+    let symbols = vec!["AAPL", "MSFT"];
[m[32m+    let market_data = generate_test_market_data(&symbols, 500)?;
[m 
[31m-        info!("Generated {} market data points for backtest", market_data.len());
[m[32m+    info!(
[m[32m+        "Generated {} market data points for backtest",
[m[32m+        market_data.len()
[m[32m+    );
[m 
[31m-        // Step 3: Process data through ML pipeline (simulating strategy)
[m[31m-        let features_count = market_data.len() / 10;
[m[31m-        info!("Simulated extraction of {} features for strategy", features_count);
[m[32m+    // Step 3: Process data through ML pipeline (simulating strategy)
[m[32m+    let features_count = market_data.len() / 10;
[m[32m+    info!(
[m[32m+        "Simulated extraction of {} features for strategy",
[m[32m+        features_count
[m[32m+    );
[m 
[31m-        let ml_status = framework.ml_pipeline.check_models_health().await?;
[m[32m+    let ml_status = framework.ml_pipeline.check_models_health().await?;
[m 
[31m-        use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[31m-        let prediction = EnsemblePrediction {
[m[31m-            signal: 0.6,
[m[31m-            confidence: 0.75,
[m[31m-            individual_predictions: vec![],
[m[31m-            ensemble_method: if ml_status.any_available() {
[m[31m-                "ensemble"
[m[31m-            } else {
[m[31m-                "mock"
[m[31m-            }
[m[31m-            .to_string(),
[m[31m-            total_inference_time: Duration::from_millis(10),
[m[31m-            prediction: PredictionType::Buy,
[m[31m-            signal_strength: 0.6,
[m[31m-        };
[m[32m+    use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[32m+    let prediction = EnsemblePrediction {
[m[32m+        signal: 0.6,
[m[32m+        confidence: 0.75,
[m[32m+        individual_predictions: vec![],
[m[32m+        ensemble_method: if ml_status.any_available() {
[m[32m+            "ensemble"
[m[32m+        } else {
[m[32m+            "mock"
[m[32m+        }
[m[32m+        .to_string(),
[m[32m+        total_inference_time: Duration::from_millis(10),
[m[32m+        prediction: PredictionType::Buy,
[m[32m+        signal_strength: 0.6,
[m[32m+    };
[m 
[31m-        info!(
[m[31m-            "Strategy signal: {:.3}, confidence: {:.3}",
[m[31m-            prediction.signal, prediction.confidence
[m[31m-        );
[m[32m+    info!(
[m[32m+        "Strategy signal: {:.3}, confidence: {:.3}",
[m[32m+        prediction.signal, prediction.confidence
[m[32m+    );
[m 
[31m-        // Step 4: Record comparison metrics
[m[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("trading_backtesting_integration_test", 1.0)?;
[m[32m+    // Step 4: Record comparison metrics
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("trading_backtesting_integration_test", 1.0)?;
[m 
[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("strategy_confidence", prediction.confidence)?;
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("strategy_confidence", prediction.confidence)?;
[m 
[31m-        info!("✅ Trading + Backtesting integration test completed");
[m[32m+    info!("✅ Trading + Backtesting integration test completed");
[m 
[31m-        Ok(())
[m[31m-    }
[m[31m-);
[m[32m+    Ok(())
[m[32m+});
[m 
[31m-e2e_test!(
[m[31m-    test_full_multi_service_workflow,
[m[31m-    |framework: Arc<E2ETestFramework>| async move {
[m[31m-        info!("🔄 Starting full multi-service workflow test");
[m[32m+e2e_test!(test_full_multi_service_workflow, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m[32m+    info!("🔄 Starting full multi-service workflow test");
[m 
[31m-        // Step 1: Verify all services
[m[31m-        let health = framework.check_services_health().await?;
[m[31m-        info!("All services health: {:?}", health);
[m[32m+    // Step 1: Verify all services
[m[32m+    let health = framework.check_services_health().await?;
[m[32m+    info!("All services health: {:?}", health);
[m 
[31m-        // Step 2: Test data flow across services
[m[31m-        info!("📊 Testing data flow: Market Data -> ML -> Trading");
[m[32m+    // Step 2: Test data flow across services
[m[32m+    info!("📊 Testing data flow: Market Data -> ML -> Trading");
[m 
[31m-        // Generate comprehensive market data
[m[31m-        let symbols = vec!["AAPL", "MSFT", "GOOGL", "TSLA"];
[m[31m-        let market_data = generate_test_market_data(&symbols, 500)?;
[m[32m+    // Generate comprehensive market data
[m[32m+    let symbols = vec!["AAPL", "MSFT", "GOOGL", "TSLA"];
[m[32m+    let market_data = generate_test_market_data(&symbols, 500)?;
[m 
[31m-        info!("Generated {} market data points", market_data.len());
[m[32m+    info!("Generated {} market data points", market_data.len());
[m 
[31m-        // Process through ML pipeline
[m[31m-        let features_count = market_data.len() / 10;
[m[31m-        info!("Simulated extraction of {} features", features_count);
[m[32m+    // Process through ML pipeline
[m[32m+    let features_count = market_data.len() / 10;
[m[32m+    info!("Simulated extraction of {} features", features_count);
[m 
[31m-        let ml_status = framework.ml_pipeline.check_models_health().await?;
[m[32m+    let ml_status = framework.ml_pipeline.check_models_health().await?;
[m 
[31m-        // Mock prediction for workflow testing
[m[31m-        use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[31m-        let prediction = EnsemblePrediction {
[m[31m-            signal: 0.7,
[m[31m-            confidence: 0.85,
[m[31m-            individual_predictions: vec![],
[m[31m-            ensemble_method: if ml_status.any_available() {
[m[31m-                "ensemble"
[m[31m-            } else {
[m[31m-                "mock"
[m[31m-            }
[m[31m-            .to_string(),
[m[31m-            total_inference_time: Duration::from_millis(10),
[m[31m-            prediction: PredictionType::Buy,
[m[31m-            signal_strength: 0.7,
[m[31m-        };
[m[32m+    // Mock prediction for workflow testing
[m[32m+    use foxhunt_e2e::ml_pipeline::{EnsemblePrediction, PredictionType};
[m[32m+    let prediction = EnsemblePrediction {
[m[32m+        signal: 0.7,
[m[32m+        confidence: 0.85,
[m[32m+        individual_predictions: vec![],
[m[32m+        ensemble_method: if ml_status.any_available() {
[m[32m+            "ensemble"
[m[32m+        } else {
[m[32m+            "mock"
[m[32m+        }
[m[32m+        .to_string(),
[m[32m+        total_inference_time: Duration::from_millis(10),
[m[32m+        prediction: PredictionType::Buy,
[m[32m+        signal_strength: 0.7,
[m[32m+    };
[m 
[31m-        info!(
[m[31m-            "ML Prediction: signal={:.3}, confidence={:.3}",
[m[31m-            prediction.signal, prediction.confidence
[m[31m-        );
[m[32m+    info!(
[m[32m+        "ML Prediction: signal={:.3}, confidence={:.3}",
[m[32m+        prediction.signal, prediction.confidence
[m[32m+    );
[m 
[31m-        // Generate trading signals based on ML prediction
[m[31m-        let mut signals_generated = 0;
[m[32m+    // Generate trading signals based on ML prediction
[m[32m+    let mut signals_generated = 0;
[m 
[31m-        for symbol in &symbols {
[m[31m-            if prediction.signal.abs() > 0.5 {
[m[31m-                signals_generated += 1;
[m[31m-                info!(
[m[31m-                    "Generated trading signal for {}: {} (strength: {:.2})",
[m[31m-                    symbol,
[m[31m-                    if prediction.signal > 0.0 { "BUY" } else { "SELL" },
[m[31m-                    prediction.signal.abs()
[m[31m-                );
[m[31m-            }
[m[32m+    for symbol in &symbols {
[m[32m+        if prediction.signal.abs() > 0.5 {
[m[32m+            signals_generated += 1;
[m[32m+            info!(
[m[32m+                "Generated trading signal for {}: {} (strength: {:.2})",
[m[32m+                symbol,
[m[32m+                if prediction.signal > 0.0 {
[m[32m+                    "BUY"
[m[32m+                } else {
[m[32m+                    "SELL"
[m[32m+                },
[m[32m+                prediction.signal.abs()
[m[32m+            );
[m         }
[32m+    }
[m 
[31m-        info!("Generated {} trading signals", signals_generated);
[m[32m+    info!("Generated {} trading signals", signals_generated);
[m 
[31m-        // Step 3: Record comprehensive metrics
[m[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("multi_service_workflow_test", 1.0)?;
[m[32m+    // Step 3: Record comprehensive metrics
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("multi_service_workflow_test", 1.0)?;
[m 
[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("signals_generated", signals_generated as f64)?;
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("signals_generated", signals_generated as f64)?;
[m 
[31m-        framework
[m[31m-            .performance_tracker
[m[31m-            .record_metric("ml_confidence", prediction.confidence)?;
[m[32m+    framework
[m[32m+        .performance_tracker
[m[32m+        .record_metric("ml_confidence", prediction.confidence)?;
[m 
[31m-        info!("✅ Full multi-service workflow test completed successfully");
[m[31m-        info!("📊 Summary:");
[m[31m-        info!("  Market data points processed: {}", market_data.len());
[m[31m-        info!("  ML predictions generated: 1");
[m[31m-        info!("  Trading signals generated: {}", signals_generated);
[m[32m+    info!("✅ Full multi-service workflow test completed successfully");
[m[32m+    info!("📊 Summary:");
[m[32m+    info!("  Market data points processed: {}", market_data.len());
[m[32m+    info!("  ML predictions generated: 1");
[m[32m+    info!("  Trading signals generated: {}", signals_generated);
[m 
[31m-        Ok(())
[m[31m-    }
[m[31m-);
[m[32m+    Ok(())
[m[32m+});
[m 
 /// Generate test market data for multiple symbols
 fn generate_test_market_data(
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_load_tests.rs:9:
 
 use anyhow::Result;
 use common::types::{Exchange, HftTimestamp, MarketTick, Price, Quantity, Symbol, TickType};
[32m+use foxhunt_e2e::e2e_test;
[m use foxhunt_e2e::proto::trading::{
     GetOrderStatusRequest, GetPortfolioSummaryRequest, OrderSide, OrderType, SubmitOrderRequest,
 };
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_load_tests.rs:15:
[31m-use foxhunt_e2e::e2e_test;
[m use std::collections::HashMap;
 use std::sync::atomic::{AtomicU64, Ordering};
 use std::sync::Arc;
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:28:
 }
 
 // Helper function to mark result as success
[31m-fn mark_success(mut result: WorkflowTestResult, duration: Duration, steps: usize) -> WorkflowTestResult {
[m[32m+fn mark_success(
[m[32m+    mut result: WorkflowTestResult,
[m[32m+    duration: Duration,
[m[32m+    steps: usize,
[m[32m+) -> WorkflowTestResult {
[m     result.success = true;
     result.duration = duration;
     result.steps_completed = steps;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:54:
 
 // Test 1: Critical path sub-50μs latency validation
 // Validates that the critical trading path meets HFT latency requirements
[31m-e2e_test!(test_critical_path_latency, |framework: Arc<E2ETestFramework>| async move {
[m[32m+e2e_test!(test_critical_path_latency, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m     let start_time = Instant::now();
     let mut result = new_workflow_result("Critical Path Latency Validation");
     let mut steps = 0;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:132:
     let price_p95 = percentile(&price_calc_samples, 95.0);
     add_metric(&mut result, "price_calculation_p95_ns", price_p95 as f64);
 
[31m-    assert!(
[m[31m-        price_p95 < 500,
[m[31m-        "Price calculations should be <500ns P95"
[m[31m-    );
[m[32m+    assert!(price_p95 < 500, "Price calculations should be <500ns P95");
[m     steps += 1;
 
     // Step 6: Symbol lookup simulation
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:223:
 
 // Test 2: Throughput and scalability benchmarks
 // Validates system throughput under various load conditions
[31m-e2e_test!(test_throughput_scalability, |framework: Arc<E2ETestFramework>| async move {
[m[32m+e2e_test!(test_throughput_scalability, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m     let start_time = Instant::now();
     let mut result = new_workflow_result("Throughput Scalability Benchmarks");
     let mut steps = 0;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:245:
     let actual_duration = single_thread_start.elapsed().as_secs_f64();
     let single_thread_ops_per_sec = operations_completed as f64 / actual_duration;
 
[31m-    add_metric(&mut result, "single_thread_ops_per_sec", single_thread_ops_per_sec);
[m[31m-    add_metric(&mut result, "single_thread_total_ops", operations_completed as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "single_thread_ops_per_sec",
[m[32m+        single_thread_ops_per_sec,
[m[32m+    );
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "single_thread_total_ops",
[m[32m+        operations_completed as f64,
[m[32m+    );
[m 
     // Should achieve at least 100k ops/sec for simple operations
     assert!(
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:339:
     let sustained_p95 = percentile(&sustained_samples, 95.0);
     let sustained_p99 = percentile(&sustained_samples, 99.0);
 
[31m-    add_metric(&mut result, "sustained_samples_count", sustained_samples.len() as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "sustained_samples_count",
[m[32m+        sustained_samples.len() as f64,
[m[32m+    );
[m     add_metric(&mut result, "sustained_p50_ns", sustained_p50 as f64);
     add_metric(&mut result, "sustained_p95_ns", sustained_p95 as f64);
     add_metric(&mut result, "sustained_p99_ns", sustained_p99 as f64);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:387:
 
 // Test 3: Resource utilization validation
 // Validates memory usage and allocation patterns
[31m-e2e_test!(test_resource_utilization, |framework: Arc<E2ETestFramework>| async move {
[m[32m+e2e_test!(test_resource_utilization, |framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m     let start_time = Instant::now();
     let mut result = new_workflow_result("Resource Utilization Validation");
     let mut steps = 0;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:402:
     }
 
     let baseline_duration = baseline_start.elapsed();
[31m-    add_metric(&mut result, "baseline_allocation_time_ms", baseline_duration.as_millis() as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "baseline_allocation_time_ms",
[m[32m+        baseline_duration.as_millis() as f64,
[m[32m+    );
[m     steps += 1;
 
     // Step 2: Stress test memory allocation
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:417:
     let stress_duration = stress_start.elapsed();
     let alloc_per_sec = stress_allocations as f64 / stress_duration.as_secs_f64();
 
[31m-    add_metric(&mut result, "stress_allocation_time_ms", stress_duration.as_millis() as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "stress_allocation_time_ms",
[m[32m+        stress_duration.as_millis() as f64,
[m[32m+    );
[m     add_metric(&mut result, "allocations_per_sec", alloc_per_sec);
     steps += 1;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:445:
     }
 
     let leak_test_duration = leak_test_start.elapsed();
[31m-    add_metric(&mut result, "leak_test_duration_ms", leak_test_duration.as_millis() as f64);
[m[32m+    add_metric(
[m[32m+        &mut result,
[m[32m+        "leak_test_duration_ms",
[m[32m+        leak_test_duration.as_millis() as f64,
[m[32m+    );
[m 
     // If this takes too long, there might be allocation issues
     assert!(
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:469:
 
 // Test 4: Performance regression detection
 // Compares performance metrics against baseline expectations
[31m-e2e_test!(test_performance_regression, |_framework: Arc<E2ETestFramework>| async move {
[m[32m+e2e_test!(test_performance_regression, |_framework: Arc<
[m[32m+    E2ETestFramework,
[m[32m+>| async move {
[m     let start_time = Instant::now();
     let mut result = new_workflow_result("Performance Regression Detection");
     let mut steps = 0;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:524:
     for (metric_name, baseline) in baselines {
         if let Some(&actual) = result.metrics.get(metric_name) {
             let regression_pct = ((actual - baseline) / baseline) * 100.0;
[31m-            add_metric(&mut result, &format!("{}_regression_pct", metric_name), regression_pct);
[m[32m+            add_metric(
[m[32m+                &mut result,
[m[32m+                &format!("{}_regression_pct", metric_name),
[m[32m+                regression_pct,
[m[32m+            );
[m 
             // Allow 20% degradation tolerance
             if regression_pct > 20.0 {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/performance_validation_tests.rs:539:
 
     // Step 3: Validate no significant regressions
     if !regressions.is_empty() {
[31m-        result.error_message = Some(format!("Performance regressions detected: {}", regressions.join("; ")));
[m[32m+        result.error_message = Some(format!(
[m[32m+            "Performance regressions detected: {}",
[m[32m+            regressions.join("; ")
[m[32m+        ));
[m         result.success = false;
[31m-        return Err(anyhow::anyhow!("Performance regressions: {:?}", regressions));
[m[32m+        return Err(anyhow::anyhow!(
[m[32m+            "Performance regressions: {:?}",
[m[32m+            regressions
[m[32m+        ));
[m     }
     steps += 1;
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:28:
 
         // Get both trading and risk clients
         let trading_client = framework.get_trading_client().await?;
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         // Step 2: Get initial risk metrics baseline
         info!("📊 Getting initial risk metrics baseline");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:55:
                 metrics.portfolio_var_1d <= 0.0,
                 "VaR should be negative or zero"
             );
[32m+            assert!(metrics.volatility >= 0.0, "Volatility should be positive");
[m             assert!(
[31m-                metrics.volatility >= 0.0,
[m[31m-                "Volatility should be positive"
[m[31m-            );
[m[31m-            assert!(
[m                 metrics.max_drawdown <= 0.0,
                 "Max drawdown should be negative or zero"
             );
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:107:
             "  Portfolio risk score: {:.2}",
             position_risk.portfolio_risk_score
         );
[31m-        info!("  Positions analyzed: {}", position_risk.position_risks.len());
[m[32m+        info!(
[m[32m+            "  Positions analyzed: {}",
[m[32m+            position_risk.position_risks.len()
[m[32m+        );
[m 
         assert!(
             position_risk.portfolio_risk_score >= 0.0,
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:281:
                 } else {
                     warn!("⚠️ Post-emergency order was submitted - emergency stop may not be fully active");
                 }
[31m-            }
[m[32m+            },
[m             Err(e) => {
                 info!("✅ Post-emergency order failed as expected: {}", e);
[31m-            }
[m[32m+            },
[m         }
 
         // Step 9: Test final risk metrics
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:333:
         info!("📏 Starting risk limit scenarios E2E test");
 
         let _trading_client = framework.get_trading_client().await?;
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         // Test various risk limit scenarios
         let test_scenarios = vec![
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:409:
         info!("💪 Starting risk system stress testing");
 
         let _trading_client = framework.get_trading_client().await?;
[31m-        let mut risk_client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-            "http://[::1]:50051"
[m[31m-        )
[m[31m-        .await
[m[31m-        .context("Failed to connect to Risk Service")?;
[m[32m+        let mut risk_client =
[m[32m+            foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                "http://[::1]:50051",
[m[32m+            )
[m[32m+            .await
[m[32m+            .context("Failed to connect to Risk Service")?;
[m 
         // Step 1: Rapid order validations
         info!("⚡ Stress testing with rapid order validations");
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:441:
                     let _response = response.into_inner();
                     // Validation completed successfully (regardless of is_valid result)
                     successful_validations += 1;
[31m-                }
[m[32m+                },
[m                 Err(_) => {
                     failed_validations += 1;
[31m-                }
[m[32m+                },
[m             }
 
             // Small delay to avoid overwhelming the system
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e/tests/risk_management_e2e.rs:479:
         let mut handles = Vec::new();
 
         for _ in 0..concurrent_requests {
[31m-            let mut client = foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[31m-                "http://[::1]:50051"
[m[31m-            )
[m[31m-            .await
[m[31m-            .context("Failed to connect to Risk Service")?;
[m[32m+            let mut client =
[m[32m+                foxhunt_e2e::proto::risk::risk_service_client::RiskServiceClient::connect(
[m[32m+                    "http://[::1]:50051",
[m[32m+                )
[m[32m+                .await
[m[32m+                .context("Failed to connect to Risk Service")?;
[m 
             let handle = tokio::spawn(async move {
                 client
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:9:
 //! **Wave 68 Agent 10**: Production latency measurement and optimization validation
 
 use std::time::Duration;
[31m-use trading_engine::timing::{
[m[31m-    HardwareTimestamp, calibrate_tsc,
[m[31m-};
[m[32m+use trading_engine::timing::{calibrate_tsc, HardwareTimestamp};
[m 
 /// E2E latency measurement point in the order processing pipeline
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:18:
 pub enum LatencyCheckpoint {
[31m-    OrderSubmission,     // Entry point
[m[31m-    ValidationStart,     // Pre-validation start
[m[31m-    ValidationComplete,  // All validations passed
[m[31m-    RiskCheckStart,      // Risk manager invocation
[m[31m-    RiskCheckComplete,   // Risk approval received
[m[31m-    ExecutionStart,      // Order routing begins
[m[31m-    BrokerSent,          // Order sent to exchange
[m[31m-    ExchangeResponse,    // Exchange acknowledgment
[m[31m-    ConfirmationSent,    // Final confirmation to client
[m[32m+    OrderSubmission,    // Entry point
[m[32m+    ValidationStart,    // Pre-validation start
[m[32m+    ValidationComplete, // All validations passed
[m[32m+    RiskCheckStart,     // Risk manager invocation
[m[32m+    RiskCheckComplete,  // Risk approval received
[m[32m+    ExecutionStart,     // Order routing begins
[m[32m+    BrokerSent,         // Order sent to exchange
[m[32m+    ExchangeResponse,   // Exchange acknowledgment
[m[32m+    ConfirmationSent,   // Final confirmation to client
[m }
 
 /// Comprehensive E2E latency measurement
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:90:
             find_checkpoint(LatencyCheckpoint::ValidationStart),
             find_checkpoint(LatencyCheckpoint::ValidationComplete),
         ) {
[31m-            self.validation_latency_ns = self.checkpoints[val_end].1
[m[32m+            self.validation_latency_ns = self.checkpoints[val_end]
[m[32m+                .1
[m                 .latency_ns(&self.checkpoints[val_start].1);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:99:
             find_checkpoint(LatencyCheckpoint::RiskCheckStart),
             find_checkpoint(LatencyCheckpoint::RiskCheckComplete),
         ) {
[31m-            self.risk_check_latency_ns = self.checkpoints[risk_end].1
[m[32m+            self.risk_check_latency_ns = self.checkpoints[risk_end]
[m[32m+                .1
[m                 .latency_ns(&self.checkpoints[risk_start].1);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:108:
             find_checkpoint(LatencyCheckpoint::ExecutionStart),
             find_checkpoint(LatencyCheckpoint::BrokerSent),
         ) {
[31m-            self.execution_latency_ns = self.checkpoints[broker_sent].1
[m[32m+            self.execution_latency_ns = self.checkpoints[broker_sent]
[m[32m+                .1
[m                 .latency_ns(&self.checkpoints[exec_start].1);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:117:
             find_checkpoint(LatencyCheckpoint::BrokerSent),
             find_checkpoint(LatencyCheckpoint::ExchangeResponse),
         ) {
[31m-            self.exchange_latency_ns = self.checkpoints[exchange_resp].1
[m[32m+            self.exchange_latency_ns = self.checkpoints[exchange_resp]
[m[32m+                .1
[m                 .latency_ns(&self.checkpoints[broker_sent].1);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:126:
             find_checkpoint(LatencyCheckpoint::ExchangeResponse),
             find_checkpoint(LatencyCheckpoint::ConfirmationSent),
         ) {
[31m-            self.confirmation_latency_ns = self.checkpoints[confirmation].1
[m[32m+            self.confirmation_latency_ns = self.checkpoints[confirmation]
[m[32m+                .1
[m                 .latency_ns(&self.checkpoints[exchange_resp].1);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:170:
             validation_target_met: self.validation_latency_ns < 5_000, // <5μs
             risk_check_target_met: self.risk_check_latency_ns < 15_000, // <15μs
             execution_target_met: self.execution_latency_ns < 10_000, // <10μs
[31m-            ml_inference_target_met: self.ml_inference_latency_ns
[m[32m+            ml_inference_target_met: self
[m[32m+                .ml_inference_latency_ns
[m                 .map(|lat| lat < 10_000)
                 .unwrap_or(true), // <10μs if present
             metrics_overhead_target_met: self.metrics_collection_overhead_ns < 5_000, // <5μs
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:230:
         let max_ns = *samples.last().unwrap();
 
         let mean_ns = samples.iter().sum::<u64>() as f64 / samples.len() as f64;
[31m-        let variance = samples.iter()
[m[32m+        let variance = samples
[m[32m+            .iter()
[m             .map(|&x| {
                 let diff = x as f64 - mean_ns;
                 diff * diff
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:237:
             })
[31m-            .sum::<f64>() / samples.len() as f64;
[m[32m+            .sum::<f64>()
[m[32m+            / samples.len() as f64;
[m         let stddev_ns = variance.sqrt();
 
         Self {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:320:
         let risk_check_samples: Vec<u64> = traces.iter().map(|t| t.risk_check_latency_ns).collect();
         let execution_samples: Vec<u64> = traces.iter().map(|t| t.execution_latency_ns).collect();
         let exchange_samples: Vec<u64> = traces.iter().map(|t| t.exchange_latency_ns).collect();
[31m-        let metrics_samples: Vec<u64> = traces.iter().map(|t| t.metrics_collection_overhead_ns).collect();
[m[32m+        let metrics_samples: Vec<u64> = traces
[m[32m+            .iter()
[m[32m+            .map(|t| t.metrics_collection_overhead_ns)
[m[32m+            .collect();
[m 
         // Calculate distributions
         let total_latency_dist = LatencyDistribution::from_samples(total_samples);
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:331:
         let metrics_overhead_dist = LatencyDistribution::from_samples(metrics_samples);
 
         // ML inference distribution (if present)
[31m-        let ml_samples: Vec<u64> = traces.iter()
[m[32m+        let ml_samples: Vec<u64> = traces
[m[32m+            .iter()
[m             .filter_map(|t| t.ml_inference_latency_ns)
             .collect();
         let ml_inference_latency_dist = if !ml_samples.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:341:
         };
 
         // Calculate target pass rates
[31m-        let total_target_pass_rate = traces.iter()
[m[32m+        let total_target_pass_rate = traces
[m[32m+            .iter()
[m             .filter(|t| t.meets_hft_targets().total_target_met)
[31m-            .count() as f64 / traces.len() as f64 * 100.0;
[m[32m+            .count() as f64
[m[32m+            / traces.len() as f64
[m[32m+            * 100.0;
[m 
[31m-        let validation_target_pass_rate = traces.iter()
[m[32m+        let validation_target_pass_rate = traces
[m[32m+            .iter()
[m             .filter(|t| t.meets_hft_targets().validation_target_met)
[31m-            .count() as f64 / traces.len() as f64 * 100.0;
[m[32m+            .count() as f64
[m[32m+            / traces.len() as f64
[m[32m+            * 100.0;
[m 
[31m-        let risk_check_target_pass_rate = traces.iter()
[m[32m+        let risk_check_target_pass_rate = traces
[m[32m+            .iter()
[m             .filter(|t| t.meets_hft_targets().risk_check_target_met)
[31m-            .count() as f64 / traces.len() as f64 * 100.0;
[m[32m+            .count() as f64
[m[32m+            / traces.len() as f64
[m[32m+            * 100.0;
[m 
[31m-        let execution_target_pass_rate = traces.iter()
[m[32m+        let execution_target_pass_rate = traces
[m[32m+            .iter()
[m             .filter(|t| t.meets_hft_targets().execution_target_met)
[31m-            .count() as f64 / traces.len() as f64 * 100.0;
[m[32m+            .count() as f64
[m[32m+            / traces.len() as f64
[m[32m+            * 100.0;
[m 
         // Identify primary bottleneck
         let avg_validation = validation_latency_dist.mean_ns;
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:484:
             self.execution_latency_dist.p95_us(),
             self.execution_target_pass_rate,
             self.exchange_latency_dist.p95_us(),
[31m-            self.ml_inference_latency_dist.as_ref()
[m[32m+            self.ml_inference_latency_dist
[m[32m+                .as_ref()
[m                 .map(|dist| format!("ML Inference: {:.2} μs\n", dist.p95_us()))
                 .unwrap_or_default(),
             self.metrics_overhead_dist.p95_us(),
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:508:
         if self.primary_bottleneck == "Validation" {
             recommendations.push("→ Optimize validation logic - consider parallel checks");
         } else if self.primary_bottleneck == "Risk Check" {
[31m-            recommendations.push("→ Optimize risk calculations - consider caching or approximation");
[m[32m+            recommendations
[m[32m+                .push("→ Optimize risk calculations - consider caching or approximation");
[m         } else if self.primary_bottleneck == "Execution" {
             recommendations.push("→ Optimize order routing - reduce broker communication overhead");
         } else if self.primary_bottleneck == "Exchange" {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:515:
[31m-            recommendations.push("→ Exchange latency dominant - consider co-location or venue change");
[m[32m+            recommendations
[m[32m+                .push("→ Exchange latency dominant - consider co-location or venue change");
[m         }
 
         if self.metrics_overhead_dist.p95_ns > 5_000 {
Diff in /home/jgrusewski/Work/foxhunt/tests/e2e_latency_measurement.rs:559:
 
     #[test]
     fn test_latency_distribution() {
[31m-        let samples = vec![1000, 2000, 3000, 4000, 5000, 10000, 15000, 20000, 50000, 100000];
[m[32m+        let samples = vec![
[m[32m+            1000, 2000, 3000, 4000, 5000, 10000, 15000, 20000, 50000, 100000,
[m[32m+        ];
[m         let dist = LatencyDistribution::from_samples(samples);
 
         assert!(dist.p50_ns > 0);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:24:
 use tracing::{info, warn};
 
 // Core system imports - use full paths since types aren't re-exported from crate root
[31m-use risk::AtomicKillSwitch;
[m use risk::risk_types::KillSwitchScope;
[31m-use risk::safety::KillSwitchConfig;
[m use risk::safety::trading_gate::TradingGate;
[32m+use risk::safety::KillSwitchConfig;
[m[32m+use risk::AtomicKillSwitch;
[m 
 /// Failure scenario test configuration
 #[derive(Debug, Clone)]
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:67:
 
         // Initialize kill switch with Redis backend
         let kill_switch_config = KillSwitchConfig::default();
[31m-        let kill_switch = Arc::new(
[m[31m-            AtomicKillSwitch::new(kill_switch_config, config.redis_url.clone()).await?
[m[31m-        );
[m[32m+        let kill_switch =
[m[32m+            Arc::new(AtomicKillSwitch::new(kill_switch_config, config.redis_url.clone()).await?);
[m 
         // Initialize trading gate
         let trading_gate = Arc::new(TradingGate::new(kill_switch.clone()));
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:138:
 
         // Step 5: Test recovery from kill switch
         info!("Step 5: Testing recovery from kill switch...");
[31m-        self.kill_switch.deactivate(
[m[31m-            KillSwitchScope::Global,
[m[31m-            "Test completed".to_string(),
[m[31m-        ).await?;
[m[32m+        self.kill_switch
[m[32m+            .deactivate(KillSwitchScope::Global, "Test completed".to_string())
[m[32m+            .await?;
[m 
         let is_active = self.kill_switch.is_active().await?;
         if is_active {
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:157:
         let test_duration = start_time.elapsed();
 
         info!("KILL SWITCH ACTIVATION TEST COMPLETED");
[31m-        info!("  Activation Time: {:?} (target: <{:?})", activation_time, self.config.max_activation_time);
[m[32m+        info!(
[m[32m+            "  Activation Time: {:?} (target: <{:?})",
[m[32m+            activation_time, self.config.max_activation_time
[m[32m+        );
[m         info!("  Total Duration: {:?}", test_duration);
 
         if activation_time > self.config.max_activation_time {
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:164:
[31m-            warn!("Kill switch activation took longer than target: {:?} > {:?}",
[m[31m-                activation_time, self.config.max_activation_time);
[m[32m+            warn!(
[m[32m+                "Kill switch activation took longer than target: {:?} > {:?}",
[m[32m+                activation_time, self.config.max_activation_time
[m[32m+            );
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:201:
 
         // Step 4: Deactivate scoped kill switch
         info!("Step 4: Deactivating AAPL kill switch...");
[31m-        self.kill_switch.deactivate(
[m[31m-            KillSwitchScope::Symbol("AAPL".to_string()),
[m[31m-            "Test completed".to_string(),
[m[31m-        ).await?;
[m[32m+        self.kill_switch
[m[32m+            .deactivate(
[m[32m+                KillSwitchScope::Symbol("AAPL".to_string()),
[m[32m+                "Test completed".to_string(),
[m[32m+            )
[m[32m+            .await?;
[m 
         // Step 5: Verify AAPL is allowed again
         info!("Step 5: Verifying AAPL is allowed again...");
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:241:
 
         // HFT compliance: each check should be sub-microsecond
         if avg_latency_ns > 1000 {
[31m-            warn!("Trading gate latency exceeds 1 microsecond target: {}ns", avg_latency_ns);
[m[32m+            warn!(
[m[32m+                "Trading gate latency exceeds 1 microsecond target: {}ns",
[m[32m+                avg_latency_ns
[m[32m+            );
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:299:
         info!("Step 1: Testing batch gate with no kill switches...");
         let allowed = self.trading_gate.batch_symbol_gate(&symbols)?;
         if allowed.len() != symbols.len() {
[31m-            return Err(format!("Expected {} allowed symbols, got {}", symbols.len(), allowed.len()).into());
[m[32m+            return Err(format!(
[m[32m+                "Expected {} allowed symbols, got {}",
[m[32m+                symbols.len(),
[m[32m+                allowed.len()
[m[32m+            )
[m[32m+            .into());
[m         }
 
         // Step 2: Activate kill switch for AAPL
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:317:
         info!("Step 3: Testing batch gate with AAPL blocked...");
         let allowed = self.trading_gate.batch_symbol_gate(&symbols)?;
         if allowed.len() != symbols.len() - 1 {
[31m-            return Err(format!("Expected {} allowed symbols, got {}", symbols.len() - 1, allowed.len()).into());
[m[32m+            return Err(format!(
[m[32m+                "Expected {} allowed symbols, got {}",
[m[32m+                symbols.len() - 1,
[m[32m+                allowed.len()
[m[32m+            )
[m[32m+            .into());
[m         }
         if allowed.contains(&"AAPL".to_string()) {
             return Err("AAPL should not be in allowed symbols".into());
Diff in /home/jgrusewski/Work/foxhunt/tests/failure_scenario_tests.rs:325:
 
         // Step 4: Cleanup
         info!("Step 4: Cleaning up...");
[31m-        self.kill_switch.deactivate(
[m[31m-            KillSwitchScope::Symbol("AAPL".to_string()),
[m[31m-            "Test completed".to_string(),
[m[31m-        ).await?;
[m[32m+        self.kill_switch
[m[32m+            .deactivate(
[m[32m+                KillSwitchScope::Symbol("AAPL".to_string()),
[m[32m+                "Test completed".to_string(),
[m[32m+            )
[m[32m+            .await?;
[m 
         info!("BATCH SYMBOL GATE TEST COMPLETED");
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:5:
 
 #![allow(dead_code, unused_imports)]
 
[32m+use std::collections::HashMap;
[m[32m+use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
[m use std::sync::Arc;
[31m-use std::sync::atomic::{AtomicU64, AtomicBool, Ordering};
[m use std::time::{Duration, Instant};
[31m-use std::collections::HashMap;
[m 
[31m-use tokio::sync::{mpsc, RwLock, Mutex, Semaphore};
[m[31m-use tokio::time::{timeout, interval};
[m[32m+use tokio::sync::{mpsc, Mutex, RwLock, Semaphore};
[m[32m+use tokio::time::{interval, timeout};
[m use tokio_stream::wrappers::ReceiverStream;
[32m+use tonic::transport::{Channel, Endpoint, Server};
[m use tonic::{Request, Response, Status, Streaming};
[31m-use tonic::transport::{Server, Channel, Endpoint};
[m 
 // Mock protobuf types for testing (would normally come from generated code)
 mod test_proto {
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:45:
 /// Stream type classification matching Wave 67 Agent 3 implementation
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
 pub enum StreamType {
[31m-    HighFrequency,    // 100K buffer, target >50K msg/sec
[m[31m-    MediumFrequency,  // 10K buffer, target >10K msg/sec
[m[31m-    LowFrequency,     // 1K buffer, target >1K msg/sec
[m[32m+    HighFrequency,   // 100K buffer, target >50K msg/sec
[m[32m+    MediumFrequency, // 10K buffer, target >10K msg/sec
[m[32m+    LowFrequency,    // 1K buffer, target >1K msg/sec
[m }
 
 impl StreamType {
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:61:
 
     pub fn target_throughput(&self) -> u64 {
         match self {
[31m-            StreamType::HighFrequency => 50_000,    // 50K msg/sec
[m[31m-            StreamType::MediumFrequency => 10_000,   // 10K msg/sec
[m[31m-            StreamType::LowFrequency => 1_000,       // 1K msg/sec
[m[32m+            StreamType::HighFrequency => 50_000,   // 50K msg/sec
[m[32m+            StreamType::MediumFrequency => 10_000, // 10K msg/sec
[m[32m+            StreamType::LowFrequency => 1_000,     // 1K msg/sec
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:70:
     pub fn expected_latency_us(&self) -> u64 {
         match self {
[31m-            StreamType::HighFrequency => 100,      // 100μs target
[m[31m-            StreamType::MediumFrequency => 500,    // 500μs target
[m[31m-            StreamType::LowFrequency => 1_000,     // 1ms target
[m[32m+            StreamType::HighFrequency => 100,   // 100μs target
[m[32m+            StreamType::MediumFrequency => 500, // 500μs target
[m[32m+            StreamType::LowFrequency => 1_000,  // 1ms target
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:114:
 
     pub fn record_message_received(&self, latency_ns: u64) {
         self.messages_received.fetch_add(1, Ordering::Relaxed);
[31m-        self.total_latency_ns.fetch_add(latency_ns, Ordering::Relaxed);
[m[32m+        self.total_latency_ns
[m[32m+            .fetch_add(latency_ns, Ordering::Relaxed);
[m 
         // Update min/max latency
         let mut current_min = self.min_latency_ns.load(Ordering::Relaxed);
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:178:
         let min_latency_ns = self.min_latency_ns.load(Ordering::Relaxed);
         let max_latency_ns = self.max_latency_ns.load(Ordering::Relaxed);
 
[31m-        let test_duration = if let (Some(start), Some(end)) = (
[m[31m-            *self.test_start.read().await,
[m[31m-            *self.test_end.read().await,
[m[31m-        ) {
[m[32m+        let test_duration = if let (Some(start), Some(end)) =
[m[32m+            (*self.test_start.read().await, *self.test_end.read().await)
[m[32m+        {
[m             end.duration_since(start)
         } else {
             Duration::ZERO
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:263:
         println!("\n📊 Message Statistics:");
         println!("  Sent:     {:>12}", format_number(self.messages_sent));
         println!("  Received: {:>12}", format_number(self.messages_received));
[31m-        println!("  Lost:     {:>12} ({:.2}%)",
[m[32m+        println!(
[m[32m+            "  Lost:     {:>12} ({:.2}%)",
[m             format_number(self.messages_lost),
             (self.messages_lost as f64 / self.messages_sent as f64 * 100.0)
         );
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:270:
 
         println!("\n⚡ Latency (microseconds):");
[31m-        println!("  Min:      {:>12.2} μs", self.min_latency_ns as f64 / 1000.0);
[m[31m-        println!("  Avg:      {:>12.2} μs", self.avg_latency_ns as f64 / 1000.0);
[m[31m-        println!("  P50:      {:>12.2} μs", self.p50_latency_ns as f64 / 1000.0);
[m[31m-        println!("  P95:      {:>12.2} μs", self.p95_latency_ns as f64 / 1000.0);
[m[31m-        println!("  P99:      {:>12.2} μs", self.p99_latency_ns as f64 / 1000.0);
[m[31m-        println!("  Max:      {:>12.2} μs", self.max_latency_ns as f64 / 1000.0);
[m[32m+        println!(
[m[32m+            "  Min:      {:>12.2} μs",
[m[32m+            self.min_latency_ns as f64 / 1000.0
[m[32m+        );
[m[32m+        println!(
[m[32m+            "  Avg:      {:>12.2} μs",
[m[32m+            self.avg_latency_ns as f64 / 1000.0
[m[32m+        );
[m[32m+        println!(
[m[32m+            "  P50:      {:>12.2} μs",
[m[32m+            self.p50_latency_ns as f64 / 1000.0
[m[32m+        );
[m[32m+        println!(
[m[32m+            "  P95:      {:>12.2} μs",
[m[32m+            self.p95_latency_ns as f64 / 1000.0
[m[32m+        );
[m[32m+        println!(
[m[32m+            "  P99:      {:>12.2} μs",
[m[32m+            self.p99_latency_ns as f64 / 1000.0
[m[32m+        );
[m[32m+        println!(
[m[32m+            "  Max:      {:>12.2} μs",
[m[32m+            self.max_latency_ns as f64 / 1000.0
[m[32m+        );
[m 
         println!("\n🚀 Throughput:");
         println!("  Messages/sec: {:>12.0}", self.throughput_msg_per_sec);
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:281:
[31m-        println!("  Target:       {:>12}", format_number(stream_type.target_throughput()));
[m[31m-        println!("  Achievement:  {:>12.1}%",
[m[32m+        println!(
[m[32m+            "  Target:       {:>12}",
[m[32m+            format_number(stream_type.target_throughput())
[m[32m+        );
[m[32m+        println!(
[m[32m+            "  Achievement:  {:>12.1}%",
[m             (self.throughput_msg_per_sec / stream_type.target_throughput() as f64 * 100.0)
         );
 
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:288:
         println!("  Connection Errors:   {:>8}", self.connection_errors);
         println!("  Window Updates:      {:>8}", self.window_updates);
 
[31m-        println!("\n⏱️  Test Duration: {:.2}s", self.test_duration.as_secs_f64());
[m[32m+        println!(
[m[32m+            "\n⏱️  Test Duration: {:.2}s",
[m[32m+            self.test_duration.as_secs_f64()
[m[32m+        );
[m         println!("{}\n", "=".repeat(80));
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:319:
         result.add_check(
             "P95 latency within target (with tcp_nodelay)",
             self.p95_latency_ns <= expected_latency_ns,
[31m-            format!("P95: {:.2}μs, Target: {:.2}μs",
[m[32m+            format!(
[m[32m+                "P95: {:.2}μs, Target: {:.2}μs",
[m                 self.p95_latency_ns as f64 / 1000.0,
                 expected_latency_ns as f64 / 1000.0
             ),
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:386:
     }
 
     pub fn print_summary(&self) {
[31m-        println!("\n🔍 Validation Results for {}:", self.stream_type.description());
[m[32m+        println!(
[m[32m+            "\n🔍 Validation Results for {}:",
[m[32m+            self.stream_type.description()
[m[32m+        );
[m         for check in &self.checks {
             let status = if check.passed { "✅ PASS" } else { "❌ FAIL" };
             println!("  {} - {} ({})", status, check.description, check.details);
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:393:
         }
[31m-        println!("  Overall: {}\n", if self.passed { "✅ PASSED" } else { "❌ FAILED" });
[m[32m+        println!(
[m[32m+            "  Overall: {}\n",
[m[32m+            if self.passed {
[m[32m+                "✅ PASSED"
[m[32m+            } else {
[m[32m+                "❌ FAILED"
[m[32m+            }
[m[32m+        );
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:411:
         }
     }
 
[31m-    pub async fn start(
[m[31m-        &self,
[m[31m-        stream_type: StreamType,
[m[31m-    ) -> Result<(), Box<dyn std::error::Error>> {
[m[32m+    pub async fn start(&self, stream_type: StreamType) -> Result<(), Box<dyn std::error::Error>> {
[m         let addr_str = format!("127.0.0.1:{}", self.port);
         let _metrics = Arc::clone(&self.metrics);
         let buffer_size = stream_type.buffer_size();
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:481:
     }
 
     pub async fn run(&self) -> Result<MetricsSummary, Box<dyn std::error::Error>> {
[31m-        println!("\n🎯 Starting load test: {}", self.config.stream_type.description());
[m[32m+        println!(
[m[32m+            "\n🎯 Starting load test: {}",
[m[32m+            self.config.stream_type.description()
[m[32m+        );
[m         println!("   Duration: {}s", self.config.test_duration.as_secs());
         println!("   Producers: {}", self.config.num_producers);
         println!("   TCP_NODELAY: {}", self.config.tcp_nodelay_enabled);
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:494:
             let metrics = Arc::clone(&self.metrics);
             let config = self.config.clone();
 
[31m-            let handle = tokio::spawn(async move {
[m[31m-                Self::producer_task(producer_id, metrics, config).await
[m[31m-            });
[m[32m+            let handle =
[m[32m+                tokio::spawn(
[m[32m+                    async move { Self::producer_task(producer_id, metrics, config).await },
[m[32m+                );
[m             handles.push(handle);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:503:
         // Spawn consumer task
         let consumer_metrics = Arc::clone(&self.metrics);
         let consumer_config = self.config.clone();
[31m-        let consumer_handle = tokio::spawn(async move {
[m[31m-            Self::consumer_task(consumer_metrics, consumer_config).await
[m[31m-        });
[m[32m+        let consumer_handle =
[m[32m+            tokio::spawn(
[m[32m+                async move { Self::consumer_task(consumer_metrics, consumer_config).await },
[m[32m+            );
[m         handles.push(consumer_handle);
 
         // Wait for test duration
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:548:
         }
     }
 
[31m-    async fn consumer_task(
[m[31m-        metrics: Arc<LoadTestMetrics>,
[m[31m-        config: LoadTestConfig,
[m[31m-    ) {
[m[32m+    async fn consumer_task(metrics: Arc<LoadTestMetrics>, config: LoadTestConfig) {
[m         let mut ticker = interval(Duration::from_micros(100));
 
         loop {
Diff in /home/jgrusewski/Work/foxhunt/tests/grpc_streaming_load_test.rs:658:
         let summary_baseline = orchestrator_baseline.run().await.unwrap();
 
         // tcp_nodelay should reduce latency by ~40ms
[31m-        let latency_improvement =
[m[31m-            summary_baseline.avg_latency_ns.saturating_sub(summary_optimized.avg_latency_ns);
[m[32m+        let latency_improvement = summary_baseline
[m[32m+            .avg_latency_ns
[m[32m+            .saturating_sub(summary_optimized.avg_latency_ns);
[m 
         println!("\n📊 TCP_NODELAY Latency Improvement:");
[31m-        println!("  Baseline (no tcp_nodelay): {:.2}ms",
[m[31m-            summary_baseline.avg_latency_ns as f64 / 1_000_000.0);
[m[31m-        println!("  Optimized (tcp_nodelay):   {:.2}ms",
[m[31m-            summary_optimized.avg_latency_ns as f64 / 1_000_000.0);
[m[31m-        println!("  Improvement:               {:.2}ms",
[m[31m-            latency_improvement as f64 / 1_000_000.0);
[m[32m+        println!(
[m[32m+            "  Baseline (no tcp_nodelay): {:.2}ms",
[m[32m+            summary_baseline.avg_latency_ns as f64 / 1_000_000.0
[m[32m+        );
[m[32m+        println!(
[m[32m+            "  Optimized (tcp_nodelay):   {:.2}ms",
[m[32m+            summary_optimized.avg_latency_ns as f64 / 1_000_000.0
[m[32m+        );
[m[32m+        println!(
[m[32m+            "  Improvement:               {:.2}ms",
[m[32m+            latency_improvement as f64 / 1_000_000.0
[m[32m+        );
[m 
         // Should see significant improvement (target -40ms)
[31m-        assert!(latency_improvement > 30_000_000,
[m[31m-            "Expected at least 30ms improvement from tcp_nodelay");
[m[32m+        assert!(
[m[32m+            latency_improvement > 30_000_000,
[m[32m+            "Expected at least 30ms improvement from tcp_nodelay"
[m[32m+        );
[m     }
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/builders.rs:32:
 //!     .build();
 //! ```
 
[31m-use chrono::{DateTime, Utc};
[m[31m-use ::rust_decimal::Decimal;
[m use ::rust_decimal::prelude::ToPrimitive;
[32m+use ::rust_decimal::Decimal;
[m[32m+use chrono::{DateTime, Utc};
[m use serde_json::json;
 use uuid::Uuid;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/builders.rs:41:
 // Import Position from risk crate to match scenarios.rs usage
[31m-use risk::risk_types::Position;
[m use common::types::Price;
[32m+use risk::risk_types::Position;
[m 
 use crate::fixtures::helpers::ToDecimal;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/builders.rs:501:
     pub fn with_average_price(mut self, price: Decimal) -> Self {
         let price_f64 = price.to_f64().unwrap_or(0.0);
         self.average_cost = price_f64;
[31m-        self.average_price = Price::from_f64(price_f64).unwrap_or_else(|_| Price::new(0.0).unwrap());
[m[32m+        self.average_price =
[m[32m+            Price::from_f64(price_f64).unwrap_or_else(|_| Price::new(0.0).unwrap());
[m         // Recalculate unrealized PnL
         self.unrealized_pnl = (self.market_price - price_f64) * self.quantity;
         self
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/builders.rs:621:
             parent_company: None,
             is_active: true,
             exposure_limit: Some(Decimal::from(10000000)), // $10M
[31m-            margin_requirement: Some(Decimal::new(5, 2)), // 5%
[m[32m+            margin_requirement: Some(Decimal::new(5, 2)),  // 5%
[m             netting_agreement: true,
             created_at: now,
             updated_at: now,
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/builders.rs:743:
             .map(|i| {
                 let asset_class = asset_classes[i % asset_classes.len()];
                 let symbol = generate_test_symbol(asset_class);
[31m-                
[m[32m+
[m                 let mut builder = InstrumentBuilder::new()
                     .with_symbol(&symbol)
                     .with_name(format!("Test Instrument {}", i + 1));
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/builders.rs:784:
             .map(|(i, &symbol)| {
                 let quantity = Decimal::from((i + 1) * 100);
                 let price = get_test_price_for_symbol(symbol).to_decimal();
[31m-                
[m[32m+
[m                 PositionBuilder::new()
                     .with_portfolio_id(portfolio_id)
                     .with_symbol(symbol)
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/builders.rs:847:
     fn test_batch_builder() {
         let instruments = BatchBuilder::create_diverse_instruments(6);
         assert_eq!(instruments.len(), 6);
[31m-        
[m[32m+
[m         // Should have different asset classes
[31m-        let asset_classes: std::collections::HashSet<_> = instruments
[m[31m-            .iter()
[m[31m-            .map(|i| i.asset_class)
[m[31m-            .collect();
[m[32m+        let asset_classes: std::collections::HashSet<_> =
[m[32m+            instruments.iter().map(|i| i.asset_class).collect();
[m         assert!(asset_classes.len() > 1);
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/builders.rs:859:
[32m+
[mDiff in /home/jgrusewski/Work/foxhunt/tests/fixtures/helpers.rs:3:
 /// Provides utilities to safely convert between f64 and Decimal types in test code.
 /// Production code should use Decimal throughout, but tests often need to work with
 /// floating point values for convenience.
[31m-
[m use rust_decimal::Decimal;
 pub use rust_decimal_macros::dec;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:3:
 //! This module provides mock implementations of all external services
 //! for isolated testing without dependencies on real services.
 
[32m+use chrono::{DateTime, Utc};
[m[32m+use rust_decimal::Decimal;
[m use std::collections::HashMap;
 use std::sync::Arc;
 use std::time::Duration;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:9:
[31m-use tokio::sync::{mpsc, RwLock, Mutex};
[m[32m+use tokio::sync::{mpsc, Mutex, RwLock};
[m use tokio::time::sleep;
 use uuid::Uuid;
[31m-use chrono::{DateTime, Utc};
[m[31m-use rust_decimal::Decimal;
[m 
 use super::test_config::TestConfig;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:48:
     }
 
     /// Submit a new order
[31m-    pub async fn submit_order(&self, request: MockOrderRequest) -> Result<MockOrderResponse, MockServiceError> {
[m[32m+    pub async fn submit_order(
[m[32m+        &self,
[m[32m+        request: MockOrderRequest,
[m[32m+    ) -> Result<MockOrderResponse, MockServiceError> {
[m         self.simulate_latency().await;
         self.simulate_failure()?;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:92:
     }
 
     /// Cancel an existing order
[31m-    pub async fn cancel_order(&self, order_id: Uuid) -> Result<MockOrderResponse, MockServiceError> {
[m[32m+    pub async fn cancel_order(
[m[32m+        &self,
[m[32m+        order_id: Uuid,
[m[32m+    ) -> Result<MockOrderResponse, MockServiceError> {
[m         self.simulate_latency().await;
         self.simulate_failure()?;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:99:
         let mut orders = self.orders.write().await;
         if let Some(order) = orders.get_mut(&order_id) {
[31m-            if matches!(order.status, MockOrderStatus::Pending | MockOrderStatus::PartiallyFilled) {
[m[32m+            if matches!(
[m[32m+                order.status,
[m[32m+                MockOrderStatus::Pending | MockOrderStatus::PartiallyFilled
[m[32m+            ) {
[m                 order.status = MockOrderStatus::Cancelled;
                 order.updated_at = Utc::now();
[31m-                
[m[32m+
[m                 Ok(MockOrderResponse {
                     order_id,
                     status: MockOrderStatus::Cancelled,
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:108:
                     message: "Order cancelled successfully".to_string(),
                 })
             } else {
[31m-                Err(MockServiceError::InvalidOperation(
[m[31m-                    format!("Cannot cancel order in status: {:?}", order.status)
[m[31m-                ))
[m[32m+                Err(MockServiceError::InvalidOperation(format!(
[m[32m+                    "Cannot cancel order in status: {:?}",
[m[32m+                    order.status
[m[32m+                )))
[m             }
         } else {
             Err(MockServiceError::OrderNotFound(order_id))
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:123:
         self.simulate_failure()?;
 
         let orders = self.orders.read().await;
[31m-        orders.get(&order_id)
[m[32m+        orders
[m[32m+            .get(&order_id)
[m             .cloned()
             .ok_or(MockServiceError::OrderNotFound(order_id))
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:130:
 
     /// Get all orders for a symbol
[31m-    pub async fn get_orders_for_symbol(&self, symbol: &str) -> Result<Vec<MockOrder>, MockServiceError> {
[m[32m+    pub async fn get_orders_for_symbol(
[m[32m+        &self,
[m[32m+        symbol: &str,
[m[32m+    ) -> Result<Vec<MockOrder>, MockServiceError> {
[m         self.simulate_latency().await;
         self.simulate_failure()?;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:193:
         let mut positions = self.positions.write().await;
         let position_key = order.symbol.clone();
 
[31m-        let position = positions.entry(position_key).or_insert_with(|| MockPosition {
[m[31m-            symbol: order.symbol.clone(),
[m[31m-            quantity: Decimal::ZERO,
[m[31m-            average_price: Decimal::ZERO,
[m[31m-            market_value: Decimal::ZERO,
[m[31m-            unrealized_pnl: Decimal::ZERO,
[m[31m-            updated_at: Utc::now(),
[m[31m-        });
[m[32m+        let position = positions
[m[32m+            .entry(position_key)
[m[32m+            .or_insert_with(|| MockPosition {
[m[32m+                symbol: order.symbol.clone(),
[m[32m+                quantity: Decimal::ZERO,
[m[32m+                average_price: Decimal::ZERO,
[m[32m+                market_value: Decimal::ZERO,
[m[32m+                unrealized_pnl: Decimal::ZERO,
[m[32m+                updated_at: Utc::now(),
[m[32m+            });
[m 
         // Update position quantity and average price
         let old_quantity = position.quantity;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:226:
 
         position.quantity = new_quantity;
         position.market_value = position.quantity * order.average_fill_price; // Assume market price = fill price
[31m-        position.unrealized_pnl = (order.average_fill_price - position.average_price) * position.quantity;
[m[32m+        position.unrealized_pnl =
[m[32m+            (order.average_fill_price - position.average_price) * position.quantity;
[m         position.updated_at = Utc::now();
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:292:
     }
 
     /// Start a new training job
[31m-    pub async fn start_training(&self, request: MockTrainingRequest) -> Result<MockTrainingResponse, MockServiceError> {
[m[32m+    pub async fn start_training(
[m[32m+        &self,
[m[32m+        request: MockTrainingRequest,
[m[32m+    ) -> Result<MockTrainingResponse, MockServiceError> {
[m         self.simulate_latency().await;
         self.simulate_failure()?;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:325:
     }
 
     /// Get training job status
[31m-    pub async fn get_training_status(&self, job_id: Uuid) -> Result<MockTrainingJob, MockServiceError> {
[m[32m+    pub async fn get_training_status(
[m[32m+        &self,
[m[32m+        job_id: Uuid,
[m[32m+    ) -> Result<MockTrainingJob, MockServiceError> {
[m         self.simulate_latency().await;
         self.simulate_failure()?;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:345:
     }
 
     /// Run inference with a model
[31m-    pub async fn run_inference(&self, request: MockInferenceRequest) -> Result<MockInferenceResponse, MockServiceError> {
[m[32m+    pub async fn run_inference(
[m[32m+        &self,
[m[32m+        request: MockInferenceRequest,
[m[32m+    ) -> Result<MockInferenceResponse, MockServiceError> {
[m         self.simulate_latency().await;
         self.simulate_failure()?;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:352:
         // Simulate inference calculation
         let prediction = match request.model_name.as_str() {
[31m-            "momentum_model" => 0.75, // Bullish
[m[32m+            "momentum_model" => 0.75,        // Bullish
[m             "mean_reversion_model" => -0.25, // Bearish
[31m-            _ => 0.0, // Neutral
[m[32m+            _ => 0.0,                        // Neutral
[m         };
 
         Ok(MockInferenceResponse {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:374:
             sleep(update_interval).await;
 
             let progress = (i as f64 + 1.0) / total_updates as f64;
[31m-            
[m[32m+
[m             // Update job progress
             if let Ok(mut jobs) = self.training_jobs.try_write() {
                 if let Some(job) = jobs.get_mut(&job_id) {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:381:
                     job.progress = progress;
[31m-                    
[m[32m+
[m                     // Add some metrics
[31m-                    job.metrics.insert("loss".to_string(), 1.0 - (progress * 0.8));
[m[31m-                    job.metrics.insert("accuracy".to_string(), 0.5 + (progress * 0.4));
[m[31m-                    
[m[32m+                    job.metrics
[m[32m+                        .insert("loss".to_string(), 1.0 - (progress * 0.8));
[m[32m+                    job.metrics
[m[32m+                        .insert("accuracy".to_string(), 0.5 + (progress * 0.4));
[m[32m+
[m                     if progress >= 1.0 {
                         job.status = MockTrainingStatus::Completed;
                         job.end_time = Some(Utc::now());
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:390:
[31m-                        
[m[32m+
[m                         // Save the trained model
                         let model = MockModel {
                             name: job.model_name.clone(),
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:397:
                             created_at: Utc::now(),
                             file_path: format!("/models/{}_v1.0.0.bin", job.model_name),
                         };
[31m-                        
[m[32m+
[m                         if let Ok(mut models) = self.models.try_write() {
                             models.insert(model.name.clone(), model);
                         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:452:
     }
 
     /// Start a new backtest
[31m-    pub async fn start_backtest(&self, request: MockBacktestRequest) -> Result<MockBacktestResponse, MockServiceError> {
[m[32m+    pub async fn start_backtest(
[m[32m+        &self,
[m[32m+        request: MockBacktestRequest,
[m[32m+    ) -> Result<MockBacktestResponse, MockServiceError> {
[m         self.simulate_latency().await;
         self.simulate_failure()?;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:486:
     }
 
     /// Get backtest status
[31m-    pub async fn get_backtest_status(&self, backtest_id: Uuid) -> Result<MockBacktest, MockServiceError> {
[m[32m+    pub async fn get_backtest_status(
[m[32m+        &self,
[m[32m+        backtest_id: Uuid,
[m[32m+    ) -> Result<MockBacktest, MockServiceError> {
[m         self.simulate_latency().await;
         self.simulate_failure()?;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:493:
         let backtests = self.backtests.read().await;
[31m-        backtests.get(&backtest_id)
[m[32m+        backtests
[m[32m+            .get(&backtest_id)
[m             .cloned()
             .ok_or(MockServiceError::BacktestNotFound(backtest_id))
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:515:
             sleep(update_interval).await;
 
             let progress = (i as f64 + 1.0) / total_updates as f64;
[31m-            
[m[32m+
[m             if let Ok(mut backtests) = self.backtests.try_write() {
                 if let Some(backtest) = backtests.get_mut(&backtest_id) {
                     backtest.progress = progress;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:522:
[31m-                    
[m[32m+
[m                     if progress >= 1.0 {
                         backtest.status = MockBacktestStatus::Completed;
                         backtest.end_time = Some(Utc::now());
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:526:
[31m-                        
[m[32m+
[m                         // Generate mock results
                         backtest.results = Some(MockBacktestResults {
                             total_return: 0.15, // 15% return
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:775:
 pub enum MockServiceError {
     #[error("Order not found: {0}")]
     OrderNotFound(Uuid),
[31m-    
[m[32m+
[m     #[error("Job not found: {0}")]
     JobNotFound(Uuid),
[31m-    
[m[32m+
[m     #[error("Backtest not found: {0}")]
     BacktestNotFound(Uuid),
[31m-    
[m[32m+
[m     #[error("Invalid operation: {0}")]
     InvalidOperation(String),
[31m-    
[m[32m+
[m     #[error("Simulated failure")]
     SimulatedFailure,
[31m-    
[m[32m+
[m     #[error("Service unavailable")]
     ServiceUnavailable,
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:820:
     }
 
     /// Create all services
[31m-    pub fn create_all_services(&self) -> (MockTradingService, MockMLTrainingService, MockBacktestingService) {
[m[32m+    pub fn create_all_services(
[m[32m+        &self,
[m[32m+    ) -> (
[m[32m+        MockTradingService,
[m[32m+        MockMLTrainingService,
[m[32m+        MockBacktestingService,
[m[32m+    ) {
[m         (
             self.create_trading_service(),
             self.create_ml_training_service(),
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:900:
         // Wait for backtest to complete
         tokio::time::sleep(Duration::from_secs(4)).await;
 
[31m-        let backtest = service.get_backtest_status(response.backtest_id).await.unwrap();
[m[32m+        let backtest = service
[m[32m+            .get_backtest_status(response.backtest_id)
[m[32m+            .await
[m[32m+            .unwrap();
[m         assert_eq!(backtest.status, MockBacktestStatus::Completed);
         assert!(backtest.results.is_some());
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:922:
     async fn test_failure_simulation() {
         let mut config = TestConfig::for_unit_tests();
         config.services.mock_failure_rate = 1.0; // 100% failure rate
[31m-        
[m[32m+
[m         let service = MockTradingService::new(config);
 
         let request = MockOrderRequest {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mock_services.rs:935:
 
         let result = service.submit_order(request).await;
         assert!(result.is_err());
[31m-        assert!(matches!(result.unwrap_err(), MockServiceError::SimulatedFailure));
[m[32m+        assert!(matches!(
[m[32m+            result.unwrap_err(),
[m[32m+            MockServiceError::SimulatedFailure
[m[32m+        ));
[m     }
 }
[32m+
[mDiff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:26:
 //! ```
 
 use std::collections::HashMap;
[31m-use std::sync::{Arc, atomic::{AtomicU16, AtomicU64, Ordering}};
[m[32m+use std::sync::{
[m[32m+    atomic::{AtomicU16, AtomicU64, Ordering},
[m[32m+    Arc,
[m[32m+};
[m use std::time::Duration;
 
[31m-use tokio::sync::{mpsc, RwLock, Mutex};
[m[31m-use uuid::Uuid;
[m[31m-use serde_json::json;
[m use chrono::{DateTime, Utc};
 use rust_decimal::Decimal;
[32m+use serde_json::json;
[m[32m+use tokio::sync::{mpsc, Mutex, RwLock};
[m[32m+use uuid::Uuid;
[m 
 // Import TLI types explicitly (tli crate is available as dependency)
 use tli::error::{TliError, TliResult};
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:40:
[31m-use tli::events::{Event, EventType, EventSeverity};
[m[32m+use tli::events::{Event, EventSeverity, EventType};
[m 
 // Re-export sub-modules for easy access
[31m-pub mod test_config;
[m[31m-pub mod test_database;
[m[31m-pub mod mock_services;
[m[31m-pub mod test_data;
[m pub mod builders;
[31m-pub mod scenarios;
[m pub mod helpers;
[32m+pub mod mock_services;
[m[32m+pub mod scenarios;
[m[32m+pub mod test_config;
[m[32m+pub mod test_data;
[m[32m+pub mod test_database;
[m 
 // =============================================================================
 // TEST SYMBOLS - PRODUCTION READY CONSTANTS
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:95:
 
 /// Comprehensive symbol collections for batch testing
 pub const ALL_TEST_EQUITIES: &[&str] = &[
[31m-    TEST_EQUITY_1, TEST_EQUITY_2, TEST_EQUITY_3,
[m[31m-    TEST_EQUITY_LARGE_CAP, TEST_EQUITY_MID_CAP, TEST_EQUITY_SMALL_CAP
[m[32m+    TEST_EQUITY_1,
[m[32m+    TEST_EQUITY_2,
[m[32m+    TEST_EQUITY_3,
[m[32m+    TEST_EQUITY_LARGE_CAP,
[m[32m+    TEST_EQUITY_MID_CAP,
[m[32m+    TEST_EQUITY_SMALL_CAP,
[m ];
 
[31m-pub const ALL_TEST_FX_PAIRS: &[&str] = &[
[m[31m-    TEST_FOREX_1, TEST_FOREX_2, TEST_FOREX_3, TEST_FOREX_EXOTIC
[m[31m-];
[m[32m+pub const ALL_TEST_FX_PAIRS: &[&str] =
[m[32m+    &[TEST_FOREX_1, TEST_FOREX_2, TEST_FOREX_3, TEST_FOREX_EXOTIC];
[m 
 pub const ALL_TEST_FUTURES: &[&str] = &[
[31m-    TEST_FUTURE_1, TEST_FUTURE_2, TEST_FUTURE_OIL, TEST_FUTURE_GOLD
[m[32m+    TEST_FUTURE_1,
[m[32m+    TEST_FUTURE_2,
[m[32m+    TEST_FUTURE_OIL,
[m[32m+    TEST_FUTURE_GOLD,
[m ];
 
 pub const ALL_TEST_BONDS: &[&str] = &[
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:111:
[31m-    TEST_BOND_1, TEST_BOND_2, TEST_BOND_CORP, TEST_BOND_HIGH_YIELD
[m[32m+    TEST_BOND_1,
[m[32m+    TEST_BOND_2,
[m[32m+    TEST_BOND_CORP,
[m[32m+    TEST_BOND_HIGH_YIELD,
[m ];
 
 pub const ALL_TEST_COMMODITIES: &[&str] = &[
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:115:
[31m-    TEST_COMMODITY_1, TEST_COMMODITY_2, TEST_COMMODITY_OIL, TEST_COMMODITY_GAS
[m[32m+    TEST_COMMODITY_1,
[m[32m+    TEST_COMMODITY_2,
[m[32m+    TEST_COMMODITY_OIL,
[m[32m+    TEST_COMMODITY_GAS,
[m ];
 
[31m-pub const ALL_TEST_CRYPTOS: &[&str] = &[
[m[31m-    TEST_CRYPTO_1, TEST_CRYPTO_2, TEST_CRYPTO_ALT
[m[31m-];
[m[32m+pub const ALL_TEST_CRYPTOS: &[&str] = &[TEST_CRYPTO_1, TEST_CRYPTO_2, TEST_CRYPTO_ALT];
[m 
 /// All test symbols combined for comprehensive testing
 pub const ALL_TEST_SYMBOLS: &[&str] = &[
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:124:
     // Equities
[31m-    TEST_EQUITY_1, TEST_EQUITY_2, TEST_EQUITY_3,
[m[31m-    TEST_EQUITY_LARGE_CAP, TEST_EQUITY_MID_CAP, TEST_EQUITY_SMALL_CAP,
[m[32m+    TEST_EQUITY_1,
[m[32m+    TEST_EQUITY_2,
[m[32m+    TEST_EQUITY_3,
[m[32m+    TEST_EQUITY_LARGE_CAP,
[m[32m+    TEST_EQUITY_MID_CAP,
[m[32m+    TEST_EQUITY_SMALL_CAP,
[m     // Forex
[31m-    TEST_FOREX_1, TEST_FOREX_2, TEST_FOREX_3, TEST_FOREX_EXOTIC,
[m[32m+    TEST_FOREX_1,
[m[32m+    TEST_FOREX_2,
[m[32m+    TEST_FOREX_3,
[m[32m+    TEST_FOREX_EXOTIC,
[m     // Futures
[31m-    TEST_FUTURE_1, TEST_FUTURE_2, TEST_FUTURE_OIL, TEST_FUTURE_GOLD,
[m[32m+    TEST_FUTURE_1,
[m[32m+    TEST_FUTURE_2,
[m[32m+    TEST_FUTURE_OIL,
[m[32m+    TEST_FUTURE_GOLD,
[m     // Bonds
[31m-    TEST_BOND_1, TEST_BOND_2, TEST_BOND_CORP, TEST_BOND_HIGH_YIELD,
[m[32m+    TEST_BOND_1,
[m[32m+    TEST_BOND_2,
[m[32m+    TEST_BOND_CORP,
[m[32m+    TEST_BOND_HIGH_YIELD,
[m     // Commodities
[31m-    TEST_COMMODITY_1, TEST_COMMODITY_2, TEST_COMMODITY_OIL, TEST_COMMODITY_GAS,
[m[32m+    TEST_COMMODITY_1,
[m[32m+    TEST_COMMODITY_2,
[m[32m+    TEST_COMMODITY_OIL,
[m[32m+    TEST_COMMODITY_GAS,
[m     // Crypto
[31m-    TEST_CRYPTO_1, TEST_CRYPTO_2, TEST_CRYPTO_ALT,
[m[32m+    TEST_CRYPTO_1,
[m[32m+    TEST_CRYPTO_2,
[m[32m+    TEST_CRYPTO_ALT,
[m     // Options
[31m-    TEST_OPTION_CALL, TEST_OPTION_PUT,
[m[32m+    TEST_OPTION_CALL,
[m[32m+    TEST_OPTION_PUT,
[m ];
 
 // =============================================================================
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:285:
 /// Generate a test symbol for the specified asset class
 pub fn generate_test_symbol(asset_class: AssetClass) -> String {
     use std::sync::atomic::{AtomicUsize, Ordering};
[31m-    
[m[32m+
[m     static EQUITY_COUNTER: AtomicUsize = AtomicUsize::new(1000);
     static FX_COUNTER: AtomicUsize = AtomicUsize::new(1000);
     static FUTURES_COUNTER: AtomicUsize = AtomicUsize::new(1000);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:331:
 
 /// Generate multiple test symbols for an asset class
 pub fn generate_test_symbols(asset_class: AssetClass, count: usize) -> Vec<String> {
[31m-    (0..count).map(|_| generate_test_symbol(asset_class)).collect()
[m[32m+    (0..count)
[m[32m+        .map(|_| generate_test_symbol(asset_class))
[m[32m+        .collect()
[m }
 
 /// Generate a random test symbol from all available symbols
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:422:
     fn default() -> Self {
         Self {
             // HFT Performance requirements
[31m-            max_latency_ns: 50_000,              // 50µs max latency
[m[31m-            max_db_latency_ns: 100_000,          // 100µs max DB latency
[m[31m-            max_risk_latency_ns: 25_000,         // 25µs max risk validation
[m[31m-            max_ml_inference_latency_ns: 50_000, // 50µs max ML inference
[m[31m-            max_init_latency_ns: 1_000_000,      // 1ms max initialization
[m[31m-            min_throughput_ops_per_sec: 10_000.0, // 10K ops/sec minimum
[m[32m+            max_latency_ns: 50_000,                 // 50µs max latency
[m[32m+            max_db_latency_ns: 100_000,             // 100µs max DB latency
[m[32m+            max_risk_latency_ns: 25_000,            // 25µs max risk validation
[m[32m+            max_ml_inference_latency_ns: 50_000,    // 50µs max ML inference
[m[32m+            max_init_latency_ns: 1_000_000,         // 1ms max initialization
[m[32m+            min_throughput_ops_per_sec: 10_000.0,   // 10K ops/sec minimum
[m             min_db_throughput_ops_per_sec: 5_000.0, // 5K DB ops/sec minimum
[31m-            min_backtest_throughput: 10.0,       // 10 backtests/sec minimum
[m[32m+            min_backtest_throughput: 10.0,          // 10 backtests/sec minimum
[m 
             // Test parameters
[31m-            request_timeout_ms: 5_000,           // 5 second timeout
[m[32m+            request_timeout_ms: 5_000, // 5 second timeout
[m             max_retry_attempts: 3,
             circuit_breaker_threshold: 5,
             concurrent_order_count: 100,
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:443:
             stress_test_duration_secs: 30,
 
             // Database configuration
[31m-            test_db_url: std::env::var("TEST_DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://foxhunt_test:test_password@localhost:5432/foxhunt_test".to_string()),
[m[32m+            test_db_url: std::env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://foxhunt_test:test_password@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             test_db_max_connections: 20,
             enable_database_cleanup: true,
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:565:
             }
 
             // Check if port is available
[31m-            if let Ok(listener) = tokio::net::TcpListener::bind(format!("127.0.0.1:{}", port)).await {
[m[32m+            if let Ok(listener) = tokio::net::TcpListener::bind(format!("127.0.0.1:{}", port)).await
[m[32m+            {
[m                 drop(listener); // Release the port
                 self.allocated_ports.write().await.push(port);
                 return port;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:612:
     }
 
     pub async fn publish_event(&self, event: Event) -> TliResult<()> {
[31m-        self._event_sender.send(event)
[m[32m+        self._event_sender
[m[32m+            .send(event)
[m             .map_err(|e| TliError::Other(format!("Failed to publish event: {}", e)))?;
 
         self.published_events.fetch_add(1, Ordering::Relaxed);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:702:
 
     pub async fn record_latency(&self, operation: &str, latency_ns: u64) {
         let mut latencies = self.latency_measurements.write().await;
[31m-        latencies.entry(operation.to_string()).or_insert_with(Vec::new).push(latency_ns);
[m[32m+        latencies
[m[32m+            .entry(operation.to_string())
[m[32m+            .or_insert_with(Vec::new)
[m[32m+            .push(latency_ns);
[m     }
 
     pub async fn record_throughput(&self, operation: &str, ops_per_sec: f64) {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:709:
         let mut throughputs = self.throughput_measurements.write().await;
[31m-        throughputs.entry(operation.to_string()).or_insert_with(Vec::new).push(ops_per_sec);
[m[32m+        throughputs
[m[32m+            .entry(operation.to_string())
[m[32m+            .or_insert_with(Vec::new)
[m[32m+            .push(ops_per_sec);
[m     }
 
     pub async fn record_error(&self, operation: &str) {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:737:
             let p99 = sorted[len * 99 / 100];
             let max = sorted[len - 1];
 
[31m-            Some(LatencyStats { avg, p50, p95, p99, max })
[m[32m+            Some(LatencyStats {
[m[32m+                avg,
[m[32m+                p50,
[m[32m+                p95,
[m[32m+                p99,
[m[32m+                max,
[m[32m+            })
[m         } else {
             None
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:752:
         let mut latency_summary = serde_json::Map::new();
         for (operation, measurements) in latencies.iter() {
             if let Some(stats) = self.get_latency_stats(operation).await {
[31m-                latency_summary.insert(operation.clone(), json!({
[m[31m-                    "count": measurements.len(),
[m[31m-                    "avg_ns": stats.avg,
[m[31m-                    "p50_ns": stats.p50,
[m[31m-                    "p95_ns": stats.p95,
[m[31m-                    "p99_ns": stats.p99,
[m[31m-                    "max_ns": stats.max
[m[31m-                }));
[m[32m+                latency_summary.insert(
[m[32m+                    operation.clone(),
[m[32m+                    json!({
[m[32m+                        "count": measurements.len(),
[m[32m+                        "avg_ns": stats.avg,
[m[32m+                        "p50_ns": stats.p50,
[m[32m+                        "p95_ns": stats.p95,
[m[32m+                        "p99_ns": stats.p99,
[m[32m+                        "max_ns": stats.max
[m[32m+                    }),
[m[32m+                );
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:770:
                 let max = measurements.iter().fold(0.0f64, |a, &b| a.max(b));
                 let min = measurements.iter().fold(f64::INFINITY, |a, &b| a.min(b));
 
[31m-                throughput_summary.insert(operation.clone(), json!({
[m[31m-                    "count": measurements.len(),
[m[31m-                    "avg_ops_per_sec": avg,
[m[31m-                    "max_ops_per_sec": max,
[m[31m-                    "min_ops_per_sec": min
[m[31m-                }));
[m[32m+                throughput_summary.insert(
[m[32m+                    operation.clone(),
[m[32m+                    json!({
[m[32m+                        "count": measurements.len(),
[m[32m+                        "avg_ops_per_sec": avg,
[m[32m+                        "max_ops_per_sec": max,
[m[32m+                        "min_ops_per_sec": min
[m[32m+                    }),
[m[32m+                );
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:804:
     pub metrics: Arc<TestMetricsCollector>,
     pub port_manager: Arc<TestPortManager>,
     pub event_publisher: Arc<TestEventPublisher>,
[31m-    cleanup_tasks: Vec<Box<dyn Fn() -> std::pin::Pin<Box<dyn std::future::Future<Output = ()> + Send>> + Send + Sync>>,
[m[32m+    cleanup_tasks: Vec<
[m[32m+        Box<
[m[32m+            dyn Fn() -> std::pin::Pin<Box<dyn std::future::Future<Output = ()> + Send>>
[m[32m+                + Send
[m[32m+                + Sync,
[m[32m+        >,
[m[32m+    >,
[m }
 
 impl std::fmt::Debug for TestEnvironment {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:814:
             .field("metrics", &self.metrics)
             .field("port_manager", &self.port_manager)
             .field("event_publisher", &self.event_publisher)
[31m-            .field("cleanup_tasks", &format!("<{} cleanup tasks>", self.cleanup_tasks.len()))
[m[32m+            .field(
[m[32m+                "cleanup_tasks",
[m[32m+                &format!("<{} cleanup tasks>", self.cleanup_tasks.len()),
[m[32m+            )
[m             .finish()
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:839:
         F: Fn() -> Fut + Send + Sync + 'static,
         Fut: std::future::Future<Output = ()> + Send + 'static,
     {
[31m-        let boxed_task = Box::new(move || Box::pin(task()) as std::pin::Pin<Box<dyn std::future::Future<Output = ()> + Send>>);
[m[32m+        let boxed_task = Box::new(move || {
[m[32m+            Box::pin(task()) as std::pin::Pin<Box<dyn std::future::Future<Output = ()> + Send>>
[m[32m+        });
[m         self.cleanup_tasks.push(boxed_task);
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:919:
         assert_eq!(TEST_EQUITY_1, "TEST_EQ_001");
         assert_eq!(TEST_FOREX_1, "TEST_FX_EURUSD");
         assert_eq!(TEST_FUTURE_1, "TEST_FUT_ES001");
[31m-        
[m[32m+
[m         // Test dynamic generation
         let equity_symbol = generate_test_symbol(AssetClass::Equities);
         assert!(equity_symbol.starts_with("TEST_EQ_"));
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:926:
[31m-        
[m[32m+
[m         let fx_symbol = generate_test_symbol(AssetClass::Currencies);
         assert!(fx_symbol.starts_with("TEST_FX_"));
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:933:
         assert!(!ALL_TEST_SYMBOLS.is_empty());
         assert!(ALL_TEST_SYMBOLS.contains(&TEST_EQUITY_1));
         assert!(ALL_TEST_SYMBOLS.contains(&TEST_FOREX_1));
[31m-        
[m[32m+
[m         // Test asset class specific collections
         assert!(!ALL_TEST_EQUITIES.is_empty());
         assert!(!ALL_TEST_FX_PAIRS.is_empty());
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:942:
 
     #[test]
     fn test_price_generation() {
[31m-        assert_eq!(get_test_price_for_symbol(TEST_EQUITY_1), TEST_PRICE_EQUITY_BASE);
[m[32m+        assert_eq!(
[m[32m+            get_test_price_for_symbol(TEST_EQUITY_1),
[m[32m+            TEST_PRICE_EQUITY_BASE
[m[32m+        );
[m         assert_eq!(get_test_price_for_symbol(TEST_FOREX_1), TEST_PRICE_FX_BASE);
[31m-        assert_eq!(get_test_price_for_symbol(TEST_FUTURE_1), TEST_PRICE_FUTURES_BASE);
[m[32m+        assert_eq!(
[m[32m+            get_test_price_for_symbol(TEST_FUTURE_1),
[m[32m+            TEST_PRICE_FUTURES_BASE
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/mod.rs:954:
         assert_eq!(metadata["test_data"], true);
     }
 }
[32m+
[mDiff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:21:
 //! let orders = hft_scenario.generate_order_flow(1000);
 //! ```
 
[31m-use chrono::{DateTime, Utc, Duration as ChronoDuration};
[m[31m-use rust_decimal::Decimal;
[m[32m+use chrono::{DateTime, Duration as ChronoDuration, Utc};
[m use rust_decimal::prelude::ToPrimitive;
[32m+use rust_decimal::Decimal;
[m use std::collections::HashMap;
 use uuid::Uuid;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:30:
 // Import types from risk crate
 use risk::risk_types::Position;
 // Note: StressScenario imported from mod.rs (risk_data::models version)
[31m-use crate::fixtures::helpers::ToDecimal;
[m use super::builders::*;
 use super::*;
[32m+use crate::fixtures::helpers::ToDecimal;
[m 
 // =============================================================================
 // BASIC TRADING SCENARIOS
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:84:
     /// Create diverse positions across asset classes
     pub fn create_positions(&self) -> Vec<Position> {
         let symbols_and_weights = vec![
[31m-            (TEST_EQUITY_1, 0.30),      // 30% large cap equity
[m[31m-            (TEST_EQUITY_2, 0.20),      // 20% mid cap equity
[m[31m-            (TEST_FOREX_1, 0.15),       // 15% major FX pair
[m[31m-            (TEST_FUTURE_1, 0.10),      // 10% equity futures
[m[31m-            (TEST_BOND_1, 0.15),        // 15% government bonds
[m[31m-            (TEST_COMMODITY_1, 0.10),   // 10% gold commodity
[m[32m+            (TEST_EQUITY_1, 0.30),    // 30% large cap equity
[m[32m+            (TEST_EQUITY_2, 0.20),    // 20% mid cap equity
[m[32m+            (TEST_FOREX_1, 0.15),     // 15% major FX pair
[m[32m+            (TEST_FUTURE_1, 0.10),    // 10% equity futures
[m[32m+            (TEST_BOND_1, 0.15),      // 15% government bonds
[m[32m+            (TEST_COMMODITY_1, 0.10), // 10% gold commodity
[m         ];
 
         symbols_and_weights
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:115:
     /// Create corresponding instruments for all positions
     pub fn create_instruments(&self) -> Vec<Instrument> {
         vec![
[31m-            InstrumentBuilder::new().with_symbol(TEST_EQUITY_1).equity().build(),
[m[31m-            InstrumentBuilder::new().with_symbol(TEST_EQUITY_2).equity().build(),
[m[31m-            InstrumentBuilder::new().with_symbol(TEST_FOREX_1).currency().build(),
[m[31m-            InstrumentBuilder::new().with_symbol(TEST_FUTURE_1).future().build(),
[m[31m-            InstrumentBuilder::new().with_symbol(TEST_BOND_1).bond().build(),
[m[31m-            InstrumentBuilder::new().with_symbol(TEST_COMMODITY_1).commodity().build(),
[m[32m+            InstrumentBuilder::new()
[m[32m+                .with_symbol(TEST_EQUITY_1)
[m[32m+                .equity()
[m[32m+                .build(),
[m[32m+            InstrumentBuilder::new()
[m[32m+                .with_symbol(TEST_EQUITY_2)
[m[32m+                .equity()
[m[32m+                .build(),
[m[32m+            InstrumentBuilder::new()
[m[32m+                .with_symbol(TEST_FOREX_1)
[m[32m+                .currency()
[m[32m+                .build(),
[m[32m+            InstrumentBuilder::new()
[m[32m+                .with_symbol(TEST_FUTURE_1)
[m[32m+                .future()
[m[32m+                .build(),
[m[32m+            InstrumentBuilder::new()
[m[32m+                .with_symbol(TEST_BOND_1)
[m[32m+                .bond()
[m[32m+                .build(),
[m[32m+            InstrumentBuilder::new()
[m[32m+                .with_symbol(TEST_COMMODITY_1)
[m[32m+                .commodity()
[m[32m+                .build(),
[m         ]
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:134:
 pub struct MarketCrashScenario {
     pub name: String,
     pub description: String,
[31m-    pub equity_shock: Decimal,      // -30%
[m[31m-    pub bond_shock: Decimal,        // +5% (flight to quality)
[m[31m-    pub commodity_shock: Decimal,   // -20%
[m[31m-    pub fx_shock: Decimal,          // +10% USD strength
[m[31m-    pub volatility_shock: Decimal,  // +200% volatility increase
[m[32m+    pub equity_shock: Decimal,     // -30%
[m[32m+    pub bond_shock: Decimal,       // +5% (flight to quality)
[m[32m+    pub commodity_shock: Decimal,  // -20%
[m[32m+    pub fx_shock: Decimal,         // +10% USD strength
[m[32m+    pub volatility_shock: Decimal, // +200% volatility increase
[m }
 
 impl Default for MarketCrashScenario {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:152:
         Self {
             name: "Market Crash 2008 Style".to_string(),
             description: "Severe market downturn with flight to quality".to_string(),
[31m-            equity_shock: Decimal::new(-30, 2),        // -30%
[m[31m-            bond_shock: Decimal::new(5, 2),            // +5%
[m[31m-            commodity_shock: Decimal::new(-20, 2),     // -20%
[m[31m-            fx_shock: Decimal::new(10, 2),             // +10%
[m[31m-            volatility_shock: Decimal::new(200, 2),    // +200%
[m[32m+            equity_shock: Decimal::new(-30, 2),     // -30%
[m[32m+            bond_shock: Decimal::new(5, 2),         // +5%
[m[32m+            commodity_shock: Decimal::new(-20, 2),  // -20%
[m[32m+            fx_shock: Decimal::new(10, 2),          // +10%
[m[32m+            volatility_shock: Decimal::new(200, 2), // +200%
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:175:
     /// Apply shocks to a list of positions
     pub fn apply_shocks_to_positions(&self, positions: &[Position]) -> Vec<Position> {
         let shocks = self.generate_market_shocks();
[31m-        
[m[32m+
[m         positions
             .iter()
             .map(|pos| {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:198:
     /// Create a formal stress test scenario record
     pub fn create_stress_scenario(&self) -> risk::risk_types::StressScenario {
         let mut price_shocks = HashMap::new();
[31m-        price_shocks.insert("EQUITY".to_string(), self.equity_shock.to_f64().unwrap_or(0.0));
[m[32m+        price_shocks.insert(
[m[32m+            "EQUITY".to_string(),
[m[32m+            self.equity_shock.to_f64().unwrap_or(0.0),
[m[32m+        );
[m         price_shocks.insert("BOND".to_string(), self.bond_shock.to_f64().unwrap_or(0.0));
[31m-        price_shocks.insert("COMMODITY".to_string(), self.commodity_shock.to_f64().unwrap_or(0.0));
[m[32m+        price_shocks.insert(
[m[32m+            "COMMODITY".to_string(),
[m[32m+            self.commodity_shock.to_f64().unwrap_or(0.0),
[m[32m+        );
[m         price_shocks.insert("FX".to_string(), self.fx_shock.to_f64().unwrap_or(0.0));
 
         risk::risk_types::StressScenario {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:240:
 pub struct InterestRateShockScenario {
     pub name: String,
     pub description: String,
[31m-    pub rate_shock: Decimal,        // +200 basis points
[m[31m-    pub duration_impact: Decimal,   // -10% for 10 year duration
[m[32m+    pub rate_shock: Decimal,      // +200 basis points
[m[32m+    pub duration_impact: Decimal, // -10% for 10 year duration
[m }
 
 impl Default for InterestRateShockScenario {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:255:
         Self {
             name: "Interest Rate Shock".to_string(),
             description: "200bp parallel shift in yield curve".to_string(),
[31m-            rate_shock: Decimal::new(200, 4),  // 2.00% = 200 basis points
[m[32m+            rate_shock: Decimal::new(200, 4), // 2.00% = 200 basis points
[m             duration_impact: Decimal::new(-10, 2), // -10%
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:271:
                     let price_impact = -duration * self.rate_shock.to_f64().unwrap_or(0.0); // Duration × rate change
                     let shock_multiplier = 1.0 + (price_impact / 100.0);
                     let new_market_price = pos.market_price * shock_multiplier;
[31m-                    
[m[32m+
[m                     Position {
                         market_price: new_market_price,
                         market_value: pos.quantity * new_market_price,
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:335:
         let start_time = Utc::now();
 
         for i in 0..total_orders {
[31m-            let timestamp = start_time + ChronoDuration::milliseconds((i as i64 * 1000) / self.order_rate_per_second as i64);
[m[31m-            let side = if i % 2 == 0 { OrderSide::Buy } else { OrderSide::Sell };
[m[32m+            let timestamp = start_time
[m[32m+                + ChronoDuration::milliseconds(
[m[32m+                    (i as i64 * 1000) / self.order_rate_per_second as i64,
[m[32m+                );
[m[32m+            let side = if i % 2 == 0 {
[m[32m+                OrderSide::Buy
[m[32m+            } else {
[m[32m+                OrderSide::Sell
[m[32m+            };
[m             let price_offset = (i % 10) as i64 - 5; // -5 to +5 ticks
             let price = self.base_price + (self.tick_size * Decimal::from(price_offset));
             let quantity = Decimal::from(100 + (i % 900)); // 100 to 1000 shares
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:364:
 
         for i in 0..count {
             let timestamp = start_time + ChronoDuration::microseconds(i as i64 * 1000); // 1ms intervals
[31m-            
[m[32m+
[m             // Random walk price movement
             let price_change = if i % 3 == 0 {
                 self.tick_size
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:373:
             } else {
                 Decimal::ZERO
             };
[31m-            
[m[32m+
[m             current_price += price_change;
[31m-            
[m[32m+
[m             ticks.push(MarketTick {
                 symbol: self.symbol.clone(),
                 timestamp,
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:414:
     pub fn new() -> Self {
         Self {
             portfolio_id: TEST_PORTFOLIO_1.to_string(),
[31m-            var_limit: Decimal::from(100000),      // $100k VaR limit
[m[32m+            var_limit: Decimal::from(100000), // $100k VaR limit
[m             position_limit: Decimal::from(1000000), // $1M position limit
             concentration_limit: Decimal::new(25, 2), // 25% concentration limit
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:423:
     /// Create positions that breach concentration limits
     pub fn create_concentrated_positions(&self) -> Vec<Position> {
         let _total_portfolio_value = Decimal::from(1000000);
[31m-        
[m[32m+
[m         vec![
             // Concentrated position - 40% of portfolio (breaches 25% limit)
             PositionBuilder::new()
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:434:
                 .with_market_price(Decimal::from(100))
                 .with_weight(Decimal::new(40, 2))
                 .build(),
[31m-            
[m             // Normal positions
             PositionBuilder::new()
                 .with_portfolio_id(&self.portfolio_id)
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:444:
                 .with_market_price(Decimal::from(100))
                 .with_weight(Decimal::new(30, 2))
                 .build(),
[31m-                
[m             PositionBuilder::new()
                 .with_portfolio_id(&self.portfolio_id)
                 .with_symbol(TEST_EQUITY_3)
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:468:
                 .with_market_price(Decimal::from(100))
                 .with_beta(Decimal::new(20, 1)) // Beta of 2.0
                 .build(),
[31m-                
[m             PositionBuilder::new()
                 .with_portfolio_id(&self.portfolio_id)
                 .with_symbol(TEST_EQUITY_2)
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:611:
         assert_eq!(positions.len(), instruments.len());
 
         // Check portfolio value adds up
[31m-        let total_value: Decimal = positions.iter()
[m[31m-            .map(|p| p.market_value.to_decimal())
[m[31m-            .sum();
[m[31m-        assert!((total_value - scenario.total_value).abs() < Decimal::new(1, 0)); // Within $1
[m[32m+        let total_value: Decimal = positions.iter().map(|p| p.market_value.to_decimal()).sum();
[m[32m+        assert!((total_value - scenario.total_value).abs() < Decimal::new(1, 0));
[m[32m+        // Within $1
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:625:
         let stressed_positions = crash_scenario.apply_shocks_to_positions(&original_positions);
 
         assert_eq!(original_positions.len(), stressed_positions.len());
[31m-        
[m[32m+
[m         // Check that equity positions went down
         for (original, stressed) in original_positions.iter().zip(stressed_positions.iter()) {
             if original.symbol.starts_with("TEST_EQ_") {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:643:
 
         assert_eq!(orders.len(), 5 * hft_scenario.order_rate_per_second);
         assert_eq!(ticks.len(), 100);
[31m-        
[m[32m+
[m         // Check order timestamps are sequential
         for window in orders.windows(2) {
             assert!(window[1].timestamp >= window[0].timestamp);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/scenarios.rs:681:
         assert!(!ticks.is_empty());
     }
 }
[32m+
[mDiff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:3:
 //! This module provides configuration utilities for test environments,
 //! including database setup, service configuration, and test parameters.
 
[32m+use rust_decimal::Decimal;
[m[32m+use serde::{Deserialize, Serialize};
[m use std::collections::HashMap;
 use std::env;
[31m-use serde::{Deserialize, Serialize};
[m[31m-use rust_decimal::Decimal;
[m 
 /// Test environment configuration
 #[derive(Debug, Clone, Serialize, Deserialize)]
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:99:
 impl Default for DatabaseConfig {
     fn default() -> Self {
         Self {
[31m-            url: env::var("TEST_DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| "postgresql://foxhunt_test:test_password@localhost:5432/foxhunt_test".to_string()),
[m[32m+            url: env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                "postgresql://foxhunt_test:test_password@localhost:5432/foxhunt_test".to_string()
[m[32m+            }),
[m             max_connections: 10,
             connection_timeout_ms: 5000,
             query_timeout_ms: 30000,
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:157:
 
 impl Default for MarketDataConfig {
     fn default() -> Self {
[31m-        use super::{ALL_TEST_SYMBOLS};
[m[31m-        
[m[32m+        use super::ALL_TEST_SYMBOLS;
[m[32m+
[m         Self {
             default_symbols: ALL_TEST_SYMBOLS.iter().map(|&s| s.to_string()).collect(),
             tick_rate_hz: 1000, // 1000 ticks per second
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:165:
[31m-            price_precision: 2,  // 2 decimal places
[m[32m+            price_precision: 2, // 2 decimal places
[m             volume_range: (100, 10000),
             volatility_range: (0.01, 0.05), // 1% to 5% daily volatility
             enable_realistic_data: true,
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:173:
 impl Default for RiskConfig {
     fn default() -> Self {
         Self {
[31m-            default_var_limit: Decimal::from(100000),      // $100k
[m[31m-            default_position_limit: Decimal::from(1000000), // $1M
[m[32m+            default_var_limit: Decimal::from(100000),         // $100k
[m[32m+            default_position_limit: Decimal::from(1000000),   // $1M
[m             default_concentration_limit: Decimal::new(25, 2), // 25%
             stress_test_scenarios: vec![
                 "market_crash".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:191:
     /// Load configuration from environment variables and defaults
     pub fn from_env() -> Self {
         let mut config = Self::default();
[31m-        
[m[32m+
[m         // Override with environment variables if present
         if let Ok(db_url) = env::var("TEST_DATABASE_URL") {
             config.database.url = db_url;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:198:
         }
[31m-        
[m[32m+
[m         if let Ok(max_connections) = env::var("TEST_DB_MAX_CONNECTIONS") {
             if let Ok(connections) = max_connections.parse() {
                 config.database.max_connections = connections;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:203:
             }
         }
[31m-        
[m[32m+
[m         if let Ok(enable_mocks) = env::var("TEST_ENABLE_MOCKS") {
             config.services.enable_mocks = enable_mocks.to_lowercase() == "true";
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:209:
[31m-        
[m[32m+
[m         if let Ok(max_latency) = env::var("TEST_MAX_LATENCY_NS") {
             if let Ok(latency) = max_latency.parse() {
                 config.performance.max_latency_ns = latency;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:213:
             }
         }
[31m-        
[m[32m+
[m         config
     }
[31m-    
[m[32m+
[m     /// Create configuration for unit tests (fast, mocked)
     pub fn for_unit_tests() -> Self {
         Self {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:246:
             ..Self::default()
         }
     }
[31m-    
[m[32m+
[m     /// Create configuration for integration tests (realistic)
     pub fn for_integration_tests() -> Self {
         Self {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:263:
             ..Self::default()
         }
     }
[31m-    
[m[32m+
[m     /// Create configuration for performance tests (demanding)
     pub fn for_performance_tests() -> Self {
         Self {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:287:
             ..Self::default()
         }
     }
[31m-    
[m[32m+
[m     /// Create configuration for stress tests (extreme)
     pub fn for_stress_tests() -> Self {
         Self {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:298:
                 ..PerformanceConfig::default()
             },
             market_data: MarketDataConfig {
[31m-                tick_rate_hz: 50000, // Extreme tick rate
[m[32m+                tick_rate_hz: 50000,            // Extreme tick rate
[m                 volatility_range: (0.05, 0.20), // Higher volatility
                 ..MarketDataConfig::default()
             },
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:305:
             ..Self::default()
         }
     }
[31m-    
[m[32m+
[m     /// Validate configuration values
     pub fn validate(&self) -> Result<(), String> {
         if self.database.max_connections == 0 {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:312:
             return Err("Database max_connections must be greater than 0".to_string());
         }
[31m-        
[m[32m+
[m         if self.performance.max_latency_ns == 0 {
             return Err("Performance max_latency_ns must be greater than 0".to_string());
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:318:
[31m-        
[m[32m+
[m         if self.performance.min_throughput_ops_per_sec <= 0.0 {
             return Err("Performance min_throughput_ops_per_sec must be positive".to_string());
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:322:
[31m-        
[m[32m+
[m         if self.services.mock_failure_rate < 0.0 || self.services.mock_failure_rate > 1.0 {
             return Err("Services mock_failure_rate must be between 0.0 and 1.0".to_string());
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:326:
[31m-        
[m[32m+
[m         if self.market_data.tick_rate_hz == 0 {
             return Err("Market data tick_rate_hz must be greater than 0".to_string());
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:330:
[31m-        
[m[32m+
[m         if self.risk.default_var_limit <= Decimal::ZERO {
             return Err("Risk default_var_limit must be positive".to_string());
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:334:
[31m-        
[m[31m-        if self.risk.default_concentration_limit <= Decimal::ZERO || self.risk.default_concentration_limit > Decimal::ONE {
[m[32m+
[m[32m+        if self.risk.default_concentration_limit <= Decimal::ZERO
[m[32m+            || self.risk.default_concentration_limit > Decimal::ONE
[m[32m+        {
[m             return Err("Risk default_concentration_limit must be between 0 and 1".to_string());
         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     /// Get database URL with test database suffix if not already present
     pub fn get_test_database_url(&self) -> String {
         let url = &self.database.url;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:354:
             }
         }
     }
[31m-    
[m[32m+
[m     /// Create environment variables map for child processes
     pub fn to_env_vars(&self) -> HashMap<String, String> {
         let mut env_vars = HashMap::new();
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:361:
[31m-        
[m[31m-        env_vars.insert("TEST_DATABASE_URL".to_string(), self.get_test_database_url());
[m[31m-        env_vars.insert("TEST_DB_MAX_CONNECTIONS".to_string(), self.database.max_connections.to_string());
[m[31m-        env_vars.insert("TEST_ENABLE_MOCKS".to_string(), self.services.enable_mocks.to_string());
[m[31m-        env_vars.insert("TEST_MAX_LATENCY_NS".to_string(), self.performance.max_latency_ns.to_string());
[m[31m-        env_vars.insert("TEST_MIN_THROUGHPUT".to_string(), self.performance.min_throughput_ops_per_sec.to_string());
[m[31m-        env_vars.insert("RUST_LOG".to_string(), if self.database.enable_logging { "debug" } else { "warn" }.to_string());
[m[31m-        
[m[32m+
[m[32m+        env_vars.insert(
[m[32m+            "TEST_DATABASE_URL".to_string(),
[m[32m+            self.get_test_database_url(),
[m[32m+        );
[m[32m+        env_vars.insert(
[m[32m+            "TEST_DB_MAX_CONNECTIONS".to_string(),
[m[32m+            self.database.max_connections.to_string(),
[m[32m+        );
[m[32m+        env_vars.insert(
[m[32m+            "TEST_ENABLE_MOCKS".to_string(),
[m[32m+            self.services.enable_mocks.to_string(),
[m[32m+        );
[m[32m+        env_vars.insert(
[m[32m+            "TEST_MAX_LATENCY_NS".to_string(),
[m[32m+            self.performance.max_latency_ns.to_string(),
[m[32m+        );
[m[32m+        env_vars.insert(
[m[32m+            "TEST_MIN_THROUGHPUT".to_string(),
[m[32m+            self.performance.min_throughput_ops_per_sec.to_string(),
[m[32m+        );
[m[32m+        env_vars.insert(
[m[32m+            "RUST_LOG".to_string(),
[m[32m+            if self.database.enable_logging {
[m[32m+                "debug"
[m[32m+            } else {
[m[32m+                "warn"
[m[32m+            }
[m[32m+            .to_string(),
[m[32m+        );
[m[32m+
[m         env_vars
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:382:
             config: TestConfig::default(),
         }
     }
[31m-    
[m[32m+
[m     pub fn with_database_url(mut self, url: impl Into<String>) -> Self {
         self.config.database.url = url.into();
         self
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:389:
     }
[31m-    
[m[32m+
[m     pub fn with_max_connections(mut self, max_connections: u32) -> Self {
         self.config.database.max_connections = max_connections;
         self
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:394:
     }
[31m-    
[m[32m+
[m     pub fn with_mocks_enabled(mut self, enabled: bool) -> Self {
         self.config.services.enable_mocks = enabled;
         self
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:399:
     }
[31m-    
[m[32m+
[m     pub fn with_max_latency_ns(mut self, latency: u64) -> Self {
         self.config.performance.max_latency_ns = latency;
         self
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:404:
     }
[31m-    
[m[32m+
[m     pub fn with_test_duration(mut self, duration_secs: u64) -> Self {
         self.config.performance.test_duration_secs = duration_secs;
         self
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:409:
     }
[31m-    
[m[32m+
[m     pub fn with_concurrent_operations(mut self, operations: usize) -> Self {
         self.config.performance.concurrent_operations = operations;
         self
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:414:
     }
[31m-    
[m[32m+
[m     pub fn with_var_limit(mut self, limit: Decimal) -> Self {
         self.config.risk.default_var_limit = limit;
         self
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:419:
     }
[31m-    
[m[32m+
[m     pub fn build(self) -> Result<TestConfig, String> {
         self.config.validate()?;
         Ok(self.config)
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:469:
             .with_max_latency_ns(10_000)
             .build()
             .unwrap();
[31m-        
[m[32m+
[m         assert_eq!(config.database.max_connections, 20);
         assert!(!config.services.enable_mocks);
         assert_eq!(config.performance.max_latency_ns, 10_000);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:478:
     #[test]
     fn test_config_validation() {
         let mut config = TestConfig::default();
[31m-        
[m[32m+
[m         // Test invalid max_connections
         config.database.max_connections = 0;
         assert!(config.validate().is_err());
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:485:
[31m-        
[m[32m+
[m         // Test invalid failure rate
         config.database.max_connections = 10;
         config.services.mock_failure_rate = 1.5;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:489:
         assert!(config.validate().is_err());
[31m-        
[m[32m+
[m         // Test valid config
         config.services.mock_failure_rate = 0.1;
         assert!(config.validate().is_ok());
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:498:
         let config = TestConfig::default();
         let test_url = config.get_test_database_url();
         assert!(test_url.contains("_test"));
[31m-        
[m[32m+
[m         // Test with already test database
         let mut config_with_test = config.clone();
         config_with_test.database.url = "postgresql://user:pass@localhost/db_test".to_string();
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:510:
     fn test_env_vars_generation() {
         let config = TestConfig::default();
         let env_vars = config.to_env_vars();
[31m-        
[m[32m+
[m         assert!(env_vars.contains_key("TEST_DATABASE_URL"));
         assert!(env_vars.contains_key("TEST_DB_MAX_CONNECTIONS"));
         assert!(env_vars.contains_key("TEST_ENABLE_MOCKS"));
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_config.rs:517:
         assert!(env_vars.contains_key("RUST_LOG"));
     }
 }
[32m+
[mDiff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:23:
 //!     .generate_random_portfolio(10); // 10 positions
 //! ```
 
[31m-use chrono::{DateTime, Utc, Duration as ChronoDuration, Timelike};
[m use ::rust_decimal::Decimal;
[32m+use chrono::{DateTime, Duration as ChronoDuration, Timelike, Utc};
[m[32m+use rand::distributions::Distribution;
[m[32m+use rand::{rngs::StdRng, Rng, SeedableRng};
[m[32m+use rand_distr::Normal;
[m use serde_json::json;
 use std::collections::HashMap;
 use uuid::Uuid;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:31:
[31m-use rand::{Rng, SeedableRng, rngs::StdRng};
[m[31m-use rand::distributions::Distribution;
[m[31m-use rand_distr::Normal;
[m 
 // Import types from risk crate
[31m-use risk::risk_types::{Position, StressScenario};
[m[31m-use crate::fixtures::helpers::ToDecimal;
[m use super::builders::*;
 use super::*;
[32m+use crate::fixtures::helpers::ToDecimal;
[m[32m+use risk::risk_types::{Position, StressScenario};
[m 
 /// Legacy constant for backward compatibility
 pub const SAMPLE_PRICE: f64 = 100.0;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:50:
 pub struct MarketDataGenerator {
     pub symbol: String,
     pub initial_price: Decimal,
[31m-    pub volatility: f64,           // Daily volatility (e.g., 0.02 = 2%)
[m[31m-    pub drift: f64,               // Daily drift (e.g., 0.0001 = 0.01%)
[m[31m-    pub tick_size: Decimal,       // Minimum price increment
[m[31m-    pub bid_ask_spread: Decimal,  // Spread in price units
[m[31m-    pub seed: Option<u64>,        // Random seed for reproducible data
[m[32m+    pub volatility: f64,         // Daily volatility (e.g., 0.02 = 2%)
[m[32m+    pub drift: f64,              // Daily drift (e.g., 0.0001 = 0.01%)
[m[32m+    pub tick_size: Decimal,      // Minimum price increment
[m[32m+    pub bid_ask_spread: Decimal, // Spread in price units
[m[32m+    pub seed: Option<u64>,       // Random seed for reproducible data
[m }
 
 impl Default for MarketDataGenerator {
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:68:
         Self {
             symbol: TEST_EQUITY_1.to_string(),
             initial_price: Decimal::from(100),
[31m-            volatility: 0.02,  // 2% daily volatility
[m[31m-            drift: 0.0001,    // 0.01% daily drift
[m[31m-            tick_size: Decimal::new(1, 2), // $0.01
[m[32m+            volatility: 0.02,                   // 2% daily volatility
[m[32m+            drift: 0.0001,                      // 0.01% daily drift
[m[32m+            tick_size: Decimal::new(1, 2),      // $0.01
[m             bid_ask_spread: Decimal::new(2, 2), // $0.02
[31m-            seed: Some(42),   // Deterministic by default for testing
[m[32m+            seed: Some(42),                     // Deterministic by default for testing
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:130:
 
         for i in 0..count {
             let timestamp = start_time + ChronoDuration::seconds(i as i64);
[31m-            
[m[32m+
[m             // Geometric Brownian Motion: dS = μS dt + σS dW
             let random_shock = normal.sample(&mut rng);
             let price_change_pct = drift_per_tick + vol_per_tick * random_shock;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:137:
[31m-            let new_price = current_price * (Decimal::ONE + Decimal::try_from(price_change_pct).unwrap_or(Decimal::ZERO));
[m[31m-            
[m[32m+            let new_price = current_price
[m[32m+                * (Decimal::ONE + Decimal::try_from(price_change_pct).unwrap_or(Decimal::ZERO));
[m[32m+
[m             // Round to tick size
             let rounded_price = self.round_to_tick_size(new_price);
             current_price = rounded_price;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:162:
 
         for point in price_points {
             let bar_start = self.get_bar_start_time(point.timestamp, bar_duration);
[31m-            
[m[32m+
[m             match &mut current_bar {
                 Some(bar) if bar.timestamp == bar_start => {
                     // Update existing bar
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:176:
                     if let Some(completed_bar) = current_bar.take() {
                         bars.push(completed_bar);
                     }
[31m-                    
[m[32m+
[m                     current_bar = Some(OHLCVBar {
                         symbol: self.symbol.clone(),
                         timestamp: bar_start,
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:186:
                         close: point.price,
                         volume: point.volume,
                     });
[31m-                }
[m[32m+                },
[m             }
[31m-            
[m[32m+
[m             if bars.len() >= count {
                 break;
             }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:217:
             let level_offset = Decimal::from(i + 1) * self.tick_size;
             let bid_price = mid_price - level_offset;
             let ask_price = mid_price + level_offset;
[31m-            
[m[32m+
[m             let bid_size = Decimal::from(rng.gen_range(100..=5000));
             let ask_size = Decimal::from(rng.gen_range(100..=5000));
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:246:
         if self.tick_size == Decimal::ZERO {
             return price;
         }
[31m-        
[m[32m+
[m         let ticks = price / self.tick_size;
         let rounded_ticks = ticks.round();
         rounded_ticks * self.tick_size
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:253:
     }
 
[31m-    fn get_bar_start_time(&self, timestamp: DateTime<Utc>, duration: ChronoDuration) -> DateTime<Utc> {
[m[32m+    fn get_bar_start_time(
[m[32m+        &self,
[m[32m+        timestamp: DateTime<Utc>,
[m[32m+        duration: ChronoDuration,
[m[32m+    ) -> DateTime<Utc> {
[m         let seconds_since_epoch = timestamp.timestamp();
         let duration_seconds = duration.num_seconds();
         let bar_start_seconds = (seconds_since_epoch / duration_seconds) * duration_seconds;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:269:
 pub struct TimeSeriesGenerator {
     pub frequency: ChronoDuration,
     pub start_time: DateTime<Utc>,
[31m-    pub trend: f64,         // Linear trend component
[m[31m-    pub seasonality: f64,   // Seasonal amplitude
[m[31m-    pub noise_level: f64,   // Random noise level
[m[32m+    pub trend: f64,       // Linear trend component
[m[32m+    pub seasonality: f64, // Seasonal amplitude
[m[32m+    pub noise_level: f64, // Random noise level
[m     pub seed: Option<u64>,
 }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:330:
 
         for i in 0..count {
             let timestamp = self.start_time + (self.frequency * i as i32);
[31m-            
[m[32m+
[m             // Trend component
             let trend_value = self.trend * i as f64;
[31m-            
[m[32m+
[m             // Seasonal component (daily pattern)
             let hour_of_day = timestamp.hour() as f64;
[31m-            let seasonal_value = self.seasonality * (2.0 * std::f64::consts::PI * hour_of_day / 24.0).sin();
[m[31m-            
[m[32m+            let seasonal_value =
[m[32m+                self.seasonality * (2.0 * std::f64::consts::PI * hour_of_day / 24.0).sin();
[m[32m+
[m             // Noise component
             let noise_value = normal.sample(&mut rng);
[31m-            
[m[32m+
[m             // Combine components
             let value = base_value + trend_value + seasonal_value + noise_value;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:407:
     }
 
     /// Generate a random portfolio with specified number of positions
[31m-    pub fn generate_random_portfolio(&mut self, position_count: usize) -> (Portfolio, Vec<Instrument>, Vec<Position>) {
[m[32m+    pub fn generate_random_portfolio(
[m[32m+        &mut self,
[m[32m+        position_count: usize,
[m[32m+    ) -> (Portfolio, Vec<Instrument>, Vec<Position>) {
[m         let portfolio_id = format!("RANDOM_PORTFOLIO_{}", self.rng.gen::<u32>());
[31m-        
[m[32m+
[m         let portfolio = PortfolioBuilder::new()
             .with_id(&portfolio_id)
             .with_name("Random Test Portfolio")
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:432:
         for i in 0..position_count {
             let asset_class = asset_classes[self.rng.gen_range(0..asset_classes.len())];
             let symbol = generate_test_symbol(asset_class);
[31m-            
[m[32m+
[m             // Generate random instrument
             let mut instrument_builder = InstrumentBuilder::new()
                 .with_symbol(&symbol)
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:454:
             let quantity = Decimal::from(self.rng.gen_range(100..=10000));
             let price = self.rng.gen_range(10.0..=1000.0).to_decimal();
             let price_change_pct = self.rng.gen_range(-0.1..=0.1); // ±10%
[31m-            let market_price = price * (Decimal::ONE + Decimal::try_from(price_change_pct).unwrap_or(Decimal::ZERO));
[m[32m+            let market_price = price
[m[32m+                * (Decimal::ONE + Decimal::try_from(price_change_pct).unwrap_or(Decimal::ZERO));
[m 
             let position = PositionBuilder::new()
                 .with_portfolio_id(&portfolio_id)
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:514:
                 "volatility_multiplier": self.rng.gen_range(1.0..=5.0)
             });
 
[31m-            let equity_shock = shock_factors.get("equity_shock").and_then(|v| v.as_f64()).unwrap_or(0.0);
[m[32m+            let equity_shock = shock_factors
[m[32m+                .get("equity_shock")
[m[32m+                .and_then(|v| v.as_f64())
[m[32m+                .unwrap_or(0.0);
[m             let mut price_shocks = HashMap::new();
             price_shocks.insert("EQUITY".to_string(), equity_shock);
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:523:
                 name: format!("Random Stress Scenario {}", i + 1),
                 price_shocks: price_shocks.clone(),
                 market_shocks: price_shocks,
[31m-                volatility_multiplier: shock_factors.get("volatility_multiplier").and_then(|v| v.as_f64()).unwrap_or(1.0),
[m[32m+                volatility_multiplier: shock_factors
[m[32m+                    .get("volatility_multiplier")
[m[32m+                    .and_then(|v| v.as_f64())
[m[32m+                    .unwrap_or(1.0),
[m                 volatility_multipliers: HashMap::new(),
                 correlation_changes: HashMap::new(),
                 correlation_adjustments: HashMap::new(),
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:611:
 /// Create realistic test prices for different asset classes
 pub fn create_realistic_test_prices() -> HashMap<String, Decimal> {
     let mut prices = HashMap::new();
[31m-    
[m[32m+
[m     // Equity prices
     for symbol in ALL_TEST_EQUITIES {
[31m-        prices.insert(symbol.to_string(), Decimal::from(100 + (symbol.len() as i64 * 10)));
[m[32m+        prices.insert(
[m[32m+            symbol.to_string(),
[m[32m+            Decimal::from(100 + (symbol.len() as i64 * 10)),
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     // FX prices (rates)
     prices.insert(TEST_FOREX_1.to_string(), Decimal::new(12345, 5)); // 1.2345
     prices.insert(TEST_FOREX_2.to_string(), Decimal::new(13456, 5)); // 1.3456
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:623:
[31m-    prices.insert(TEST_FOREX_3.to_string(), Decimal::from(150));     // 150.00
[m[32m+    prices.insert(TEST_FOREX_3.to_string(), Decimal::from(150)); // 150.00
[m     prices.insert(TEST_FOREX_EXOTIC.to_string(), Decimal::new(2850, 2)); // 28.50 (USDTRY)
[31m-    
[m[32m+
[m     // Futures prices
     for symbol in ALL_TEST_FUTURES {
[31m-        prices.insert(symbol.to_string(), Decimal::from(4000 + (symbol.len() as i64 * 100)));
[m[32m+        prices.insert(
[m[32m+            symbol.to_string(),
[m[32m+            Decimal::from(4000 + (symbol.len() as i64 * 100)),
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     // Bond prices (yield-like)
     for symbol in ALL_TEST_BONDS {
[31m-        prices.insert(symbol.to_string(), Decimal::new(250 + (symbol.len() as i64 * 10), 2));
[m[32m+        prices.insert(
[m[32m+            symbol.to_string(),
[m[32m+            Decimal::new(250 + (symbol.len() as i64 * 10), 2),
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     // Commodity prices
     prices.insert(TEST_COMMODITY_1.to_string(), Decimal::from(2000)); // Gold
[31m-    prices.insert(TEST_COMMODITY_2.to_string(), Decimal::from(25));   // Silver
[m[32m+    prices.insert(TEST_COMMODITY_2.to_string(), Decimal::from(25)); // Silver
[m     prices.insert(TEST_COMMODITY_OIL.to_string(), Decimal::from(80)); // Oil
[31m-    prices.insert(TEST_COMMODITY_GAS.to_string(), Decimal::from(4));  // Natural Gas
[m[31m-    
[m[32m+    prices.insert(TEST_COMMODITY_GAS.to_string(), Decimal::from(4)); // Natural Gas
[m[32m+
[m     // Crypto prices
[31m-    prices.insert(TEST_CRYPTO_1.to_string(), Decimal::from(50000));   // BTC-like
[m[31m-    prices.insert(TEST_CRYPTO_2.to_string(), Decimal::from(3000));    // ETH-like
[m[31m-    prices.insert(TEST_CRYPTO_ALT.to_string(), Decimal::from(1));     // Altcoin
[m[32m+    prices.insert(TEST_CRYPTO_1.to_string(), Decimal::from(50000)); // BTC-like
[m[32m+    prices.insert(TEST_CRYPTO_2.to_string(), Decimal::from(3000)); // ETH-like
[m[32m+    prices.insert(TEST_CRYPTO_ALT.to_string(), Decimal::from(1)); // Altcoin
[m 
     // Option prices
[31m-    prices.insert(TEST_OPTION_CALL.to_string(), Decimal::from(5));    // Call option premium
[m[31m-    prices.insert(TEST_OPTION_PUT.to_string(), Decimal::from(3));     // Put option premium
[m[32m+    prices.insert(TEST_OPTION_CALL.to_string(), Decimal::from(5)); // Call option premium
[m[32m+    prices.insert(TEST_OPTION_PUT.to_string(), Decimal::from(3)); // Put option premium
[m 
     prices
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:654:
 /// Create test volatility estimates for different asset classes
 pub fn create_test_volatilities() -> HashMap<String, f64> {
     let mut volatilities = HashMap::new();
[31m-    
[m[32m+
[m     // Equity volatilities (annualized)
     for symbol in ALL_TEST_EQUITIES {
         volatilities.insert(symbol.to_string(), 0.20); // 20% annual vol
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:661:
     }
[31m-    
[m[32m+
[m     // FX volatilities
     volatilities.insert(TEST_FOREX_1.to_string(), 0.10); // 10% annual vol
     volatilities.insert(TEST_FOREX_2.to_string(), 0.12);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:666:
     volatilities.insert(TEST_FOREX_3.to_string(), 0.08);
     volatilities.insert(TEST_FOREX_EXOTIC.to_string(), 0.18); // Higher vol for exotic pair
[31m-    
[m[32m+
[m     // Futures volatilities
     for symbol in ALL_TEST_FUTURES {
         volatilities.insert(symbol.to_string(), 0.25); // 25% annual vol
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:672:
     }
[31m-    
[m[32m+
[m     // Bond volatilities
     for symbol in ALL_TEST_BONDS {
         volatilities.insert(symbol.to_string(), 0.05); // 5% annual vol
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:677:
     }
[31m-    
[m[32m+
[m     // Commodity volatilities
     volatilities.insert(TEST_COMMODITY_1.to_string(), 0.15); // Gold
     volatilities.insert(TEST_COMMODITY_2.to_string(), 0.20); // Silver
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:682:
     volatilities.insert(TEST_COMMODITY_OIL.to_string(), 0.35); // Oil
     volatilities.insert(TEST_COMMODITY_GAS.to_string(), 0.50); // Natural Gas
[31m-    
[m[32m+
[m     // Crypto volatilities
     volatilities.insert(TEST_CRYPTO_1.to_string(), 0.60); // BTC-like
     volatilities.insert(TEST_CRYPTO_2.to_string(), 0.70); // ETH-like
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:688:
     volatilities.insert(TEST_CRYPTO_ALT.to_string(), 0.80); // Altcoin
[31m-    
[m[32m+
[m     volatilities
 }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:698:
     fn test_market_data_generator() {
         let generator = MarketDataGenerator::new();
         let prices = generator.generate_price_series(100);
[31m-        
[m[32m+
[m         assert_eq!(prices.len(), 100);
         assert!(prices[0].price > Decimal::ZERO);
[31m-        
[m[32m+
[m         // Check timestamps are sequential
         for window in prices.windows(2) {
             assert!(window[1].timestamp >= window[0].timestamp);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:712:
     fn test_ohlcv_generation() {
         let generator = MarketDataGenerator::new();
         let bars = generator.generate_ohlcv_bars(50, ChronoDuration::minutes(1));
[31m-        
[m[32m+
[m         assert_eq!(bars.len(), 50);
[31m-        
[m[32m+
[m         for bar in &bars {
             assert!(bar.high >= bar.low);
             assert!(bar.high >= bar.open);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:729:
         let generator = TimeSeriesGenerator::new()
             .with_trend(0.1)
             .with_seasonality(0.2);
[31m-        
[m[32m+
[m         let series = generator.generate_series(100, 100.0);
         assert_eq!(series.len(), 100);
[31m-        
[m[32m+
[m         // Check that trend is applied (last value should be higher due to positive trend)
         assert!(series.last().unwrap().value > series.first().unwrap().value);
     }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:741:
     fn test_random_data_generator() {
         let mut generator = RandomDataGenerator::new();
         let (portfolio, instruments, positions) = generator.generate_random_portfolio(5);
[31m-        
[m[32m+
[m         assert_eq!(instruments.len(), 5);
         assert_eq!(positions.len(), 5);
         assert_eq!(portfolio.id.len() > 0, true);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:754:
     fn test_market_depth_generation() {
         let generator = MarketDataGenerator::new();
         let depth = generator.generate_market_depth(5);
[31m-        
[m[32m+
[m         assert_eq!(depth.bids.len(), 5);
         assert_eq!(depth.asks.len(), 5);
[31m-        
[m[32m+
[m         // Check that bid prices are decreasing and ask prices are increasing
         for window in depth.bids.windows(2) {
             assert!(window[0].price > window[1].price);
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:764:
         }
[31m-        
[m[32m+
[m         for window in depth.asks.windows(2) {
             assert!(window[0].price < window[1].price);
         }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:772:
     fn test_realistic_test_prices() {
         let prices = create_realistic_test_prices();
         assert!(!prices.is_empty());
[31m-        
[m[32m+
[m         // Check that all test symbols have prices
         for &symbol in ALL_TEST_SYMBOLS {
             assert!(prices.contains_key(symbol));
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_data.rs:792:
         }
     }
 }
[32m+
[mDiff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:3:
 //! This module provides database setup, cleanup, and helper utilities
 //! for testing database operations in isolation.
 
[32m+use sqlx::{migrate::MigrateDatabase, PgPool, Postgres};
[m use std::sync::Arc;
[31m-use sqlx::{PgPool, Postgres, migrate::MigrateDatabase};
[m use tokio::sync::OnceCell;
 use uuid::Uuid;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:121:
     pub async fn insert_test_data(&self) -> Result<(), sqlx::Error> {
         // Insert test instruments
         self.insert_test_instruments().await?;
[31m-        
[m[32m+
[m         // Insert test portfolios
         self.insert_test_portfolios().await?;
[31m-        
[m[32m+
[m         // Insert test counterparties
         self.insert_test_counterparties().await?;
[31m-        
[m[32m+
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:134:
     /// Insert test instruments
     async fn insert_test_instruments(&self) -> Result<(), sqlx::Error> {
[31m-        use super::{ALL_TEST_SYMBOLS, builders::BatchBuilder};
[m[31m-        
[m[32m+        use super::{builders::BatchBuilder, ALL_TEST_SYMBOLS};
[m[32m+
[m         let instruments = BatchBuilder::create_diverse_instruments(ALL_TEST_SYMBOLS.len());
[31m-        
[m[32m+
[m         for instrument in instruments {
             sqlx::query(
                 r#"
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:160:
             .execute(&self.pool)
             .await?;
         }
[31m-        
[m[32m+
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:167:
     /// Insert test portfolios
     async fn insert_test_portfolios(&self) -> Result<(), sqlx::Error> {
[31m-        use super::{TEST_PORTFOLIO_1, TEST_PORTFOLIO_2, builders::PortfolioBuilder};
[m[31m-        
[m[32m+        use super::{builders::PortfolioBuilder, TEST_PORTFOLIO_1, TEST_PORTFOLIO_2};
[m[32m+
[m         let portfolios = vec![
             PortfolioBuilder::new().with_id(TEST_PORTFOLIO_1).build(),
             PortfolioBuilder::new().with_id(TEST_PORTFOLIO_2).build(),
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:174:
         ];
[31m-        
[m[32m+
[m         for portfolio in portfolios {
             sqlx::query(
                 r#"
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:197:
             .execute(&self.pool)
             .await?;
         }
[31m-        
[m[32m+
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:204:
     /// Insert test counterparties
     async fn insert_test_counterparties(&self) -> Result<(), sqlx::Error> {
         use super::builders::CounterpartyBuilder;
[31m-        
[m[32m+
[m         let counterparties = vec![
[31m-            CounterpartyBuilder::new().with_id("TEST_COUNTERPARTY_001").bank().build(),
[m[31m-            CounterpartyBuilder::new().with_id("TEST_COUNTERPARTY_002").broker().build(),
[m[31m-            CounterpartyBuilder::new().with_id("TEST_COUNTERPARTY_003").exchange().build(),
[m[32m+            CounterpartyBuilder::new()
[m[32m+                .with_id("TEST_COUNTERPARTY_001")
[m[32m+                .bank()
[m[32m+                .build(),
[m[32m+            CounterpartyBuilder::new()
[m[32m+                .with_id("TEST_COUNTERPARTY_002")
[m[32m+                .broker()
[m[32m+                .build(),
[m[32m+            CounterpartyBuilder::new()
[m[32m+                .with_id("TEST_COUNTERPARTY_003")
[m[32m+                .exchange()
[m[32m+                .build(),
[m         ];
[31m-        
[m[32m+
[m         for counterparty in counterparties {
             sqlx::query(
                 r#"
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:234:
             .execute(&self.pool)
             .await?;
         }
[31m-        
[m[32m+
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:254:
 
     /// Get database statistics
     pub async fn get_stats(&self) -> Result<DatabaseStats, sqlx::Error> {
[31m-        let instruments_count: Option<i64> = sqlx::query_scalar(
[m[31m-            "SELECT COUNT(*) FROM instruments WHERE symbol LIKE 'TEST_%'"
[m[31m-        )
[m[31m-        .fetch_one(&self.pool)
[m[31m-        .await?;
[m[32m+        let instruments_count: Option<i64> =
[m[32m+            sqlx::query_scalar("SELECT COUNT(*) FROM instruments WHERE symbol LIKE 'TEST_%'")
[m[32m+                .fetch_one(&self.pool)
[m[32m+                .await?;
[m 
[31m-        let portfolios_count: Option<i64> = sqlx::query_scalar(
[m[31m-            "SELECT COUNT(*) FROM portfolios WHERE id LIKE 'TEST_%'"
[m[31m-        )
[m[31m-        .fetch_one(&self.pool)
[m[31m-        .await?;
[m[32m+        let portfolios_count: Option<i64> =
[m[32m+            sqlx::query_scalar("SELECT COUNT(*) FROM portfolios WHERE id LIKE 'TEST_%'")
[m[32m+                .fetch_one(&self.pool)
[m[32m+                .await?;
[m 
[31m-        let positions_count: Option<i64> = sqlx::query_scalar(
[m[31m-            "SELECT COUNT(*) FROM positions WHERE portfolio_id LIKE 'TEST_%'"
[m[31m-        )
[m[31m-        .fetch_one(&self.pool)
[m[31m-        .await?;
[m[32m+        let positions_count: Option<i64> =
[m[32m+            sqlx::query_scalar("SELECT COUNT(*) FROM positions WHERE portfolio_id LIKE 'TEST_%'")
[m[32m+                .fetch_one(&self.pool)
[m[32m+                .await?;
[m 
         Ok(DatabaseStats {
             instruments_count: instruments_count.unwrap_or(0),
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:296:
                 updated_at TIMESTAMPTZ DEFAULT NOW(),
                 metadata JSONB DEFAULT '{}'
             )
[31m-            "#
[m[32m+            "#,
[m         )
         .execute(pool)
         .await?;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:316:
                 updated_at TIMESTAMPTZ DEFAULT NOW(),
                 metadata JSONB DEFAULT '{}'
             )
[31m-            "#
[m[32m+            "#,
[m         )
         .execute(pool)
         .await?;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:336:
                 entry_date TIMESTAMPTZ NOT NULL,
                 last_updated TIMESTAMPTZ DEFAULT NOW()
             )
[31m-            "#
[m[32m+            "#,
[m         )
         .execute(pool)
         .await?;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:355:
                 updated_at TIMESTAMPTZ DEFAULT NOW(),
                 metadata JSONB DEFAULT '{}'
             )
[31m-            "#
[m[32m+            "#,
[m         )
         .execute(pool)
         .await?;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:378:
         if self.cleanup_on_drop && self.database_name != "shared_test_db" {
             // Note: We can't use async in Drop, so we schedule cleanup
             // In practice, you might want to use a cleanup service or manual cleanup
[31m-            eprintln!("TestDatabase: Consider cleaning up database: {}", self.database_name);
[m[32m+            eprintln!(
[m[32m+                "TestDatabase: Consider cleaning up database: {}",
[m[32m+                self.database_name
[m[32m+            );
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:445:
         test_db.insert_test_data().await?;
         test_db
     }};
[31m-    
[m[32m+
[m     ($config:expr) => {{
         let test_db = $crate::fixtures::test_database::TestDatabase::with_config($config).await?;
         test_db.insert_test_data().await?;
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:542:
         let test_db = TestDatabase::new().await.unwrap();
 
         // Count before transaction
[31m-        let initial_count = test_db.execute("SELECT COUNT(*) FROM instruments").await.unwrap();
[m[32m+        let initial_count = test_db
[m[32m+            .execute("SELECT COUNT(*) FROM instruments")
[m[32m+            .await
[m[32m+            .unwrap();
[m 
         // Start transaction and insert data
         let mut tx = TestTransaction::begin(test_db.pool()).await.unwrap();
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:550:
         tx.rollback().await.unwrap();
 
         // Count after rollback should be the same
[31m-        let final_count = test_db.execute("SELECT COUNT(*) FROM instruments").await.unwrap();
[m[32m+        let final_count = test_db
[m[32m+            .execute("SELECT COUNT(*) FROM instruments")
[m[32m+            .await
[m[32m+            .unwrap();
[m         assert_eq!(initial_count, final_count);
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/fixtures/test_database.rs:557:
[32m+
[mDiff in /home/jgrusewski/Work/foxhunt/tests/lib.rs:30:
 // Test modules - external files (only enable working ones for now)
 pub mod test_common;
 // pub mod framework;      // Temporarily disabled
[31m-pub mod helpers;         // Re-enabled after fixing imports
[m[31m-// pub mod unit;           // Temporarily disabled - has dependency issues
[m[31m-// pub mod integration;    // Temporarily disabled - missing broker modules
[m[31m-// pub mod performance;    // Temporarily disabled - missing dependencies
[m[31m-// pub mod gpu;            // Temporarily disabled - missing candle_core
[m[31m-pub mod utils;
[m[31m-pub mod fixtures;        // Re-enabled after fixing imports
[m[32m+pub mod helpers; // Re-enabled after fixing imports
[m[32m+                 // pub mod unit;           // Temporarily disabled - has dependency issues
[m[32m+                 // pub mod integration;    // Temporarily disabled - missing broker modules
[m[32m+                 // pub mod performance;    // Temporarily disabled - missing dependencies
[m[32m+                 // pub mod gpu;            // Temporarily disabled - missing candle_core
[m[32m+pub mod fixtures;
[m[32m+pub mod utils; // Re-enabled after fixing imports
[m 
 // Performance utilities module
 pub mod performance_utils {
Diff in /home/jgrusewski/Work/foxhunt/tests/test_common/database_helper.rs:44:
             .unwrap_or_else(|_| "localhost".to_string());
 
         Self {
[31m-            postgres_url: std::env::var("TEST_DATABASE_URL")
[m[31m-                .unwrap_or_else(|_| format!("postgresql://foxhunt_test:test_password@{}:5433/foxhunt_test", db_host)),
[m[32m+            postgres_url: std::env::var("TEST_DATABASE_URL").unwrap_or_else(|_| {
[m[32m+                format!(
[m[32m+                    "postgresql://foxhunt_test:test_password@{}:5433/foxhunt_test",
[m[32m+                    db_host
[m[32m+                )
[m[32m+            }),
[m             influxdb_url: std::env::var("TEST_INFLUXDB_URL")
                 .unwrap_or_else(|_| format!("http://{}:8086", db_host)),
             redis_url: std::env::var("TEST_REDIS_URL")
Diff in /home/jgrusewski/Work/foxhunt/tests/test_common/mod.rs:47:
                         let db_host = std::env::var("DATABASE_HOST")
                             .or_else(|_| std::env::var("POSTGRES_HOST"))
                             .unwrap_or_else(|_| "localhost".to_string());
[31m-                        format!("postgresql://foxhunt_test:test_password@{}:5433/foxhunt_test", db_host)
[m[32m+                        format!(
[m[32m+                            "postgresql://foxhunt_test:test_password@{}:5433/foxhunt_test",
[m[32m+                            db_host
[m[32m+                        )
[m                     })
                 }),
                 test_redis_url: std::env::var("TEST_REDIS_URL").unwrap_or_else(|_| {
Diff in /home/jgrusewski/Work/foxhunt/tests/utils/hft_utils.rs:4:
 //! with focus on performance, latency, and financial accuracy.
 
 use super::test_safety::{TestError, TestResult};
[31m-use chrono::{DateTime, Utc};
[m use ::rust_decimal::Decimal;
[32m+use chrono::{DateTime, Utc};
[m use std::collections::VecDeque;
 use std::time::{Duration, Instant};
 
Diff in /home/jgrusewski/Work/foxhunt/tests/utils/test_safety.rs:188:
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         f.debug_struct("TestFixture")
             .field("resource", &self.resource)
[31m-            .field("cleanup_fn", &if self.cleanup_fn.is_some() { "<cleanup fn>" } else { "<none>" })
[m[32m+            .field(
[m[32m+                "cleanup_fn",
[m[32m+                &if self.cleanup_fn.is_some() {
[m[32m+                    "<cleanup fn>"
[m[32m+                } else {
[m[32m+                    "<none>"
[m[32m+                },
[m[32m+            )
[m             .finish()
     }
 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:38:
         monitor.record_sample(sample).await;
 
         // Wait for alert to be broadcast
[31m-        let alert_result = tokio::time::timeout(Duration::from_millis(100), alert_receiver.recv()).await;
[m[32m+        let alert_result =
[m[32m+            tokio::time::timeout(Duration::from_millis(100), alert_receiver.recv()).await;
[m 
[31m-        assert!(alert_result.is_ok(), "Alert should be received within timeout");
[m[32m+        assert!(
[m[32m+            alert_result.is_ok(),
[m[32m+            "Alert should be received within timeout"
[m[32m+        );
[m         let alert = alert_result.unwrap().unwrap();
 
         assert_eq!(alert.model_id, "test_model");
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:47:
         assert_eq!(alert.alert_type, AlertType::HighLatency);
         assert_eq!(alert.severity, AlertSeverity::Warning);
[31m-        assert!(alert.current_value > 1000.0, "Latency should exceed threshold");
[m[32m+        assert!(
[m[32m+            alert.current_value > 1000.0,
[m[32m+            "Latency should exceed threshold"
[m[32m+        );
[m     }
 
     #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:96:
         monitor.record_sample(sample1).await;
 
         let no_alert = tokio::time::timeout(Duration::from_millis(50), receiver.recv()).await;
[31m-        assert!(no_alert.is_err(), "No alert should be generated for latency below threshold");
[m[32m+        assert!(
[m[32m+            no_alert.is_err(),
[m[32m+            "No alert should be generated for latency below threshold"
[m[32m+        );
[m 
         // Record sample above threshold - should trigger alert
         let sample2 = create_sample_with_latency("model_a", 1000);
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:103:
         monitor.record_sample(sample2).await;
 
         let alert_result = tokio::time::timeout(Duration::from_millis(100), receiver.recv()).await;
[31m-        assert!(alert_result.is_ok(), "Alert should be generated for high latency");
[m[32m+        assert!(
[m[32m+            alert_result.is_ok(),
[m[32m+            "Alert should be generated for high latency"
[m[32m+        );
[m 
         let alert = alert_result.unwrap().unwrap();
         assert_eq!(alert.alert_type, AlertType::HighLatency);
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:131:
         monitor.record_sample(sample2).await;
 
         let alert_result = tokio::time::timeout(Duration::from_millis(100), receiver.recv()).await;
[31m-        assert!(alert_result.is_ok(), "Alert should be generated for low accuracy");
[m[32m+        assert!(
[m[32m+            alert_result.is_ok(),
[m[32m+            "Alert should be generated for low accuracy"
[m[32m+        );
[m 
         let alert = alert_result.unwrap().unwrap();
         assert_eq!(alert.alert_type, AlertType::LowAccuracy);
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:159:
         monitor.record_sample(sample2).await;
 
         let alert_result = tokio::time::timeout(Duration::from_millis(100), receiver.recv()).await;
[31m-        assert!(alert_result.is_ok(), "Alert should be generated for high memory");
[m[32m+        assert!(
[m[32m+            alert_result.is_ok(),
[m[32m+            "Alert should be generated for high memory"
[m[32m+        );
[m 
         let alert = alert_result.unwrap().unwrap();
         assert_eq!(alert.alert_type, AlertType::HighMemoryUsage);
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:222:
         monitor.record_sample(sample2).await;
 
         let alert2 = tokio::time::timeout(Duration::from_millis(100), receiver.recv()).await;
[31m-        assert!(alert2.is_err(), "Second alert should be suppressed by cooldown");
[m[32m+        assert!(
[m[32m+            alert2.is_err(),
[m[32m+            "Second alert should be suppressed by cooldown"
[m[32m+        );
[m 
         // Wait for cooldown to expire
         sleep(Duration::from_secs(3)).await;
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:232:
         monitor.record_sample(sample3).await;
 
         let alert3 = tokio::time::timeout(Duration::from_millis(100), receiver.recv()).await;
[31m-        assert!(alert3.is_ok(), "Alert should be generated after cooldown expires");
[m[32m+        assert!(
[m[32m+            alert3.is_ok(),
[m[32m+            "Alert should be generated after cooldown expires"
[m[32m+        );
[m     }
 
     #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:254:
 
         let stats = stats.unwrap();
         assert_eq!(stats.total_samples, 100);
[31m-        assert!((stats.avg_accuracy - 0.75).abs() < 0.01, "Average accuracy should be ~75%");
[m[32m+        assert!(
[m[32m+            (stats.avg_accuracy - 0.75).abs() < 0.01,
[m[32m+            "Average accuracy should be ~75%"
[m[32m+        );
[m 
         // Check latency percentiles
[31m-        assert!(stats.p95_latency_us > 900.0, "P95 latency should be near 950");
[m[31m-        assert!(stats.p99_latency_us > 1000.0, "P99 latency should be near 1080");
[m[32m+        assert!(
[m[32m+            stats.p95_latency_us > 900.0,
[m[32m+            "P95 latency should be near 950"
[m[32m+        );
[m[32m+        assert!(
[m[32m+            stats.p99_latency_us > 1000.0,
[m[32m+            "P99 latency should be near 1080"
[m[32m+        );
[m         assert_eq!(stats.max_latency_us, 1090, "Max latency should be 1090");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:274:
         }
 
         let stats = monitor.get_model_stats("trend_model").await.unwrap();
[31m-        assert_eq!(stats.trend, PerformanceTrend::Improving, "Should detect improving trend");
[m[32m+        assert_eq!(
[m[32m+            stats.trend,
[m[32m+            PerformanceTrend::Improving,
[m[32m+            "Should detect improving trend"
[m[32m+        );
[m     }
 
     // ==================================================================================
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:304:
 
         // Record failures to trigger circuit breaker
         for _ in 0..config.circuit_breaker_failure_threshold {
[31m-            manager.record_prediction_result("cb_model", false, 100, None).await;
[m[32m+            manager
[m[32m+                .record_prediction_result("cb_model", false, 100, None)
[m[32m+                .await;
[m         }
 
         // Check model status
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:327:
 
         // Cause primary to fail
         for _ in 0..6 {
[31m-            manager.record_prediction_result("primary", false, 100, None).await;
[m[32m+            manager
[m[32m+                .record_prediction_result("primary", false, 100, None)
[m[32m+                .await;
[m         }
 
         // Wait for failover event
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:334:
[31m-        let event_result = tokio::time::timeout(Duration::from_millis(100), event_receiver.recv()).await;
[m[32m+        let event_result =
[m[32m+            tokio::time::timeout(Duration::from_millis(100), event_receiver.recv()).await;
[m         assert!(event_result.is_ok(), "Failover event should be broadcast");
 
         let event = event_result.unwrap().unwrap();
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:354:
 
         // Fail highest priority
         for _ in 0..6 {
[31m-            manager.record_prediction_result("priority_1", false, 100, None).await;
[m[32m+            manager
[m[32m+                .record_prediction_result("priority_1", false, 100, None)
[m[32m+                .await;
[m         }
 
         // Should fall back to second priority
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:387:
         let features = vec![0.05, 1000.0]; // momentum, volume
         let prediction = manager.predict_with_fallback(&features, None).await;
 
[31m-        assert_eq!(prediction.strategy_used, FallbackStrategy::RuleBasedFallback);
[m[32m+        assert_eq!(
[m[32m+            prediction.strategy_used,
[m[32m+            FallbackStrategy::RuleBasedFallback
[m[32m+        );
[m         assert_eq!(prediction.models_used, vec!["rule_based".to_string()]);
         assert!(prediction.fallback_triggered);
         assert!(prediction.confidence <= 0.6);
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:419:
 
         // Trigger failover by causing failures
         for _ in 0..6 {
[31m-            manager.record_prediction_result("event_test", false, 100, None).await;
[m[32m+            manager
[m[32m+                .record_prediction_result("event_test", false, 100, None)
[m[32m+                .await;
[m         }
 
         // Receive event
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:456:
         let avg_overhead_ns = total_overhead_ns / iterations;
         let avg_overhead_us = avg_overhead_ns as f64 / 1000.0;
 
[31m-        println!("Average metric recording overhead: {:.2}μs ({} ns)", avg_overhead_us, avg_overhead_ns);
[m[32m+        println!(
[m[32m+            "Average metric recording overhead: {:.2}μs ({} ns)",
[m[32m+            avg_overhead_us, avg_overhead_ns
[m[32m+        );
[m 
         // Wave 67 claimed <10μs overhead
[31m-        assert!(avg_overhead_us < 10.0,
[m[31m-            "Metric recording overhead {:.2}μs exceeds 10μs target", avg_overhead_us);
[m[32m+        assert!(
[m[32m+            avg_overhead_us < 10.0,
[m[32m+            "Metric recording overhead {:.2}μs exceeds 10μs target",
[m[32m+            avg_overhead_us
[m[32m+        );
[m     }
 
     #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:488:
         println!("Alert broadcast latency: {:?}", broadcast_latency);
 
         // Should be very fast (< 1ms for local broadcast)
[31m-        assert!(broadcast_latency < Duration::from_millis(1),
[m[31m-            "Alert broadcast took {:?}, expected <1ms", broadcast_latency);
[m[32m+        assert!(
[m[32m+            broadcast_latency < Duration::from_millis(1),
[m[32m+            "Alert broadcast took {:?}, expected <1ms",
[m[32m+            broadcast_latency
[m[32m+        );
[m     }
 
     #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:503:
 
         // Measure prediction with fallback latency
         let start = Instant::now();
[31m-        let _prediction = manager.predict_with_fallback(&features, Some("model_1".to_string())).await;
[m[32m+        let _prediction = manager
[m[32m+            .predict_with_fallback(&features, Some("model_1".to_string()))
[m[32m+            .await;
[m         let decision_latency = start.elapsed();
 
         println!("Failover decision latency: {:?}", decision_latency);
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:510:
 
         // Should be sub-millisecond for local operations
[31m-        assert!(decision_latency < Duration::from_millis(1),
[m[31m-            "Failover decision took {:?}, expected <1ms", decision_latency);
[m[32m+        assert!(
[m[32m+            decision_latency < Duration::from_millis(1),
[m[32m+            "Failover decision took {:?}, expected <1ms",
[m[32m+            decision_latency
[m[32m+        );
[m     }
 
     // ==================================================================================
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:523:
         let manager = create_test_fallback_manager().await;
 
         // Register models
[31m-        manager.register_model("integrated_model".to_string(), 100).await;
[m[32m+        manager
[m[32m+            .register_model("integrated_model".to_string(), 100)
[m[32m+            .await;
[m 
         // Make prediction
         let features = vec![0.05, 1500.0];
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:530:
[31m-        let prediction = manager.predict_with_fallback(&features, Some("integrated_model".to_string())).await;
[m[32m+        let prediction = manager
[m[32m+            .predict_with_fallback(&features, Some("integrated_model".to_string()))
[m[32m+            .await;
[m 
         // Record performance sample based on prediction
         let sample = ModelPerformanceSample {
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:559:
         let mut failover_receiver = manager.subscribe_failover_events();
 
         // Register models
[31m-        manager.register_model("failing_model".to_string(), 100).await;
[m[32m+        manager
[m[32m+            .register_model("failing_model".to_string(), 100)
[m[32m+            .await;
[m         manager.register_model("backup_model".to_string(), 50).await;
 
         // Simulate failures that trigger both alerts and failover
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:566:
         for _ in 0..6 {
             let sample = create_sample_with_latency("failing_model", 5000);
             monitor.record_sample(sample).await;
[31m-            manager.record_prediction_result("failing_model", false, 5000, Some(0.3)).await;
[m[32m+            manager
[m[32m+                .record_prediction_result("failing_model", false, 5000, Some(0.3))
[m[32m+                .await;
[m         }
 
         // Should receive both alert and failover event
Diff in /home/jgrusewski/Work/foxhunt/tests/ml_monitoring_integration.rs:573:
[31m-        let alert_result = tokio::time::timeout(Duration::from_millis(100), alert_receiver.recv()).await;
[m[31m-        let failover_result = tokio::time::timeout(Duration::from_millis(100), failover_receiver.recv()).await;
[m[32m+        let alert_result =
[m[32m+            tokio::time::timeout(Duration::from_millis(100), alert_receiver.recv()).await;
[m[32m+        let failover_result =
[m[32m+            tokio::time::timeout(Duration::from_millis(100), failover_receiver.recv()).await;
[m 
         assert!(alert_result.is_ok(), "Alert should be triggered");
         assert!(failover_result.is_ok(), "Failover should be triggered");
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:4:
 //! for critical components of the Foxhunt HFT system.
 #![allow(unused_crate_dependencies)]
 
[32m+use std::collections::HashMap;
[m use std::sync::atomic::{AtomicU64, Ordering};
 use std::sync::Arc;
 use std::time::Instant;
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:10:
[31m-use std::collections::HashMap;
[m use tokio::sync::RwLock;
 
 // Import common types
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:14:
[32m+use chrono::Utc;
[m use common::{OrderId, OrderSide, OrderStatus, OrderType, TimeInForce};
 use rust_decimal::Decimal;
[31m-use chrono::Utc;
[m 
 // Import trading engine modules with correct paths
[31m-use trading_engine::timing::{HardwareTimestamp, calibrate_tsc};
[m[31m-use trading_engine::simd::{SimdPriceOps, AlignedPrices, AlignedVolumes};
[m[31m-use trading_engine::lockfree::{LockFreeRingBuffer, HftMessage};
[m[32m+use trading_engine::lockfree::{HftMessage, LockFreeRingBuffer};
[m[32m+use trading_engine::simd::{AlignedPrices, AlignedVolumes, SimdPriceOps};
[m[32m+use trading_engine::timing::{calibrate_tsc, HardwareTimestamp};
[m use trading_engine::trading::order_manager::OrderManager;
 use trading_engine::trading_operations::TradingOrder;
 
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:85:
 
         // Generate test price data
         let prices: Vec<f64> = (0..ARRAY_SIZE).map(|i| 100.0 + (i as f64 * 0.01)).collect();
[31m-        let volumes: Vec<f64> = (0..ARRAY_SIZE).map(|i| 1000.0 + (i as f64 * 10.0)).collect();
[m[32m+        let volumes: Vec<f64> = (0..ARRAY_SIZE)
[m[32m+            .map(|i| 1000.0 + (i as f64 * 10.0))
[m[32m+            .collect();
[m 
         let aligned_prices = AlignedPrices::from_slice(&prices);
         let aligned_volumes = AlignedVolumes::from_slice(&volumes);
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:111:
         for _ in 0..ITERATIONS {
             let total_pv: f64 = prices.iter().zip(volumes.iter()).map(|(p, v)| p * v).sum();
             let total_volume: f64 = volumes.iter().sum();
[31m-            let vwap = if total_volume > 0.0 { total_pv / total_volume } else { 0.0 };
[m[32m+            let vwap = if total_volume > 0.0 {
[m[32m+                total_pv / total_volume
[m[32m+            } else {
[m[32m+                0.0
[m[32m+            };
[m             scalar_results.push(vwap);
         }
         let scalar_time = scalar_start.elapsed();
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:147:
         const NUM_MESSAGES: usize = 100_000;
 
         let ring_buffer = Arc::new(
[31m-            LockFreeRingBuffer::<HftMessage>::new(1_000_000)
[m[31m-                .expect("Failed to create ring buffer")
[m[32m+            LockFreeRingBuffer::<HftMessage>::new(1_000_000).expect("Failed to create ring buffer"),
[m         );
         let start_time = Instant::now();
         let processed_count = Arc::new(AtomicU64::new(0));
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:198:
 
         println!("Lock-Free Ring Buffer Performance:");
         println!("  Total messages: {}", NUM_MESSAGES);
[31m-        println!("  Produced: {}, Consumed: {}", total_produced, total_consumed);
[m[32m+        println!(
[m[32m+            "  Produced: {}, Consumed: {}",
[m[32m+            total_produced, total_consumed
[m[32m+        );
[m         println!("  Processing time: {:?}", total_time);
         println!("  Throughput: {:.0} messages/sec", throughput);
 
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:239:
                     let order = TradingOrder {
                         id: OrderId::from(format!("TRADER{:03}_{:06}", trader_id, order_id)),
                         symbol: format!("SYMBOL{:02}", order_id % 10),
[31m-                        side: if order_id % 2 == 0 { OrderSide::Buy } else { OrderSide::Sell },
[m[32m+                        side: if order_id % 2 == 0 {
[m[32m+                            OrderSide::Buy
[m[32m+                        } else {
[m[32m+                            OrderSide::Sell
[m[32m+                        },
[m                         order_type: OrderType::Limit,
                         quantity: Decimal::from((order_id + 1) * 1000),
                         price: Decimal::new(10000 + order_id as i64, 4), // e.g. 1.0001
Diff in /home/jgrusewski/Work/foxhunt/tests/performance_and_stress_tests.rs:370:
     TradingOrder {
         id: OrderId::from(format!("TEST_ORDER_{:06}", id)),
         symbol: "EURUSD".to_string(),
[31m-        side: if id % 2 == 0 { OrderSide::Buy } else { OrderSide::Sell },
[m[32m+        side: if id % 2 == 0 {
[m[32m+            OrderSide::Buy
[m[32m+        } else {
[m[32m+            OrderSide::Sell
[m[32m+        },
[m         order_type: OrderType::Limit,
         quantity: Decimal::from((id + 1) * 1000),
         price: Decimal::new(12345 + id as i64, 4), // 1.2345 + small increment
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/regulatory_compliance_tests.rs:16:
 
 use risk::error::RiskResult;
 use risk::risk_types::KillSwitchScope;
[31m-use risk::safety::KillSwitchConfig;
[m use risk::safety::kill_switch::AtomicKillSwitch;
 use risk::safety::trading_gate::TradingGate;
[31m-use risk::safety::unix_socket_kill_switch::{UnixSocketKillSwitch, KillSwitchCommand};
[m[32m+use risk::safety::unix_socket_kill_switch::{KillSwitchCommand, UnixSocketKillSwitch};
[m[32m+use risk::safety::KillSwitchConfig;
[m 
 /// Regulatory compliance test suite
 pub struct RegulatoryComplianceTests {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/regulatory_submission_tests.rs:3:
 #![allow(unused_crate_dependencies)]
 
 use chrono::{DateTime, Duration, Utc};
[32m+use common::{OrderId, OrderSide, OrderType, Price, Quantity};
[m use std::collections::HashMap;
 use tokio;
 use trading_engine::compliance::*;
Diff in /home/jgrusewski/Work/foxhunt/tests/regulatory_submission_tests.rs:9:
[31m-use common::{OrderId, OrderSide, OrderType, Price, Quantity};
[m 
 #[tokio::test]
 async fn test_mifid_ii_rts22_report_generation() {
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/risk_validation_tests.rs:10:
 #![allow(unused_crate_dependencies)]
 
 use chrono::Utc;
[31m-use rust_decimal::Decimal;
[m use rust_decimal::prelude::FromStr;
[32m+use rust_decimal::Decimal;
[m use uuid::Uuid;
 
 // Common types from foxhunt ecosystem
Diff in /home/jgrusewski/Work/foxhunt/tests/risk_validation_tests.rs:35:
     let price_decimal = Decimal::try_from(price).unwrap_or(Decimal::ZERO);
 
     OrderInfo {
[31m-        order_id: format!("test_order_{}", Utc::now().timestamp_nanos_opt().unwrap_or(0)),
[m[32m+        order_id: format!(
[m[32m+            "test_order_{}",
[m[32m+            Utc::now().timestamp_nanos_opt().unwrap_or(0)
[m[32m+        ),
[m         symbol: Symbol::from(symbol),
         instrument_id: format!("inst_{}", symbol),
         side: OrderSide::Buy,
Diff in /home/jgrusewski/Work/foxhunt/tests/risk_validation_tests.rs:42:
[31m-        quantity: quantity_decimal.try_into().unwrap_or(common::Quantity::ZERO),
[m[32m+        quantity: quantity_decimal
[m[32m+            .try_into()
[m[32m+            .unwrap_or(common::Quantity::ZERO),
[m         price: price_decimal.into(),
         order_type: Some(OrderType::Market),
         portfolio_id: Some(TEST_PORTFOLIO_ID.to_string()),
Diff in /home/jgrusewski/Work/foxhunt/tests/risk_validation_tests.rs:117:
         resolved: false,
     };
 
[31m-    assert_eq!(violation.violation_type, ViolationType::PositionSizeExceeded);
[m[32m+    assert_eq!(
[m[32m+        violation.violation_type,
[m[32m+        ViolationType::PositionSizeExceeded
[m[32m+    );
[m     assert_eq!(violation.severity, risk::risk_types::RiskSeverity::High);
     assert!(!violation.resolved);
     assert!(violation.current_value.is_some());
Diff in /home/jgrusewski/Work/foxhunt/tests/risk_validation_tests.rs:145:
     // All types should have string representations
     for vtype in violation_types {
         let s = format!("{}", vtype);
[31m-        assert!(!s.is_empty(), "Violation type should have string representation");
[m[32m+        assert!(
[m[32m+            !s.is_empty(),
[m[32m+            "Violation type should have string representation"
[m[32m+        );
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/tests/risk_validation_tests.rs:379:
     let elapsed = start.elapsed();
 
     // Should complete in under 100ms
[31m-    assert!(elapsed.as_millis() < 100, "Order creation too slow: {:?}", elapsed);
[m[32m+    assert!(
[m[32m+        elapsed.as_millis() < 100,
[m[32m+        "Order creation too slow: {:?}",
[m[32m+        elapsed
[m[32m+    );
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/tests/risk_validation_tests.rs:407:
     let elapsed = start.elapsed();
 
     // Should complete in under 100ms
[31m-    assert!(elapsed.as_millis() < 100, "Violation creation too slow: {:?}", elapsed);
[m[32m+    assert!(
[m[32m+        elapsed.as_millis() < 100,
[m[32m+        "Violation creation too slow: {:?}",
[m[32m+        elapsed
[m[32m+    );
[m }
 
 #[test]
Diff in /home/jgrusewski/Work/foxhunt/tests/risk_validation_tests.rs:422:
     let elapsed = start.elapsed();
 
     // Should be able to create 100 engines quickly
[31m-    assert!(elapsed.as_millis() < 500, "VaR engine creation too slow: {:?}", elapsed);
[m[32m+    assert!(
[m[32m+        elapsed.as_millis() < 500,
[m[32m+        "VaR engine creation too slow: {:?}",
[m[32m+        elapsed
[m[32m+    );
[m     assert_eq!(engines.len(), 100);
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/run_comprehensive_tests.rs:1:
 //! DISABLED: This test depends on framework and integration modules that are currently disabled.
 //! See tests/lib.rs for details.
[31m-//! 
[m[32m+//!
[m //! To re-enable: Uncomment this file and enable the framework and integration modules in tests/lib.rs
 
 #![allow(unused)]
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tests/test_runner.rs:31:
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         match self {
             SafeTestError::Message(msg) => write!(f, "{}", msg),
[31m-            SafeTestError::Timeout { operation, timeout_ms } => {
[m[31m-                write!(f, "Operation '{}' timed out after {}ms", operation, timeout_ms)
[m[31m-            }
[m[32m+            SafeTestError::Timeout {
[m[32m+                operation,
[m[32m+                timeout_ms,
[m[32m+            } => {
[m[32m+                write!(
[m[32m+                    f,
[m[32m+                    "Operation '{}' timed out after {}ms",
[m[32m+                    operation, timeout_ms
[m[32m+                )
[m[32m+            },
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/tests/test_runner.rs:454:
             .run_single_test("simd_price_calculations", || async {
                 self.performance_monitor
                     .record_metric("simd_vwap_latency", 800.0);
[31m-                self.performance_monitor
[m[31m-                    .record_metric("simd_speedup", 3.2);
[m[32m+                self.performance_monitor.record_metric("simd_speedup", 3.2);
[m                 Ok(())
             })
             .await
Diff in /home/jgrusewski/Work/foxhunt/tests/test_runner.rs:826:
         // Test false sharing impact
         if self
             .run_single_test("false_sharing_impact", || async {
[31m-                self.performance_monitor
[m[31m-                    .record_metric("cache_speedup", 2.3);
[m[32m+                self.performance_monitor.record_metric("cache_speedup", 2.3);
[m                 Ok(())
             })
             .await
Diff in /home/jgrusewski/Work/foxhunt/tests/test_runner.rs:841:
         // Test SoA vs AoS performance
         if self
             .run_single_test("soa_vs_aos_performance", || async {
[31m-                self.performance_monitor
[m[31m-                    .record_metric("soa_speedup", 1.8);
[m[32m+                self.performance_monitor.record_metric("soa_speedup", 1.8);
[m                 Ok(())
             })
             .await
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tli/examples/config_management_placeholder.rs:4:
 //! Full TLI client functionality is not yet implemented
 #![allow(unused_crate_dependencies)]
 
[31m-
[m #[tokio::main]
 async fn main() -> Result<(), Box<dyn std::error::Error>> {
     println!("🔧 Configuration Management Demo (PLACEHOLDER)");
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/interceptor.rs:34:
             let bearer_token = format!("Bearer {}", access_token);
 
             // Parse as metadata value
[31m-            let token_value = bearer_token
[m[31m-                .parse::<MetadataValue<_>>()
[m[31m-                .map_err(|e| {
[m[31m-                    tracing::error!("Failed to parse JWT as metadata value: {}", e);
[m[31m-                    Status::internal("Invalid token format")
[m[31m-                })?;
[m[32m+            let token_value = bearer_token.parse::<MetadataValue<_>>().map_err(|e| {
[m[32m+                tracing::error!("Failed to parse JWT as metadata value: {}", e);
[m[32m+                Status::internal("Invalid token format")
[m[32m+            })?;
[m 
             // Add to request metadata
             request.metadata_mut().insert("authorization", token_value);
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/login.rs:65:
 /// Login client for API Gateway authentication
 pub struct LoginClient {
     /// API Gateway gRPC channel
[31m-    #[allow(dead_code)]  // Will be used when API Gateway gRPC endpoints are implemented
[m[32m+    #[allow(dead_code)] // Will be used when API Gateway gRPC endpoints are implemented
[m     gateway_channel: Channel,
 }
 
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/login.rs:98:
 
         // Attempt login
         let _login_request = LoginRequest { username, password };
[31m-        
[m[32m+
[m         // TODO: Call API Gateway login endpoint via gRPC
         // For now, simulate a successful login response
         tracing::warn!("Using simulated login response (API Gateway gRPC not yet implemented)");
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/login.rs:146:
             session_id: session_id.to_string(),
             totp_code,
         };
[31m-        
[m[32m+
[m         // TODO: Call API Gateway MFA endpoint via gRPC
         tracing::warn!("Using simulated MFA response (API Gateway gRPC not yet implemented)");
 
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/login.rs:175:
             .context("No refresh token available")?;
 
         let _refresh_request = RefreshRequest { refresh_token };
[31m-        
[m[32m+
[m         // TODO: Call API Gateway refresh endpoint via gRPC
         tracing::warn!("Using simulated refresh response (API Gateway gRPC not yet implemented)");
 
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/login.rs:185:
         auth_manager
             .update_tokens(response.access_token.clone(), response.expires_at)
             .await?;
[31m-        
[m[32m+
[m         // If new refresh token provided (token rotation), update storage
         // We need to manually update the refresh token in the current token info
         if let Some(new_refresh) = response.refresh_token {
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/login.rs:219:
                 Ok(()) => {
                     tracing::info!("Silent login successful");
                     Ok(true)
[31m-                }
[m[32m+                },
[m                 Err(e) => {
[31m-                    tracing::warn!("Silent login failed: {} - will require interactive login", e);
[m[32m+                    tracing::warn!(
[m[32m+                        "Silent login failed: {} - will require interactive login",
[m[32m+                        e
[m[32m+                    );
[m                     Ok(false)
[31m-                }
[m[32m+                },
[m             }
         } else {
             tracing::info!("No stored refresh token - interactive login required");
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/login.rs:290:
 
     #[tokio::test]
     async fn test_silent_login_without_refresh_token() {
[31m-        let channel = Channel::from_static("https://localhost:50050")
[m[31m-            .connect_lazy();
[m[32m+        let channel = Channel::from_static("https://localhost:50050").connect_lazy();
[m         let client = LoginClient::new(channel);
 
         let storage = InMemoryTokenStorage::new();
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/mod.rs:3:
 //! Provides JWT-based authentication for TLI connections to the API Gateway,
 //! including secure token storage, automatic refresh, and gRPC interceptors.
 
[31m-pub mod token_manager;
[m pub mod interceptor;
 pub mod login;
[32m+pub mod token_manager;
[m 
[31m-pub use token_manager::{AuthTokenManager, TokenStorage};
[m pub use interceptor::AuthInterceptor;
 pub use login::{LoginClient, LoginRequest, LoginResponse, MfaRequest};
[32m+pub use token_manager::{AuthTokenManager, TokenStorage};
[m 
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/token_manager.rs:134:
                 Ok(()) => {
                     tracing::info!("Refresh token removed from OS keyring");
                     Ok(())
[31m-                }
[m[32m+                },
[m                 Err(keyring::Error::NoEntry) => Ok(()), // Already deleted
                 Err(e) => Err(anyhow::anyhow!("Failed to remove refresh token: {}", e)),
             }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/auth/token_manager.rs:303:
 
             tracing::info!("Access token updated after refresh");
         } else {
[31m-            return Err(anyhow::anyhow!("Cannot update tokens - no current token info"));
[m[32m+            return Err(anyhow::anyhow!(
[m[32m+                "Cannot update tokens - no current token info"
[m[32m+            ));
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/backtesting_client.rs:33:
     /// All requests now route through the API Gateway for centralized authentication.
     fn default() -> Self {
         Self {
[31m-            endpoint: "https://localhost:50050".to_string(),  // API Gateway endpoint
[m[32m+            endpoint: "https://localhost:50050".to_string(), // API Gateway endpoint
[m             timeout_ms: 60_000,
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/backtesting_client.rs:143:
     /// The client can be reconnected after shutdown by calling `connect()`.
     pub async fn shutdown(&mut self) {
         if self.channel.is_some() {
[31m-            tracing::info!("Shutting down backtesting client connection to {}", self.config.endpoint);
[m[32m+            tracing::info!(
[m[32m+                "Shutting down backtesting client connection to {}",
[m[32m+                self.config.endpoint
[m[32m+            );
[m         }
         self.channel = None;
     }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/backtesting_client.rs:156:
     #[test]
     fn test_default_uses_https() {
         let config = BacktestingClientConfig::default();
[31m-        assert!(config.endpoint.starts_with("https://"), "Default config must use HTTPS");
[m[32m+        assert!(
[m[32m+            config.endpoint.starts_with("https://"),
[m[32m+            "Default config must use HTTPS"
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/connection_manager.rs:33:
         // SECURITY: Default to HTTPS, not HTTP
         // Wave 71: Connect to API Gateway instead of direct service endpoints
         Self {
[31m-            server_url: "https://localhost:50050".to_string(),  // API Gateway endpoint
[m[32m+            server_url: "https://localhost:50050".to_string(), // API Gateway endpoint
[m             auth_token: None,
             timeout_ms: 10000,
             max_retries: 3,
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/ml_training_client.rs:33:
     /// All requests now route through the API Gateway for centralized authentication.
     fn default() -> Self {
         Self {
[31m-            endpoint: "https://localhost:50050".to_string(),  // API Gateway endpoint
[m[32m+            endpoint: "https://localhost:50050".to_string(), // API Gateway endpoint
[m             timeout_ms: 120_000,
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/ml_training_client.rs:142:
     /// The client can be reconnected after shutdown by calling `connect()`.
     pub async fn shutdown(&mut self) {
         if self.channel.is_some() {
[31m-            tracing::info!("Shutting down ML training client connection to {}", self.config.endpoint);
[m[32m+            tracing::info!(
[m[32m+                "Shutting down ML training client connection to {}",
[m[32m+                self.config.endpoint
[m[32m+            );
[m         }
         self.channel = None;
     }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/ml_training_client.rs:205:
     #[test]
     fn test_default_uses_https() {
         let config = MLTrainingClientConfig::default();
[31m-        assert!(config.endpoint.starts_with("https://"), "Default config must use HTTPS");
[m[32m+        assert!(
[m[32m+            config.endpoint.starts_with("https://"),
[m[32m+            "Default config must use HTTPS"
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/mod.rs:48:
     /// The API Gateway handles routing to backend services based on gRPC service names.
     pub fn localhost() -> Self {
         Self {
[31m-            trading_engine: "https://localhost:50050".to_string(),       // API Gateway
[m[31m-            market_data: "https://localhost:50050".to_string(),          // API Gateway
[m[31m-            backtesting_service: "https://localhost:50050".to_string(),  // API Gateway
[m[31m-            ml_training_service: "https://localhost:50050".to_string(),  // API Gateway
[m[32m+            trading_engine: "https://localhost:50050".to_string(), // API Gateway
[m[32m+            market_data: "https://localhost:50050".to_string(),    // API Gateway
[m[32m+            backtesting_service: "https://localhost:50050".to_string(), // API Gateway
[m[32m+            ml_training_service: "https://localhost:50050".to_string(), // API Gateway
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/trading_client.rs:32:
     /// All requests now route through the API Gateway for centralized authentication.
     fn default() -> Self {
         Self {
[31m-            endpoint: "https://localhost:50050".to_string(),  // API Gateway endpoint
[m[32m+            endpoint: "https://localhost:50050".to_string(), // API Gateway endpoint
[m             timeout_ms: 30_000,
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/trading_client.rs:141:
     /// The client can be reconnected after shutdown by calling `connect()`.
     pub async fn shutdown(&mut self) {
         if self.channel.is_some() {
[31m-            tracing::info!("Shutting down trading client connection to {}", self.config.endpoint);
[m[32m+            tracing::info!(
[m[32m+                "Shutting down trading client connection to {}",
[m[32m+                self.config.endpoint
[m[32m+            );
[m         }
         self.channel = None;
     }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/client/trading_client.rs:154:
     #[test]
     fn test_default_uses_https() {
         let config = TradingClientConfig::default();
[31m-        assert!(config.endpoint.starts_with("https://"), "Default config must use HTTPS");
[m[32m+        assert!(
[m[32m+            config.endpoint.starts_with("https://"),
[m[32m+            "Default config must use HTTPS"
[m[32m+        );
[m     }
 
     #[test]
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboard/events.rs:35:
     ShowHelp(String),
 
     // Configuration events
[31m-    ConfigChanged { category: String, key: String },
[m[32m+    ConfigChanged {
[m[32m+        category: String,
[m[32m+        key: String,
[m[32m+    },
[m     ConfigReloaded,
     ConfigUpdateRequest(ConfigUpdateRequest),
     ConfigUpdate {
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:335:
                     match client.get_configuration(config_request).await {
                         Ok(response) => {
                             let settings = response.into_inner().settings;
[31m-                            let _ = event_sender.send(DashboardEvent::ConfigUpdate {
[m[31m-                                category_id,
[m[31m-                                settings,
[m[31m-                            }).await;
[m[31m-                        }
[m[32m+                            let _ = event_sender
[m[32m+                                .send(DashboardEvent::ConfigUpdate {
[m[32m+                                    category_id,
[m[32m+                                    settings,
[m[32m+                                })
[m[32m+                                .await;
[m[32m+                        },
[m                         Err(e) => {
                             tracing::error!("Failed to load category settings: {}", e);
[31m-                        }
[m[32m+                        },
[m                     }
                 });
             }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:815:
             },
             KeyCode::Char('r') if key.modifiers.contains(KeyModifiers::NONE) => {
                 // Reset to default
[31m-                if let (Some(setting_key), Some(client)) =
[m[31m-                    (self.selection.setting_key.clone(), self.config_client.clone())
[m[31m-                {
[m[32m+                if let (Some(setting_key), Some(client)) = (
[m[32m+                    self.selection.setting_key.clone(),
[m[32m+                    self.config_client.clone(),
[m[32m+                ) {
[m                     let event_sender = self._event_sender.clone();
                     tokio::spawn(async move {
                         let mut client = client;
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:842:
                                 if response.into_inner().success {
                                     let _ = event_sender.send(DashboardEvent::RefreshConfig).await;
                                 }
[31m-                            }
[m[32m+                            },
[m                             Err(e) => {
                                 tracing::error!("Failed to reset to default: {}", e);
[31m-                            }
[m[32m+                            },
[m                         }
                     });
                 }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:882:
                                         })
                                         .await;
                                 }
[31m-                            }
[m[32m+                            },
[m                             Err(e) => {
                                 tracing::error!("Failed to refresh configuration: {}", e);
[31m-                            }
[m[32m+                            },
[m                         }
                     });
                 }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:906:
                     self.selection.flat_settings = settings;
                     self.needs_redraw = true;
                 }
[31m-            }
[m[32m+            },
[m             DashboardEvent::ConfigSearchResults { results } => {
                 self.search_state.results = results;
                 self.search_state.selected_result = 0;
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:913:
                 self.needs_redraw = true;
[31m-            }
[m[31m-            _ => {}
[m[32m+            },
[m[32m+            _ => {},
[m         }
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:1346:
                         let _ = event_sender
                             .send(DashboardEvent::ConfigSearchResults { results })
                             .await;
[31m-                    }
[m[32m+                    },
[m                     Err(e) => {
                         tracing::error!("Search failed: {}", e);
[31m-                    }
[m[32m+                    },
[m                 }
             });
         }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:1395:
             },
             KeyCode::Char('s') if key.modifiers.contains(KeyModifiers::CONTROL) => {
                 // Save changes - call the existing async save_edit method
[31m-                if let (Some(setting_key), Some(mut client)) =
[m[31m-                    (self.selection.setting_key.clone(), self.config_client.clone())
[m[31m-                {
[m[32m+                if let (Some(setting_key), Some(mut client)) = (
[m[32m+                    self.selection.setting_key.clone(),
[m[32m+                    self.config_client.clone(),
[m[32m+                ) {
[m                     let edit_buffer = self.edit_state.edit_buffer.clone();
                     let event_sender = self._event_sender.clone();
 
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:1424:
                                 if response.into_inner().success {
                                     let _ = event_sender.send(DashboardEvent::RefreshConfig).await;
                                 }
[31m-                            }
[m[32m+                            },
[m                             Err(e) => {
                                 tracing::error!("Failed to save configuration: {}", e);
[31m-                            }
[m[32m+                            },
[m                         }
                     });
                 }
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:1435:
             },
             KeyCode::Char('v') if key.modifiers.contains(KeyModifiers::CONTROL) => {
                 // Validate - call the existing async validate_current_edit method
[31m-                if let (Some(setting_key), Some(mut client)) =
[m[31m-                    (self.selection.setting_key.clone(), self.config_client.clone())
[m[31m-                {
[m[32m+                if let (Some(setting_key), Some(mut client)) = (
[m[32m+                    self.selection.setting_key.clone(),
[m[32m+                    self.config_client.clone(),
[m[32m+                ) {
[m                     let edit_buffer = self.edit_state.edit_buffer.clone();
 
                     tokio::spawn(async move {
Diff in /home/jgrusewski/Work/foxhunt/tli/src/dashboards/configuration.rs:1459:
                                     validation_response.errors.len(),
                                     validation_response.warnings.len()
                                 );
[31m-                            }
[m[32m+                            },
[m                             Err(e) => {
                                 tracing::error!("Validation failed: {}", e);
[31m-                            }
[m[32m+                            },
[m                         }
                     });
                 }
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/performance_tests.rs:9:
 //! 3. Focus on gRPC client performance metrics
 //! 4. Update config field references to match current TradingClientConfig
 
[31m-
[m #[test]
 fn performance_tests_disabled() {
     // Tests disabled pending refactoring
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/property_tests.rs:9:
 //! 3. Focus on gRPC message validation properties
 //! 4. Update config field references to match current client configs
 
[31m-
[m #[test]
 fn property_tests_disabled() {
     // Tests disabled pending refactoring
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/test_monitoring.rs:9:
 //! 3. Focus on client-side metrics and monitoring
 //! 4. Update config field references to match current client configs
 
[31m-
[m #[test]
 fn monitoring_tests_disabled() {
     // Tests disabled pending refactoring
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/unit_tests.rs:9:
 //! 3. Use actual TradingClientConfig fields (endpoint, timeout_ms)
 //! 4. Remove database-related tests (TLI is pure client)
 
[31m-
[m #[test]
 fn unit_tests_disabled() {
     // Tests disabled pending refactoring
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/performance_tests.rs:9:
 //! 3. Focus on gRPC client performance metrics
 //! 4. Update config field references to match current TradingClientConfig
 
[31m-
[m #[test]
 fn performance_tests_disabled() {
     // Tests disabled pending refactoring
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/property_tests.rs:9:
 //! 3. Focus on gRPC message validation properties
 //! 4. Update config field references to match current client configs
 
[31m-
[m #[test]
 fn property_tests_disabled() {
     // Tests disabled pending refactoring
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/test_monitoring.rs:9:
 //! 3. Focus on client-side metrics and monitoring
 //! 4. Update config field references to match current client configs
 
[31m-
[m #[test]
 fn monitoring_tests_disabled() {
     // Tests disabled pending refactoring
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:14:
 use anyhow::{Context, Result};
 use std::time::{SystemTime, UNIX_EPOCH};
 use tli::auth::{
[31m-    AuthInterceptor, AuthTokenManager, LoginClient, TokenStorage,
[m     token_manager::{InMemoryTokenStorage, KeyringTokenStorage, TokenInfo},
[32m+    AuthInterceptor, AuthTokenManager, LoginClient, TokenStorage,
[m };
 use tonic::service::Interceptor;
 use tonic::transport::Channel;
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:115:
 
     manager.set_tokens(valid_token).await?;
 
[31m-    assert!(
[m[31m-        manager.has_valid_token().await,
[m[31m-        "Token should be valid"
[m[31m-    );
[m[32m+    assert!(manager.has_valid_token().await, "Token should be valid");
[m     println!("✓ Token correctly identified as valid");
 
     Ok(())
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:165:
     let auth_value = auth_header.unwrap().to_str().unwrap();
     assert_eq!(auth_value, "Bearer grpc_test_token");
 
[31m-    println!("✓ gRPC interceptor added Authorization header: {}", auth_value);
[m[32m+    println!(
[m[32m+        "✓ gRPC interceptor added Authorization header: {}",
[m[32m+        auth_value
[m[32m+    );
[m 
     // Test interceptor without token
     manager.clear_tokens().await?;
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:174:
     let request_no_token = Request::new(());
 
     let result_no_token = interceptor_no_token.call(request_no_token);
[31m-    assert!(result_no_token.is_ok(), "Request without token should still succeed");
[m[32m+    assert!(
[m[32m+        result_no_token.is_ok(),
[m[32m+        "Request without token should still succeed"
[m[32m+    );
[m 
     let unauthenticated_request = result_no_token.unwrap();
     let auth_header_missing = unauthenticated_request.metadata().get("authorization");
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:195:
 async fn test_keyring_token_storage() -> Result<()> {
     println!("\n=== Test: OS Keyring Token Storage ===");
 
[31m-    let storage = KeyringTokenStorage::new(
[m[31m-        "foxhunt-tli-test".to_string(),
[m[31m-        "test_user".to_string(),
[m[31m-    );
[m[32m+    let storage = KeyringTokenStorage::new("foxhunt-tli-test".to_string(), "test_user".to_string());
[m 
     // Clear any existing tokens
     let _ = storage.remove_refresh_token();
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:231:
         .context("Failed to retrieve refresh token from keyring")?;
 
     assert_eq!(refresh_token, "keyring_refresh_token_secure");
[31m-    println!("✓ Refresh token retrieved from OS keyring: {}", refresh_token);
[m[32m+    println!(
[m[32m+        "✓ Refresh token retrieved from OS keyring: {}",
[m[32m+        refresh_token
[m[32m+    );
[m 
     // Clean up
     manager.clear_tokens().await?;
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:238:
 
     let cleared_token = manager.get_refresh_token().await?;
[31m-    assert!(cleared_token.is_none(), "Token should be cleared from keyring");
[m[32m+    assert!(
[m[32m+        cleared_token.is_none(),
[m[32m+        "Token should be cleared from keyring"
[m[32m+    );
[m 
     println!("✓ Tokens cleared from OS keyring");
 
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:280:
     // Attempt silent login (will use simulated response)
     let result = login_client.silent_login(&manager).await?;
 
[31m-    assert!(result, "Silent login should succeed with stored refresh token");
[m[32m+    assert!(
[m[32m+        result,
[m[32m+        "Silent login should succeed with stored refresh token"
[m[32m+    );
[m     println!("✓ Silent login succeeded (using simulated API Gateway response)");
 
     // Verify token was refreshed
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:336:
         "Access token should be updated"
     );
 
[31m-    println!("✓ New access token: {}", manager.get_access_token().await.unwrap());
[m[32m+    println!(
[m[32m+        "✓ New access token: {}",
[m[32m+        manager.get_access_token().await.unwrap()
[m[32m+    );
[m 
     Ok(())
 }
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:378:
     println!("  Connection errors: {}", stats.connection_errors);
 
     // Disconnect
[31m-    manager.disconnect().await
[m[32m+    manager
[m[32m+        .disconnect()
[m[32m+        .await
[m         .map_err(|e| anyhow::anyhow!("Failed to disconnect: {}", e))?;
     println!("✓ Disconnected from API Gateway");
 
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:391:
     println!("\n=== Test: TLI Client Builder ===");
 
     use tli::client::{
[31m-        backtesting_client::BacktestingClientConfig,
[m[31m-        connection_manager::ConnectionConfig,
[m[31m-        ml_training_client::MLTrainingClientConfig,
[m[31m-        trading_client::TradingClientConfig,
[m[32m+        backtesting_client::BacktestingClientConfig, connection_manager::ConnectionConfig,
[m[32m+        ml_training_client::MLTrainingClientConfig, trading_client::TradingClientConfig,
[m         TliClientBuilder,
     };
 
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:428:
     let client_suite = builder.build().await?;
 
     println!("✓ TLI client suite built successfully");
[31m-    println!("  Trading client: {}", client_suite.trading_client.is_some());
[m[31m-    println!("  Backtesting client: {}", client_suite.backtesting_client.is_some());
[m[31m-    println!("  ML Training client: {}", client_suite.ml_training_client.is_some());
[m[32m+    println!(
[m[32m+        "  Trading client: {}",
[m[32m+        client_suite.trading_client.is_some()
[m[32m+    );
[m[32m+    println!(
[m[32m+        "  Backtesting client: {}",
[m[32m+        client_suite.backtesting_client.is_some()
[m[32m+    );
[m[32m+    println!(
[m[32m+        "  ML Training client: {}",
[m[32m+        client_suite.ml_training_client.is_some()
[m[32m+    );
[m 
     // Shutdown
     client_suite.shutdown().await;
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:504:
     let authenticated_request = interceptor.call(request)?;
     let auth_header = authenticated_request.metadata().get("authorization");
 
[31m-    assert!(auth_header.is_some(), "Authorization header should be present");
[m[32m+    assert!(
[m[32m+        auth_header.is_some(),
[m[32m+        "Authorization header should be present"
[m[32m+    );
[m     println!("✓ Step 4: gRPC interceptor added JWT Bearer token");
 
     // 6. Simulate token refresh before expiration
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/tli_auth_integration_test.rs:512:
     println!("✓ Step 5: Token refreshed successfully");
 
     // 7. Verify new token is valid
[31m-    assert!(manager.has_valid_token().await, "Refreshed token should be valid");
[m[32m+    assert!(
[m[32m+        manager.has_valid_token().await,
[m[32m+        "Refreshed token should be valid"
[m[32m+    );
[m     println!("✓ Step 6: Refreshed token validated");
 
     // 8. Logout (clear tokens)
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/tli/tests/unit_tests.rs:9:
 //! 3. Use actual TradingClientConfig fields (endpoint, timeout_ms)
 //! 4. Remove database-related tests (TLI is pure client)
 
[31m-
[m #[test]
 fn unit_tests_disabled() {
     // Tests disabled pending refactoring
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading-data/src/executions.rs:809:
             .and_utc();
         let end_date = date
             .succ_opt()
[31m-            .ok_or_else(|| crate::RepositoryError::Validation("Date overflow computing next day".into()))?
[m[32m+            .ok_or_else(|| {
[m[32m+                crate::RepositoryError::Validation("Date overflow computing next day".into())
[m[32m+            })?
[m             .and_hms_opt(0, 0, 0)
             .expect("Valid time (0, 0, 0) should never fail")
             .and_utc();
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:5:
 use crate::trading::data_interface::{BrokerConnectionStatus, BrokerError, BrokerInterface};
 use crate::trading_operations::TradingOrder;
 use async_trait::async_trait;
[32m+use chrono::Utc;
[m use common::OrderStatus;
 use common::{Execution as ExecutionReport, Position};
 use serde::{Deserialize, Serialize};
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:11:
 use std::collections::HashMap;
 use std::sync::atomic::{AtomicU64, Ordering};
[31m-use chrono::Utc;
[m 
 /// `ICMarkets` configuration
 #[derive(Debug, Clone, Serialize, Deserialize)]
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:243:
     pub fn parse(raw: &str) -> Result<Self, String> {
         let mut fields = HashMap::new();
         let mut msg_type_raw = String::new();
[31m-        
[m[32m+
[m         // Split by SOH delimiter (0x01)
         for field in raw.split('\u{0001}') {
             if field.is_empty() {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:250:
                 continue;
             }
[31m-            
[m[32m+
[m             let parts: Vec<&str> = field.split('=').collect();
             if parts.len() != 2 {
                 continue;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:256:
             }
[31m-            
[m[32m+
[m             if let Ok(tag) = parts[0].parse::<u32>() {
                 let value = parts[1].to_string();
[31m-                
[m[32m+
[m                 // Capture message type (tag 35)
                 if tag == 35 {
                     msg_type_raw = value.clone();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:264:
                 }
[31m-                
[m[32m+
[m                 fields.insert(tag, value);
             }
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:269:
[31m-        
[m[32m+
[m         let msg_type = FixMessageType::from_str(&msg_type_raw);
[31m-        
[m[32m+
[m         Ok(Self {
             msg_type,
             msg_type_raw,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:321:
     /// Build the FIX message string
     pub fn build(self) -> String {
         let mut msg = String::new();
[31m-        
[m[32m+
[m         // Standard header
         msg.push_str("8=FIX.4.4\u{0001}"); // BeginString
         msg.push_str(&format!("35={}\u{0001}", self.msg_type.as_str())); // MsgType
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:328:
         msg.push_str(&format!("49={}\u{0001}", self.sender_comp_id)); // SenderCompID
         msg.push_str(&format!("56={}\u{0001}", self.target_comp_id)); // TargetCompID
         msg.push_str(&format!("34={}\u{0001}", self.msg_seq_num)); // MsgSeqNum
[31m-        msg.push_str(&format!("52={}\u{0001}", Utc::now().format("%Y%m%d-%H:%M:%S"))); // SendingTime
[m[31m-        
[m[32m+        msg.push_str(&format!(
[m[32m+            "52={}\u{0001}",
[m[32m+            Utc::now().format("%Y%m%d-%H:%M:%S")
[m[32m+        )); // SendingTime
[m[32m+
[m         // Add custom fields
         for (tag, value) in &self.fields {
             msg.push_str(&format!("{}={}\u{0001}", tag, value));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:336:
         }
[31m-        
[m[32m+
[m         // Checksum placeholder (tag 10)
         msg.push_str("10=");
[31m-        
[m[32m+
[m         msg
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/brokers/icmarkets.rs:375:
             self.incoming_seq.fetch_add(1, Ordering::SeqCst);
             Ok(())
         } else {
[31m-            Err(format!("Sequence gap: expected {}, got {}", expected, seq_num))
[m[32m+            Err(format!(
[m[32m+                "Sequence gap: expected {}, got {}",
[m[32m+                expected, seq_num
[m[32m+            ))
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:11:
 use serde::{Deserialize, Serialize};
 use sha2::{Digest, Sha256};
 use std::collections::HashMap;
[31m-use std::sync::Arc;
[m use std::sync::atomic::AtomicU64;
[31m-use tokio::sync::RwLock;
[m[32m+use std::sync::Arc;
[m use tokio::sync::mpsc;
[32m+use tokio::sync::RwLock;
[m 
 use rust_decimal::Decimal;
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:313:
     ///
     /// Returns immediately after queuing (<10μs P99)
     pub fn submit(&self, event: TransactionAuditEvent) -> Result<(), AuditTrailError> {
[31m-        self.sender.send(event)
[m[32m+        self.sender
[m[32m+            .send(event)
[m             .map_err(|_| AuditTrailError::BufferFull)?;
[31m-        self.queued_events.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
[m[32m+        self.queued_events
[m[32m+            .fetch_add(1, std::sync::atomic::Ordering::Relaxed);
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:345:
                 flush_interval_ms,
                 persisted_events,
                 dropped_events,
[31m-            ).await;
[m[32m+            )
[m[32m+            .await;
[m         });
 
         let mut flush_handle = self.flush_handle.write().await;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:364:
         persisted_events: Arc<AtomicU64>,
         dropped_events: Arc<AtomicU64>,
     ) {
[31m-        use std::io::Write;
[m         use std::fs::OpenOptions;
[32m+        use std::io::Write;
[m 
         let mut batch = Vec::with_capacity(batch_size);
[31m-        let mut interval = tokio::time::interval(tokio::time::Duration::from_millis(flush_interval_ms));
[m[32m+        let mut interval =
[m[32m+            tokio::time::interval(tokio::time::Duration::from_millis(flush_interval_ms));
[m 
         // Recover any events from WAL on startup
         if let Err(e) = Self::recover_from_wal(&wal_path, &pool).await {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:410:
     }
 
     /// Append event to WAL (Write-Ahead Log) for crash recovery
[31m-    fn append_to_wal(wal_path: &std::path::Path, event: &TransactionAuditEvent) -> Result<(), AuditTrailError> {
[m[32m+    fn append_to_wal(
[m[32m+        wal_path: &std::path::Path,
[m[32m+        event: &TransactionAuditEvent,
[m[32m+    ) -> Result<(), AuditTrailError> {
[m         use std::fs::OpenOptions;
         use std::io::Write;
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:444:
         }
 
         // Begin transaction for batch insert
[31m-        let mut tx = pool.pool()
[m[31m-            .begin()
[m[31m-            .await
[m[31m-            .map_err(|e| AuditTrailError::Persistence(format!("Failed to begin transaction: {}", e)))?;
[m[32m+        let mut tx = pool.pool().begin().await.map_err(|e| {
[m[32m+            AuditTrailError::Persistence(format!("Failed to begin transaction: {}", e))
[m[32m+        })?;
[m 
         // Insert events in batch
         for event in batch {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:460:
                     transaction_id, order_id, actor, session_id, client_ip,
                     details, before_state, after_state,
                     compliance_tags, risk_level, digital_signature, checksum
[31m-                ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)"
[m[32m+                ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)",
[m             )
             .bind(&event.event_id)
             .bind(&event_type_str)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:480:
             .bind(&event.checksum)
             .execute(&mut *tx)
             .await
[31m-            .map_err(|e| AuditTrailError::Persistence(format!("Failed to insert audit event: {}", e)))?;
[m[32m+            .map_err(|e| {
[m[32m+                AuditTrailError::Persistence(format!("Failed to insert audit event: {}", e))
[m[32m+            })?;
[m         }
 
         // Commit transaction
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:487:
[31m-        tx.commit()
[m[31m-            .await
[m[31m-            .map_err(|e| AuditTrailError::Persistence(format!("Failed to commit transaction: {}", e)))?;
[m[32m+        tx.commit().await.map_err(|e| {
[m[32m+            AuditTrailError::Persistence(format!("Failed to commit transaction: {}", e))
[m[32m+        })?;
[m 
         // Clear WAL after successful persistence
         Self::clear_wal(wal_path)?;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:509:
             return Ok(());
         }
 
[31m-        let file = File::open(wal_path)
[m[31m-            .map_err(|e| AuditTrailError::Persistence(format!("Failed to open WAL for recovery: {}", e)))?;
[m[32m+        let file = File::open(wal_path).map_err(|e| {
[m[32m+            AuditTrailError::Persistence(format!("Failed to open WAL for recovery: {}", e))
[m[32m+        })?;
[m 
         let reader = BufReader::new(file);
         let mut events = Vec::new();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:517:
 
         for line in reader.lines() {
[31m-            let line = line.map_err(|e| AuditTrailError::Persistence(format!("Failed to read WAL line: {}", e)))?;
[m[32m+            let line = line.map_err(|e| {
[m[32m+                AuditTrailError::Persistence(format!("Failed to read WAL line: {}", e))
[m[32m+            })?;
[m             let event: TransactionAuditEvent = serde_json::from_str(&line)?;
             events.push(event);
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:561:
     /// Get queue statistics
     pub fn stats(&self) -> AsyncAuditQueueStats {
         AsyncAuditQueueStats {
[31m-            queued: self.queued_events.load(std::sync::atomic::Ordering::Relaxed),
[m[31m-            persisted: self.persisted_events.load(std::sync::atomic::Ordering::Relaxed),
[m[31m-            dropped: self.dropped_events.load(std::sync::atomic::Ordering::Relaxed),
[m[32m+            queued: self
[m[32m+                .queued_events
[m[32m+                .load(std::sync::atomic::Ordering::Relaxed),
[m[32m+            persisted: self
[m[32m+                .persisted_events
[m[32m+                .load(std::sync::atomic::Ordering::Relaxed),
[m[32m+            dropped: self
[m[32m+                .dropped_events
[m[32m+                .load(std::sync::atomic::Ordering::Relaxed),
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:894:
     /// before any trading operations to maintain compliance with audit trail requirements.
     pub async fn set_postgres_pool(&self, pool: Arc<crate::persistence::postgres::PostgresPool>) {
         // Set pool on persistence engine for audit event storage
[31m-        self.persistence_engine.set_postgres_pool(Arc::clone(&pool)).await;
[m[32m+        self.persistence_engine
[m[32m+            .set_postgres_pool(Arc::clone(&pool))
[m[32m+            .await;
[m 
         // Set pool on query engine for audit trail queries
         self.query_engine.set_postgres_pool(pool).await;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1202:
                 "audit-trail-v1".to_owned(),
             )),
             postgres_pool: Arc::new(RwLock::new(None)), // Must be set via set_postgres_pool()
[31m-            async_queue: None, // Initialized when PostgreSQL pool is set
[m[32m+            async_queue: None,                          // Initialized when PostgreSQL pool is set
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1222:
 
         // Get PostgreSQL pool
         let pool_guard = self.postgres_pool.read().await;
[31m-        let pool = pool_guard.as_ref()
[m[31m-            .ok_or_else(|| AuditTrailError::Persistence(
[m[31m-                "PostgreSQL connection pool not initialized".to_string()
[m[31m-            ))?;
[m[32m+        let pool = pool_guard.as_ref().ok_or_else(|| {
[m[32m+            AuditTrailError::Persistence("PostgreSQL connection pool not initialized".to_string())
[m[32m+        })?;
[m 
         // Begin transaction for batch insert
[31m-        let mut tx = pool.pool()
[m[31m-            .begin()
[m[31m-            .await
[m[31m-            .map_err(|e| AuditTrailError::Persistence(format!("Failed to begin transaction: {}", e)))?;
[m[32m+        let mut tx = pool.pool().begin().await.map_err(|e| {
[m[32m+            AuditTrailError::Persistence(format!("Failed to begin transaction: {}", e))
[m[32m+        })?;
[m 
         // Insert events in batch
         for event in events {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1244:
                     transaction_id, order_id, actor, session_id, client_ip,
                     details, before_state, after_state,
                     compliance_tags, risk_level, digital_signature, checksum
[31m-                ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)"
[m[32m+                ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)",
[m             )
             .bind(&event.event_id)
             .bind(&event_type_str)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1255:
             .bind(&event.actor)
             .bind(&event.session_id)
             .bind(&event.client_ip)
[31m-            .bind(serde_json::to_value(&event.details)
[m[31m-                .map_err(|e| AuditTrailError::Serialization(e))?)
[m[32m+            .bind(
[m[32m+                serde_json::to_value(&event.details)
[m[32m+                    .map_err(|e| AuditTrailError::Serialization(e))?,
[m[32m+            )
[m             .bind(&event.before_state)
             .bind(&event.after_state)
             .bind(&event.compliance_tags)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1265:
             .bind(&event.checksum)
             .execute(&mut *tx)
             .await
[31m-            .map_err(|e| AuditTrailError::Persistence(format!("Failed to insert audit event: {}", e)))?;
[m[32m+            .map_err(|e| {
[m[32m+                AuditTrailError::Persistence(format!("Failed to insert audit event: {}", e))
[m[32m+            })?;
[m         }
 
         // Commit transaction
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1272:
[31m-        tx.commit()
[m[31m-            .await
[m[31m-            .map_err(|e| AuditTrailError::Persistence(format!("Failed to commit transaction: {}", e)))?;
[m[32m+        tx.commit().await.map_err(|e| {
[m[32m+            AuditTrailError::Persistence(format!("Failed to commit transaction: {}", e))
[m[32m+        })?;
[m 
         Ok(())
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1293:
 
         match self.algorithm {
             CompressionAlgorithm::Gzip => {
[31m-                let mut encoder = GzEncoder::new(Vec::new(), Compression::new(self.compression_level));
[m[31m-                encoder.write_all(data)
[m[31m-                    .map_err(|e| AuditTrailError::Compression(format!("Gzip compression failed: {}", e)))?;
[m[31m-                encoder.finish()
[m[32m+                let mut encoder =
[m[32m+                    GzEncoder::new(Vec::new(), Compression::new(self.compression_level));
[m[32m+                encoder.write_all(data).map_err(|e| {
[m[32m+                    AuditTrailError::Compression(format!("Gzip compression failed: {}", e))
[m[32m+                })?;
[m[32m+                encoder
[m[32m+                    .finish()
[m                     .map_err(|e| AuditTrailError::Compression(format!("Gzip finish failed: {}", e)))
[31m-            }
[m[32m+            },
[m             CompressionAlgorithm::LZ4 | CompressionAlgorithm::ZSTD => {
                 // Future: implement LZ4/ZSTD if needed
[31m-                Err(AuditTrailError::Compression("LZ4/ZSTD not yet implemented".to_string()))
[m[31m-            }
[m[32m+                Err(AuditTrailError::Compression(
[m[32m+                    "LZ4/ZSTD not yet implemented".to_string(),
[m[32m+                ))
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1315:
             CompressionAlgorithm::Gzip => {
                 let mut decoder = GzDecoder::new(data);
                 let mut decompressed = Vec::new();
[31m-                decoder.read_to_end(&mut decompressed)
[m[31m-                    .map_err(|e| AuditTrailError::Compression(format!("Gzip decompression failed: {}", e)))?;
[m[32m+                decoder.read_to_end(&mut decompressed).map_err(|e| {
[m[32m+                    AuditTrailError::Compression(format!("Gzip decompression failed: {}", e))
[m[32m+                })?;
[m                 Ok(decompressed)
[31m-            }
[m[31m-            CompressionAlgorithm::LZ4 | CompressionAlgorithm::ZSTD => {
[m[31m-                Err(AuditTrailError::Compression("LZ4/ZSTD not yet implemented".to_string()))
[m[31m-            }
[m[32m+            },
[m[32m+            CompressionAlgorithm::LZ4 | CompressionAlgorithm::ZSTD => Err(
[m[32m+                AuditTrailError::Compression("LZ4/ZSTD not yet implemented".to_string()),
[m[32m+            ),
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1332:
     }
 
     /// Encrypt data with AEAD (returns ciphertext and nonce)
[31m-    pub fn encrypt(&self, data: &[u8], key: &[u8; 32]) -> Result<(Vec<u8>, Vec<u8>), AuditTrailError> {
[m[31m-        use aes_gcm::{Aes256Gcm, KeyInit, Nonce};
[m[32m+    pub fn encrypt(
[m[32m+        &self,
[m[32m+        data: &[u8],
[m[32m+        key: &[u8; 32],
[m[32m+    ) -> Result<(Vec<u8>, Vec<u8>), AuditTrailError> {
[m         use aes_gcm::aead::Aead;
[32m+        use aes_gcm::{Aes256Gcm, KeyInit, Nonce};
[m         use rand::Rng;
 
         match self.algorithm {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1341:
             EncryptionAlgorithm::AES256GCM => {
[31m-                let cipher = Aes256Gcm::new_from_slice(key)
[m[31m-                    .map_err(|e| AuditTrailError::Encryption(format!("Failed to create cipher: {}", e)))?;
[m[32m+                let cipher = Aes256Gcm::new_from_slice(key).map_err(|e| {
[m[32m+                    AuditTrailError::Encryption(format!("Failed to create cipher: {}", e))
[m[32m+                })?;
[m 
                 // Generate random 96-bit nonce
                 let mut nonce_bytes = [0u8; 12];
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1347:
                 rand::thread_rng().fill(&mut nonce_bytes);
                 let nonce = Nonce::from_slice(&nonce_bytes);
 
[31m-                let ciphertext = cipher.encrypt(nonce, data)
[m[31m-                    .map_err(|e| AuditTrailError::Encryption(format!("Encryption failed: {}", e)))?;
[m[32m+                let ciphertext = cipher.encrypt(nonce, data).map_err(|e| {
[m[32m+                    AuditTrailError::Encryption(format!("Encryption failed: {}", e))
[m[32m+                })?;
[m 
                 Ok((ciphertext, nonce_bytes.to_vec()))
[31m-            }
[m[32m+            },
[m             EncryptionAlgorithm::ChaCha20Poly1305 => {
                 // Future: implement ChaCha20-Poly1305 if needed
[31m-                Err(AuditTrailError::Encryption("ChaCha20Poly1305 not yet implemented".to_string()))
[m[31m-            }
[m[32m+                Err(AuditTrailError::Encryption(
[m[32m+                    "ChaCha20Poly1305 not yet implemented".to_string(),
[m[32m+                ))
[m[32m+            },
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1362:
     /// Decrypt AEAD ciphertext
[31m-    pub fn decrypt(&self, ciphertext: &[u8], nonce: &[u8], key: &[u8; 32]) -> Result<Vec<u8>, AuditTrailError> {
[m[31m-        use aes_gcm::{Aes256Gcm, KeyInit, Nonce};
[m[32m+    pub fn decrypt(
[m[32m+        &self,
[m[32m+        ciphertext: &[u8],
[m[32m+        nonce: &[u8],
[m[32m+        key: &[u8; 32],
[m[32m+    ) -> Result<Vec<u8>, AuditTrailError> {
[m         use aes_gcm::aead::Aead;
[32m+        use aes_gcm::{Aes256Gcm, KeyInit, Nonce};
[m 
         match self.algorithm {
             EncryptionAlgorithm::AES256GCM => {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1369:
[31m-                let cipher = Aes256Gcm::new_from_slice(key)
[m[31m-                    .map_err(|e| AuditTrailError::Encryption(format!("Failed to create cipher: {}", e)))?;
[m[32m+                let cipher = Aes256Gcm::new_from_slice(key).map_err(|e| {
[m[32m+                    AuditTrailError::Encryption(format!("Failed to create cipher: {}", e))
[m[32m+                })?;
[m 
                 let nonce_array = Nonce::from_slice(nonce);
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1374:
[31m-                cipher.decrypt(nonce_array, ciphertext)
[m[31m-                    .map_err(|e| AuditTrailError::Encryption(format!("Decryption failed (tampered?): {}", e)))
[m[31m-            }
[m[31m-            EncryptionAlgorithm::ChaCha20Poly1305 => {
[m[31m-                Err(AuditTrailError::Encryption("ChaCha20Poly1305 not yet implemented".to_string()))
[m[31m-            }
[m[32m+                cipher.decrypt(nonce_array, ciphertext).map_err(|e| {
[m[32m+                    AuditTrailError::Encryption(format!("Decryption failed (tampered?): {}", e))
[m[32m+                })
[m[32m+            },
[m[32m+            EncryptionAlgorithm::ChaCha20Poly1305 => Err(AuditTrailError::Encryption(
[m[32m+                "ChaCha20Poly1305 not yet implemented".to_string(),
[m[32m+            )),
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1402:
     pub async fn cleanup_expired_events(&self) -> Result<(), AuditTrailError> {
         use chrono::Duration;
 
[31m-        tracing::info!("Starting audit event cleanup for events older than {} days", self.config.retention_days);
[m[32m+        tracing::info!(
[m[32m+            "Starting audit event cleanup for events older than {} days",
[m[32m+            self.config.retention_days
[m[32m+        );
[m 
         // Calculate cutoff date
         let cutoff_date = Utc::now() - Duration::days(self.config.retention_days as i64);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1462:
 
         // Get PostgreSQL pool
         let pool_guard = self.postgres_pool.read().await;
[31m-        let pool = pool_guard.as_ref()
[m[31m-            .ok_or_else(|| AuditTrailError::QueryExecution(
[m[31m-                "PostgreSQL connection pool not initialized".to_string()
[m[31m-            ))?;
[m[32m+        let pool = pool_guard.as_ref().ok_or_else(|| {
[m[32m+            AuditTrailError::QueryExecution(
[m[32m+                "PostgreSQL connection pool not initialized".to_string(),
[m[32m+            )
[m[32m+        })?;
[m 
         // Build SQL query with filters
         // Build parameterized query to prevent SQL injection
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1480:
 
         // Track parameter count for placeholders
         let mut param_count = 2;
[31m-        
[m[32m+
[m         // Build query with proper parameter binding
         let query_str = {
             let mut conditions = Vec::new();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1487:
[31m-            
[m[32m+
[m             // Optional filters with parameterized queries
             if query.transaction_id.is_some() {
                 param_count += 1;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1498:
                 param_count += 1;
                 conditions.push(format!("actor = ${}", param_count));
             }
[31m-            
[m[32m+
[m             // Add all conditions
             if !conditions.is_empty() {
                 sql_parts.push(format!("AND {}", conditions.join(" AND ")));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1518:
             sql_parts.push(format!("LIMIT ${}", param_count));
             param_count += 1;
             sql_parts.push(format!("OFFSET ${}", param_count));
[31m-            
[m[32m+
[m             sql_parts.join(" ")
         };
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1525:
         // Validate input parameters
         let validated_limit = Self::validate_limit(query.limit.unwrap_or(1000))?;
         let validated_offset = Self::validate_offset(query.offset.unwrap_or(0))?;
[31m-        
[m[32m+
[m         if let Some(ref tx_id) = query.transaction_id {
             Self::validate_id_field(tx_id, "transaction_id")?;
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1540:
         let mut query_builder = sqlx::query(&query_str)
             .bind(&query.start_time)
             .bind(&query.end_time);
[31m-        
[m[32m+
[m         // Bind optional parameters in the same order as the query was built
         if let Some(ref tx_id) = query.transaction_id {
             query_builder = query_builder.bind(tx_id);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1551:
         if let Some(ref actor) = query.actor {
             query_builder = query_builder.bind(actor);
         }
[31m-        
[m[32m+
[m         // Bind pagination parameters
         query_builder = query_builder
             .bind(validated_limit as i64)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1572:
         // Verify audit log integrity
         for event in &events {
             if !Self::verify_event_integrity(event)? {
[31m-                return Err(AuditTrailError::QueryExecution(
[m[31m-                    format!("Audit log integrity check failed for event {}", event.event_id)
[m[31m-                ));
[m[32m+                return Err(AuditTrailError::QueryExecution(format!(
[m[32m+                    "Audit log integrity check failed for event {}",
[m[32m+                    event.event_id
[m[32m+                )));
[m             }
         }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1590:
     fn validate_id_field(id: &str, field_name: &str) -> Result<(), AuditTrailError> {
         // Check length
         if id.is_empty() || id.len() > 255 {
[31m-            return Err(AuditTrailError::QueryExecution(
[m[31m-                format!("{} must be between 1 and 255 characters", field_name)
[m[31m-            ));
[m[32m+            return Err(AuditTrailError::QueryExecution(format!(
[m[32m+                "{} must be between 1 and 255 characters",
[m[32m+                field_name
[m[32m+            )));
[m         }
 
         // Allow alphanumeric, hyphens, underscores only
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1599:
[31m-        if !id.chars().all(|c| c.is_alphanumeric() || c == '-' || c == '_') {
[m[31m-            return Err(AuditTrailError::QueryExecution(
[m[31m-                format!("{} contains invalid characters (only alphanumeric, -, _ allowed)", field_name)
[m[31m-            ));
[m[32m+        if !id
[m[32m+            .chars()
[m[32m+            .all(|c| c.is_alphanumeric() || c == '-' || c == '_')
[m[32m+        {
[m[32m+            return Err(AuditTrailError::QueryExecution(format!(
[m[32m+                "{} contains invalid characters (only alphanumeric, -, _ allowed)",
[m[32m+                field_name
[m[32m+            )));
[m         }
 
         Ok(())
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1610:
         // Check length
         if actor.is_empty() || actor.len() > 255 {
             return Err(AuditTrailError::QueryExecution(
[31m-                "actor must be between 1 and 255 characters".to_string()
[m[32m+                "actor must be between 1 and 255 characters".to_string(),
[m             ));
         }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1617:
         // Allow alphanumeric, hyphens, underscores, @, . for email addresses
[31m-        if !actor.chars().all(|c| c.is_alphanumeric() || c == '-' || c == '_' || c == '@' || c == '.') {
[m[32m+        if !actor
[m[32m+            .chars()
[m[32m+            .all(|c| c.is_alphanumeric() || c == '-' || c == '_' || c == '@' || c == '.')
[m[32m+        {
[m             return Err(AuditTrailError::QueryExecution(
[31m-                "actor contains invalid characters (only alphanumeric, -, _, @, . allowed)".to_string()
[m[32m+                "actor contains invalid characters (only alphanumeric, -, _, @, . allowed)"
[m[32m+                    .to_string(),
[m             ));
         }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1629:
         const MAX_LIMIT: u32 = 10_000;
 
         if limit > MAX_LIMIT {
[31m-            return Err(AuditTrailError::QueryExecution(
[m[31m-                format!("LIMIT must not exceed {} rows", MAX_LIMIT)
[m[31m-            ));
[m[32m+            return Err(AuditTrailError::QueryExecution(format!(
[m[32m+                "LIMIT must not exceed {} rows",
[m[32m+                MAX_LIMIT
[m[32m+            )));
[m         }
 
         Ok(limit)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1642:
         const MAX_OFFSET: u32 = 1_000_000;
 
         if offset > MAX_OFFSET {
[31m-            return Err(AuditTrailError::QueryExecution(
[m[31m-                format!("OFFSET must not exceed {}", MAX_OFFSET)
[m[31m-            ));
[m[32m+            return Err(AuditTrailError::QueryExecution(format!(
[m[32m+                "OFFSET must not exceed {}",
[m[32m+                MAX_OFFSET
[m[32m+            )));
[m         }
 
         Ok(offset)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1668:
     }
 
     /// Map PostgreSQL row to TransactionAuditEvent
[31m-    fn map_row_to_event(row: &sqlx::postgres::PgRow) -> Result<TransactionAuditEvent, AuditTrailError> {
[m[32m+    fn map_row_to_event(
[m[32m+        row: &sqlx::postgres::PgRow,
[m[32m+    ) -> Result<TransactionAuditEvent, AuditTrailError> {
[m         use sqlx::Row;
 
         // Parse enum strings back to Rust enums
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1679:
         let risk_level = Self::parse_risk_level(&risk_level_str)?;
 
         // Deserialize JSONB fields
[31m-        let details: AuditEventDetails = serde_json::from_value(row.get("details"))
[m[31m-            .map_err(|e| AuditTrailError::QueryExecution(format!("Failed to deserialize details: {}", e)))?;
[m[32m+        let details: AuditEventDetails =
[m[32m+            serde_json::from_value(row.get("details")).map_err(|e| {
[m[32m+                AuditTrailError::QueryExecution(format!("Failed to deserialize details: {}", e))
[m[32m+            })?;
[m 
         Ok(TransactionAuditEvent {
             event_id: row.get("event_id"),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1718:
             "AuthorizationCheck" => Ok(AuditEventType::AuthorizationCheck),
             "SystemEvent" => Ok(AuditEventType::SystemEvent),
             "ErrorEvent" => Ok(AuditEventType::ErrorEvent),
[31m-            _ => Err(AuditTrailError::QueryExecution(format!("Unknown event type: {}", s))),
[m[32m+            _ => Err(AuditTrailError::QueryExecution(format!(
[m[32m+                "Unknown event type: {}",
[m[32m+                s
[m[32m+            ))),
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/audit_trails.rs:1729:
             "Medium" => Ok(RiskLevel::Medium),
             "High" => Ok(RiskLevel::High),
             "Critical" => Ok(RiskLevel::Critical),
[31m-            _ => Err(AuditTrailError::QueryExecution(format!("Unknown risk level: {}", s))),
[m[32m+            _ => Err(AuditTrailError::QueryExecution(format!(
[m[32m+                "Unknown risk level: {}",
[m[32m+                s
[m[32m+            ))),
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:6:
 
 #![deny(clippy::unwrap_used, clippy::expect_used)]
 
[31m-use std::collections::HashMap;
[m[31m-use std::sync::Arc;
[m[31m-use std::str::FromStr;
[m[31m-use chrono::{DateTime, Utc, Duration};
[m[31m-use serde::{Serialize, Deserialize};
[m[31m-use tokio::sync::RwLock;
[m[31m-use cron::Schedule;
[m use crate::compliance::{
[31m-    transaction_reporting::{TransactionReporter, ReportingPeriod, PeriodType},
[m[31m-    sox_compliance::SOXComplianceManager,
[m[31m-    best_execution::BestExecutionAnalyzer,
[m     audit_trails::AuditTrailEngine,
[32m+    best_execution::BestExecutionAnalyzer,
[m[32m+    sox_compliance::SOXComplianceManager,
[m[32m+    transaction_reporting::{PeriodType, ReportingPeriod, TransactionReporter},
[m };
[32m+use chrono::{DateTime, Duration, Utc};
[m[32m+use cron::Schedule;
[m[32m+use serde::{Deserialize, Serialize};
[m[32m+use std::collections::HashMap;
[m[32m+use std::str::FromStr;
[m[32m+use std::sync::Arc;
[m[32m+use tokio::sync::RwLock;
[m 
 /// Automated reporting system
 #[derive(Debug)]
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:25:
 /// AutomatedReportingSystem
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct AutomatedReportingSystem {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:39:
 /// Configuration for automated reporting
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AutomatedReportingConfig
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct AutomatedReportingConfig {
     /// Enable automated reporting
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:61:
 /// Report schedule configuration
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ReportSchedule
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ReportSchedule {
     /// Schedule ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:89:
 /// Scheduled report types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ScheduledReportType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ScheduledReportType {
     /// MiFID II transaction reports
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:113:
 /// Quality check definitions
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// QualityCheck
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct QualityCheck {
     /// Check ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:133:
 /// Quality check types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// QualityCheckType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum QualityCheckType {
     /// Data completeness check
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:155:
 /// Quality check severity
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// QualityCheckSeverity
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum QualityCheckSeverity {
     /// Critical - blocks submission
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:171:
 /// Submission settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// SubmissionSettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct SubmissionSettings {
     /// Enable automatic submission
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:191:
 /// Authority-specific submission settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AuthoritySubmissionSettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct AuthoritySubmissionSettings {
     /// Authority identifier
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:209:
 /// Submission methods
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// SubmissionMethod
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum SubmissionMethod {
     /// REST API
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:227:
 /// Notification settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// NotificationSettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct NotificationSettings {
     /// Enable notifications
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:243:
 /// Notification channels
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// NotificationChannel
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum NotificationChannel {
     /// Email notifications
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:257:
         channel: String,
     },
     /// Microsoft Teams
[31m-    Teams {
[m[31m-        webhook_url: String,
[m[31m-    },
[m[32m+    Teams { webhook_url: String },
[m     /// SMS notifications
[31m-    SMS {
[m[31m-        provider: String,
[m[31m-        api_key: String,
[m[31m-    },
[m[32m+    SMS { provider: String, api_key: String },
[m     /// Webhook notifications
     Webhook {
         url: String,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:275:
 /// Notification levels
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// NotificationLevel
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum NotificationLevel {
     /// Info - routine notifications
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:291:
 /// Escalation settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// EscalationSettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct EscalationSettings {
     /// Enable escalation
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:305:
 /// Escalation level
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// EscalationLevel
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct EscalationLevel {
     /// Level number
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:321:
 /// Quality assurance settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// QualityAssuranceSettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct QualityAssuranceSettings {
     /// Enable QA checks
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:339:
 /// Retry settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RetrySettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RetrySettings {
     /// Maximum retry attempts
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:357:
 /// Retry conditions
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RetryCondition
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RetryCondition {
     /// Error type to retry on
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:371:
 /// Retry policy
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RetryPolicy
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RetryPolicy {
     /// Maximum attempts for this policy
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:385:
 /// Monitoring settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// MonitoringSettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct MonitoringSettings {
     /// Enable monitoring
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:401:
 /// Performance thresholds
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// PerformanceThresholds
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct PerformanceThresholds {
     /// Maximum report generation time (seconds)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:417:
 /// Alert settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AlertSettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct AlertSettings {
     /// Enable alerts
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:431:
 /// Alert condition
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AlertCondition
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct AlertCondition {
     /// Condition name
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:449:
 /// Comparison operators for alerts
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ComparisonOperator
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ComparisonOperator {
     /// Greater than
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:465:
 /// Report scheduler
 #[derive(Debug)]
 /// ReportScheduler
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ReportScheduler {
     schedules: Vec<ReportSchedule>,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:475:
 /// Cron job information
 #[derive(Debug, Clone)]
 /// CronJob
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct CronJob {
     /// Schedule Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:504:
 /// Submission engine
 #[derive(Debug)]
 /// SubmissionEngine
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct SubmissionEngine {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:516:
 /// Submission task
 #[derive(Debug, Clone)]
 /// SubmissionTask
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct SubmissionTask {
     /// Task Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:540:
 /// Task priority
 #[derive(Debug, Clone)]
 /// TaskPriority
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum TaskPriority {
     // Low variant
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:556:
 /// Generated report data
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// GeneratedReport
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct GeneratedReport {
     /// Report Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:578:
 /// Validation result
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ValidationResult
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ValidationResult {
     /// Check Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:598:
 /// Active submission tracking
 #[derive(Debug, Clone)]
 /// ActiveSubmission
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ActiveSubmission {
     /// Task Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:616:
 /// Submission status
 #[derive(Debug, Clone)]
 /// SubmissionStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum SubmissionStatus {
     // Pending variant
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:634:
 /// Notification service
 #[derive(Debug)]
 /// NotificationService
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct NotificationService {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:645:
 /// Notification task
 #[derive(Debug, Clone)]
 /// NotificationTask
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct NotificationTask {
     /// Task Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:667:
 /// Reporting monitoring
 #[derive(Debug)]
 /// ReportingMonitoring
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct ReportingMonitoring {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:678:
 /// Reporting metrics
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ReportingMetrics
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ReportingMetrics {
     /// Total Reports Generated
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:709:
         audit_trail_engine: Arc<RwLock<AuditTrailEngine>>,
     ) -> Self {
         let scheduler = Arc::new(ReportScheduler::new(&config.schedules));
[31m-        
[m[32m+
[m         let report_generators = Arc::new(RwLock::new(ReportGenerators {
             transaction_reporter,
             sox_manager,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:718:
         }));
 
         let submission_engine = Arc::new(SubmissionEngine::new(&config.submission_settings));
[31m-        let notification_service = Arc::new(NotificationService::new(&config.notification_settings));
[m[32m+        let notification_service =
[m[32m+            Arc::new(NotificationService::new(&config.notification_settings));
[m         let monitoring = Arc::new(ReportingMonitoring::new(&config.monitoring_settings));
 
         // Start background tasks
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:725:
         let mut background_tasks = Vec::new();
[31m-        
[m[32m+
[m         // Scheduler task
         let scheduler_task = Self::start_scheduler_task(
             Arc::clone(&scheduler),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:762:
         }
 
         println!("Starting automated regulatory reporting system...");
[31m-        
[m[32m+
[m         // Initialize all schedules
         self.scheduler.initialize_schedules().await?;
[31m-        
[m[32m+
[m         println!("Automated reporting system started successfully");
         println!("Active schedules: {}", self.config.schedules.len());
[31m-        
[m[32m+
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:775:
     /// Add a new reporting schedule
[31m-    pub async fn add_schedule(&self, schedule: ReportSchedule) -> Result<(), AutomatedReportingError> {
[m[32m+    pub async fn add_schedule(
[m[32m+        &self,
[m[32m+        schedule: ReportSchedule,
[m[32m+    ) -> Result<(), AutomatedReportingError> {
[m         self.scheduler.add_schedule(schedule).await
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:788:
     }
 
     /// Force run a specific schedule
[31m-    pub async fn force_run_schedule(&self, schedule_id: &str) -> Result<String, AutomatedReportingError> {
[m[31m-        let schedule = self.scheduler.get_schedule(schedule_id).await
[m[32m+    pub async fn force_run_schedule(
[m[32m+        &self,
[m[32m+        schedule_id: &str,
[m[32m+    ) -> Result<String, AutomatedReportingError> {
[m[32m+        let schedule = self
[m[32m+            .scheduler
[m[32m+            .get_schedule(schedule_id)
[m[32m+            .await
[m             .ok_or_else(|| AutomatedReportingError::ScheduleNotFound(schedule_id.to_string()))?;
 
         // Generate report immediately
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:796:
         let task_id = uuid::Uuid::new_v4().to_string();
         let period = Self::determine_reporting_period(&schedule.report_type);
[31m-        
[m[32m+
[m         let report = self.generate_report(&schedule, &period).await?;
[31m-        
[m[32m+
[m         // Submit report
[31m-        self.submission_engine.submit_report(task_id.clone(), schedule.schedule_id, report, schedule.target_authorities).await?;
[m[31m-        
[m[31m-    // Ok variant
[m[32m+        self.submission_engine
[m[32m+            .submit_report(
[m[32m+                task_id.clone(),
[m[32m+                schedule.schedule_id,
[m[32m+                report,
[m[32m+                schedule.target_authorities,
[m[32m+            )
[m[32m+            .await?;
[m[32m+
[m[32m+        // Ok variant
[m         Ok(task_id)
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:814:
     ) -> tokio::task::JoinHandle<()> {
         tokio::spawn(async move {
             let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(60));
[31m-            
[m[32m+
[m             loop {
                 interval.tick().await;
[31m-                
[m[32m+
[m                 // Check for due schedules
                 if let Ok(due_schedules) = scheduler.get_due_schedules().await {
                     for schedule in due_schedules {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:826:
                         let _period = Self::determine_reporting_period(&schedule.report_type);
 
                         // This would generate the actual report
[31m-                        println!("Processing due schedule: {} ({})", schedule.name, schedule.schedule_id);
[m[31m-                        
[m[32m+                        println!(
[m[32m+                            "Processing due schedule: {} ({})",
[m[32m+                            schedule.name, schedule.schedule_id
[m[32m+                        );
[m[32m+
[m                         // Mark schedule as processed
[31m-                        if let Err(e) = scheduler.mark_schedule_processed(&schedule.schedule_id).await {
[m[32m+                        if let Err(e) = scheduler
[m[32m+                            .mark_schedule_processed(&schedule.schedule_id)
[m[32m+                            .await
[m[32m+                        {
[m                             eprintln!("Failed to mark schedule as processed: {}", e);
                         }
                     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:845:
     ) -> tokio::task::JoinHandle<()> {
         tokio::spawn(async move {
             let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(30));
[31m-            
[m[32m+
[m             loop {
                 interval.tick().await;
[31m-                
[m[32m+
[m                 // Process pending submissions
                 if let Err(e) = submission_engine.process_pending_submissions().await {
                     eprintln!("Error processing submissions: {}", e);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:861:
     fn start_monitoring_task(monitoring: Arc<ReportingMonitoring>) -> tokio::task::JoinHandle<()> {
         tokio::spawn(async move {
             let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(300)); // 5 minutes
[31m-            
[m[32m+
[m             loop {
                 interval.tick().await;
[31m-                
[m[32m+
[m                 // Update metrics
                 if let Err(e) = monitoring.update_metrics().await {
                     eprintln!("Error updating metrics: {}", e);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:874:
     }
 
     /// Generate report for a schedule
[31m-    async fn generate_report(&self, schedule: &ReportSchedule, period: &ReportingPeriod) -> Result<GeneratedReport, AutomatedReportingError> {
[m[32m+    async fn generate_report(
[m[32m+        &self,
[m[32m+        schedule: &ReportSchedule,
[m[32m+        period: &ReportingPeriod,
[m[32m+    ) -> Result<GeneratedReport, AutomatedReportingError> {
[m         let start_time = std::time::Instant::now();
         let _generators = self.report_generators.read().await;
[31m-        
[m[32m+
[m         let data = match &schedule.report_type {
             ScheduledReportType::MiFIDTransactionReports => {
                 // Generate MiFID II transaction reports
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:891:
             ScheduledReportType::SOXComplianceAssessment => {
                 // Generate SOX compliance assessment
                 serde_json::json!({
[31m-                    "report_type": "sox_compliance_assessment", 
[m[32m+                    "report_type": "sox_compliance_assessment",
[m                     "period": period,
                     "compliance_score": 95.5,
                     "status": "compliant"
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:903:
                     "period": period,
                     "status": "generated"
                 })
[31m-            }
[m[32m+            },
[m         };
 
         let report = GeneratedReport {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:918:
 
         // Update metrics
         let generation_time = start_time.elapsed().as_millis() as f64;
[31m-        self.monitoring.record_report_generated(generation_time).await;
[m[32m+        self.monitoring
[m[32m+            .record_report_generated(generation_time)
[m[32m+            .await;
[m 
[31m-    // Ok variant
[m[32m+        // Ok variant
[m         Ok(report)
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:929:
         let now = Utc::now();
         match report_type {
             ScheduledReportType::MiFIDTransactionReports => ReportingPeriod {
[31m-                start_date: now.date_naive().and_hms_opt(0, 0, 0).unwrap().and_utc() - Duration::days(1),
[m[32m+                start_date: now.date_naive().and_hms_opt(0, 0, 0).unwrap().and_utc()
[m[32m+                    - Duration::days(1),
[m                 end_date: now.date_naive().and_hms_opt(0, 0, 0).unwrap().and_utc(),
                 period_type: PeriodType::Daily,
             },
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:954:
 
     pub async fn initialize_schedules(&self) -> Result<(), AutomatedReportingError> {
         let mut cron_jobs = self.cron_jobs.write().await;
[31m-        
[m[32m+
[m         for schedule in &self.schedules {
             if schedule.enabled {
                 let cron_job = CronJob {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:966:
                 cron_jobs.insert(schedule.schedule_id.clone(), cron_job);
             }
         }
[31m-        
[m[32m+
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:974:
         let now = Utc::now();
         let cron_jobs = self.cron_jobs.read().await;
         let mut due_schedules = Vec::new();
[31m-        
[m[32m+
[m         for schedule in &self.schedules {
             if let Some(cron_job) = cron_jobs.get(&schedule.schedule_id) {
                 if cron_job.enabled && cron_job.next_run <= now {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:982:
                 }
             }
         }
[31m-        
[m[31m-    // Ok variant
[m[32m+
[m[32m+        // Ok variant
[m         Ok(due_schedules)
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:990:
[31m-    pub async fn add_schedule(&self, schedule: ReportSchedule) -> Result<(), AutomatedReportingError> {
[m[32m+    pub async fn add_schedule(
[m[32m+        &self,
[m[32m+        schedule: ReportSchedule,
[m[32m+    ) -> Result<(), AutomatedReportingError> {
[m         // Validate cron expression before adding
[31m-        Schedule::from_str(&schedule.cron_expression)
[m[31m-            .map_err(|e| AutomatedReportingError::SchedulingError(
[m[31m-                format!("Invalid cron expression '{}': {}", schedule.cron_expression, e)
[m[31m-            ))?;
[m[32m+        Schedule::from_str(&schedule.cron_expression).map_err(|e| {
[m[32m+            AutomatedReportingError::SchedulingError(format!(
[m[32m+                "Invalid cron expression '{}': {}",
[m[32m+                schedule.cron_expression, e
[m[32m+            ))
[m[32m+        })?;
[m 
         // Check for duplicate schedule ID
[31m-        if self.schedules.iter().any(|s| s.schedule_id == schedule.schedule_id) {
[m[31m-            return Err(AutomatedReportingError::ConfigurationError(
[m[31m-                format!("Schedule with ID '{}' already exists", schedule.schedule_id)
[m[31m-            ));
[m[32m+        if self
[m[32m+            .schedules
[m[32m+            .iter()
[m[32m+            .any(|s| s.schedule_id == schedule.schedule_id)
[m[32m+        {
[m[32m+            return Err(AutomatedReportingError::ConfigurationError(format!(
[m[32m+                "Schedule with ID '{}' already exists",
[m[32m+                schedule.schedule_id
[m[32m+            )));
[m         }
 
         // Add to cron jobs if enabled
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1019:
     pub async fn remove_schedule(&self, schedule_id: &str) -> Result<(), AutomatedReportingError> {
         // Check if schedule exists
         if !self.schedules.iter().any(|s| s.schedule_id == schedule_id) {
[31m-            return Err(AutomatedReportingError::ScheduleNotFound(schedule_id.to_string()));
[m[32m+            return Err(AutomatedReportingError::ScheduleNotFound(
[m[32m+                schedule_id.to_string(),
[m[32m+            ));
[m         }
 
         // Remove from cron jobs
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1040:
     }
 
     pub async fn get_schedule(&self, schedule_id: &str) -> Option<ReportSchedule> {
[31m-        self.schedules.iter().find(|s| s.schedule_id == schedule_id).cloned()
[m[32m+        self.schedules
[m[32m+            .iter()
[m[32m+            .find(|s| s.schedule_id == schedule_id)
[m[32m+            .cloned()
[m     }
 
[31m-    pub async fn mark_schedule_processed(&self, schedule_id: &str) -> Result<(), AutomatedReportingError> {
[m[32m+    pub async fn mark_schedule_processed(
[m[32m+        &self,
[m[32m+        schedule_id: &str,
[m[32m+    ) -> Result<(), AutomatedReportingError> {
[m         let mut cron_jobs = self.cron_jobs.write().await;
         if let Some(cron_job) = cron_jobs.get_mut(schedule_id) {
             cron_job.last_run = Some(Utc::now());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1057:
 
     fn calculate_next_run(cron_expression: &str) -> Result<DateTime<Utc>, AutomatedReportingError> {
         // Parse cron expression
[31m-        let schedule = Schedule::from_str(cron_expression)
[m[31m-            .map_err(|e| AutomatedReportingError::SchedulingError(
[m[31m-                format!("Failed to parse cron expression '{}': {}", cron_expression, e)
[m[31m-            ))?;
[m[32m+        let schedule = Schedule::from_str(cron_expression).map_err(|e| {
[m[32m+            AutomatedReportingError::SchedulingError(format!(
[m[32m+                "Failed to parse cron expression '{}': {}",
[m[32m+                cron_expression, e
[m[32m+            ))
[m[32m+        })?;
[m 
         // Get next occurrence after current time
         let now = Utc::now();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1067:
[31m-        let next_time = schedule.after(&now).next()
[m[31m-            .ok_or_else(|| AutomatedReportingError::SchedulingError(
[m[31m-                format!("No future occurrence found for cron expression '{}'", cron_expression)
[m[31m-            ))?;
[m[32m+        let next_time = schedule.after(&now).next().ok_or_else(|| {
[m[32m+            AutomatedReportingError::SchedulingError(format!(
[m[32m+                "No future occurrence found for cron expression '{}'",
[m[32m+                cron_expression
[m[32m+            ))
[m[32m+        })?;
[m 
         Ok(next_time)
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1082:
         }
     }
 
[31m-    pub async fn submit_report(&self, task_id: String, schedule_id: String, report: GeneratedReport, authorities: Vec<String>) -> Result<(), AutomatedReportingError> {
[m[32m+    pub async fn submit_report(
[m[32m+        &self,
[m[32m+        task_id: String,
[m[32m+        schedule_id: String,
[m[32m+        report: GeneratedReport,
[m[32m+        authorities: Vec<String>,
[m[32m+    ) -> Result<(), AutomatedReportingError> {
[m         let mut queue = self.submission_queue.write().await;
[31m-        
[m[32m+
[m         for authority in authorities {
             let task = SubmissionTask {
                 task_id: format!("{}-{}", task_id, authority),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1098:
             };
             queue.push(task);
         }
[31m-        
[m[32m+
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1107:
         let mut active = self.active_submissions.write().await;
 
         // Sort queue by priority and scheduled time
[31m-        queue.sort_by(|a, b| {
[m[31m-            match (&a.priority, &b.priority) {
[m[31m-                (TaskPriority::Critical, TaskPriority::Critical) => a.scheduled_time.cmp(&b.scheduled_time),
[m[31m-                (TaskPriority::Critical, _) => std::cmp::Ordering::Less,
[m[31m-                (_, TaskPriority::Critical) => std::cmp::Ordering::Greater,
[m[31m-                (TaskPriority::High, TaskPriority::High) => a.scheduled_time.cmp(&b.scheduled_time),
[m[31m-                (TaskPriority::High, _) => std::cmp::Ordering::Less,
[m[31m-                (_, TaskPriority::High) => std::cmp::Ordering::Greater,
[m[31m-                (TaskPriority::Normal, TaskPriority::Normal) => a.scheduled_time.cmp(&b.scheduled_time),
[m[31m-                (TaskPriority::Normal, _) => std::cmp::Ordering::Less,
[m[31m-                (_, TaskPriority::Normal) => std::cmp::Ordering::Greater,
[m[31m-                (TaskPriority::Low, TaskPriority::Low) => a.scheduled_time.cmp(&b.scheduled_time),
[m[31m-            }
[m[32m+        queue.sort_by(|a, b| match (&a.priority, &b.priority) {
[m[32m+            (TaskPriority::Critical, TaskPriority::Critical) => {
[m[32m+                a.scheduled_time.cmp(&b.scheduled_time)
[m[32m+            },
[m[32m+            (TaskPriority::Critical, _) => std::cmp::Ordering::Less,
[m[32m+            (_, TaskPriority::Critical) => std::cmp::Ordering::Greater,
[m[32m+            (TaskPriority::High, TaskPriority::High) => a.scheduled_time.cmp(&b.scheduled_time),
[m[32m+            (TaskPriority::High, _) => std::cmp::Ordering::Less,
[m[32m+            (_, TaskPriority::High) => std::cmp::Ordering::Greater,
[m[32m+            (TaskPriority::Normal, TaskPriority::Normal) => a.scheduled_time.cmp(&b.scheduled_time),
[m[32m+            (TaskPriority::Normal, _) => std::cmp::Ordering::Less,
[m[32m+            (_, TaskPriority::Normal) => std::cmp::Ordering::Greater,
[m[32m+            (TaskPriority::Low, TaskPriority::Low) => a.scheduled_time.cmp(&b.scheduled_time),
[m         });
 
         // Process tasks in batches
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1138:
                 // Check if within retry limits
                 if task.current_attempts < task.max_attempts {
                     // Check authority-specific rate limits
[31m-                    if let Some(authority_config) = self.config.authority_settings.get(&task.target_authority) {
[m[31m-                        if !Self::check_rate_limit(&task.target_authority, authority_config.rate_limit, &active) {
[m[32m+                    if let Some(authority_config) =
[m[32m+                        self.config.authority_settings.get(&task.target_authority)
[m[32m+                    {
[m[32m+                        if !Self::check_rate_limit(
[m[32m+                            &task.target_authority,
[m[32m+                            authority_config.rate_limit,
[m[32m+                            &active,
[m[32m+                        ) {
[m                             tracing::debug!(
                                 authority = %task.target_authority,
                                 rate_limit = authority_config.rate_limit,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1186:
                             authority = %task_clone.target_authority,
                             "Report submitted successfully"
                         );
[31m-                    }
[m[32m+                    },
[m                     Err(e) => {
                         tracing::error!(
                             task_id = %task_clone.task_id,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1195:
                             attempt = task_clone.current_attempts,
                             "Report submission failed"
                         );
[31m-                    }
[m[32m+                    },
[m                 }
             });
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1229:
         // Apply submission timeout
         let timeout_duration = std::time::Duration::from_secs(config.submission_timeout_seconds);
 
[31m-        match tokio::time::timeout(timeout_duration, Self::execute_submission(task, authority_config)).await {
[m[32m+        match tokio::time::timeout(
[m[32m+            timeout_duration,
[m[32m+            Self::execute_submission(task, authority_config),
[m[32m+        )
[m[32m+        .await
[m[32m+        {
[m             Ok(Ok(_)) => Ok(()),
             Ok(Err(e)) => Err(e),
[31m-            Err(_) => Err(AutomatedReportingError::SubmissionFailed(
[m[31m-                format!("Submission timed out after {} seconds", config.submission_timeout_seconds)
[m[31m-            )),
[m[32m+            Err(_) => Err(AutomatedReportingError::SubmissionFailed(format!(
[m[32m+                "Submission timed out after {} seconds",
[m[32m+                config.submission_timeout_seconds
[m[32m+            ))),
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1254:
                 );
                 // Actual REST API submission would go here
                 Ok(())
[31m-            }
[m[32m+            },
[m             Some(SubmissionMethod::SFTP { host, path }) => {
                 tracing::info!(
                     task_id = %task.task_id,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1265:
                 );
                 // Actual SFTP submission would go here
                 Ok(())
[31m-            }
[m[32m+            },
[m             Some(SubmissionMethod::Email { recipient }) => {
                 tracing::info!(
                     task_id = %task.task_id,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1275:
                 );
                 // Actual email submission would go here
                 Ok(())
[31m-            }
[m[32m+            },
[m             Some(SubmissionMethod::WebPortal { url }) => {
                 tracing::info!(
                     task_id = %task.task_id,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1285:
                 );
                 // Actual web portal submission would go here
                 Ok(())
[31m-            }
[m[31m-            Some(SubmissionMethod::Database { connection_string: _ }) => {
[m[32m+            },
[m[32m+            Some(SubmissionMethod::Database {
[m[32m+                connection_string: _,
[m[32m+            }) => {
[m                 tracing::info!(
                     task_id = %task.task_id,
                     authority = %task.target_authority,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1294:
                 );
                 // Actual database submission would go here
                 Ok(())
[31m-            }
[m[31m-            None => {
[m[31m-                Err(AutomatedReportingError::ConfigurationError(
[m[31m-                    format!("No submission method configured for authority '{}'", task.target_authority)
[m[31m-                ))
[m[31m-            }
[m[32m+            },
[m[32m+            None => Err(AutomatedReportingError::ConfigurationError(format!(
[m[32m+                "No submission method configured for authority '{}'",
[m[32m+                task.target_authority
[m[32m+            ))),
[m         }
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1324:
     pub async fn record_report_generated(&self, generation_time_ms: f64) {
         let mut metrics = self.metrics.write().await;
         metrics.total_reports_generated += 1;
[31m-        metrics.average_generation_time_ms = 
[m[31m-            (metrics.average_generation_time_ms * (metrics.total_reports_generated - 1) as f64 + generation_time_ms) / 
[m[31m-            metrics.total_reports_generated as f64;
[m[32m+        metrics.average_generation_time_ms = (metrics.average_generation_time_ms
[m[32m+            * (metrics.total_reports_generated - 1) as f64
[m[32m+            + generation_time_ms)
[m[32m+            / metrics.total_reports_generated as f64;
[m         metrics.last_updated = Utc::now();
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1406:
         let total = metrics.total_reports_submitted;
         if total > 1 {
             metrics.average_submission_time_ms =
[31m-                (metrics.average_submission_time_ms * (total - 1) as f64 + submission_time_ms) / total as f64;
[m[32m+                (metrics.average_submission_time_ms * (total - 1) as f64 + submission_time_ms)
[m[32m+                    / total as f64;
[m         } else {
             metrics.average_submission_time_ms = submission_time_ms;
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1521:
 /// Automated reporting error types
 #[derive(Debug, thiserror::Error)]
 /// AutomatedReportingError
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum AutomatedReportingError {
     #[error("Automated reporting system is disabled")]
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/automated_reporting.rs:1549:
     // NotificationError variant
     NotificationError(String),
 }
[32m+
[mDiff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/mod.rs:13:
 #![deny(clippy::unwrap_used, clippy::expect_used)]
 
 pub mod audit_trails;
[31m-pub mod best_execution;
[m[31m-pub mod transaction_reporting;
[m[31m-pub mod sox_compliance;
[m pub mod automated_reporting;
[31m-pub mod regulatory_api;
[m[32m+pub mod best_execution;
[m pub mod compliance_reporting;
 pub mod iso27001_compliance;
[32m+pub mod regulatory_api;
[m[32m+pub mod sox_compliance;
[m[32m+pub mod transaction_reporting;
[m // TODO: Implement missing compliance modules
 // pub mod market_surveillance;
 // pub mod regulatory_reporting;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/mod.rs:28:
 // pub mod mar_compliance;
 
 // Re-export key types from submodules for easier access
[32m+pub use audit_trails::{
[m[32m+    AuditEventDetails, AuditEventType, AuditTrailConfig, AuditTrailEngine, AuditTrailError,
[m[32m+    TransactionAuditEvent,
[m[32m+};
[m pub use best_execution::{
     BestExecutionAnalysis, BestExecutionAnalyzer, BestExecutionConfig, BestExecutionError,
     ExecutionQualityMetrics, TransactionCostBreakdown, VenueAnalysis,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/mod.rs:34:
[31m-};
[m[31m-pub use audit_trails::{
[m[31m-    TransactionAuditEvent, AuditTrailEngine, AuditTrailConfig,
[m[31m-    AuditEventType, AuditEventDetails, AuditTrailError
[m };
 pub use transaction_reporting::TransactionReport;
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:9:
 
 #![deny(clippy::unwrap_used, clippy::expect_used)]
 
[31m-use std::collections::HashMap;
[m[31m-use chrono::{DateTime, Utc, Duration};
[m[31m-use serde::{Serialize, Deserialize};
[m[32m+use super::best_execution::{FindingSeverity, ModelAccuracy};
[m[32m+use chrono::{DateTime, Duration, Utc};
[m use rust_decimal::Decimal;
[31m-use super::best_execution::{ModelAccuracy, FindingSeverity};
[m[32m+use serde::{Deserialize, Serialize};
[m[32m+use std::collections::HashMap;
[m 
 /// SOX Compliance Manager
 #[derive(Debug)]
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:33:
 /// SOX compliance configuration
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// SOXConfig
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct SOXConfig {
     /// Enable Section 302 controls
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:55:
 /// Management certification configuration
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ManagementCertificationConfig
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ManagementCertificationConfig {
     /// Required certification level
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:71:
 /// Certification levels
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// CertificationLevel
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum CertificationLevel {
     /// CEO/CFO certification
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:85:
 /// Officer roles for certification
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// OfficerRole
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum OfficerRole {
     /// Chief Executive Officer
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:103:
 /// Testing frequency for controls
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// TestingFrequency
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum TestingFrequency {
     /// Daily testing
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:121:
 /// Escalation policies
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// EscalationPolicies
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct EscalationPolicies {
     /// Control deficiency escalation
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:135:
 /// Individual escalation policy
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// EscalationPolicy
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct EscalationPolicy {
     /// Initial escalation time (minutes)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:149:
 /// Escalation level
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// EscalationLevel
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct EscalationLevel {
     /// Level number
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:163:
 /// Notification methods
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// NotificationMethod
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum NotificationMethod {
     /// Email notification
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:179:
 /// Internal Controls Engine
 #[derive(Debug)]
 /// InternalControlsEngine
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct InternalControlsEngine {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:191:
 /// Internal control definition
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// InternalControl
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct InternalControl {
     /// Control identifier
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:221:
 /// Control types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ControlType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ControlType {
     /// Preventive control
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:237:
 /// Control frequency
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ControlFrequency
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ControlFrequency {
     /// Real-time/continuous
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:259:
 /// Risk levels
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RiskLevel
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum RiskLevel {
     /// Critical risk
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:275:
 /// Testing procedure
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// TestingProcedure
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct TestingProcedure {
     /// Procedure ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:295:
 /// Testing methods
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// TestingMethod
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum TestingMethod {
     /// Observation of process
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:313:
 /// Implementation status
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ImplementationStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ImplementationStatus {
     /// Not implemented
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:331:
 /// Control testing engine
 #[derive(Debug)]
 /// ControlTestingEngine
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct ControlTestingEngine {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:342:
 /// Test schedule
 #[derive(Debug, Clone)]
 /// TestSchedule
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct TestSchedule {
     /// Control Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:356:
 /// Scheduled test
 #[derive(Debug, Clone)]
 /// ScheduledTest
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ScheduledTest {
     /// Test Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:374:
 /// Test types
 #[derive(Debug, Clone)]
 /// TestType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum TestType {
     /// Design effectiveness test
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:390:
 /// Test status
 #[derive(Debug, Clone)]
 /// TestStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum TestStatus {
     /// Scheduled
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:408:
 /// Control test result
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ControlTestResult
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ControlTestResult {
     /// Test ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:432:
 /// Tester information
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// TesterInfo
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct TesterInfo {
     /// Tester ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:448:
 /// Test conclusion
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// TestConclusion
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum TestConclusion {
     /// Control is operating effectively
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:466:
 /// Test evidence
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// TestEvidence
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct TestEvidence {
     /// Evidence ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:484:
 /// Evidence types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// EvidenceType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum EvidenceType {
     /// Document review
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:504:
 /// Control deficiency
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ControlDeficiency
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ControlDeficiency {
     /// Deficiency ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:534:
 /// Deficiency types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// DeficiencyType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum DeficiencyType {
     /// Design deficiency
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:548:
 /// Deficiency severity
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// DeficiencySeverity
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum DeficiencySeverity {
     /// Material weakness
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:562:
 /// Remediation plan
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RemediationPlan
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RemediationPlan {
     /// Plan ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:580:
 /// Remediation action
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RemediationAction
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RemediationAction {
     /// Action ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:598:
 /// Action status
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ActionStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ActionStatus {
     /// Not started
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:616:
 /// Progress update
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ProgressUpdate
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ProgressUpdate {
     /// Update date
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:632:
 /// Deficiency status
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// DeficiencyStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum DeficiencyStatus {
     /// Open
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:648:
 /// Management response
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ManagementResponse
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ManagementResponse {
     /// Response ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:670:
 /// Deficiency tracker
 #[derive(Debug)]
 /// DeficiencyTracker
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct DeficiencyTracker {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:681:
 /// Deficiency metrics
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// DeficiencyMetrics
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct DeficiencyMetrics {
     /// Total deficiencies
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:701:
 /// Segregation of Duties Manager
 #[derive(Debug)]
 /// SegregationOfDutiesManager
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct SegregationOfDutiesManager {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:713:
 /// Segregation matrix
 #[derive(Debug, Clone)]
 /// SegregationMatrix
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct SegregationMatrix {
     /// Role definitions
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:727:
 /// Role definition
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RoleDefinition
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RoleDefinition {
     /// Role ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:747:
 /// Permission definition
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// Permission
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct Permission {
     /// Permission ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:763:
 /// Incompatible roles
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// IncompatibleRoles
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct IncompatibleRoles {
     /// Rule ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:781:
 /// Required separation
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RequiredSeparation
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RequiredSeparation {
     /// Separation ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:797:
 /// Conflict detector
 #[derive(Debug)]
 /// ConflictDetector
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct ConflictDetector {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:804:
[31m-#[allow(dead_code)]
[m[32m+    #[allow(dead_code)]
[m     detection_rules: Vec<ConflictDetectionRule>,
     active_conflicts: Vec<DetectedConflict>,
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:809:
 /// Conflict detection rule
 #[derive(Debug, Clone)]
 /// ConflictDetectionRule
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ConflictDetectionRule {
     /// Rule Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:825:
 /// Conflict rule types
 #[derive(Debug, Clone)]
 /// ConflictRuleType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ConflictRuleType {
     /// Role conflict
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:841:
 /// Conflict severity
 #[derive(Debug, Clone)]
 /// ConflictSeverity
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ConflictSeverity {
     /// Critical - must be resolved immediately
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:857:
 /// Detected conflict
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// DetectedConflict
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct DetectedConflict {
     /// Conflict ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:881:
 /// Conflict resolution status
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ConflictResolutionStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ConflictResolutionStatus {
     /// Open - needs resolution
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:899:
 /// Approval workflow
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ApprovalWorkflow
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ApprovalWorkflow {
     /// Workflow ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:917:
 /// Approval step
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ApprovalStep
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ApprovalStep {
     /// Step number
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:935:
 /// Approval types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ApprovalType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ApprovalType {
     /// Any one approver
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:951:
 /// Timeout settings
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// TimeoutSettings
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct TimeoutSettings {
     /// Default timeout (hours)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:965:
 /// Change Management System
 #[derive(Debug)]
 /// ChangeManagementSystem
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct ChangeManagementSystem {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:978:
 /// Change request
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ChangeRequest
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ChangeRequest {
     /// Change ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1010:
 /// Change types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ChangeType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ChangeType {
     /// Emergency change
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1026:
 /// Change priority
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ChangePriority
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ChangePriority {
     /// Critical priority
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1042:
 /// Risk assessment
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RiskAssessment
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RiskAssessment {
     /// Overall risk level
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1058:
 /// Risk factor
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RiskFactor
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RiskFactor {
     /// Factor name
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1074:
 /// Impact analysis
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ImpactAnalysis
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ImpactAnalysis {
     /// Affected systems
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1092:
 /// Business impact
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// BusinessImpact
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct BusinessImpact {
     /// Impact level
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1108:
 /// Technical impact
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// TechnicalImpact
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct TechnicalImpact {
     /// Performance impact
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1124:
 /// Compliance impact
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ComplianceImpact
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ComplianceImpact {
     /// Regulatory requirements affected
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1138:
 /// Impact levels
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ImpactLevel
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ImpactLevel {
     /// Critical impact
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1156:
 /// Implementation plan
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ImplementationPlan
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ImplementationPlan {
     /// Implementation steps
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1174:
 /// Implementation step
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ImplementationStep
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ImplementationStep {
     /// Step number
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1194:
 /// Rollback plan
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RollbackPlan
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RollbackPlan {
     /// Rollback steps
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1210:
 /// Rollback step
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RollbackStep
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RollbackStep {
     /// Step number
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1226:
 /// Change approval status
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ChangeApprovalStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ChangeApprovalStatus {
     /// Pending approval
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1242:
 /// Change implementation status
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ChangeImplementationStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ChangeImplementationStatus {
     /// Not started
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1260:
 /// Change approval engine
 #[derive(Debug)]
 /// ChangeApprovalEngine
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct ChangeApprovalEngine {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1271:
 /// Approval record
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ApprovalRecord
[31m-/// 
[m[32m+///
[m #[allow(dead_code)]
 /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ApprovalRecord {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1292:
 /// Approval decisions
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ApprovalDecision
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ApprovalDecision {
     /// Approved
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1308:
 /// Change impact analyzer
 #[derive(Debug)]
 /// ChangeImpactAnalyzer
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct ChangeImpactAnalyzer {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1319:
 /// Impact model
 #[derive(Debug, Clone)]
 /// ImpactModel
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ImpactModel {
     /// Model Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1326:
     pub model_id: String,
[31m-#[allow(dead_code)]
[m[32m+    #[allow(dead_code)]
[m     /// Model Type
     pub model_type: String,
     /// Parameters
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1336:
 /// Dependency graph
 #[derive(Debug, Clone)]
 /// DependencyGraph
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct DependencyGraph {
     /// Nodes
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1348:
 /// Dependency node
 #[derive(Debug, Clone)]
 /// DependencyNode
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct DependencyNode {
     /// Node Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1362:
 /// Dependency edge
 #[derive(Debug, Clone)]
 /// DependencyEdge
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct DependencyEdge {
     /// From Node
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1378:
 /// Access Control Matrix
 #[derive(Debug)]
 /// AccessControlMatrix
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct AccessControlMatrix {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1390:
 /// User role assignment
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// UserRoleAssignment
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct UserRoleAssignment {
     /// User ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1398:
     /// Assigned roles
     pub roles: Vec<AssignedRole>,
     /// Last review date
[31m-#[allow(dead_code)]
[m[32m+    #[allow(dead_code)]
[m     pub last_review_date: DateTime<Utc>,
     /// Next review due date
     pub next_review_date: DateTime<Utc>,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1409:
 /// Assigned role
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AssignedRole
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct AssignedRole {
     /// Role ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1427:
 /// Assignment status
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AssignmentStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum AssignmentStatus {
     /// Active assignment
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1445:
 /// Role permissions
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// RolePermissions
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct RolePermissions {
     /// Role ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1463:
 /// Access review
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AccessReview
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct AccessReview {
     /// Review ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1485:
 /// Access review types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AccessReviewType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum AccessReviewType {
     /// User access review
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1501:
 /// Review scope
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ReviewScope
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ReviewScope {
     /// Users in scope
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1517:
 /// Review period
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ReviewPeriod
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ReviewPeriod {
     /// Start date
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1529:
 /// Access review finding
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AccessReviewFinding
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct AccessReviewFinding {
     /// Finding ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1551:
 /// Access finding types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AccessFindingType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum AccessFindingType {
     /// Excessive access
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1571:
 /// Review status
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ReviewStatus
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum ReviewStatus {
     /// In progress
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1587:
 /// SOX Audit Logger
 #[derive(Debug)]
 /// SOXAuditLogger
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 #[allow(dead_code)]
 pub struct SOXAuditLogger {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1598:
 /// SOX audit event
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// SOXAuditEvent
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct SOXAuditEvent {
     /// Event ID
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1624:
 /// SOX event types
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// SOXEventType
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum SOXEventType {
     /// Control testing event
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1654:
 /// Event outcomes
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// EventOutcome
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum EventOutcome {
     /// Success
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1670:
 /// Audit retention policy
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// AuditRetentionPolicy
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct AuditRetentionPolicy {
     /// Retention period (days)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1714:
                             delay_minutes: 120,
                         },
                     ],
[31m-                    notification_methods: vec![NotificationMethod::Email, NotificationMethod::Dashboard],
[m[32m+                    notification_methods: vec![
[m[32m+                        NotificationMethod::Email,
[m[32m+                        NotificationMethod::Dashboard,
[m[32m+                    ],
[m                 },
                 material_weakness_escalation: EscalationPolicy {
                     initial_escalation_time: 15,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1734:
                 },
                 significant_deficiency_escalation: EscalationPolicy {
                     initial_escalation_time: 30,
[31m-                    escalation_levels: vec![
[m[31m-                        EscalationLevel {
[m[31m-                            level: 1,
[m[31m-                            target_roles: vec!["director".to_string()],
[m[31m-                            delay_minutes: 30,
[m[31m-                        },
[m[31m-                    ],
[m[32m+                    escalation_levels: vec![EscalationLevel {
[m[32m+                        level: 1,
[m[32m+                        target_roles: vec!["director".to_string()],
[m[32m+                        delay_minutes: 30,
[m[32m+                    }],
[m                     notification_methods: vec![NotificationMethod::Email],
                 },
             },
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1762:
     }
 
     /// Assess overall SOX compliance
[31m-    pub async fn assess_sox_compliance(&self) -> Result<SOXComplianceAssessment, SOXComplianceError> {
[m[32m+    pub async fn assess_sox_compliance(
[m[32m+        &self,
[m[32m+    ) -> Result<SOXComplianceAssessment, SOXComplianceError> {
[m         // Assess internal controls effectiveness
[31m-        let controls_assessment = self.internal_controls.assess_controls_effectiveness().await?;
[m[32m+        let controls_assessment = self
[m[32m+            .internal_controls
[m[32m+            .assess_controls_effectiveness()
[m[32m+            .await?;
[m 
         // Check segregation of duties compliance
[31m-        let sod_assessment = self.segregation_duties.assess_segregation_compliance().await?;
[m[32m+        let sod_assessment = self
[m[32m+            .segregation_duties
[m[32m+            .assess_segregation_compliance()
[m[32m+            .await?;
[m 
         // Evaluate change management controls
         let change_mgmt_assessment = self.change_management.assess_change_controls().await?;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1776:
         let access_assessment = self.access_control.assess_access_controls().await?;
 
         // Calculate overall compliance score
[31m-        let overall_score = self.calculate_overall_compliance_score(&controls_assessment, &sod_assessment, &change_mgmt_assessment, &access_assessment);
[m[32m+        let overall_score = self.calculate_overall_compliance_score(
[m[32m+            &controls_assessment,
[m[32m+            &sod_assessment,
[m[32m+            &change_mgmt_assessment,
[m[32m+            &access_assessment,
[m[32m+        );
[m 
         Ok(SOXComplianceAssessment {
             assessment_date: Utc::now(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1792:
     }
 
     /// Generate management certification report
[31m-    pub async fn generate_management_certification(&self, officer: &OfficerRole) -> Result<ManagementCertificationReport, SOXComplianceError> {
[m[32m+    pub async fn generate_management_certification(
[m[32m+        &self,
[m[32m+        officer: &OfficerRole,
[m[32m+    ) -> Result<ManagementCertificationReport, SOXComplianceError> {
[m         let assessment = self.assess_sox_compliance().await?;
 
         Ok(ManagementCertificationReport {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1805:
             },
             compliance_assertions: self.generate_compliance_assertions(&assessment),
             material_changes: self.identify_material_changes().await,
[31m-            deficiencies_disclosed: assessment.material_weaknesses.len() + assessment.significant_deficiencies.len(),
[m[32m+            deficiencies_disclosed: assessment.material_weaknesses.len()
[m[32m+                + assessment.significant_deficiencies.len(),
[m             certification_statement: self.generate_certification_statement(officer, &assessment),
         })
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1812:
 
     // Helper methods with placeholder implementations
[31m-    fn calculate_overall_compliance_score(&self, _controls: &str, _sod: &str, _change: &str, _access: &str) -> f64 {
[m[32m+    fn calculate_overall_compliance_score(
[m[32m+        &self,
[m[32m+        _controls: &str,
[m[32m+        _sod: &str,
[m[32m+        _change: &str,
[m[32m+        _access: &str,
[m[32m+    ) -> f64 {
[m         85.0 // Placeholder score
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1818:
     async fn generate_compliance_recommendations(&self) -> Vec<ComplianceRecommendation> {
[31m-        vec![
[m[31m-            ComplianceRecommendation {
[m[31m-                recommendation_id: "REC-001".to_string(),
[m[31m-                category: "Internal Controls".to_string(),
[m[31m-                priority: "High".to_string(),
[m[31m-                description: "Implement automated control testing".to_string(),
[m[31m-                target_date: Utc::now() + Duration::days(90),
[m[31m-            }
[m[31m-        ]
[m[32m+        vec![ComplianceRecommendation {
[m[32m+            recommendation_id: "REC-001".to_string(),
[m[32m+            category: "Internal Controls".to_string(),
[m[32m+            priority: "High".to_string(),
[m[32m+            description: "Implement automated control testing".to_string(),
[m[32m+            target_date: Utc::now() + Duration::days(90),
[m[32m+        }]
[m     }
 
[31m-    fn generate_compliance_assertions(&self, _assessment: &SOXComplianceAssessment) -> Vec<ComplianceAssertion> {
[m[31m-        vec![
[m[31m-            ComplianceAssertion {
[m[31m-                assertion_type: "Design Effectiveness".to_string(),
[m[31m-                statement: "Internal controls are properly designed".to_string(),
[m[31m-                confidence_level: 0.95,
[m[31m-            }
[m[31m-        ]
[m[32m+    fn generate_compliance_assertions(
[m[32m+        &self,
[m[32m+        _assessment: &SOXComplianceAssessment,
[m[32m+    ) -> Vec<ComplianceAssertion> {
[m[32m+        vec![ComplianceAssertion {
[m[32m+            assertion_type: "Design Effectiveness".to_string(),
[m[32m+            statement: "Internal controls are properly designed".to_string(),
[m[32m+            confidence_level: 0.95,
[m[32m+        }]
[m     }
 
     async fn identify_material_changes(&self) -> Vec<MaterialChange> {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1841:
         vec![] // Placeholder
     }
 
[31m-    fn generate_certification_statement(&self, _officer: &OfficerRole, _assessment: &SOXComplianceAssessment) -> String {
[m[32m+    fn generate_certification_statement(
[m[32m+        &self,
[m[32m+        _officer: &OfficerRole,
[m[32m+        _assessment: &SOXComplianceAssessment,
[m[32m+    ) -> String {
[m         "I certify that the internal controls over financial reporting are effective.".to_string()
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1854:
 // Supporting structures
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// SOXComplianceAssessment
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct SOXComplianceAssessment {
     /// Assessment Date
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1879:
 
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ComplianceRecommendation
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ComplianceRecommendation {
     /// Recommendation Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1896:
 
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ManagementCertificationReport
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ManagementCertificationReport {
     /// Certification Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1919:
 
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// CertificationPeriod
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct CertificationPeriod {
     /// Start Date
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1930:
 
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// ComplianceAssertion
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct ComplianceAssertion {
     /// Assertion Type
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:1943:
 
 #[derive(Debug, Clone, Serialize, Deserialize)]
 /// MaterialChange
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub struct MaterialChange {
     /// Change Id
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:2102:
         // - Use lock-free ring buffer for HFT compatibility
         // - Batch events for efficient disk writes
         // - Compress and encrypt per retention policy
[31m-        
[m[32m+
[m         Ok(())
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:2109:
     /// Log control testing event
[31m-    pub async fn log_control_testing(&mut self, control_id: &str, test_result: &ControlTestResult) -> Result<(), SOXComplianceError> {
[m[32m+    pub async fn log_control_testing(
[m[32m+        &mut self,
[m[32m+        control_id: &str,
[m[32m+        test_result: &ControlTestResult,
[m[32m+    ) -> Result<(), SOXComplianceError> {
[m         let event = SOXAuditEvent {
             event_id: format!("CT-{}-{}", control_id, Utc::now().timestamp_millis()),
             event_type: SOXEventType::ControlTesting,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:2128:
     }
 
     /// Log deficiency identification
[31m-    pub async fn log_deficiency(&mut self, deficiency: &ControlDeficiency) -> Result<(), SOXComplianceError> {
[m[32m+    pub async fn log_deficiency(
[m[32m+        &mut self,
[m[32m+        deficiency: &ControlDeficiency,
[m[32m+    ) -> Result<(), SOXComplianceError> {
[m         let event = SOXAuditEvent {
[31m-            event_id: format!("DEF-{}-{}", deficiency.deficiency_id, Utc::now().timestamp_millis()),
[m[32m+            event_id: format!(
[m[32m+                "DEF-{}-{}",
[m[32m+                deficiency.deficiency_id,
[m[32m+                Utc::now().timestamp_millis()
[m[32m+            ),
[m             event_type: SOXEventType::DeficiencyIdentified,
             timestamp: Utc::now(),
             actor: "system".to_string(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:2145:
     }
 
     /// Log access control changes
[31m-    pub async fn log_access_change(&mut self, user_id: &str, action: &str, resource: &str) -> Result<(), SOXComplianceError> {
[m[32m+    pub async fn log_access_change(
[m[32m+        &mut self,
[m[32m+        user_id: &str,
[m[32m+        action: &str,
[m[32m+        resource: &str,
[m[32m+    ) -> Result<(), SOXComplianceError> {
[m         let event_type = match action {
             "grant" => SOXEventType::AccessGranted,
             "revoke" => SOXEventType::AccessRevoked,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:2161:
             resource: resource.to_string(),
             details: {
                 let mut details = HashMap::new();
[31m-                details.insert("action".to_string(), serde_json::Value::String(action.to_string()));
[m[32m+                details.insert(
[m[32m+                    "action".to_string(),
[m[32m+                    serde_json::Value::String(action.to_string()),
[m[32m+                );
[m                 details
             },
             outcome: EventOutcome::Success,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:2181:
     }
 
     /// Helper to serialize test results
[31m-    fn serialize_test_result(&self, test_result: &ControlTestResult) -> Result<HashMap<String, serde_json::Value>, SOXComplianceError> {
[m[32m+    fn serialize_test_result(
[m[32m+        &self,
[m[32m+        test_result: &ControlTestResult,
[m[32m+    ) -> Result<HashMap<String, serde_json::Value>, SOXComplianceError> {
[m         let mut details = HashMap::new();
[31m-        details.insert("test_id".to_string(), serde_json::Value::String(test_result.test_id.clone()));
[m[31m-        details.insert("conclusion".to_string(), serde_json::json!(test_result.conclusion));
[m[31m-        details.insert("evidence_count".to_string(), serde_json::Value::Number(serde_json::Number::from(test_result.evidence.len())));
[m[31m-    // Ok variant
[m[32m+        details.insert(
[m[32m+            "test_id".to_string(),
[m[32m+            serde_json::Value::String(test_result.test_id.clone()),
[m[32m+        );
[m[32m+        details.insert(
[m[32m+            "conclusion".to_string(),
[m[32m+            serde_json::json!(test_result.conclusion),
[m[32m+        );
[m[32m+        details.insert(
[m[32m+            "evidence_count".to_string(),
[m[32m+            serde_json::Value::Number(serde_json::Number::from(test_result.evidence.len())),
[m[32m+        );
[m[32m+        // Ok variant
[m         Ok(details)
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:2193:
     /// Helper to serialize deficiencies
[31m-    fn serialize_deficiency(&self, deficiency: &ControlDeficiency) -> Result<HashMap<String, serde_json::Value>, SOXComplianceError> {
[m[32m+    fn serialize_deficiency(
[m[32m+        &self,
[m[32m+        deficiency: &ControlDeficiency,
[m[32m+    ) -> Result<HashMap<String, serde_json::Value>, SOXComplianceError> {
[m         let mut details = HashMap::new();
[31m-        details.insert("severity".to_string(), serde_json::json!(deficiency.severity));
[m[31m-        details.insert("description".to_string(), serde_json::Value::String(deficiency.description.clone()));
[m[31m-        details.insert("root_cause".to_string(), serde_json::Value::String(deficiency.root_cause.clone()));
[m[31m-    // Ok variant
[m[32m+        details.insert(
[m[32m+            "severity".to_string(),
[m[32m+            serde_json::json!(deficiency.severity),
[m[32m+        );
[m[32m+        details.insert(
[m[32m+            "description".to_string(),
[m[32m+            serde_json::Value::String(deficiency.description.clone()),
[m[32m+        );
[m[32m+        details.insert(
[m[32m+            "root_cause".to_string(),
[m[32m+            serde_json::Value::String(deficiency.root_cause.clone()),
[m[32m+        );
[m[32m+        // Ok variant
[m         Ok(details)
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/compliance/sox_compliance.rs:2216:
 /// SOX compliance error types
 #[derive(Debug, thiserror::Error)]
 /// SOXComplianceError
[31m-/// 
[m[32m+///
[m /// Auto-generated documentation placeholder - enhance with specifics
 pub enum SOXComplianceError {
     #[error("Control testing failed: {0}")]
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/comprehensive_performance_benchmarks.rs:921:
             let symbol = Symbol::from("TEST");
             let quantity = Quantity::from_f64(100.0)
                 .map_err(|e| format!("Failed to create quantity: {}", e))?;
[31m-            let price = Price::from_f64(500.0)
[m[31m-                .map_err(|e| format!("Failed to create price: {}", e))?;
[m[32m+            let price =
[m[32m+                Price::from_f64(500.0).map_err(|e| format!("Failed to create price: {}", e))?;
[m             let _order = Order::limit(symbol, OrderSide::Buy, quantity, price);
 
             let end = unsafe { _rdtsc() };
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/comprehensive_performance_benchmarks.rs:955:
             let symbol = Symbol::from("TEST");
             let quantity = Quantity::from_f64(100.0)
                 .map_err(|e| format!("Failed to create quantity: {}", e))?;
[31m-            let price = Price::from_f64(500.0)
[m[31m-                .map_err(|e| format!("Failed to create price: {}", e))?;
[m[32m+            let price =
[m[32m+                Price::from_f64(500.0).map_err(|e| format!("Failed to create price: {}", e))?;
[m             let order = Order::limit(symbol, OrderSide::Buy, quantity, price);
 
             let start = unsafe { _rdtsc() };
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/comprehensive_performance_benchmarks.rs:993:
             let symbol = Symbol::from("TEST");
             let quantity = Quantity::from_f64(100.0)
                 .map_err(|e| format!("Failed to create quantity: {}", e))?;
[31m-            let price = Price::from_f64(500.0)
[m[31m-                .map_err(|e| format!("Failed to create price: {}", e))?;
[m[32m+            let price =
[m[32m+                Price::from_f64(500.0).map_err(|e| format!("Failed to create price: {}", e))?;
[m             let order = Order::limit(symbol, OrderSide::Buy, quantity, price);
 
             let start = unsafe { _rdtsc() };
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/comprehensive_performance_benchmarks.rs:1087:
             let symbol = Symbol::from("TEST");
             let quantity = Quantity::from_f64(100.0)
                 .map_err(|e| format!("Failed to create quantity: {}", e))?;
[31m-            let price = Price::from_f64(500.0)
[m[31m-                .map_err(|e| format!("Failed to create price: {}", e))?;
[m[32m+            let price =
[m[32m+                Price::from_f64(500.0).map_err(|e| format!("Failed to create price: {}", e))?;
[m             let order = Order::limit(symbol, OrderSide::Buy, quantity, price);
 
             // Validate order
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/events/postgres_writer.rs:152:
                     tracing::error!("Batch receiver not available - processing task cannot start");
                     metrics.increment_failed_writes();
                     return;
[31m-                }
[m[32m+                },
[m             };
 
             while !shutdown.load(Ordering::Relaxed) {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/lib.rs:60:
 // SIMD features are detected at runtime instead of using unstable features
 
 // Unused crate dependencies (used in features or other contexts)
[32m+extern crate chacha20poly1305 as _;
[m #[allow(unused_extern_crates)]
 extern crate dashmap as _;
 extern crate log as _;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/lib.rs:66:
[31m-extern crate chacha20poly1305 as _;
[m extern crate zeroize as _;
 
 /// Core trading types with optimized memory layout and financial safety
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/lib.rs:80:
 // Re-export commonly used SIMD types for convenience
 #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
 pub use simd::{
[31m-    AlignedPrices, AlignedVolumes, SimdPriceOps, SimdRiskEngine,
[m[31m-    SimdMarketDataOps, SafeSimdDispatcher, CpuFeatures, SimdLevel
[m[32m+    AlignedPrices, AlignedVolumes, CpuFeatures, SafeSimdDispatcher, SimdLevel, SimdMarketDataOps,
[m[32m+    SimdPriceOps, SimdRiskEngine,
[m };
 
 #[cfg(feature = "wide")]
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/lockfree/atomic_ops.rs:162:
                 SystemTime::now()
                     .duration_since(UNIX_EPOCH)
                     .unwrap_or_default()
[31m-                    .as_nanos() as u64
[m[32m+                    .as_nanos() as u64,
[m             ),
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/lockfree/atomic_ops.rs:189:
     pub fn operations_per_second(&self) -> f64 {
         let ops = self.operations_count.load(Ordering::Relaxed);
         let start_ns = self.start_time_ns.load(Ordering::Relaxed);
[31m-        
[m[32m+
[m         let now_ns = SystemTime::now()
             .duration_since(UNIX_EPOCH)
             .unwrap_or_default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/lockfree/atomic_ops.rs:196:
             .as_nanos() as u64;
[31m-        
[m[32m+
[m         let elapsed_ns = now_ns.saturating_sub(start_ns);
         let elapsed_secs = elapsed_ns as f64 / 1_000_000_000.0;
[31m-        
[m[32m+
[m         if elapsed_secs > 0.0 {
             ops as f64 / elapsed_secs
         } else {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/lockfree/atomic_ops.rs:301:
                 .duration_since(UNIX_EPOCH)
                 .unwrap_or_default()
                 .as_nanos() as u64,
[31m-            Ordering::Relaxed
[m[32m+            Ordering::Relaxed,
[m         );
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/lockfree/mod.rs:48:
 pub mod small_batch_ring;
 
 // Re-export key types for external use
[32m+pub use atomic_ops::{AtomicMetrics, SequenceGenerator};
[m pub use ring_buffer::LockFreeRingBuffer;
 pub use small_batch_ring::{BatchMode, SmallBatchOrdersSoA, SmallBatchRing};
[31m-pub use atomic_ops::{AtomicMetrics, SequenceGenerator};
[m 
 // High-performance shared memory channel implementation
 use std::sync::atomic::{AtomicU64, Ordering};
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/persistence/backup.rs:171:
         let backup_id = self.generate_backup_id();
         let backup_timestamp = SystemTime::now()
             .duration_since(UNIX_EPOCH)
[31m-            .map_err(|e| BackupError::Io(std::io::Error::new(
[m[31m-                std::io::ErrorKind::Other,
[m[31m-                format!("Failed to get system time: {}", e)
[m[31m-            )))?
[m[32m+            .map_err(|e| {
[m[32m+                BackupError::Io(std::io::Error::new(
[m[32m+                    std::io::ErrorKind::Other,
[m[32m+                    format!("Failed to get system time: {}", e),
[m[32m+                ))
[m[32m+            })?
[m             .as_secs();
 
         // Create backup directory
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/persistence/backup.rs:474:
         let retention_seconds = self.config.retention_days as u64 * 24 * 3600;
         let current_time = SystemTime::now()
             .duration_since(UNIX_EPOCH)
[31m-            .map_err(|e| BackupError::Io(std::io::Error::new(
[m[31m-                std::io::ErrorKind::Other,
[m[31m-                format!("Failed to get system time: {}", e)
[m[31m-            )))?
[m[32m+            .map_err(|e| {
[m[32m+                BackupError::Io(std::io::Error::new(
[m[32m+                    std::io::ErrorKind::Other,
[m[32m+                    format!("Failed to get system time: {}", e),
[m[32m+                ))
[m[32m+            })?
[m             .as_secs();
         let cutoff_time = current_time.saturating_sub(retention_seconds);
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/prelude.rs:7:
 
 // Re-export timing types for benchmarks and performance monitoring
 pub use crate::timing::{
[31m-    calibrate_tsc, get_tsc_reliability, is_tsc_reliable, reset_tsc_calibration,
[m[31m-    HardwareTimestamp, HftLatencyTracker, LatencyMeasurement, LatencyStats, TimingSafetyConfig,
[m[31m-    TimingSource,
[m[32m+    calibrate_tsc, get_tsc_reliability, is_tsc_reliable, reset_tsc_calibration, HardwareTimestamp,
[m[32m+    HftLatencyTracker, LatencyMeasurement, LatencyStats, TimingSafetyConfig, TimingSource,
[m };
 
 // Re-export types from common crate for convenience
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/simd/mod.rs:1903:
 
             // Test sum with various sizes
             let test_cases = vec![
[31m-                vec![1.0, 2.0, 3.0, 4.0], // 4 elements
[m[32m+                vec![1.0, 2.0, 3.0, 4.0],                     // 4 elements
[m                 vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], // 8 elements
[31m-                vec![1.0; 100], // 100 elements
[m[32m+                vec![1.0; 100],                               // 100 elements
[m             ];
 
             for prices in test_cases {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/simd/mod.rs:1913:
                 let simd_sum = price_ops.sum_aligned(&aligned_prices);
                 let expected_sum: f64 = prices.iter().sum();
 
[31m-                assert!((simd_sum - expected_sum).abs() < 1e-10,
[m[31m-                       "SIMD sum {} should match expected {}", simd_sum, expected_sum);
[m[32m+                assert!(
[m[32m+                    (simd_sum - expected_sum).abs() < 1e-10,
[m[32m+                    "SIMD sum {} should match expected {}",
[m[32m+                    simd_sum,
[m[32m+                    expected_sum
[m[32m+                );
[m             }
         }
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/small_batch_optimizer.rs:614:
                 1.0,
                 50000.0 + i as f64,
             );
[31m-            processor.add_order(order).expect("Test: Failed to add order");
[m[32m+            processor
[m[32m+                .add_order(order)
[m[32m+                .expect("Test: Failed to add order");
[m         }
 
         // Process batch
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/small_batch_optimizer.rs:621:
[31m-        let result = processor.process_batch().expect("Test: Failed to process batch");
[m[32m+        let result = processor
[m[32m+            .process_batch()
[m[32m+            .expect("Test: Failed to process batch");
[m 
         assert_eq!(result.orders_processed, 3);
         assert!(result.total_notional > 0.0);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:281:
                 // Prevents overflow after 8.5+ hours uptime (>18.4 quintillion cycles at 3GHz)
                 let cycles_u128 = cycles as u128;
                 let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
[31m-                
[m[32m+
[m                 // Overflow detection: warn if approaching u64::MAX (unlikely but possible)
                 if nanos_u128 > u64::MAX as u128 {
                     tracing::error!(
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:367:
                 // Use u128 to handle large cycle counts without overflow
                 let cycles_u128 = cycles2 as u128;
                 let nanos_u128 = cycles_u128 * 1_000_000_000u128 / freq as u128;
[31m-                
[m[32m+
[m                 if nanos_u128 > u64::MAX as u128 {
                     return Err(anyhow!(
                         "TSC calculation overflow: cycles={}, freq={}, result={}",
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:374:
[31m-                        cycles2, freq, nanos_u128
[m[32m+                        cycles2,
[m[32m+                        freq,
[m[32m+                        nanos_u128
[m                     ));
                 }
                 nanos_u128 as u64
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:496:
 ///
 /// **FIX 4 (UNRESTRICTED CALIBRATION ACCESS - CRITICAL):**
 /// This function is now restricted and logged to prevent timing manipulation attacks.
[31m-/// 
[m[32m+///
[m /// **Access Control Measures:**
 /// - Audit logging of all calibration attempts
 /// - Rate limiting prevents DoS via repeated calibration
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:506:
 /// - PUBLIC function allowed any module to recalibrate system timing
 /// - No authentication or authorization checks
 /// - **IMPACT:** Market manipulation, order sequencing attacks, regulatory violations
[31m-/// 
[m[32m+///
[m /// **Production Recommendations:**
 /// - Monitor calibration attempts in production environments
 /// - Alert on calibration during trading hours
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:516:
     tracing::warn!(
         "TSC calibration initiated - this is a privileged operation that affects system-wide timing"
     );
[31m-    
[m[32m+
[m     calibrate_tsc_with_config(&TimingSafetyConfig::default())
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:875:
         // Simulate 3GHz CPU running for 10 hours
         const THREE_GHZ: u64 = 3_000_000_000;
         const TEN_HOURS_CYCLES: u64 = THREE_GHZ * 60 * 60 * 10;
[31m-        
[m[32m+
[m         // Set up test TSC frequency
         TSC_FREQUENCY.store(THREE_GHZ, Ordering::Release);
         TSC_VALIDATED.store(true, Ordering::Release);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:882:
[31m-        
[m[32m+
[m         // Calculate expected nanoseconds using fixed u128 arithmetic
[31m-        let expected_nanos = ((TEN_HOURS_CYCLES as u128 * 1_000_000_000u128) 
[m[31m-                              / THREE_GHZ as u128) as u64;
[m[31m-        
[m[32m+        let expected_nanos =
[m[32m+            ((TEN_HOURS_CYCLES as u128 * 1_000_000_000u128) / THREE_GHZ as u128) as u64;
[m[32m+
[m         // Verify calculation doesn't overflow
         assert_eq!(expected_nanos, 36_000_000_000_000); // 10 hours in nanoseconds
[31m-        
[m[32m+
[m         // Old buggy calculation would have overflowed:
         // cycles.saturating_mul(1_000_000_000) saturates at u64::MAX
         // Then dividing by freq gives incorrect small value
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:893:
         let buggy_result = TEN_HOURS_CYCLES.saturating_mul(1_000_000_000) / THREE_GHZ;
[31m-        
[m[32m+
[m         // Buggy calculation produces wrong result (saturates)
         assert_ne!(buggy_result, expected_nanos);
         assert!(buggy_result < expected_nanos);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:898:
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_race_condition_fix_atomic_ordering() {
         // Test FIX 2: Race condition in atomic operations
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:905:
         // Verify we're using Acquire ordering for loads
[31m-        
[m[32m+
[m         // Set frequency with Release ordering
         TSC_FREQUENCY.store(2_500_000_000, Ordering::Release);
[31m-        
[m[32m+
[m         // Load with Acquire ordering (happens-before relationship guaranteed)
         let freq = TSC_FREQUENCY.load(Ordering::Acquire);
[31m-        
[m[32m+
[m         assert_eq!(freq, 2_500_000_000);
[31m-        
[m[32m+
[m         // Verify calibration uses proper ordering
         TSC_VALIDATED.store(true, Ordering::Release);
         assert!(TSC_VALIDATED.load(Ordering::Acquire));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:918:
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_reliability_score_underflow_protection() {
         // Test FIX 3: Reliability score underflow protection
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:954:
         // Reset for future tests
         TSC_RELIABILITY_SCORE.store(100, Ordering::SeqCst);
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_calibration_access_control_logging() -> Result<()> {
         // Test FIX 4: Calibration access control and audit logging
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:961:
[31m-        
[m[32m+
[m         // Reset calibration state
         reset_tsc_calibration();
[31m-        
[m[32m+
[m         // Attempt calibration (will log security audit)
         let result = calibrate_tsc();
[31m-        
[m[32m+
[m         // In test environment, calibration may fail due to system load
         // The important part is that it attempts with proper logging
         match result {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:977:
                 // Calibration can fail in test environments - that's OK
                 // The security fix is about logging and access control
                 eprintln!("Calibration failed in test environment: {}", e);
[31m-            }
[m[32m+            },
[m         }
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_overflow_boundary_conditions() -> Result<()> {
         // Test boundary conditions around u64::MAX overflow
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:995:
         TSC_VALIDATED.store(true, Ordering::Release);
 
         // Test with overflow: OVERFLOW_CYCLES * 1B overflows u64
[31m-        let correct_nanos = ((OVERFLOW_CYCLES as u128 * 1_000_000_000u128)
[m[31m-                              / FREQ as u128) as u64;
[m[32m+        let correct_nanos = ((OVERFLOW_CYCLES as u128 * 1_000_000_000u128) / FREQ as u128) as u64;
[m 
         // Verify calculation using u128 is correct
         assert_eq!(correct_nanos, OVERFLOW_CYCLES);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:1012:
 
         Ok(())
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_high_frequency_cpu_extended_runtime() -> Result<()> {
         // Test with high-end CPU (5 GHz) running for 24 hours
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:1019:
         const FIVE_GHZ: u64 = 5_000_000_000;
         const TWENTYFOUR_HOURS_CYCLES: u64 = FIVE_GHZ * 60 * 60 * 24;
[31m-        
[m[32m+
[m         TSC_FREQUENCY.store(FIVE_GHZ, Ordering::Release);
[31m-        
[m[32m+
[m         // Calculate using fixed u128 arithmetic
[31m-        let correct_nanos = ((TWENTYFOUR_HOURS_CYCLES as u128 * 1_000_000_000u128) 
[m[31m-                             / FIVE_GHZ as u128) as u64;
[m[31m-        
[m[32m+        let correct_nanos =
[m[32m+            ((TWENTYFOUR_HOURS_CYCLES as u128 * 1_000_000_000u128) / FIVE_GHZ as u128) as u64;
[m[32m+
[m         // Verify 24 hours = 86,400 seconds = 86,400,000,000,000 nanoseconds
         assert_eq!(correct_nanos, 86_400_000_000_000);
[31m-        
[m[32m+
[m         Ok(())
     }
[31m-    
[m[32m+
[m     #[test]
     fn test_concurrent_calibration_safety() -> Result<()> {
         // Test that concurrent calibration attempts are safe
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:1037:
[31m-        use std::sync::Arc;
[m         use std::sync::atomic::AtomicBool;
[31m-        
[m[32m+        use std::sync::Arc;
[m[32m+
[m         reset_tsc_calibration();
[31m-        
[m[32m+
[m         let running = Arc::new(AtomicBool::new(true));
         let running_clone = running.clone();
[31m-        
[m[32m+
[m         // Spawn thread that attempts calibration
         let handle = thread::spawn(move || {
             let _ = calibrate_tsc();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/timing.rs:1048:
             running_clone.store(false, Ordering::SeqCst);
         });
[31m-        
[m[32m+
[m         // Wait for thread to complete
         handle.join().expect("Thread panicked");
[31m-        
[m[32m+
[m         // Verify running flag was set (thread completed)
         assert!(!running.load(Ordering::SeqCst));
[31m-        
[m[32m+
[m         Ok(())
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/trading/account_manager.rs:321:
 mod tests {
     use super::*;
     use crate::trading_operations::LiquidityFlag;
[31m-    use common::{OrderStatus, OrderType, TimeInForce};
[m     use chrono::Utc;
[32m+    use common::{OrderStatus, OrderType, TimeInForce};
[m 
     fn create_test_order(
         id: &str,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/trading/broker_client.rs:56:
     /// Create IBConfig from environment variables with proper error handling
     /// This replaces the panic-on-failure Default implementation for production safety
     pub fn from_env() -> Result<Self, String> {
[31m-        let host = std::env::var("IB_TWS_HOST")
[m[31m-            .map_err(|_| "CRITICAL: IB_TWS_HOST environment variable must be set - no default host allowed".to_string())?;
[m[32m+        let host = std::env::var("IB_TWS_HOST").map_err(|_| {
[m[32m+            "CRITICAL: IB_TWS_HOST environment variable must be set - no default host allowed"
[m[32m+                .to_string()
[m[32m+        })?;
[m 
         let port = std::env::var("IB_TWS_PORT")
             .map_err(|_| "CRITICAL: IB_TWS_PORT environment variable must be set".to_string())?
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/types/cardinality_limiter.rs:150:
         let parts: Vec<&str> = symbol.split('/').collect();
         if parts.len() == 2 {
             let (base, quote) = (parts[0], parts[1]);
[31m-            let crypto_codes = ["BTC", "ETH", "SOL", "DOGE", "ADA", "XRP", "DOT", "MATIC", "AVAX", "LINK", "USDT", "USDC"];
[m[31m-            return crypto_codes.iter().any(|&code| base == code || quote == code);
[m[32m+            let crypto_codes = [
[m[32m+                "BTC", "ETH", "SOL", "DOGE", "ADA", "XRP", "DOT", "MATIC", "AVAX", "LINK", "USDT",
[m[32m+                "USDC",
[m[32m+            ];
[m[32m+            return crypto_codes
[m[32m+                .iter()
[m[32m+                .any(|&code| base == code || quote == code);
[m         }
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/types/cardinality_limiter.rs:348:
         use std::time::Instant;
 
         let symbols = [
[31m-            "BTCUSD", "ETHUSD", "EURUSD", "AAPL", "GOOGL", "ESZ24", "AAPL240920C150",
[m[32m+            "BTCUSD",
[m[32m+            "ETHUSD",
[m[32m+            "EURUSD",
[m[32m+            "AAPL",
[m[32m+            "GOOGL",
[m[32m+            "ESZ24",
[m[32m+            "AAPL240920C150",
[m         ];
 
         let start = Instant::now();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/types/events.rs:1076:
 #[cfg(test)]
 mod tests {
     use super::*;
[31m-    use chrono::{TimeZone, Duration};
[m[32m+    use chrono::{Duration, TimeZone};
[m     // CANONICAL TYPE IMPORTS - FromPrimitive available via types::prelude
     use crate::types::test_utils::test_symbols::*;
     use anyhow::anyhow;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/types/metrics.rs:13:
 
 // Using simple tracing instead of OpenTelemetry for HFT performance
 // OpenTelemetry was removed - too heavy for HFT requirements
[31m-use parking_lot::RwLock;
[m use lru::LruCache;
[32m+use parking_lot::RwLock;
[m use std::num::NonZeroUsize;
 
 // Import cardinality limiter for metrics optimization
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/types/metrics.rs:38:
 
 /// Global no-op HistogramVec for fallback use
 static NOOP_HISTOGRAM: Lazy<HistogramVec> = Lazy::new(|| {
[31m-    HistogramVec::new(HistogramOpts::new("foxhunt_noop_histogram", "No-op histogram"), &[])
[m[31m-        .or_else(|_| HistogramVec::new(HistogramOpts::new("_noop", ""), &[]))
[m[31m-        .unwrap_or_else(|e| {
[m[31m-            panic!("CATASTROPHIC: Cannot create no-op histogram: {e}. Prometheus library failure.")
[m[31m-        })
[m[32m+    HistogramVec::new(
[m[32m+        HistogramOpts::new("foxhunt_noop_histogram", "No-op histogram"),
[m[32m+        &[],
[m[32m+    )
[m[32m+    .or_else(|_| HistogramVec::new(HistogramOpts::new("_noop", ""), &[]))
[m[32m+    .unwrap_or_else(|e| {
[m[32m+        panic!("CATASTROPHIC: Cannot create no-op histogram: {e}. Prometheus library failure.")
[m[32m+    })
[m });
 
 /// Global no-op GaugeVec for fallback use
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/types/metrics.rs:133:
 /// Protected by RwLock for concurrent access from multiple trading threads.
 pub static ORDER_ACK_LATENCY: Lazy<Arc<RwLock<LruCache<String, hdrhistogram::Histogram<u64>>>>> =
     Lazy::new(|| {
[31m-        Arc::new(RwLock::new(
[m[31m-            LruCache::new(NonZeroUsize::new(100).expect("Valid non-zero size"))
[m[31m-        ))
[m[32m+        Arc::new(RwLock::new(LruCache::new(
[m[32m+            NonZeroUsize::new(100).expect("Valid non-zero size"),
[m[32m+        )))
[m     });
 
 /// Trading Business Metrics - Regular Prometheus counters
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/types/metrics.rs:854:
                 hdrhistogram::Histogram::new(3)
             })
             .or_else(|e2| {
[31m-                tracing::error!("Failed to create fallback histogram (3 digits) for {}: {}", key, e2);
[m[32m+                tracing::error!(
[m[32m+                    "Failed to create fallback histogram (3 digits) for {}: {}",
[m[32m+                    key,
[m[32m+                    e2
[m[32m+                );
[m                 hdrhistogram::Histogram::new(2)
             })
             .or_else(|e3| {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/src/types/metrics.rs:861:
[31m-                tracing::error!("Failed to create fallback histogram (2 digits) for {}: {}", key, e3);
[m[32m+                tracing::error!(
[m[32m+                    "Failed to create fallback histogram (2 digits) for {}: {}",
[m[32m+                    key,
[m[32m+                    e3
[m[32m+                );
[m                 hdrhistogram::Histogram::new(1)
             });
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:22:
 use std::collections::HashMap;
 use std::sync::Arc;
 use trading_engine::compliance::audit_trails::{
[31m-    AuditEventType, AuditTrailConfig, AuditTrailEngine, AuditTrailQuery,
[m[31m-    ComplianceRequirements, ExecutionDetails, OrderDetails, PartitioningStrategy,
[m[31m-    RiskLevel, SortOrder, StorageBackendConfig, StorageType,
[m[32m+    AuditEventType, AuditTrailConfig, AuditTrailEngine, AuditTrailQuery, ComplianceRequirements,
[m[32m+    ExecutionDetails, OrderDetails, PartitioningStrategy, RiskLevel, SortOrder,
[m[32m+    StorageBackendConfig, StorageType,
[m };
 use trading_engine::persistence::postgres::{PostgresConfig, PostgresPool};
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:34:
 
 async fn create_test_postgres_pool() -> Option<Arc<PostgresPool>> {
     let postgres_config = PostgresConfig {
[31m-        url: std::env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[31m-            "postgresql://postgres:postgres@localhost:5433/foxhunt".to_owned()
[m[31m-        }),
[m[32m+        url: std::env::var("DATABASE_URL")
[m[32m+            .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5433/foxhunt".to_owned()),
[m         max_connections: 5,
         min_connections: 1,
         connect_timeout_ms: 5000,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:55:
         Err(e) => {
             eprintln!("⚠️  Database not available: {} - Skipping DB tests", e);
             None
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:71:
         storage_backend: StorageBackendConfig {
             primary_storage: StorageType::PostgreSQL,
             backup_storage: None,
[31m-            connection_string: "postgresql://postgres:password@localhost:5432/foxhunt_test".to_owned(),
[m[32m+            connection_string: "postgresql://postgres:password@localhost:5432/foxhunt_test"
[m[32m+                .to_owned(),
[m             table_name: "audit_trail".to_owned(),
             partitioning: PartitioningStrategy::Daily,
         },
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:140:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let order = create_order_details("IMM001", "trader_sox");
[31m-    
[m[32m+
[m     // Log order creation (generates checksum automatically)
[31m-    audit.log_order_created("order_IMM001", &order)
[m[32m+    audit
[m[32m+        .log_order_created("order_IMM001", &order)
[m         .expect("Failed to log order");
[31m-    
[m[32m+
[m     // Allow persistence
     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     // Query back and verify checksum exists
     let query = AuditTrailQuery {
         order_id: Some("order_IMM001".to_owned()),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:157:
         limit: Some(10),
         ..Default::default()
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Should find audit event");
[31m-    assert!(!result.events[0].checksum.is_empty(), "Event must have checksum for tamper detection");
[m[31m-    
[m[31m-    println!("✅ SOX immutability test passed - checksum: {}", &result.events[0].checksum[..16]);
[m[32m+    assert!(
[m[32m+        !result.events[0].checksum.is_empty(),
[m[32m+        "Event must have checksum for tamper detection"
[m[32m+    );
[m[32m+
[m[32m+    println!(
[m[32m+        "✅ SOX immutability test passed - checksum: {}",
[m[32m+        &result.events[0].checksum[..16]
[m[32m+    );
[m }
 
 /// Test 2: 7-year retention - verify events are tagged for long-term storage
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:172:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let config = create_test_audit_config();
[31m-    assert_eq!(config.retention_days, 2555, "SOX requires 7 years (2555 days) retention");
[m[31m-    
[m[32m+    assert_eq!(
[m[32m+        config.retention_days, 2555,
[m[32m+        "SOX requires 7 years (2555 days) retention"
[m[32m+    );
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let order = create_order_details("RET001", "trader_retention");
[31m-    
[m[31m-    audit.log_order_created("order_RET001", &order)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_created("order_RET001", &order)
[m         .expect("Failed to log order");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_RET001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:190:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
[31m-    assert!(!result.events.is_empty(), "Event must be persisted for retention");
[m[31m-    assert!(result.events[0].compliance_tags.contains(&"SOX".to_owned()), "Must be tagged for SOX compliance");
[m[31m-    
[m[32m+    assert!(
[m[32m+        !result.events.is_empty(),
[m[32m+        "Event must be persisted for retention"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        result.events[0].compliance_tags.contains(&"SOX".to_owned()),
[m[32m+        "Must be tagged for SOX compliance"
[m[32m+    );
[m[32m+
[m     println!("✅ SOX 7-year retention test passed - config verified");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:203:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let order = create_order_details("ACC001", "restricted_user");
[31m-    
[m[31m-    audit.log_order_created("order_ACC001", &order)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_created("order_ACC001", &order)
[m         .expect("Failed to log order");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         actor: Some("restricted_user".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:218:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
[31m-    assert!(!result.events.is_empty(), "Should track actor for access control");
[m[31m-    assert_eq!(result.events[0].actor, "restricted_user", "Actor must match");
[m[31m-    assert!(result.events[0].session_id.is_some(), "Session ID required for audit trail");
[m[31m-    
[m[32m+    assert!(
[m[32m+        !result.events.is_empty(),
[m[32m+        "Should track actor for access control"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        result.events[0].actor, "restricted_user",
[m[32m+        "Actor must match"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        result.events[0].session_id.is_some(),
[m[32m+        "Session ID required for audit trail"
[m[32m+    );
[m[32m+
[m     println!("✅ SOX access control test passed - actor tracked");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:232:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
[31m-    
[m[32m+
[m     // Log 5 different events
     for i in 0..5 {
         let order = create_order_details(&format!("CHK{:03}", i), "trader_integrity");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:241:
[31m-        audit.log_order_created(&format!("order_CHK{:03}", i), &order)
[m[32m+        audit
[m[32m+            .log_order_created(&format!("order_CHK{:03}", i), &order)
[m             .expect("Failed to log order");
     }
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(300)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         actor: Some("trader_integrity".to_owned()),
         limit: Some(10),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:250:
         ..Default::default()
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert_eq!(result.events.len(), 5, "Should find all 5 events");
[31m-    
[m[32m+
[m     for event in &result.events {
         assert!(!event.checksum.is_empty(), "Every event must have checksum");
[31m-        assert!(event.checksum.len() >= 32, "Checksum must be cryptographically secure (SHA256)");
[m[32m+        assert!(
[m[32m+            event.checksum.len() >= 32,
[m[32m+            "Checksum must be cryptographically secure (SHA256)"
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     println!("✅ SOX checksum integrity test passed - all events secured");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:268:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
[31m-    
[m[32m+
[m     // Create order then execute it
     let order = create_order_details("ARCH001", "trader_archive");
[31m-    audit.log_order_created("order_ARCH001", &order)
[m[32m+    audit
[m[32m+        .log_order_created("order_ARCH001", &order)
[m         .expect("Failed to log order creation");
[31m-    
[m[32m+
[m     let execution = create_execution_details("ARCH001");
[31m-    audit.log_order_executed(&execution)
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_ARCH001".to_owned()),
         sort_order: SortOrder::TimestampAsc,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:288:
         ..Default::default()
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
[31m-    assert_eq!(result.events.len(), 2, "Should capture both creation and execution");
[m[31m-    assert!(matches!(result.events[0].event_type, AuditEventType::OrderCreated), "First event should be creation");
[m[31m-    assert!(matches!(result.events[1].event_type, AuditEventType::OrderExecuted), "Second event should be execution");
[m[31m-    
[m[32m+    assert_eq!(
[m[32m+        result.events.len(),
[m[32m+        2,
[m[32m+        "Should capture both creation and execution"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        matches!(result.events[0].event_type, AuditEventType::OrderCreated),
[m[32m+        "First event should be creation"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        matches!(result.events[1].event_type, AuditEventType::OrderExecuted),
[m[32m+        "Second event should be execution"
[m[32m+    );
[m[32m+
[m     println!("✅ SOX archive completeness test passed - full lifecycle captured");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:303:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let order = create_order_details("REP001", "trader_reporting");
[31m-    
[m[31m-    audit.log_order_created("order_REP001", &order)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_created("order_REP001", &order)
[m         .expect("Failed to log order");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_REP001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:318:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Event must be queryable");
[31m-    
[m[32m+
[m     let event = &result.events[0];
[31m-    assert!(event.compliance_tags.contains(&"SOX".to_owned()), "Must be SOX tagged");
[m[31m-    assert!(event.compliance_tags.contains(&"MIFID2".to_owned()), "Must be MiFID II tagged");
[m[31m-    assert!(event.details.symbol.is_some(), "Symbol required for reporting");
[m[32m+    assert!(
[m[32m+        event.compliance_tags.contains(&"SOX".to_owned()),
[m[32m+        "Must be SOX tagged"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        event.compliance_tags.contains(&"MIFID2".to_owned()),
[m[32m+        "Must be MiFID II tagged"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        event.details.symbol.is_some(),
[m[32m+        "Symbol required for reporting"
[m[32m+    );
[m     assert!(event.details.venue.is_some(), "Venue required for MiFID II");
[31m-    
[m[32m+
[m     println!("✅ SOX regulatory format test passed - compliance tags verified");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:336:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
[31m-    
[m[32m+
[m     // High-value order (triggers Medium/High risk assessment)
     let mut order = create_order_details("CTRL001", "trader_control");
     order.quantity = Decimal::from(10000); // Large quantity
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:345:
     order.price = Some(Decimal::from(200)); // High price = $2M notional
[31m-    
[m[31m-    audit.log_order_created("order_CTRL001", &order)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_created("order_CTRL001", &order)
[m         .expect("Failed to log high-value order");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_CTRL001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:355:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "High-value order must be logged");
[31m-    
[m[32m+
[m     // Risk level should be elevated for high notional
     let event = &result.events[0];
     assert!(
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:363:
         matches!(event.risk_level, RiskLevel::Medium | RiskLevel::High),
         "High-value orders must have elevated risk level"
     );
[31m-    
[m[32m+
[m     println!("✅ SOX internal control test passed - risk assessment active");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:374:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
[31m-    
[m[32m+
[m     // Trader creates order
     let order = create_order_details("SEG001", "trader_junior");
[31m-    audit.log_order_created("order_SEG001", &order)
[m[32m+    audit
[m[32m+        .log_order_created("order_SEG001", &order)
[m         .expect("Failed to log order");
[31m-    
[m[32m+
[m     // System executes (different actor)
     let execution = create_execution_details("SEG001");
[31m-    audit.log_order_executed(&execution)
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_SEG001".to_owned()),
         sort_order: SortOrder::TimestampAsc,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:395:
         ..Default::default()
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert_eq!(result.events.len(), 2, "Should capture both actions");
[31m-    assert_eq!(result.events[0].actor, "trader_junior", "Order created by trader");
[m[31m-    assert_eq!(result.events[1].actor, "system", "Execution by system (segregation)");
[m[31m-    
[m[32m+    assert_eq!(
[m[32m+        result.events[0].actor, "trader_junior",
[m[32m+        "Order created by trader"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        result.events[1].actor, "system",
[m[32m+        "Execution by system (segregation)"
[m[32m+    );
[m[32m+
[m     println!("✅ SOX segregation of duties test passed - actor separation verified");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:410:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
[31m-    
[m[32m+
[m     // Original order
     let order = create_order_details("CHG001", "trader_change");
[31m-    audit.log_order_created("order_CHG001", &order)
[m[32m+    audit
[m[32m+        .log_order_created("order_CHG001", &order)
[m         .expect("Failed to log original order");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         transaction_id: Some("tx_CHG001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:426:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
[31m-    assert!(!result.events.is_empty(), "Changes must be traceable via transaction_id");
[m[31m-    assert!(result.events[0].after_state.is_some(), "After-state required for change tracking");
[m[31m-    
[m[32m+    assert!(
[m[32m+        !result.events.is_empty(),
[m[32m+        "Changes must be traceable via transaction_id"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        result.events[0].after_state.is_some(),
[m[32m+        "After-state required for change tracking"
[m[32m+    );
[m[32m+
[m     println!("✅ SOX change management test passed - state tracking verified");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:439:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
[31m-    
[m[32m+
[m     // Execution with performance metrics
     let execution = create_execution_details("EXC001");
[31m-    audit.log_order_executed(&execution)
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_EXC001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:455:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Execution must be logged");
[31m-    
[m[32m+
[m     let event = &result.events[0];
[31m-    assert!(event.details.performance_metrics.is_some(), "Performance metrics required for exception analysis");
[m[31m-    
[m[32m+    assert!(
[m[32m+        event.details.performance_metrics.is_some(),
[m[32m+        "Performance metrics required for exception analysis"
[m[32m+    );
[m[32m+
[m     println!("✅ SOX exception handling test passed - metrics captured");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:474:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let execution = create_execution_details("MIFID001");
[31m-    
[m[31m-    audit.log_order_executed(&execution)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_MIFID001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:489:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Event must exist");
[31m-    
[m[32m+
[m     let event = &result.events[0];
     // MiFID II Article 25 required fields
     assert!(event.details.symbol.is_some(), "Instrument ID required");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:497:
     assert!(event.details.quantity.is_some(), "Quantity required");
     assert!(event.details.price.is_some(), "Price required");
     assert!(event.details.venue.is_some(), "Venue required");
[31m-    assert!(event.compliance_tags.contains(&"MIFID2".to_owned()), "MiFID II tag required");
[m[31m-    
[m[32m+    assert!(
[m[32m+        event.compliance_tags.contains(&"MIFID2".to_owned()),
[m[32m+        "MiFID II tag required"
[m[32m+    );
[m[32m+
[m     println!("✅ MiFID II Article 25 completeness test passed");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:509:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let order = create_order_details("CLIENT001", "client_xyz");
[31m-    
[m[31m-    audit.log_order_created("order_CLIENT001", &order)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_created("order_CLIENT001", &order)
[m         .expect("Failed to log order");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_CLIENT001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:524:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Event must exist");
[31m-    assert_eq!(result.events[0].details.account_id, Some("ACC001".to_owned()), "Account ID required for client identification");
[m[31m-    
[m[32m+    assert_eq!(
[m[32m+        result.events[0].details.account_id,
[m[32m+        Some("ACC001".to_owned()),
[m[32m+        "Account ID required for client identification"
[m[32m+    );
[m[32m+
[m     println!("✅ MiFID II client identification test passed");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:537:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let execution = create_execution_details("INSTR001");
[31m-    
[m[31m-    audit.log_order_executed(&execution)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         symbol: Some("AAPL".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:552:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Should find by instrument");
[31m-    assert_eq!(result.events[0].details.symbol, Some("AAPL".to_owned()), "Instrument must be tracked");
[m[31m-    
[m[32m+    assert_eq!(
[m[32m+        result.events[0].details.symbol,
[m[32m+        Some("AAPL".to_owned()),
[m[32m+        "Instrument must be tracked"
[m[32m+    );
[m[32m+
[m     println!("✅ MiFID II instrument identification test passed");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:565:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let execution = create_execution_details("VENUE001");
[31m-    
[m[31m-    audit.log_order_executed(&execution)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_VENUE001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:581:
 
     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Should find execution");
[31m-    assert_eq!(result.events[0].details.venue, Some("XNYS".to_owned()), "Venue must be tracked");
[m[31m-    
[m[32m+    assert_eq!(
[m[32m+        result.events[0].details.venue,
[m[32m+        Some("XNYS".to_owned()),
[m[32m+        "Venue must be tracked"
[m[32m+    );
[m[32m+
[m     println!("✅ MiFID II venue identification test passed");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:593:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let execution = create_execution_details("TIME001");
[31m-    
[m[31m-    audit.log_order_executed(&execution)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_TIME001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:608:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Event must exist");
[31m-    assert!(result.events[0].timestamp_nanos > 0, "Nanosecond timestamp required for MiFID II");
[m[31m-    
[m[32m+    assert!(
[m[32m+        result.events[0].timestamp_nanos > 0,
[m[32m+        "Nanosecond timestamp required for MiFID II"
[m[32m+    );
[m[32m+
[m     println!("✅ MiFID II timestamp accuracy test passed - nanosecond precision verified");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:625:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let execution = create_execution_details("BEST001");
[31m-    
[m[31m-    audit.log_order_executed(&execution)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_BEST001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:640:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Execution must be logged");
[31m-    
[m[32m+
[m     let event = &result.events[0];
[31m-    assert!(event.compliance_tags.contains(&"BEST_EXECUTION".to_owned()), "Best execution tag required");
[m[31m-    assert!(event.details.performance_metrics.is_some(), "Performance metrics required for best execution analysis");
[m[31m-    
[m[32m+    assert!(
[m[32m+        event.compliance_tags.contains(&"BEST_EXECUTION".to_owned()),
[m[32m+        "Best execution tag required"
[m[32m+    );
[m[32m+    assert!(
[m[32m+        event.details.performance_metrics.is_some(),
[m[32m+        "Performance metrics required for best execution analysis"
[m[32m+    );
[m[32m+
[m     println!("✅ MiFID II Article 27 best execution test passed");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:656:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
[31m-    
[m[32m+
[m     // Execute on different venues
     let mut exec1 = create_execution_details("VQ001");
     exec1.venue = "XNYS".to_owned();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:665:
     audit.log_order_executed(&exec1).expect("Failed to log");
[31m-    
[m[32m+
[m     let mut exec2 = create_execution_details("VQ002");
     exec2.venue = "NASDAQ".to_owned();
     audit.log_order_executed(&exec2).expect("Failed to log");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:670:
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     // Query by order to verify venue tracking
     let query = AuditTrailQuery {
         order_id: Some("order_VQ001".to_owned()),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:677:
     };
 
     let result = audit.query(query).await.expect("Failed to query");
[31m-    assert!(!result.events.is_empty(), "Should find venue-specific executions");
[m[31m-    assert_eq!(result.events[0].details.venue, Some("XNYS".to_owned()), "Venue should be XNYS");
[m[31m-    
[m[32m+    assert!(
[m[32m+        !result.events.is_empty(),
[m[32m+        "Should find venue-specific executions"
[m[32m+    );
[m[32m+    assert_eq!(
[m[32m+        result.events[0].details.venue,
[m[32m+        Some("XNYS".to_owned()),
[m[32m+        "Venue should be XNYS"
[m[32m+    );
[m[32m+
[m     println!("✅ MiFID II venue quality test passed - venue tracking operational");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:690:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let execution = create_execution_details("PRICE001");
[31m-    
[m[31m-    audit.log_order_executed(&execution)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_PRICE001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:705:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Execution must be logged");
[31m-    assert!(result.events[0].details.price.is_some(), "Price required for improvement calculation");
[m[31m-    
[m[32m+    assert!(
[m[32m+        result.events[0].details.price.is_some(),
[m[32m+        "Price required for improvement calculation"
[m[32m+    );
[m[32m+
[m     println!("✅ MiFID II price improvement test passed");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:718:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
     let execution = create_execution_details("QUAL001");
[31m-    
[m[31m-    audit.log_order_executed(&execution)
[m[32m+
[m[32m+    audit
[m[32m+        .log_order_executed(&execution)
[m         .expect("Failed to log execution");
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let query = AuditTrailQuery {
         order_id: Some("order_QUAL001".to_owned()),
         ..Default::default()
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:733:
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
     assert!(!result.events.is_empty(), "Execution must be logged");
[31m-    
[m[31m-    let metrics = result.events[0].details.performance_metrics.as_ref()
[m[32m+
[m[32m+    let metrics = result.events[0]
[m[32m+        .details
[m[32m+        .performance_metrics
[m[32m+        .as_ref()
[m         .expect("Performance metrics required");
     assert!(metrics.processing_latency_ns > 0, "Latency must be tracked");
[31m-    
[m[32m+
[m     println!("✅ MiFID II execution quality test passed - latency tracked");
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:749:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let audit = create_test_audit_engine(pool).await;
[31m-    
[m[32m+
[m     // Log multiple executions
     for i in 0..3 {
         let execution = create_execution_details(&format!("Q{:02}", i));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:758:
[31m-        audit.log_order_executed(&execution)
[m[32m+        audit
[m[32m+            .log_order_executed(&execution)
[m             .expect("Failed to log execution");
     }
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(300)).await;
[31m-    
[m[32m+
[m     // Query for reporting period
     let start_time = Utc::now() - Duration::hours(1);
     let query = AuditTrailQuery {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance.rs:770:
         limit: Some(100),
         ..Default::default()
     };
[31m-    
[m[32m+
[m     let result = audit.query(query).await.expect("Failed to query");
[31m-    assert!(result.events.len() >= 3, "Should capture executions for reporting period");
[m[31m-    
[m[31m-    println!("✅ MiFID II periodic reporting test passed - {} executions in period", result.events.len());
[m[32m+    assert!(
[m[32m+        result.events.len() >= 3,
[m[32m+        "Should capture executions for reporting period"
[m[32m+    );
[m[32m+
[m[32m+    println!(
[m[32m+        "✅ MiFID II periodic reporting test passed - {} executions in period",
[m[32m+        result.events.len()
[m[32m+    );
[m }
 
 // ============================================================================
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:19:
 
 async fn create_test_postgres_pool() -> Option<Arc<PostgresPool>> {
     let postgres_config = PostgresConfig {
[31m-        url: std::env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[31m-            "postgresql://postgres:postgres@localhost:5433/foxhunt".to_owned()
[m[31m-        }),
[m[32m+        url: std::env::var("DATABASE_URL")
[m[32m+            .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5433/foxhunt".to_owned()),
[m         max_connections: 5,
         min_connections: 1,
         connect_timeout_ms: 5000,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:40:
         Err(e) => {
             eprintln!("⚠️  Database not available: {} - Skipping DB tests", e);
             None
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:56:
         storage_backend: StorageBackendConfig {
             primary_storage: StorageType::PostgreSQL,
             backup_storage: None,
[31m-            connection_string: "postgresql://postgres:password@localhost:5432/foxhunt_test".to_owned(),
[m[32m+            connection_string: "postgresql://postgres:password@localhost:5432/foxhunt_test"
[m[32m+                .to_owned(),
[m             table_name: "audit_trail".to_owned(),
             partitioning: PartitioningStrategy::Daily,
         },
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:114:
 
     let config = create_test_audit_config(pg_pool.clone());
     let audit_engine = AuditTrailEngine::new(config);
[31m-    
[m[32m+
[m     if let Some(pool) = pg_pool {
         audit_engine.set_postgres_pool(pool).await;
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:124:
     config_change_event.event_type = AuditEventType::SystemEvent;
     config_change_event.details.metadata.insert(
         "action".to_owned(),
[31m-        serde_json::Value::String("config_change_initiated".to_owned())
[m[32m+        serde_json::Value::String("config_change_initiated".to_owned()),
[m     );
     config_change_event.details.metadata.insert(
         "param".to_owned(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:131:
[31m-        serde_json::Value::String("max_daily_loss".to_owned())
[m[32m+        serde_json::Value::String("max_daily_loss".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(config_change_event.clone()).expect("Failed to log config change");
[m 
[32m+    audit_engine
[m[32m+        .log_event(config_change_event.clone())
[m[32m+        .expect("Failed to log config change");
[m[32m+
[m     // Log approval attempt (should be separate actor for four-eyes principle)
     let mut approval_event = create_test_audit_event("CONFIG_APPROVAL_001", "devB");
     approval_event.event_type = AuditEventType::SystemEvent;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:139:
     approval_event.details.metadata.insert(
         "action".to_owned(),
[31m-        serde_json::Value::String("config_change_approved".to_owned())
[m[32m+        serde_json::Value::String("config_change_approved".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(approval_event).expect("Failed to log approval");
[m 
[32m+    audit_engine
[m[32m+        .log_event(approval_event)
[m[32m+        .expect("Failed to log approval");
[m[32m+
[m     // Query for configuration change events
     let query = AuditTrailQuery {
         start_time: Utc::now() - Duration::hours(1),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:153:
     };
 
     let results = audit_engine.query(query).await.expect("Query failed");
[31m-    
[m[32m+
[m     assert!(
         results.events.len() >= 1,
         "Should record configuration change initiation"
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:173:
 
     let config = create_test_audit_config(pg_pool.clone());
     let audit_engine = AuditTrailEngine::new(config);
[31m-    
[m[32m+
[m     if let Some(pool) = pg_pool {
         audit_engine.set_postgres_pool(pool).await;
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:184:
     deploy_event.risk_level = RiskLevel::High;
     deploy_event.details.metadata.insert(
         "action".to_owned(),
[31m-        serde_json::Value::String("deployment_attempted".to_owned())
[m[32m+        serde_json::Value::String("deployment_attempted".to_owned()),
[m     );
     deploy_event.details.metadata.insert(
         "result".to_owned(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:191:
[31m-        serde_json::Value::String("denied_insufficient_privileges".to_owned())
[m[32m+        serde_json::Value::String("denied_insufficient_privileges".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(deploy_event).expect("Failed to log deployment attempt");
[m 
[32m+    audit_engine
[m[32m+        .log_event(deploy_event)
[m[32m+        .expect("Failed to log deployment attempt");
[m[32m+
[m     // Log successful deployment by release manager
     let mut authorized_deploy = create_test_audit_event("DEPLOY_002", "releaseManagerY");
     authorized_deploy.event_type = AuditEventType::SystemEvent;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:199:
     authorized_deploy.risk_level = RiskLevel::Medium;
     authorized_deploy.details.metadata.insert(
         "action".to_owned(),
[31m-        serde_json::Value::String("deployment_completed".to_owned())
[m[32m+        serde_json::Value::String("deployment_completed".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(authorized_deploy).expect("Failed to log authorized deployment");
[m 
[32m+    audit_engine
[m[32m+        .log_event(authorized_deploy)
[m[32m+        .expect("Failed to log authorized deployment");
[m[32m+
[m     // Query for deployment events
     let query = AuditTrailQuery {
         start_time: Utc::now() - Duration::hours(1),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:213:
     };
 
     let results = audit_engine.query(query).await.expect("Query failed");
[31m-    
[m[32m+
[m     assert!(
         results.events.len() >= 2,
         "Should record both deployment attempts"
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:237:
 
     let config = create_test_audit_config(pg_pool.clone());
     let audit_engine = AuditTrailEngine::new(config);
[31m-    
[m[32m+
[m     if let Some(pool) = pg_pool {
         audit_engine.set_postgres_pool(pool).await;
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:247:
     change1.event_type = AuditEventType::SystemEvent;
     change1.details.metadata.insert(
         "config_item".to_owned(),
[31m-        serde_json::Value::String("algo_threshold".to_owned())
[m[32m+        serde_json::Value::String("algo_threshold".to_owned()),
[m     );
     change1.details.metadata.insert(
         "old_value".to_owned(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:254:
[31m-        serde_json::Value::String("0.05".to_owned())
[m[32m+        serde_json::Value::String("0.05".to_owned()),
[m     );
     change1.details.metadata.insert(
         "new_value".to_owned(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:258:
[31m-        serde_json::Value::String("0.055".to_owned())
[m[32m+        serde_json::Value::String("0.055".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(change1).expect("Failed to log change 1");
[m 
[32m+    audit_engine
[m[32m+        .log_event(change1)
[m[32m+        .expect("Failed to log change 1");
[m[32m+
[m     // Log config change 2
     let mut change2 = create_test_audit_event("CONFIG_CHG_002", "riskManager");
     change2.event_type = AuditEventType::SystemEvent;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:266:
     change2.details.metadata.insert(
         "config_item".to_owned(),
[31m-        serde_json::Value::String("max_position_size".to_owned())
[m[32m+        serde_json::Value::String("max_position_size".to_owned()),
[m     );
     change2.details.metadata.insert(
         "old_value".to_owned(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:272:
[31m-        serde_json::Value::String("500000".to_owned())
[m[32m+        serde_json::Value::String("500000".to_owned()),
[m     );
     change2.details.metadata.insert(
         "new_value".to_owned(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:276:
[31m-        serde_json::Value::String("1000000".to_owned())
[m[32m+        serde_json::Value::String("1000000".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(change2).expect("Failed to log change 2");
[m 
[32m+    audit_engine
[m[32m+        .log_event(change2)
[m[32m+        .expect("Failed to log change 2");
[m[32m+
[m     // Query for config changes
     let query = AuditTrailQuery {
         start_time: Utc::now() - Duration::hours(1),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:287:
     };
 
     let results = audit_engine.query(query).await.expect("Query failed");
[31m-    
[m[32m+
[m     assert!(
         results.events.len() >= 2,
         "Should record both config changes"
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:296:
     // Verify first change details
     let algo_change = results.events.iter().find(|e| e.actor == "adminUser");
     assert!(algo_change.is_some(), "Should find algo_threshold change");
[31m-    
[m[32m+
[m     if let Some(change) = algo_change {
         assert_eq!(
[31m-            change.details.metadata.get("config_item").and_then(|v| v.as_str()),
[m[32m+            change
[m[32m+                .details
[m[32m+                .metadata
[m[32m+                .get("config_item")
[m[32m+                .and_then(|v| v.as_str()),
[m             Some("algo_threshold"),
             "Should record config item"
         );
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:319:
 
     let config = create_test_audit_config(pg_pool.clone());
     let audit_engine = AuditTrailEngine::new(config);
[31m-    
[m[32m+
[m     if let Some(pool) = pg_pool {
         audit_engine.set_postgres_pool(pool).await;
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:330:
     error1.risk_level = RiskLevel::High;
     error1.details.metadata.insert(
         "error_type".to_owned(),
[31m-        serde_json::Value::String("invalid_market_data".to_owned())
[m[32m+        serde_json::Value::String("invalid_market_data".to_owned()),
[m     );
     error1.details.metadata.insert(
         "component".to_owned(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:337:
[31m-        serde_json::Value::String("trading_engine".to_owned())
[m[32m+        serde_json::Value::String("trading_engine".to_owned()),
[m     );
     error1.details.metadata.insert(
         "stack_trace".to_owned(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:341:
[31m-        serde_json::Value::String("Error at line 123".to_owned())
[m[32m+        serde_json::Value::String("Error at line 123".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(error1).expect("Failed to log error 1");
[m 
[31m-    // Log error 2: Network timeout  
[m[32m+    audit_engine
[m[32m+        .log_event(error1)
[m[32m+        .expect("Failed to log error 1");
[m[32m+
[m[32m+    // Log error 2: Network timeout
[m     let mut error2 = create_test_audit_event("ERR_002", "system");
     error2.event_type = AuditEventType::ErrorEvent;
     error2.risk_level = RiskLevel::Medium;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:350:
     error2.details.metadata.insert(
         "error_type".to_owned(),
[31m-        serde_json::Value::String("network_timeout".to_owned())
[m[32m+        serde_json::Value::String("network_timeout".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(error2).expect("Failed to log error 2");
[m 
[32m+    audit_engine
[m[32m+        .log_event(error2)
[m[32m+        .expect("Failed to log error 2");
[m[32m+
[m     // Log error 3: Database failure
     let mut error3 = create_test_audit_event("ERR_003", "system");
     error3.event_type = AuditEventType::ErrorEvent;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:360:
     error3.risk_level = RiskLevel::Critical;
     error3.details.metadata.insert(
         "error_type".to_owned(),
[31m-        serde_json::Value::String("database_connection_failure".to_owned())
[m[32m+        serde_json::Value::String("database_connection_failure".to_owned()),
[m     );
[31m-    
[m[31m-    audit_engine.log_event(error3).expect("Failed to log error 3");
[m 
[32m+    audit_engine
[m[32m+        .log_event(error3)
[m[32m+        .expect("Failed to log error 3");
[m[32m+
[m     // Query for errors
     let query = AuditTrailQuery {
         start_time: Utc::now() - Duration::hours(1),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:374:
     };
 
     let results = audit_engine.query(query).await.expect("Query failed");
[31m-    
[m[32m+
[m     assert_eq!(results.events.len(), 3, "Should log all 3 errors");
 
     // Verify market data error details
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_compliance_part2_rewrite.rs:381:
[31m-    let market_data_error = results.events.iter()
[m[31m-        .find(|e| {
[m[31m-            e.details.metadata.get("component")
[m[31m-                .and_then(|v| v.as_str()) == Some("trading_engine")
[m[31m-        });
[m[31m-    
[m[32m+    let market_data_error = results.events.iter().find(|e| {
[m[32m+        e.details.metadata.get("component").and_then(|v| v.as_str()) == Some("trading_engine")
[m[32m+    });
[m[32m+
[m     assert!(market_data_error.is_some(), "Should find market data error");
[31m-    
[m[32m+
[m     if let Some(error) = market_data_error {
[31m-        assert_eq!(error.risk_level, RiskLevel::High, "Should mark as high severity");
[m[31m-        assert!(error.details.metadata.contains_key("error_type"), "Should include error type");
[m[31m-        assert!(error.details.metadata.contains_key("stack_trace"), "Should include stack trace");
[m[32m+        assert_eq!(
[m[32m+            error.risk_level,
[m[32m+            RiskLevel::High,
[m[32m+            "Should mark as high severity"
[m[32m+        );
[m[32m+        assert!(
[m[32m+            error.details.metadata.contains_key("error_type"),
[m[32m+            "Should include error type"
[m[32m+        );
[m[32m+        assert!(
[m[32m+            error.details.metadata.contains_key("stack_trace"),
[m[32m+            "Should include stack trace"
[m[32m+        );
[m     }
 
     println!("✅ SOX Test 10: Exception handling audit verified (simplified)");
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:20:
 // Helper to create test PostgreSQL pool
 async fn create_test_postgres_pool() -> Option<Arc<PostgresPool>> {
     let postgres_config = PostgresConfig {
[31m-        url: std::env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[31m-            "postgresql://postgres:postgres@localhost:5433/foxhunt".to_owned()
[m[31m-        }),
[m[32m+        url: std::env::var("DATABASE_URL")
[m[32m+            .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5433/foxhunt".to_owned()),
[m         max_connections: 5,
         min_connections: 1,
         connect_timeout_ms: 5000,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:41:
         Err(e) => {
             eprintln!("⚠️  Database not available: {} - Skipping DB tests", e);
             None
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:309:
     };
 
     let result = audit_engine.log_order_executed(&execution);
[31m-    assert!(result.is_ok(), "Failed to log execution: {:?}", result.err());
[m[32m+    assert!(
[m[32m+        result.is_ok(),
[m[32m+        "Failed to log execution: {:?}",
[m[32m+        result.err()
[m[32m+    );
[m 
     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:420:
 
     // Checksum should be non-empty SHA-256 (64 hex characters)
     let checksum = &events.events[0].checksum;
[31m-    assert_eq!(checksum.len(), 64, "SHA-256 checksum should be 64 characters");
[m[32m+    assert_eq!(
[m[32m+        checksum.len(),
[m[32m+        64,
[m[32m+        "SHA-256 checksum should be 64 characters"
[m[32m+    );
[m     assert!(
         checksum.chars().all(|c| c.is_ascii_hexdigit()),
         "Checksum should be hexadecimal"
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:662:
 
 #[tokio::test]
 async fn test_aes256gcm_encryption_roundtrip() {
[31m-    let encryption_engine = EncryptionEngine::new(EncryptionAlgorithm::AES256GCM, "test-key-v1".to_owned());
[m[32m+    let encryption_engine =
[m[32m+        EncryptionEngine::new(EncryptionAlgorithm::AES256GCM, "test-key-v1".to_owned());
[m 
     let plaintext = b"Sensitive audit data: Order #12345 executed at $150.25";
     let key = [42u8; 32]; // 256-bit key
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:674:
     assert_ne!(ciphertext.as_slice(), plaintext);
 
     // Decrypt
[31m-    let decrypted = encryption_engine.decrypt(&ciphertext, &nonce, &key).unwrap();
[m[32m+    let decrypted = encryption_engine
[m[32m+        .decrypt(&ciphertext, &nonce, &key)
[m[32m+        .unwrap();
[m 
     // Verify round-trip
     assert_eq!(decrypted.as_slice(), plaintext);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:684:
 
 #[tokio::test]
 async fn test_encryption_tamper_detection() {
[31m-    let encryption_engine = EncryptionEngine::new(EncryptionAlgorithm::AES256GCM, "test-key-v1".to_owned());
[m[32m+    let encryption_engine =
[m[32m+        EncryptionEngine::new(EncryptionAlgorithm::AES256GCM, "test-key-v1".to_owned());
[m 
     let plaintext = b"Critical audit event";
     let key = [99u8; 32];
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:698:
 
     // Decryption should fail (AEAD authentication)
     let result = encryption_engine.decrypt(&ciphertext, &nonce, &key);
[31m-    assert!(result.is_err(), "Tampered ciphertext should fail decryption");
[m[32m+    assert!(
[m[32m+        result.is_err(),
[m[32m+        "Tampered ciphertext should fail decryption"
[m[32m+    );
[m 
     println!("✅ test_encryption_tamper_detection PASSED");
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_comprehensive.rs:1117:
 #[tokio::test]
 async fn test_buffer_overflow_handling() {
     let audit_config = AuditTrailConfig {
[31m-        buffer_size: 10, // Very small buffer
[m[32m+        buffer_size: 10,          // Very small buffer
[m         flush_interval_ms: 10000, // Slow flushing to force overflow
         ..Default::default()
     };
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:34:
 /// Create PostgreSQL pool for testing (skips if database unavailable)
 async fn create_test_postgres_pool() -> Option<Arc<PostgresPool>> {
     let postgres_config = PostgresConfig {
[31m-        url: std::env::var("DATABASE_URL")
[m[31m-            .unwrap_or_else(|_| "postgresql://postgres:password@localhost:5432/foxhunt_test".to_owned()),
[m[32m+        url: std::env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+            "postgresql://postgres:password@localhost:5432/foxhunt_test".to_owned()
[m[32m+        }),
[m         max_connections: 5,
         min_connections: 1,
         connect_timeout_ms: 5000,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:54:
         Err(e) => {
             eprintln!("⚠️  Database not available, skipping test: {}", e);
             None
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:110:
 }
 
 /// Create generic audit event for testing
[31m-fn create_test_audit_event(event_type: AuditEventType, risk_level: RiskLevel) -> TransactionAuditEvent {
[m[32m+fn create_test_audit_event(
[m[32m+    event_type: AuditEventType,
[m[32m+    risk_level: RiskLevel,
[m[32m+) -> TransactionAuditEvent {
[m     TransactionAuditEvent {
         event_id: format!("EVT-{}", uuid::Uuid::new_v4()),
         timestamp: Utc::now(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:172:
         let order_id = format!("ORD-{}", uuid::Uuid::new_v4());
 
         let result = engine.log_order_created(&order_id, &order_details);
[31m-        assert!(result.is_ok(), "Failed to log order created: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log order created: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         // Wait for background flush
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:195:
         event.after_state = Some(serde_json::json!({"price": 151.00, "quantity": 100}));
 
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log order modified: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log order modified: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Order modified event with state diff persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:213:
 
         let event = create_test_audit_event(AuditEventType::OrderCancelled, RiskLevel::Low);
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log order cancelled: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log order cancelled: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Order cancelled event persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:233:
         let execution = create_test_execution_details(&order_id, "AAPL");
 
         let result = engine.log_order_executed(&execution);
[31m-        assert!(result.is_ok(), "Failed to log execution: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log execution: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Order executed event with performance metrics persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:251:
 
         let event = create_test_audit_event(AuditEventType::TradeSettled, RiskLevel::Medium);
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log trade settled: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log trade settled: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Trade settled event persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:294:
         let engine = create_test_audit_engine();
         engine.set_postgres_pool(Arc::clone(&pool)).await;
 
[31m-        let event = create_test_audit_event(AuditEventType::ComplianceValidation, RiskLevel::Medium);
[m[32m+        let event =
[m[32m+            create_test_audit_event(AuditEventType::ComplianceValidation, RiskLevel::Medium);
[m         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log compliance validation: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log compliance validation: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Compliance validation event persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:314:
 
         let event = create_test_audit_event(AuditEventType::PositionUpdate, RiskLevel::High);
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log position update: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log position update: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Position update event persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:335:
         event.after_state = Some(serde_json::json!({"balance": 95000, "margin": 47500}));
 
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log account modified: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log account modified: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Account modified event with state diff persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:353:
 
         let event = create_test_audit_event(AuditEventType::UserAuthenticated, RiskLevel::Low);
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log user authenticated: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log user authenticated: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ User authenticated event persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:371:
 
         let event = create_test_audit_event(AuditEventType::AuthorizationCheck, RiskLevel::Medium);
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log authorization check: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log authorization check: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Authorization check event persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:389:
 
         let event = create_test_audit_event(AuditEventType::SystemEvent, RiskLevel::Low);
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log system event: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log system event: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ System event persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:407:
 
         let event = create_test_audit_event(AuditEventType::ErrorEvent, RiskLevel::Critical);
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log error event: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log error event: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Error event persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:484:
         // Add large metadata (1000 key-value pairs)
         let mut large_metadata = HashMap::new();
         for i in 0..1000 {
[31m-            large_metadata.insert(format!("key_{}", i), serde_json::json!(format!("value_{}", i)));
[m[32m+            large_metadata.insert(
[m[32m+                format!("key_{}", i),
[m[32m+                serde_json::json!(format!("value_{}", i)),
[m[32m+            );
[m         }
         event.details.metadata = large_metadata;
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:491:
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log event with large metadata: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log event with large metadata: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Event with large metadata (1000 keys) persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:566:
         }
 
         tokio::time::sleep(tokio::time::Duration::from_millis(300)).await;
[31m-        println!("✅ Transaction atomicity verified: {} events persisted atomically", events_to_log);
[m[32m+        println!(
[m[32m+            "✅ Transaction atomicity verified: {} events persisted atomically",
[m[32m+            events_to_log
[m[32m+        );
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:653:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Query by transaction_id failed: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Query by transaction_id failed: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         println!("✅ Query by transaction_id successful");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:691:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Query by order_id failed: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Query by order_id failed: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         println!("✅ Query by order_id successful");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:769:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Pagination first page failed: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Pagination first page failed: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         println!("✅ Pagination first page (LIMIT 10, OFFSET 0) successful");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:808:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Pagination second page failed: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Pagination second page failed: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         println!("✅ Pagination second page (LIMIT 10, OFFSET 10) successful");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:847:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Sort timestamp ASC failed: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Sort timestamp ASC failed: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         println!("✅ Query sort by timestamp ASC successful");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:861:
         let engine = create_test_audit_engine();
         engine.set_postgres_pool(Arc::clone(&pool)).await;
 
[31m-        engine.log_event(create_test_audit_event(AuditEventType::OrderCreated, RiskLevel::Low)).unwrap();
[m[31m-        engine.log_event(create_test_audit_event(AuditEventType::OrderExecuted, RiskLevel::Medium)).unwrap();
[m[31m-        engine.log_event(create_test_audit_event(AuditEventType::RiskCheck, RiskLevel::High)).unwrap();
[m[32m+        engine
[m[32m+            .log_event(create_test_audit_event(
[m[32m+                AuditEventType::OrderCreated,
[m[32m+                RiskLevel::Low,
[m[32m+            ))
[m[32m+            .unwrap();
[m[32m+        engine
[m[32m+            .log_event(create_test_audit_event(
[m[32m+                AuditEventType::OrderExecuted,
[m[32m+                RiskLevel::Medium,
[m[32m+            ))
[m[32m+            .unwrap();
[m[32m+        engine
[m[32m+            .log_event(create_test_audit_event(
[m[32m+                AuditEventType::RiskCheck,
[m[32m+                RiskLevel::High,
[m[32m+            ))
[m[32m+            .unwrap();
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:884:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Sort by event type failed: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Sort by event type failed: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         println!("✅ Query sort by event type successful");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:916:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Empty time range query failed: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Empty time range query failed: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         if let Ok(query_result) = result {
[31m-            assert_eq!(query_result.total_count, 0, "Expected 0 events in empty time range");
[m[32m+            assert_eq!(
[m[32m+                query_result.total_count, 0,
[m[32m+                "Expected 0 events in empty time range"
[m[32m+            );
[m         }
         println!("✅ Query with empty time range successful (0 results)");
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:962:
         let elapsed = start.elapsed();
 
         assert!(result.is_ok(), "Query failed: {:?}", result.err());
[31m-        assert!(elapsed.as_millis() < 1000, "Query took too long: {}ms", elapsed.as_millis());
[m[31m-        println!("✅ Query execution time: {}ms (< 1000ms threshold)", elapsed.as_millis());
[m[32m+        assert!(
[m[32m+            elapsed.as_millis() < 1000,
[m[32m+            "Query took too long: {}ms",
[m[32m+            elapsed.as_millis()
[m[32m+        );
[m[32m+        println!(
[m[32m+            "✅ Query execution time: {}ms (< 1000ms threshold)",
[m[32m+            elapsed.as_millis()
[m[32m+        );
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1001:
         engine.set_postgres_pool(Arc::clone(&pool)).await;
 
         let mut event = create_test_audit_event(AuditEventType::OrderCreated, RiskLevel::Low);
[31m-        event.compliance_tags = vec!["SOX".to_owned(), "MIFID2".to_owned(), "BEST_EXECUTION".to_owned()];
[m[32m+        event.compliance_tags = vec![
[m[32m+            "SOX".to_owned(),
[m[32m+            "MIFID2".to_owned(),
[m[32m+            "BEST_EXECUTION".to_owned(),
[m[32m+        ];
[m 
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log event with compliance tags: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log event with compliance tags: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Compliance tags (SOX, MIFID2, BEST_EXECUTION) persisted");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1171:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_err(), "Offset validation should reject > 1,000,000");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Offset validation should reject > 1,000,000"
[m[32m+        );
[m         println!("✅ Query OFFSET validation (max 1,000,000) successful");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1202:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Valid limit should be accepted: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Valid limit should be accepted: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         println!("✅ Valid LIMIT (5000) accepted");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1233:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_ok(), "Valid offset should be accepted: {:?}", result.err());
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Valid offset should be accepted: {:?}",
[m[32m+            result.err()
[m[32m+        );
[m         println!("✅ Valid OFFSET (50,000) accepted");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1299:
         engine.set_postgres_pool(Arc::clone(&pool)).await;
 
         let event = create_test_audit_event(AuditEventType::OrderCreated, RiskLevel::Low);
[31m-        assert!(event.timestamp_nanos > 0, "Timestamp nanos should be non-zero");
[m[32m+        assert!(
[m[32m+            event.timestamp_nanos > 0,
[m[32m+            "Timestamp nanos should be non-zero"
[m[32m+        );
[m 
         let result = engine.log_event(event);
[31m-        assert!(result.is_ok(), "Failed to log event with nanosecond timestamp");
[m[32m+        assert!(
[m[32m+            result.is_ok(),
[m[32m+            "Failed to log event with nanosecond timestamp"
[m[32m+        );
[m 
         tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
         println!("✅ Nanosecond timestamp precision verified");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1384:
 
         assert!(success_count >= 5, "Should accept at least 5 events");
         assert!(failed_count > 0, "Should drop some events when buffer full");
[31m-        println!("✅ Buffer overflow correctly drops events (accepted: {}, dropped: {})", success_count, failed_count);
[m[32m+        println!(
[m[32m+            "✅ Buffer overflow correctly drops events (accepted: {}, dropped: {})",
[m[32m+            success_count, failed_count
[m[32m+        );
[m     }
 
     #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1431:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_err(), "Invalid transaction_id format should be rejected");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Invalid transaction_id format should be rejected"
[m[32m+        );
[m         println!("✅ Invalid transaction_id format correctly rejected");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1462:
         };
 
         let result = engine.query(query).await;
[31m-        assert!(result.is_err(), "Invalid order_id format should be rejected");
[m[32m+        assert!(
[m[32m+            result.is_err(),
[m[32m+            "Invalid order_id format should be rejected"
[m[32m+        );
[m         println!("✅ Invalid order_id format correctly rejected");
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1584:
             let engine_clone = Arc::clone(&engine);
             let handle = tokio::spawn(async move {
                 for j in 0..events_per_thread {
[31m-                    let event = create_test_audit_event(AuditEventType::OrderCreated, RiskLevel::Low);
[m[32m+                    let event =
[m[32m+                        create_test_audit_event(AuditEventType::OrderCreated, RiskLevel::Low);
[m                     let result = engine_clone.log_event(event);
                     assert!(result.is_ok(), "Thread {} event {} failed", i, j);
                 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1598:
         }
 
         tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
[31m-        println!("✅ Concurrent stress test: {} threads × {} events = {} total events logged",
[m[31m-                 thread_count, events_per_thread, thread_count * events_per_thread);
[m[32m+        println!(
[m[32m+            "✅ Concurrent stress test: {} threads × {} events = {} total events logged",
[m[32m+            thread_count,
[m[32m+            events_per_thread,
[m[32m+            thread_count * events_per_thread
[m[32m+        );
[m     }
 
     #[tokio::test]
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1612:
             let engine_clone = Arc::clone(&engine);
             let handle = tokio::spawn(async move {
                 for _ in 0..50 {
[31m-                    let event = create_test_audit_event(AuditEventType::OrderCreated, RiskLevel::Low);
[m[32m+                    let event =
[m[32m+                        create_test_audit_event(AuditEventType::OrderCreated, RiskLevel::Low);
[m                     let result = engine_clone.log_event(event);
                     assert!(result.is_ok(), "Thread {} failed", i);
                 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_persistence_tests.rs:1694:
 
         tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
 
[31m-        println!("✅ High throughput test: {} events in {}ms ({:.0} events/sec)",
[m[31m-                 event_count, elapsed.as_millis(), throughput);
[m[31m-        assert!(throughput > 1000.0, "Throughput should exceed 1000 events/sec");
[m[32m+        println!(
[m[32m+            "✅ High throughput test: {} events in {}ms ({:.0} events/sec)",
[m[32m+            event_count,
[m[32m+            elapsed.as_millis(),
[m[32m+            throughput
[m[32m+        );
[m[32m+        assert!(
[m[32m+            throughput > 1000.0,
[m[32m+            "Throughput should exceed 1000 events/sec"
[m[32m+        );
[m     }
 }
 
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_retention_tests.rs:10:
 use rust_decimal::Decimal;
 use std::collections::HashMap;
 use std::sync::Arc;
[31m-use trading_engine::compliance::audit_trails::{
[m[31m-    AuditTrailConfig, AuditTrailEngine, OrderDetails,
[m[31m-};
[m[32m+use trading_engine::compliance::audit_trails::{AuditTrailConfig, AuditTrailEngine, OrderDetails};
[m use trading_engine::persistence::postgres::{PostgresConfig, PostgresPool};
 
 // Helper to create test PostgreSQL pool
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_retention_tests.rs:19:
 async fn create_test_postgres_pool() -> Option<Arc<PostgresPool>> {
     let postgres_config = PostgresConfig {
[31m-        url: std::env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[31m-            "postgresql://postgres:postgres@localhost:5433/foxhunt".to_owned()
[m[31m-        }),
[m[32m+        url: std::env::var("DATABASE_URL")
[m[32m+            .unwrap_or_else(|_| "postgresql://postgres:postgres@localhost:5433/foxhunt".to_owned()),
[m         max_connections: 5,
         min_connections: 1,
         connect_timeout_ms: 5000,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_retention_tests.rs:39:
         Err(e) => {
             eprintln!("⚠️  Database not available: {} - Skipping DB tests", e);
             None
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_retention_tests.rs:147:
 
     // Create events at various ages
     let test_cases = vec![
[31m-        (retention_days + 10, true, "EXPIRED"),   // Should be archived
[m[31m-        (retention_days + 1, true, "EXPIRED"),    // Should be archived
[m[31m-        (retention_days, false, "BOUNDARY"),      // Should NOT be archived (exact boundary)
[m[31m-        (retention_days - 1, false, "ACTIVE"),    // Should NOT be archived
[m[31m-        (1, false, "RECENT"),                     // Should NOT be archived
[m[32m+        (retention_days + 10, true, "EXPIRED"), // Should be archived
[m[32m+        (retention_days + 1, true, "EXPIRED"),  // Should be archived
[m[32m+        (retention_days, false, "BOUNDARY"),    // Should NOT be archived (exact boundary)
[m[32m+        (retention_days - 1, false, "ACTIVE"),  // Should NOT be archived
[m[32m+        (1, false, "RECENT"),                   // Should NOT be archived
[m     ];
 
     for (age_days, should_archive, label) in test_cases {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_retention_tests.rs:360:
                 metadata: HashMap::new(),
             };
 
[31m-            let _ = audit_engine_logging.log_order_created(&format!("ORD-CONC-{:03}", i), &order_details);
[m[32m+            let _ = audit_engine_logging
[m[32m+                .log_order_created(&format!("ORD-CONC-{:03}", i), &order_details);
[m             tokio::time::sleep(tokio::time::Duration::from_millis(10)).await;
         }
     });
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:5:
 #![allow(unused_crate_dependencies)]
 
 use chrono::Utc;
[32m+use rust_decimal::Decimal;
[m use std::collections::HashMap;
 use std::sync::Arc;
[32m+use tokio::sync::mpsc;
[m use trading_engine::compliance::audit_trails::{
[31m-    AuditEventDetails, AuditEventType, AsyncAuditQueue, RiskLevel, TransactionAuditEvent,
[m[32m+    AsyncAuditQueue, AuditEventDetails, AuditEventType, RiskLevel, TransactionAuditEvent,
[m };
 use trading_engine::persistence::postgres::{PostgresConfig, PostgresPool};
[31m-use rust_decimal::Decimal;
[m[31m-use tokio::sync::mpsc;
[m 
 /// Helper function to create a test PostgreSQL pool
 async fn create_test_pool() -> Option<Arc<PostgresPool>> {
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:19:
     let postgres_config = PostgresConfig {
[31m-        url: std::env::var("DATABASE_URL")
[m[31m-            .unwrap_or_else(|_| "postgresql://postgres:password@localhost:5432/foxhunt_test".to_owned()),
[m[32m+        url: std::env::var("DATABASE_URL").unwrap_or_else(|_| {
[m[32m+            "postgresql://postgres:password@localhost:5432/foxhunt_test".to_owned()
[m[32m+        }),
[m         max_connections: 5,
         min_connections: 1,
         connect_timeout_ms: 5000,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:37:
         Err(e) => {
             eprintln!("Skipping test: Database not available: {}", e);
             None
[31m-        }
[m[32m+        },
[m     }
 }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:80:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
     let wal_path = temp_dir.path().join("audit.wal");
[31m-    
[m[32m+
[m     // Create AsyncAuditQueue
     let queue = AsyncAuditQueue::new(wal_path.clone());
     let (_tx, rx) = mpsc::unbounded_channel();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:90:
[31m-    
[m[32m+
[m     // Submit events (should write to WAL immediately)
     for i in 0..5 {
         let event = create_test_event(&format!("WAL-{:03}", i));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:94:
         queue.submit(event).expect("Failed to submit event");
     }
[31m-    
[m[32m+
[m     // Start background flush to write to WAL
     queue
         .start_background_flush(rx, Arc::clone(&pool), 100, 100)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:100:
         .await
         .expect("Failed to start background flush");
[31m-    
[m[32m+
[m     // Give it time to write to WAL
     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     // Verify WAL file exists and contains events
     assert!(wal_path.exists(), "WAL file should exist");
[31m-    
[m[31m-    let wal_content = std::fs::read_to_string(&wal_path)
[m[31m-        .expect("Failed to read WAL");
[m[31m-    
[m[32m+
[m[32m+    let wal_content = std::fs::read_to_string(&wal_path).expect("Failed to read WAL");
[m[32m+
[m     // Each event should be on a separate line
     let line_count = wal_content.lines().count();
     assert_eq!(line_count, 5, "WAL should contain 5 events");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:115:
[31m-    
[m[32m+
[m     // Verify events can be deserialized from WAL
     for line in wal_content.lines() {
[31m-        let _event: TransactionAuditEvent = serde_json::from_str(line)
[m[31m-            .expect("WAL should contain valid JSON events");
[m[32m+        let _event: TransactionAuditEvent =
[m[32m+            serde_json::from_str(line).expect("WAL should contain valid JSON events");
[m     }
[31m-    
[m[32m+
[m     println!("✅ WAL persistence test passed");
     println!("   - 5 events written to WAL");
     println!("   - WAL file verified at: {:?}", wal_path);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:131:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
     let wal_path = temp_dir.path().join("audit_crash.wal");
[31m-    
[m[32m+
[m     // Simulate: Write events to WAL but DON'T flush to database (crash scenario)
     {
         let queue = AsyncAuditQueue::new(wal_path.clone());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:141:
[31m-        
[m[32m+
[m         for i in 0..3 {
             let event = create_test_event(&format!("CRASH-{:03}", i));
             queue.submit(event).expect("Failed to submit event");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:145:
         }
[31m-        
[m[32m+
[m         tokio::time::sleep(tokio::time::Duration::from_millis(10)).await;
[31m-        
[m[32m+
[m         // Simulate crash: Drop queue without flushing
     }
[31m-    
[m[32m+
[m     // Verify WAL contains unprocessed events
     assert!(wal_path.exists(), "WAL should exist after crash");
[31m-    
[m[32m+
[m     // Simulate recovery: Create new queue, start background flush
     let queue_recovered = AsyncAuditQueue::new(wal_path.clone());
     let (_tx, rx) = mpsc::unbounded_channel();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:158:
[31m-    
[m[32m+
[m     queue_recovered
         .start_background_flush(rx, Arc::clone(&pool), 100, 100)
         .await
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:162:
         .expect("Failed to start background flush");
[31m-    
[m[32m+
[m     // Give recovery time to process WAL
     tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
[31m-    
[m[32m+
[m     // Verify WAL was cleared after successful recovery
     if wal_path.exists() {
[31m-        let wal_content = std::fs::read_to_string(&wal_path)
[m[31m-            .expect("Failed to read WAL");
[m[31m-        assert!(wal_content.is_empty() || wal_content.trim().is_empty(), 
[m[31m-                "WAL should be cleared after recovery");
[m[32m+        let wal_content = std::fs::read_to_string(&wal_path).expect("Failed to read WAL");
[m[32m+        assert!(
[m[32m+            wal_content.is_empty() || wal_content.trim().is_empty(),
[m[32m+            "WAL should be cleared after recovery"
[m[32m+        );
[m     }
[31m-    
[m[32m+
[m     println!("✅ Crash recovery test passed");
     println!("   - Simulated crash with 3 events in WAL");
     println!("   - Recovery process replayed events");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:184:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
     let wal_path = temp_dir.path().join("audit_batch.wal");
[31m-    
[m[32m+
[m     let queue = AsyncAuditQueue::new(wal_path.clone());
     let (tx, rx) = mpsc::unbounded_channel();
[31m-    
[m[32m+
[m     // Start background flush with batch_size=5
     queue
         .start_background_flush(rx, Arc::clone(&pool), 5, 1000)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:197:
         .await
         .expect("Failed to start background flush");
[31m-    
[m[32m+
[m     // Submit 10 events (should trigger 2 batches)
     for i in 0..10 {
         let event = create_test_event(&format!("BATCH-{:03}", i));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:203:
         tx.send(event).expect("Failed to send event");
     }
[31m-    
[m[32m+
[m     // Wait for batches to flush
     tokio::time::sleep(tokio::time::Duration::from_millis(300)).await;
[31m-    
[m[32m+
[m     let stats = queue.stats();
[31m-    assert!(stats.persisted >= 10, "Should have persisted at least 10 events");
[m[31m-    
[m[32m+    assert!(
[m[32m+        stats.persisted >= 10,
[m[32m+        "Should have persisted at least 10 events"
[m[32m+    );
[m[32m+
[m     println!("✅ Batch flushing test passed");
     println!("   - Submitted 10 events");
     println!("   - Batch size: 5");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:222:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
     let wal_path = temp_dir.path().join("audit_time.wal");
[31m-    
[m[32m+
[m     let queue = AsyncAuditQueue::new(wal_path.clone());
     let (tx, rx) = mpsc::unbounded_channel();
[31m-    
[m[32m+
[m     // Start background flush with large batch_size but short interval (200ms)
     queue
         .start_background_flush(rx, Arc::clone(&pool), 1000, 200)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:235:
         .await
         .expect("Failed to start background flush");
[31m-    
[m[32m+
[m     // Submit only 3 events (below batch threshold)
     for i in 0..3 {
         let event = create_test_event(&format!("TIME-{:03}", i));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:241:
         tx.send(event).expect("Failed to send event");
     }
[31m-    
[m[32m+
[m     // Wait for time-based flush (200ms interval)
     tokio::time::sleep(tokio::time::Duration::from_millis(400)).await;
[31m-    
[m[32m+
[m     let stats = queue.stats();
[31m-    assert!(stats.persisted >= 3, "Should flush on time interval even if batch not full");
[m[31m-    
[m[32m+    assert!(
[m[32m+        stats.persisted >= 3,
[m[32m+        "Should flush on time interval even if batch not full"
[m[32m+    );
[m[32m+
[m     println!("✅ Time-based flush test passed");
     println!("   - Submitted 3 events (below batch threshold)");
     println!("   - Flush interval: 200ms");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:257:
 #[tokio::test]
 async fn test_fsync_durability_guarantees() {
     use std::fs::OpenOptions;
[31m-    
[m[32m+
[m     let pool = match create_test_pool().await {
         Some(p) => p,
         None => return,
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:264:
     };
[31m-    
[m[32m+
[m     let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
     let wal_path = temp_dir.path().join("audit_fsync.wal");
[31m-    
[m[32m+
[m     let queue = AsyncAuditQueue::new(wal_path.clone());
     let (tx, rx) = mpsc::unbounded_channel();
[31m-    
[m[32m+
[m     // Start background flush
     queue
         .start_background_flush(rx, Arc::clone(&pool), 100, 100)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:275:
         .await
         .expect("Failed to start background flush");
[31m-    
[m[32m+
[m     // Submit event
     let event = create_test_event("FSYNC-001");
     tx.send(event).expect("Failed to send event");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:281:
[31m-    
[m[32m+
[m     // Give time to write
     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     // Verify WAL file exists and is fsynced
     assert!(wal_path.exists(), "WAL should exist");
[31m-    
[m[32m+
[m     // Try to open file and verify it's readable (fsync ensures visibility)
     let mut file = OpenOptions::new()
         .read(true)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:291:
         .open(&wal_path)
         .expect("WAL should be readable after fsync");
[31m-    
[m[32m+
[m     let mut content = String::new();
[31m-    std::io::Read::read_to_string(&mut file, &mut content)
[m[31m-        .expect("Should read WAL content");
[m[31m-    
[m[32m+    std::io::Read::read_to_string(&mut file, &mut content).expect("Should read WAL content");
[m[32m+
[m     assert!(!content.is_empty(), "WAL should contain data after fsync");
[31m-    
[m[32m+
[m     println!("✅ fsync durability test passed");
     println!("   - Event written to WAL");
     println!("   - File is readable (fsync completed)");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:345:
 
         handles.push(handle);
     }
[31m-    
[m[32m+
[m     // Wait for all tasks
     for handle in handles {
         handle.await.expect("Task should complete");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:352:
     }
[31m-    
[m[32m+
[m     let total_success = success_count.load(Ordering::Relaxed);
[31m-    assert_eq!(total_success, 100, "Should successfully submit all 100 events");
[m[31m-    
[m[32m+    assert_eq!(
[m[32m+        total_success, 100,
[m[32m+        "Should successfully submit all 100 events"
[m[32m+    );
[m[32m+
[m     println!("✅ Concurrent write test passed");
     println!("   - 10 tasks submitting concurrently");
     println!("   - 10 events per task");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:367:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
     let wal_path = temp_dir.path().join("audit_explicit.wal");
[31m-    
[m[32m+
[m     let queue = AsyncAuditQueue::new(wal_path.clone());
     let (tx, rx) = mpsc::unbounded_channel();
[31m-    
[m[32m+
[m     queue
         .start_background_flush(rx, Arc::clone(&pool), 100, 1000)
         .await
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:380:
         .expect("Failed to start background flush");
[31m-    
[m[32m+
[m     // Submit events
     for i in 0..5 {
         let event = create_test_event(&format!("EXPLICIT-{:03}", i));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:385:
         tx.send(event).expect("Failed to send event");
     }
[31m-    
[m[32m+
[m     // Explicit flush (blocks until all queued events are persisted)
     queue.flush().await.expect("Flush should succeed");
[31m-    
[m[32m+
[m     let stats = queue.stats();
[31m-    assert!(stats.persisted >= 5, "All events should be persisted after explicit flush");
[m[31m-    
[m[32m+    assert!(
[m[32m+        stats.persisted >= 5,
[m[32m+        "All events should be persisted after explicit flush"
[m[32m+    );
[m[32m+
[m     println!("✅ Explicit flush test passed");
     println!("   - Submitted 5 events");
     println!("   - Called explicit flush()");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:404:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
     let wal_path = temp_dir.path().join("audit_stats.wal");
[31m-    
[m[32m+
[m     let queue = AsyncAuditQueue::new(wal_path.clone());
     let (tx, rx) = mpsc::unbounded_channel();
[31m-    
[m[32m+
[m     // Start background flush
     queue
         .start_background_flush(rx, Arc::clone(&pool), 100, 100)
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:417:
         .await
         .expect("Failed to start background flush");
[31m-    
[m[32m+
[m     // Initial stats
     let stats = queue.stats();
     assert_eq!(stats.queued, 0, "Initially no events queued");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:423:
     assert_eq!(stats.persisted, 0, "Initially no events persisted");
     assert_eq!(stats.dropped, 0, "Initially no events dropped");
[31m-    
[m[32m+
[m     // Submit events
     for i in 0..10 {
         let event = create_test_event(&format!("STATS-{:03}", i));
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:429:
         tx.send(event).expect("Failed to send event");
     }
[31m-    
[m[32m+
[m     tokio::time::sleep(tokio::time::Duration::from_millis(200)).await;
[31m-    
[m[32m+
[m     let stats = queue.stats();
     assert_eq!(stats.queued, 10, "Should track queued events");
[31m-    
[m[32m+
[m     println!("✅ Statistics tracking test passed");
     println!("   - Queued: {} events", stats.queued);
     println!("   - Persisted: {} events", stats.persisted);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:447:
         Some(p) => p,
         None => return,
     };
[31m-    
[m[32m+
[m     let temp_dir = tempfile::tempdir().expect("Failed to create temp dir");
     let wal_path = temp_dir.path().join("audit_power_loss.wal");
[31m-    
[m[32m+
[m     // Phase 1: Submit events but simulate power loss before persistence
     {
         let queue = AsyncAuditQueue::new(wal_path.clone());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:457:
[31m-        
[m[32m+
[m         for i in 0..5 {
             let event = create_test_event(&format!("POWER-LOSS-{:03}", i));
             queue.submit(event).expect("Failed to submit event");
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:461:
         }
[31m-        
[m[32m+
[m         // Wait for WAL writes (but not DB persistence)
         tokio::time::sleep(tokio::time::Duration::from_millis(50)).await;
[31m-        
[m[32m+
[m         // Simulate power loss: abrupt termination
         drop(queue);
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:469:
[31m-    
[m[32m+
[m     // Phase 2: System restart - recover from WAL
     {
         let queue_recovered = AsyncAuditQueue::new(wal_path.clone());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:473:
         let (_tx, rx) = mpsc::unbounded_channel();
[31m-        
[m[32m+
[m         queue_recovered
             .start_background_flush(rx, Arc::clone(&pool), 100, 100)
             .await
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/audit_trail_persistence_test.rs:478:
             .expect("Failed to start recovery");
[31m-        
[m[32m+
[m         // Wait for recovery
         tokio::time::sleep(tokio::time::Duration::from_millis(300)).await;
[31m-        
[m[32m+
[m         let stats = queue_recovered.stats();
[31m-        assert!(stats.persisted >= 5, "Should recover all events after power loss");
[m[31m-        
[m[32m+        assert!(
[m[32m+            stats.persisted >= 5,
[m[32m+            "Should recover all events after power loss"
[m[32m+        );
[m[32m+
[m         println!("✅ Power loss simulation test passed");
         println!("   - Phase 1: Submitted 5 events, simulated power loss");
         println!("   - Phase 2: Recovered from WAL");
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/brokers_comprehensive.rs:98:
         let mut connector1 = BrokerConnector::new(config.clone());
         let mut connector2 = BrokerConnector::new(config);
 
[31m-        let (result1, result2) = tokio::join!(
[m[31m-            connector1.initialize(),
[m[31m-            connector2.initialize()
[m[31m-        );
[m[32m+        let (result1, result2) = tokio::join!(connector1.initialize(), connector2.initialize());
[m 
         assert!(result1.is_ok());
         assert!(result2.is_ok());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/brokers_comprehensive.rs:156:
         let config = BrokerConnectorConfig::default();
         let connector = BrokerConnector::new(config);
 
[31m-        let order_ids = vec![
[m[31m-            "ORD_ABC-123",
[m[31m-            "ORD:456",
[m[31m-            "ORD/789",
[m[31m-            "ORD.XYZ",
[m[31m-        ];
[m[32m+        let order_ids = vec!["ORD_ABC-123", "ORD:456", "ORD/789", "ORD.XYZ"];
[m 
         for order_id in order_ids {
             let result = connector.submit_order(order_id).await;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/brokers_comprehensive.rs:330:
         let mut handles = vec![];
         for _ in 0..5 {
             let connector_clone = connector.clone();
[31m-            let handle = tokio::spawn(async move {
[m[31m-                connector_clone.get_connected_brokers().await
[m[31m-            });
[m[32m+            let handle = tokio::spawn(async move { connector_clone.get_connected_brokers().await });
[m             handles.push(handle);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/brokers_comprehensive.rs:437:
         let config1 = BrokerConnectorConfig::default();
         let config2 = config1.clone();
 
[31m-        assert_eq!(config1.brokers.interactive_brokers.enabled, config2.brokers.interactive_brokers.enabled);
[m[32m+        assert_eq!(
[m[32m+            config1.brokers.interactive_brokers.enabled,
[m[32m+            config2.brokers.interactive_brokers.enabled
[m[32m+        );
[m         assert_eq!(config1.fail_on_broker_error, config2.fail_on_broker_error);
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/brokers_comprehensive.rs:518:
         let broker_handles: Vec<_> = (0..5)
             .map(|_| {
                 let connector_clone = connector.clone();
[31m-                tokio::spawn(async move {
[m[31m-                    connector_clone.get_connected_brokers().await
[m[31m-                })
[m[32m+                tokio::spawn(async move { connector_clone.get_connected_brokers().await })
[m             })
             .collect();
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/brokers_comprehensive.rs:550:
                 match i % 3 {
                     0 => {
                         let _ = connector_clone.submit_order(&format!("ORD_{}", i)).await;
[31m-                    }
[m[32m+                    },
[m                     1 => {
                         let _ = connector_clone.cancel_order(&format!("ORD_{}", i)).await;
[31m-                    }
[m[32m+                    },
[m                     _ => {
                         connector_clone.get_connected_brokers().await;
[31m-                    }
[m[32m+                    },
[m                 }
             });
             handles.push(handle);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/brokers_comprehensive.rs:605:
         let config = BrokerConnectorConfig::default();
         let connector = BrokerConnector::new(config);
 
[31m-        let unicode_ids = vec![
[m[31m-            "ORD_日本語",
[m[31m-            "ORD_中文",
[m[31m-            "ORD_한글",
[m[31m-            "ORD_العربية",
[m[31m-        ];
[m[32m+        let unicode_ids = vec!["ORD_日本語", "ORD_中文", "ORD_한글", "ORD_العربية"];
[m 
         for order_id in unicode_ids {
             let submit_result = connector.submit_order(order_id).await;
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:24:
     ExecutionResult {
         order_id: OrderId::new(),
         symbol,
[31m-        executed_quantity: if side == OrderSide::Buy { quantity } else { -quantity },
[m[32m+        executed_quantity: if side == OrderSide::Buy {
[m[32m+            quantity
[m[32m+        } else {
[m[32m+            -quantity
[m[32m+        },
[m         execution_price: price,
         commission: Decimal::from_str("0.01").unwrap(),
         execution_time: Utc::now(),
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:422:
         );
         pm.update_position(&exec).unwrap();
 
[31m-        pm.update_market_values("TSLA", Decimal::from_str("680.00").unwrap()).unwrap();
[m[32m+        pm.update_market_values("TSLA", Decimal::from_str("680.00").unwrap())
[m[32m+            .unwrap();
[m 
         let position = pm.get_position("TSLA").unwrap();
         // Unrealized P&L should be negative: 100 * (680 - 700) = -2000
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:525:
             OrderSide::Buy,
         );
         pm.update_position(&exec1).unwrap();
[31m-        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap()).unwrap();
[m[32m+        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap())
[m[32m+            .unwrap();
[m 
         let total = pm.get_total_portfolio_value();
         // Market value: 100 * 160 = 16000
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:550:
             OrderSide::Buy,
         );
         pm.update_position(&exec).unwrap();
[31m-        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap()).unwrap();
[m[32m+        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap())
[m[32m+            .unwrap();
[m 
         let total = pm.get_total_unrealized_pnl();
         assert_eq!(total, Decimal::from_str("1000").unwrap());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:647:
             OrderSide::Buy,
         );
         pm.update_position(&exec).unwrap();
[31m-        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap()).unwrap();
[m[32m+        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap())
[m[32m+            .unwrap();
[m 
         let exceeding = pm.get_positions_exceeding_limits(Decimal::from_str("20000").unwrap());
         assert_eq!(exceeding.len(), 0);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:664:
             OrderSide::Buy,
         );
         pm.update_position(&exec).unwrap();
[31m-        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap()).unwrap();
[m[32m+        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap())
[m[32m+            .unwrap();
[m 
         let exceeding = pm.get_positions_exceeding_limits(Decimal::from_str("10000").unwrap());
         assert_eq!(exceeding.len(), 1);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:689:
             OrderSide::Buy,
         );
         pm.update_position(&exec).unwrap();
[31m-        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap()).unwrap();
[m[32m+        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap())
[m[32m+            .unwrap();
[m 
         let risk = pm.calculate_concentration_risk();
         assert_eq!(risk.len(), 1);
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:711:
                 OrderSide::Buy,
             );
             pm.update_position(&exec).unwrap();
[31m-            pm.update_market_values(symbol, Decimal::from_str("160.00").unwrap()).unwrap();
[m[32m+            pm.update_market_values(symbol, Decimal::from_str("160.00").unwrap())
[m[32m+                .unwrap();
[m         }
 
         let risk = pm.calculate_concentration_risk();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/position_manager_comprehensive.rs:732:
             OrderSide::Buy,
         );
         pm.update_position(&exec).unwrap();
[31m-        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap()).unwrap();
[m[32m+        pm.update_market_values("AAPL", Decimal::from_str("160.00").unwrap())
[m[32m+            .unwrap();
[m 
         let stats = pm.get_position_stats();
         assert_eq!(stats.total_positions, 1);
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: Unknown configuration option `macro_use_wildcards`
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `format_code_in_doc_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 80`, unstable features are only available in nightly channel.
Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `normalize_doc_attributes = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_matchers = true`, unstable features are only available in nightly channel.
Warning: can't set `format_macro_bodies = true`, unstable features are only available in nightly channel.
Warning: can't set `empty_item_single_line = false`, unstable features are only available in nightly channel.
Warning: can't set `where_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `imports_layout = Vertical`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Module`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `merge_imports = false`, unstable features are only available in nightly channel.
Warning: can't set `overflow_delimited_expr = true`, unstable features are only available in nightly channel.
Warning: can't set `struct_field_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `enum_discrim_align_threshold = 20`, unstable features are only available in nightly channel.
Warning: can't set `match_arm_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `force_multiline_blocks = false`, unstable features are only available in nightly channel.
Warning: can't set `brace_style = SameLineWhere`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_upper_bound = 2`, unstable features are only available in nightly channel.
Warning: can't set `blank_lines_lower_bound = 0`, unstable features are only available in nightly channel.
Warning: can't set `format_generated_files = false`, unstable features are only available in nightly channel.
Warning: can't set `skip_children = false`, unstable features are only available in nightly channel.
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:37:
         Ok(())
     }
 
[31m-    fn subscribe_market_data_events(&self) -> tokio::sync::broadcast::Receiver<common::MarketDataEvent> {
[m[32m+    fn subscribe_market_data_events(
[m[32m+        &self,
[m[32m+    ) -> tokio::sync::broadcast::Receiver<common::MarketDataEvent> {
[m         self.market_data_tx.subscribe()
     }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:44:
[31m-    fn subscribe_order_update_events(&self) -> tokio::sync::broadcast::Receiver<common::MarketDataEvent> {
[m[32m+    fn subscribe_order_update_events(
[m[32m+        &self,
[m[32m+    ) -> tokio::sync::broadcast::Receiver<common::MarketDataEvent> {
[m         self.order_update_tx.subscribe()
     }
 }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:105:
     #[tokio::test]
     async fn test_submit_order_market_buy_success() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "AAPL".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("100").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "AAPL".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("100").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result.is_ok());
         let order_id = result.unwrap();
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:123:
     #[tokio::test]
     async fn test_submit_order_market_sell_success() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "MSFT".to_string(),
[m[31m-            OrderSide::Sell,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("50").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "MSFT".to_string(),
[m[32m+                OrderSide::Sell,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("50").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result.is_ok());
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:138:
     #[tokio::test]
     async fn test_submit_order_limit_buy_with_price() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "GOOGL".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Limit,
[m[31m-            Decimal::from_str("10").unwrap(),
[m[31m-            Some(Decimal::from_str("2800.50").unwrap()),
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "GOOGL".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Limit,
[m[32m+                Decimal::from_str("10").unwrap(),
[m[32m+                Some(Decimal::from_str("2800.50").unwrap()),
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result.is_ok());
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:153:
     #[tokio::test]
     async fn test_submit_order_limit_sell_with_price() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "TSLA".to_string(),
[m[31m-            OrderSide::Sell,
[m[31m-            OrderType::Limit,
[m[31m-            Decimal::from_str("25").unwrap(),
[m[31m-            Some(Decimal::from_str("750.00").unwrap()),
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "TSLA".to_string(),
[m[32m+                OrderSide::Sell,
[m[32m+                OrderType::Limit,
[m[32m+                Decimal::from_str("25").unwrap(),
[m[32m+                Some(Decimal::from_str("750.00").unwrap()),
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result.is_ok());
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:168:
     #[tokio::test]
     async fn test_submit_order_stop_loss_with_stop_price() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "AMZN".to_string(),
[m[31m-            OrderSide::Sell,
[m[31m-            OrderType::Stop,
[m[31m-            Decimal::from_str("20").unwrap(),
[m[31m-            None,
[m[31m-            Some(Decimal::from_str("3200.00").unwrap()),
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "AMZN".to_string(),
[m[32m+                OrderSide::Sell,
[m[32m+                OrderType::Stop,
[m[32m+                Decimal::from_str("20").unwrap(),
[m[32m+                None,
[m[32m+                Some(Decimal::from_str("3200.00").unwrap()),
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result.is_ok());
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:183:
     #[tokio::test]
     async fn test_submit_order_zero_quantity_validation() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "AAPL".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::ZERO,
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "AAPL".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::ZERO,
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         // Order should still be submitted (validation happens at broker level)
         assert!(result.is_ok());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:199:
     #[tokio::test]
     async fn test_submit_order_fractional_shares() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "AAPL".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("0.5").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "AAPL".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("0.5").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result.is_ok());
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:214:
     #[tokio::test]
     async fn test_submit_order_large_quantity() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "SPY".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("100000").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "SPY".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("100000").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result.is_ok());
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:229:
     #[tokio::test]
     async fn test_submit_order_empty_symbol_handling() {
         let engine = create_test_engine();
[31m-        let result = engine.submit_order(
[m[31m-            "".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("100").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("100").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         // Should accept empty symbol (validation at broker level)
         assert!(result.is_ok());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:250:
         for i in 0..10 {
             let engine_clone = Arc::clone(&engine);
             let handle = tokio::spawn(async move {
[31m-                engine_clone.submit_order(
[m[31m-                    format!("SYM{}", i),
[m[31m-                    OrderSide::Buy,
[m[31m-                    OrderType::Market,
[m[31m-                    Decimal::from_str("10").unwrap(),
[m[31m-                    None,
[m[31m-                    None,
[m[31m-                ).await
[m[32m+                engine_clone
[m[32m+                    .submit_order(
[m[32m+                        format!("SYM{}", i),
[m[32m+                        OrderSide::Buy,
[m[32m+                        OrderType::Market,
[m[32m+                        Decimal::from_str("10").unwrap(),
[m[32m+                        None,
[m[32m+                        None,
[m[32m+                    )
[m[32m+                    .await
[m             });
             handles.push(handle);
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:285:
         let engine = create_test_engine();
 
         // First submit an order
[31m-        let order_result = engine.submit_order(
[m[31m-            "AAPL".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Limit,
[m[31m-            Decimal::from_str("100").unwrap(),
[m[31m-            Some(Decimal::from_str("150.00").unwrap()),
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let order_result = engine
[m[32m+            .submit_order(
[m[32m+                "AAPL".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Limit,
[m[32m+                Decimal::from_str("100").unwrap(),
[m[32m+                Some(Decimal::from_str("150.00").unwrap()),
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(order_result.is_ok());
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:336:
         let mut handles = vec![];
         for _ in 0..5 {
             let engine_clone = Arc::clone(&engine);
[31m-            let handle = tokio::spawn(async move {
[m[31m-                engine_clone.cancel_order(order_id).await
[m[31m-            });
[m[32m+            let handle = tokio::spawn(async move { engine_clone.cancel_order(order_id).await });
[m             handles.push(handle);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:425:
         for i in 0..10 {
             let engine_clone = Arc::clone(&engine);
             let handle = tokio::spawn(async move {
[31m-                engine_clone.get_account_info(format!("account-{}", i)).await
[m[32m+                engine_clone
[m[32m+                    .get_account_info(format!("account-{}", i))
[m[32m+                    .await
[m             });
             handles.push(handle);
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:482:
         for i in 0..5 {
             let engine_clone = Arc::clone(&engine);
             let handle = tokio::spawn(async move {
[31m-                engine_clone.get_positions(Some(format!("account-{}", i))).await
[m[32m+                engine_clone
[m[32m+                    .get_positions(Some(format!("account-{}", i)))
[m[32m+                    .await
[m             });
             handles.push(handle);
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:518:
 
         let result1 = engine.subscribe_market_data(vec!["AAPL".to_string()]).await;
         let result2 = engine.subscribe_market_data(vec!["MSFT".to_string()]).await;
[31m-        let result3 = engine.subscribe_market_data(vec!["GOOGL".to_string()]).await;
[m[32m+        let result3 = engine
[m[32m+            .subscribe_market_data(vec!["GOOGL".to_string()])
[m[32m+            .await;
[m 
         assert!(result1.is_ok());
         assert!(result2.is_ok());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:552:
         for i in 0..10 {
             let engine_clone = Arc::clone(&engine);
             let handle = tokio::spawn(async move {
[31m-                engine_clone.subscribe_market_data(vec![format!("SYM{}", i)]).await
[m[32m+                engine_clone
[m[32m+                    .subscribe_market_data(vec![format!("SYM{}", i)])
[m[32m+                    .await
[m             });
             handles.push(handle);
         }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:603:
         let mut handles = vec![];
         for _ in 0..5 {
             let engine_clone = Arc::clone(&engine);
[31m-            let handle = tokio::spawn(async move {
[m[31m-                engine_clone.subscribe_order_updates(None).await
[m[31m-            });
[m[32m+            let handle =
[m[32m+                tokio::spawn(async move { engine_clone.subscribe_order_updates(None).await });
[m             handles.push(handle);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:641:
         let engine = create_test_engine();
 
         // Submit some orders
[31m-        let _ = engine.submit_order(
[m[31m-            "AAPL".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("100").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let _ = engine
[m[32m+            .submit_order(
[m[32m+                "AAPL".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("100").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
[31m-        let _ = engine.submit_order(
[m[31m-            "MSFT".to_string(),
[m[31m-            OrderSide::Sell,
[m[31m-            OrderType::Limit,
[m[31m-            Decimal::from_str("50").unwrap(),
[m[31m-            Some(Decimal::from_str("300.00").unwrap()),
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let _ = engine
[m[32m+            .submit_order(
[m[32m+                "MSFT".to_string(),
[m[32m+                OrderSide::Sell,
[m[32m+                OrderType::Limit,
[m[32m+                Decimal::from_str("50").unwrap(),
[m[32m+                Some(Decimal::from_str("300.00").unwrap()),
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         let stats = engine.get_trading_stats().await;
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:672:
         let mut handles = vec![];
         for _ in 0..10 {
             let engine_clone = Arc::clone(&engine);
[31m-            let handle = tokio::spawn(async move {
[m[31m-                engine_clone.get_trading_stats().await
[m[31m-            });
[m[32m+            let handle = tokio::spawn(async move { engine_clone.get_trading_stats().await });
[m             handles.push(handle);
         }
 
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:709:
             let handle = tokio::spawn(async move {
                 match i % 4 {
                     0 => {
[31m-                        engine_clone.submit_order(
[m[31m-                            format!("SYM{}", i),
[m[31m-                            OrderSide::Buy,
[m[31m-                            OrderType::Market,
[m[31m-                            Decimal::from_str("10").unwrap(),
[m[31m-                            None,
[m[31m-                            None,
[m[31m-                        ).await.ok();
[m[32m+                        engine_clone
[m[32m+                            .submit_order(
[m[32m+                                format!("SYM{}", i),
[m[32m+                                OrderSide::Buy,
[m[32m+                                OrderType::Market,
[m[32m+                                Decimal::from_str("10").unwrap(),
[m[32m+                                None,
[m[32m+                                None,
[m[32m+                            )
[m[32m+                            .await
[m[32m+                            .ok();
[m                     },
                     1 => {
                         engine_clone.get_trading_stats().await;
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:723:
                     },
                     2 => {
[31m-                        engine_clone.get_positions(Some(format!("account-{}", i))).await.ok();
[m[32m+                        engine_clone
[m[32m+                            .get_positions(Some(format!("account-{}", i)))
[m[32m+                            .await
[m[32m+                            .ok();
[m                     },
                     _ => {
[31m-                        engine_clone.subscribe_market_data(vec![format!("SYM{}", i)]).await.ok();
[m[32m+                        engine_clone
[m[32m+                            .subscribe_market_data(vec![format!("SYM{}", i)])
[m[32m+                            .await
[m[32m+                            .ok();
[m                     },
                 }
             });
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:749:
         let _ = engine.get_order_status(OrderId::new()).await;
 
         // Engine should still be functional
[31m-        let result = engine.submit_order(
[m[31m-            "AAPL".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("100").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result = engine
[m[32m+            .submit_order(
[m[32m+                "AAPL".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("100").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result.is_ok());
     }
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:766:
         let engine = create_test_engine();
 
         // Very large quantity
[31m-        let result1 = engine.submit_order(
[m[31m-            "SPY".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("999999999").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result1 = engine
[m[32m+            .submit_order(
[m[32m+                "SPY".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("999999999").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         // Very small quantity
[31m-        let result2 = engine.submit_order(
[m[31m-            "BTC".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Market,
[m[31m-            Decimal::from_str("0.00000001").unwrap(),
[m[31m-            None,
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result2 = engine
[m[32m+            .submit_order(
[m[32m+                "BTC".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Market,
[m[32m+                Decimal::from_str("0.00000001").unwrap(),
[m[32m+                None,
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         // Very high price
[31m-        let result3 = engine.submit_order(
[m[31m-            "BRK.A".to_string(),
[m[31m-            OrderSide::Buy,
[m[31m-            OrderType::Limit,
[m[31m-            Decimal::from_str("1").unwrap(),
[m[31m-            Some(Decimal::from_str("500000.00").unwrap()),
[m[31m-            None,
[m[31m-        ).await;
[m[32m+        let result3 = engine
[m[32m+            .submit_order(
[m[32m+                "BRK.A".to_string(),
[m[32m+                OrderSide::Buy,
[m[32m+                OrderType::Limit,
[m[32m+                Decimal::from_str("1").unwrap(),
[m[32m+                Some(Decimal::from_str("500000.00").unwrap()),
[m[32m+                None,
[m[32m+            )
[m[32m+            .await;
[m 
         assert!(result1.is_ok());
         assert!(result2.is_ok());
Diff in /home/jgrusewski/Work/foxhunt/trading_engine/tests/trading_engine_comprehensive.rs:805:
         let engine = create_test_engine();
 
         // Test various symbol formats
[31m-        let symbols = vec![
[m[31m-            "AAPL",
[m[31m-            "BRK.B",
[m[31m-            "^VIX",
[m[31m-            "EUR/USD",
[m[31m-            "BTC-USD",
[m[31m-            "ES_F",
[m[31m-        ];
[m[32m+        let symbols = vec!["AAPL", "BRK.B", "^VIX", "EUR/USD", "BTC-USD", "ES_F"];
[m 
         for symbol in symbols {
[31m-            let result = engine.submit_order(
[m[31m-                symbol.to_string(),
[m[31m-                OrderSide::Buy,
[m[31m-                OrderType::Market,
[m[31m-                Decimal::from_str("10").unwrap(),
[m[31m-                None,
[m[31m-                None,
[m[31m-            ).await;
[m[32m+            let result = engine
[m[32m+                .submit_order(
[m[32m+                    symbol.to_string(),
[m[32m+                    OrderSide::Buy,
[m[32m+                    OrderType::Market,
[m[32m+                    Decimal::from_str("10").unwrap(),
[m[32m+                    None,
[m[32m+                    None,
[m[32m+                )
[m[32m+                .await;
[m 
             assert!(result.is_ok(), "Failed for symbol: {}", symbol);
         }
