Brings in the enforcement layer from ~/daytoday/meta:
- Makefile, scripts/ (check-rules.sh, setup-hooks.sh, pre-commit/pre-push,
docker-run.sh, garden.sh, lib/common.sh)
- WORKING.md, questions-v1.md, .env.example
- Git hooks installed (pre-commit: fast audit, pre-push: full audit)
Fixes to pass rule audit:
- Pin Pi-hole/autoheal Docker images (no :latest tags)
- Fix shellcheck SC2001 in probe-vm-dns.sh
- Prune vendor/ and archive/ from shellcheck + Discourse pointer checks
- Add Quick Start, Enforcement Model, Task Tracking, Working Style
sections to AGENTS.md from template
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
26 lines
809 B
Bash
Executable File
26 lines
809 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# pre-commit — fast rule audit (< 1s typical).
|
|
# Hot-path bypass: commits that ONLY touch STATUS.md / WORKING.md skip the
|
|
# audit so frequent status/task commits stay frictionless.
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
cd "$REPO_ROOT"
|
|
|
|
CHANGED="$(git diff --cached --name-only)"
|
|
HOT_PATHS="$(printf '%s\n' "$CHANGED" | grep -vE '^(STATUS.md|WORKING.md)$' || true)"
|
|
|
|
if [ -z "$HOT_PATHS" ]; then
|
|
echo "hot-path files only (STATUS/WORKING) — skipping rule audit"
|
|
exit 0
|
|
fi
|
|
|
|
if ! bash scripts/check-rules.sh --fast; then
|
|
echo ""
|
|
echo "pre-commit audit FAILED. Fix the violations above before committing."
|
|
echo "Full audit: bash scripts/check-rules.sh"
|
|
echo "Bypass: git commit --no-verify (emergencies only)"
|
|
exit 1
|
|
fi
|
|
exit 0
|