diegosouzapw
33c28f73db
refactor(phase5-6): domain persistence, policy engine, OAuth extraction, proxy decoupling
...
Phase 5 — Foundation & Security:
- SQLite domain state persistence (5 tables, 4 modules: fallback, budget, lockout, circuit breaker)
- Write-through cache pattern for state survival across restarts
- Race condition fix in route.js (Promise-based singleton)
- Default password hardening (.env.example)
- Server init error handling improvement
Phase 6 — Architecture Refactoring:
- OAuth providers extracted into 12 individual modules (providers.js 1051→144 lines)
- Policy Engine (lockout→budget→fallback) with evaluateRequest/evaluateFirstAllowed
- Deterministic round-robin via persistent counter Map
- Telemetry window fix with proper recordedAt timestamps
- Proxy decoupled from API settings (direct import vs HTTP self-fetch)
Tests: 295 pass (22 new: domain-persistence 16, policy-engine 6)
Docs: CHANGELOG, README, ARCHITECTURE.md updated
2026-02-15 08:12:12 -03:00
diegosouzapw
4269c25a9f
docs: update CHANGELOG, README, and ARCHITECTURE for v0.3.0 release
...
- CHANGELOG.md: comprehensive v0.3.0 entry with security hardening, domain layer,
pipeline wiring, 9 API routes, frontend 100% coverage, rate limit overhaul
(4 phases), ADRs, compliance, eval framework, 273+ tests
- README.md: add 10 new feature rows (circuit breaker, anti-thundering herd,
resilience profiles/UI, cost budgets, telemetry, correlation IDs, compliance,
model availability, eval framework), update tech stack and release example
- ARCHITECTURE.md: add domain layer modules, resilience modules, 11 new API
routes, usageDb decomposition note, update date
2026-02-15 02:06:14 -03:00
diegosouzapw
6e29bd1197
feat(resilience): rate limit overhaul — exponential backoff, circuit breaker, anti-thundering herd, Resilience UI
...
Phase 1: Error classification + provider profiles (constants, providerRegistry, accountFallback)
Phase 2: Circuit breaker integration in combo pipeline (combo.js)
Phase 3: Anti-thundering herd mutex + auto rate limits for API key providers (auth.js, rateLimitManager)
Phase 4: Frontend Resilience tab with Circuit Breaker, Provider Profiles, Rate Limit cards
Tests: 63/63 passing (error-classification, combo-circuit-breaker, thundering-herd, rate-limit-enhanced)
2026-02-15 01:42:50 -03:00
diegosouzapw
f44ec7e1f2
feat: complete all 46 tasks — ADRs, eval framework, compliance, a11y, CLI, Playwright specs (Batch B)
...
T-30 — ADRs:
- 6 ADRs: SQLite, Fallback Strategy, OAuth, JS+JSDoc, Single-Tenant, Translator Registry
T-33 — JSDoc Coverage:
- Full JSDoc on all new modules (100% exported functions documented)
T-35 — Accessibility:
- a11yAudit.js: lightweight WCAG AA checker (aria-label, dialog role, alt text, labels)
T-38 — Password Reset CLI:
- bin/reset-password.mjs: interactive CLI tool for admin password reset
T-39 — Playwright Specs:
- tests/e2e/responsiveSpecs.mjs: viewports (375/768/1280), 4 pages, test matrix
T-42 — Eval Framework:
- evalRunner.js: 4 strategies (exact, contains, regex, custom) + golden set (10 cases)
T-43 — Compliance:
- audit_log table, noLog opt-out per API key, LOG_RETENTION_DAYS cleanup
TASKS.md: 46/46 Concluído ✅
Tests: 144/144 pass (119 existing + 25 new)
2026-02-14 19:18:02 -03:00
diegosouzapw
c09978454b
feat: domain layer, error codes, request ID, fetch timeout, JSDoc (T-19, T-22, T-23, T-25, T-27)
...
T-19 — Domain Layer:
- modelAvailability.js: Model availability tracking with TTL cooldowns
- costRules.js: Per-API-key budget management with daily/monthly limits
- fallbackPolicy.js: Declarative fallback chain routing
T-22 — Error Codes Catalog:
- errorCodes.js: 24 codes in 6 categories + createErrorResponse helper
T-23 — Correlation ID:
- requestId.js: AsyncLocalStorage-based x-request-id propagation
T-25 — Fetch Timeout:
- fetchTimeout.js: AbortController wrapper with FETCH_TIMEOUT_MS env var
T-27 — JSDoc + @ts-check:
- Added @ts-check to 8 critical files
TASKS.md updated: 37/46 tasks Concluído, 9 remaining
Tests: 119/119 pass (88 existing + 31 new)
2026-02-14 19:03:55 -03:00
diegosouzapw
492afc4ff1
refactor: decompose usageDb, handleSingleModelChat, UI components (T-15, T-28, T-29)
...
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)
2026-02-14 18:53:14 -03:00
diegosouzapw
81a4f2986c
feat: v0.2.0 — advanced routing services, cost analytics dashboard, pricing overhaul
...
Added:
- 8 new open-sse services (account selector, IP filter, session manager, etc.)
- 6 new dashboard settings tabs (IP filter, system prompt, thinking budget, pricing)
- Usage cost dashboard with provider cost donut, cost trend line, model cost column
- Pricing API merging registry + custom + pricing-only models
- 9 unit tests for all new services
Changed:
- Usage analytics layout redesigned with prominent cost display
- DailyTrendChart upgraded to ComposedChart with dual Y-axes
Fixed:
- Pricing page now shows custom/imported models
- Icon rendering (material-symbols-rounded → outlined)
2026-02-14 13:50:45 -03:00
diegosouzapw
7ff1ba978a
feat: add OpenAPI specification, generate package-lock, and remove various SVG assets from the public directory.
2026-02-13 20:57:44 -03:00
diegosouzapw
699329944e
feat: initial OmniRoute release (rebranded from 9router)
...
This project is inspired by and originally forked from 9router by decolua
(https://github.com/decolua/9router ).
Full rebrand: 9router → OmniRoute across all source code, configuration,
Docker, documentation, and assets.
2026-02-13 16:29:27 -03:00