Skip to content

Fix cleaning safety guards#30

Open
edufalcao wants to merge 1 commit intomomenbasel:mainfrom
edufalcao:security/cleaning-safety-fixes
Open

Fix cleaning safety guards#30
edufalcao wants to merge 1 commit intomomenbasel:mainfrom
edufalcao:security/cleaning-safety-fixes

Conversation

@edufalcao
Copy link
Copy Markdown

Summary

  • Fix item selection state so items that scan as not selected, especially large and old files, remain deselected unless the user explicitly opts them in.
  • Add a destructive confirmation gate for manual cleaning and snapshot the exact selected items at confirmation request time.
  • Restrict scheduled auto-cleaning to cache-like categories and keep personal-file/purgeable categories out of unattended cleanup.
  • Add XCTest coverage for selection semantics, scheduled-clean category policy, and manual cleaning confirmation behavior.

Safety notes

  • This change was prepared by an LLM coding agent, Codex, with human oversight.
  • Because this application can permanently delete local files, this PR should be reviewed and tested carefully before merging.
  • The cleaner still uses permanent deletion through FileManager.removeItem; this PR reduces accidental deletion risk but does not change deletion to Trash-based recovery.

Verification

  • xcodebuild test -project PureMac.xcodeproj -scheme PureMac -destination 'platform=macOS'
    • 9 tests executed, 0 failures, TEST SUCCEEDED.
  • xcodebuild build -project PureMac.xcodeproj -scheme PureMac -configuration Release -destination 'platform=macOS'
    • BUILD SUCCEEDED.
  • git diff --check
    • No whitespace errors.
  • Static searches checked for stale deselectedItems state, telemetry/network clients, credential handling, and destructive/process execution surfaces.

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