Skip to content

Decode an empty event; test a stream holding events sent as their own text - #14

Draft
talwgx wants to merge 1 commit into
mainfrom
feat/template-create-after
Draft

talwgx wants to merge 1 commit into
mainfrom
feat/template-create-after

Conversation

@talwgx

@talwgx talwgx commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Two fixes for compact streams, with tests.

  1. An empty event decodes to an empty line. The engine writes the template record of an empty event with a null template (hash -J}UrlyaKD8). The CLI took the null for a missing template, logged two warnings and wrote ~-J}UrlyaKD8 instead of the empty line. A hash that has a record now decodes, a null template being the empty template; a hash with no record is still written as read with a warning. This affects every compact stream that holds blank lines, with or without the Receiver option below.
  2. Events written as their own text. With the Receiver option templateCreateAfter, a compact stream holds encoded lines and events sent as their own text. The engine writes every event whose text starts with ~ encoded, so a line without the prefix is an event's text. Main already passes such a line through untouched; this adds a test of a mixed stream (including a plain line whose text before the first comma is a known hash) and README text on -d , -p '~'.

How it was checked. 29 tests pass (javac and the JUnit launcher, offline). On compact files from the engine branch, 24 source and framing pairs: the CLI's output from a stream with events written as text equals its output from the same input fully compact, and equals the input wherever the fully compact decode does; 0 warnings (before the fix, one pair of warnings per blank line).

🤖 Generated with Claude Code

… own text

An empty event's template is empty, and the engine writes its template record
with a null template (hash -J}UrlyaKD8). TemplateProvider took the null for a
missing template, warned twice and wrote the encoded line as read, so a blank
line came back as "~-J}UrlyaKD8". A hash with a record now decodes, a null
template being the empty template; a hash with no record is still kept as
read with a warning.

Tests: an empty event between encoded ones; a stream that mixes encoded lines
with events written as their own text (lines that do not begin with ~ pass
through untouched and are not looked up, even when the text before their
first comma is a known hash). README: the -d and -p arguments that match the
engine's compact lines, and what happens to a line without the prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant