Daily audio lesson: per-user preference + nightly pre-generation#641
Merged
Conversation
Backend for the daily-delivery Listen redesign. Instead of generating a lesson on demand each day, the user configures a daily lesson once and a fresh one is pre-generated so it's waiting when they open the app. - UserPreference: per-language keys daily_audio_lesson_type_<lang> / daily_audio_lesson_suggestion_<lang> (+ get_daily_audio_lesson_config helper). The subject is stored verbatim — canonicalization stays at generation time. - save_user_preferences persists those keys (prefix-matched). - tools/generate_daily_audio_lessons.py: nightly job that, for each recently-active opted-in user with no lesson yet for their local today, runs the existing prepare+generate pipeline synchronously. Idempotent; --dry-run / --user-id for testing. The crontab entry lives in the ops repo (separate PR); merge/deploy this first so the tool exists before the schedule references it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
ArchLens - No architecturally relevant changes to the existing views |
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.
Backend half of the daily-delivery Listen redesign (frontend is a separate PR in
zeeguu/web). The model shifts from "tap Generate every day" to "configure once, a fresh lesson is waiting each morning."What's here
UserPreference— per-language keysdaily_audio_lesson_type_<lang>anddaily_audio_lesson_suggestion_<lang>, plus aget_daily_audio_lesson_config(user, lang)helper. "Enabled" == a type is set. The subject is stored verbatim (exactly what the user typed); canonicalization still happens at generation time.save_user_preferences— persists the new keys (prefix-matched), soGET /user_preferencesalready returns them.tools/generate_daily_audio_lessons.py— nightly job modeled onprecompute_upcoming_meaning_lessons.py. For each recently-active user who has a daily lesson configured for their learned language and no lesson yet for their local "today", it runs the existingprepare_lesson_generation+generate_daily_lessonpipeline synchronously. Idempotent (skips users who already have today's lesson);--dry-runand--user-idfor testing; per-user timeout; optional--send-emailsummary.Notes
opsrepo (separate PR). Merge/deploy this one first so the tool exists before the schedule references it.Test
🤖 Generated with Claude Code