Skip to content

fix(disk-hygiene): engine gate denies commands that only mention the engine file name #6242

Closed

Description

@kyle-sexton

Problem

The disk-hygiene engine gate (plugins/disk-hygiene/skills/clean/scripts/destructive_guard.py) denies read-only commands that only name the engine file hygiene.py. #5519 / #5521 and #4218 relaxed it for git show, git grep, grep and rg; other read-only readers (awk, sed -n, cat) are still denied. During the #6225 audit, two read-only auditor calls were denied this way: an awk that named the engine and contained #, and a read of the engine by name.

Filing this issue reproduced it: gh issue create --title "...only name hygiene.py" --body-file … was denied as an engine invocation because the title named the engine file and the command held a (. The 2,500-character deny text it returned is the one #6225 shortens.

Expected

A read-only inspection of the engine file is allowed; only invocations of the engine are gated.

Related

#5519, #4218, #6225.

Activity

  1. added
    needs-triage
    on Oct 4, 2026
  2. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor

    Thanks for the clear writeup and reproduction. Understood: destructive_guard.py's engine gate still denies read-only commands (awk, sed -n, cat, and even a gh issue create whose title/body merely names hygiene.py) even though #5519 and #4218 already relaxed it for git show, git grep, grep, and rg. The ask is for the gate to key off actual engine invocation rather than any text mention of the filename, discovered during the #6225 audit.

    No open issue duplicates this — #5519 and #4218 cover the earlier, narrower relaxations and are both closed, and #3950 (closed) covered a related but distinct watchdog false-closed case. This reads as a follow-up gap in the same gate rather than a dupe.

    No fix or timeline implied here — just triage.

    Automated triage. A maintainer reviews it.

  3. removed
    needs-triage
    on Oct 12, 2026
  4. added theissue type on Oct 12, 2026
  5. kyle-sexton commented on Oct 13, 2026

    @kyle-sexton
    MemberAuthor

    Owner decision (2026-10-13): approved the recommendation.

    This fixes the reported gh issue create denial. It does not fix the awk denial or a cat of the real engine through a resolving path; use the Read and Grep tools for those.

    Next: an agent lane, via admission, implements it with red-first tests; it relaxes a guard, so a human merges it.

    This was generated by AI.

  6. kyle-sexton commented on Oct 13, 2026

    @kyle-sexton
    MemberAuthor

    Owner ratified this admission in an attended session on 2026-10-13: work-class: scoped. It touches a guard, CI script, settings or trust surface, so an agent may build it but the owner merges the PR: put 'Hold: a human merges this' in the PR body.

  7. added
    agent-ready
    on Oct 13, 2026
  8. removed
    agent-ready
    on Oct 14, 2026
  9. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded.

    Question: How far should the disk-hygiene engine gate relax for a Bash command that only mentions the engine file as quoted data?

    Owner's answer: Add a Bash counterpart of the PowerShell string-data rule, limited to one simple command on a closed reader allowlist and blanking only safe literals, with identity checked before blanking. A pipeline of readers still does not count as a mention.

    The owner confirmed this decision, first recorded at #6242 (comment), in an attended backlog-shaping session on 2026-10-18. The question was "Confirm the 10 decisions, #7287's kill-switch hardening included, and admit them to the paced queue?" and the owner answered "Yes, all 10 (Recommended)".

    Posted by AI from the owner's answer in that session.

  10. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    Agent Brief

    Type: Bug
    Summary: Let the disk-hygiene engine gate allow a simple reader command that only mentions the engine file as quoted data.

    Current behavior:
    The engine gate denies a command that names the engine file in its text, for example a gh issue create whose title names it, unless the command is one of the few readers already relaxed. Only PowerShell has a rule that blanks quoted string data.

    Desired behavior:

    • The Bash path gains a counterpart of the PowerShell string-data rule with three limits: (1) one simple command with no unquoted operator, so pipelines stay fail-closed; (2) the command word is on a closed reader allowlist: cat, head, tail, wc, grep, rg without --pre, git show/log/diff/grep without -c, -O/--open-files-in-pager or an alias, and gh issue/pr subcommands; (3) only single-quoted literals, and double-quoted literals with no $ or backtick, are blanked as data.
    • Identity is checked on the command as written before any blanking, so a resolving path to the engine still gates.
    • awk and sed stay classified as written.
    • The docstring names the gh alias residual (--shell or !).

    Key interfaces:

    • Engine gate's Bash classification: new string-data blanking under the three limits.

    Acceptance criteria:

    • A stay-quiet test, red before the fix: gh issue create --title '...hygiene.py...' is allowed.
    • Tests: a pipeline that mentions the engine, a reader outside the allowlist, a double-quoted literal holding $, and a path that resolves to the engine each stay denied.
    • scripts/run-test-file.sh passes on the guard's test file.
    • A changelog entry or fragment for disk-hygiene passes scripts/check-changelog-fragments.sh.

    Out of scope:


    This was generated by AI during backlog shaping. The owner approved its admission in an attended backlog-shaping session on 2026-10-18.

  11. added
    agent-ready
    on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-ready

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions