Files
lg-smtv-mcp/docs/adr/0003-asyncssh-protocol-boundary-for-dev-mode-capture.md
T
kiskaadee 1d3e40126d
Core Architecture & Invariant CI / validate (push) Successful in 15s
docs(designs,adr): align M2 implementation plan and resolve egm-review findings
- Update ADR-0003 and ADR-0004 Status lines from closed placeholder #5 to active M2 capture issue #12
- Fix LG Developer Mode documentation URLs from developer.lg.com to developer.lge.com in docs/designs/lg-smtv-mcp.md
- Clarify Developer Mode asyncssh/SFTP session lifecycle (lazily opened on first capture, reused while online, swept on connect/reconnect, and closed on STANDBY_OFFLINE), define FastMCP, and align state-diagram backoff terminology
- Document trusted home-LAN transport boundary, wss://:3001 self-signed TLS + client-key model, known_hosts=None vs. SSH_KNOWN_HOSTS_PATH host-key pinning trade-offs, and single-TV-per-daemon scalability limit
- Separate completed M1 baseline (#1-#4, matching actual tests/ layout and mime_type="image/jpeg") from actionable M2 specifications (#12 CaptureClient/AsyncSshCaptureTransport contracts and shielded cleanup, #13 systemd unit, #11 E2E hardening)
2026-11-16 16:28:15 -05:00

22 lines
1.6 KiB
Markdown

# ADR-0003: Asyncssh Protocol Boundary for Dev Mode Capture
- Status: Accepted (Protocol seams `CaptureTransport` / `FrameCapturer` implemented in M1; `CaptureClient` / `AsyncSshCaptureTransport` planned for M2 `#12`)
- Date: 2026-11-15
- Deciders: kiskaadee
## Context and Problem Statement
Retail LG webOS TVs do not serve `/tmp` screenshots over HTTPS (`:3001`), requiring SFTP retrieval from the Developer Mode SSH server (`prisoner@<TV_IP>:9922`) using legacy `ssh-rsa` algorithms.
## Decision Outcome
Chosen option: "Use `asyncssh` (`config=[]`, explicit `ssh-rsa` host-key and signature algorithms) wrapped behind `CaptureTransport` / `FrameCapturer` `Protocol` interfaces", because it keeps SFTP sessions persistent in-process and enables deterministic offline contract testing via protocol doubles.
## Consequences
- Positive: Eliminates per-capture SSH subprocess startup and `ControlMaster` socket management; cleanly mockable in `pytest`; degrades gracefully to `SCREENSHOT_UNAVAILABLE` when Developer Mode expires.
- Negative: Requires explicit legacy `ssh-rsa` algorithm configuration in `asyncssh` and `known_hosts=None` default on LAN (overridable via `SSH_KNOWN_HOSTS_PATH`).
## Alternatives Considered
- OpenSSH `ControlMaster` subprocesses: Rejected because managing background control sockets, parsing subprocess output/exit codes, and writing offline unit tests is more brittle.
## Related Decisions
- Documented in [docs/designs/lg-smtv-mcp.md](../designs/lg-smtv-mcp.md) (Alternative C) and [ADR-0004](0004-sequenced-temp-captures-with-cleanup-and-sweep.md).