trading-platform/orchestration/tareas/TASK-2026-02-04-ANALISIS-PLANIFICACION-INTEGRAL/subagentes/DELEGACION-PLAN.yml
Adrian Flores Cortes b9098ca91c [TASK-2026-02-05-ANALISIS-VALIDACION-MODELADO-BD] docs: Complete 6-phase database modeling analysis
Comprehensive analysis of 101 DDL tables across 11 schemas:
- Phase 1-2: Schema validation, 37 gaps cataloged (3 resolved)
- Phase 3: Integrity audit (80 FKs, 89 CHECKs, 17 issues: 2 CRIT/5 HIGH)
- Phase 4: DDL-Backend mapping (84% interfaces, 75% services, 61% controllers)
- Phase 5: Documentation purge catalog (201 files analyzed)
- Phase 6: Remediation plan (4 sprints, 204h)

Key finding: Backend uses raw SQL + pg Pool (NOT TypeORM).
13 deliverables + updated inventories to v2.0.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 16:48:45 -06:00

477 lines
12 KiB
YAML

delegacion_plan:
version: 1.0.0
fecha: "2026-02-04"
tarea_principal: TASK-2026-02-04-ANALISIS-PLANIFICACION-INTEGRAL
agente_orquestador: claude-opus-4-5
perfil_orquestador: PERFIL-ORQUESTADOR
perfiles_requeridos:
- id: PERFIL-ORQUESTADOR
alias: "@PERFIL_ORQUESTADOR"
uso: Coordinación general y delegación
subtareas:
- ST-0.1
- ST-0.2
- ST-0.3
- id: PERFIL-DATABASE-POSTGRESQL
alias: "@PERFIL_DATABASE_POSTGRESQL"
uso: Operaciones DDL y schemas
subtareas:
- ST-1.1
- ST-1.2
- ST-1.3
- ST-1.4
alternativa_compacta: PERFIL-DATABASE-COMPACT
- id: PERFIL-BACKEND-NESTJS
alias: "@PERFIL_BACKEND_NESTJS"
uso: Servicios y controllers Express.js/TypeScript
subtareas:
- ST-2.1
- ST-2.2
- ST-2.3
- ST-2.4
- ST-2.5
- ST-3.1
- ST-3.2
- ST-3.3
- ST-3.4
- ST-3.5
- ST-5.1
- ST-5.2
alternativa_compacta: PERFIL-BACKEND-COMPACT
- id: PERFIL-FRONTEND-REACT
alias: "@PERFIL_FRONTEND_REACT"
uso: Componentes React y páginas
subtareas:
- SUBTASK-001
- SUBTASK-002
- SUBTASK-003
- SUBTASK-004
- SUBTASK-005
- SUBTASK-006
- SUBTASK-007
- SUBTASK-008
- SUBTASK-009
- SUBTASK-010
alternativa_compacta: PERFIL-GENERIC-SUBAGENT
- id: PERFIL-ML-SPECIALIST
alias: "@PERFIL_ML_SPEC"
uso: Integración modelos ML y overlays
subtareas:
- SUBTASK-004 (parte ML)
opcional: true
- id: PERFIL-TRADING-STRATEGIST
alias: "@PERFIL_TRADING"
uso: Validación lógica de trading agents
subtareas:
- SUBTASK-003 (parte agents)
opcional: true
- id: PERFIL-QA-TESTER
alias: "@PERFIL_QA"
uso: Testing y validación
subtareas:
- ST-6.1
- ST-6.2
- ST-6.3
- ST-6.4
- id: PERFIL-DOCUMENTACION
alias: "@PERFIL_DOC"
uso: Documentación técnica
subtareas:
- ST-7.1
- ST-7.2
- ST-7.3
- SUBTASK-011
fases_ejecucion:
FASE_0:
nombre: Preparación
duracion_horas: 8
paralelismo: 3
subtareas:
- id: ST-0.1
nombre: Purga documentación obsoleta
perfil: PERFIL-ORQUESTADOR
esfuerzo: 2h
dependencias: []
paralelo_con: [ST-0.2, ST-0.3]
- id: ST-0.2
nombre: Sincronización inventarios
perfil: PERFIL-ORQUESTADOR
esfuerzo: 4h
dependencias: []
paralelo_con: [ST-0.1, ST-0.3]
- id: ST-0.3
nombre: Actualización PROJECT-STATUS
perfil: PERFIL-ORQUESTADOR
esfuerzo: 2h
dependencias: []
paralelo_con: [ST-0.1, ST-0.2]
FASE_1:
nombre: DDL Gaps
duracion_horas: 16
paralelismo: 3
subtareas:
- id: ST-1.1
nombre: education.instructors table
perfil: PERFIL-DATABASE-POSTGRESQL
esfuerzo: 4h
dependencias: [ST-0.2]
paralelo_con: [ST-1.2, ST-1.3]
ddl_script: |
CREATE TABLE education.instructors (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES auth.user_profiles(id),
bio TEXT,
specializations TEXT[],
rating DECIMAL(3,2) DEFAULT 0,
total_courses INTEGER DEFAULT 0,
is_verified BOOLEAN DEFAULT false,
created_at TIMESTAMPTZ DEFAULT NOW()
);
- id: ST-1.2
nombre: education.course_tags field
perfil: PERFIL-DATABASE-POSTGRESQL
esfuerzo: 2h
dependencias: [ST-0.2]
paralelo_con: [ST-1.1, ST-1.3]
- id: ST-1.3
nombre: trading.price_alerts table
perfil: PERFIL-DATABASE-POSTGRESQL
esfuerzo: 4h
dependencias: [ST-0.2]
paralelo_con: [ST-1.1, ST-1.2]
- id: ST-1.4
nombre: Validación DDL post-cambios
perfil: PERFIL-DATABASE-POSTGRESQL
esfuerzo: 2h
dependencias: [ST-1.1, ST-1.2, ST-1.3]
paralelo_con: []
FASE_2:
nombre: Backend Services
duracion_horas: 48
paralelismo: 2
subtareas:
- id: ST-2.1
nombre: Market Data OHLCV Service
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 16h
dependencias: [ST-1.4]
paralelo_con: []
critico: true
desbloquea: [CHAIN-001]
- id: ST-2.2
nombre: Notifications Complete Service
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 12h
dependencias: [ST-1.4]
paralelo_con: [ST-2.3]
- id: ST-2.3
nombre: User Profile Service
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 6h
dependencias: []
paralelo_con: [ST-2.2]
- id: ST-2.4
nombre: Audit Service
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 8h
dependencias: [ST-1.4]
paralelo_con: [ST-2.5]
- id: ST-2.5
nombre: 2FA Complete Flow
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 8h
dependencias: []
paralelo_con: [ST-2.4]
FASE_3:
nombre: Backend API
duracion_horas: 24
paralelismo: 3
subtareas:
- id: ST-3.1
nombre: Market Data Endpoints
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 4h
dependencias: [ST-2.1]
- id: ST-3.2
nombre: Notifications Endpoints
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 4h
dependencias: [ST-2.2]
- id: ST-3.3
nombre: User Profile Endpoints
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 4h
dependencias: [ST-2.3]
- id: ST-3.4
nombre: Trading Agents Endpoints
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 8h
dependencias: []
- id: ST-3.5
nombre: 2FA Setup Endpoints
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 4h
dependencias: [ST-2.5]
FASE_4:
nombre: Frontend Integration
duracion_horas: 180
paralelismo: 2-3
sprints:
- sprint: FE-1
nombre: Fundamentos
story_points: 17
subtareas:
- id: SUBTASK-001
nombre: Routing y Huérfanos
perfil: PERFIL-FRONTEND-REACT
sp: 4
dependencias: []
- id: SUBTASK-002
nombre: OQI-001 Auth Completar
perfil: PERFIL-FRONTEND-REACT
sp: 13
dependencias: [ST-2.5, ST-3.3]
- sprint: FE-2
nombre: Trading Core
story_points: 60
subtareas:
- id: SUBTASK-003
nombre: OQI-003 Trading
perfil: PERFIL-FRONTEND-REACT
sp: 44
dependencias: [ST-3.1, ST-3.4]
incluye:
- TP/SL en órdenes
- Trading Agents UI
- Price Alerts
- Métricas
- id: SUBTASK-004
nombre: OQI-006 ML
perfil: PERFIL-FRONTEND-REACT
sp: 16
dependencias: [ST-3.1]
incluye:
- ML Prediction Overlay
- Signal Markers
- ICT Concepts Overlay
- sprint: FE-3
nombre: Investment
story_points: 81
subtareas:
- id: SUBTASK-005
nombre: OQI-004 Investment
perfil: PERFIL-FRONTEND-REACT
sp: 68
dependencias: []
- id: SUBTASK-006
nombre: OQI-005 Payments
perfil: PERFIL-FRONTEND-REACT
sp: 13
dependencias: []
- sprint: FE-4
nombre: Advanced Features
story_points: 128
subtareas:
- id: SUBTASK-007
nombre: OQI-002 Education
perfil: PERFIL-FRONTEND-REACT
sp: 21
dependencias: [ST-1.1, ST-1.2]
- id: SUBTASK-008
nombre: OQI-007 LLM
perfil: PERFIL-FRONTEND-REACT
sp: 44
dependencias: []
- id: SUBTASK-009
nombre: OQI-008 Portfolio
perfil: PERFIL-FRONTEND-REACT
sp: 63
dependencias: []
- sprint: FE-5
nombre: Growth
story_points: 55
subtareas:
- id: SUBTASK-010
nombre: OQI-009 Marketplace
perfil: PERFIL-FRONTEND-REACT
sp: 42
dependencias: []
- id: SUBTASK-011
nombre: Migración Docs
perfil: PERFIL-DOCUMENTACION
sp: 8
dependencias: []
- id: SUBTASK-012
nombre: Inventarios Sync
perfil: PERFIL-ORQUESTADOR
sp: 5
dependencias: []
FASE_5:
nombre: Architecture Refactor
duracion_horas: 24
paralelismo: 1
subtareas:
- id: ST-5.1
nombre: Proxy Python Services (ARCH-001)
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 16h
dependencias: [FASE_4]
descripcion: |
Crear proxy endpoints en Express.js para:
- /api/proxy/ml/* → ML Engine (3083)
- /api/proxy/llm/* → LLM Agent (3085)
Beneficios: Auth centralizada, CORS consistente, logs unificados
- id: ST-5.2
nombre: Standardize apiClient (ARCH-002)
perfil: PERFIL-BACKEND-NESTJS
esfuerzo: 8h
dependencias: [ST-5.1]
descripcion: |
Refactorizar 5 servicios para usar apiClient:
- portfolio.service.ts
- adminService.ts
- mlService.ts
- llmAgentService.ts
- backtestService.ts
FASE_6:
nombre: Testing
duracion_horas: 40
paralelismo: 2
subtareas:
- id: ST-6.1
nombre: Unit Tests Backend
perfil: PERFIL-QA-TESTER
esfuerzo: 12h
dependencias: [FASE_3]
- id: ST-6.2
nombre: Unit Tests Frontend
perfil: PERFIL-QA-TESTER
esfuerzo: 12h
dependencias: [FASE_4]
- id: ST-6.3
nombre: Integration Tests
perfil: PERFIL-QA-TESTER
esfuerzo: 8h
dependencias: [ST-6.1, ST-6.2]
- id: ST-6.4
nombre: E2E Tests
perfil: PERFIL-QA-TESTER
esfuerzo: 8h
dependencias: [ST-6.3]
FASE_7:
nombre: Documentación
duracion_horas: 16
paralelismo: 3
subtareas:
- id: ST-7.1
nombre: Guías desarrollo
perfil: PERFIL-DOCUMENTACION
esfuerzo: 8h
dependencias: []
entregables:
- 95-guias-desarrollo/backend/GUIA-BACKEND.md
- 95-guias-desarrollo/frontend/GUIA-FRONTEND.md
- id: ST-7.2
nombre: API Documentation
perfil: PERFIL-DOCUMENTACION
esfuerzo: 4h
dependencias: [FASE_3]
- id: ST-7.3
nombre: Actualización inventarios final
perfil: PERFIL-ORQUESTADOR
esfuerzo: 4h
dependencias: [FASE_6]
herencia_contexto:
template: |
[HERENCIA-CTX]
proyecto: trading-platform
tarea_padre: TASK-2026-02-04-ANALISIS-PLANIFICACION-INTEGRAL
variables_resueltas:
DB_NAME: "trading_platform"
DB_USER: "trading_user"
DB_PASS: "trading_dev_2026"
BACKEND_ROOT: "apps/backend/src"
FRONTEND_ROOT: "apps/frontend/src"
DDL_ROOT: "apps/database"
estado_actual:
coherencia_global: 81.25%
gaps_p0: 3
gaps_p1: 6
subtarea_especifica: "{subtarea_id}"
archivos_involucrados: ["{archivos}"]
criterios_aceptacion: ["{criterios}"]
simco_a_seguir:
- "@PRINCIPIO-CAPVED"
- "@SIMCO-EDICION-SEGURA"
- "{simco_especifico}"
metricas_subagentes:
max_tokens_por_subtarea: 50000
max_archivos_modificados: 5
max_lineas_por_archivo: 500
timeout_minutos: 30
validaciones:
pre_delegacion:
- Verificar anti-duplicación
- Verificar dependencias satisfechas
- Cargar perfil correcto
- Incluir herencia de contexto
post_ejecucion:
- npm run build (backend)
- npm run lint (backend/frontend)
- Verificar sin placeholders
- Actualizar inventario correspondiente