Add PreserveTildeOnSave config flag (default false). When enabled, the
Save path folds $HOME prefixes back to ~ when serializing the in-memory
Config to YAML so the on-disk config stays portable across machines
(e.g. when shared via dotfiles).
The in-memory Config is left untouched; cloneForSave() produces a
shallow copy with path fields rewritten. Mirrors the existing
expandPath() calls performed in Load():
- cfg.Source, cfg.ExtrasSource
- cfg.Targets[*].Path / Skills.Path / Agents.Path
- cfg.Extras[*].Source and Extras[*].Targets[*].Path
Adds:
- utils.FoldHomePath() helper with unit tests (exact-home, child,
sibling-non-home, unrelated-abs, relative, Windows case-insensitive)
- 3 Save-path tests covering default-off, fold-on, and Load→Save
idempotency.
Default off keeps the change backward compatible: existing users see no
behavior difference. Users who share their config via dotfiles can opt
in with:
preserve_tilde_on_save: true
filepath.Walk/WalkDir silently skip symlinked root directories because
os.Lstat sees the root as a non-directory symlink and never enters it.
This affected update, uninstall, reconcile, and server handlers when
the source directory was a symlink (common with dotfiles managers).
Extract ResolveSymlink() from sync.go into internal/utils/path.go and
apply it at every filepath.Walk/WalkDir callsite on source/target dirs.
Also add containment guards to resolveGroupSkills (uninstall) and
resolveGroupUpdatable (update) to reject group directories that are
symlinks pointing outside the source tree.
- Add detailed error messages when junction/symlink creation fails
- Pre-flight checks for source existence and target conflicts
- Capture mklink /J stderr output
- Show both junction and symlink failure reasons
- Add case-insensitive path comparison for Windows (NTFS)
- New PathsEqual() and PathHasPrefix() in utils/path.go
- Fix 8 path comparisons that could fail due to case differences
- Affects sync, pull, target remove, diff, and doctor commands