aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/audit.sh4
-rw-r--r--scripts/tests/audit.bats17
2 files changed, 21 insertions, 0 deletions
diff --git a/scripts/audit.sh b/scripts/audit.sh
index 86eeb76..a7b8089 100755
--- a/scripts/audit.sh
+++ b/scripts/audit.sh
@@ -144,10 +144,14 @@ for proj in "${projects[@]}"; do
# - the rulesets repo itself (canonical .ai/ lives at the repo root, not under a project)
# - the canonical-source subdir (rulesets/claude-templates/.ai/ is the source, not a target)
# - the legacy standalone claude-templates checkout (frozen during fold transition)
+ # - retired projects under any .retired/ ancestor (~/projects/.retired/<name>) —
+ # shelved, never a live sync target; nested one level deeper than live projects,
+ # so the maxdepth-3 find reaches them and they must be excluded explicitly
case "$proj" in
"$REPO") continue ;;
"$REPO/claude-templates") continue ;;
"$HOME/projects/claude-templates") continue ;;
+ */.retired/*) continue ;;
esac
# Display path: strip $HOME prefix to ~/, otherwise leave alone.
diff --git a/scripts/tests/audit.bats b/scripts/tests/audit.bats
index 3df69c9..0b062fb 100644
--- a/scripts/tests/audit.bats
+++ b/scripts/tests/audit.bats
@@ -113,6 +113,23 @@ git_init_with_ai_tracked() {
! grep -q "# uncommitted" "$TEST_HOME/code/alpha/.ai/protocols.org"
}
+@test "audit: retired projects are excluded entirely" {
+ # ~/projects/.retired/<name> holds shelved projects. The audit must
+ # never sync into them — they're not live targets. A drifted retired
+ # project must not appear in the output or the counts.
+ scaffold_synced_ai "$TEST_HOME/projects/.retired/oldproj"
+ echo "# drift marker" >> "$TEST_HOME/projects/.retired/oldproj/.ai/protocols.org"
+ scaffold_synced_ai "$TEST_HOME/code/alpha"
+
+ run bash "$AUDIT" --no-doctor
+
+ # The retired project is invisible to the audit, in any state.
+ [[ "$output" != *".retired/oldproj"* ]]
+ # The live project is still audited and clean.
+ [[ "$output" == *"ok ~/code/alpha"* ]]
+ [[ "$output" == *"Summary: 1 ok, 0 drift, 0 skipped, 0 failed"* ]]
+}
+
@test "audit: loop continues past .ai/-missing failure" {
# Edge case 2 from todo.org:1766. The defensive [ ! -d "$proj/.ai" ]
# branch fires when a discovered .ai/ disappears between find and