Skip to content

feat: ConnState proofs, Huffman O(1) trie, xDS JSON parser, streaming StreamCallContext (v1.5.0) - #14

Merged
robertbetts merged 1 commit into
developmentfrom
feature/next-steps-v14
Aug 12, 2026
Merged

robertbetts merged 1 commit into
developmentfrom
feature/next-steps-v14

Conversation

@robertbetts

Copy link
Copy Markdown
Contributor

Summary

  • Tranche 1 — H2.ConnState proof foundations (Proofs/ConnState.lean, zero sorry): CONTINUATION sequencing, non-negative recv-window, ENHANCE_YOUR_CALM on oversized header list, GOAWAY gate on new streams.
  • Tranche 2 — Security hardening: O(1) Huffman trie decoder fixes CPU-DoS risk (LGSEC-2026-23) with new EOS/padding lemmas; proper recursive-descent xDS bootstrap JSON parser replaces fragile string scraper (LGSEC-2026-32).
  • Tranche 3 — Streaming StreamCallContext (v1.5.0): Server/Stream/Bidi*WithContext handler types + register helpers + codegen emits context-aware streaming registrars; mTLS peerIdentity + metadata now available in all streaming handler types.

Test plan

  • lake build Proofs — all ConnState + Huffman theorems pass native_decide with no sorry
  • lake build — full clean build (all 59 targets)
  • Verify parseBootstrap handles out-of-order fields, escaped strings, unterminated values
  • Verify Huffman encode→decode roundtrip for "application/grpc" (was broken before trie fix)
  • Smoke-test registerServerStreamWithContext / registerBidiWithContext in helloworld example

Made with Cursor

…ext (v1.5.0)

Tranche 1 — H2.ConnState proof foundations (Proofs/ConnState.lean):
- CONTINUATION sequencing: handleFrame rejects non-CONTINUATION frames when
  expectContinuation is set; wrong-stream CONTINUATION is a connection error.
- Non-negative recv windows: windows ≥ 0 after DATA within budget; overflow → GOAWAY.
- ENHANCE_YOUR_CALM: server rejects oversized header blocks with error code 0xb.
- GOAWAY gate: new streams rejected once wentAway = true; GOAWAY frame sets flag.

Tranche 2 — Security hardening (LGSEC-2026-23 + LGSEC-2026-32):
- Huffman/Huffman.lean: O(1) TrieRow decoder sorted by code-length; fixes stale
  high-bit accumulator bug (mask with 0x3fffffff after each symbol consume);
  adds BEq/DecidableEq for Error; EOS/padding lemmas in Proofs/Hpack.lean.
- Grpc/Xds.lean: replaces ad-hoc string scraper with recursive-descent JSON parser
  (parseVal with structural recursion on fuel); handles field ordering, escapes,
  unterminated values safely; parseEndpointsJson also updated.

Tranche 3 — Streaming ServerCallContext (mTLS IAM parity, v1.5.0):
- StreamCallContext alias (= ServerCallContext) in Grpc/PeerIdentity.lean.
- Stream.{Server,Client,Bidi}StreamHandlerWithContext types in Grpc/Stream.lean.
- MethodHandler.{serverStreamCtx,clientStreamCtx,bidiCtx} dispatch variants.
- Server.register{ServerStream,ClientStream,Bidi}WithContext + typed variants.
- handlerFor dispatch extended to pass ctx to all new handler variants.
- Codegen: emits register{Svc}{Method}{ServerStream,ClientStream,Bidi}WithContext.
- Version bumped to 1.5.0 in lakefile, Grpc.lean, Grpc/Metadata.lean.
- CHANGELOG and ROADMAP updated.

Co-authored-by: Cursor <cursoragent@cursor.com>
@robertbetts
robertbetts merged commit e88691e into development Aug 12, 2026
11 of 12 checks passed
@robertbetts
robertbetts deleted the feature/next-steps-v14 branch August 12, 2026 09:57
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