Review follow-up to 46e4107 (AwadYoo).
What:
- storeAppVersion counts only the main package (empty resource id). The
Windows box's AppX registry key keeps a resource package that Get-AppxPackage
no longer lists (Clipchamp.Clipchamp_4.6.10420.0_neutral_split.scale-125_…
beside the installed 4.7.10020.0_x64__…). A stale entry like that is no sign
the app is installed, and a newer-numbered one would win "newest".
- internal/agent's TestMain stubs windowsStorePackages, as it already does
for nodeModulesOf and the other machine readers (#1823's rule): on a
Windows box with the Codex app installed, tests read nothing of it.
- the doc comment for storeAppVersion had a blank line in the middle of it.
It is joined, and windowsStorePackages has its own comment.
Run (go1.26.8, sandbox HOME, private GOCACHE):
- Windows box (Win 11 x64): installed the real Store app (winget
9PLM9XGG6VKS, "ChatGPT", OpenAI.Codex_26.1007.2314.0_x64__2p2nqsd0c76g0).
A probe built from origin/main printed AppVersion="" HasApp=false; built
from this series: AppVersion="26.1007.2314.0" HasApp=true, and CLI()
ok=true App="26.1007.2314.0" with no codex CLI on PATH.
- break checks: the resource-id filter put back to len(fields) < 3 ->
TestCodexWindowsStoreAppVersion FAIL `Codex Store app: "27.0.0.0"`;
AppVersion without the Store read -> FAIL `Codex Store app: ""`.
Restored: pass on darwin and on the Windows box (test binary built with
GOOS=windows GOARCH=amd64, run there with the real app installed).