#!/usr/bin/env bash # Sea Haven security-review pre-commit hook: FAST deterministic scanners only (sub-30s). # The full agentic review is the on-demand /sh-security-review slash command — run that before pushing. # CI re-runs review.sh as the unbypassable backstop, so --no-verify here only skips local fast feedback. set -euo pipefail REPO_ROOT="$(git rev-parse --show-toplevel)" REVIEW_SH="${SH_REVIEW_SH:-$HOME/Documents/repositories/orchestrator/security-review/review.sh}" if [ ! -f "$REVIEW_SH" ]; then echo "security-review: review.sh not found at $REVIEW_SH (set SH_REVIEW_SH to override) — skipping" >&2 exit 0 fi # Nothing staged -> nothing to do. git diff --cached --name-only --diff-filter=ACM | grep -q . || exit 0 bash "$REVIEW_SH" --scanners-only "$REPO_ROOT"