# Validate a security-review Markdown doc's structural completeness: every
# finding must carry a severity rating, a reproduction/impact description,
# and a remediation. Pure text parsing (python3 stdlib, no deps) — there is
# no external CLI for "does this review doc have complete findings", so this
# check is 100% custom regex/text parsing, honestly labeled as such below.
# lint_security_review.sh [security-review.md]
# scripts/lint_security_review.sh ./security-review.md
DOC="${1:-./security-review.md}"
warn() { printf '⚠️ %s\n' "$1"; }
error() { printf '❌ %s\n' "$1"; fail=1; }
ok() { printf '✅ %s\n' "$1"; }
if [[ ! -f "$DOC" ]]; then
echo "Usage: $0 <security-review.md>" >&2
echo "== finding-completeness check (python3 stdlib text parsing — no external CLI exists for this) =="
py_out=$(python3 "$(dirname "$0")/lint_security_review.py" "$DOC")
while IFS= read -r line; do
OK::*) ok "${line#OK::}" ;;
ERROR::*) error "${line#ERROR::}" ;;
*) [[ -n "$line" ]] && echo "$line" ;;
if [[ "$py_status" -ne 0 ]]; then
if [[ "$fail" -eq 0 ]]; then
echo "All checks passed."
echo "One or more checks failed — see ❌ lines above."