Skip to content

disk-hygiene: PowerShell lane denies commands that merely mention engine script names in string data #4218

Closed

Description

@kyle-sexton

Problem

The PowerShell lane's engine-invocation deny fires on command text that only mentions the engine's script names inside string data. A gh issue create --body here-string that named the engine script and the kill-switch probe was denied with "disk-hygiene engine invocations must go through the Bash tool's exact guarded command shapes, not PowerShell", even though nothing invoked the engine.

Observed on Windows (v0.23.12) while filing issues about this plugin during a /disk-hygiene:clean session. The workaround was writing the bodies to files and passing --body-file.

Proposal

Match only on the invocation position (the command or the script argument of an interpreter call), not on any occurrence of the name in the command string. Add a regression case: a here-string or quoted argument that mentions the script name is allowed.

Activity

  1. added
    needs-triage
    on Sep 19, 2026
  2. added
    agent-ready
    status: ready
    and removed
    needs-triage
    on Sep 23, 2026
  3. added theissue type on Sep 23, 2026
  4. kyle-sexton commented on Sep 23, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Agent Brief

    Type: Bug
    Summary: The PowerShell lane's engine-invocation gate denies a command merely because the engine's script name appears somewhere in quoted string data, not because anything actually invokes the engine.

    Current behavior:
    The classifier that decides whether a PowerShell command is relevant to the disk-hygiene engine treats any command carrying the engine's marker filename as fail-closed into a deny unless the literal parser can prove the occurrence is a mere mention — and that proof fails for shapes such as an unparsable quoting construct (a here-string, or a quoted argument passed to an unrelated command such as an issue-creation call). As a result, a command that only names the engine script inside string data, with no invocation of it at all, is denied with a message stating that engine invocations must go through the Bash tool.

    Desired behavior:
    The classifier should distinguish an actual invocation of the engine (the command word itself, or an interpreter token followed by the engine's script name as its argument) from a bare textual mention of the script's name inside quoted string data such as a here-string or a quoted argument to an unrelated command. A command whose only reference to the engine's name is inside such string data, with no invocation shape present, should defer (be allowed) rather than deny.

    Key interfaces:

    • The engine-invocation relevance classifier used by the PowerShell lane needs an invocation-position check: the marker must appear as the command itself, or as the trailing argument of a recognized interpreter token, not merely anywhere in the command text.
    • The classifier's existing fail-closed posture for genuinely unparsable command shapes should be preserved for shapes that could actually hide an invocation; a well-formed quoted literal or here-string body that is provably just data should not by itself count as unparsable.

    Acceptance criteria:

    • An issue-creation call whose here-string body names the engine's script filename in prose is allowed, not denied, by the PowerShell lane.
    • A quoted argument to an unrelated command (for example, a search term or commit message) that happens to contain the engine's script filename is allowed, not denied.
    • A PowerShell command that actually invokes the engine script (the script as the command, or as an interpreter's script argument) is still denied.
    • A regression test exists covering a here-string or quoted argument that merely mentions the script name.

    Out of scope:

    • The mutation-word quoted-string over-match on the PowerShell belt's ask verdicts — tracked separately (see the sibling issue on quoted mutation words).
    • Any change to the Bash-lane engine gate's own fail-closed posture on unparsable quoting.
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-readystatus: 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