aboutsummaryrefslogtreecommitdiff
path: root/scripts/sync-check.sh
Commit message (Collapse)AuthorAgeFilesLines
* fix(sync-check): ignore generated python and elisp artifactsCraig Jennings2026-05-281-4/+24
| | | | | | | | | | | | | | Pre-commit caught a false-positive on its first real-world run. The .ai/scripts/__pycache__ directory created by make test (pytest writes .pyc and .pytest_cache, emacs writes .elc) was flagged as drift against the canonical's clean tree. Added matching --exclude patterns to the diff -rq check and the --fix rsync calls. Patterns: __pycache__, *.pyc, *.pyo, .pytest_cache, *.elc. The --fix excludes prevent rsync's --delete from wiping the mirror's __pycache__ when the canonical has none. Four new bats tests cover the exclusions. All 12 pass.
* feat(sync-check): canonical/mirror drift detection + pre-commit hookCraig Jennings2026-05-281-0/+72
scripts/sync-check.sh diffs claude-templates/.ai/{protocols.org, workflows,scripts} against the .ai/ mirror. Exits 0 when clean, 1 with a diff report on drift, 2 outside a rulesets-shaped repo or git checkout. --fix mode rsyncs canonical -> mirror and re-checks, then prompts to re-stage. githooks/pre-commit wraps the script. Commits abort on drift so the issue surfaces at publish time, not at the next session's startup rsync. Two new Makefile targets: - make sync-check [FIX=1] runs the script (FIX=1 passes --fix through). - make install-githooks sets core.hooksPath=githooks (idempotent). scripts/tests/sync-check.bats holds 8 tests covering clean, drift-per-path, --fix, extra-file removal, missing canonical, and outside-git. All eight pass. This catches the exact drift I had to fix manually during this morning's audit pass. The mirror's open-tasks.org PROPERTIES drawer sat below a sub-heading because the mirror commit was older than canonical.