mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 23:02:10 +03:00
T-15 — Decompose usageDb.js (969→40 lines): - Extract src/lib/usage/migrations.js (legacy + JSON→SQLite migration) - Extract src/lib/usage/usageHistory.js (tracking, pending, log.txt) - Extract src/lib/usage/costCalculator.js (pure cost calculation) - Extract src/lib/usage/usageStats.js (dashboard aggregation) - Extract src/lib/usage/callLogs.js (structured logs, CRUD, rotation) - usageDb.js is now a thin facade re-exporting all functions T-28 — Decompose handleSingleModelChat (183→80 lines): - Extract handleNoCredentials() — credential error responses - Extract safeResolveProxy() — proxy resolution with error handling - Extract safeLogEvents() — fire-and-forget proxy + translation logging - Also created chatHelpers.js with standalone helper exports T-29 — Extract shared UI primitives (3230 total lines): - FilterBar.js — search input + filter chips dropdown - ColumnToggle.js — table column visibility toggle - DataTable.js — generic data table with sticky header, loading/empty Tests: 88/88 pass (no regressions)
6.1 KiB
6.1 KiB
Plano de Implantação — OmniRoute
Versão: 1.0
Data: 2026-02-14
Baseado em: Relatório de Análise Crítica Exaustiva (9 Dimensões)
Total de Fases: 9
Total de Itens: 41
Estimativa Total: 34–59 dias úteis
Visão Geral
gantt
title Plano de Implantação OmniRoute
dateFormat YYYY-MM-DD
axisFormat %d/%m
section Crítico
FASE 01 - Security Hardening :f1, 2026-02-17, 5d
FASE 02 - CI/CD & Testes :f2, after f1, 5d
section Importante
FASE 03 - Refatoração Arquitetural :f3, after f2, 8d
FASE 04 - Error Handling :f4, after f3, 6d
FASE 05 - Qualidade de Código :f5, after f3, 6d
section Moderado
FASE 06 - Documentação :f6, after f5, 4d
FASE 07 - UX & Microinterações :f7, after f5, 6d
FASE 08 - LLM Proxy Avançado :f8, after f4, 10d
FASE 09 - Fluxo Ponta a Ponta :f9, after f8, 5d
Documentos de Fase
| Fase | Documento | Prioridade | Itens | Complexidade |
|---|---|---|---|---|
| 01 | FASE-01-security-hardening.md | 🔴 Crítica | 5 | Média (3–5d) |
| 02 | FASE-02-cicd-test-infrastructure.md | 🔴 Crítica | 5 | Média (3–5d) |
| 03 | FASE-03-architecture-refactoring.md | 🟠 Importante | 5 | Alta (5–8d) |
| 04 | FASE-04-error-handling-observability.md | 🟠 Importante | 5 | Média (4–6d) |
| 05 | FASE-05-code-quality-standards.md | 🟠/🟡 Importante | 4 | Média (4–6d) |
| 06 | FASE-06-documentation-governance.md | 🟡 Moderado | 4 | Baixa (2–4d) |
| 07 | FASE-07-ux-microinteractions.md | 🟡 Moderado | 6 | Média (4–6d) |
| 08 | FASE-08-llm-proxy-advanced.md | 🟡 Moderado | 4 | Alta (6–10d) |
| 09 | FASE-09-e2e-flow-hardening.md | 🟡/🟢 Moderado | 3 | Média (3–5d) |
Ordem de Execução e Dependências
graph TD
F1[FASE 01<br/>Security Hardening] --> F2[FASE 02<br/>CI/CD & Testes]
F2 --> F3[FASE 03<br/>Refatoração Arquitetural]
F3 --> F4[FASE 04<br/>Error Handling & Observabilidade]
F3 --> F5[FASE 05<br/>Qualidade do Código]
F5 --> F6[FASE 06<br/>Documentação & Governança]
F5 --> F7[FASE 07<br/>UX & Microinterações]
F4 --> F8[FASE 08<br/>LLM Proxy Avançado]
F8 --> F9[FASE 09<br/>Fluxo Ponta a Ponta]
style F1 fill:#dc3545,color:#fff
style F2 fill:#dc3545,color:#fff
style F3 fill:#fd7e14,color:#fff
style F4 fill:#fd7e14,color:#fff
style F5 fill:#fd7e14,color:#fff
style F6 fill:#ffc107,color:#000
style F7 fill:#ffc107,color:#000
style F8 fill:#ffc107,color:#000
style F9 fill:#28a745,color:#fff
Paralelização Possível
| Janela | Fases Paralelas | Condição |
|---|---|---|
| Após FASE-03 | FASE-04 + FASE-05 | Ambas dependem apenas de FASE-03 |
| Após FASE-05 | FASE-06 + FASE-07 | Ambas dependem apenas de FASE-05 |
Marcos de Entrega
| Marco | Fases Inclusas | Data Estimada | Critério de Aceite |
|---|---|---|---|
| M1 — Segurança Baseline | FASE-01 | Semana 1 | Segredos obrigatórios, erros logados, sanitizador ativo |
| M2 — Qualidade Garantida | FASE-01, 02 | Semana 2 | CI verde, testes executam, cobertura mensurável |
| M3 — Arquitetura Madura | FASE-01–03 | Semana 4 | Monólitos decompostos, domain layer criado |
| M4 — Produção-Ready | FASE-01–05 | Semana 6 | Error handling, logging, tipagem padronizados |
| M5 — Documentado | FASE-01–06 | Semana 7 | ADRs, CONTRIBUTING, SECURITY completos |
| M6 — UX Polish | FASE-01–07 | Semana 9 | Toasts, a11y, breadcrumbs, empty states |
| M7 — Gateway Completo | FASE-01–09 | Semana 12 | Policy engine, cache, evals, telemetria |
Critérios de Qualidade Transversais
Aplicáveis a TODAS as fases:
- CI pipeline verde após cada merge.
- Cobertura de testes não regride.
- Nenhum
console.logadicionado (a partir da FASE-05). - PR review obrigatório.
- CHANGELOG atualizado a cada fase.