feat(observabilidade): rota /api/sessions com validação Zod

Task 5 do MVP Espelho: endpoint Express com factory createSessionsRouter(db)
que expõe GET / (lista filtrável por days/project/tool/skill/q + limit/offset
validados via Zod) e GET /:id (meta + eventos via parseSessionFile). Integrado
em server.ts com DB aberta a partir de OBSERVABILIDADE_DB ?? DEFAULT_DB_PATH.

Validação empírica: total=559 sessões (últimos 7d), detalhe com 37 eventos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 01:04:44 +01:00
parent 7a13d21caa
commit e101577d61
5 changed files with 370 additions and 28 deletions
Executable → Regular
+2
View File
@@ -53,6 +53,7 @@
"@types/react": "^19.2.5",
"@types/react-dom": "^19.2.3",
"@types/ssh2": "^1.15.5",
"@types/supertest": "^7.2.0",
"@vitejs/plugin-react": "^5.1.1",
"@vitest/ui": "^4.0.18",
"autoprefixer": "^10.4.24",
@@ -63,6 +64,7 @@
"globals": "^16.5.0",
"jsdom": "^28.0.0",
"postcss": "^8.5.6",
"supertest": "^7.2.2",
"tailwindcss": "^4.1.18",
"tsx": "^4.19.2",
"typescript": "~5.9.3",