Retention
RetentionPlanner.plan is pure over [SnapshotSummary]. Preview in UI must use the same function the store executes.
- Newest snapshot is never deleted. Without it there is nothing to compare against.
- Default policy: 90 days, 1 GiB, protects pinned and labelled snapshots.
- Empty labels are not protection.
protectsLabelled/protectsPinnedcan be turned off. - Protected snapshots do not consume the count/size quota.
- Age is applied before count/size so the reason stays
tooOldwhen both apply. SnapshotService.captureruns retention after save so the new snapshot always survives a tight limit.
Tests: Tests/Domain/RetentionPlannerTests.swift and retention invariants.