🔥 AGGRESSIVE CLEANUP: Eliminate ALL re-export anti-patterns
MASSIVE ARCHITECTURAL CLEANUP: - Deleted 576 lines of re-export violations across entire codebase - Removed ALL pub use statements from lib.rs files (200+ violations) - Deleted prelude modules that violated separation of concerns - Fixed all imports to use explicit paths (no more hidden dependencies) CRATES CLEANED: - common: Removed 25+ type re-exports - ml: Removed 20+ re-exports including external crates - trading_engine: Deleted entire prelude module (160+ lines) - risk: Removed 15+ re-exports - data: Removed all provider re-exports - tests: Removed 30+ convenience re-exports - services: Cleaned prelude modules - tli: Fixed imports for pure client architecture ARCHITECTURAL IMPROVEMENTS: ✅ Strict separation of concerns enforced ✅ No hidden dependency web ✅ Single source of truth for all types ✅ Explicit imports required everywhere ✅ Clean module boundaries ✅ Zero compilation errors This eliminates the re-export anti-pattern completely, forcing all consumers to use explicit imports like common::types::Price instead of relying on convenience re-exports that hide true dependencies. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -147,86 +147,15 @@ mod storage_test;
|
||||
// Tracing macros
|
||||
use tracing::{error, info, warn};
|
||||
|
||||
// Re-export commonly used types for clean API
|
||||
// === Core Error Handling ===
|
||||
pub use error::{DataError, Result};
|
||||
|
||||
// === Broker Integration ===
|
||||
// Note: Broker clients moved to trading_engine module in monolithic architecture
|
||||
pub use brokers::{
|
||||
BrokerType, BrokerFactory,
|
||||
InteractiveBrokersAdapter, IBConfig
|
||||
};
|
||||
pub use trading_engine::trading::data_interface::BrokerError;
|
||||
|
||||
// === Data Providers ===
|
||||
// Databento provider - only available when feature is enabled
|
||||
#[cfg(feature = "databento")]
|
||||
pub use crate::providers::databento::{
|
||||
DatabentoConfig, DatabentoHistoricalProvider
|
||||
};
|
||||
// Benzinga provider
|
||||
pub use crate::providers::benzinga::{
|
||||
BenzingaConfig, BenzingaHistoricalProvider, NewsEvent
|
||||
};
|
||||
// Provider traits and common types
|
||||
pub use crate::providers::{
|
||||
RealTimeProvider, HistoricalProvider, MarketDataProvider,
|
||||
ProviderConfig, ProviderFactory, ProviderManager,
|
||||
MarketStatus, ProviderHealthStatus
|
||||
};
|
||||
// Common event types from providers
|
||||
pub use crate::providers::common::{
|
||||
MarketDataEvent as CommonMarketDataEvent,
|
||||
TradeEvent as CommonTradeEvent,
|
||||
QuoteEvent as CommonQuoteEvent,
|
||||
NewsEvent as CommonNewsEvent,
|
||||
OrderBookSnapshot, OrderBookUpdate,
|
||||
ConnectionState
|
||||
};
|
||||
|
||||
// === Data Types ===
|
||||
pub use crate::types::{
|
||||
TimeRange, MarketDataType
|
||||
};
|
||||
// Re-export from common
|
||||
pub use common::{
|
||||
MarketDataEvent, Subscription, TradeEvent, QuoteEvent, OrderBookEvent,
|
||||
Aggregate, Level2Update, ConnectionEvent, ErrorEvent, Position
|
||||
};
|
||||
|
||||
// === Feature Engineering ===
|
||||
pub use crate::unified_feature_extractor::{
|
||||
UnifiedFeatureExtractor, UnifiedFeatureExtractorConfig
|
||||
};
|
||||
|
||||
// === Storage and Persistence ===
|
||||
pub use crate::storage::{
|
||||
StorageManager, EnhancedDatasetMetadata, StorageStats, ExportFormat
|
||||
};
|
||||
|
||||
// === Validation ===
|
||||
pub use crate::validation::{
|
||||
DataValidator, ValidationResult, ValidationError
|
||||
};
|
||||
|
||||
// === Training Pipeline ===
|
||||
pub use crate::training_pipeline::{
|
||||
TrainingDataPipeline, FeatureProcessor, TechnicalIndicatorsCalculator,
|
||||
MicrostructureAnalyzer, TLOBProcessor, RegimeDetector,
|
||||
DatasetMetadata, DatasetSchema, FeatureColumn, TargetColumn
|
||||
};
|
||||
// === Utilities ===
|
||||
pub use crate::utils::{
|
||||
format_timestamp, calculate_percentage_change, normalize_symbol
|
||||
};
|
||||
|
||||
// === External Re-exports ===
|
||||
// Commonly used external types
|
||||
use tokio::sync::broadcast;
|
||||
// Import configuration and event types that are actually used
|
||||
use config::DataModuleConfig;
|
||||
use trading_engine::types::events::OrderEvent;
|
||||
use crate::error::Result;
|
||||
use crate::brokers::{InteractiveBrokersAdapter, IBConfig};
|
||||
use common::{MarketDataEvent, Subscription};
|
||||
|
||||
// Using direct imports from common crate - NO backward compatibility aliases
|
||||
|
||||
|
||||
Reference in New Issue
Block a user