#!/usr/bin/env bash
# scripts/repo-lint.sh [--record-clientdocs-sweep] [--record-guide-skill-coupling] [repo-root]
#
# Thin runner for scripts/repo_lint.py (DOCFIX-074) -- static repo hygiene lint.
# Mutates NOTHING -- except under --record-clientdocs-sweep (DOCFIX-104, rewrites
# ONLY clientdocs/sweep-receipt.txt) or --record-guide-skill-coupling (rewrites
# ONLY clientdocs/guide-skill-coupling.txt, the L8 pin); both then lint as usual.
# See the .py docstring for the check catalog (L1-L12).
# Exit: 0 clean | 1 FAIL findings | 2 warnings only.  ASCII + LF.
set -uo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
command -v python3 >/dev/null 2>&1 || { echo "FAIL: python3 required"; exit 1; }
FLAGS=(); ROOT=""
for a in "$@"; do
  case "$a" in
    --*) FLAGS+=("$a") ;;
    *)   ROOT="$a" ;;
  esac
done
python3 "$HERE/repo_lint.py" ${FLAGS[@]+"${FLAGS[@]}"} "${ROOT:-$HERE/..}"
