aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-18 13:38:55 -0500
committerCraig Jennings <c@cjennings.net>2026-05-18 13:38:55 -0500
commit049a9f8ac380df39cac285032cf1fedcb6f566bf (patch)
tree10da8947d2bb1d7554358416a2c11c20ba096b56
parent89da216416b39b70d87da7a423b02f177cfdef8b (diff)
downloadrulesets-049a9f8ac380df39cac285032cf1fedcb6f566bf.tar.gz
rulesets-049a9f8ac380df39cac285032cf1fedcb6f566bf.zip
docs(protocols): mechanical primary trigger for session-context writes
The "If this session crashed right now..." heuristic was the trigger. It pushes the decision onto the agent every turn, and the agent's bias is to defer when no obvious milestone just happened. Four recent sessions in the work project showed the same drift. The pattern: substantive work, no mid-session writes, a wrap-time reconstruction afterward. The new primary trigger is mechanical. A turn that called any state-modifying tool (Edit, Write, Agent dispatch, MCP write, or Bash that mutates state) writes to the Session Log before the closing user-facing message. Pure-read turns (Read, Glob, Grep, read-only Bash) don't trigger. The existing high-loss bullets stay as elaboration. They aren't the trigger. The 5-turn safety net remains. The judgment heuristic is gone. The primary trigger replaces it.
-rw-r--r--.ai/protocols.org8
-rw-r--r--claude-templates/.ai/protocols.org8
-rw-r--r--inbox/2026-05-18-0227-from-work-recurring-wrap-time-discipline-miss.org30
3 files changed, 10 insertions, 36 deletions
diff --git a/.ai/protocols.org b/.ai/protocols.org
index 600ddd6..30b0274 100644
--- a/.ai/protocols.org
+++ b/.ai/protocols.org
@@ -98,7 +98,11 @@ The Summary lets a future reader scan quickly. The Log preserves the /why/ and t
*** When to update (Session Log)
-Append to the Session Log at /progress points/ — moments where something has changed that you'd want to recover to if the session crashed right now:
+*Primary trigger (mechanical).* A turn that called any state-modifying tool — Edit, Write, Agent dispatch, MCP write, or Bash that mutates state (anything beyond pure reads like =git status=, =ls=, =grep=, =cat=) — writes to the Session Log before the closing user-facing message. This is not a judgment call. If the turn changed state, the turn gets a Session Log entry before the response goes out. The entry can be brief: one short paragraph naming what changed and why.
+
+Pure-read turns (only Read, Glob, Grep, or read-only Bash) do not trigger. Conversational turns with no tools do not trigger.
+
+The bullets below are not optional supplements — they all change state and so the primary trigger already covers them. They appear explicitly because they are the high-loss moments where missing the write is most expensive:
- A decision was reached ("we agreed on X, not Y")
- A workflow phase completed, or a new phase is starting
@@ -108,8 +112,6 @@ Append to the Session Log at /progress points/ — moments where something has c
- Before long-running or blocking tool calls — agent spawns, builds, rsync/ssh loops, MCP calls to external services. You could be waiting minutes; if anything crashes during the wait, everything since the last save is gone.
- Before destructive or irreversible operations — =rm -rf=, =git reset --hard=, force-push, package removal, database drops. If the op succeeds and something breaks afterward, you need to know what state you caused.
-Heuristic: /"If this session crashed right now, what would I wish I had written down?"/ If the answer is substantive, append to the Log.
-
*** Safety net
If 5 user turns pass without appending to the Log, save anyway. Semantic triggers should catch most cases; this fallback covers judgment failures.
diff --git a/claude-templates/.ai/protocols.org b/claude-templates/.ai/protocols.org
index 600ddd6..30b0274 100644
--- a/claude-templates/.ai/protocols.org
+++ b/claude-templates/.ai/protocols.org
@@ -98,7 +98,11 @@ The Summary lets a future reader scan quickly. The Log preserves the /why/ and t
*** When to update (Session Log)
-Append to the Session Log at /progress points/ — moments where something has changed that you'd want to recover to if the session crashed right now:
+*Primary trigger (mechanical).* A turn that called any state-modifying tool — Edit, Write, Agent dispatch, MCP write, or Bash that mutates state (anything beyond pure reads like =git status=, =ls=, =grep=, =cat=) — writes to the Session Log before the closing user-facing message. This is not a judgment call. If the turn changed state, the turn gets a Session Log entry before the response goes out. The entry can be brief: one short paragraph naming what changed and why.
+
+Pure-read turns (only Read, Glob, Grep, or read-only Bash) do not trigger. Conversational turns with no tools do not trigger.
+
+The bullets below are not optional supplements — they all change state and so the primary trigger already covers them. They appear explicitly because they are the high-loss moments where missing the write is most expensive:
- A decision was reached ("we agreed on X, not Y")
- A workflow phase completed, or a new phase is starting
@@ -108,8 +112,6 @@ Append to the Session Log at /progress points/ — moments where something has c
- Before long-running or blocking tool calls — agent spawns, builds, rsync/ssh loops, MCP calls to external services. You could be waiting minutes; if anything crashes during the wait, everything since the last save is gone.
- Before destructive or irreversible operations — =rm -rf=, =git reset --hard=, force-push, package removal, database drops. If the op succeeds and something breaks afterward, you need to know what state you caused.
-Heuristic: /"If this session crashed right now, what would I wish I had written down?"/ If the answer is substantive, append to the Log.
-
*** Safety net
If 5 user turns pass without appending to the Log, save anyway. Semantic triggers should catch most cases; this fallback covers judgment failures.
diff --git a/inbox/2026-05-18-0227-from-work-recurring-wrap-time-discipline-miss.org b/inbox/2026-05-18-0227-from-work-recurring-wrap-time-discipline-miss.org
deleted file mode 100644
index ab777f1..0000000
--- a/inbox/2026-05-18-0227-from-work-recurring-wrap-time-discipline-miss.org
+++ /dev/null
@@ -1,30 +0,0 @@
-#+TITLE: * Recurring Wrap-Time Discipline Miss: session-context.org n
-#+SOURCE: from work
-#+DATE: 2026-05-18 02:27:44 -0400
-
-* Recurring Wrap-Time Discipline Miss: session-context.org not maintained mid-session
-
-The wrap-it-up workflow and protocols.org both call for writing to .ai/session-context.org during the session at progress points (decisions reached, phase completions, substantive findings, before long tool batches, before destructive ops), with a safety net of every 5 user turns. Empirically across at least the last 4 work-project sessions, this discipline keeps slipping. The file gets created (or not) at wrap time and the Summary + Session Log get reconstructed retrospectively from conversation context.
-
-Affected sessions where the session log itself flagged the miss:
-- work/.ai/sessions/2026-05-15-18-10-deepsat-pr-reviews-and-slack-mcp-rule.org
-- work/.ai/sessions/2026-05-15-22-56-sofweek-prep-flights-and-slack-dms.org
-- work/.ai/sessions/2026-05-17-22-07-tampa-triage-socom-feedback-tuesday-prep.org
-
-Pattern: the in-flight nature of session work pulls focus away from "stop and write to the file." The rule exists in protocols.org but is not enforced or surfaced. The reconstruction at wrap time produces honest records, but the underlying purpose (crash recovery) is unprotected.
-
-Process-improvement candidates worth considering:
-
-1. Wrap-up refuses to proceed without a non-trivial session-context.org at wrap time. Forcing function instead of soft rule. The file has to exist with substantive Session Log content before the rename step runs. Pushes the discipline upstream from wrap to mid-session.
-
-2. Stop-event hook nudge. A hook fired on certain triggers (long tool batch returns, agent dispatch, before destructive ops) prints a reminder to update session-context.org. Mechanical reminders compete for attention but are harder to ignore than a passive protocol rule.
-
-3. Accept retrospective reconstruction as default. The wrap-time reconstruction produces honest, substantive records. The only loss case is mid-session crash. An honest cost-benefit might say: keep the rule for high-stakes sessions, accept reconstruction for low-stakes ones, drop the "discipline miss" framing.
-
-4. Harder named checkpoints. Replace soft "narrate as you go" triggers (judgment-heavy) with three named mandatory ones: after Phase A startup completes, after first user-initiated workflow completes, before any tool-batch over N calls fires. Fewer judgment calls, easier to enforce.
-
-The rule files this would touch:
-- claude-templates/.ai/protocols.org section "Session Context File — Record + Recovery Anchor"
-- claude-templates/.ai/workflows/wrap-it-up.org Exit Criteria + Step 1
-
-Sent from work-project wrap-time 2026-05-18 02:31 EDT (Tampa).