gw-02 — Verification

One command

cd gw-02-l7-protocols && bash scripts/verify.sh

What the tests prove

TestInvariant
TestEncodeDecodeIntHPACK integer coding matches RFC 7541 §C.1 vectors exactly (10/5-bit, 1337/5-bit, 42/8-bit)
TestFrameRoundTripframe write→read preserves type/flags/stream/payload; END_STREAM decoded
TestReadFramesMultiplexinterleaved frames for streams 1 & 3 parse in order (multiplexing)
TestHpackStaticIndexedstatic-table indexed field decodes (0x82:method GET)
TestHpackRFCRequestExamplesRFC 7541 §C.3.1 + §C.3.2 decode correctly with a persistent dynamic table (the 0xbe dynamic reference)
TestHpackEncodeDecodeRoundTripencoder→decoder round-trips; a literal becomes dynamically indexable
TestHpackDynamicEvictiondynamic-table size accounting + eviction (len+len+32, evict oldest over max)
TestHpackHuffmanSurfacedHuffman strings surface ErrHuffman (no silent garbage)
TestFlowControltwo-level windows: stream-only WINDOW_UPDATE is insufficient while the conn window is 0
TestDemuxMultiplexingper-stream phases + concurrent stream set reconstructed from an interleaved trace

All under -race.

What "green" does NOT guarantee

  • No Huffman codec. Real captures Huffman-code headers; this decoder surfaces that and defers to x/net/http2/hpack (GUIDE §2). The framing, demux, and flow control work regardless.
  • Not a full codec. No CONTINUATION reassembly, PRIORITY trees, or SETTINGS negotiation state machine — out of scope; production = Envoy's HCM / x/net/http2.
  • No live gRPC LB demo in-process. The skew is reproduced as a shell exercise (steps/03) against real backends.