Performance improvements:
- Merge 3 separate find operations into 1 for /Library/Caches
- Combine *.cache, *.tmp, *.log patterns in single scan
- Reduces filesystem traversal overhead
- Merge 2 find operations into 1 for /private/var/log
- Combine *.log and *.gz patterns
- Optimize diagnostics cleanup with single combined scan
- Merge Special, Persist, and tracev3 patterns
- Reduces redundant directory traversal
- Use find -delete for batch removal of memory exception reports
- More efficient than iterative removal for large file counts
- Add summary logging to operations.log
UI improvements:
- Add granular spinner messages for each cleanup stage
- Separate diagnostic logs and power logs output for clarity
- Add progress feedback during Time Machine status check
Tests:
- Update sudo mock functions to support new combined find patterns
- Verify find -delete usage for memory exception cleanup
- Update assertions to match optimized implementation
- Export MOLE_DRY_RUN env var for subprocess visibility
- Add || true to grep commands to prevent pipeline failures
- Add dry-run test for clean_orphaned_system_services
- Simplify clean_local_snapshots tests