You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NewsService.story() (app/news.py:229-236) caches empty {"html": "", "source_url": ""} responses permanently, so a single transient network failure leaves that story blank until restart.
BamSECService.get_filings() (app/bamsec.py:82-94) caches HTTP 5xx/429 error responses for the full 120s TTL.
AlpacaNews._stories, NewsService._cache, NewsService._stories, BamSECService._cache, NewsPrefetcher._fetched, and TapeWorker._tg_last_alert grow without bound over long sessions.
NewsPrefetcher (app/screener.py:75-81) uses a FIFO queue.Queue, so priority=True calls for newly alerted symbols sit behind the entire background backlog (0.25s per ticker).
Trigger a transient failure when fetching a story via NewsService.story(id) and retry -> empty result stays cached forever.
Enqueue A, B, then URGENT (priority=True) in NewsPrefetcher -> dequeues in FIFO order ['A', 'B', 'URGENT'].
Expected Behavior
Skip caching empty/failed stories and 5xx/429 BamSEC errors, enforce bounded LRU/max-size eviction on caches, and use queue.PriorityQueue in NewsPrefetcher so urgent new-symbol news fetches jump ahead of background prefetches.
Operating System & Version
OS: Windows 11 x64 / macOS arm64 / Linux x86_64
Version: v2.12.0
Display / Scale: Verified via live Chrome CDP (1600x960) & local unit/backend suite
Logs & Additional Context
Backend reproduction confirmed perm_empty_story_cache=True, bamsec_caches_503=True, and prefetch_order=['A', 'B', 'URGENT'].
Summary of Changes: Stopped permanently caching empty stories (app/news.py) and transient BamSEC 5xx/429 responses (app/bamsec.py), bounded caches with LRU OrderedDict, and upgraded NewsPrefetcher (app/screener.py) to queue.PriorityQueue. Verified via unit tests.
Verification: compileall clean, 84/84 unit tests passing (including tests/test_audit_fixes.py), and live Chrome CDP verification passed.
This issue will automatically close upon PR #82 review and merge into main.
Activity
mlgitdev commentedon Dec 2, 2026
🚀 Resolution In Progress
A fix for this issue has been implemented and submitted in Pull Request #82 (
v2.12.1).fix/audit-remediation-67app/news.py) and transient BamSEC 5xx/429 responses (app/bamsec.py), bounded caches with LRUOrderedDict, and upgradedNewsPrefetcher(app/screener.py) toqueue.PriorityQueue. Verified via unit tests.compileallclean, 84/84 unit tests passing (includingtests/test_audit_fixes.py), and live Chrome CDP verification passed.This issue will automatically close upon PR #82 review and merge into
main.github-actions commentedon Dec 2, 2026
✅ Issue Validation Passed
fix(cache))This issue is well-structured and ready for work according to the Issue-First Protocol.