Skip to content

gate: quote mask glues a backslash-newline onto the previous word, hiding the next word from the subagent guard #306

Closed

Description

@wasikarn

Found by the 2026-10-02 differential fuzz sweep over the gate fixes merged on 2026-10-01 (residue of GH #286).

In hooks/gates/_quotemask.py (about lines 120-130) a backslash-newline is blanked only when at_word_start is true. Directly after a word character it is masked as two Q characters and glued to the previous word, even when whitespace follows. So the next word is hidden. In a subagent, plain stash, reset and clean are then allowed when the continuation sits: after the command word, mid-word in the git word or the subcommand, after env/time/sudo/command/eval, after an open brace, then or do, or trailing at the end. The same shapes inside a bash -c or eval body also allow. A space before the backslash denies correctly.

Reproducers (one file per shape) are in the sweep's scratchpad under zfz/repro/ with names starting 286-g1-; the maintainer has them. Fix direction: a continuation glues to the previous word only when the next character is not whitespace or a separator; keep the three mask copies and tests/hooks/quotemask_drift.py in sync. Differential-fuzz it per docs/reference/repo-gotchas.md.

Activity

  1. added a commit that references this issue on Oct 2, 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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions