Mouth: pin the malformed-line tail gap

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-11 10:30:11 +00:00
commit 290a9131d8

View file

@ -1660,3 +1660,9 @@ test("tail gaps: the builder refuses a repeated room, and a pre-gap decoder is s
assert.throws(() => docs.parsePendingV3(["eureka", [], []]), /4-field/);
assert.throws(() => docs.parsePendingV3(["eureka", [], [], "#a:x"]), /list/);
});
test("tail gaps: a line the mouth drops as malformed (no event id) gaps its room; a clean room beside it does not", async () => {
const { tail, gaps } = await tailed({ preload: { [ROOM]: [message("", META, "no id", 10), message("$ok", META, "fine", 11)], [OPERATOR]: lines(OPERATOR, 1) } });
assert.deepEqual(tail.map(l => l.eventId).sort(), ["$ok", "$ope0"].sort());
assert.deepEqual(gaps, [SWARM_ALIAS]);
});