Repository navigation
feat(elos): morning coach from the learner snapshot, scheduled by Hermes - #23
Conversation
Deterministic message (no model, no network): streak, cards and words due, a retrieval question on the top difficulty, English word of the day with example, a roleplay line with its task, exam countdown with advice. scripts/morning-coach.ts writes it to coach-du-jour.md next to the snapshot and can show a macOS notification; Hermes runs it with `cron create --script --no-agent`. Stale or missing snapshots are stated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c71d2928b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const today = snapshot.today; | ||
| const index = dayIndex(today); | ||
| if (now.getTime() - Date.parse(snapshot.generatedAt) > STALE_MS) { |
There was a problem hiding this comment.
Reject prior-day snapshots before reporting today's plan
When ELOS was last opened the previous evening, the snapshot can be less than 24 hours old and therefore trigger no warning, but snapshot.today, dueToday, dueWords, and daysLeft still describe yesterday. The 08:00 job then labels yesterday's workload as today's, repeats the previous word, and reports a stale exam countdown beneath a header generated from the current date. Compare snapshot.today with the current local calendar day and require a refresh or avoid presenting its date-dependent fields as current.
Useful? React with 👍 / 👎.
| Avec une messagerie configurée dans Hermes (`hermes gateway setup`), remplace `--deliver local` par `telegram`, | ||
| `signal`… Le contenu (vocabulaire, jeux de rôle, intitulés de notions) est générique ; aucun passage de cours n’y figure. |
There was a problem hiding this comment.
Warn before forwarding snapshot-derived labels
For learners with imported personal course documents, the message is not entirely generic: it includes studio.difficulties[].term, which is derived from those documents, and the exam course name. Hermes' --no-agent mode delivers script stdout verbatim, so replacing local with Telegram or Signal forwards these labels to an external service despite the assurance here. Disclose the exact fields and obtain informed authorization, or redact snapshot-derived labels for external delivery.
AGENTS.md reference: AGENTS.md:L14-L14
Useful? React with 👍 / 👎.
| const file = process.env.ELOS_STATE_FILE ?? path.join(process.env.HOME ?? "", "ELOS-Hermes", "elos-state.json"); | ||
| let snapshot: LearnerSnapshot | null = null; | ||
| try { snapshot = parseLearnerSnapshot(readFileSync(file, "utf8")); } catch { snapshot = null; } | ||
| const message = buildMorningMessage(snapshot, new Date()); |
There was a problem hiding this comment.
Handle nested snapshot corruption in the fallback
The surrounding try handles only reading and parsing, while parseLearnerSnapshot accepts structurally incomplete same-version values such as dailyEnglish: {} and studio: {}. Passing that value here makes the builder throw on fields such as cards.length, so the scheduled job exits without writing or delivering the intended missing-snapshot fallback. Include message construction in the recovery path or validate the complete nested schema before returning it.
AGENTS.md reference: AGENTS.md:L30-L31
Useful? React with 👍 / 👎.
Summary
Deterministic morning message (no model, no network) from the learner snapshot: streak, workload, retrieval question on the top difficulty, English word of the day, roleplay line, exam countdown.
scripts/morning-coach.tswritescoach-du-jour.mdand can notify on macOS; Hermes schedules it withcron create --script --no-agent(docs indocs/integrations/HERMES.md).Test plan
npm test645/645, typecheck,eslint .🤖 Generated with Claude Code