aboutsummaryrefslogtreecommitdiff
path: root/scripts/sweep-gitignore-tooling.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 07:53:05 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 07:53:05 -0500
commitf625cf5c6e38c1abb98491b4e1b8ce63c57b8712 (patch)
tree607dcc6ac35be78d5092ea720bd68c849547471a /scripts/sweep-gitignore-tooling.sh
parent067ed55b6bf6276f9e5203cc521a2785716d0ece (diff)
downloadrulesets-f625cf5c6e38c1abb98491b4e1b8ce63c57b8712.tar.gz
rulesets-f625cf5c6e38c1abb98491b4e1b8ce63c57b8712.zip
feat: track working/ from creation, gitignore temp/ in both modes
working/ is the tracked home of in-progress work, version-controlled from creation rather than staged locally until it graduates. Filing on completion reorganizes durable artifacts into permanent homes. It doesn't mark when they became durable. Ephemeral, disposable artifacts go in a gitignored temp/ (or /tmp), never working/. install-ai.sh emits a temp/ ignore in both track and gitignore modes. Ephemerality is independent of whether a project tracks its .ai/ tooling, so temp/ rides neither the track .gitkeep step nor the gitignore-only tooling block. working/ is never ignored, on purpose. sweep-gitignore-tooling.sh backfills temp/ as a separate mode-independent pass, not an IGNORE_SET member: folding it into that set would skip every track-mode project, the set that most needs it. While implementing I confirmed the canonical machinery never ignored working/ (the tooling set is only .ai/ .claude/ CLAUDE.md AGENTS.md), so a project that ignored working/ did so as a local deviation. Documents the convention in working-files.md and mirrors it in protocols.org. 7 new bats cover temp/ in both modes, never working/, and idempotency.
Diffstat (limited to 'scripts/sweep-gitignore-tooling.sh')
-rwxr-xr-xscripts/sweep-gitignore-tooling.sh32
1 files changed, 31 insertions, 1 deletions
diff --git a/scripts/sweep-gitignore-tooling.sh b/scripts/sweep-gitignore-tooling.sh
index 68bfe2d..7194d6c 100755
--- a/scripts/sweep-gitignore-tooling.sh
+++ b/scripts/sweep-gitignore-tooling.sh
@@ -153,7 +153,37 @@ for project in "${projects[@]}"; do
done
done
+# temp/ backfill — mode-independent. Unlike the personal-tooling set above
+# (gitignore-mode only, track-mode deliberately skipped), temp/ holds ephemeral
+# artifacts in every project regardless of whether it tracks its .ai/, so both
+# track- and gitignore-mode projects get it. A separate pass, not an IGNORE_SET
+# member — folding it into that set would miss every track-mode project, which
+# is exactly the set that needs it. working/ is never ignored: it's the tracked
+# home of in-progress work.
+temp_swept=0
+for project in "${projects[@]}"; do
+ [ -d "$project/.git" ] || continue
+ name="$(basename "$project")"
+ gi="$project/.gitignore"
+
+ if [ -f "$gi" ] && { grep -qFx 'temp/' "$gi" || grep -qFx '/temp/' "$gi"; }; then
+ continue
+ fi
+
+ if [ "$dry_run" -eq 1 ]; then
+ echo "DRY $name — would add: temp/"
+ else
+ {
+ [ -s "$gi" ] && echo ""
+ echo "# Ephemeral working artifacts (throwaway; see working-files.md; swept $(date +%Y-%m-%d))"
+ echo "temp/"
+ } >> "$gi"
+ echo "temp $name — added: temp/"
+ fi
+ temp_swept=$((temp_swept + 1))
+done
+
echo
-echo "Summary: $swept swept, $complete already complete, $skipped skipped (of ${#projects[@]} projects)."
+echo "Summary: $swept swept, $complete already complete, $skipped skipped (of ${#projects[@]} projects); $temp_swept temp/ backfilled."
[ "$dry_run" -eq 1 ] && echo "(dry-run — no files written)"
exit 0