feat: watchlist-based daily briefing on session start (closes #140)#149
Merged
Conversation
Add `generate_briefing()` to surface a one-time summary at REPL startup of activity since the previous session: current watchlist prices, alerts that triggered while away, and pending scheduled tasks. Detects the prior session via the most recent JSONL log mtime in the sessions directory, excluding the current session. The REPL loop calls the briefing once before printing the banner. The briefing is silently skipped on first-ever runs (no previous session) or when there is nothing noteworthy to report, and any failures are logged at debug level so they never block the REPL. https://claude.ai/code/session_01TDznA5KxCsxF5oeaBy3JH6
3cbd860 to
943fc12
Compare
This was referenced Apr 14, 2026
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
generate_briefing()toqracer/conversation/quickpath.py— composes a one-time session-start summary of watchlist prices, alerts triggered since the previous session, and pending scheduled tasks.mtimein the sessions dir, excluding the current session's path so it works correctly even after the current session has started writing._repl_loop()inqracer/cli.py, printed once before the banner; wrapped in try/except so failures never block the REPL.None(and prints nothing) on first-ever runs or when there is nothing to report.Closes #140
Implementation notes
data_registry.async_get_with_fallback(PriceProvider, "get_price", ...); individual ticker failures are skipped silently.triggered_atISO timestamps, treats naive datetimes as UTC, and only includes alerts withtriggered_at > last_session.... and N morefooter._find_last_session,_briefing_price_lines,_briefing_alert_lines,_briefing_task_lines) are private to keepgenerate_briefing()readable.Files changed
qracer/conversation/quickpath.pygenerate_briefing()and helpersqracer/cli.py_repl_loop()signature; call briefing before bannertests/conversation/test_quickpath.pyTestGenerateBriefing(8 cases)Test plan
uv run pytest tests/conversation/test_quickpath.py→ 16 passed (8 new briefing tests + 8 pre-existing)uv run pytest tests/conversation/ tests/test_cli.py→ 136 passed, 2 skippeduv run pytest tests/test_alerts.py tests/test_tasks.py tests/test_watchlist.py tests/test_alert_monitor.py tests/test_task_executor.py tests/data/→ 143 passeduv run ruff check qracer/ tests/→ cleanuv run ruff format --check→ cleanuv run pyright qracer/conversation/quickpath.py qracer/cli.py tests/conversation/test_quickpath.py→ 0 errorsHow to test manually
qracer repl→exit. This creates a session log under~/.qracer/sessions/.watch AAPL) or schedule a task so the briefing has content to show.qracer repl. The "Session Briefing" block should print before the banner, listing watchlist prices and any alerts/tasks since the previous run. On first-ever runs (no prior session log) the briefing is silently skipped.https://claude.ai/code/session_01TDznA5KxCsxF5oeaBy3JH6