aboutsummaryrefslogtreecommitdiff
path: root/claude-templates/.ai/workflows/wrap-it-up.org
diff options
context:
space:
mode:
Diffstat (limited to 'claude-templates/.ai/workflows/wrap-it-up.org')
-rw-r--r--claude-templates/.ai/workflows/wrap-it-up.org23
1 files changed, 21 insertions, 2 deletions
diff --git a/claude-templates/.ai/workflows/wrap-it-up.org b/claude-templates/.ai/workflows/wrap-it-up.org
index d0c4e75..a032bc3 100644
--- a/claude-templates/.ai/workflows/wrap-it-up.org
+++ b/claude-templates/.ai/workflows/wrap-it-up.org
@@ -1,5 +1,5 @@
#+TITLE: Session Wrap-Up Workflow
-#+AUTHOR: Craig Jennings & Claude
+#+AUTHOR: Craig Jennings
#+DATE: 2026-04-20
* Overview
@@ -43,6 +43,20 @@ This depends on three functions in =.emacs.d/modules/ai-term.el= (=cj/ai-term-qu
* The Workflow
+** Step 0: Refuse if sentry is live
+
+Before anything else, check whether sentry is running in this project. Sentry holds the working tree on its =sentry/<date>-<host>= branch and commits unattended; wrapping underneath it would archive the session anchor and tear down the buffer while the loop is still firing into it. If sentry's single-runner lock is held, stop and point at the shutdown path:
+
+#+begin_src bash
+proj="$(basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")"
+if [ -x .ai/scripts/agent-lock ] && .ai/scripts/agent-lock status "sentry-$proj" | grep -q '^held'; then
+ echo "sentry is active — say 'stop sentry' first"
+ exit 1
+fi
+#+end_src
+
+The stop-sentry operation (defined in =sentry.org=) owns the shutdown: it cancels the loop, disposes of the branch, and walks the approval queue. Wrap-up carries only this one guard; a =stale= lock (a crashed fire) doesn't block — only a live =held= lock does.
+
** Step 1: Finalize the Summary
*** Early KB reflection (capture while fresh, before the Summary)
@@ -202,9 +216,14 @@ else
followups=".ai/lint-followups.org"
fi
[ -f todo.org ] && emacs --batch -q -l .ai/scripts/lint-org.el \
- --followups-file="$followups" todo.org
+ --fix --followups-file="$followups" todo.org
#+end_src
+The =--fix= flag is required for the writes: lint-org's CLI default is
+report-only (a linter reports, it doesn't write), and this wrap-up pass is
+the deliberate exception that applies fixes — its diff rides the wrap-up
+commit for review.
+
=lint-org= runs =org-lint= over =todo.org=, auto-applies four mechanical
categories (=item-number= counters, bare =#+begin_src= → =#+begin_example=,
multi-line planning-info merged onto one line, =**X.**= → =*X.*=), and