# Supported Windows capture boundary
The collector uses public Win32 console metadata, IP Helper owner-PID TCP tables, and Windows UI Automation. It reads no terminal text buffer or process environments. It briefly changes console-title metadata and selects tabs to expose inactive pane controls. Exact random markers bind recognized console owners to TermControl leaves; pre-existing titles never identify a session.
Bare PowerShell/pwsh consoles may be represented as explicit fresh-shell panes. They must be direct Terminal children with only the executable in argv, and their attached console must contain only that shell after excluding the observation helper. Recognized Codex/SSH owners have priority; shell wrappers never replace them. Membership is checked during binding and again before capture completes. This observes the executable, not shell memory, command history, running built-in state or current directory. The root recovery layer must supply and disclose its configured fresh-shell directory; this collector makes no cwd claim. ProcessesOnly continues to return Codex records exclusively.
Socket evidence comes from public GetExtendedTcpTable OWNER_MODULE_ALL, with SDK-derived verified row sizes/table offsets (IPv4 160/8, IPv6 192/8) and context-bind creation FILETIME. All owned rows with nonzero local and peer addresses/ports are retained, rather than selecting an ESTABLISHED state. Raw state is diagnostic: this PC returned states0 and6 for the same unchanged SSH endpoint/timestamp while its independently observed remote peer was established. Context-bind creation must not predate the current process incarnation; endpoint+creation sets are rechecked after capture, excluding raw state from identity. The root resolver must require uniqueness across **all** qualifying rows for an SSH owner before correlating an exact fresh remote client/socket/session. A matching subset is insufficient; no state value claims old-interface health. Missing OWNER_MODULE_ALL access or timestamps fail closed without privilege escalation. Native Connection JSON adds required `state:u32` and `created_filetime:u64`; these are observation provenance, not persisted attachment identities. SDK contracts: [IPv4](https://learn.microsoft.com/en-us/windows/win32/api/tcpmib/ns-tcpmib-mib_tcprow_owner_module), [IPv6](https://learn.microsoft.com/en-us/windows/win32/api/tcpmib/ns-tcpmib-mib_tcp6row_owner_module).
Capture currently requires exactly one CASCADIA_HOSTING_WINDOW_CLASS HWND for the selected Terminal process, counting hidden siblings. Explicit HWND selection does not relax this restriction. The default ignores Terminal processes without recognized interactive Codex/SSH ancestry. Scope is checked before console probes and again between observations. Multiple HWNDs sharing the selected process fail before title mutation; arbitrary shared-process multi-window capture is unsupported.
Title cleanup is **compare-before-restore**, not an atomic compare-exchange. A title change already observed after the marker is preserved. An application can still write between the equality read and restoration call, or between initial title read and marker write; a small caption-only race remains. No atomic nonclobber guarantee is claimed. Selection restoration likewise checks exact window/process/tab identity, current owned selection and GetLastInputInfo, and preserves a changed selection or physical input. Those public APIs do not form an atomic user-intent transaction.
Every title helper has a 2.5-second lease and independently detects its collector parent's PID/creation identity disappearing. Before the first Select, an independent selection watchdog is ready and a journal records the original RuntimeId, committed and pending owned selections, HWND, Terminal creation identity, physical-input tick and deadline. Pending selection is journalled before Select so parent death in the call has a known bounded ownership set. At deadline the watchdog terminates only the exact owned collector process, then attempts guarded restoration in a worker bounded to four seconds. It never stops an agent, shell or Terminal. On normal exit PowerShell restores selection before requesting and waiting for watchdog acknowledgement. Rust waits for the receipt and exact watchdog process exit before recursive temporary cleanup. Missing/failed acknowledgements retain diagnostics. The watchdog can itself encounter an unavailable or blocked UIA provider: that is a reported cleanup failure, not a restoration guarantee.
Recursive cleanup checks canonical task-root containment. Runtime helpers and journals stay inside the Rust-created random task directory. Whole-window completeness, provider identity joins and geometry-equivalent restoration still need integration acceptance. Rectangles do not reveal the Terminal's historical private binary split ancestry.
## Collector validation
Normal `cargo test` includes the native observation parser. Its isolated artifact harness can also compile capture.rs with this workspace's already-built, locked dependencies:
```powershell
cargo test --lib
$anyhowLib=(Get-ChildItem target/debug/deps/libanyhow-*.rlib | Select-Object -First 1).FullName
$serdeLib=(Get-ChildItem target/debug/deps/libserde-*.rlib | Select-Object -First 1).FullName
$jsonLib=(Get-ChildItem target/debug/deps/libserde_json-*.rlib | Select-Object -First 1).FullName
rustc --edition 2024 --test src/capture.rs --extern "anyhow=$anyhowLib" --extern "serde=$serdeLib" --extern "serde_json=$jsonLib" -L dependency=target/debug/deps -o target/capture-native-tests.exe
./target/capture-native-tests.exe
```
Both C# helpers compile with the installed .NET Framework compiler, using System.Web.Extensions and the installed UIAutomationClient/UIAutomationTypes/WindowsBase assembly paths for the watchdog. Native acceptance must exercise actual tab restoration, exact leaf binding, complete-window capture and geometry restoration. Parser and compilation checks alone do not establish those behaviors.
The journal reader uses a single shared-delete file handle for both size and contents, with at most 250ms of retries for missing/share/delete races bounded by the original immutable deadline. Malformed data and immutable mismatches are never retried or replaced with stale state. `tests/windows_journal_stress.cs` is an artifact-only C# entry point: compile it together with selection-watchdog.cs, `/main:JournalStress`, and the same helper/UIA references described above; pass an owned scratch directory. It performs 6,000 actual PublishJournal/File.Replace operations with concurrent old and new readers, tests transient disappearance, and verifies expired deadlines, malformed input and immutable mismatches fail closed. It does not call UIA, attach consoles or select tabs.