Skip to content

fix(rules): anchor system var tmp paths - #93

Merged
Muawiya-contact merged 3 commits into
Coding-Moves:mainfrom
be-student:fix/anchor-var-tmp
Sep 8, 2026
Merged

fix(rules): anchor system var tmp paths#93
Muawiya-contact merged 3 commits into
Coding-Moves:mainfrom
be-student:fix/anchor-var-tmp

Conversation

@be-student

Copy link
Copy Markdown
Contributor

Fixes #81.

What & why

Anchors the actionable var/tmp rule to Linux /var/tmp and macOS /private/var/tmp. User, project, and Homebrew var/tmp paths now remain unknown instead of being offered for quarantine.

Checklist

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

The recursive var/tmp glob also matched user projects and Homebrew state, exposing them as actionable temporary files. Restrict the rule to the Linux and macOS system roots and pin both intended and excluded paths in 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.

This one's spot on. Mirroring unix-system-logs is the right shape, and you covered all four cases from the issue plus the macOS path. Rebased and ran it here: fmt, clippy and 57 tests all clean.

Only outstanding thing is the changelog line, same as the other two.

@be-student

Copy link
Copy Markdown
Contributor Author

Merged current main and moved the changelog entry to Unreleased. cargo test -p diskern-core passes (61 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.

Changelog's in the right place now, and the rule itself was already right. Ran it here: fmt, clippy and all tests pass.

There's a small conflict on CHANGELOG.md — #92 landed a ### Fixed bullet on the same line yours goes on. Nothing for you to do, both lines just want keeping and I'll sort it on merge. Everything else auto-merges clean, and I checked the combined result builds and passes.

Approved.

Signed-off-by: Muawiya Amir <contactmuawia@gmail.com>
@Muawiya-contact
Muawiya-contact merged commit 3c1f20b 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.

Rule temp-dirs still reaches a user's own var/tmp

2 participants