chart/tests
Chris Amow e9c22f6bbd Move alert evaluation server-side so push works without a browser open
Alerts were evaluated inside the WebSocket handler, with a separate AlertEngine
per connection. Three consequences, all of which defeated the point of phone
push:

- No browser connected meant no alert at all. The notification only existed if
  a tab was open to receive it, which is precisely when you least need it.
- Two tabs meant two notifications, since each connection evaluated
  independently.
- Cooldowns lived and died with the connection, so reloading the page cleared
  them and a zone that had just alerted alerted again at once.

The third also meant the calibration in the README described a system nobody was
running: it models a single engine, which is what this now is.

Evaluation moves into Runtime, once per closed 1m bar, over every level. Layer
preferences are deliberately not consulted — they are a display choice made in
one browser, and a push notification should not depend on which checkboxes that
browser has ticked. Sockets now only relay what the runtime produced.

ntfy dispatch is a detached task with its own error handling. It previously ran
inline in the socket loop and called raise_for_status(), where the only except
clause caught disconnects — so a transient ntfy outage dropped the client's
connection.

Delivery verified end to end against ntfy.sh: title, priority and the multi-line
body all arrive as intended. NTFY_TOPIC still has to be set for anything to send.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 00:48:03 -05:00
..
fixtures Add implementation plan for /ES multi-timeframe confluence chart 2026-08-09 20:31:40 -05:00
test_aggregator.py Implement M2 session-aware aggregation 2026-08-09 20:41:36 -05:00
test_alerts.py Add prior-day levels and session VWAP; fix alert repetition they exposed 2026-08-10 00:36:21 -05:00
test_auth.py Enforce CHART_AUTH_TOKEN on /api and /ws; restore /api/version for wait-deploy 2026-08-10 04:38:36 +00:00
test_confluence.py Fix trendline deletion while typing, audio leak, prefs drift, cluster payload 2026-08-10 00:17:40 -05:00
test_horizontals.py Add prior-day levels and session VWAP; fix alert repetition they exposed 2026-08-10 00:36:21 -05:00
test_manual_lines.py Remove the 4h timeframe 2026-08-10 00:43:47 -05:00
test_moving_averages.py Implement M3 projected daily moving averages 2026-08-09 20:44:11 -05:00
test_replay.py Implement M0 Yahoo market data and replay 2026-08-09 20:36:13 -05:00
test_runtime_alerts.py Move alert evaluation server-side so push works without a browser open 2026-08-10 00:48:03 -05:00
test_session.py Remove the 4h timeframe 2026-08-10 00:43:47 -05:00
test_store.py Implement M1 live one-minute chart 2026-08-09 20:38:50 -05:00
test_vwap.py Add prior-day levels and session VWAP; fix alert repetition they exposed 2026-08-10 00:36:21 -05:00
test_yahoo.py Implement M0 Yahoo market data and replay 2026-08-09 20:36:13 -05:00