feat(clean): add dirs_cleaner cleanup command#927
Conversation
|
@richardgetz Thanks for the very careful work and the detailed safety thinking. I am going to close this PR in its current shape because the explicit cleanup path is too risky for Mole’s current boundary. The report-only audit idea for If you want to continue this, the mergeable shape would be a much smaller PR that only adds a read-only audit: no deletion command, no |
|
It started as read-only, but I added the explicit cleanup for others assuming that would be the end goal for anyone else facing stuck "to be deleted" files. Is the expectation to never clean out system files that are meant for deletion? Tbh not worth my time if the tool isn't managing the deletion. Best of luck! |
Summary
/private/var/dirs_cleanerduring normal system cleanup and report suspicious stuck cleanup staging without deleting by defaultmo clean --dirs-cleanercommand with--dry-runsupport for deliberate stale staging cleanupWhy this is safe
mo cleanremains report-only for dirs_cleaner findings/private/var/dirs_cleaneritselfsafe_sudo_removepath, with a dirs_cleaner-specific validation contextTesting
bash -n bin/clean.sh lib/clean/system.sh lib/core/file_ops.sh lib/core/help.sh tests/clean_system_maintenance.bats tests/core_safe_functions.bats tests/cli.batsgit diff --check main...HEADGOPATH=/private/tmp/mole-gopath GOMODCACHE=/private/tmp/mole-gopath/pkg/mod GOCACHE=/private/tmp/mole-gocache ./scripts/check.sh --no-formatGOPATH=/private/tmp/mole-gopath GOMODCACHE=/private/tmp/mole-gopath/pkg/mod GOCACHE=/private/tmp/mole-gocache go test ./cmd/...GOPATH=/private/tmp/mole-gopath GOMODCACHE=/private/tmp/mole-gopath/pkg/mod GOCACHE=/private/tmp/mole-gocache MOLE_GO_TEST_CACHE=/private/tmp/mole-go-build-cache ./scripts/test.shNote:
bats,shellcheck, andshfmtwere not installed in this environment; the repo scripts skipped/fell back as designed.