Repository navigation
refactor(wire_frame): port FrameV1 onto backend_sdk codecs (partial #718) - #736
Merged
Merged
Conversation
… backend_sdk codecs (refs #718) Replaces the hand-rolled outer-envelope construction and decode loop in `crates/zccache/src/protocol/wire_frame.rs` with running-process's `Frame::request` / `Frame::response_to` + `frame_ext::encode_framed` / `try_decode_framed`. The bare `pub const ZCCACHE_FRAME_PAYLOAD_PROTOCOL` plus four hand-rolled collision asserts collapse into a single `register_payload_protocol!` invocation, picking up the SDK's compile-time first-party-collision and registered-consumer-range checks. The public API surface (`encode_frame_v1_request`, `encode_frame_v1_response`, `decode_frame_v1_message`, `FrameV1Decoded`, `buffer_starts_running_process_frame`, `ZCCACHE_FRAME_PAYLOAD_PROTOCOL`) is unchanged, so transport.rs / connection.rs / tests are not touched. ## Acceptance - Golden bytes identical: `frame_v1_request_golden_bytes_are_frozen`, `frame_v1_golden_round_trips`, `frame_v1_rejects_foreign_payload_protocol` in the unit tests, plus `request_frame_encodes_to_golden_bytes`, `response_frame_encodes_to_golden_bytes`, and the live + mixed-wire daemon integration tests in `daemon_wire_frame_v1_test.rs` all pass. - Net-negative LOC: -15 lines on `wire_frame.rs` (86 deletions, 71 insertions). The rest of the #718 refactor (mux integration in `transport.rs`, `next_frame_request_id` / `send_frame_v1_*` removal, `ResponseWire::FrameV1` → mux payload-handler closure in `connection.rs`) has a much larger blast radius and is staged for a follow-up PR. Refs #718
2 tasks
This was referenced Jun 14, 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.
Closes part of #718 (the
crates/zccache/src/protocol/wire_frame.rsslice). The transport.rs / connection.rs work in the issue body has a much larger blast radius and will land as a follow-up.What changed
crates/zccache/src/protocol/wire_frame.rsnow delegates outer-envelope construction and decoding to running-processbackend_sdkcodecs:Frame::request(ZCCACHE_FRAME_PAYLOAD_PROTOCOL, payload).with_request_id(id)+frame_ext::encode_framed(andFrame::response_to(&template, payload)on the response path). Replaces hand-rolledFrame { … }literal +[1][LE len][prost]byte assembly inencode_frame_v1_message.frame_ext::try_decode_framed+ buffer advance, replacing hand-rolled body-length parsing +Frame::decode.pub const ZCCACHE_FRAME_PAYLOAD_PROTOCOL: u32 = 0x7A63;+ four hand-rolled collision asserts collapse into onerunning_process::register_payload_protocol!invocation, which inherits the SDK's compile-time first-party-collision and registered-consumer-range checks (tracksrunning_process::broker::protocol::registry::ZCCACHE_PAYLOAD_PROTOCOL).The public API surface —
encode_frame_v1_request,encode_frame_v1_response,decode_frame_v1_message,FrameV1Decoded,buffer_starts_running_process_frame,ZCCACHE_FRAME_PAYLOAD_PROTOCOL— is unchanged, sotransport.rs,connection.rs, andtests/daemon_wire_frame_v1_test.rsneed no edits.Acceptance
protocol::wire_frame::testspass; all 10 integration tests intests/daemon_wire_frame_v1_test.rspass (including live daemon round-trip and mixed-wire/backend-probe coexistence).What is left in #718 (follow-up)
transport.rs: deletetry_serve_backend_handle_probe, probe-sideensure_buffered,is_backend_handle_probe_request,backend_handle_probe_response,write_running_process_frame; replace the accept-path call withBackendEndpointMux(legacy detector = existing v15/v16 header check); dropnext_frame_request_id+send_frame_v1_request/responseonceFrameClientowns correlation on the client side.daemon/server/connection.rs: replaceResponseWire::FrameV1plumbing with the mux payload-handler closure.tests/daemon_wire_frame_v1_test.rs: keep the golden-bytes constants verbatim; replace the bespoke live/mixed-wire harness with the conformance kit.These are non-trivial restructures of the daemon's accept loop and wire dispatch; splitting them out keeps this PR small and verifiable.
Test plan
soldrtest onprotocol::wire_frameunit tests (3/3 pass)soldrtest ondaemon_wire_frame_v1_testintegration tests (10/10 pass)-D warningsRefs #718, #735