Skip to content

mind_commit_guard v1.1: token-level clause parsing#133

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/mind-guard-v11
Jul 16, 2026
Merged

mind_commit_guard v1.1: token-level clause parsing#133
Jammy2211 merged 1 commit into
mainfrom
feature/mind-guard-v11

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

The guard shipped in #132 fired twice in its first hour — both false positives on its own author (F5-class, exactly the cost the doc warns trains bypass-by-default): a gh issue comment whose quoted body prose contained the trigger words, and a ; inside a quoted -m message that made the raw-regex clause splitter strand the -- pathspecs. v1.1 replaces textual clause splitting with token-level parsing (shlex with punctuation_chars, quotes respected): quoted strings are single tokens that can neither leak trigger words nor swallow the pathspec section. Unparseable input (heredocs, unbalanced quotes) fails open. Both live incidents are regression tests; all denial behaviour unchanged (13 guard tests, suite 117).

Shipped under the standing corrective-PR exception (Heart RED).

API Changes

None.

Test Plan

  • 13 guard tests incl. the two live false positives verbatim; full suite 117 passed.
  • The exact denied closeout command now returns allow; bare commits still deny.

Generated by the PyAutoLabs agent workflow.

The guard's first live hour produced two false positives on its own author:
a gh-comment body whose prose contained the trigger words, and a semicolon
inside a quoted -m message that stranded the -- pathspecs in the next raw
regex clause. v1.1 splits clauses at token level (shlex punctuation_chars,
quotes respected), so quoted strings can neither leak trigger words nor
swallow the pathspec section; unparseable input fails open. Both live
incidents are regression tests; bare/directory denials unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 7df5a8b into main Jul 16, 2026
@Jammy2211
Jammy2211 deleted the feature/mind-guard-v11 branch July 16, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant