Owner:
What’s already done: cross-match job exists and creates Alerts; API routes exist.
Goal: Make alerts pipeline demo-ready + add basic API integration tests.
Tasks
-
Add a scheduled-job simulation path:
- e.g.,
scripts/run_daily_alerts.py that does: ingest trends → cross-match → print summary
-
Improve alert dedup logic if needed:
- confirm what defines “duplicate” (currently item_id + trend_term)
- optionally add “same day” logic if you want it
-
Add integration tests using FastAPI TestClient:
- seed DB in test setup
- call
/trends/ingest in snapshot mode
- call
/alerts/run
- verify
/alerts returns alerts with expected structure
Acceptance criteria
-
One command can demo the “daily run”:
python -m scripts.run_daily_alerts --source snapshot
-
Integration tests exist: tests/test_api_flow.py
-
/alerts includes risk delta and explanation details (already mostly there; ensure stable schema)
Tests
pytest -q runs integration tests without network or API keys
Dependencies
- Uses Issue 3 snapshot ingest mode (or embed snapshot ingestion in the script directly)
Owner:
What’s already done: cross-match job exists and creates Alerts; API routes exist.
Goal: Make alerts pipeline demo-ready + add basic API integration tests.
Tasks
Add a scheduled-job simulation path:
scripts/run_daily_alerts.pythat does: ingest trends → cross-match → print summaryImprove alert dedup logic if needed:
Add integration tests using FastAPI TestClient:
/trends/ingestin snapshot mode/alerts/run/alertsreturns alerts with expected structureAcceptance criteria
One command can demo the “daily run”:
python -m scripts.run_daily_alerts --source snapshotIntegration tests exist:
tests/test_api_flow.py/alertsincludes risk delta and explanation details (already mostly there; ensure stable schema)Tests
pytest -qruns integration tests without network or API keysDependencies