feat(translation): 8h sweep + drain button + detection probe (#1376) #207

Merged
bvandeusen merged 1 commits from dev into main 2026-07-08 20:19:33 -04:00
Owner

Starts task #1376 (translation throughput + misdetection groundwork).

Throughput

  • translate_posts beat cadence: daily → every 8h (steady-state for newly-imported posts).
  • Settings "Translate now" now runs in drain mode (run-until-done, no reset): one press chases the whole untranslated backlog (~22.9k) to zero instead of a single 300-post chunk. The interrupt/backoff re-enqueue preserves the drain flag so a bulk drain resumes cleanly after an Interpreter restart.

Misdetection groundwork

  • Surface the detector's detected_confidence from the Interpreter client (was present in the detectedLanguage payload but discarded).
  • New read-only "Test translation" box (POST /settings/translation/probe + TranslationCard UI): paste text → detected language + confidence + engine + result, without saving. Lets the operator see why a short/abbreviation-heavy English title (e.g. "WIP") gets mis-detected, so the guard (min-length + confidence floor) can be tuned from real numbers. The guard itself follows once the cases are probed.

Ops note (rule #132): CSS-free but changes worker/scheduler behavior — a plain redeploy of :latest picks it up. The 8h beat key was renamed (translate-posts-dailytranslate-posts-8h); the scheduler runs celery worker --beat with no volume for the beat shelve, so it reseeds from config on restart — no stale entry.

Tests: drain-chases-tail + beat-single-chunk (integration), confidence surfacing (unit), run-asserts-drain + 3 probe endpoint tests (unit). CI run 2072 green (all four lanes).

🤖 Generated with Claude Code

https://claude.ai/code/session_01CgZP9v2otxVJymiYsnVuMy

Starts task #1376 (translation throughput + misdetection groundwork). **Throughput** - `translate_posts` beat cadence: daily → **every 8h** (steady-state for newly-imported posts). - Settings **"Translate now"** now runs in **drain mode** (run-until-done, no reset): one press chases the whole untranslated backlog (~22.9k) to zero instead of a single 300-post chunk. The interrupt/backoff re-enqueue preserves the `drain` flag so a bulk drain resumes cleanly after an Interpreter restart. **Misdetection groundwork** - Surface the detector's `detected_confidence` from the Interpreter client (was present in the `detectedLanguage` payload but discarded). - New read-only **"Test translation"** box (`POST /settings/translation/probe` + TranslationCard UI): paste text → detected language + confidence + engine + result, without saving. Lets the operator see *why* a short/abbreviation-heavy English title (e.g. "WIP") gets mis-detected, so the guard (min-length + confidence floor) can be tuned from real numbers. The guard itself follows once the cases are probed. **Ops note (rule #132):** CSS-free but changes worker/scheduler behavior — a plain redeploy of `:latest` picks it up. The 8h beat key was renamed (`translate-posts-daily` → `translate-posts-8h`); the scheduler runs `celery worker --beat` with no volume for the beat shelve, so it reseeds from config on restart — no stale entry. **Tests:** drain-chases-tail + beat-single-chunk (integration), confidence surfacing (unit), run-asserts-drain + 3 probe endpoint tests (unit). CI run 2072 green (all four lanes). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01CgZP9v2otxVJymiYsnVuMy
bvandeusen added 1 commit 2026-07-08 20:19:26 -04:00
feat(translation): 8h sweep + drain button + detection probe (#1376)
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 19s
CI / backend-lint-and-test (push) Successful in 46s
CI / integration (push) Successful in 3m55s
ffdbdbaf07
Throughput: translate_posts now runs every 8h (was daily) as the
steady-state cadence for newly-imported posts, and the Settings
"Translate now" button runs it in drain mode (run-until-done, no reset)
so one press clears the whole untranslated backlog instead of a single
300-post chunk. The interrupt/backoff re-enqueue now preserves the drain
flag so a bulk drain resumes cleanly after an Interpreter restart.

Misdetection groundwork: surface the detector's confidence from the
Interpreter client (it was in the detectedLanguage payload but discarded)
and add a read-only "Test translation" box — POST /settings/translation/
probe + TranslationCard UI — that shows detected language + confidence +
engine + result for pasted text, without saving. Lets the operator see
why a short/abbreviation-heavy English title gets mis-detected so the
detection guard (min-length + confidence floor) can be tuned from real
numbers. The guard itself follows once the mis-detected cases are probed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CgZP9v2otxVJymiYsnVuMy
bvandeusen merged commit 5366047d55 into main 2026-07-08 20:19:33 -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#207