Skip to content

feat: catalog breadth — curated dev/app caches + process guards - #3

Open
gor3a wants to merge 3 commits into
mainfrom
feat/catalog-breadth
Open

feat: catalog breadth — curated dev/app caches + process guards#3
gor3a wants to merge 3 commits into
mainfrom
feat/catalog-breadth

Conversation

@gor3a

@gor3a gor3a commented Aug 18, 2026

Copy link
Copy Markdown
Owner

What

Refines dscan's cache catalog from a coarse blind sweep into a curated, tiered set, and adds a running-process guard.

  • Rules: removed the broad ~/Library/Caches (macOS) and ~/.cache (Linux) Safe sweeps; replaced with curated SAFE dev-cache subdirs (Xcode DeviceSupport/Archives, go-build, Homebrew, Yarn, CocoaPods, SwiftPM, Playwright, pip, uv, node-gyp, cargo/git) and REVIEW app-cache rows (Spotify/Slack/Teams/Zoom/Discord/Figma/Obsidian/Notion/Claude/ChatGPT + Chrome cache subdirs). New Entry.GuardProcess + guarded().
  • Engine: one ps snapshot per scan (fail-open) downgrades a guarded entry (Xcode DerivedData) to KEEP while its tool runs; isDescendant suppresses any nested catalog path so nothing double-counts.

Why refine, not append

An adversarial review found the naive additive approach unsound: app-cache dirs nest under the broad ~/Library/Caches Safe row, so their "REVIEW → Trash → recoverable" promise was illusory (the parent rm -rf'd them) and bytes double-counted. Curated rows with no broad parent fix this. Trade-off: unlisted caches are no longer blind-swept (Mole's curated model) — safer, legible, recoverable.

Safety

  • Browser rows target cache subdirs only — never a profile root, Cookies, Login Data, History, Bookmarks, Local Storage, Local State (asserted by a denylist test).
  • App-caches are REVIEW → Trash (recoverable). Dropped ~/go/pkg/mod (read-only files → os.RemoveAll EACCES) and ~/.docker/buildx (not the build cache).

Tests

go build + go vet + go test ./... → 91 pass. New tests: catalog breadth/denylist/dup (darwin+linux), procs units, and a real ScanAll guard test via an injected snapshot seam.

gor3a added 3 commits August 4, 2026 14:26
dscan is now a sibling of dotai instead of nested under it, shifting
the relative path to the upstream powersched CLI source.
Remove the broad ~/Library/Caches and ~/.cache SAFE rows; replace with
curated SAFE dev-cache subdirs and REVIEW (Trash, recoverable) app-cache
rows. Add Entry.GuardProcess + guarded() so high-churn caches lock while
their tool runs. Browser rows target cache subdirs only, never a profile
root or cookies/history.
One ps snapshot per scan (fail-open); guarded entries downgrade to Keep
while their process runs. Skip a catalog path nested under an already
covered path so no row double-counts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant