Repository navigation
refactor(cli): print json and jsonl through Loom's views, and stop store export truncating control characters (MMR-595) - #516
Merged
Merged
Conversation
…MR-595) Commands now hand Loom's json() and jsonl() a data projection instead of pre-serialized text, so encoding and control escaping are Loom's and the CLI's serializers and C1 escaping are gone. A view spec states the document, whether it prints on one line, and whether jsonl repeats it, prints it compact, or streams rows. Two narrow adapters keep the established bytes: an empty row list still prints one empty line, and a document printed under both formats keeps each format's media type. The host admin CLI's views move with it. store export - prints the transfer document exactly as a file holds it under every format, as the released CLI does, instead of re-escaping C1 controls under json and jsonl.
…der every format (MMR-595) Loom's style resolution drops DEL and C1 controls from view text, and a CSI or control-string character swallows the text after it, so a raw transfer document carrying one printed truncated. The stream now prints through one document view that writes those characters as \uXXXX escapes, which inside JSON strings parse to the same characters. This restores the json and jsonl behavior and fixes records, ids, and table, which already truncated.
…f the fix (MMR-595)
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Loom CLI and
mimir-hoststill serialized their own JSON: every command pre-stringified its document, and the CLI kept a copy of Loom's control escaping and media-type wrappers. That is a second way to do a job Loom 0.15'sjson()andjsonl()views already do.Commands now give Loom data. Each view spec names the document's projection, whether it prints on one line, and whether
jsonlrepeats the document, prints it compact, or prints one line per row. Two narrow adapters keep the existing bytes. An empty row list still prints one empty line, and a document printed under both formats keeps each format's media type. The CLI's serializers and its C1 escaping are gone. The host admin commands (doctor,pairing,tokens) moved with it.Review found a real problem here.
store export -prints a raw transfer document rather than data, and Loom's style resolver strips DEL and C1 controls from raw view text. A CSI or control-string character also swallows the text after it, so a backup piped from a store with such a title came out truncated. The stream now prints through one document view that escapes those characters as\uXXXX. That restores thejson/jsonlbehavior and fixesrecords,ids, andtable, which already truncated on main.Validation:
bun run verify: 5,077 Bun tests and 1,069 UI tests pass, including the full parity harness.bun run test:host: 7 pass.render/views.test.tscovers media types, compact array documents, rows, the empty-list newline, and C1 escaping.commands/store.test.tschecks that a control-laden title survivesstore export -in all five formats.Two independent Opus reviews ran. Round 1 found the export truncation, which is fixed here. Round 2 found two wording issues, both fixed.
Implemented with Claude Opus 5.5 in the Claude Code harness.