MIGRATION_GUIDE_V3.md•5.49 kB
# 🚀 MIGRATION GUIDE: v2.0 → v3.0 INSTITUTIONAL
**Target Audience:** Developers & DevOps
**Required Time:** 5 minutes
**Downtime:** ZERO (backward compatible)
---
## 📋 QUICK START
### Step 1: Backup (безопасность прежде всего)
```bash
# Создать backup tag
git tag v2.0-final-backup
git push origin v2.0-final-backup
```
### Step 2: Install Dependencies (опционально)
```bash
# Для ML predictor (опционально)
source venv/bin/activate
pip install scikit-learn joblib
# Если не нужен ML - пропустить, система работает без него
```
### Step 3: Verify Integration
```bash
# Запустить unit tests
venv/bin/pytest tests/test_tier_classifier.py tests/test_regime_detector.py tests/test_smart_display.py -v
# Должно быть: 30 passed ✅
# Запустить integration test
venv/bin/python test_institutional_modules.py
# Должно быть: 🎉 ВСЕ МОДУЛИ РАБОТАЮТ
```
### Step 4: Deploy
```bash
# Если всё OK - commit
git add .
git commit -m "feat: v3.0 Institutional transformation - zero empty reports, tier system, adaptive thresholds"
git tag v3.0-institutional
git push origin main --tags
# Готово!
```
---
## 🔍 ЧТО ИЗМЕНИЛОСЬ
### Новые файлы (автоматически используются)
```
mcp_server/
├── tier_classifier.py ✨ NEW
├── regime_detector.py ✨ NEW
├── adaptive_thresholds.py ✨ NEW
├── smart_display.py ✨ NEW
└── ml_probability_predictor.py ✨ NEW (optional)
tests/
├── test_tier_classifier.py ✨ NEW
├── test_regime_detector.py ✨ NEW
└── test_smart_display.py ✨ NEW
```
### Модифицированные файлы
```
mcp_server/market_scanner.py 📝 MODIFIED
autonomous_agent/autonomous_analyzer.py 📝 MODIFIED
autonomous_agent/detailed_formatter.py 📝 MODIFIED
```
**ВАЖНО:** Все изменения backward compatible!
---
## ✅ VERIFICATION CHECKLIST
После deployment проверьте:
- [ ] `publish_market_analysis.py` работает
- [ ] Отчёт показывает market regime
- [ ] Отчёт показывает adaptive thresholds
- [ ] Отчёт показывает ОБА направления (LONG и SHORT)
- [ ] У opportunities есть tier badges (🟢🟡🟠🔴)
- [ ] Есть warnings для низких scores
- [ ] НЕТ empty reports
---
## 🔧 TROUBLESHOOTING
### Проблема: ImportError для новых модулей
**Решение:**
```bash
# Проверьте что файлы созданы
ls -la mcp_server/tier_classifier.py
ls -la mcp_server/regime_detector.py
ls -la mcp_server/adaptive_thresholds.py
ls -la mcp_server/smart_display.py
# Должны существовать и иметь размер >1KB
```
### Проблема: Всё ещё empty reports
**Решение:**
```bash
# Проверьте что market_scanner.py изменён
grep "SmartDisplay" mcp_server/market_scanner.py
# Должно найти импорты и использование
```
### Проблема: Только один direction
**Решение:**
```bash
# Проверьте autonomous_analyzer.py
grep "entry_plan.get" autonomous_agent/autonomous_analyzer.py
# Должно быть: entry_plan.get("side", "long")
```
### Проблема: ML predictor errors
**Решение:**
Это NORMAL! ML predictor опциональный.
```python
# В логах должно быть:
"ML predictor disabled (sklearn not available)"
# или
"No ML model found at ..."
# Система fallback к static formula - это OK!
```
---
## 📊 EXPECTED BEHAVIOR
### Before v3.0 ❌
```
NO SAFE OPPORTUNITIES found.
Scanned: 652
Found: 0
```
### After v3.0 ✅
```
🔍 INSTITUTIONAL MARKET ANALYSIS
📊 MARKET REGIME
Type: STRONG_BULL | Confidence: 87%
🎯 ADAPTIVE THRESHOLDS
LONG: 6.0/10 | SHORT: 8.5/10
📈 LONG (Top 3 of 45)
1. ETH - 🟢 Elite (8.5/10)
2. SOL - 🟡 Professional (7.2/10)
3. AVAX - 🟠 Speculative (6.3/10)
📉 SHORT (Top 3 of 8)
1. DOGE - 🟠 Speculative (5.8/10)
⚠️ Ниже порога
🔴 ПРОТИВ ТРЕНДА
```
---
## 🎓 KEY CONCEPTS
### Tier System
| Tier | Score | Probability | Action |
|------|-------|-------------|--------|
| 🟢 Elite | 8.0+ | 75%+ | ✅ Trade full size |
| 🟡 Professional | 6.5+ | 65%+ | ⚠️ Trade 75% size |
| 🟠 Speculative | 5.0+ | 55%+ | ⚠️⚠️ Trade 50% size |
| 🔴 High Risk | 4.0+ | <55% | 🔴 Paper trade only |
| ⛔ Not Recommended | <4.0 | <50% | ⛔ Skip |
### Adaptive Thresholds
| Regime | LONG | SHORT | Logic |
|--------|------|-------|-------|
| Strong Bull | 6.0 | 8.5 | Follow trend |
| Strong Bear | 8.5 | 6.0 | Follow trend |
| Sideways | 7.0 | 7.0 | Neutral |
| Uncertain | 7.5 | 7.5 | Cautious |
### Smart Display Rules
1. **ALWAYS** show TOP-3 each direction
2. Add warnings if below threshold
3. Explain regime context
4. Educate user on "what to wait for"
5. **NEVER** return empty
---
## ✅ DEPLOYMENT COMPLETE!
**System Status:** ✅ READY FOR PRODUCTION
**Breaking Changes:** ❌ NONE
**Backward Compatibility:** ✅ 100%
**Test Coverage:** ✅ 30/30 passed
**Documentation:** ✅ Complete
**Next:** Start trading with institutional-grade system! 🎉