Skip to content

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

Merged
Brad (bmethod) merged 3 commits into
mainfrom
ken-1423
Sep 13, 2026

Conversation

@bmethod

Copy link
Copy Markdown
Collaborator

Summary

  • hooks/block-unsafe-rm.sh refuses any rm with a variable-rooted path operand, including non-recursive commands and globs.
  • hooks/tests/block-unsafe-rm.test.sh covers the requested command shapes, their safe inverses, and the prior recursive-only rule as a must-fail control.
  • The existing tracked Claude and Codex hook renders carry the same change. This checkout has no tracked Agents or Pi copy of this hook.

Context

  • Hosted consumer audit: drovr, hyprtrade, hyprtrade-io, kendex, kendex-web, memsira, vg, vgs and vsys render block-unsafe-rm per .kendex-generated.json; dotfiles does not; the registered scratch project is absent. The dotfiles owner must declare the hook in /home/method/dotfiles/kendex.toml and run kendex refresh.

Completed Issues

  • Closes 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

Test Plan

  • Run hooks/tests/block-unsafe-rm.test.sh against the fixed hook.
  • Restore the prior recursive-only expression in an isolated copy and confirm the new rows fail.
  • Run .agents/skills/preflight/scripts/preflight --base origin/main --repo /home/method/dev/.worktrees/kendex/ken-1423.
  • Run env -u TMPDIR tools/guard --full.

Copilot AI balanced review requested due to automatic review settings September 13, 2026 18:30
@linear-code

linear-code Bot commented Sep 13, 2026

Copy link
Copy Markdown

KEN-1423

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.

Comment thread hooks/block-unsafe-rm.sh

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread hooks/block-unsafe-rm.sh
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T18:34:43.610978Z 2fc3fe8 PR opened
ℹ️ About Codex in GitHub

Your 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.

@bmethod

Copy link
Copy Markdown
Collaborator Author

Completed Issues

  • Closes 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

Recommendations Processed

Fixed in PR

  • external-claude: Rewrite examples added recursive flags that the refused command did not contain. - b403d95
  • external-claude: Test labels still described the removed recursion requirement. - b403d95
  • branch-size-check: Nonessential test commentary exceeded the declared test-line allowance. - 2fc3fe8

Skipped

  • copilot-pull-request-reviewer: Extend the lexical scanner through redirections. - The harness still blocks the named commands before execution, so this is not a fail-open safety or data-loss path.
  • chatgpt-codex-connector: Scan past redirections to later operands. - The harness still blocks the named commands before execution, so this is not a fail-open safety or data-loss path.

Fix rounds: 2 | Local review, focused re-review, formal review, and CI passed.

@bmethod
Brad (bmethod) added this pull request to the merge queue Sep 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 13, 2026
@bmethod
Brad (bmethod) added this pull request to the merge queue Sep 13, 2026
Merged via the queue into main with commit 537f216 Sep 13, 2026
54 checks passed
@bmethod
Brad (bmethod) deleted the ken-1423 branch September 13, 2026 19:35
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.

2 participants