Skip to content

Split Claude Code transcripts only at their newlines - #3719

Merged
max-sixty merged 4 commits into
mainfrom
transcript-line-separators
Oct 23, 2026
Merged

max-sixty merged 4 commits into
mainfrom
transcript-line-separators

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The Claude Code journey's transcript reads still failed with JSONDecodeError: Unterminated string, after #3700. The cause was not a half-written last line, as #3700 assumed. Claude Code writes U+2028 and U+2029 raw inside JSON strings, which JSON allows, and both readers split the transcript with splitlines(), which breaks a line at those characters. A transcript kept from a failed run held one U+2028 and one U+2029: 113 newlines, but 115 lines to splitlines().

Both readers now share reply_phases.transcript_records:

  • journey_claude_code.native_records reads the journey's session.
  • claude_code_transcript reads a session for leaf-dev response-times.

It splits only at the newline Claude Code writes after each record, and keeps #3700's rule of leaving out a record still being written. The transcript test now holds a raw U+2028 inside a string. It fails without the fix and passes with it.

This follows up #3700, the transcript-read fix from Max's decision #46 on the overnight report. leaf.event_log.jsonl_line already escapes these characters in the page log for the same reason.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 4 commits October 23, 2026 01:12
Composing a vocabulary now writes $tones and $languages into the enum of
each attribute marked x-tone or x-language (stamp_words), so the entry
an agent reads lists the words. Validation reads that enum through the
attribute schema, replacing the separate DECLARED_WORDS pass and its
unknown-word finding, and `page instructions --use` lists any
attribute's enum from the schema, replacing #3690's listing.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…gistry

A page vendored before the declared words moved into each attribute's
enum carries a registry without them, and would pass an unknown tone or
language.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude Code writes U+2028 and U+2029 raw inside JSON strings, and
splitlines() broke a transcript line at them, failing the journey with
an unterminated string. Both transcript readers now share
reply_phases.transcript_records, which splits at newlines alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 9e53b0d into main Oct 23, 2026
3 checks passed
@max-sixty
max-sixty deleted the transcript-line-separators branch October 23, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants