feat(eo): complete EO simulation flow (T1 + T3) with Gemini transcription

- Gemini batch transcription (no Deepgram live)
- blobToBase64 helper (shared/lib/audio.ts)
- AudioRecorder: remove onChunk, add maxSeconds/onMaxReached auto-submit
- Timer stops at maxSeconds and triggers auto-submission
- EnregistrementEOPage: audioBase64 to backend, fix race condition step=done
- SimulationFlowProvider: submitEoAudio(audioBase64, mimeType, nclcCible)
- MIME normalization (strip codec params)
- Split CORRECTION_EE_TIMEOUT_MS (60s) / CORRECTION_EO_TIMEOUT_MS (120s)
- PresentationGenereeT1Page: localStorage persistence

Typecheck: OK · Tests: 159/159 

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hermann_Kitio 2026-04-25 08:28:51 +03:00
parent 71c1ad3018
commit d1c8b548bb
34 changed files with 3255 additions and 70 deletions

View file

@ -48,7 +48,14 @@ export function getReport(id: string): Promise<Report> {
// Sprint 3.6a — le nouveau prompt maître (taxonomie + revelation + diagnostic +
// criteres×6 champs + conseil_nclc + erreurs_codes) produit un JSON long ;
// DeepSeek met typiquement 25-45 s pour répondre. Backend abort à 55 s.
const CORRECTION_TIMEOUT_MS = 60_000
const CORRECTION_EE_TIMEOUT_MS = 60_000
// Sprint 4b.3 — EO en mode audio enchaîne Gemini transcribe (jusqu'à 60 s,
// 30 s + 1 retry de 30 s) puis DeepSeek correction (55 s côté backend).
// Pire cas serveur ≈ 115 s : on alloue 120 s côté client pour ne pas couper
// avant que la mutation aboutisse (le rapport apparaissait sinon dans
// l'historique sans navigation vers /rapport/:id).
const CORRECTION_EO_TIMEOUT_MS = 120_000
/** Soumet une production écrite pour correction. Endpoint : `POST /corrections/ee`.
* Payload : { simulationId, contenu, tache }
@ -57,7 +64,7 @@ export function correctEe(payload: CorrectEePayload): Promise<Report> {
return apiFetch<Report>('/corrections/ee', {
method: 'POST',
body: payload,
timeoutMs: CORRECTION_TIMEOUT_MS,
timeoutMs: CORRECTION_EE_TIMEOUT_MS,
})
}
@ -69,7 +76,7 @@ export function correctEo(payload: CorrectEoPayload): Promise<Report> {
return apiFetch<Report>('/corrections/eo', {
method: 'POST',
body: payload,
timeoutMs: CORRECTION_TIMEOUT_MS,
timeoutMs: CORRECTION_EO_TIMEOUT_MS,
})
}