trading-platform/orchestration/tareas/TASK-2026-01-27-PLATFORM-VALIDATION/05-EJECUCION.md
Adrian Flores Cortes 495513f3dd docs(orchestration): Add TASK-2026-01-27-PLATFORM-VALIDATION documentation
- TypeScript validation: Backend/Frontend builds (0 errors)
- WebSocket URLs verified (ports 3080, 3083)
- ML Pipeline data ingestion: 1,084,471 OHLCV bars
- Updated _INDEX.yml with task entry

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 07:05:27 -06:00

134 lines
3.3 KiB
Markdown

# 05-EJECUCION - Platform Validation
**Task:** TASK-2026-01-27-PLATFORM-VALIDATION
**Fecha:** 2026-01-27
**Estado:** COMPLETADA
---
## 1. Verificación TypeScript Backend
### Comando Ejecutado
```bash
cd apps/backend && npm run build
```
### Resultado
```
> @trading/backend@0.1.0 build
> tsc
```
**Estado:** 0 errores de compilación
---
## 2. Verificación TypeScript Frontend
### Comando Ejecutado
```bash
cd apps/frontend && npm run build
```
### Resultado
```
✓ built in 10.53s
```
**Estado:** 0 errores de compilación, build exitoso
---
## 3. Verificación Auth Endpoints y WebSocket URLs
### Auth Service
- **Archivo:** `apps/frontend/src/lib/apiClient.ts`
- **Features verificados:**
- Auto-refresh token interceptor
- Request queue durante refresh
- Proactive refresh (5min antes de expirar)
- BroadcastChannel para multi-tab sync
### WebSocket URLs
- **Archivo:** `apps/frontend/src/services/websocket.service.ts`
| Service | URL | Puerto |
|---------|-----|--------|
| tradingWS | ws://localhost:3080/ws | 3080 (Backend) |
| mlSignalsWS | ws://localhost:3083/ws/signals | 3083 (ML Engine) |
| portfolioWS | ws://localhost:3080/ws | 3080 (Backend) |
**Estado:** URLs correctamente configuradas
---
## 4. ML Pipeline Data Ingestion (OHLCV)
### Script Mejorado
- **Archivo:** `apps/ml-engine/scripts/ingest_ohlcv_polygon.py`
- **Mejoras implementadas:**
- `batch_size`: 5000 → 500 (para estabilidad)
- `sslmode`: disable (evitar SSL timeouts WSL)
- Lógica de reconexión automática con 3 reintentos
- Progreso cada 20 batches
### Datos Ingestados
| Symbol | Bars | Primer Bar | Último Bar |
|--------|------|------------|------------|
| XAUUSD | 140,310 | 2024-01-28 16:00 | 2026-01-26 17:55 |
| EURUSD | 147,296 | 2024-01-28 16:50 | 2026-01-26 17:55 |
| GBPUSD | 147,091 | 2024-01-28 16:50 | 2026-01-26 17:55 |
| BTCUSD | 210,227 | 2024-01-27 18:00 | 2026-01-26 17:55 |
| USDJPY | 147,191 | 2024-01-28 16:50 | 2026-01-26 17:55 |
| GBPJPY | 146,061 | 2024-01-28 16:50 | 2026-01-26 17:55 |
| AUDUSD | 146,295 | 2024-01-28 16:50 | 2026-01-26 17:55 |
| **TOTAL** | **1,084,471** | - | - |
### Comandos de Ingesta
```bash
# XAUUSD (previo)
wsl -d Ubuntu-24.04 -u developer -- bash -c "
cd /mnt/c/.../apps/ml-engine &&
POLYGON_API_KEY='...' python3 scripts/ingest_ohlcv_polygon.py \
--symbols XAUUSD --start 2024-01-01 --end 2026-01-27"
# Resto de símbolos
wsl -d Ubuntu-24.04 -u developer -- bash -c "
cd /mnt/c/.../apps/ml-engine &&
POLYGON_API_KEY='...' python3 scripts/ingest_ohlcv_polygon.py \
--symbols EURUSD GBPUSD BTCUSD USDJPY GBPJPY AUDUSD \
--start 2024-01-01 --end 2026-01-27"
```
### Rate Limiting
- Polygon API (free tier): ~5 requests/minute
- Tiempo total ingesta: ~35 minutos
- Manejo automático de 429 (Rate Limited) con retry
---
## Verificación Final BD
```sql
SELECT t.symbol, COUNT(o.id) as bar_count,
MIN(o.timestamp) as first_bar,
MAX(o.timestamp) as last_bar
FROM market_data.tickers t
LEFT JOIN market_data.ohlcv_5m o ON t.id = o.ticker_id
GROUP BY t.symbol ORDER BY t.symbol;
```
**Resultado:** 7 símbolos con datos completos (~2 años cada uno)
---
## Estado Git
```
trading-platform: main (up to date with origin)
Working tree: clean
```
**Nota:** `apps/ml-engine/` está en `.gitignore`, los cambios al script no se comitean al repo principal.