video-accessibility/backend/app
michael e44210ea64 feat: auto-rewrite TTS cues that fail synthesis
When TTS synthesis fails after 3 retries, the system now:
- Sends problematic cue text to Gemini for TTS-safe rewriting
- Updates the VTT file in GCS with rewritten text
- Retries TTS synthesis with the new text
- Records successful rewrites in job.tts_rewrites field

UI changes:
- JobDetail shows amber caution box with original/rewritten text
- JobsList shows warning icon next to jobs with rewrites
- Error display clarifies text shown is "after rewrite attempt"

Files changed:
- backend/app/models/job.py: Add tts_rewrites field
- backend/app/prompts/gemini_tts_rewrite.md: New prompt template
- backend/app/services/gemini.py: Add rewrite_tts_cue method
- backend/app/tasks/tts_synthesis.py: Add VTT update utilities
- backend/app/tasks/translate_and_synthesize.py: Rewrite+retry logic
- frontend/src/types/api.ts: Add TTSRewriteItem type
- frontend/src/routes/jobs/JobDetail.tsx: Caution display
- frontend/src/routes/jobs/JobsList.tsx: Warning indicator

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 14:42:50 -06:00
..
__pycache__ fixed middleware silent swallowing of exceptions FINALLY 2025-10-08 18:19:59 -05:00
api/v1 feat: add server-side zip download for bulk job downloads 2026-01-04 15:57:57 -06:00
core feat: add environment-based worker concurrency for Cloud Run mode 2026-01-02 10:27:07 -06:00
lib initial commit 2025-08-24 16:28:33 -05:00
middleware fixed overly aggressive security algorithm 2025-10-08 17:49:20 -05:00
migrations fix: add tts_failed and render_failed to MongoDB schema validator 2026-01-05 14:09:41 -06:00
models feat: auto-rewrite TTS cues that fail synthesis 2026-01-05 14:42:50 -06:00
prompts feat: auto-rewrite TTS cues that fail synthesis 2026-01-05 14:42:50 -06:00
schemas feat: add server-side zip download for bulk job downloads 2026-01-04 15:57:57 -06:00
services feat: auto-rewrite TTS cues that fail synthesis 2026-01-05 14:42:50 -06:00
tasks feat: auto-rewrite TTS cues that fail synthesis 2026-01-05 14:42:50 -06:00
telemetry initial commit 2025-08-24 16:28:33 -05:00
main.py feat: add video review with timestamped notes to Final Review 2025-12-26 15:30:00 -06:00