Something went wrong. Try again.
A free/open-source launcher and vehicle-data platform for aftermarket Android head units.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950#!/usr/bin/env bash# The commit-msg hook encodes the Human Voice policy (AI_POLICY.md §"What agents must not do").# If the hook silently stops rejecting, nothing else will notice.set -uo pipefailcd "$(dirname "$0")/../.." || exit 1
HOOK="./scripts/hooks/commit-msg"[ -x "$HOOK" ] || { printf 'FAIL: %s missing or not executable\n' "$HOOK"; exit 1; }
tmp=$(mktemp); trap 'rm -f "$tmp"' EXITfail=0case_() { # name, message, expected exit printf '%s\n' "$2" > "$tmp" "$HOOK" "$tmp" >/dev/null 2>&1 got=$? if [ "$got" -ne "$3" ]; then printf ' %-28s expected exit %s, got %s\n' "$1" "$3" "$got"; fail=1 fi}
SIGN='Signed-off-by: A Human <human@example.com>'case_ "own words + DCO" "feat(hal): replay traces
Why it matters, briefly.$SIGN" 0case_ "human co-author" "fix(ui): dock overflow
Body.$SIGNCo-Authored-By: Jane Doe <jane@example.com>" 0case_ "AI co-author" "feat: gauges
Co-Authored-By: Claude <noreply@anthropic.com>$SIGN" 1case_ "tool footer" "feat: gauges
Generated with Claude Code$SIGN" 1case_ "robot signature" "feat: gauges
🤖 Generated$SIGN" 1case_ "missing DCO" "feat: gauges
Body only." 1case_ "merge commit exempt" "Merge branch 'feat/hal'" 0
[ "$fail" -eq 0 ] || { printf 'FAIL: commit-msg hook behaviour regressed\n'; exit 1; }printf 'OK: commit-msg hook rejects AI attribution, requires DCO\n'