mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
Pre-sync backups followed merge-mode skill symlinks and copied the resolved content, so every snapshot duplicated the source — including gitignored artifacts still sitting on disk (model weights, .venv, browser profiles). Combined with retention that only ever ran on demand, backup directories grew without bound; one user reported 500 GB and sync failing with ENOSPC. A backup only needs to protect what sync can destroy: local content that exists in the target but not in the source. Symlinks point into the source, which is the single source of truth and already safe, and sync recreates them. copyDir already skips symlinks, so copyDirFollowTopSymlinks is deleted. Retention now runs after every automatic backup using the existing default policy — in global sync and in both agent sync paths, since project agent backups had the same unbounded growth. Two related defects surfaced while wiring this up: - Cleanup's size check could remove the newest snapshot, leaving no restore point at all when a single snapshot exceeded the cap. It now always keeps the newest. - A target holding nothing but symlinks produced an empty snapshot that consumed a retention slot and evicted snapshots that had content. Empty snapshots are now discarded. Behaviour change: restoring a merge-mode target recovers local content only; run `skillshare sync` afterwards to recreate symlinks. Copy mode is unaffected because those targets hold real files. Refs #252