🚨 ARCHITECTURAL DISASTER: THREE Competing Type Sources Discovered

## Critical Investigation Results

**DISASTER CONFIRMED**: Agents discovered THREE type sources instead of ONE:
1. foxhunt-common-types/ (SHOULD NOT EXIST - still active!)
2. trading_engine/src/types/ (massive duplication)
3. common/src/types.rs (depends on competing crate)

## Evidence of Violations
- foxhunt-common-types still in workspace members (line 86)
- common/Cargo.toml depends on foxhunt-common-types (line 48)
- 48+ duplicate type definitions across OrderSide, OrderStatus, OrderType
- Compilation failures due to competing imports

## Immediate Action Required
- Choose ONE canonical source
- DELETE foxhunt-common-types completely
- Consolidate ALL types to single source
- Fix THREE-WAY import chaos

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2025-09-26 15:33:34 +02:00
parent f58d14ccc3
commit ea9d8f2c88
87 changed files with 2192 additions and 817 deletions

View File

@@ -208,17 +208,10 @@ pub struct Order {
}
#[derive(Debug, Clone)]
pub enum OrderSide {
Buy,
Sell,
}
// OrderSide now imported from canonical source
use trading_engine::types::prelude::OrderSide;
#[derive(Debug, Clone)]
pub enum OrderType {
Market,
Limit,
Stop,
}
// OrderType now imported via trading_engine::types::prelude::* (line 21)
#[derive(Debug, Clone)]
pub struct Position {
@@ -307,14 +300,8 @@ pub struct OrderResponse {
pub execution_latency_ns: u64,
}
#[derive(Debug, Clone)]
pub enum OrderStatus {
Submitted,
PartiallyFilled,
Filled,
Cancelled,
Rejected,
}
// OrderStatus now imported from canonical source
use trading_engine::types::prelude::OrderStatus;
// =============================================================================
// INTEGRATION TESTS

View File

@@ -87,10 +87,8 @@ impl TradeRecord {
}
#[derive(Debug, Clone)]
pub enum OrderSide {
Buy,
Sell,
}
// OrderSide now imported from canonical source
use trading_engine::types::prelude::OrderSide;
/// Market data point for time-series storage
#[derive(Debug, Clone)]

View File

@@ -511,17 +511,10 @@ pub struct Order {
pub timestamp: HardwareTimestamp,
}
#[derive(Debug, Clone)]
pub enum OrderSide {
Buy,
Sell,
}
// OrderSide now imported from canonical source
use trading_engine::types::prelude::OrderSide;
#[derive(Debug, Clone)]
pub enum OrderType {
Market,
Limit,
}
// OrderType now imported via trading_engine::types::prelude::* (line 24)
#[derive(Debug, Clone)]
pub struct TradeExecution {

View File

@@ -10,7 +10,8 @@ use config::{ConfigManager, TradingConfig, RiskConfig, MLConfig};
use trading_engine::types::{Order, OrderType, OrderStatus, Position, MarketData, Tick};
use trading_engine::services::trading::{TradingService, OrderExecutor, PositionManager};
use risk::safety::KillSwitchController;
use core::events::{EventBus, OrderEvent, PositionEvent, RiskEvent};
use trading_engine::types::events::{OrderEvent, PositionEvent, RiskEvent};
use trading_engine::events::EventBus;
/// Comprehensive Trading Service Integration Tests
///