diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-23 20:51:38 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-23 20:51:38 -0500 |
| commit | 970134d1c80fc9142ea4f93211ab157e894a1e9b (patch) | |
| tree | 7aad00213a02aa9e98d3ff06dffe17dc2465ca39 /working/working-dir-orphan-check/proposed.diff | |
| parent | c238afbd4150ef53737f16e7dd84a565d2838ecc (diff) | |
| download | rulesets-970134d1c80fc9142ea4f93211ab157e894a1e9b.tar.gz rulesets-970134d1c80fc9142ea4f93211ab157e894a1e9b.zip | |
chore(inbox): park the auto-empty-working proposal with a narrower fix
Craig's roam capture reached me a second time, relayed from another project, and the sender asked what already existed before treating it as new. Three of its four asks had already shipped, one of them earlier today from the same capture.
The remaining ask is an automatic sweep of a closed task's working/ files into temp/. I'm recommending against it. temp/ is cleared at the next wrap, so the sweep would destroy the artifacts that working-files.md says to rename and file into assets/. Filing is also the moment you decide what each artifact is worth keeping as, and automating it skips that.
The real gap is smaller: orphan detection only runs during a sentry fire, so a project that never runs sentry never hears about it. The parked diff adds report-only detection to wrap-up.
Diffstat (limited to 'working/working-dir-orphan-check/proposed.diff')
| -rw-r--r-- | working/working-dir-orphan-check/proposed.diff | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/working/working-dir-orphan-check/proposed.diff b/working/working-dir-orphan-check/proposed.diff new file mode 100644 index 0000000..03452dc --- /dev/null +++ b/working/working-dir-orphan-check/proposed.diff @@ -0,0 +1,24 @@ +--- claude-templates/.ai/workflows/wrap-it-up.org 2026-07-23 08:39:07.467575608 -0500 ++++ /tmp/wu2.org 2026-07-23 20:49:55.500740517 -0500 +@@ -189,6 +189,21 @@ + emacs --batch -q -l .ai/scripts/todo-cleanup.el --archive-done --check todo.org + #+end_src + ++*** Flag orphaned working/ directories ++ ++#+begin_src bash ++for d in working/*/; do ++ [ -d "$d" ] || continue ++ s=$(basename "$d") ++ grep -q "working/$s/" todo.org 2>/dev/null || { echo "ORPHAN: $d (no todo.org reference)"; continue; } ++ awk -v s="$s" '/^\*\* /{h=$0} $0 ~ "working/" s "/" {print (h ~ /^\*\* (DONE|CANCELLED)/ ? "CLOSED-TASK: working/" s "/ — " h : "") ; exit}' todo.org ++done ++#+end_src ++ ++Report only — never move or delete anything here. A =working/<slug>/= whose backing task is closed (or which no task references at all) is a filing candidate per =working-files.md=: rename each file individually and move it flat into its permanent home, then remove the empty directory. ++ ++Filing is deliberately a judgment step and stays manual. Deciding each artifact's permanent home and giving it a meaningful name is what makes =assets/= searchable later, and it's also the moment you notice which artifacts aren't worth keeping. An automatic sweep would skip exactly that review, and sweeping to =temp/= would destroy the artifacts outright, since =temp/= is cleared just below. ++ + *** Clear temp/ + + #+begin_src bash |
