Repository navigation
feat(tui,remote): workbench approval and history; accessibility prefs; binary page carrier - #1359
Merged
Merged
Conversation
A paged read's chunk was base64url-encoded into `readChunk.data` before the
reply was JSON-serialized and gzipped. The wire below that JSON is binary
already (the reply is sealed and published as bytes), so the 4/3 expansion
bought nothing there: measured on a real-shaped 4 MiB page, and confirmed on the
socket with a counting proxy, it costs 31% of the encoded reply on prose, 44% on
identifier-heavy text and 54% on tool output.
`read_binary_v1` is a negotiated increment, not a protocol bump. A client
declares it on `secure_ready` only after the host's confirmation advertised it;
the host frames a page only for a connection that declared it. A frame is
`"FBR1" | u32 BE header length | header JSON | raw bytes`, so every field a
reader pins — id, offset, nextOffset, totalBytes — is still JSON and only the
bytes' carrier moved. gzip still applies, to text the compressor can model.
Both ends and both clients:
- protocol: the frame's builder/reader plus the advertised capability;
- server: `ReplySink::send_binary`, whose default is the legacy base64 page, and
`NatsReply::send_binary`, which frames only for a declared connection;
- host: a page is handed to the sink as header+body, so the carrier is the
sink's decision rather than the transport's;
- Rust client: `session::Reply::{Data, Page}`, decoded by shape, with `PageChunk`
folding both carriers into one set of snapshot checks;
- TS client (phone and desktop): the frame is split before JSON parsing and its
bytes ride beside the reply for `requestReadPage`.
The socket measurement also found a defect it had to fix to be meaningful:
`get_read_chunk` skips the single-flight reply cache, and the negotiated gzip
flag was installed by that wrapper, so every chunk after a page's first was
served uncompressed — 262 KB of base64 per chunk instead of ~90 KB, for every
client since `reply_gzip_v1` landed. The flag now lives in `handle_command`,
the one function every command path reaches, and a test fails if a fetched
chunk is not compressed.
`docs/testing/remote-page-encoding-2026-10-26.md` records the measurements
(encoder and socket bytes per corpus, per-chunk CPU, loopback wall clock), why
the number is 31% and not the 44.6% this replaced, what is not measured, and the
gates run.
Refs: docs/testing/remote-page-encoding-2026-10-26.md
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.
What and why
Three pieces of work land together on the long-lived dev branch: the TUI workbench gains diff approval and history workflows (with its skills and worktree panels), it gains accessibility and notification preferences, and a paged remote read can now carry a chunk's bytes beside the JSON instead of base64-encoded inside it.
Commits
Verification
Run locally at
37756ae23with rustc/clippy 1.97.0 (the pinned toolchain) on macOS arm64:cargo fmt --all -- --check— cleancargo clippy -p future-host -p future-remote-protocol -p future-remote-server -p future-tui -p future-remote-interop --all-targets -- -D warnings— cleancargo test -p future-remote-protocol -p future-remote-server— 28 + 1 + 174 passed, 5 ignoredcargo test -p future-tui --lib— 1209 passedcargo test -p future-remote-interop --features network-tests --test page_encoding— 6 passed, 1 ignored (real nats-server on loopback)cargo test -p future-host --lib -- remote read_pages— 582 passed, 8 ignoredThe TypeScript packages (
packages/remote-client,packages/remote-protocol) were not run locally: the self-test ran in a detached worktree withoutnode_modules, so CI'sTypeScript check/TypeScript testcontexts are the gate for them.Notes
read_binary_v1(seepackages/remote-protocol/fixtures/protocol.json). A client that does not declare it keeps receiving base64 pages, so existing clients are unaffected.docs/testing/remote-page-encoding-2026-10-26.md(and its zh-CN pair) records the measurement behind the carrier change.