Two runtime bugs discovered after merging the idempotent init PR.
Bug 1: mosaic wizard — EACCES on same-path sync (file-ops.ts)
EACCES: permission denied, copyfile '.git/objects/pack/pack-XXX.idx' -> same path
Cause:syncDirectory called where sourceDir === mosaicHome. It copied every file onto itself; git pack files are read-only (0444), so copyFileSync fails.
Also:excludeGit only matched top-level .git — nested dirs like sources/agent-skills/.git were still traversed.
Fix (packages/mosaic/src/platform/file-ops.ts):
Early return when resolve(source) === resolve(target)
Two bugs causing 'EACCES: permission denied, copyfile' when source
and target are the same path (e.g. wizard with sourceDir == mosaicHome):
1. No same-path guard — syncDirectory tried to copy every file onto
itself; git pack files are read-only (0444) so copyFileSync fails.
2. excludeGit only matched top-level .git — nested .git dirs like
sources/agent-skills/.git were copied, hitting the same permission
issue.
Fixes:
- Early return when resolve(source) === resolve(target)
- Match .git dirs at any depth via dirName and relPath checks
- Skip files inside .git/ paths
Added file-ops.test.ts with 4 tests covering all cases.
git pull --rebase fails with 'cannot pull with rebase: You have
unstaged changes' when the skills repo has local modifications.
Fix: detect dirty index/worktree, stash before pull, restore after.
Also gracefully handle pull failures (warn and continue with existing
checkout) and stash pop conflicts.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #355
Two runtime bugs discovered after merging the idempotent init PR.
Bug 1:
mosaic wizard— EACCES on same-path sync (file-ops.ts)Cause:
syncDirectorycalled wheresourceDir === mosaicHome. It copied every file onto itself; git pack files are read-only (0444), socopyFileSyncfails.Also:
excludeGitonly matched top-level.git— nested dirs likesources/agent-skills/.gitwere still traversed.Fix (
packages/mosaic/src/platform/file-ops.ts):resolve(source) === resolve(target).gitdirs at any depth (not just top-level).git/pathsTests (
packages/mosaic/__tests__/platform/file-ops.test.ts):.gitexclusion.gitcopied whenexcludeGit: falseBug 2:
mosaic sync— dirty worktree breaks pull (mosaic-sync-skills)Cause: Bare
git pull --rebasewith no dirty-tree handling.Fix (
packages/mosaic/framework/tools/_scripts/mosaic-sync-skills):git diff --quietTesting
@mosaic/mosaicbumped to0.0.3-1