Skip to content

fix(cli): init creates its files where hard links are refused, with no Developer Mode needed - #6463

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/cli-win-create-file
Oct 26, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/cli-win-create-file

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

writeNewFileSync (the helper init uses to create hyperframes.json and its other new files) now publishes through core's createFileAtomically, which already falls back to an exclusive create when hard links are refused.

Why

init failed on Windows with EPERM on link creation. writeNewFileSync published each file with linkSync and only tolerated EEXIST, so a volume or sandbox that refuses hard links (FAT/exFAT, restricted workspaces) stopped the scaffold. The fallback already existed in core; this was a second, weaker copy of it. No Developer Mode or admin needed.

Why under 100 lines

Windows launch fix, asked for directly; it deletes a copy of existing logic.

Tests

New case: a linkSync that throws EPERM still creates hyperframes.json with the right bytes and leaves no staging files. It fails on main (Error: operation not permitted) and passes here; the 90 tests in projectConfig.create, projectConfig and init pass.
Not run on a real Windows machine: none was reachable.

@miguel-heygen
miguel-heygen force-pushed the fix/cli-win-create-file branch from b6231d7 to ea99169 Compare October 26, 2026 18:14
@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 113 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (3)

  • seqplainkeys-none-px-r0-nested-z100: tracking 0.07, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.07, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.07, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true
  • seqplainkeys-none-pct-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true
  • seqplainkeys-none-pct-r0-nested-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits

Scope

Read both files and core's createFileAtomically. It keeps the old guarantees: link and the fallback's open("wx") both refuse an existing entry and don't follow a dangling link, and EEXIST is still swallowed. Temp siblings match isAtomicTempPath, so the studio watcher skips them. Checked all four writeNewFileSync callers. With main's writeNewFile.ts the new EPERM test fails; at this head it passes locally, along with projectConfig.test.ts. All Actions runs on this head are green.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 6dee9d1 Oct 26, 2026
70 checks passed
@miguel-heygen
miguel-heygen deleted the fix/cli-win-create-file branch October 26, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant