v8.7.7 — Internal tidy: the panel debug log moves to its own module, all 41 admin commands are checked by a test, coverage floors raised
[8.7.7] — Internal tidy: the panel debug log moves to its own module, all 41 admin commands are checked by a test, coverage floors raised
This is an internal change. Nothing you can see or configure changes: no setting, service, websocket command, error code or stored file is different, and the panel behaves as before. It is the first step of splitting websocket.py, which is 4,300 lines.
Moved (code moved as it was, no edits)
- The panel debug log moved from
websocket.pyto a newcustom_components/nova/ws_log.py: the two in memory buffers (500 entries, and 80 for conversation and reply routing), thenova.logfile, its queue, writer thread and lock,nova_log,recent_debug_logandrecent_conversation_log. The new module imports nothing from Home Assistant. - The persisted log is still read once when Nova is imported, before the config folder is set, from the same file (
nova/nova.log).websocket.pystill exportsnova_log,recent_debug_logandrecent_conversation_log, so the 15 modules that importnova_logfrom it are untouched. _read_integration_versionand_INTEGRATION_VERSIONstay inwebsocket.py.
Tests
- New
tests/ws_sources.pyreadswebsocket.pyand everyws_*.pytogether. The tests andtests/contract_extract.pythat readwebsocket.pyby path now use it, so they keep finding commands and helpers after later moves. test_websocket_admin_gate.pylisted 36 of the 41 admin gated commands. It now lists all 41 (it addscamera_snapshot,clear_scene_memory,get_debug_log,list_actionsandsay_hello), and the count check is exact. These five were already admin gated and pinned bywebsocket.json. This only makes the gate test cover them.- 31 new unit tests for the debug log (
tests/unit/test_ws_log.py). The behaviour tests passed against the old code before the move. - The one test that patched
_LOG_FILEonwebsocketnow patches it onws_log._LOG_FILEis not re exported, so a stray patch of it onwebsocketfails loudly instead of doing nothing. tests/fixtures/contracts/storage.json: the owner ofnova/nova.logis nowws_loginstead ofwebsocket. The path is the same.websocket.jsonis unchanged.
Coverage floors
agent_runtime71 to 74 andintent33 to 35 (measured 75.1% and 36.5% on the unit run). The Python 3.14 run that CI also does was not measured.