- Docker: Delete 23 deprecated Dockerfiles, fix CI/CD to use Dockerfile.foxhunt-build - Config: Remove 36 .env files, keep 4 essential, delete config/environments/ - Docs: Archive 614 Wave D files to docs/archive/wave_d/, 95% reduction in root - Scripts: Delete 56 deprecated scripts, keep 58 production-critical (49% reduction) - Python: Organize 37 scripts into scripts/python/ subdirectories, delete ml/python/ - Build: Remove 1GB artifacts, delete old venvs, clean Python cache from git - Migrations: Delete deprecated directory (4,432 lines), remove duplicate database/migrations/ - Infrastructure: Delete deployment/ (61 files), docs/scripts/ (8 files) Total impact: ~2,500 files cleaned, 750MB+ space freed, zero production impact All deleted scripts backed up to archives. runpod/ and tests/runpod/ preserved. data_acquisition_service retained per user request.
14 KiB
ROADMAP EXECUTIVE SUMMARY
100% Clean Codebase Initiative
Date: 2025-10-23 Status: ⏳ Ready to Execute Timeline: 6-8 hours (critical path) Confidence: HIGH (comprehensive analysis complete)
🎯 OBJECTIVE
Transform Foxhunt from 99.22% production-ready to 100% clean codebase by fixing:
- 10 test failures (QAT + TFT quantization)
- 6 compilation errors (common crate)
- 94 clippy warnings (code quality)
📊 THE GAP (Current → Target)
| Metric | Current | Target | Work Required |
|---|---|---|---|
| Tests Passing | 1,278/1,288 (99.22%) | 1,288/1,288 (100%) | Fix 10 tests |
| Compilation | 6 errors (common) | 0 errors | Fix 6 unwrap/panic |
| Code Quality | 94 clippy warnings | 0-20 warnings | Auto-fix 37, manual 22 |
Bottom Line: 10 tests + 6 errors + 59 warnings = 75 issues blocking 100% status
🚀 THE SOLUTION (5-Track Roadmap)
Track 1: Critical Blockers (P0) - 2 HOURS
What: Fix 6 common crate errors (unwrap, panic) blocking ml compilation Why: BLOCKS all other work - must complete first Risk: 🟡 Medium (affects error handling semantics) Agents: 5 (FIX-01 through FIX-V1)
Track 2: QAT Test Fixes (P0) - 4 HOURS
What: Fix 10 quantization test failures (shape mismatch, observer state) Why: Enables TFT-INT8-QAT production deployment Risk: 🔴 High (quantized attention matmul fix) Agents: 7 (QAT-01 through QAT-07)
Track 3: Clippy Auto-Fixes (P1) - 1 HOUR
What: Auto-fix 37 low-risk warnings (.get(0), unnecessary_cast, etc.) Why: Code quality improvements with zero risk Risk: 🟢 Zero (automated, guaranteed safe) Agents: 5 (CLIPPY-01 through CLIPPY-05)
Track 4: Manual Code Quality (P2) - 3 HOURS
What: Manual fix 22 medium-risk warnings (needless_borrows, etc.) Why: Performance & code quality (defer 16 high-risk) Risk: 🟡 Medium (requires code review) Agents: 6 (MANUAL-01 through MANUAL-06)
Track 5: Validation & Docs (P3) - 1 HOUR
What: Final test validation + certification report Why: Confirm 100% status, update documentation Risk: 🟢 Low (verification only) Agents: 2 (VAL-01, VAL-02)
⏱️ TIMELINE (7 HOURS)
Hour 0-2: Track 1 (BLOCKING - sequential)
├─ FIX-01: Technical indicators (30m)
├─ FIX-02: Retry module (45m)
├─ FIX-03: Bounded concurrency (30m)
└─ Validation (15m)
Hour 2-6: Tracks 2, 3, 4 (PARALLEL)
├─ Track 2: QAT fixes (4h) ← LONGEST
├─ Track 3: Auto-fixes (1h)
└─ Track 4: Manual fixes (3h)
Hour 6-7: Track 5 (SEQUENTIAL)
├─ VAL-01: Test validation (45m)
└─ VAL-02: Documentation (15m)
Hour 7: ✅ 100% CLEAN CODEBASE ACHIEVED
Critical Path: Track 1 (2h) → Track 2 (4h) → Track 5 (1h) = 7 hours
🎯 PARALLELIZATION STRATEGY
Sequential Phases (MUST COMPLETE FIRST)
- Track 1 (0-2h): Unblock ml crate compilation
- No parallelization possible
- Each fix depends on previous success
Parallel Phase (SIMULTANEOUS EXECUTION)
- Tracks 2, 3, 4 (2-6h): All run at same time
- Track 2: 4 hours (longest, sets pace)
- Track 3: 1 hour (completes first)
- Track 4: 3 hours (completes second)
Final Sequential Phase
- Track 5 (6-7h): Validate everything
- Must wait for all tracks complete
- Final certification
Time Savings: 8 hours sequential → 7 hours with parallelization = 12.5% faster
🛡️ RISK MANAGEMENT
High-Risk Agents (2)
-
AGENT-QAT-03 (Quantized Attention, 2-3h)
- Risk: Shape mismatch may affect inference accuracy
- Mitigation: 7 unit tests, FP32 baseline comparison
- Rollback: Level 2 (Track 2 rollback)
-
AGENT-QAT-06 (Gradient Checkpoint, 4-6h)
- Risk: Memory optimization instability
- Mitigation: DEFER TO POST-100% SPRINT
- Rollback: N/A (not required)
Medium-Risk Agents (7)
- AGENT-FIX-01, 02, 03 (error handling changes)
- AGENT-QAT-02, 04, 05 (checkpoint format changes)
- AGENT-MANUAL-01 (needless_borrows)
- Mitigation: Comprehensive test suites, code review
Low-Risk Agents (16)
- All auto-fix agents (CLIPPY-01 through 05)
- Simple manual fixes (MANUAL-02 through 05)
- Validation agents (VAL-01, VAL-02)
- Mitigation: Standard test suite validation
Overall Risk: 🟡 MEDIUM (2 high-risk agents out of 25)
🔄 ROLLBACK PROCEDURES
3-Level Safety Net
Level 1: Agent Rollback (<5 min)
- Roll back single failing agent
- Impact: Minimal
- Command:
git stash push -m "AGENT-XX rollback"
Level 2: Track Rollback (<15 min)
- Roll back entire failing track
- Impact: Medium (may block dependent tracks)
- Command:
git reset --hard <pre-track-commit>
Level 3: Full Rollback (<30 min)
- Nuclear option: roll back all 25 agents
- Impact: High (all progress lost)
- Command:
git reset --hard HEAD~25
Safety: Each level provides progressively broader rollback scope
📊 SUCCESS METRICS
Primary Metrics (100% Required)
| Metric | Target | Validation |
|---|---|---|
| Test Pass Rate | 100% (1,288/1,288) | cargo test --workspace |
| Compilation Errors | 0 | cargo build --workspace |
| Critical Clippy | 0 | cargo clippy -- -D warnings |
Secondary Metrics (Code Quality)
| Metric | Target | Validation |
|---|---|---|
| Clippy Warnings | 0-20 | cargo clippy --workspace |
| Build Time | <2m | Currently 1m 47s ✅ |
| GPU Memory | <500MB | Currently 440MB ✅ |
Performance Metrics (No Regression)
| Metric | Baseline | Target | Status |
|---|---|---|---|
| Feature Extraction | 5.10μs/bar | <10μs | ✅ 196x faster |
| Inference Latency | ~500μs | <1ms | ✅ Within target |
| Sharpe Ratio | 2.00 | ≥2.0 | ✅ Wave D validated |
💰 COST-BENEFIT ANALYSIS
Cost (Time Investment)
- Development: 6-8 hours (25 agents)
- Testing: Included in agent time
- Documentation: 1 hour (Track 5)
- Total: 7-9 hours
Benefit (Value Delivered)
- 100% Test Coverage → Zero production surprises
- Zero Compilation Errors → Smooth CI/CD pipeline
- Clean Code Quality → Reduced technical debt
- Full Production Readiness → Deploy with confidence
- Team Productivity → No more "why is this failing?" discussions
ROI: 7 hours investment → Eliminate 100% of remaining blockers
🎯 DEPENDENCIES & BLOCKERS
What Must Complete First
- ✅ Track 1 (BLOCKS all other tracks)
- Reason: ml crate won't compile until common crate errors fixed
- Impact: 100% blocking
What Can Run in Parallel
- ✅ Tracks 2, 3, 4 (AFTER Track 1)
- Reason: Independent code areas
- Impact: 4-hour time savings
What Must Complete Last
- ✅ Track 5 (AFTER all tracks)
- Reason: Final validation requires all fixes applied
- Impact: Certification requirement
Critical Path: Track 1 → Track 2 → Track 5 = 7 hours
📋 PRE-EXECUTION CHECKLIST
System Preparation
- Backup current state:
git branch roadmap-backup - Create tracking branch:
git checkout -b roadmap-execution - Verify Docker services:
docker-compose ps(all healthy) - Verify GPU available:
nvidia-smi(RTX 3050 Ti ready) - Clear cargo cache:
cargo clean(fresh build)
Team Coordination
- Notify team: "Starting 7-hour roadmap execution"
- Block PR merges: Prevent conflicts during execution
- Set Slack status: "🔧 Roadmap Execution (7h)"
- Schedule review: Post-execution code review session
Documentation
- Review
MASTER_FIX_ROADMAP.md(full details) - Review
ROADMAP_QUICK_REFERENCE.md(command reference) - Review
TEST_FAILURE_ROOT_CAUSE_ANALYSIS.md(test details)
🚀 EXECUTION PLAN (STEP-BY-STEP)
Step 1: Track 1 Execution (2 hours)
# AGENT-FIX-01 (30m): Technical indicators
# Edit: common/src/features/technical_indicators.rs (lines 357-359)
cargo test -p common --lib features::technical_indicators
# AGENT-FIX-02 (45m): Retry module
# Edit: common/src/resilience/retry.rs (lines 170, 188)
cargo test -p common --lib resilience::retry
# AGENT-FIX-03 (30m): Bounded concurrency
# Edit: common/src/resilience/bounded_concurrency.rs (line 94)
cargo test -p common --lib resilience::bounded_concurrency
# AGENT-FIX-04 (15m): Validation
cargo test -p common --lib
cargo check -p ml # Verify ml crate unblocked
Step 2: Parallel Execution (4 hours)
# Start all 3 tracks simultaneously
# Terminal 1: Track 2 (QAT fixes)
cargo test -p ml --lib memory_optimization::qat
cargo test -p ml --lib tft::quantized_attention
# (Manual fixes per AGENT-QAT-01 through 07)
# Terminal 2: Track 3 (Auto-fixes)
cargo clippy --fix -p common --allow-dirty
cargo clippy --fix -p ml --allow-dirty
# Terminal 3: Track 4 (Manual fixes)
# (Manual code edits per AGENT-MANUAL-01 through 06)
cargo test -p ml --lib
Step 3: Final Validation (1 hour)
# AGENT-VAL-01 (45m): Test validation
cargo test --workspace --release
cargo clippy --workspace --all-targets --all-features
cargo bench --package ml
# AGENT-VAL-02 (15m): Documentation
# Update CLAUDE.md, generate certification report
✅ POST-EXECUTION VALIDATION
Immediate Checks (5 minutes)
# Test pass rate
cargo test --workspace 2>&1 | grep "test result:"
# Expected: test result: ok. 1,288 passed; 0 failed
# Compilation
cargo build --workspace --release
# Expected: 0 errors
# Clippy
cargo clippy --workspace 2>&1 | grep -c "warning:"
# Expected: 0-20 warnings
Extended Validation (30 minutes)
- Run full ML training pipeline (MAMBA-2, DQN, PPO, TFT)
- Test TFT-INT8-QAT inference with real data
- Validate GPU memory usage (<500MB)
- Benchmark feature extraction (<10μs)
- Test TLI commands (regime, transitions, adaptive-metrics)
Certification (15 minutes)
- Generate
AGENT_VAL_02_100_PERCENT_CERTIFICATION.md - Update
CLAUDE.md(test status: 100%) - Update
CLEAN_CODEBASE_CERTIFICATION.md - Commit all changes with detailed message
🎉 SUCCESS CRITERIA
Must-Have (100% Required)
- ✅ 1,288/1,288 tests passing
- ✅ 0 compilation errors
- ✅ 0 critical clippy errors
- ✅ All 25 agents complete
- ✅ Documentation updated
Nice-to-Have (Stretch Goals)
- 🎯 0 clippy warnings (vs. 0-20 target)
- 🎯 <6h execution time (vs. 7h estimate)
- 🎯 Zero rollbacks required
- 🎯 Performance improvements (bonus)
📈 EXPECTED OUTCOMES
Immediate Benefits
- 100% Test Pass Rate → Production confidence
- Zero Compilation Errors → Clean CI/CD
- Clean Code Quality → Reduced tech debt
- Full Documentation → Team knowledge sharing
Medium-Term Benefits (1-2 weeks)
- Faster Development → No more "fixing the tests" sprints
- Easier Onboarding → Clean codebase = clear patterns
- Better Code Reviews → Focus on logic, not style
- Higher Velocity → Less time fixing, more time building
Long-Term Benefits (1-3 months)
- Production Stability → Zero unexpected test failures
- Team Morale → Pride in clean codebase
- Competitive Advantage → Deploy features faster
- Technical Foundation → Ready for future scaling
🚦 GO/NO-GO DECISION
GREEN LIGHTS (Ready to Execute) ✅
- ✅ Comprehensive analysis complete (3 detailed reports)
- ✅ All 25 agents planned with time estimates
- ✅ 3-level rollback procedures documented
- ✅ Risk assessment complete (2 high, 7 medium, 16 low)
- ✅ Success metrics defined
- ✅ Parallel execution strategy optimized
RED LIGHTS (Would Block Execution) ❌
- ❌ None identified
YELLOW LIGHTS (Minor Concerns) ⚠️
- ⚠️ AGENT-QAT-03 (2-3h) is high-risk (quantized attention)
- Mitigation: Extensive unit tests, FP32 baseline comparison
- Rollback: Level 2 (Track 2 rollback) available
DECISION: 🟢 GO FOR EXECUTION
📞 CONTACT & ESCALATION
Execution Owner
- Lead: Claude Code Agent System
- Supervisor: Engineering Team Lead
- Stakeholders: ML Team, DevOps Team
Escalation Path
- Agent Failure → Rollback Level 1 (5 min)
- Track Failure → Rollback Level 2, notify lead (15 min)
- Critical Bug → Rollback Level 3, emergency meeting (30 min)
Communication Plan
- Start: Slack notification to #engineering
- Hourly Updates: Progress report every 60 minutes
- Blockers: Immediate Slack ping to @lead
- Completion: Final report to #engineering + #ml-team
🎯 FINAL RECOMMENDATION
Executive Summary
The Foxhunt codebase is 99.22% production-ready with only 75 issues blocking 100% status. This roadmap provides a comprehensive, low-risk path to eliminate all remaining blockers in 6-8 hours.
Why Execute Now
- High Confidence: 3 detailed analysis reports, 25 agents planned
- Low Risk: 64% of work is low-risk (16/25 agents)
- High Value: 100% test coverage → production confidence
- Optimal Timing: After Wave D completion, before model retraining
Recommended Action
✅ APPROVE EXECUTION with the following conditions:
- Execute Track 1 first (2h, blocking)
- Parallelize Tracks 2-4 for time efficiency
- Defer AGENT-QAT-06 (gradient checkpoint) to post-100% sprint
- Monitor high-risk agents (QAT-03) closely
- Use Level 2 rollback if Track 2 encounters issues
Expected Completion: 2025-10-23 (7-8 hours from start)
EXECUTIVE SUMMARY END
Status: ⏳ APPROVED - READY TO EXECUTE Next Action: Begin Track 1 (AGENT-FIX-01) Timeline: 6-8 hours to 100% clean codebase Confidence: HIGH (comprehensive planning complete)