trading-platform/orchestration/analisis/integracion/EFFORT-ESTIMATES.yml
Adrian Flores Cortes 090fe5d278 feat: Add Trading Agents types for frontend
Create comprehensive TypeScript type definitions for Trading Agents (Atlas, Orion, Nova) in the frontend.

- Align with backend trading-agents.client.ts interfaces
- Export AgentType, AgentStatus, BotStatus types
- Define TradingBot, AgentMetrics, AgentPosition, AgentTrade interfaces
- Include utility functions for status mapping and display names
- Full JSDoc documentation for all types
- Export from main types/index.ts

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

694 lines
19 KiB
YAML

# EFFORT-ESTIMATES.yml - Trading Platform
# Sistema: SIMCO v4.0.0
# Fecha: 2026-01-27
# Fuente: COHERENCE-MASTER-REPORT.md + PROJECT-STATUS.md
metadata:
proyecto: trading-platform
fecha_analisis: 2026-01-27
version: 1.0.0
estado_actual: Desarrollo Activo - Post MVP
completitud_global: 60%
coherencia_global: 81.25%
metodologia: CAPVED
fuentes:
- orchestration/analisis/coherencia/COHERENCE-MASTER-REPORT.md
- orchestration/PROJECT-STATUS.md
- orchestration/analisis/coherencia/GAPS-TRACKING.yml
# ============================================================
# RESUMEN EJECUTIVO
# ============================================================
resumen:
total_horas: 208
total_semanas: 5.2
jornada_semanal: 40
total_gaps: 12
distribucion:
p0_bloqueantes: 54h
p1_criticos: 76h
p2_importantes: 78h
estado_actual:
horas_completadas: 0
horas_pendientes: 208
progreso_porcentaje: 0%
target:
coherencia_deseada: 95%
coherencia_actual: 81.25%
gap_coherencia: 13.75%
# ============================================================
# ESTIMACIONES POR PRIORIDAD
# ============================================================
por_prioridad:
P0_BLOQUEANTES:
descripcion: "Impiden produccion - CRITICO"
horas_totales: 54
items: 3
semanas: 1.35
sla: "Inmediato - Semana 1-2"
detalle:
- id: GAP-P0-001
descripcion: "Password Recovery sin UI"
epica: OQI-001 (Auth)
capa: Frontend
impacto: "Usuarios no pueden recuperar cuenta"
horas: 8
skills: [React, TypeScript, Zustand]
componentes:
- PasswordRecoveryForm.tsx
- ForgotPasswordPage.tsx
- Integration con /auth/forgot-password endpoint
dependencias: []
- id: GAP-P0-002
descripcion: "User Profile sin servicio"
epica: OQI-001 (Auth)
capa: Backend + Frontend
impacto: "No hay gestion de perfil"
horas: 6
skills: [TypeScript, Express.js, React]
componentes:
- userService.ts (backend)
- user.service.ts (frontend)
- ProfilePage integration
dependencias: []
- id: GAP-P0-003
descripcion: "Trading Agents sin UI"
epica: OQI-006 (ML Signals)
capa: Frontend
impacto: "Feature core Atlas/Orion/Nova sin interfaz"
horas: 40
skills: [React, TypeScript, TanStack Query, Charts]
componentes:
- AgentDashboard.tsx
- AgentCard.tsx
- AgentPerformance.tsx
- Integration con /ml/agents endpoints (port 3086)
dependencias: [Backend agents OK]
notas: "Tarea grande - considerar partir en 3 subtareas (Atlas, Orion, Nova)"
P1_CRITICOS:
descripcion: "Afectan funcionalidad core - URGENTE"
horas_totales: 76
items: 4
semanas: 1.9
sla: "Semana 3-4"
detalle:
- id: GAP-P1-001
descripcion: "Market Data OHLCV sin servicio"
epica: OQI-003 (Trading)
capa: Backend
impacto: "Charts afectados - datos historicos incompletos"
horas: 16
skills: [TypeScript, Express.js, PostgreSQL]
componentes:
- marketData.service.ts (backend)
- GET /api/market-data/ohlcv/:symbol
- Query a market_data.ohlcv table
dependencias: [DDL OK]
- id: GAP-P1-002
descripcion: "Notifications sin API completa"
epica: OQI-001 (Auth)
capa: Backend
impacto: "Push notifications incompletas"
horas: 20
skills: [TypeScript, Express.js, FCM, APNs, WebSocket]
componentes:
- notifications.service.ts (backend)
- POST /api/notifications/send
- PUT /api/notifications/:id/read
- WebSocket integration (port 3082)
dependencias: []
- id: GAP-P1-003
descripcion: "ML Chart Overlays sin UI"
epica: OQI-006 (ML Signals)
capa: Frontend
impacto: "Visualizacion ML no conectada a charts"
horas: 24
skills: [React, TypeScript, lightweight-charts, TanStack Query]
componentes:
- ChartOverlay.tsx
- PredictionLayer.tsx
- Integration con mlService.ts (port 3083)
dependencias: [ML Backend OK]
- id: GAP-P1-004
descripcion: "2FA sin flujo completo"
epica: OQI-001 (Auth)
capa: Backend + Frontend
impacto: "Seguridad avanzada no disponible"
horas: 16
skills: [TypeScript, React, TOTP, QR Codes]
componentes:
- TwoFactorSetup.tsx
- TwoFactorVerify.tsx
- Backend 2FA endpoints
- QR generation
dependencias: []
P2_IMPORTANTES:
descripcion: "Mejoran experiencia - MEDIO PLAZO"
horas_totales: 78
items: 5
semanas: 1.95
sla: "Semana 5-6"
detalle:
- id: GAP-P2-001
descripcion: "Audit system sin servicios"
epica: OQI-001 (Auth)
capa: Backend
impacto: "Sin consultas de auditoria"
horas: 32
skills: [TypeScript, Express.js, PostgreSQL]
componentes:
- audit.service.ts (backend)
- GET /api/audit/logs
- GET /api/audit/user/:userId
- Query optimization (audit.logs puede crecer mucho)
dependencias: [DDL OK]
- id: GAP-P2-002
descripcion: "Currency Exchange sin servicio"
epica: OQI-005 (Payments)
capa: Backend
impacto: "Multi-moneda incompleto"
horas: 16
skills: [TypeScript, Express.js, External API]
componentes:
- currencyExchange.service.ts (backend)
- GET /api/currency/rates
- POST /api/currency/convert
- Integration con API externa (exchangerate-api)
dependencias: []
- id: GAP-P2-003
descripcion: "Risk Assessment sin servicio"
epica: OQI-004 (Investment)
capa: Backend
impacto: "Cuestionario riesgo desconectado"
horas: 12
skills: [TypeScript, Express.js, PostgreSQL]
componentes:
- riskAssessment.service.ts (backend)
- POST /api/investment/risk-assessment
- GET /api/investment/risk-profile/:userId
- Scoring logic
dependencias: [DDL OK]
- id: GAP-P2-004
descripcion: "Course Reviews sin endpoints"
epica: OQI-002 (Education)
capa: Backend
impacto: "Reviews no disponibles"
horas: 6
skills: [TypeScript, Express.js, PostgreSQL]
componentes:
- courseReviews.service.ts (backend)
- POST /api/courses/:id/reviews
- GET /api/courses/:id/reviews
- Rating aggregation
dependencias: [DDL OK]
- id: GAP-P2-005
descripcion: "OAuth flows incompletos"
epica: OQI-001 (Auth)
capa: Frontend
impacto: "Login social parcial (solo Google, falta GitHub/Apple)"
horas: 12
skills: [React, TypeScript, OAuth 2.0]
componentes:
- GitHubLoginButton.tsx
- AppleLoginButton.tsx
- OAuth callback handlers
dependencias: [Backend OAuth OK]
# ============================================================
# ESTIMACIONES POR TIPO DE TRABAJO
# ============================================================
por_tipo:
ddl:
horas: 0
items: 0
porcentaje: 0%
estado: "COMPLETO - 89 tablas, 10 schemas"
notas: "DDL al 100% - pgvector agregado 2026-01-27"
backend:
horas: 108
items: 7
porcentaje: 51.9%
detalle:
- GAP-P0-002 (User Profile service): 6h
- GAP-P1-001 (Market Data OHLCV): 16h
- GAP-P1-002 (Notifications API): 20h
- GAP-P1-004 (2FA backend): 8h
- GAP-P2-001 (Audit system): 32h
- GAP-P2-002 (Currency Exchange): 16h
- GAP-P2-003 (Risk Assessment): 12h
- GAP-P2-004 (Course Reviews): 6h
skills_requeridas:
- TypeScript: 108h
- Express.js: 108h
- PostgreSQL: 66h
- External APIs: 16h
- WebSocket: 20h
frontend:
horas: 92
items: 6
porcentaje: 44.2%
detalle:
- GAP-P0-001 (Password Recovery UI): 8h
- GAP-P0-003 (Trading Agents UI): 40h
- GAP-P1-003 (ML Chart Overlays): 24h
- GAP-P1-004 (2FA frontend): 8h
- GAP-P2-005 (OAuth flows): 12h
skills_requeridas:
- React: 92h
- TypeScript: 92h
- Zustand: 16h
- TanStack Query: 64h
- lightweight-charts: 24h
- OAuth 2.0: 12h
tests:
horas: 0
items: 0
porcentaje: 0%
notas: "No incluido en estimaciones gaps - agregar 20% adicional"
recomendacion: "41.6h adicionales para tests (20% de 208h)"
docs:
horas: 8
items: 1
porcentaje: 3.9%
detalle:
- Actualizar Swagger con nuevos endpoints: 4h
- Actualizar GAPS-TRACKING.yml: 2h
- Actualizar inventarios coherencia: 2h
# ============================================================
# ESTIMACIONES POR EPICA
# ============================================================
por_epica:
OQI-001_Auth:
horas: 70
items: 5
gaps: [GAP-P0-001, GAP-P0-002, GAP-P1-002, GAP-P1-004, GAP-P2-001, GAP-P2-005]
coherencia_actual: 93%
coherencia_target: 98%
OQI-002_Education:
horas: 6
items: 1
gaps: [GAP-P2-004]
coherencia_actual: 95%
coherencia_target: 98%
OQI-003_Trading:
horas: 16
items: 1
gaps: [GAP-P1-001]
coherencia_actual: 98%
coherencia_target: 100%
OQI-004_Investment:
horas: 12
items: 1
gaps: [GAP-P2-003]
coherencia_actual: 97%
coherencia_target: 99%
OQI-005_Payments:
horas: 16
items: 1
gaps: [GAP-P2-002]
coherencia_actual: 92%
coherencia_target: 98%
OQI-006_ML_Signals:
horas: 64
items: 2
gaps: [GAP-P0-003, GAP-P1-003]
coherencia_actual: 82%
coherencia_target: 95%
notas: "Mayor gap - UI agents critica"
OQI-007_LLM_Agent:
horas: 0
items: 0
gaps: []
coherencia_actual: 89%
notas: "Gaps no incluidos en P0-P2 - requiere analisis FASE 2"
OQI-008_Portfolio:
horas: 0
items: 0
gaps: []
coherencia_actual: 97%
notas: "Alta coherencia - sin gaps criticos"
OQI-009_MT4:
horas: 0
items: 0
gaps: []
coherencia_actual: 0%
notas: "NO INICIADO - fuera de scope actual"
# ============================================================
# RECURSOS NECESARIOS
# ============================================================
recursos_necesarios:
perfiles:
typescript_fullstack_developer:
horas: 200
descripcion: "Backend + Frontend TypeScript"
skills: [TypeScript, Express.js, React, Zustand, PostgreSQL]
asignacion:
- GAP-P0-001 (8h)
- GAP-P0-002 (6h)
- GAP-P0-003 (40h)
- GAP-P1-001 (16h)
- GAP-P1-002 (20h)
- GAP-P1-003 (24h)
- GAP-P1-004 (16h)
- GAP-P2-001 (32h)
- GAP-P2-002 (16h)
- GAP-P2-003 (12h)
- GAP-P2-004 (6h)
- GAP-P2-005 (12h)
semanas: 5
qa_engineer:
horas: 42
descripcion: "Testing + Validacion"
skills: [Jest, Playwright, E2E Testing, API Testing]
asignacion:
- Tests para todos los gaps: 41.6h
- Validacion integracion: 8h
semanas: 1
tech_lead:
horas: 16
descripcion: "Code review + Arquitectura"
skills: [Architecture, Code Review, Performance]
asignacion:
- Review PRs: 12h
- Validacion arquitectural: 4h
semanas: 0.4 (distribuido en 5 semanas)
total_personas: 1-2 fullstack + 1 QA + 1 tech lead (part-time)
# ============================================================
# TIMELINE RECOMENDADO
# ============================================================
timeline:
semana_1_2:
periodo: "2026-01-27 a 2026-02-07"
enfoque: "Gaps P0 - Bloqueantes"
horas: 54
items:
- GAP-P0-001: Password Recovery UI (8h)
- GAP-P0-002: User Profile service (6h)
- GAP-P0-003: Trading Agents UI - Fase 1 (40h)
entregables:
- Password recovery funcional
- Profile page conectada a backend
- AgentDashboard base implementado
checkpoint: "CP-01: Gaps P0 = 0"
semana_3_4:
periodo: "2026-02-10 a 2026-02-21"
enfoque: "Gaps P1 - Criticos"
horas: 76
items:
- GAP-P1-001: Market Data OHLCV service (16h)
- GAP-P1-002: Notifications API completa (20h)
- GAP-P1-003: ML Chart Overlays (24h)
- GAP-P1-004: 2FA flujo completo (16h)
entregables:
- OHLCV data disponible en charts
- Push notifications funcionales
- ML predictions visible en charts
- 2FA setup completo
checkpoint: "CP-02: Cobertura Backend-Frontend >= 90%"
semana_5_6:
periodo: "2026-02-24 a 2026-03-07"
enfoque: "Gaps P2 - Importantes"
horas: 78
items:
- GAP-P2-001: Audit system servicios (32h)
- GAP-P2-002: Currency Exchange (16h)
- GAP-P2-003: Risk Assessment (12h)
- GAP-P2-004: Course Reviews (6h)
- GAP-P2-005: OAuth flows (12h)
entregables:
- Audit logs consultables
- Multi-moneda funcional
- Risk profiling disponible
- Course reviews activas
- GitHub/Apple login
checkpoint: "CP-03: Coherencia Global >= 95%"
semana_7_8:
periodo: "2026-03-10 a 2026-03-21"
enfoque: "Consolidacion Arquitectural"
horas: 40
items:
- Migrar acceso Python via Express gateway (16h)
- Migrar servicios a apiClient (12h)
- Tests de integracion E2E (12h)
entregables:
- Todos los servicios via apiClient
- Python acceso centralizado
- Test coverage >= 70%
checkpoint: "CP-04: Servicios apiClient = 100%"
# ============================================================
# RIESGOS Y FACTORES DE AJUSTE
# ============================================================
riesgos_estimacion:
- id: RISK-001
descripcion: "ML integration puede exceder estimado"
gaps_afectados: [GAP-P0-003, GAP-P1-003]
probabilidad: MEDIA
factor_ajuste: 1.3x
horas_adicionales: 19.2h
mitigacion: "Partir GAP-P0-003 en 3 subtareas (Atlas, Orion, Nova)"
- id: RISK-002
descripcion: "External APIs pueden requerir mas tiempo"
gaps_afectados: [GAP-P2-002]
probabilidad: BAJA
factor_ajuste: 1.2x
horas_adicionales: 3.2h
mitigacion: "Usar mock data si API externa falla"
- id: RISK-003
descripcion: "Audit system query optimization compleja"
gaps_afectados: [GAP-P2-001]
probabilidad: MEDIA
factor_ajuste: 1.15x
horas_adicionales: 4.8h
mitigacion: "Implementar pagination desde inicio"
- id: RISK-004
descripcion: "WebSocket integration puede requerir refactor"
gaps_afectados: [GAP-P1-002]
probabilidad: BAJA
factor_ajuste: 1.1x
horas_adicionales: 2h
mitigacion: "Validar WebSocket existente funciona correctamente"
- id: RISK-005
descripcion: "OAuth providers pueden requerir mas configuracion"
gaps_afectados: [GAP-P2-005]
probabilidad: BAJA
factor_ajuste: 1.2x
horas_adicionales: 2.4h
mitigacion: "Consultar documentacion oficial antes de iniciar"
total_horas_riesgo: 31.6h
estimacion_conservadora: 239.6h (208h + 31.6h)
semanas_conservadoras: 6.0
# ============================================================
# INCONSISTENCIAS ARQUITECTURALES (Adicional)
# ============================================================
refactoring_arquitectural:
descripcion: "Consolidacion post-gaps"
horas: 40
incluido_en_timeline: true
semanas: "7-8"
items:
- id: ARCH-001
descripcion: "Migrar mlService.ts a usar Express gateway"
horas: 8
razon: "Actualmente accede directo a Python (3083)"
- id: ARCH-002
descripcion: "Migrar llmAgentService.ts a usar Express gateway"
horas: 8
razon: "Actualmente accede directo a Python (3085)"
- id: ARCH-003
descripcion: "Migrar backtestService.ts a usar Express gateway"
horas: 6
razon: "Actualmente accede directo a Python (3083)"
- id: ARCH-004
descripcion: "Migrar portfolio.service.ts a apiClient"
horas: 4
razon: "No usa apiClient centralizado"
- id: ARCH-005
descripcion: "Migrar adminService.ts a apiClient"
horas: 4
razon: "No usa apiClient centralizado"
- id: ARCH-006
descripcion: "Tests de integracion E2E"
horas: 10
razon: "Validar toda la cadena DDL->Backend->Frontend"
# ============================================================
# METRICAS DE VALIDACION
# ============================================================
metricas_validacion:
checkpoints:
CP-01:
nombre: "Gaps P0 resueltos"
criterio: "0 bloqueantes"
fecha_target: "2026-02-07"
validacion:
- Password recovery funcional en produccion
- User profile accesible via UI
- Trading Agents UI desplegada (minimo viable)
CP-02:
nombre: "Cobertura Backend-Frontend"
criterio: ">= 90%"
fecha_target: "2026-02-21"
validacion:
- 187 endpoints, 168+ consumidos (90%)
- ML predictions visible en charts
- Notifications push funcionales
CP-03:
nombre: "Coherencia Global"
criterio: ">= 95%"
fecha_target: "2026-03-07"
validacion:
- DDL-Backend >= 95%
- Backend-Frontend >= 90%
- Promedio >= 95%
CP-04:
nombre: "Servicios apiClient"
criterio: "100%"
fecha_target: "2026-03-21"
validacion:
- Todos los servicios usan apiClient
- Ningun acceso directo a Python
- Test coverage >= 70%
progreso_actual_vs_target:
coherencia_global:
actual: 81.25%
target: 95%
gap: -13.75%
gaps_p0:
actual: 3
target: 0
gap: -3
gaps_p1:
actual: 4
target: 0
gap: -4
servicios_apiClient:
actual: 64%
target: 100%
gap: -36%
# ============================================================
# RECOMENDACIONES FINALES
# ============================================================
recomendaciones:
prioridad_inmediata:
- "Iniciar GAP-P0-001 (Password Recovery) - Quick win 8h"
- "Iniciar GAP-P0-002 (User Profile service) - Quick win 6h"
- "Planificar GAP-P0-003 en 3 sprints (Atlas, Orion, Nova)"
organizacion:
- "Asignar 1 fullstack developer full-time para P0+P1"
- "Considerar contratar QA engineer para semana 3"
- "Tech lead debe revisar PRs cada 2 dias"
riesgos:
- "Aplicar factor 1.3x a ML integration (GAP-P0-003, GAP-P1-003)"
- "Validar WebSocket funcional antes de GAP-P1-002"
- "Partir tareas >20h en subtareas"
documentacion:
- "Actualizar GAPS-TRACKING.yml cada viernes"
- "Documentar decisiones arquitecturales en ADRs"
- "Actualizar PROJECT-STATUS.md al completar cada checkpoint"
calidad:
- "Agregar tests antes de cerrar cada gap"
- "Code review obligatorio antes de merge"
- "Validar coherencia DDL-Backend-Frontend en cada PR"
# ============================================================
# METADATA FINAL
# ============================================================
generado_por: Claude Code (Opus 4.5)
sistema: SIMCO v4.0.0
fecha_creacion: 2026-01-27
version: 1.0.0
estado: DRAFT
proxima_revision: 2026-02-03
notas:
- "Estimaciones basadas en COHERENCE-MASTER-REPORT.md"
- "No incluye tests (agregar 20% = 41.6h)"
- "No incluye OQI-009 MT4 (0% funcional, fuera de scope)"
- "Refactoring arquitectural incluido en semanas 7-8"
- "Estimacion conservadora: 239.6h (con riesgos)"