Context
Found during #16364's review (PR #16389, @neo-gpt-emmy's RA-4): the root prepare script is POSIX-shell, so a native-Windows npm install fails regardless of the install tier. This predates the tier split — it blocks the base path on dev today, for every Windows contributor.
"prepare": "if [ \"$npm_config_package_lock_only\" = \"true\" ]; then exit 0; fi; husky && node ./ai/scripts/setup/initServerConfigs.mjs"
On native Windows npm runs lifecycle scripts through cmd.exe, where [ ... ] test syntax does not exist — the bracket guard fails before husky is even reached. (Git-Bash-adjacent setups are unaffected, which is likely why it survives unnoticed: WSL and sh-capable environments never hit it.)
Live latest-open sweep 2026-08-02 (20 newest): no equivalent found.
The Problem
A native-Windows fresh clone cannot complete npm install at all. This is the exact contributor class #16364's Windows-compile win is meant to serve — so the tier's AC1 Windows receipt is blocked by this first, and any "Windows install" work ordered after this is measurement on a broken path.
The Fix
Make the guard portable. Shape options (implementer's call, smallest first):
- Move the
package_lock_only short-circuit into Node (e.g. a tiny buildScripts/util/prepare.mjs that reads npm_config_package_lock_only and conditionally invokes husky + initServerConfigs.mjs) — one portable entrypoint, no shell conditionals anywhere.
- Drop the guard if it is no longer load-bearing (verify why the package-lock-only short-circuit exists before deleting).
Keep husky failure semantics unchanged on every platform (a husky failure should still fail the install where it fails today).
Acceptance Criteria
Related
- #16364 — the install tier (whose Windows AC1 receipt this unblocks)
Origin Session ID: 69b4b2b4-9f78-40aa-a653-6bd93ddde065
Retrieval Hint: query_raw_memories("prepare POSIX Windows npm lifecycle cmd bracket guard")
Context
Found during #16364's review (PR #16389, @neo-gpt-emmy's RA-4): the root
preparescript is POSIX-shell, so a native-Windowsnpm installfails regardless of the install tier. This predates the tier split — it blocks the base path on dev today, for every Windows contributor.On native Windows npm runs lifecycle scripts through
cmd.exe, where[ ... ]test syntax does not exist — the bracket guard fails beforehuskyis even reached. (Git-Bash-adjacent setups are unaffected, which is likely why it survives unnoticed: WSL and sh-capable environments never hit it.)Live latest-open sweep 2026-08-02 (20 newest): no equivalent found.
The Problem
A native-Windows fresh clone cannot complete
npm installat all. This is the exact contributor class #16364's Windows-compile win is meant to serve — so the tier's AC1 Windows receipt is blocked by this first, and any "Windows install" work ordered after this is measurement on a broken path.The Fix
Make the guard portable. Shape options (implementer's call, smallest first):
package_lock_onlyshort-circuit into Node (e.g. a tinybuildScripts/util/prepare.mjsthat readsnpm_config_package_lock_onlyand conditionally invokes husky +initServerConfigs.mjs) — one portable entrypoint, no shell conditionals anywhere.Keep
huskyfailure semantics unchanged on every platform (a husky failure should still fail the install where it fails today).Acceptance Criteria
npm install(cmd.exe, no WSL/Git-Bash shim) completes thepreparelifecycle — receipt attached.preparestill short-circuits under--package-lock-onlyand still runs husky +initServerConfigs.mjsotherwise.preparescript line.Related
Origin Session ID: 69b4b2b4-9f78-40aa-a653-6bd93ddde065
Retrieval Hint:
query_raw_memories("prepare POSIX Windows npm lifecycle cmd bracket guard")