Files
lg-smtv-mcp/docs/adr/0004-sequenced-temp-captures-with-cleanup-and-sweep.md
T
kiskaadee 1ab5246fbf
Core Architecture & Invariant CI / validate (push) Successful in 15s
docs: reconcile M1 architecture, roadmap, ADRs, and design spec
- Add ARCHITECTURE.md documenting canonical present-state M1 topology, components, boundaries, and ADR index
- Add ROADMAP.md recording M1 (#1-#4) completion and M2 (#5, #11) trajectory
- Extract Alternatives A-E from docs/designs/lg-smtv-mcp.md into docs/adr/0001-0005 MADR records
- Update README.md milestone status (#1-#4 merged on main, #5/#11 in M2) and Documentation links
- Reconcile docs/designs/lg-smtv-mcp.md module statuses, FrameCapturer seam, and KeysResult/TextResult.image_bytes
2026-11-16 13:52:16 -05:00

1.4 KiB
Raw Blame History

ADR-0004: Sequenced Temp Captures with Cleanup and Sweep

  • Status: Accepted (Implementation planned in M2 #5)
  • Date: 2026-11-15
  • Deciders: kiskaadee

Context and Problem Statement

ssap://com.webos.service.capture/executeOneShot writes screenshots to a path on the TV's /tmp filesystem (~1.2 GB RAM). Writing to a fixed path risks reading stale frames on silent failure, while uncleaned unique paths can exhaust TV RAM.

Decision Outcome

Chosen option: "Capture to /tmp/lg_smtv_cap_<seq>.jpg, pull bytes into memory only on returnValue: true, delete via finally: sftp.remove() under a 1–2s grace period, and sweep /tmp/lg_smtv_cap_*.jpg on SFTP connect/reconnect", because it prevents both stale-frame reads and /tmp memory exhaustion.

Consequences

  • Positive: Guarantees fresh frame reads per sequence number and bounds /tmp usage even when captures fail or time out.
  • Negative: Requires a 6s shared capture deadline plus 1–2s cleanup grace inside the 25s ui_lock budget.

Alternatives Considered

  • Fixed /tmp/test.jpg overwrite path: Rejected because if executeOneShot fails silently or races, SFTP pull can read a stale screenshot from an earlier step.