autoplan: phase-publication-hook ownPath() rejects forward-slash / MSYS absolute paths on Windows
Summary
On Windows, /autoplan's publication hook fails with Native parent project directory is unavailable. (or Native parent hook identity is unavailable.) whenever CLAUDE_PROJECT_DIR, cwd or transcript_path is spelled with forward slashes or in MSYS/Git Bash form.
Where
autoplan/bin/phase-publication-hook.ts (v1.89.0.0):
const ownPath = (value: unknown): value is string =>
typeof value === 'string' && path.isAbsolute(value) && path.normalize(value) === value;and its callers, e.g. if (!ownPath(projectCwd)) fail('Native parent project directory is unavailable.');
Why
On win32, path.normalize rewrites separators, so the equality check rejects valid absolute paths:
| input | path.win32.normalize |
ownPath |
|---|---|---|
C:/Users/x/proj |
C:\Users\\\x\proj |
false |
/c/Users/x/proj |
\c\Users\\\x\proj |
false |
C:\Users\\\x\proj |
C:\Users\\\x\proj |
true |
Hooks run under Git Bash on Windows commonly receive the forward-slash or MSYS spellings, so the hook refuses and /autoplan can't publish.
Suggested fix
Compare canonical forms instead of requiring the input to already be normalized, e.g. path.isAbsolute(v) && !path.normalize(v).split(path.sep).includes('..'). Or normalize before use and reject only on .. traversal. Add a win32 test with forward-slash input.
Environment
Windows 11, Git Bash, Claude Code desktop, gstack v1.89.0.0.
Source: garrytan/gstack