Re-translate on Interpreter model change — artist-scoped + global (m146) #202

Merged
bvandeusen merged 1 commits from dev into main 2026-07-07 20:22:40 -04:00
Owner

Refresh stored post translations after switching the Interpreter model — aimable at specific artists so already-English artists are left alone. Builds on m143 (post translation), which is already on main. No migration (reuses the m143 translation columns).

What it does

  • retranslate_posts(artist_ids, _reset_done) (tasks/translation.py): resets the 5 translation columns to NULL for a scoped set of posts (all, or WHERE artist_id IN ids), then reuses the untranslated sweep to re-run them, chasing the tail until drained (run-until-done, bounded ~300/chunk). The reset only happens after the service passes enabled + base-URL + health, so translations are never wiped when they can't be rebuilt. The Interpreter cache keys on engine_version → a changed model re-translates, an unchanged one is cache-fast.
  • POST /settings/translation/retranslate{artist_id} (one artist) or {all:true} (every artist; must be explicit so an empty body can't wipe everything).
  • UI: per-artist "Re-translate posts" on the Artist Management tab + "Re-translate all" in the Settings Translation card, both with confirm dialogs.
  • Tests: task (reset / artist-scope isolation / run-until-done re-enqueue / disabled+unhealthy no-reset) + endpoint (artist_id, all, disabled 400, empty-body 400, bad-int 400).

Deploy note

No migration — the translation columns already exist on main (from m143). Head = 1f6d94f, CI run 2041 green on dev.

🤖 Generated with Claude Code

Refresh stored post translations after switching the Interpreter model — aimable at specific artists so already-English artists are left alone. Builds on m143 (post translation), which is already on main. **No migration** (reuses the m143 translation columns). ## What it does - `retranslate_posts(artist_ids, _reset_done)` (tasks/translation.py): resets the 5 translation columns to NULL for a scoped set of posts (all, or `WHERE artist_id IN ids`), then reuses the untranslated sweep to re-run them, chasing the tail until drained (run-until-done, bounded ~300/chunk). The reset only happens after the service passes enabled + base-URL + health, so translations are never wiped when they can't be rebuilt. The Interpreter cache keys on engine_version → a changed model re-translates, an unchanged one is cache-fast. - `POST /settings/translation/retranslate` — `{artist_id}` (one artist) or `{all:true}` (every artist; must be explicit so an empty body can't wipe everything). - UI: per-artist **"Re-translate posts"** on the Artist Management tab + **"Re-translate all"** in the Settings Translation card, both with confirm dialogs. - Tests: task (reset / artist-scope isolation / run-until-done re-enqueue / disabled+unhealthy no-reset) + endpoint (artist_id, all, disabled 400, empty-body 400, bad-int 400). ## Deploy note **No migration** — the translation columns already exist on main (from m143). Head = 1f6d94f, CI run 2041 green on dev. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-07-07 20:21:57 -04:00
feat(translation): re-translate on model change — artist-scoped + global re-run (#146)
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 21s
CI / backend-lint-and-test (push) Successful in 32s
CI / integration (push) Successful in 3m41s
1f6d94f51d
retranslate_posts resets the 5 translation columns to NULL for a scoped set of posts (all, or WHERE artist_id IN ids) then reuses the untranslated sweep to re-run them, chasing the tail until drained (run-until-done). Interpreter cache keys on engine_version so a changed model re-translates, an unchanged one is cache-fast. Reset only happens when the service is configured+healthy so translations are never wiped when they can't be rebuilt. New POST /settings/translation/retranslate (artist_id | all=true). UI: per-artist 'Re-translate posts' on the Artist Management tab + 'Re-translate all' in the Settings Translation card, both with confirm dialogs. No migration (reuses m143 columns).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bvandeusen changed title from Post translation via Interpreter (m143) + re-translate on model change (m146) to Re-translate on Interpreter model change — artist-scoped + global (m146) 2026-07-07 20:22:33 -04:00
bvandeusen merged commit 11572f469a into main 2026-07-07 20:22:40 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#202