Commit graph

26 commits

Author SHA1 Message Date
0662e766d4 Sprint 6d — Migrate Gemini Live to @google/genai SDK
feat(geminiLive): rewrite with GoogleGenAI SDK (vertexai: true, apiKey)
  replaces raw WebSocket to generativelanguage.googleapis.com
feat(geminiLive): restore full setup config (systemInstruction,
  inputAudioTranscription, outputAudioTranscription, VAD)
fix(geminiLive): buildSetupFrame → SDK config object (no manual JSON)
fix(useT2LiveSession): cancelTokenRef for idempotent startDialogue,
  closeAllRef for stable unmount cleanup
chore: add @google/genai@^1.50.1 dependency
test: 11 geminiLive tests rewritten with SDK mock
  292/292 backend tests green
2026-04-27 02:25:58 +03:00
d89b0b1e89 Sprint 6a — Backend T2 Live (WS proxy + correction + persistance)
feat(geminiLive): dynamic prompt builder, transcript accumulation,
  VAD config (END_SENSITIVITY_LOW, 2s silence), 210s timeout + 180s warning
feat(t2live): sujet fetch + validation, correction pipeline (deepseekCorrectEO
  + PHONOLOGY_STUB TD-08), production insert + report delivery via WS
feat(deepseek): TacheEO extended with EO_T2, VALID_TACHES_EO updated
test: 11 geminiLive tests (rewritten + 4 new), 10 t2live integration tests
  292/292 backend tests green (+15)
2026-04-26 19:53:37 +03:00
6671bac347 feat(billing): TD-13 webhook idempotency + Stripe Customer Portal + doc cleanup
- Table stripe_webhook_events + helpers isEventProcessed/markEventProcessed
- POST /stripe/customer-portal (auth + stripe_customer_id check)
- ARCHITECTURE-backend.md: suppression POST /plans/upgrade (duplication doc)
- TD-13 fermé dans TECH_DEBT-backend.md
- Tests: 261 → 278 verts (+17)
2026-04-26 04:15:46 +03:00
8f8a900449 feat(eo): restore audioBase64 mode for Gemini batch transcription
- POST /corrections/eo accepts audioBase64 + mimeType (XOR with transcript)
- Gemini transcribeAudio called server-side before correction
- No audio storage (client downloads locally)
- /transcriptions/token kept for future Deepgram live use

Typecheck: OK · Tests: all green

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 05:59:53 +03:00
14880fe94c fix(deepgram): revert to /v1/auth/grant for temporary JWT tokens
- /v1/projects/{id}/keys creates permanent API keys, not WebSocket-compatible JWT tokens
- /v1/auth/grant requires Member-scoped API key (now configured)
- Remove DEEPGRAM_PROJECT_ID dependency
- Update tests

Typecheck: OK · Tests: 241/241 

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 05:49:45 +03:00
a62b4816a2 fix(deepgram): use correct /v1/projects/{project_id}/keys endpoint
- Replace non-existent /v1/auth/grant with /v1/projects/{project_id}/keys
- Add DEEPGRAM_PROJECT_ID env variable
- Update request body and response parsing
- Update tests

Typecheck: OK · Tests: 241/241 

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 05:36:19 +03:00
7cac057062 feat(eo): align correction EO on 3.6a format + Deepgram token + T1 presentation generation
Sprint 4a:
- correctEO aligned on CorrectionRapport format (revelation, diagnostic, criteres, conseil_nclc, erreurs_codes)
- nclc_cible parameter (default 9, accepts 9|10)
- Fire-and-forget modele + exercices jobs (same pattern as EE)
- EO-specific DeepSeek prompt (oral transcript tolerance, 4 TCF criteria)
- Gemini transcribeAudio: 30s timeout + 1 retry
- POST /presentations/generate: 5-field questionnaire → DeepSeek generates oral presentation (~220-260 words, NCLC 7-8)
- Migration 006_sprint_4a_eo.sql (documentation only — no audio storage)

Sprint 4b:
- POST /transcriptions/token: Deepgram temporary API key (600s TTL)
- Removed audio storage pipeline (audioStorage.ts, XOR validation, 14MB limit)
- Backend receives transcript text only, no audio files
- TD-10/TD-11 resolved (Sprint 3.6c), TD-16/17/18 resolved (4b cleanup)

Typecheck: OK · Tests: 241/241 

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 05:04:26 +03:00
c48ae8d443 feat(patterns): GET /users/patterns — agrégation erreurs récurrentes + exercices long terme + indice de préparation (Sprint 3.6c)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 22:06:14 +03:00
a394ce8429 feat(simulations): GET /simulations — liste paginée des productions (Sprint 3.7)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 20:54:36 +03:00
63bc43ddcf feat(corrections): Sprint 3.6a — nouveaux prompts + taxonomie erreurs + génération parallèle
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 17:27:29 +03:00
fcd8fe7017 feat(simulations): persistance session — autosave + sujet_id + getById tolère rapport=null (FTD-21) 2026-04-21 03:48:45 +03:00
fc76fac981 test(sujets): 5 tests POST /sujets/idees
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 03:07:13 +03:00
bd8ab4b72b feat(sujets): POST /sujets/idees — suggestions DeepSeek (G5)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 03:05:07 +03:00
1a5b79807e test(sujets): 8 tests route GET /sujets 2026-04-21 01:03:49 +03:00
cc72487013 feat(sujets): GET /sujets?mode=&tache= avec auth + filtre actif 2026-04-21 00:59:18 +03:00
0680a6382f feat(simulations): GET /simulations/:id — lecture rapport avec auth + REPORT_NOT_READY 2026-04-20 04:41:24 +03:00
20aeda86aa fix: T2 live — envoi message erreur + setTimeout avant close WS 2026-04-17 03:49:20 +03:00
653fc3150e feat: WS /t2/live — proxy Gemini Live API — 124/124 tests 2026-04-17 03:39:21 +03:00
f08be960b0 fix: imports ESM avec extensions .js — NodeNext compatible Render — 117/117 tests 2026-04-17 01:04:16 +03:00
5b82c6bd46 feat: Stripe checkout + webhook + upgrade prorata — 117/117 tests 2026-04-16 20:39:18 +03:00
f4f8c55ce7 feat: POST /corrections/eo — Gemini transcription + DeepSeek EO — 84/84 tests 2026-04-16 17:43:46 +03:00
77d5a8373e feat: POST /corrections/ee — DeepSeek rapport complet — 73/73 tests 2026-04-16 17:14:45 +03:00
bf2c48b2c7 feat: POST /simulations — quota check + insert productions — 65/65 tests 2026-04-16 14:13:47 +03:00
2fba6f2003 test: validation manuelle auth middleware — 3/3 verts 2026-04-16 13:52:08 +03:00
f71498668f feat: middleware plan + route GET /plans/status — 59/59 tests verts 2026-04-16 12:42:43 +03:00
708517edef feat: initialisation projet Hono.js + TypeScript + Vitest 2026-04-16 06:37:25 +03:00