fix(no-vibes): exempt pure-display echo/printf from destructive matcher (false positive)#31
Merged
Merged
Conversation
A benign command that only displays a destructive-op reminder (e.g. an echo of a force-push or recursive-delete note) was blocked, because the matcher substring-matches the whole command. Add a narrow pre-guard exempting pure-display echo/printf with no pipe/redirect/chaining/background/backtick/$( substitution; anything executable or redirecting falls through unchanged (no bypass). Adds regression fixture 40 (negative). no-vibes stress 69/69; pack-loader 17/17; measured FPR 33%->0% recall 100% via hookbench. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
waitdeadai
added a commit
that referenced
this pull request
Jun 1, 2026
…ix) (#32) Marks the fix from PR #31 (pure-display echo/printf exemption in the destructive matcher) as a discrete release so a /plugin update maps the change to its own version. Co-authored-by: Fernando Lazzarin <263019791+waitdeadai@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
is_destructive_bash()inhooks/no-vibes.shmatches each destructive pattern as asubstring of the whole command (and a de-quoted copy). So a benign command that
only displays a destructive op — e.g.
echo 'reminder: avoid git push --force on shared branches'— is wrongly blocked (exit 2). This is a real, daily falsepositive: documentation/reminder
echos and comments mentioning destructive ops getgated.
Fix (narrow, bypass-safe)
Add a precision pre-guard: exempt a command only when it is a pure-display
echo/printfof literal args with no way for the mentioned text to execute orredirect — no pipe/background/chaining/redirect (
| & ; < >), no backtick, no$(command substitution. Anything that can execute or redirect (bash -c '…',$(…),echo … > /dev/sda,echo …; rm …) falls through to the unchangedmatcher. This cannot open a bypass: a lone
echo/printfof literal text has noexecution or write path.
Tested
tests/stress/no-vibes/negative/40-echo-mentions-force-push.json(negative = expect allow). It failed before the fix, passes after.
bash tests/stress/run.sh --hook no-vibes→ 69/69 pass (was 68/69 with the newfixture).
bash tests/test-pack-loader.sh→ 17/17 pass.remaining 5 failures are pre-existing and unrelated — all in
no-fake-cite/positive(arxiv/doi/citation patterns), failing identically with or without this change. Not
touched here.
command corpus the patched hook goes false-positive rate 33% → 0% with recall held
at 100% (the real
git push --force origin mainstill blocks; only the echoedmention is now allowed).
Out of scope
The 5 pre-existing
no-fake-citepositive failures (a separate hook) — flagged here sothey're visible, but not addressed in this PR.