A project config can name any YAML file in sources.mcp. A cloned
repository could point it at a file outside the project, such as the
global config or the global MCP source, and the next project-mode MCP
change or 0.23.0 migration rewrote that file. Saves now check the
external source against the project root, as config.yaml already is.
Reading a shared file outside the project still works.
The check also needs the right root. Deriving it from the external
file's path would accept a sibling of the project, so the root is now
passed in. A global config acting for a project in mcp.projects is no
longer treated as a project config, so a dotfile link to it keeps
working instead of being refused.
The containment check appended a separator to the project root. For a
project at / or C:\ the root already ends with one, so the prefix became
// or C:\\ and every save of that project's config was refused as
linking outside the project.
ConfigWritePath followed only one hop of a dangling link and resolved
only an existing parent directory. A project link to an in-project
link pointing outside, or to a missing file under an in-project
directory link that leaves the project, passed the containment check,
and the save then wrote or created the file outside the project.
Follow every link of a dangling chain, with a hop limit, and resolve
symlinks in the longest existing prefix of each path so a missing
directory cannot hide an escaping link above it.
Saves follow a symlinked config.yaml to its target so dotfile links
survive. For a project config that also lets a cloned repository point
.skillshare/config.yaml at any file the user can write, including one
that does not exist yet, and every project save, plugin change, hooks
change, MCP change, or legacy migration would then rewrite or create it.
All five writers now resolve the destination through one helper,
utils.ConfigWritePath. A global config keeps writing through its link.
A project config must resolve inside its project; otherwise the save
fails and names the link so the user can replace it with a regular
file. The one-time legacy migration skips persisting instead, and the
next save reports the link.
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