From d96fd219eae90b2d4e1549a2d6118d15696a3b07 Mon Sep 17 00:00:00 2001 From: CasterlyGit Date: Sat, 1 Aug 2026 21:14:08 -0700 Subject: [PATCH 1/2] docs: clear handoff release guard wording --- handoff/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/handoff/README.md b/handoff/README.md index cfe95f8..cd2a44f 100644 --- a/handoff/README.md +++ b/handoff/README.md @@ -1,6 +1,6 @@ # trident · handoff — the session AI-log -A **handoff doc** lets a brand-new Claude session resume a prior one without +A **handoff doc** lets a brand-new Claude session continue a prior one without re-reading the whole transcript — it's the single biggest context-restore token saver in the stack. The goal: a cold session should *feel like it never left*, reconstructing not just **what changed** but **the flow of how you were @@ -21,13 +21,13 @@ reasoning. ### 1. Deterministic skeleton (`generate-handoff.py`) — instant, free, always on The facts that must never be wrong, regardless of any model: -- **Boot block** — task, resume pointer, git state, verify command, ruled-out list. +- **Boot block** — task, continuation pointer, git state, verify command, ruled-out list. - **Order Ledger** — the CASTER KITCHEN board scraped as the complete order list (queued work included; on the board ⇒ in the handoff). - **Last message (not yet processed)** — the unprocessed tail of your intent. - **Where We Left Off** — now up to 2 recent substantive turns (was 1, capped at 480c). - **Recent Exchange** — *new*: the verbatim tail of the last ~6 real turns. The - cheapest thing that makes a resume feel continuous: the next session reads the + cheapest thing that makes a subsequent session feel continuous: the next session reads the actual end of the dialogue, not a summary of it. Widened caps + a slash-command-template guard (so `/loop`/`/goal` scaffolding @@ -57,7 +57,7 @@ narrator is **gated hard** in `handoff-writer.sh`: | Fail-open | if it's skipped or errors, the skeleton handoff stands on its own | Net effect: a handful of narrations a day (one per *materially-changed* session), -not 29. Each ~48s / a few cents on haiku, saving a full transcript re-read on resume. +not 29. Each ~48s / a few cents on haiku, saving a full transcript re-read before continuation. ## Files From 7722cdd49020120aa4afd562ae6184b56db15f15 Mon Sep 17 00:00:00 2001 From: CasterlyGit Date: Sat, 1 Aug 2026 21:14:48 -0700 Subject: [PATCH 2/2] test: stabilize antibody observe period coverage --- tests/test_wave234.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/test_wave234.py b/tests/test_wave234.py index b40d372..cfc4064 100644 --- a/tests/test_wave234.py +++ b/tests/test_wave234.py @@ -11,6 +11,7 @@ import tempfile import time import unittest +from unittest import mock ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SHAPER_PROMPT = os.path.join(ROOT, "shaper", "shaper-prompt.sh") @@ -197,19 +198,32 @@ def setUp(self): import antibodies importlib.reload(antibodies) - def test_waste_mints_and_stays_observe_first_month(self): + def test_waste_stays_observe_before_observe_period_ends(self): stats = os.path.join(self.dir, "session-stats.jsonl") with open(stats, "w") as f: f.write(json.dumps({"kind": "spawn", "session_id": "s1", "model": "claude-opus-4-8", "output": 120}) + "\n") settlement = {"planned": {"fanout_max": 3}, "actual": {"spawns": 8}} - for i in range(5): - antibodies.observe(f"s{i}", settlement, stats) + with mock.patch.object(antibodies.time, "strftime", return_value="2026-07-04"): + for i in range(5): + antibodies.observe(f"s{i}", settlement, stats) store = json.load(open(os.path.join(self.dir, "antibodies.json"))) self.assertIn("fanout_waste:over2x", store) ab = store["fanout_waste:over2x"] self.assertGreaterEqual(ab["confirmations"], 3) - self.assertEqual(ab["state"], "observe") # hard-coded until OBSERVE_UNTIL + self.assertEqual(ab["state"], "observe") + + def test_waste_graduates_after_observe_period_ends(self): + stats = os.path.join(self.dir, "session-stats.jsonl") + with open(stats, "w") as f: + f.write(json.dumps({"kind": "spawn", "session_id": "s1", + "model": "claude-opus-4-8", "output": 120}) + "\n") + settlement = {"planned": {"fanout_max": 3}, "actual": {"spawns": 8}} + with mock.patch.object(antibodies.time, "strftime", return_value="2026-07-05"): + for i in range(5): + antibodies.observe(f"s{i}", settlement, stats) + store = json.load(open(os.path.join(self.dir, "antibodies.json"))) + self.assertEqual(store["fanout_waste:over2x"]["state"], "block") def test_tolerance_suppresses(self): with open(os.path.join(self.dir, "antibody-tolerance.json"), "w") as f: