feat: 23:00 daily news recap; prompts drop futures
Summarizer still runs the 15-min analyst, plus a 24h breaking-news recap at 23:00 America/New_York. HUD pins kind=daily_recap. Prompts ignore futures/market tape.
This commit is contained in:
parent
d25ca8ed9c
commit
49ee5fe7a3
16 changed files with 431 additions and 75 deletions
45
news/summerizer/tests/test_summarizer.py
Normal file
45
news/summerizer/tests/test_summarizer.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
"""Summarizer window, recap flag, and no futures injection into prompts."""
|
||||
|
||||
from summarizer import (
|
||||
build_map_prompt,
|
||||
build_master_prompt,
|
||||
effective_window_minutes,
|
||||
is_recap_run,
|
||||
)
|
||||
|
||||
|
||||
def test_interval_window_defaults_to_15_minutes(monkeypatch):
|
||||
monkeypatch.delenv("NEWS_RECAP", raising=False)
|
||||
monkeypatch.delenv("SUMMARY_WINDOW_HOURS", raising=False)
|
||||
monkeypatch.setenv("SUMMARY_WINDOW_MINUTES", "15")
|
||||
assert is_recap_run() is False
|
||||
assert effective_window_minutes() == 15
|
||||
|
||||
|
||||
def test_recap_window_is_24_hours(monkeypatch):
|
||||
monkeypatch.setenv("NEWS_RECAP", "1")
|
||||
monkeypatch.setenv("SUMMARY_WINDOW_MINUTES", "15")
|
||||
assert is_recap_run() is True
|
||||
assert effective_window_minutes() == 24 * 60
|
||||
|
||||
|
||||
def test_build_map_prompt_does_not_inject_futures():
|
||||
prompt = build_map_prompt(
|
||||
[{"title": "Blast", "domain": "ex.com", "url": "https://ex.com/1", "content": "x" * 120}]
|
||||
)
|
||||
assert "FUTURES PRICES" not in prompt
|
||||
assert "ES=F" not in prompt
|
||||
assert "Blast" in prompt
|
||||
|
||||
|
||||
def test_build_master_prompt_interval_uses_summary_not_recap():
|
||||
prompt = build_master_prompt("partial facts", recap=False)
|
||||
assert "partial facts" in prompt
|
||||
assert "daily recap" not in prompt.lower()
|
||||
|
||||
|
||||
def test_build_master_prompt_recap_uses_daily_template():
|
||||
prompt = build_master_prompt("partial facts", recap=True)
|
||||
assert "partial facts" in prompt
|
||||
assert "daily recap" in prompt.lower()
|
||||
assert "24" in prompt
|
||||
Loading…
Reference in a new issue