Add newsletter translation with NEWSLETTER_LANGUAGES - #10
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a post-assembly translation step: after each English newsletter is assembled, every language in
NEWSLETTER_LANGUAGESis translated by a newtranslatoragent and archived in a newnewsletter_translationstable. English stays the only language emailed. A translation failure is logged but never blocks the English send.Also moves
beats,campaign, andorchestratorfromsrc/agents/into a newsrc/newsroom/package, keeping agent definitions insrc/agents/and orchestration logic insrc/newsroom/.Related issues
Closes #9
Changes
src/newsroom/— new package withbeats,campaign,orchestrator, andtranslation(the translation orchestration step moved fromsrc/agents/)src/agents/translator.py— new translator agent viamake_agent()src/agents/skills/translation/SKILL.md— tone and fidelity rules for the translatorsrc/db/newsletter_translations.py—NewsletterTranslationmodel andupsert_translation/get_translationhelpersalembic/versions/0002_newsletter_translations.py— migration for the new tablesrc/db/newsletters.py— status string changed from"complete"to"completed"for consistency.env.exampleupdated to matchHow to test
alembic upgrade head— should apply0002_newsletter_translationscleanly.pytest— all 142 tests should pass.NEWSLETTER_LANGUAGES=Indonesianand runpython src/app.py run; checknewsletter_translationsin Postgres for a row per delivered ticker.