fix(guard): mind_commit_guard v1.3 — fail open on shell it cannot attribute (#155)#148
Merged
Merged
Conversation
…ribute Three live firings, three false positives on the guard's own author (v1.0 quoted gh body, v1.1 cd-away commit, v1.2 cd inside a for-loop body), zero confirmed catches of a real bad Mind commit. All three came from attributing a commit to a repo by parsing arbitrary shell. Adds _unattributable(): compounds (for/while/until/select/case), subshells and brace groups, and any non-clause-leading cd now ALLOW rather than being guessed at. The two high-confidence denials — no `--` section, and a directory pathspec — are unchanged. Quoted text stays a single token, so a commit message mentioning 'for'/'done' still hits the bare-commit denial. 5 regression tests (22 total green), and the outcome recorded in docs/agent_failure_modes.md mitigation 2: a refusal whose trigger requires modelling an unbounded input space spends its budget on false positives. Build-chain campaign PyAutoHands#155, remaining-queue item 5. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFnvcMxTMgKvfZmxame6WG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build-chain campaign (PyAutoHands#155) remaining-queue item 5.
Evidence.
mind_commit_guardhas fired live three times and every one was a false positive on its own author — v1.0 on a quotedghcomment body, v1.1 on acd-away PyAutoHands commit, v1.2 on afor-loop withcdin the body — against zero confirmed catches of a real bad Mind commit. The-- <files>habit has done that work. All three share a root cause: attributing a commit to a repo by parsing arbitrary shell.Decision (user, this session): narrow, do not retire.
docs/agent_failure_modes.md§4 argues a noisy refusal trains bypass-by-default, so the guard may now only DENY when confident._unattributable(): allow when the command contains a compound keyword (for/while/until/select/case), a subshell or brace group, or acdat a non-leading clause position (the shape_cd_targetsilently drops).git commitunambiguously resolving to a Mind checkout with no--section, and a directory pathspec after--.for/donestill hits the bare-commit denial (tested).Verification: 22/22 green (17 existing + 5 new, covering all three historical FPs and re-asserting the simple denials). Also exercised as a live
PreToolUsepayload throughbin/mind_commit_guard.py: the three FP commands return an empty allow, a baregit commitfrom a Mind cwd still returns the deny JSON.docs/agent_failure_modes.mdmitigation 2 records the outcome and the general lesson: a refusal whose trigger requires modelling an unbounded input space spends its budget on false positives — prefer refusals with a decidable precondition (mitigation 3, which has true-positived).