fix(KEN-1423): block-unsafe-rm refuses any rm on a variable-rooted path, not only a recursive one: the harness prompt it prevents fires on both and stalls an unattended lane - #2622
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Redirections before variable-rooted operands still bypass the hook and can stall unattended lanes.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Expands block-unsafe-rm to reject non-recursive variable-rooted deletions across supported harnesses.
Changes:
- Removes the recursive-flag requirement.
- Adds non-recursive and glob test cases.
- Synchronizes Claude and Codex renders.
File summaries
| File | Description |
|---|---|
hooks/block-unsafe-rm.sh |
Broadens refusal logic and guidance. |
hooks/tests/block-unsafe-rm.test.sh |
Adds coverage for new command shapes. |
.codex/hooks/block-unsafe-rm.sh |
Updates the Codex render. |
.claude/hooks/block-unsafe-rm.sh |
Updates the Claude render. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2fc3fe8557
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Completed Issues
Recommendations ProcessedFixed in PR
Skipped
Fix rounds: 2 | Local review, focused re-review, formal review, and CI passed. |
Summary
hooks/block-unsafe-rm.shrefuses anyrmwith a variable-rooted path operand, including non-recursive commands and globs.hooks/tests/block-unsafe-rm.test.shcovers the requested command shapes, their safe inverses, and the prior recursive-only rule as a must-fail control.Context
block-unsafe-rmper.kendex-generated.json; dotfiles does not; the registered scratch project is absent. The dotfiles owner must declare the hook in/home/method/dotfiles/kendex.tomland runkendex refresh.Completed Issues
Test Plan
hooks/tests/block-unsafe-rm.test.shagainst the fixed hook..agents/skills/preflight/scripts/preflight --base origin/main --repo /home/method/dev/.worktrees/kendex/ken-1423.env -u TMPDIR tools/guard --full.