You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The Husky Snippet's Prose Gate Skips Silently When Its Second git diff Fails #4122
catalog/snippets/husky/pre-commit runs git diff --cached --name-only --diff-filter=ACMRT -z twice. The first run is a preflight, >/dev/null || exit 1. The second is the producer piped into xargs -0 sh -c '... exec uv run ... prose_lint.py ...'.
The snippet's own comment gives the reason for the preflight: "a pipeline hides a failure of its first command". But the preflight only proves the first invocation succeeded. The hook is POSIX sh with no pipefail, so a failure of the second invocation is still hidden. That second invocation is the one whose output the gate actually reads. If it fails after the preflight passes, it emits nothing. xargs then gets empty input, the inner sh sees $# -eq 0 and exits 0, and the commit proceeds with the prose gate never run.
GitHub Copilot raised it on ptr727/LanguageTags#503 against .husky/pre-commit, whose lines from the hook header on are the snippet byte for byte at hub 009d3e5e. So the fix belongs here at the source.
Expected
The path list is produced once and its exit status checked before the gate reads it. For example, capture it NUL-safely to a temporary file under the hook's control and feed that file to xargs -0. Or have the inner sh refuse when the producer failed, so a failed producer refuses the commit rather than skipping the gate.
Actual
The preflight checks a different invocation from the one feeding the gate, so a producer failure skips the prose gate silently. Per GOVERNANCE.md "Trust Boundaries and Hardening Effort" the input is trusted and the failure unlikely. It is silent, though, which is the case that section says earns a fix.
Activity
ptr727 commentedon Nov 13, 2026
Backlog burndown claim, round 1 (2026-11-13), away run, scope
develop. Branchburndown/husky-snippet-gate, group: #4122, #4104, #4121. Tier:frontier(carried catalog hook snippets and the gate they run).Predicted files:
catalog/snippets/husky/pre-commitcatalog/snippets/husky/README.mdcatalog/snippets/pre-commit/.pre-commit-config.yamlcatalog/snippets/pre-commit/README.md.husky/pre-committests/test_pre_commit_hook.pyRead the Husky Hook's Path List Once, Diff a Merge Against MERGE_HEAD…