feat: ConnState proofs, Huffman O(1) trie, xDS JSON parser, streaming StreamCallContext (v1.5.0) - #14
Merged
Merged
Conversation
…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>
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.
Summary
H2.ConnStateproof foundations (Proofs/ConnState.lean, zerosorry): CONTINUATION sequencing, non-negative recv-window,ENHANCE_YOUR_CALMon oversized header list, GOAWAY gate on new streams.StreamCallContext(v1.5.0):Server/Stream/Bidi*WithContexthandler types + register helpers + codegen emits context-aware streaming registrars; mTLSpeerIdentity+ metadata now available in all streaming handler types.Test plan
lake build Proofs— all ConnState + Huffman theorems passnative_decidewith nosorrylake build— full clean build (all 59 targets)parseBootstraphandles out-of-order fields, escaped strings, unterminated valuesregisterServerStreamWithContext/registerBidiWithContextin helloworld exampleMade with Cursor