aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-28 09:08:43 -0500
committerCraig Jennings <c@cjennings.net>2026-05-28 09:08:43 -0500
commitbeb646e827802c0491b422ce03c7687eb66a717b (patch)
treee429eeb6ff362f9ddd85beff9fd811dca40a835c
parent0c7eb59f813b5572cc32beb6d2dd09355639cbfc (diff)
downloadrulesets-beb646e827802c0491b422ce03c7687eb66a717b.tar.gz
rulesets-beb646e827802c0491b422ce03c7687eb66a717b.zip
feat(open-tasks): archive-done sweep at start of Phase A
open-tasks.org Phase A now runs `emacs --batch -q -l .ai/scripts/todo-cleanup.el --archive-done todo.org` as a pre-step before the parallel read batch. A level-2 task that completed during the session sits as ** DONE under Open Work until something archives it, which means Next Mode would surface it as a "what's next" candidate between cleanups. The pre-step ensures Phase A's read of todo.org reflects current state. The pre-step skips only in an explicit read-only or dry-run context. Default is always to sweep. Common Mistake #13 records "recommending a freshly-DONE task" with the pointer back to the pre-step. The proposal came from a pearl handoff on 2026-05-28.
-rw-r--r--.ai/workflows/open-tasks.org17
-rw-r--r--claude-templates/.ai/workflows/open-tasks.org17
-rw-r--r--todo.org3
3 files changed, 34 insertions, 3 deletions
diff --git a/.ai/workflows/open-tasks.org b/.ai/workflows/open-tasks.org
index e90bc12..fe782d6 100644
--- a/.ai/workflows/open-tasks.org
+++ b/.ai/workflows/open-tasks.org
@@ -21,7 +21,21 @@ User says one of:
Don't route "task review" / "review tasks" here — those trigger the hygiene habit in =task-review.org=, a different workflow.
-* Phase A: Data Gathering (one parallel batch — both modes)
+* Phase A: Data Gathering (both modes)
+
+** Phase A pre-step — archive any freshly-DONE tasks
+
+Before reading =todo.org=, run the cleanup script's archive-done sweep so completed level-2 subtrees move from =* $Project Open Work= to =* $Project Resolved=:
+
+#+begin_src bash
+emacs --batch -q -l .ai/scripts/todo-cleanup.el --archive-done todo.org
+#+end_src
+
+Costs a few hundred milliseconds. Without it, a task that completed earlier in the session sits as =** DONE= under Open Work until the next =clean-todo= or wrap-up pass, and Next Mode would surface it as a "what's next" candidate. The sweep makes Phase A's read of =todo.org= reflect current state.
+
+Skip the sweep if the workflow is invoked in an explicit read-only or dry-run context. Default is to run it.
+
+** Phase A reads — one parallel batch
Issue all source reads as a single batch of parallel tool calls. They're independent:
@@ -276,6 +290,7 @@ Key elements:
10. *Padding the friction block when a row is empty.* If no task carries both =:quick:= and =:solo:=, omit that row entirely. Don't promote a =:quick:=-only task into the =:quick:solo:= slot.
11. *Recommending over stale facts in Next Mode.* When =:LAST_AUDIT:= is old or a state signal trips in Phase A.1, offer =task-audit= first. Let the user override — but don't skip the offer.
12. *Running Phase A.1 in List Mode.* The audit-warranted check is a Next Mode pre-step. List Mode displays the plate as-is and shouldn't trigger a write workflow first.
+13. *Recommending a freshly-DONE task.* Phase A's archive-done pre-step exists for exactly this. Skip it only in an explicit read-only or dry-run context; the default is always to sweep before reading.
* Living Document
diff --git a/claude-templates/.ai/workflows/open-tasks.org b/claude-templates/.ai/workflows/open-tasks.org
index e90bc12..fe782d6 100644
--- a/claude-templates/.ai/workflows/open-tasks.org
+++ b/claude-templates/.ai/workflows/open-tasks.org
@@ -21,7 +21,21 @@ User says one of:
Don't route "task review" / "review tasks" here — those trigger the hygiene habit in =task-review.org=, a different workflow.
-* Phase A: Data Gathering (one parallel batch — both modes)
+* Phase A: Data Gathering (both modes)
+
+** Phase A pre-step — archive any freshly-DONE tasks
+
+Before reading =todo.org=, run the cleanup script's archive-done sweep so completed level-2 subtrees move from =* $Project Open Work= to =* $Project Resolved=:
+
+#+begin_src bash
+emacs --batch -q -l .ai/scripts/todo-cleanup.el --archive-done todo.org
+#+end_src
+
+Costs a few hundred milliseconds. Without it, a task that completed earlier in the session sits as =** DONE= under Open Work until the next =clean-todo= or wrap-up pass, and Next Mode would surface it as a "what's next" candidate. The sweep makes Phase A's read of =todo.org= reflect current state.
+
+Skip the sweep if the workflow is invoked in an explicit read-only or dry-run context. Default is to run it.
+
+** Phase A reads — one parallel batch
Issue all source reads as a single batch of parallel tool calls. They're independent:
@@ -276,6 +290,7 @@ Key elements:
10. *Padding the friction block when a row is empty.* If no task carries both =:quick:= and =:solo:=, omit that row entirely. Don't promote a =:quick:=-only task into the =:quick:solo:= slot.
11. *Recommending over stale facts in Next Mode.* When =:LAST_AUDIT:= is old or a state signal trips in Phase A.1, offer =task-audit= first. Let the user override — but don't skip the offer.
12. *Running Phase A.1 in List Mode.* The audit-warranted check is a Next Mode pre-step. List Mode displays the plate as-is and shouldn't trigger a write workflow first.
+13. *Recommending a freshly-DONE task.* Phase A's archive-done pre-step exists for exactly this. Skip it only in an explicit read-only or dry-run context; the default is always to sweep before reading.
* Living Document
diff --git a/todo.org b/todo.org
index 2e5357c..a15fe6c 100644
--- a/todo.org
+++ b/todo.org
@@ -1235,7 +1235,8 @@ Verification: simulate two agents sharing a project (separate AI_AGENT_ID values
Parent: see [[#16 Generic agent runtime support][Generic agent runtime support — Codex spec v0]] above for the larger arc this is sliced from.
-** TODO [#C] Run =--archive-done= sweep at start of =open-tasks.org= Phase A :chore:quick:solo:
+** DONE [#C] Run =--archive-done= sweep at start of =open-tasks.org= Phase A :chore:quick:solo:
+CLOSED: [2026-05-28 Thu]
:PROPERTIES:
:CREATED: [2026-05-28 Thu]
:LAST_REVIEWED: 2026-05-28