Files
lg-smtv-mcp/docs/adr/0003-asyncssh-protocol-boundary-for-dev-mode-capture.md
kiskaadee b41a721086
Core Architecture & Invariant CI / validate (push) Successful in 16s
docs(reconcile): align M1/M2 docs with merged capture slice
Reconcile repository documentation with the merged M2 capture
implementation (#12 / PR #15, merge commit c7e2618) and its review
remediation (61d2315, CR-01..CR-11). Resolves the CR-10 follow-up.

- README.md: flip status banner, component table, capture channel,
  M2 milestone row, requirements, and doc index from "planned" to
  implemented; scope the remaining M2 work to #13.
- ARCHITECTURE.md: extend scope to M1 + M2 capture; replace the
  dashed "None in M1" FrameCapturer seam with the real
  TvManager -> CaptureClient -> AsyncSshCaptureTransport edge; add a
  capture component row, correct data-flow step 3, document the
  Developer Mode SSH/SFTP device boundary and known_hosts policy, and
  record the 6.0s + 1.5s capture budget as a constraint.
- ROADMAP.md: update Current Direction; reduce Near Term to #13 and
  #17; add a "M2: Capture & E2E Hardening (partial)" Completed
  section covering #11 (PR #14) and #12 (PR #15).
- docs/designs/lg-smtv-mcp.md: drop all five planned markers; correct
  the sweep_temp_files signature to include `exclude`; fix the
  returnValue contract to "exactly True" -> otherwise
  SCREENSHOT_UNAVAILABLE (was: false -> COMMAND_FAILED); document the
  in-flight capture sweep exclusion; restructure the M2 plan into
  "Completed Milestone M2 Slices" so only #13 remains active; add a
  Last reconciled line.
- docs/adr/0003: status -> implemented in M2 #12 / PR #15.
- docs/adr/0004: status -> implemented, plus a dated Amendment
  (2026-11-16) recording CR-01's in-flight sweep exclusion and its
  rationale (the transport connects lazily after the capture request,
  so an unconditional sweep would delete the frame about to be read).
2026-11-16 23:35:09 -05:00

1.5 KiB

ADR-0003: Asyncssh Protocol Boundary for Dev Mode Capture

  • Status: Accepted (implemented in M2 #12 / PR #15)
  • 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.