Skip to content

feat(id): serve-proxy wire protocol slice 1 — typed frame codec (#7569) - #7666

Merged
dezren39 merged 1 commit into
mainfrom
queue/13211-7569-serve-proxy-codec
Nov 8, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/13211-7569-serve-proxy-codec

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Slice 1 of issue #7569: the serve-proxy (ID broker) typed frame codec, per the issue #5792 decision record §2.

What this lands (pkgs/id/src/serve_proxy.rs, ungated pure-std module):

  • Wire format: 4-byte big-endian length prefix + typed frame (type u8, stream u32 BE, seq u64 BE, payload). The decision record fixes the types/caps, not the header layout — the v1 layout is defined and documented in the module.
  • Frame types: OPEN, DATA, CLOSE, WINDOW_UPDATE, PING, PONG, RESUME, RESUME_ACK, ERROR.
  • DATA payload cap 16 KiB enforced on encode and decode; oversized length prefixes are refused before the body is buffered.
  • Leg-scoped stream-ID parity (odd = initiator), scheduling classes (control frames never queue behind DATA), classified ERROR reasons (parent id: design: ID transport fallback for UDP-denied networks v1 #5671 classes + credit-overrun / protocol-violation).
  • Credit-window primitive: 64 KiB/stream and 1 MiB/connection initial windows; try_consume never exceeds granted credit (invariant 5).

Tests (named oracles, per the repo testing doctrine):

  • PBT: decode∘encode = identity over generated frames; streaming decoder chunking transparency (any byte-split yields the same frames); credit-never-exceeded over generated grant/consume sequences.
  • Unit: DATA cap boundary (16384 ok / 16385 refused both directions), truncated-frame handling, ERROR reason and WINDOW_UPDATE round-trips, stream parity.
  • Verified on the laptop: cargo test --lib serve_proxy — 10 passed, 0 failed.

Not in this slice (remaining on issue #7569, in decision-record order): leg establishment (TLS 1.3 / HTTP CONNECT / WebSocket adapter), broker-side stream-ID mapping + priority scheduling across streams, keepalive/dead-leg timing (§4, fake-clock MBT), resumption state machine (§5, model-based no-duplicate/no-reorder tests), and the E2E ciphertext forwarding test.

Filed by queue task 13211 (lane code-g); the task is parked on this PR's CI with the remainder named above.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Implements the framing layer of the #5792 decision record: 4-byte BE length prefix + typed frames (OPEN/DATA/CLOSE/WINDOW_UPDATE/PING/PONG/RESUME/RESUME_ACK/ERROR), 16 KiB DATA cap enforced on encode and decode, leg-scoped stream-ID parity, scheduling classes (control never queued behind DATA), classified ERROR reasons (#5671 classes + credit/protocol), and a credit-window primitive (64 KiB/stream, 1 MiB/connection initial) that never exceeds granted credit.

Oracles: proptest decode-encode identity, streaming-decoder chunking transparency, credit-never-exceeded; 10/10 targeted tests pass on the laptop. Later slices (legs, mux mapping/scheduling, keepalive, resumption, E2E) remain on issue #7569.
@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 8, 2026 11:39
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed78652d-5a29-40e4-ac94-ba7562f19a77

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@developing-today

Copy link
Copy Markdown
Contributor Author

Agent note — task 13211 parked, CI pending (lane code-b, direct)

@developing-today

Copy link
Copy Markdown
Contributor Author

🤖 Agent note · parked — CI pending

@dezren39
dezren39 merged commit 72377c0 into main Nov 8, 2026
7 of 9 checks passed
@dezren39
dezren39 deleted the queue/13211-7569-serve-proxy-codec branch November 8, 2026 20:03
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