- Fix Messages running check to not skip CrashReporter/idleassetsd cleanup
- Add proper spacing between function definitions
- Add app_support_item_size_bytes() for accurate size calculation
- Improve progress reporting during Application Support scan
Replace du traversal + double find with single find -print0 + stat -f%z
to eliminate 8+ minute hang on directories with 392K files. Add progress
feedback via update_progress_if_needed in the outer loop.
The dry-run mode hardcoded SYSTEM_CLEAN=false, which meant
the entire system section was silently skipped during preview.
Users had no way to see what /Library/Caches, /private/var/log,
diagnostics, or other sudo-required paths would be cleaned.
Now dry-run checks for a cached sudo session (sudo -n) and
includes the system preview when available. When sudo isn't
cached, a hint tells the user how to get the full preview
without running the whole script as root.
- reduce noisy scan output outside debug mode
- consolidate final result messaging
- run xcode/code editor stages explicitly in developer flow
- update dev cache tests for new stage calls
- replace direct delete patterns with safe_sudo_find_delete/safe_sudo_remove
- keep log/temp/diagnostic cleanup behavior with guarded scans
- align system maintenance tests with safe deletion flow
- reorganize perform_cleanup sections and naming
- merge macOS + sandbox caches into clean_app_caches
- move recent items and mail downloads into user essentials
- update core/user tests for renamed internal helpers
- Replace ls with find -maxdepth 1 to reduce IO and permission noise
- Keep same behavior: silently skip if directory is empty or inaccessible
Addresses: user.sh (line 484)
- Normalize npm cache paths with pwd -P to handle symlinks and
trailing slashes, preventing duplicate scans of same directory
- Add declare -f check before calling clean_maven_repository for
robustness when dynamic source fails
- Add test for trailing slash handling
Addresses: dev.sh (line 27, 48, 602)
- Save caller's INT/TERM traps before installing local cleanup trap
- Restore original traps after clean_project_artifacts completes
- Add test to verify trap restoration behavior
Fixes P3 issue: project.sh (line 825, 870)