fix: harden review and verifier governance
This commit is contained in:
36
scripts/git_commit_status_test.sh
Normal file
36
scripts/git_commit_status_test.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
TMP_DIR="$(mktemp -d)"
|
||||
trap 'rm -rf "$TMP_DIR"' EXIT
|
||||
|
||||
CLEAN_REPO="$TMP_DIR/repo"
|
||||
mkdir -p "$CLEAN_REPO"
|
||||
cd "$CLEAN_REPO"
|
||||
git init -q
|
||||
printf 'tracked\n' > tracked.txt
|
||||
git add tracked.txt
|
||||
git config user.email test@example.com
|
||||
git config user.name test
|
||||
|
||||
git commit -qm 'init'
|
||||
|
||||
CLEAN_OUTPUT="$(bash /home/long/project/llm-intelligence/scripts/git_commit_status_report.sh clean)"
|
||||
printf '%s' "$CLEAN_OUTPUT" | grep -q 'state=clean'
|
||||
printf '%s' "$CLEAN_OUTPUT" | grep -q 'severity=normal'
|
||||
|
||||
printf 'dirty\n' >> tracked.txt
|
||||
DIRTY_OUTPUT="$(bash /home/long/project/llm-intelligence/scripts/git_commit_status_report.sh dirty)"
|
||||
printf '%s' "$DIRTY_OUTPUT" | grep -q 'state=dirty'
|
||||
printf '%s' "$DIRTY_OUTPUT" | grep -q 'tracked_modified=1'
|
||||
printf '%s' "$DIRTY_OUTPUT" | grep -q 'commit_hint=needed'
|
||||
printf '%s' "$DIRTY_OUTPUT" | grep -q 'severity=warning'
|
||||
|
||||
for i in $(seq 1 60); do
|
||||
printf 'u%d\n' "$i" > "untracked_$i.txt"
|
||||
done
|
||||
BLOCKER_OUTPUT="$(WORKTREE_BLOCKER_THRESHOLD=50 bash /home/long/project/llm-intelligence/scripts/git_commit_status_report.sh blocker)"
|
||||
printf '%s' "$BLOCKER_OUTPUT" | grep -q 'severity=blocker'
|
||||
Reference in New Issue
Block a user