suusuu0927 e63241c699
fix(observe): skip Windows AppInstallerPythonRedirector.exe in resolve_python_cmd (#1511)
On Windows 10/11 without Python installed from the Microsoft Store, the
"App Execution Alias" stubs at %LOCALAPPDATA%\Microsoft\WindowsApps\python.exe
and python3.exe are symlinks to AppInstallerPythonRedirector.exe. These
stubs neither launch Python nor honor `-c`; calls print a bare "Python "
line and exit, silently breaking every JSON-parsing step in observe.sh.

Net effect: observations.jsonl is never written, CLV2 appears installed
correctly, and the only residual artifact is `.last-purge`.

This commit:
  1. Adds `_is_windows_app_installer_stub` helper that detects the stub
     via `command -v` output and optional `readlink -f` resolution.
  2. Teaches `resolve_python_cmd` to skip stub candidates and fall
     through to the next real interpreter (typically C:\...\Python3xx\python.exe).
  3. Exports the stub-aware CLV2_PYTHON_CMD before sourcing
     detect-project.sh, which already honors an already-set value,
     so the shared helper does not re-resolve and re-select the stub.

POSIX-compatible. No behavior change on macOS / Linux / WSL where no
such stub exists.

Refs: observations.jsonl empty on Windows Claude Desktop users.
2026-04-21 18:39:06 -04:00
..