1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 19:05:07 +00:00
Commit Graph

223 Commits

Author SHA1 Message Date
Tw93
0c71ee9363 fix(main): preserve versioned app names and clean mise cache 2026-03-22 14:45:21 +08:00
Tw93
dca5bd5b0e chore(release): 1.31.0 2026-03-21 16:16:53 +08:00
Tw93
d6b9d9f3f3 Fix cleanup regressions and analyze navigation
Refs #605 #607 #608 #609 #610
2026-03-21 13:05:21 +08:00
Felix
82e25632e0 feat(status): alert on persistent high-cpu processes (#602)
* feat(status): alert on persistent high-cpu processes

* refactor(status): keep high-cpu alerts read-only

* fix(status): address lint and sudo test regressions

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-21 08:22:01 +08:00
Yuval Dinodia
7403f4d35e fix: pass through sudo's native prompt instead of hardcoding 'Password:' (#599)
* pass through sudo prompt instead of hardcoding Password:

* simplify: remove redundant retry loop, sudo handles retries internally

* keep stty safety net and styled prefix

* fix: clear clamshell sudo prompt lines correctly

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-21 07:33:44 +08:00
Tw93
546a5a292f test(core): fix shellcheck warnings in common bats 2026-03-21 07:18:28 +08:00
Tw93
584e10cdc4 fix(log): preserve Mole runtime logs during clean 2026-03-19 09:52:27 +08:00
Tw93
3b46b4ade6 fix(ui): use system sleep for inline spinner 2026-03-19 00:40:39 +08:00
Tw93
821a824d81 fix: dedupe cleanup previews by filesystem identity 2026-03-19 00:32:28 +08:00
Jason Costello
e617ed2e76 Fix: Removed duplicate calls to clean_xcode_tools and clean_code_editors (#593)
* removed duplicate calls to clean_xcode_tools and clean_code_editors

in lib/clean/app_caches.sh clean_user_gui_application() was making calls
to clean_xcode_tools and clean_code_editors.

in lib/clean/dev.sh clean_xcode_tools and clean_code_editors was also
being called, causing the duplication when executing the clean command.

removed the calls from lib/clean/app_caches.sh
clean_user_gui_application since these two calls are developer focused.

* test: cover removed developer app calls

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-19 00:25:49 +08:00
Tw93
06d2a3d029 fix: keep tealdeer tldr pages cache 2026-03-19 00:24:54 +08:00
Tw93
49c16a3450 Merge branch 'bugfix/fix-software-update-available-false-positive'
# Conflicts:
#	lib/check/all.sh
#	tests/clean_system_maintenance.bats
2026-03-18 15:05:37 +08:00
Tw93
90949f7fdf test(purge): fix glob quoting in path assertion 2026-03-18 14:55:26 +08:00
Tw93
5a2a5d9179 fix(uninstall): detect bundle-id-derived extension leftovers
Scan Application Scripts, Containers and FileProvider directories for
entries that share the app bundle-id prefix (e.g. share extensions,
file-provider extensions) so they are included in uninstall cleanup.
2026-03-18 14:54:59 +08:00
Tw93
fa935548b0 fix(optimize): warn before bluetooth refresh
Show "Bluetooth devices may disconnect briefly during refresh" before
actually restarting bluetoothd, so the user is not surprised by a
momentary disconnect.
2026-03-18 14:50:04 +08:00
Tw93
b8f3a0ecd3 fix(clean): avoid container cache scan stalls
Add a lightweight top-level entry cap to Containers and Group
Containers scanning.  When a cache directory exceeds the threshold,
skip the expensive per-item du/find size scan and take a partial-size
/ "cleaned" output path instead.  Replace find-piped-to-read loops
with pure-bash glob iteration to cut external process overhead.

Closes #586
2026-03-18 14:49:12 +08:00
Tw93
f88b2116ab fix(check): use softwareupdate output for macOS update detection
Replace LastRecommendedUpdatesAvailable defaults check with unified
softwareupdate -l --no-scan parsing.  Add caching layer and teach the
parser to distinguish macOS updates, Background Security Improvements,
Rapid Security Responses, and non-macOS entries so each gets an
accurate title in the output.

Fix reset_softwareupdate_cache() to also reset the in-memory
SOFTWARE_UPDATE_LIST_LOADED flag, and add a regression test.

Closes #585
2026-03-18 14:48:39 +08:00
corevibe555
2d8c938333 trust softwareupdate for macOS status and harden tests 2026-03-18 04:59:33 +01:00
root
e6ee9ec490 fix macOS update false positives 2026-03-18 03:15:39 +01:00
Tw93
25892594b0 fix: show full purge paths during confirmation
Fixes #576
2026-03-17 19:20:32 +08:00
Tw93
6c53906427 fix brew uninstall fallback consistency 2026-03-17 16:39:42 +08:00
Tw93
e1f427c9aa fix: stop cleaning aerial wallpaper assets by default 2026-03-17 16:35:10 +08:00
Tw93
ea4cd9d0e3 fix(tests): prevent permission dialogs during test runs
Add MOLE_TEST_MODE=1 checks to skip AppleScript osascript calls
and sudo operations that trigger system permission dialogs during tests:

- lib/check/all.sh: Skip login items listing
- lib/clean/apps.sh: Skip running app detection
- lib/clean/user.sh: Skip Finder trash operations and sudo test calls
- lib/core/log.sh: Skip sudo status check in debug log
- lib/uninstall/batch.sh: Skip login item removal

Also add MOLE_TEST_MODE=1 export to all test files that load
these modules to ensure consistent test isolation.
2026-03-16 20:43:35 +08:00
Tw93
30c1a95731 Harden test mode against auth and uninstall side effects 2026-03-15 12:19:50 +08:00
Tw93
7a0b4cf07e fix: move logs to ~/Library/Logs/mole, add system idle assets cleanup
- Move log files from ~/.config/mole/ to ~/Library/Logs/mole/ per
     macOS convention. Fixes #569.
   - Add safe_sudo_find_delete for /Library/Application Support/
     com.apple.idleassetsd/Customer/ screensaver videos. Closes #570.
   - Update tests to reflect new log file paths.
2026-03-15 11:38:18 +08:00
Tw93
45c98c2ec8 fix: explicitly skip system binary launch agents and harden test isolation
Add hint_is_system_binary() to short-circuit detection for plists that
use /bin/*, /usr/bin/*, /usr/libexec/* etc. as their program path.
These are custom scripts, not app-backed launch agents, so the stale
detection logic does not apply. Previously the function relied on the
absence of AssociatedBundleIdentifiers as an implicit skip, which could
fail on certain macOS plutil edge cases.

Also add teardown() in clean_hints.bats to explicitly remove the
LaunchAgents directory after each test, and add run_with_timeout mock
in the "skips custom shell wrappers" test to prevent mdfind from
influencing results. This eliminates the intermittent failure where
test 70 showed "Review:" in output without "Potential stale login item:".
2026-03-15 08:55:17 +08:00
Tw93
a61d959d7f Stabilize launch agent hint test 2026-03-14 22:56:31 +08:00
Tw93
2e6553ab2b Protect user launch agents during clean 2026-03-14 22:32:53 +08:00
Tw93
ba01cb7f43 test: fix parallel test flakiness and bash 3.2 empty-array expansion
- Fix 'bats_opts[@]: unbound variable' under set -u + bash 3.2: empty
  arrays must use ${arr[@]+"${arr[@]}"} idiom, not "${arr[@]}"
- Split core_performance.bats out of the parallel batch; run it after
  all parallel workers finish so wall-clock timing assertions aren't
  skewed by CPU contention from concurrent bats processes
- Raise MOLE_PERF_GET_INVOKING_USER_LIMIT_MS default 500→2000ms and
  add MOLE_PERF_SECTION_LIMIT_MS (default 2000ms) to give sufficient
  headroom without masking real regressions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-14 10:16:42 +08:00
Tw93
7697acb711 test: speed up bats execution 2026-03-14 09:19:54 +08:00
Dylan Joss
7350547458 feat: add JSON output tests and README docs for analyze and status (#556)
* feat: add JSON output tests and README docs for analyze and status

Add 7 BATS tests covering `--json` output for `mo analyze` and `mo status`:
- schema structure
- field types
- pipe auto-detection.

Also document the `--json` flag in a new "Machine-Readable Output" README section, including the auto-detection behavior when piped.

* chore: use waitgroup go in status collector

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-13 11:40:41 +08:00
c5d923cd48 fix(appli-support):using whitelist in application_support clean (#562)
* fix(appli-support):using whitelist in application_support clean

* fix: harden clash verge app support protection

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-13 11:38:37 +08:00
Nour
65b0db4e1c feat(clean): add opt-in Docker unused data pruning (#554)
* feat(clean): add opt-in Docker unused data pruning

* fix(clean): make docker prune default

---------

Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-10 16:20:40 +08:00
Tw93
af84d6f4be docs: strengthen public security signals 2026-03-10 15:31:07 +08:00
tw93
24da1e2ac1 fix(clean): speed up Python bytecode cache cleanup 2026-03-08 19:45:53 +08:00
tw93
2a36c662aa fix: tighten orphan cleanup retention windows 2026-03-08 15:33:30 +08:00
tw93
26b267c4a2 fix: harden orphan cleanup and lsregister fallback 2026-03-08 15:29:25 +08:00
tw93
50efe51565 fix(clean): guard empty Xcode DeviceSupport arrays 2026-03-07 23:10:41 +08:00
Tw93
42cc50d0fd test(purge): cover empty menu options path 2026-03-07 20:36:47 +08:00
Tw93
faf29b05f1 Fix perl timeout fallback selection 2026-03-07 20:36:34 +08:00
tw93
d189e1b84f test: fix update and cache cleanup cases 2026-03-07 20:03:11 +08:00
tw93
300aded07b fix(clean): avoid stalls in app support scan 2026-03-07 18:35:19 +08:00
Tw93
92ad46a396 fix(clean): harden project cache scans
Refs #541
2026-03-06 07:49:44 +08:00
Tw93
7e69a4eb71 clean orphaned Claude VM bundle
Fixes #537
2026-03-06 07:36:08 +08:00
Tw93
423c424f52 fix: gate main menu update action on update availability
Follow-up to #540.
2026-03-06 07:19:10 +08:00
tw93
f91975e5be Refine update/uninstall UX and stabilize brew flows 2026-03-05 17:46:05 +08:00
tw93
8e4b8a5e0d Improve update checks and cleanup UX, add timeout regressions 2026-03-05 12:00:07 +08:00
tw93
27a2cc5927 feat: show nightly channel in version output
Refs #517
2026-03-02 10:55:36 +08:00
tw93
241e6a7a34 fix(purge): avoid counting failed dry-run removals 2026-03-01 20:35:49 +08:00
陳德生
05446e0847 Add dry-run support across destructive commands (#516)
* chore: update contributors [skip ci]

* Add dry-run support across destructive commands

Implement dry-run for uninstall, purge, installer, touchid, completion, and remove flows.\nGuard side effects in uninstall path (launchctl, defaults writes, kill/brew actions), update help/README, and add coverage in CLI/Bats tests.\n\nValidation: ./scripts/check.sh and ./scripts/test.sh (452 tests, 0 failures, 8 skipped).

* test(purge): keep dev-compatible purge coverage

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-01 20:03:22 +08:00