Repository navigation
fleet(proxy-proto): proxy-mux stream frame family — wire contract for #5756 (§7 step 1) - #13330
Conversation
…5756 (§7 step 1) Implements step 1 of the merged seam record (doc/2026-11-16T10-40-00Z_design_id5756_multiplexed_streams_seam.md): the stream frame types (open/data/window/rst/ping/pong) inside the existing 8-byte length-prefixed JSON framing, discriminated by kind; the proxy-mux hello capability with a both-peers negotiation helper; window/credit semantics as a type (64 KiB data-frame bound, 256 KiB initial per-stream window); per-stream timeout ceiling type (10 s default, 15 s hard cap, well under the 16-26 s failure cluster); keepalive/idle-exit constants carried from the issue. Dormant contract only: no peer sends these frames until both hello peers advertise proxy-mux, and no existing behavior changes — the no-one-sided-shipment rule (record §5). Proxy mux, client path, broker dispatch, and the acceptance harness are follow-on steps 2-5 of the record's §7 split. New dependency for this crate: base64 0.23 (already used by the fleet bin crate at the same version) for data-frame payloads.
|
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 14 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be5bcbe299
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #[test] | ||
| fn window_credit_bounds_both_directions() { |
There was a problem hiding this comment.
Add generated model tests for the credit-window invariants
The new StreamWindow state machine is covered only by a fixed operation sequence, despite having explicit credit-conservation and window-bound invariants. This violates the testing doctrine in AGENTS.md, which requires property tests for invariant-bearing code and model-based tests where a specification exists; the linked doctrine explicitly says example tests do not replace these. Add generated send/grant/receive/consume sequences checked against an independent credit model, including rejected-operation state preservation and receive/consume conservation, and name that model as the oracle.
AGENTS.md reference: AGENTS.md:L36-L39
Useful? React with 👍 / 👎.
Implements step 1 of the merged seam record for #5756 (
doc/2026-11-16T10-40-00Z_design_id5756_multiplexed_streams_seam.md§7): thefleet-proxy-protoslice. The rest of #5756 (proxy mux, client path, broker dispatch, acceptance harness — record §7 steps 2–5) is untouched and still open; this PR does not close the issue.What lands
New module
fleet_proxy_proto::mux— the wire contract only:open/data/window/rst/ping/ponginside the existing 8-byte length-prefixed JSON framing, discriminated bykind(record §4, decision D1).opencarries stream id, target port, method/path or raw-connect intent, and the trip id;datacarries a base64 payload chunk withfinhalf-close and the broker's first-responsestatus;rstreasons are named constants (cancelled,timeout,tunnel_lost,port_not_served,protocol_error).proxy-muxcapability (CAP_PROXY_MUX) +mux_negotiated(): the mux activates only when BOTH hello peers advertise it (record §5). It is a wire-negotiation capability string owned by the proto crate, deliberately not a fleet-registry build capability — mux is negotiated behavior, not a build surface.MAX_DATA_PAYLOAD_BYTES= 64 KiB (enforced in thedataconstructor,payload(), andvalidate());StreamWindow— the credit window as a type (256 KiB initial;sendrefuses overrun of granted credit,receiverefuses peer overrun of the granted window,consumereturns credit to grant back);StreamCeiling— per-stream timeout, default 10 s, hard cap 15 s, well under the historical 16–26 s failure cluster; keepalive/idle-exit constants (180 s / 3600 s) carried from the issue.StreamId::client); id 0 on the wire fails validation.Compatibility
Dormant by construction: no peer sends these frames until both sides advertise
proxy-mux, and nothing in this PR advertises it — no existing behavior changes anywhere; the pooled HTTP-per-call path stays byte-for-byte in charge (the record's no-one-sided-shipment rule). Stream frames are additive within protocol major 1; unknown fields are tolerated, unknownkinds are not stream frames.Evidence
Dispatched remotely (fleet-command workflow, developing-today/fleet run 45185203954, head be5bcbe):
cargo test -p fleet-proxy-proto— 20 passed / 0 failed (10 pre-existing + 10 new contract tests: negotiation, frame shapes, intent, id rules, 64 KiB bound, unknown-field tolerance, window credit in both directions, ceiling bounds, framing roundtrip);cargo check -p fleet-proxyclean;cargo clippy -p fleet-proxy-proto --all-targetsclean. (First run caught one wrong expectation in my own window test — the implementation was right, the test's arithmetic was not; fixed in be5bcbe.)Venue note: the fleet build container ships no cargo and its nix cannot build the root dev shell (missing
nixbldgroup, then a/homeless-shelterbuild purity error), so the dispatched command bootstraps the pinned toolchain (1.99.1, perpkgs/fleet/rust-toolchain.toml) via rustup into the run's CARGO_HOME/RUSTUP_HOME caches. Filed separately as a runner-surface issue.New dependency
base64 0.23added tofleet-proxy-protofor data-frame payloads — the same version thefleetbin crate already uses; no new crate enters the project's dependency graph.Refs #5756
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.