test(upgrade): migration test resolves bash through the parent PATH

A hardcoded /usr/bin:/bin child PATH breaks spawn('bash') on the Windows
curated lane (spawn resolves against the CHILD env's PATH; no bash.exe
lives there). Hermeticity is carried by HOME/GSTACK_* overrides, not PATH.
Found by the cycle-2 review pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-09-01 16:20:27 +00:00
co-authored by Claude Fable 5
parent 45eb8c30bd
commit cce6955932
@@ -44,7 +44,12 @@ afterAll(() => {
function run(): { code: number; stdout: string; stderr: string } {
const r = spawnSync('bash', [MIGRATION], {
env: {
PATH: '/usr/bin:/bin',
// The parent PATH, not a hardcoded POSIX one: on Windows, spawn
// resolves `bash` against the CHILD env's PATH, and /usr/bin:/bin
// contains no bash.exe there (the exact hazard documented on
// codex-under-codex-detection's KNOWN_WINDOWS_INCOMPATIBLE entry).
// Hermeticity comes from HOME/GSTACK_* below, not from PATH.
PATH: process.env.PATH ?? '/usr/bin:/bin',
HOME: tmpHome,
GSTACK_INSTALL_DIR: installDir,
GSTACK_HOME: gstackHome,