Web-gateway routing: - Point TRADING_SERVICE_URL at api-gateway (proto mismatch fix) Web-gateway uses foxhunt.tli.TradingService proto but was connecting directly to trading-service which implements trading.TradingService. api-gateway already proxies Subscribe* → Stream* correctly. GitLab KAS: - Disable gitlab_kas in appConfig to stop sidekiq NotifyGitPushWorker errors (KAS pod was already disabled but Rails still tried to connect) Trading service monitoring (3 stubs → real): - AcknowledgeAlert: real alert lookup + state mutation in shared store - GetActiveAlerts: returns actual active alerts from in-memory store - StreamAlerts: now persists generated alerts (capped at 1000 entries) Trading service ML streams (2 stubs → real): - StreamModelMetrics: emits real inference_count, error_count, latency per model every N seconds from the RuntimeModelInfo registry - StreamSignalStrength: emits per-symbol signal aggregation from model ensemble weights and latency confidence Backtesting service: - stop_backtest: real CancellationToken cancellation (was no-op) Tokens stored per-backtest, execute_backtest wraps strategy call in tokio::select! for immediate cancellation Deleted 7 empty placeholder files: - 4 Wave D regime stubs (dynamic_stops, ensemble, performance_tracker, position_sizer) — comment-only files, never wired - 2 Wave 3 feature stubs (microstructure, statistical) - 1 PPO stub (unified_ppo.rs — empty struct definitions) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ml
Machine learning models for Foxhunt.
Models
- DQN (Rainbow) -- Deep Q-Network with prioritized experience replay, dueling heads, noisy nets, double Q-learning
- PPO -- Proximal Policy Optimization with GAE, LSTM policies, clip-higher option
- TFT -- Temporal Fusion Transformer for multi-horizon time series forecasting
- Mamba2 -- State space model for efficient sequence prediction
- Liquid Networks -- Biologically inspired neural networks for non-stationary data
- TLOB -- Transformer-based Limit Order Book analysis
- Flash Attention -- Optimized attention implementation
Training
Two paths per model:
- Standalone trainer -- direct training loop (e.g.,
DQN::train,PpoTrainer) - UnifiedTrainable adapter -- wraps models for the hyperopt pipeline (e.g.,
DQNTrainableAdapter,UnifiedTrainablePPO)
Inference
InferenceAdapterBridge connects models to the ensemble coordinator in adaptive-strategy. Each model exposes an InferenceAdapter trait for prediction.
Backend
- Candle v0.9.1 --
VarMap,AdamW,loss.backward(),GradStore,opt.step(&grads) - CUDA required for training -- tested on RTX 3050 Ti 4GB, max batch size 230
- CPU inference supported
Hyperopt
ArgminOptimizer (Particle Swarm Optimization) with per-model adapters:
DQN, PPO, ContinuousPPO, TFT, Mamba2. Uses ParameterSpace trait for continuous parameter mapping.
ModelType Enum
15 variants: CompactDQN, DistilledMicroNet, DQN, RainbowDQN, MAMBA, TFT, TGGN, LNN, TLOB, PPO, Transformer, Mamba, LiquidNet, TGNN, Ensemble.
Key Modules
dqn, ppo, tft, mamba, liquid, tlob, flash_attention, ensemble, evaluation, inference, trainers, hyperopt, checkpoint, preprocessing, data_loaders, features, model_factory, training_pipeline, regime_detection, stress_testing, validation, bridge, common, metrics.
Testing
SQLX_OFFLINE=true cargo test -p ml --lib # ~2009 tests