Skip to content

feat(analyze): Mole parity B2 — batch delete, overview/insights, scan cache (P9–P11) - #4

Merged
baroitrung merged 3 commits into
mainfrom
quaqua/mu-integ
Oct 26, 2026
Merged

baroitrung merged 3 commits into
mainfrom
quaqua/mu-integ

Conversation

@baroitrung

Copy link
Copy Markdown
Owner

B2 of the Mole parity plan (docs/plans/active/mole-parity.md), P9 → P11.

  • P9 0bdf9ff: multi-select, batch delete with re-lstat → whitelist → trash → oplog, name filter
  • P10 72fe21b: Overview start screen, insights, cleanable badges, R/O/P/F actions
  • P11 a8bf7b8: versioned scan cache under $XDG_CACHE_HOME/mu/analyze; R and delete invalidate it, --json is always fresh

Verification (on a8bf7b8)

  • make test: 467 unit + 59 integration, 0 failed
  • make lint (clippy -D warnings): clean
  • tests/golden unchanged

Known follow-ups (not blocking)

  • The P11 cache stores the full tree (7.6 MB for this repo), and --json writes a cache it never reads. Fix: a size guard, or skip saving on bypass.
  • CleanTarget has no roots field, so the badge roots are enumerated separately. If they drift, only the badges are wrong; nothing gets deleted.

from therealTINHTUTE with love ❤️❤️❤️

…actions (Phase 10)

- Add overview view mode in AnalyzeTui with 4 locations (Home, Downloads, User Cache, Root)
- Add hidden-space insights rows (old downloads >90 days pointer to mu installer, cleanable artifacts)
- Add [cleanable] badges for node_modules, target, .venv, dist, CACHEDIR.TAG excluding mu clean roots
- Derive clean target roots from built-in clean targets list (src/clean/targets.rs)
- Implement actions: R (rescan), O (open dir via xdg-open), F (reveal file via xdg-open), P (text preview modal)
- Enforce GUI safety: refuse xdg-open when DISPLAY/WAYLAND_DISPLAY are absent with informative message
- Route external commands through Runner (ProcessRunner / FakeRunner)
- Fix folded-in Phase 9 navigate_up filter restore issue with regression test
- Retain exact byte-level non-TTY and --json contracts and empty golden diff
… 11)

- Add `src/analyze/cache.rs` keyed by schema version and canonical root path
- Use atomic write via temporary file and rename on same filesystem
- Ignore relative `XDG_CACHE_HOME` falling back to standard cache dir via `crate::xdg::cache_home()`
- Treat read errors, corrupt files, and schema mismatches as cache misses
- Derive `Deserialize` on `FileNode` and `ScanStats` with serde defaults for non-serialized fields
- Support cache bypass in walker and ensure `--json` always scans fresh
- Invalidate affected root cache on single delete, batch delete, and 'R' rescan in AnalyzeTui
- Add unit tests for roundtrip, corrupt file, schema mismatch, invalidation, relative XDG_CACHE_HOME, and fresh JSON scan
@baroitrung
baroitrung merged commit 261aee9 into main Oct 26, 2026
0 of 2 checks passed
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