# Foxhunt Dependency Analysis ## Current Dependency Structure ### Layer 1: Foundation - **foxhunt-core**: Base types, trading primitives, performance infrastructure ### Layer 2: Domain Libraries - **risk**: Risk management, VaR, Kelly sizing (depends: foxhunt-core) - **data**: Market data ingestion, broker connectivity (depends: foxhunt-core) - **ml**: Machine learning models, inference (depends: foxhunt-core) ### Layer 3: Integration Libraries - **backtesting**: Strategy testing (depends: foxhunt-core, ml) - **tli**: Terminal interface (depends: foxhunt-core) - **adaptive-strategy**: Strategy framework (depends: foxhunt-core, ml, risk, data) ### Layer 4: Services - **trading_service**: Main trading service (depends: foxhunt-core, risk, ml, data) - **backtesting_service**: Backtesting service (depends: foxhunt-core, risk, data, adaptive-strategy) ## Identified Issues ### ✅ FIXED: ML → Risk Circular Dependency - **Status**: RESOLVED - **Fix**: Removed `risk = { workspace = true }` from ml/Cargo.toml - **Comment**: "# REMOVED: risk = { workspace = true } # CIRCULAR DEPENDENCY FIX" ### Potential Issues to Check: 1. **TLI Dependencies**: Currently commented out data, risk, ml dependencies 2. **Workspace Dependency Cleanup**: Remove any unused dependencies 3. **Service Layer**: Verify services don't create cycles 4. **Commented Dependencies**: Clean up commented-out dependencies ## Validation Status - [x] ML → Risk circular dependency removed - [ ] All Cargo.toml files validated for clean dependencies - [ ] Commented dependencies cleaned up - [ ] Workspace compilation verified