NutsNews Translation All-in-One Update
Section titled “NutsNews Translation All-in-One Update”This replaces the earlier translation recovery/diagnostics bundles with one cleaner update.
What this update includes
Section titled “What this update includes”- Better Stack logging when accepted articles are skipped because
SUMMARY_TRANSLATION_LIMITis too low. - Better Stack logging for translation summary completion.
- Better Stack logging for Supabase
article_summariessave failures. - Extra Worker response counters:
articleSummaryAttemptedTaskCountarticleSummaryFailedTaskCountarticleSummarySkippedByLimitArticleCountarticleSummarySkippedByLimitLanguageTaskCount
- Diagnostic script:
scripts/diagnose_missing_article_translations.mjs
- Audit script:
scripts/audit_article_translations.mjs
- Backfill script:
scripts/backfill_article_summaries.mjs
- Validation helper:
scripts/validate_translation_update.sh
- Updated documentation:
docs/MULTI_LANGUAGE_SUMMARIES.md
Important note
Section titled “Important note”This update is diagnostic-first. It does not silently hide the issue by auto-fixing unknown failures. The likely cause of the six untranslated articles is that one Worker run accepted more articles than SUMMARY_TRANSLATION_LIMIT, so some accepted articles were saved without translation tasks.
The proper flow is:
- Install and validate this bundle.
- Run the diagnosis script.
- If the cause is
SUMMARY_TRANSLATION_LIMIT, raise the Worker secret. - Backfill the specific missing translations.
- Deploy the Worker logging fix so future incidents are visible.
One block: copy and validate
Section titled “One block: copy and validate”cd /Users/ramideltoro/WebstormProjects/nutsnews3
UPDATE_ZIP="$HOME/Downloads/nutsnews-translation-all-in-one-update.zip"TMP_DIR="/tmp/nutsnews-translation-all-in-one-update"
rm -rf "$TMP_DIR"mkdir -p "$TMP_DIR"unzip -o "$UPDATE_ZIP" -d "$TMP_DIR"rsync -av "$TMP_DIR"/ ./
chmod +x scripts/validate_translation_update.shchmod +x scripts/diagnose_missing_article_translations.mjschmod +x scripts/audit_article_translations.mjschmod +x scripts/backfill_article_summaries.mjs
scripts/validate_translation_update.sh /Users/ramideltoro/WebstormProjects/nutsnews3One block: diagnose the missing translations
Section titled “One block: diagnose the missing translations”Fill in your Supabase values, then run:
cd /Users/ramideltoro/WebstormProjects/nutsnews3
export SUPABASE_URL="https://YOUR_PROJECT.supabase.co"export SUPABASE_SERVICE_ROLE_KEY="YOUR_SERVICE_ROLE_KEY"
LANGUAGE_CODES=fr,ja,de-CH,de,el AUDIT_LIMIT=250 WINDOW_MINUTES=45 \node scripts/diagnose_missing_article_translations.mjsWhat to look for:
- If nearby runs show
accepted_countgreater than12, the likely cause is the translation limit. - If Better Stack has article-level translation failure logs, the cause is AI/local/OpenAI failure.
- If Better Stack has
worker.supabase.article_summary_batch_save_failed, the cause is Supabase save failure.
Better Stack searches
Section titled “Better Stack searches”service:nutsnews-worker event:worker.translation.skipped_by_limitservice:nutsnews-worker event:worker.refresh.completed articleSummarySkippedByLimitArticleCount:>0service:nutsnews-worker articleUrl:"PASTE_ARTICLE_URL_HERE"service:nutsnews-worker event:worker.supabase.article_summary_batch_save_failedIf the cause is SUMMARY_TRANSLATION_LIMIT
Section titled “If the cause is SUMMARY_TRANSLATION_LIMIT”Raise the limit:
cd /Users/ramideltoro/WebstormProjects/nutsnews3/workernpx wrangler secret put SUMMARY_TRANSLATION_LIMITEnter this value when prompted:
18Then deploy the Worker update:
cd /Users/ramideltoro/WebstormProjects/nutsnews3npm --prefix worker run deploy:allBackfill only after diagnosis
Section titled “Backfill only after diagnosis”Preview first:
cd /Users/ramideltoro/WebstormProjects/nutsnews3
export SUPABASE_URL="https://YOUR_PROJECT.supabase.co"export SUPABASE_SERVICE_ROLE_KEY="YOUR_SERVICE_ROLE_KEY"export LOCAL_AI_URL="https://ai.nutsnews.com"export LOCAL_AI_API_KEY="YOUR_LOCAL_AI_API_KEY"export LOCAL_AI_MODEL="qwen2.5:3b"
LANGUAGE_CODES=fr,ja,de-CH,de,el BACKFILL_SOURCE=public_feed_snapshot CANDIDATE_LIMIT=250 BACKFILL_LIMIT=12 DRY_RUN=1 \node scripts/backfill_article_summaries.mjsRun the real backfill:
LANGUAGE_CODES=fr,ja,de-CH,de,el BACKFILL_SOURCE=public_feed_snapshot CANDIDATE_LIMIT=250 BACKFILL_LIMIT=12 \node scripts/backfill_article_summaries.mjsVerify:
LANGUAGE_CODES=fr,ja,de-CH,de,el AUDIT_LIMIT=250 WINDOW_MINUTES=45 \node scripts/diagnose_missing_article_translations.mjsCommit
Section titled “Commit”cd /Users/ramideltoro/WebstormProjects/nutsnews3
git statusgit add worker/src/index.ts worker/src/logger.ts scripts/diagnose_missing_article_translations.mjs scripts/audit_article_translations.mjs scripts/backfill_article_summaries.mjs scripts/validate_translation_update.sh docs/MULTI_LANGUAGE_SUMMARIES.md README_TRANSLATION_ALL_IN_ONE_UPDATE.mdgit commit -m "Add translation diagnostics and backfill tools"git push