Repository navigation
feat(id): negotiated binary v2 ScreenPatch transport — F12.11 phase 3 Rust slice (#12242) - #12655
Merged
Merged
Conversation
…12242) Join gains an additive screen_msgpack opt-in (shell contract revision 12). When it is set together with screen_patches and the transport carries bytes, patch frames are sent as one versioned MessagePack binary frame (id-core screen_codec ViewPatchFrame: sequence, view_revision, base_view_revision, resume_token, patch) instead of the JSON view frame, whenever the binary patch is smaller than the full view. Full views and all other frames stay on the text path; v1 clients and text-only transports keep the exact JSON behavior, and an offer the transport cannot take up negotiates down to JSON patches. SessionIo gains a byte capability (supports_bytes / send_bytes, text-only by default) and Inbound::Bytes; client binary frames fail safely like non-UTF-8 frames. The iroh and SSH length-prefixed transports mark binary bodies with a leading NUL (never a JSON start); WebSocket uses native binary messages. Codec: golden vector + round-trip proptest + unsupported-version / trailing / oversized rejection for the view-patch envelope. Session tests: negotiated binary catch-up patch applies with full-view parity, text-only fallback stays JSON, binary frames before and after join fail safely.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
dezren39
pushed a commit
that referenced
this pull request
Nov 22, 2026
…12242) The TS half of F12.11 phase 3, on the Rust slice merged in #12655: the session join now offers screen_msgpack alongside screen_patches, binary WebSocket messages decode through a strict MessagePack view-patch decoder at golden-vector parity with id-core's screen_codec, and a decoded patch applies exactly like a JSON view frame's patch — with the same full-view fallback (a same-size resize) when the frame is malformed, unsupported, or its base revision does not match. JSON patches on an offered session remain accepted, per the contract's offer-and-observe rule.
dezren39
pushed a commit
that referenced
this pull request
Nov 22, 2026
…-lint passes The #12655 test module used unwrap() in its proptest strategies and golden tests without the test-module allow the codebase requires (pkgs/id AGENTS.md); clippy-lint has been red on main since the merge. No production code changes.
This was referenced Nov 22, 2026
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 slice
The negotiation itself, Rust side: an explicitly negotiated binary v2
ScreenPatchsession path on the #12241 MessagePack codec, covering acceptance bullet 1 and the Rust half of bullet 2 of #12242. TypeScript golden parity and the browser client decode are the follow-up slice (below).Negotiation + fallback semantics
screen_msgpackflag (shell contract revision 12), following the existingscreen_patchesserde-default pattern. No ALPN/path v2 split: the contract's own rule is that additive changes bumprevision, and there is no in-repo v2 client to negotiate with at the ALPN level.screen_patchesis on AND the transport is byte-capable (SessionIo::supports_bytes, defaultfalse). Selection is by use — no confirmation frame: a negotiated session either receives binary patch frames or keeps receiving JSON ones.id_core::screen_codec::ViewPatchFrame) carrying exactly the JSONviewframe's patch fields —sequence,view_revision,base_view_revision,resume_token,patch— so world-event cursor and view-revision semantics are unchanged. A patch is sent binary only when it encodes smaller than the full view; encode failure falls through to the existing JSON patch/full-view choice. Full views and every other frame stay text.id_core::frames::BINARY_FRAME_MARKER— JSON text frames always start with{); WebSocket uses native binary messages.Evidence
Fail-before: at base
9b88acfdanone of this exists — the offer is ignored, patches are JSON-only, and the new tests fail to compile against base (the codec envelope, join field,Inbound::Bytes, and the byte capability are all new).Sandbox (this worktree):
cargo test -p id-core --lib— 533 passed (codec: golden vector for the view-patch envelope, round-trip proptest, unsupported-version/trailing/oversized rejection; frames: marker round-trip)cargo test -p id-worlds --lib world_session::— 84 passed, incl. the 4 new session tests: negotiated binary catch-up patch decodes and applies with full-view parity; offer on a text-only transport stays JSON; binary frames before/after join fail safelycargo test -p id-worlds --lib shell_contract— 12 passed (revision pins moved 11 → 12);contract_tests— 5 passedcargo fmt --check -p id-core -p id-worlds -p id-web— cleanLaptop (fleet shell, worktree at this head):
cargo test -p id-web --lib world_ws— 20 passed (WebSocket adapter incl. binary messages)cargo test -p id-worlds --lib world_net— 53 passed (iroh adapter; the coordinator test in this set times out in the sandbox at base too — QUIC loopback is unavailable there — and passes here)cargo test -p id-worlds --lib --features ssh,sandbox world_ssh— 49 passed (SSH adapter)Not run: id-native-shell tests — their build needs wayland client libs a bare laptop shell lacks (
wayland-sysbuild script); no native-shell code changes here, and the contract it embeds is validated by the shell_contract suite above.Dependencies
None.
rmp-serdewas already a dependency from #12241; no Cargo.toml changes.What remains on #12242
id-webclient decode of binary patch frames + TS golden-vector parity against the pinned Rust vectors (bullet 3's TS half, bullet 2's browser half).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.