diff options
Diffstat (limited to '.ai/scripts/todo-cleanup.el')
| -rw-r--r-- | .ai/scripts/todo-cleanup.el | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/.ai/scripts/todo-cleanup.el b/.ai/scripts/todo-cleanup.el index 569e7c7..6b3081a 100644 --- a/.ai/scripts/todo-cleanup.el +++ b/.ai/scripts/todo-cleanup.el @@ -397,20 +397,30 @@ before their descendants — a [#A] → [#B] → [#D] chain collapses in one pas (save-buffer)))) (defun tc--emit-archive-report () - (princ (format "todo-cleanup --archive-done: %d subtree(s) %s%s\n" - tc-archived - (if tc-check-only "would move" "moved") - (if tc-check-only " — CHECK MODE (no writes)" ""))) - (dolist (i (reverse tc-issues)) - (pcase (plist-get i :kind) - ('archive-skip - (princ (format " skipped %s: %s\n" (plist-get i :file) (plist-get i :detail)))) - ((or 'archive-moved 'archive-would) - (princ (format " %s:%d: %s %s\n" - (plist-get i :file) - (plist-get i :line) - (if tc-check-only "would move" "moved") - (plist-get i :heading))))))) + ;; A real-mode no-op stays silent. When nothing moved and nothing was + ;; skipped, there's nothing to report — and the wrap runs this twice + ;; (wrap-it-up, then open-tasks.org Phase A), so a vocal "0 subtree(s) moved" + ;; on the second pass reads as alarming next to the first pass's diff. Check + ;; mode always reports (a "0 would move" preview is information the caller + ;; asked for), and a skip always reports (a missing section is a real + ;; condition, not a no-op). + (let ((has-skip (cl-some (lambda (i) (eq (plist-get i :kind) 'archive-skip)) + tc-issues))) + (when (or tc-check-only (> tc-archived 0) has-skip) + (princ (format "todo-cleanup --archive-done: %d subtree(s) %s%s\n" + tc-archived + (if tc-check-only "would move" "moved") + (if tc-check-only " — CHECK MODE (no writes)" ""))) + (dolist (i (reverse tc-issues)) + (pcase (plist-get i :kind) + ('archive-skip + (princ (format " skipped %s: %s\n" (plist-get i :file) (plist-get i :detail)))) + ((or 'archive-moved 'archive-would) + (princ (format " %s:%d: %s %s\n" + (plist-get i :file) + (plist-get i :line) + (if tc-check-only "would move" "moved") + (plist-get i :heading))))))))) (defun tc--emit-hygiene-report () (princ (format "todo-cleanup: %d fix(es) applied%s\n" |
