Windows support: infraternal agent, ConPTY shim, fact collector (after first Linux release) #70

Open
opened 2026-10-07 09:41:34 +00:00 by kayg · 1 comment
Owner

Windows support: infraternal agent and fact collector (after the first Linux release, D156)

Everything a job needs to start this without prior context.

Read first

  • DECISIONS 9, 17–22, 64, 104, 114, 126, 132–139, 145 and 156 (install first, then the agent collects; no one-shot probe).
  • contracts/bootstrap.md (dev), contracts/shim.md, contracts/wire.md.
  • research/discovery/REPORT.md and matrix.json (main): the Windows rows hold commands, fallbacks, root needs, cost and privacy for every fact.

What is known (research #64, not yet verified on a real host)

  • Windows 10/11 and Server 2019/2022/2025 ship OpenSSH Server as an optional feature. The default shell is cmd.exe; HKLM\SOFTWARE\OpenSSH\DefaultShell can switch it to PowerShell (5.1 or 7). The bootstrap sniff must detect which shell answered: research §2 has a candidate cross-shell sniff that has not been validated on cmd, PowerShell 5.1 or PowerShell 7.
  • Facts come from CIM/WMI via PowerShell (Get-CimInstance Win32_OperatingSystem, Win32_ComputerSystem, Win32_Processor, Win32_LogicalDisk), listeners from Get-NetTCPConnection -State Listen, the firewall from the Windows Firewall APIs and time from the Windows Time service. "Load" is a processor-load sample, not a Unix load average.
  • Admin rights are the analogue of root: the D139 consent applies (a UAC-elevated service vs a per-user agent).

What needs designing and building

  1. Terminal sessions on Windows: ConPTY replaces the Unix PTY in the shim (D9), with the same shim contract (contracts/shim.md): a ring buffer, Snapshot via libghostty-vt (does it build for Windows? check the Zig target), and resume. Shells: PowerShell 7, Windows PowerShell, cmd, WSL.
  2. The agent as a Windows service (rootful) or a per-user scheduled-task or startup agent (rootless); A/B binary slots and lockstep updates (D135) with Windows file-locking rules (a running exe cannot be overwritten: rename-swap).
  3. Transport: QUIC/TCP-TLS outbound only (D64); certificate storage with DPAPI or the Windows cert store.
  4. Fact collector table for Windows from the matrix, with parallel tasks, timeouts and hang detection (D145).
  5. Bootstrap over OpenSSH: shell detection, upload, install and enroll, all through PowerShell and cmd-safe commands.
  6. Testing: a real Windows Server 2022/2025 VM and a Windows 11 VM are required. There is no Windows host today: ask the owner for one (the Mac Studio could run one under UTM/Parallels for ARM64 Windows; x86_64 needs another host).

Done means

On a real Windows host: add host, then the agent installs, the facts appear, a terminal works with resume, updates and rollback work, and removal is clean. Gates as for Linux, plus Windows CI.

# Windows support: infraternal agent and fact collector (after the first Linux release, D156) Everything a job needs to start this without prior context. ## Read first - DECISIONS 9, 17–22, 64, 104, 114, 126, 132–139, 145 and **156** (install first, then the agent collects; no one-shot probe). - `contracts/bootstrap.md` (dev), `contracts/shim.md`, `contracts/wire.md`. - `research/discovery/REPORT.md` and `matrix.json` (main): the Windows rows hold commands, fallbacks, root needs, cost and privacy for every fact. ## What is known (research #64, not yet verified on a real host) - Windows 10/11 and Server 2019/2022/2025 ship **OpenSSH Server as an optional feature**. The **default shell is `cmd.exe`**; `HKLM\SOFTWARE\OpenSSH\DefaultShell` can switch it to PowerShell (5.1 or 7). The bootstrap sniff must detect which shell answered: research §2 has a candidate cross-shell sniff that has **not been validated** on cmd, PowerShell 5.1 or PowerShell 7. - Facts come from CIM/WMI via PowerShell (`Get-CimInstance Win32_OperatingSystem`, `Win32_ComputerSystem`, `Win32_Processor`, `Win32_LogicalDisk`), listeners from `Get-NetTCPConnection -State Listen`, the firewall from the Windows Firewall APIs and time from the Windows Time service. "Load" is a processor-load sample, not a Unix load average. - Admin rights are the analogue of root: the D139 consent applies (a UAC-elevated service vs a per-user agent). ## What needs designing and building 1. **Terminal sessions on Windows:** ConPTY replaces the Unix PTY in the shim (D9), with the same shim contract (contracts/shim.md): a ring buffer, Snapshot via libghostty-vt (does it build for Windows? check the Zig target), and resume. Shells: PowerShell 7, Windows PowerShell, cmd, WSL. 2. **The agent as a Windows service** (rootful) or a per-user scheduled-task or startup agent (rootless); A/B binary slots and lockstep updates (D135) with Windows file-locking rules (a running exe cannot be overwritten: rename-swap). 3. **Transport:** QUIC/TCP-TLS outbound only (D64); certificate storage with DPAPI or the Windows cert store. 4. **Fact collector table** for Windows from the matrix, with parallel tasks, timeouts and hang detection (D145). 5. **Bootstrap over OpenSSH:** shell detection, upload, install and enroll, all through PowerShell and cmd-safe commands. 6. **Testing:** a real Windows Server 2022/2025 VM and a Windows 11 VM are required. There is no Windows host today: ask the owner for one (the Mac Studio could run one under UTM/Parallels for ARM64 Windows; x86_64 needs another host). ## Done means On a real Windows host: add host, then the agent installs, the facts appear, a terminal works with resume, updates and rollback work, and removal is clean. Gates as for Linux, plus Windows CI.
Author
Owner

Priority raised by D161 (2026-10-07): Windows is one of the enterprise platforms that come next after the first Linux release (enterprise Linux incl. PVE), alongside macOS.

Priority raised by D161 (2026-10-07): Windows is one of the enterprise platforms that come next after the first Linux release (enterprise Linux incl. PVE), alongside macOS.
Sign in to join this conversation.
No labels
launch-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal#70
No description provided.