Skip to content

fix: ignore Hermes transient cleanup in deletion correlation - #178

Open
cresslank wants to merge 6 commits into
sheeki03:mainfrom
cresslank:fix/hermes-snapshot-cleanup
Open

fix: ignore Hermes transient cleanup in deletion correlation#178
cresslank wants to merge 6 commits into
sheeki03:mainfrom
cresslank:fix/hermes-snapshot-cleanup

Conversation

@cresslank

@cresslank cresslank commented Aug 2, 2026

Copy link
Copy Markdown

Summary

  • Ignore shell redirection tokens such as 2>/dev/null when deriving delete operands.
  • Classify Hermes hermes-snap-*.sh.tmp.* environment snapshots under OS temp roots as generated artifacts.
  • Classify files inside hermes_sandbox_* execute-code directories under OS temp roots as generated artifacts.
  • Keep similarly named authored files outside temp roots in mass-deletion correlation.

Problem

Hermes removes these generated artifacts during normal terminal and execute-code operations. Parallel agent work could otherwise accumulate enough non-build deletions to trigger mass-file-deletion correlation and block unrelated operations.

The exemption is deliberately constrained to /tmp, /private/tmp, /var/tmp, macOS /var/folders, and Windows drive Temp roots. It does not exempt similarly named project files or directories.

Validation

  • cargo fmt --check
  • cargo test -p tirith-core --lib (2931 passed, 1 ignored)
  • cargo clippy -p tirith-core --all-targets -- -D warnings
  • release build installed locally
  • four concurrent Hermes execute-code sandboxes completed without triggering deletion escalation
  • regression tests cover POSIX, macOS, Windows, empty suffixes, and authored paths outside temp roots

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 23fcb1fd-3f01-455b-a205-5b8f68553284

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

// failure. These are generated session artifacts, not authored files, and
// must not contribute to the mass-file-deletion correlation.
let basename = path.rsplit(['/', '\\']).next().unwrap_or(path);
basename.starts_with("hermes-snap-") && basename.contains(".sh.tmp.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Hermes exemption hides authored deletions

When authored files anywhere in the filesystem have basenames beginning hermes-snap- and containing .sh.tmp., this basename-only check classifies them as build artifacts, excluding them from the non-build deletion count and allowing a destructive burst to remain below the mass-file-deletion threshold. How this was verified: The predicate feeds the non-build count summed by the critical correlation without checking the file's directory or provenance.

@cresslank
cresslank force-pushed the fix/hermes-snapshot-cleanup branch from 88ee3f1 to 6a43702 Compare August 3, 2026 19:53
@cresslank cresslank changed the title fix: ignore Hermes snapshot cleanup in deletion correlation fix: ignore Hermes transient cleanup in deletion correlation Aug 3, 2026
@cresslank

Copy link
Copy Markdown
Author

Updated the branch to cover Hermes execute-code sandboxes and addressed the review concern by constraining all Hermes artifact exemptions to OS temp roots. Full tirith-core tests and clippy pass.

@cresslank

Copy link
Copy Markdown
Author

Follow-up: parallel Hermes workers also delete the final hermes-snap-*.sh snapshot when they exit. d8780db classifies that final form, still only under recognized OS temp roots; authored lookalikes remain covered by negative tests. The full tirith-core suite remains green (2,931 passed, 1 ignored), with clippy clean.

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