Skip to content

fix(#1053): copy-mode sync replaces foreign scripts/dev symlinks - #1111

Merged
admarble merged 4 commits into
mainfrom
feature/1053-fix-sync-copy-mode-sync-leaves-existing-machine-sp
Sep 20, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/1053-fix-sync-copy-mode-sync-leaves-existing-machine-sp

Conversation

@admarble

@admarble admarble commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • copyDir called writeFile on an existing scripts/dev symlink, which follows links: the link stayed and its target (npx cache or a sibling dev checkout) was overwritten. It now unlinks symlinks first; in the scripts/dev copy branch regular files are kept unless force.
  • previewScriptsSymlinkTargets reports old → (copy) in copy mode; doctor names the fix that changes the link.

Acceptance criteria

  • AC-1: symlink replaced by a copy, target untouched; regular file kept without --force (replaces a foreign symlink)
  • AC-2: doctor hint is npm install sequant --save-dev && sequant sync without a local install, sequant sync with one; no --force
  • AC-3: sync --dry-run lists old → (copy) (copy mode preview + real-fs preview test)
  • AC-4: full npm run build && npm test left to the runner per the runner-context comment; build and lint pass locally, the three named test files pass (176/176)

Mutation-verified: AC-1 — removed the symlink unlink in copyDir; src/lib/templates.test.ts > templates > scripts/dev symlink target routing (#990) > copy mode over existing scripts/dev entries (#1053) > replaces a foreign symlink failed; restored.

Mutation-verified: AC-3 — copy-mode preview returned no entries; src/lib/templates.test.ts > templates > scripts/dev symlink target routing (#990) > copy mode over existing scripts/dev entries (#1053) > previewScriptsSymlinkTargets reports old → (copy) for a foreign link and nothing for a regular file failed; restored.

Notes for the owner

Closes #1053

🤖 Generated with Claude Code

Runner verification (guard-2026-09 wave 1, 2026-09-20)

@admarble
admarble merged commit 5c83983 into main Sep 20, 2026
8 checks passed
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.

fix(sync): copy-mode sync leaves existing machine-specific scripts/dev symlinks in place, and doctor's hint loops back to sync

1 participant