Skip to content

fix(rules): include the macOS Chrome cache - #92

Merged
Muawiya-contact merged 2 commits into
Coding-Moves:mainfrom
be-student:fix/chrome-macos-cache
Sep 8, 2026
Merged

fix(rules): include the macOS Chrome cache#92
Muawiya-contact merged 2 commits into
Coding-Moves:mainfrom
be-student:fix/chrome-macos-cache

Conversation

@be-student

Copy link
Copy Markdown
Contributor

Fixes #88.

What & why

Adds Chrome's macOS ~/Library/Caches/Google/Chrome/<Profile>/Cache path to the existing safe browser-cache rule. This changes matching files from unknown to safe; a neighboring Chrome History path remains unknown in the regression coverage.

Checklist

  • cargo fmt --all and strict clippy pass for diskern-core and diskern-cli
  • All 59 core and CLI tests pass
  • Commit is one focused rule change
  • Deterministic verdict and quarantine-only safety principles remain intact

Chrome stores its regenerable cache under Library/Caches on macOS, outside both existing Windows and Linux patterns. Add the platform path while pinning a neighboring profile History file as unknown so the safe rule cannot drift into user data.

@Muawiya-contact Muawiya-contact left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, this is exactly right. Pattern's correct, and I like that you pinned the Application Support/History case so the rule can't creep into profile data later. Rebased it locally and ran the suite: clippy clean, 59 pass.

Two things:

  • Move your changelog line up to [Unreleased]. v0.2.0 went out today, so that ### Fixed block is now inside the released section. It rebases cleanly and lands in the wrong place without warning you.
  • Code Cache sits right next to Cache in that same folder and still comes out unknown, so it stays invisible in the report. Worth adding **/library/caches/google/chrome/*/code cache/** while you're in here, unless you'd rather keep this PR to one thing.

Second one's your call, the changelog isn't.

@Muawiya-contact Muawiya-contact left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing, sorry — same changelog issue is in #91 and #93. Both were branched before v0.2.0 went out, so all three need the line moved up to [Unreleased].

Could you sort those two as well when you get a chance? Easy to miss since git doesn't complain.

@be-student

Copy link
Copy Markdown
Contributor Author

Merged current main, moved the changelog entry to Unreleased, and included macOS Chrome Code Cache coverage in the rule, docs, and regression test. cargo test -p diskern-core passes (63 tests).

@Muawiya-contact Muawiya-contact left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All sorted. Changelog's in the right place, and you picked up Code Cache with a test case for it.

Leaving GPUCache out was the right call, by the way. On macOS it sits under Application Support next to the profile data, not in Caches, so a rule for it would be reaching into exactly what chrome_profile_data_is_not_safe_to_remove is there to stop.

Approved CI and ran it here too: 12 checks green, fmt and clippy clean, 63 tests pass.

Welcome to Coding Moves, and thanks for sticking with the back and forth on this one 🙌 You've got #91 and #93 open too — #93 just needs the changelog line moved, #91 needs one with_context and it's done.

After those, the issues here are labelled by difficulty if you want to keep going, and there are a few other Coding Moves repos worth a look.

And if you're enjoying the project, a ⭐ on the repo helps people find it 🚀

@Muawiya-contact
Muawiya-contact merged commit 27409cd into Coding-Moves:main Sep 8, 2026
12 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.

Chrome's macOS cache path matches no rule, so it never reaches the report

2 participants