Repository navigation
Description
Found by the v0.25.0 release audit (round 2, dispatch token rel2-ab2ef9d5), platform band, returned unranked. Ranked here by the maintainer: not blocking, no existing row fits, no new row earned. v0.25.0 ships with it.
Mechanism, composed from two commits
Neither half is wrong alone:
- 91727f2 (The #469 env-cache fix is inert in user-prompt-hook.sh, and the #469 test certifies it against a premise that hook does not meet #479, in this delta) moved the
REMEMBER_HOOK_CWDstdin read ahead of the cache lookup inscripts/user-prompt-hook.sh, which now pins its cache key to the raw stdincwd. scripts/lib-env-cache.sh:105's pre-existing The #227 env-cache fast path is permanently dead on Codex and Gemini CLI, so every prompt takes the slow path #469 key fallback.scripts/session-start-hook.sh:175-176sources the cache and publishes afterresolve-paths.shhas exported the normalizedCLAUDE_PROJECT_DIR, in a fresh process where that pin is unset -- so it keys on the normalized form.
Two hooks, two forms of the same directory, one cache.
Why it does not bite today
The auditor ran the real normalizer (scripts/resolve-paths.sh:202-228, copied verbatim) under OSTYPE=msys with the real key sanitiser, with a positive control:
raw = C:\\Users\\dev\\proj -> key C---Users--dev--proj } STABLE
norm = C:\\Users\\dev\\proj -> key C---Users--dev--proj }
raw2 = c:/Users/dev/proj -> key c--Users-dev-proj } DIVERGENT
norm2= C:\Users\dev\proj -> key C--Users-dev-proj } (control fires)
For the form the extractor actually produces, the keys agree. The reason they agree is the interesting part: running the delta's own _stdin_cwd over a CRLF, pretty-printed, Windows-native payload returns C:\\Users\\dev\\proj -- JSON escapes are not decoded, so backslashes arrive doubled, and normalization is an identity on that form. All four hooks' extractors are identical here and this is pre-existing.
So the agreement rests on an accident of the extractor, not on the two sites deriving the key the same way.
When it would bite
The moment a host sends a drive path in a form normalization rewrites -- c:/Users/dev/proj, per the control row above. Cost is bounded: user-prompt-hook.sh's own load and publish stay pinned to each other, so it self-heals from prompt two, leaving one extra slow resolution and a stray cache file per session.
What would settle it
The literal cwd string Codex and Gemini CLI put on a Windows payload. Not observed -- and it is the same class of unknown as #494, which asks whether any host can nest a cwd ahead of the top-level one. Both are questions about payloads from hosts this project does not control.
Why no row
misreports sends a reviewer to a rendering seam, and there is none. fails-to-preserve implies lost data, and nothing is lost -- a divergent key costs a re-resolution, not a record. Filed unranked-as-ranked: not blocking, worth closing, no new row on one bounded instance.
Platform
Windows only -- the divergence needs a drive-letter path. Mechanism exercised on macOS/arm64 (Darwin 24.3.0) by running the real normalizer under a forced OSTYPE=msys; no Windows host was used, so the host-payload half is unobserved.
Activity
Fewer warm-path forks (#511), env-cache key parity on Windows (#504),…
Make the Python-detection FATAL diagnosable, and guard every detached…