From 94782eea3df22289fb556481f9569a9284c7ac50 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 15 May 2026 17:18:55 -0500 Subject: feat(make): add audit target for cross-project .ai/ drift detection scripts/audit.sh walks every .ai/-using project under ~/code/, ~/projects/, and ~/.emacs.d/, compares each .ai/ against the canonical source at claude-templates/.ai/, and reports drift per project. Default mode is report-only; APPLY=1 rsyncs detected drift into each project (no auto-commit). FORCE=1 also rsyncs into projects with uncommitted .ai/ changes (default: skip with a warning). Uses diff -rq for content comparison rather than rsync --itemize-changes to avoid false positives on attribute-only drift (mtime, permissions). Skips the rulesets repo itself, the in-repo canonical source, and the legacy standalone ~/projects/claude-templates/ during the fold transition. Output mirrors make doctor: per-project ok/drift/applied/skipped/FAIL lines, summary tally, exit 0 when all ok. Runs make doctor as the final check by default; NO_DOCTOR=1 skips. --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 087e734..f269298 100644 --- a/Makefile +++ b/Makefile @@ -401,6 +401,12 @@ lint: ## Validate ruleset structure (headings, Applies-to, shebangs, exec bits) doctor: ## Verify ~/.claude/ live state matches repo + settings.json (drift detector) @bash scripts/doctor.sh +audit: ## Verify project .ai/ dirs against canonical ([APPLY=1] [FORCE=1] [NO_DOCTOR=1]) + @bash scripts/audit.sh \ + $(if $(APPLY),--apply) \ + $(if $(FORCE),--force) \ + $(if $(NO_DOCTOR),--no-doctor) + test: ## Run the .ai/scripts/ test suites (pytest + ERT) @cd .ai/scripts/tests && python3 -m pytest @set -e; for f in .ai/scripts/tests/test-*.el; do \ -- cgit v1.2.3