From 0127889a41fc4f870def2982d822023e0dcb49dd Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 24 Jun 2026 06:53:10 -0400 Subject: chore(todo): unblock wrap-teardown — .emacs.d companion landed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The three ai-term companion functions (cj/ai-term-quit, -live-count, -shutdown-countdown) are now in .emacs.d/modules/ai-term.el, double-checked against the contract. Dropped the :blocked: tag and :BLOCKED_BY: property — the build dependency is resolved, only the manual end-to-end validation remains. With the Stop hook wired and the companion present, the feature is live: the next bare "wrap it up" now tears the session down. Claude-Session: https://claude.ai/code/session_017PtX1nt1rtYVATuzmzBS4f --- todo.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'todo.org') diff --git a/todo.org b/todo.org index 62763fe..134001b 100644 --- a/todo.org +++ b/todo.org @@ -38,11 +38,10 @@ Tags are assigned and refreshed by =task-audit=; =task-review= keeps them honest * Rulesets Open Work -** DOING [#B] wrap-it-up teardown + "wrap it up and shutdown" :feature:blocked: +** DOING [#B] wrap-it-up teardown + "wrap it up and shutdown" :feature: :PROPERTIES: :CREATED: [2026-06-23 Tue] :LAST_REVIEWED: 2026-06-24 -:BLOCKED_BY: emacsd: ai-term companion (cj/ai-term-quit, -live-count, -shutdown-countdown) + manual validation :END: Two additions to =wrap-it-up.org=, designed by Craig (home, 2026-06-23). Item 1: bare "wrap it up" also tears down the session — kill the =aiv-= tmux session (takes =claude= with it), kill the vterm buffer, restore geometry. Teardown is the default; "wrap it up with summary" wraps without teardown (keeps the buffer readable). Must fire from a Stop/SessionEnd hook via a sentinel file, decoupled and last, so the valediction flushes before the session dies, and strictly after commit+push is verified. Item 2: "wrap it up and shutdown" → wrap, then a hard blocking gate (abort unless this is the only live =aiv-*= session), then an abort-able 10→1 countdown, then =sudo shutdown now=. Countdown can't run through the Bash tool (stdout buffers — prints all ten at once); needs a detached tty writer or an Emacs =run-at-time= timer. Companion: =cj/ai-term-quit= (and optional =cj/ai-term-live-count=) must live in =.emacs.d/modules/ai-term.el= — route there via inbox-send when building so both sides land together. Open decisions for Craig first: qualifier wording ("with summary" vs "and summarize"), countdown home (tty script vs Emacs timer), session-count mechanism (=tmux ls= / =pgrep claude= / helper). Shared-asset, review-gated. Proposal: [[file:docs/design/2026-06-23-wrap-teardown-shutdown-proposal.org][proposal]]. From home 2026-06-23. @@ -52,6 +51,9 @@ Craig's three decisions (2026-06-23): non-destructive qualifier is *both* "with *** 2026-06-23 Tue @ 23:40 .emacs.d received + filed the companion spec Per a roam-inbox FYI from .emacs.d (2026-06-23 23:38): both ai-term handoffs (multi-LLM support + this wrap-teardown companion spec) landed and are filed as .emacs.d tasks. The teardown one is flagged for its own focused session to land alongside the rulesets half. Part (c) is now in progress on the .emacs.d side. +*** 2026-06-24 Wed @ 06:51:13 -0400 Unblocked — .emacs.d companion landed; feature now live +The three companion functions are in =.emacs.d/modules/ai-term.el= (=cj/ai-term-quit= 1068, =cj/ai-term-live-count= 1087, =cj/ai-term-shutdown-countdown= 1109), matching the contract — double-checked the bodies: quit kills session+buffer+restores layout idempotently, live-count returns the gate integer, shutdown-countdown re-checks the gate (TOCTOU guard), runs an abort-able =run-at-time= countdown (C-g cancels), then a configurable =cj/ai-term-shutdown-command=. 13 ERT tests, headless-verified live (.emacs.d FYI 2026-06-24 06:44). Dropped =:blocked:= / =:BLOCKED_BY:= — the build dependency is resolved; only the manual end-to-end validation below remains. NOTE: with the Stop hook wired and the companion present, the feature is now functional — the next bare "wrap it up" will actually tear the session down. Run the validation below before relying on it. + *** TODO Manual testing and validation :test: What we're verifying: the wrap-teardown + shutdown feature end to end, once =.emacs.d/modules/ai-term.el= has the three companion functions and the =Stop= hook is installed (=make install-hooks= + the =settings-snippet.json= Stop block in =~/.claude/settings.json=). These need a live Emacs daemon + tmux + an =aiv-= ai-term session; they can't be driven from a script. -- cgit v1.2.3