Define a human turn at typed, the entry it tests

This commit is contained in:
2026-09-25 17:43:05 +02:00
parent 75bc4885fd
commit 8a021bbe02
2 changed files with 7 additions and 6 deletions
+7 -5
View File
@@ -25,9 +25,7 @@ boundary, once the new file answers --help.
Claude Code internals this rests on, observed on 2.1.282:
- The transcript is ~/.claude/projects/*/<session-id>.jsonl, one JSON object per line. A <session-id>/
folder and <session-id>.superseded-*/ and .orphaned-*.jsonl siblings belong to the same session.
- Claude Code writes "user" entries of its own: isMeta ones, tool_result lists, strings starting with
"<" (<command-name> and its kind) and text parts starting with "[Request interrupted". A typed human
turn is any other "user" entry.
- Claude Code writes "user" entries of its own into the transcript; typed() tells a human's from them.
- An "assistant" entry, in the transcript and in --output-format stream-json, carries message.content
parts of type "text" (text) and "tool_use" (name, input); stream-json ends with a "result" event.
- `claude -p --output-format json --json-schema` returns the verdict under "structured_output".
@@ -174,7 +172,11 @@ def render(entries):
return "\n\n".join(lines)
def typed(content):
def typed(entry):
"""A human turn: a "user" entry, not isMeta, whose message.content is a string not starting with "<" (<command-name> and its kind) or text parts none starting with "[Request interrupted"; Claude Code writes the rest, tool_result lists among them."""
if entry.get("type") != "user" or entry.get("isMeta"):
return False
content = entry.get("message", {}).get("content")
if isinstance(content, str):
return not content.startswith("<")
parts = content if isinstance(content, list) else []
@@ -182,7 +184,7 @@ def typed(content):
def human_turns(entries):
return sum(1 for entry in entries if entry.get("type") == "user" and not entry.get("isMeta") and typed(entry.get("message", {}).get("content")))
return sum(1 for entry in entries if typed(entry))
def make_private(folder):
-1
View File
@@ -4,7 +4,6 @@
Ordered by how many seats of the 2026-09-25 scoring panel (`docs/decisions.md`) named the place; each is one chunk.
- Define a human turn at `typed` in one line and name what it tests, today the definition sits in the docstring 150 lines above.
- Place `larv-review`'s Re-entry section after the passes it cites, today five forward references before §0.
- State the fits-in-your-head thresholds once in `agents/systems-architect.md`, cited by heading, today echoed at seven places and cited as "step 4" by number at nine; fold the Quality Bar into the sections it restates.
- Say why the worker failed when `claude` exits 0 without a result event, today `run_worker` returns `{}` for that and for a non-zero exit and prints nothing.