feat(ipc): display control socket, stage 1 - on-demand with acks (#706)

The display serves a control socket (/run/ledmatrix/control.sock) carrying versioned JSON commands, one per line, each answered. Stage 1 covers on-demand start, stop and status; commands are queued on the socket thread and applied on the render thread through the mailbox's own handler, and the web interface falls back to the file mailbox when the socket is unavailable. Protocol and security model: docs/IPC_CONTROL_SOCKET.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-10-01 10:33:02 -04:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 74696d2108
commit 695ff92009
18 changed files with 3158 additions and 42 deletions
+13
View File
@@ -315,6 +315,19 @@ def _hermetic_display_watchdog(monkeypatch):
display_watchdog.RenderWatchdog(environ={}, heartbeat_dir=None))
@pytest.fixture(autouse=True)
def _hermetic_control_socket(monkeypatch):
"""Keep the control socket (src/ipc) off the host.
DisplayController.run() would serve /run/ledmatrix/control.sock -- or
find the live display's already there, when the suite runs on a device
-- and the web routes would send on-demand commands to that display.
Off by default; the socket tests point it at a tmp_path of their own.
"""
from src.ipc.contract import SOCKET_PATH_ENV
monkeypatch.setenv(SOCKET_PATH_ENV, 'off')
@pytest.fixture(autouse=True)
def reset_logging():
"""Reset logging configuration before each test."""