fix(secure-state): skip directory fsync on Windows (unsupported, blocks install)
writePrivateJson fsyncs the parent directory handle after the atomic rename. Windows does not support fsync on a directory handle — FlushFileBuffers on a directory handle returns ERROR_ACCESS_DENIED, which Node surfaces as `EPERM: operation not permitted, fsync`. This throws on the very first key write, so `agent-config-init.mjs` / `murmur-join.mjs` cannot complete and Murmur cannot be installed on Windows at all. The key file itself is already fsync'd above the rename; the directory fsync is a best-effort durability nicety. Guard it behind `process.platform !== 'win32'`: POSIX behaviour is byte-identical, Windows skips only the unsupported call. Verified on Windows 11 / Node 24.13.1: `murmur-join.mjs` completes and writes agent-config.json where it previously threw EPERM at secure-state.mjs:90. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
S
Stanislav Glazov committed
d5d543f8cac15d0fc6bebebd2c884653aa4d3711
Parent: 7208903