From 82cd7cbd8e1b5bfaa74dad7a2a5aa31c44efb867 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 27 Sep 2026 16:59:41 +0200 Subject: [PATCH 1/2] Name each clause of typed for the entry kind it drops --- bin/loop-claude | 13 ++++++++----- todo.md | 4 ---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/loop-claude b/bin/loop-claude index b17d9109..4bb9079f 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -410,14 +410,17 @@ def human_turns(entries): def typed(entry): - """A human turn: a "user" entry, not isMeta, not promptSource "sdk" (the loop's own prompts), whose message.content is a string not starting with "<" ( and its kind) or one or more text parts, none starting with "[Request interrupted".""" - if entry.get("type") != "user" or entry.get("isMeta") or entry.get("promptSource") == "sdk": + if entry.get("type") != "user": return False content = entry.get("message", {}).get("content") - if isinstance(content, str): - return not content.startswith("<") parts = content if isinstance(content, list) else [] - return bool(parts) and all(isinstance(part, dict) and part.get("type") == "text" and not part.get("text", "").startswith("[Request interrupted") for part in parts) + meta = entry.get("isMeta") + loop_prompt = entry.get("promptSource") == "sdk" + command = isinstance(content, str) and content.startswith("<") + no_content = not isinstance(content, str) and not parts + non_text = any(not isinstance(part, dict) or part.get("type") != "text" for part in parts) + interruption = any(isinstance(part, dict) and part.get("type") == "text" and part.get("text", "").startswith("[Request interrupted") for part in parts) + return not (meta or loop_prompt or command or no_content or non_text or interruption) # "assistant" entries and stream-json diff --git a/todo.md b/todo.md index 85571314..5de406fd 100644 --- a/todo.md +++ b/todo.md @@ -4,10 +4,6 @@ Ships when a four-seat scoring run puts every dimension and the overall at 7.0 or above (`docs/decisions.md`). Ordered by the dimension each item lifts, lowest first, per the 2026-09-26 panel; each is one chunk. -Locality, 6.25: - -- Name each clause of `typed` for the entry kind it drops, so one edit cannot silently change what both `human_turns` and `render` see. - Self-sufficiency, 6.75: - Record in `docs/decisions.md` why every worktree of the checkout is trusted before an interrupt. -- 2.52.0 From 869aa03733bdbbacfb760f979a8f8719be657b78 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 27 Sep 2026 17:01:12 +0200 Subject: [PATCH 2/2] Check typed's interruption only over the text parts non_text cleared --- bin/loop-claude | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/loop-claude b/bin/loop-claude index 4bb9079f..380e43f3 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -419,7 +419,7 @@ def typed(entry): command = isinstance(content, str) and content.startswith("<") no_content = not isinstance(content, str) and not parts non_text = any(not isinstance(part, dict) or part.get("type") != "text" for part in parts) - interruption = any(isinstance(part, dict) and part.get("type") == "text" and part.get("text", "").startswith("[Request interrupted") for part in parts) + interruption = not non_text and any(part.get("text", "").startswith("[Request interrupted") for part in parts) return not (meta or loop_prompt or command or no_content or non_text or interruption) -- 2.52.0