Skip to content

[Windows] Hooks silently broken: python3 Store stub passes command -v but fails to execute #30

@benslockedin

Description

@benslockedin

Description

On Windows, all ALIVE hooks that depend on Python silently fail. This means:

  • project.py never runs (no _kernel/now.json generation after save)
  • generate-index.py never runs (no world index regeneration)
  • JSON field extraction returns empty strings (squirrel entries populate with engine: unknown, walnut: null)
  • No error is surfaced to the user (all failures are swallowed by 2>/dev/null)

The system appears to work (hooks don't crash, squirrel files get created) but is actually running blind.

Root Cause

Windows ships a python3 stub at AppData/Local/Microsoft/WindowsApps/python3.exe that is actually AppInstallerPythonRedirector.exe:

  • Passes command -v python3 (the file exists and is executable)
  • Fails when actually run: exits with code 49 and prints "Python was not found"

In alive-common.sh, command -v python3 succeeds so ALIVE_JSON_RT is set to "python3". The node fallback (which works perfectly on Windows) never triggers.

Environment

  • OS: Windows 11 Home 10.0.26200
  • Shell: Git Bash (MINGW64) via Claude Code
  • Python: Available via py -3 launcher but NOT via python3
  • Node: Working, but never reached as fallback

Impact

Feature Status on Windows
Squirrel creation Partial (file created, fields empty)
JSON parsing in hooks Broken (returns empty strings)
project.py (now.json generation) Never runs
generate-index.py (world index) Never runs
Statusline Degraded
PreToolUse guards May silently skip checks
Post-save chain Broken

Fix

Fixed in #29 (commit de8d602). The detection now validates execution, not just existence, and adds a py -3 fallback with a shim:

if command -v python3 &>/dev/null && python3 -c "" &>/dev/null 2>&1; then
  ALIVE_JSON_RT="python3"
elif command -v py &>/dev/null && py -3 -c "" &>/dev/null 2>&1; then
  python3() { py -3 "$@"; }
  export -f python3
  ALIVE_JSON_RT="python3"
elif command -v node &>/dev/null; then
  ALIVE_JSON_RT="node"
fi

Reporter

Stuart Smyth — discovered during Windows onboarding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions