Skip to content

fix(guard): mind_commit_guard v1.3 — fail open on shell it cannot attribute (#155)#148

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/build-chain-closeout
Jul 22, 2026
Merged

fix(guard): mind_commit_guard v1.3 — fail open on shell it cannot attribute (#155)#148
Jammy2211 merged 1 commit into
mainfrom
feature/build-chain-closeout

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Build-chain campaign (PyAutoHands#155) remaining-queue item 5.

Evidence. mind_commit_guard has fired live three times and every one was a false positive on its own author — v1.0 on a quoted gh comment body, v1.1 on a cd-away PyAutoHands commit, v1.2 on a for-loop with cd in 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.

  • New _unattributable(): allow when the command contains a compound keyword (for/while/until/select/case), a subshell or brace group, or a cd at a non-leading clause position (the shape _cd_target silently drops).
  • Unchanged: the two high-confidence denials — a git commit unambiguously resolving to a Mind checkout with no -- section, and a directory pathspec after --.
  • Quoted text is a single shlex token by then, so a commit message that merely mentions for/done still 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 PreToolUse payload through bin/mind_commit_guard.py: the three FP commands return an empty allow, a bare git commit from a Mind cwd still returns the deny JSON.

docs/agent_failure_modes.md mitigation 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).

…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
@Jammy2211
Jammy2211 merged commit cff8ca3 into main Jul 22, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the feature/build-chain-closeout branch July 22, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant