Files
skillshare/internal
Willie 98c1af18b3 fix(backup): back up only local target content, prune snapshots automatically
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
2026-07-30 00:55:41 +08:00
..
2026-06-05 13:56:07 +08:00
2026-04-14 18:16:11 +08:00