Trash retention sweep: auto-purge entries past their window #77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Salvaged from the stale
feat/onboarding-settingsbranch before deleting it (commit5302948 feat(trash): retention sweep — auto-purge old entries). It is the one idea on that branch with no equivalent on main.Today (#63) retention is passive: it blocks purging inside the keep window, but nothing ever purges afterwards — trash grows forever until someone empties it by hand. The sweep is the other half: a background janitor that deletes trash entries whose retention window has expired (and, for paths with no retention policy, entries older than a configurable default).
Sketch: ticker in
internal/storage/trash(hourly, plus once at startup), walks/.trash/*/, reads each sidecar, purges whendeletedAt + max(retentionFor(path), trash.autoPurgeAfter)has passed. Configstorage.trash.autoPurgeAfter(empty = never auto-purge, preserving today's behavior). Purges must respect legal holds and emit audit events (#61) so a disappearing file is always explainable.Wants its own greenlight — auto-deletion is exactly the kind of thing that should be opt-in and deliberate.
Cordy referenced this issue2026-07-30 04:28:20 +00:00