Skip to content

Rules wanted: teach Diskern about the caches on your platform #71

Description

@Muawiya-contact

The rules database is thirteen rules. That is the whole of what Diskern
knows:

chrome-cache · firefox-cache · pip-cache · rust-target · node-modules
unix-system-logs · macos-user-logs · windows-crash-logs
installer-packages · temp-dirs
windows-driverstore · windows-winsxs · windows-installer-cache

Everything else on a disk classifies as unknown, and report::build
drops those — so for most people, most of what is actually eating their
space is invisible.

This is the contribution that needs the most people and the least
Rust.
A rule is JSON:

{
  "id": "npm-cache",
  "patterns": ["**/.npm/_cacache/**", "**/appdata/local/npm-cache/**"],
  "category": "package_manager_cache",
  "verdict": "safe",
  "description": "npm's download cache. Re-fetched on demand; removing it costs one slower install."
}

Things worth having, if you know where they live on your platform:

  • package managers — npm/pnpm/yarn, Go module cache, Gradle, Maven, Composer, NuGet, Homebrew
  • browsers — Edge, Safari, Brave, Chromium variants
  • creative apps with enormous caches — Adobe, DaVinci, Blender
  • IDEs — JetBrains, VS Code workspace storage, Xcode DerivedData
  • containers — Docker/Podman overlay and build caches

Read docs/RULES.md first — especially the
part on why review is the safer default and why rule order is a
safety property. The important rule about rules: safe means the user
loses nothing but time. If removing it loses state, history, licences or
credentials, it is review at most.

One rule per PR is perfect. A test in rules.rs showing the path you
mean to match, and one nearby path you mean not to match, makes it
easy to accept.

crates/diskern-core/rules/base.json

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededlevel: beginnerSmall and well-scoped; no deep context neededpriority: highCorrectness or safety — should land soonrulesThe safety rules database

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions