Repository navigation
Labels
agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.status: readyTriaged, unblocked, and fully specified; eligible to pick up.
Description
Refs #5683. Slice 2 of 2 (parallel with slice 1).
Problem
The 2026-10-20 overengineering audit (comment on #5683) measured three destructive-operation guards whose blocks are mostly false positives:
- disk-hygiene destructive guard. Its Bash registration is
"if": "Bash(*hygiene.py*)"(plugins/disk-hygiene/hooks/hooks.json). 648 of 649 recorded denies are rulenot-exact-engine-command, mostly reads of the plugin's own source:grep,sed,gh pr diff, or a heredoc whose text names the engine script. The filter matches any command line that contains the file name. - guardrails
block-dangerous-git. 24 blocks, mostlygit reset --hardandgit clean -finside disposable scratch repositories an agent created. - guardrails
block-root-delete-target. 192 blocks, mostlyrm -rf "$S"whereSwas assigned a literal scratch path earlier in the same command line. No sampled block prevented a harmful delete.
Fix
Narrow each matcher; never widen what it allows outside the cases named here.
- disk-hygiene: make the guard act only on a command that invokes the engine (an interpreter followed by the engine script path as its program argument), and stay quiet for commands that only read or mention the file.
block-dangerous-git: allowreset --hardandclean -fwhen the target repository's top level resolves under the system temp directory ($TMPDIRor/tmp). Everything else stays blocked.block-root-delete-target: resolve a variable assigned a literal path earlier in the same command line before judging the delete target. An assignment that is not a literal, or one the command can change before the delete, stays unresolved and blocks as today.
Each change follows the hook-precision convention (docs/conventions/hook-precision/README.md): a stay-quiet test that fails before the fix, plus a still-blocks test for the dangerous neighbour of each shape.
Done when
- A stay-quiet test for each shape above fails on
origin/mainand passes on the PR branch (show both runs in the PR body) - Still-blocks tests pass: an engine invocation without the exact shape,
git reset --hardin a repository outside the temp directory, andrm -rf "$X"whereXis not a same-command literal -
bash plugins/guardrails/hooks/block-dangerous-git.test.shandbash plugins/guardrails/hooks/block-root-delete-target.test.shexit 0 -
python3 -m pytest plugins/disk-hygiene/skills/clean/scriptsexits 0 -
ci-statusis green on the PR head
Metadata
Metadata
Assignees
Labels
agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.status: readyTriaged, unblocked, and fully specified; eligible to pick up.
Type
Fields
No fields configured for Bug.
Activity
github-actions commentedon Oct 24, 2026
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Medium
Complexity: Medium
Uncertainty: Known
Flags: none
Blocked by: none
#9779 (comment)
This decision settles the open questions. I read this as a bounded change that narrows three hook matchers and adds stay-quiet and still-blocks tests. I found no likely duplicates.
Automated triage, applied by the lanes App.
kyle-sexton commentedon Oct 26, 2026
Decision recorded. The owner answered in the Issue Triage session (2026-10-26), on the question "Narrow the three destructive-command guards (disk-hygiene's destructive guard, guardrails
block-dangerous-gitandblock-root-delete-target) to their measured false positives, as this issue scopes it?" (recommended: yes, as scoped):Decided: yes, as the body scopes it. The facts are the body's measurements (disk-hygiene: 648 of 649 recorded denies were rule
not-exact-engine-command, mostly reads of the plugin's own source;block-root-delete-target: 192 blocks, no sampled block prevented a harmful delete). Each guard narrows only to the shapes named under "Fix" and never widens what it allows outside them, perdocs/conventions/hook-precision/README.md: a stay-quiet test that fails before the fix, plus a still-blocks test for each dangerous neighbour.The body's "Done when" criteria stand as written.