Name each clause of typed for the entry kind it drops #74
+8
-5
@@ -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 "<" (<command-name> 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 = 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)
|
||||
|
||||
|
||||
# "assistant" entries and stream-json
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user