Skip to content

feat(tui,remote): workbench approval and history; accessibility prefs; binary page carrier - #1359

Merged
huichen merged 6 commits into
mainfrom
pr/huichen
Oct 26, 2026
Merged

huichen merged 6 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

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

  • feat(tui): add diff approval and history workflows
  • perf(remote): carry a read page's chunk bytes outside the JSON
  • feat(tui): add accessibility and notification preferences

Verification

Run locally at 37756ae23 with rustc/clippy 1.97.0 (the pinned toolchain) on macOS arm64:

  • cargo fmt --all -- --check — clean
  • cargo clippy -p future-host -p future-remote-protocol -p future-remote-server -p future-tui -p future-remote-interop --all-targets -- -D warnings — clean
  • cargo test -p future-remote-protocol -p future-remote-server — 28 + 1 + 174 passed, 5 ignored
  • cargo test -p future-tui --lib — 1209 passed
  • cargo 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 ignored

The TypeScript packages (packages/remote-client, packages/remote-protocol) were not run locally: the self-test ran in a detached worktree without node_modules, so CI's TypeScript check / TypeScript test contexts are the gate for them.

Notes

  • Protocol: the paged read negotiates read_binary_v1 (see packages/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.

huichen and others added 6 commits October 26, 2026 07:42
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
@huichen
huichen enabled auto-merge (squash) October 26, 2026 00:25
@huichen
huichen merged commit 4f35867 into main Oct 26, 2026
29 checks passed
@huichen
huichen deleted the pr/huichen branch October 26, 2026 00:43
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