Repository navigation
docs: architecture page, diagrams across the guide, and stale-fact fixes - #6
Merged
Merged
Conversation
Add guide/architecture.md (Introduction group, listed in llms.txt): the layers a call crosses, the life of one call, the four entry points into RpcServer, one connection's object model, the receive and send paths with the per-carrier order of compression and encryption, the client's internals, the extension seams, and the topology across instances. Add mermaid diagrams where the mechanics were prose only: HTTP routing (server), revision negotiation and the packet exchange (protocol), where each encryption layer applies, the Noise handshake and a sealed HPKE request (encryption), per-direction codec choice (compression), the broker capability model, a queue delivery's settlement, stateless vs session broker RPC, the WebTransport session and hosting path, the WebRTC peer composition, the ws metadata carrier, where client.api comes from (typed client), the worker proxy, the deployment topology, the two rate-limiting layers, trace propagation through a broker, and the express/fastify wiring. Every diagram was checked against src/, rendered in both themes and at mobile width, and kept under ~1100px natural width so it stays legible. Two corrections found on the way: the client's reconnect state diagram now matches #scheduleReconnect/#openOrClose (the first connect never waits, fallback and restore-failed transitions, failed is not final), and broker RPC no longer claims NATS answers 503 for an address nobody listens on — the in-process broker, Redis and RabbitMQ do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each checked against the source: - createPublisher writes the trace context under the W3C header names traceparent/tracestate (renamed from the packet fields tp/ts the injector writes); consumers.js reads traceparent, falling back to tp. - The envelope receiver's per-(kid, suite ‖ salt) cache evicts the least recently used entry past maxSenders (1024 by default), not the oldest; the sealer skips its own last 16 salts, not one. - A sealed SSE stream's key also mixes in a per-stream server nonce, carried as n= in the Content-Type (streamKey in src/encryption/http.js). - "No frame names its codec" holds for WebTransport and WebRTC; a broker binding frame names it in wrpc-enc. - client.md › Transport fallback: reconnect.retries defaults to Infinity, so after the first connection the next candidate is never reached unless the budget is finite — only the first connect walks the list on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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
Adds architecture diagrams that show how wRPC's pieces work together: a new Architecture page, plus mermaid diagrams on the guide and reference pages that only described their mechanics in prose (32 new diagrams in total). I checked every diagram against
src/before drawing it, and the check turned up a few statements in the docs and inCLAUDE.mdthat no longer match the code. Those are fixed here too.New page:
guide/architecture.mdUnder Introduction, after "Why wRPC?", and listed in
llms.txt:callthrough every layerRpcServerthroughattachSocket,handleHttpCall,attachorattachPortRpcServer,Client,ServerTransportandContext, plus what is injectedWrpcClientoutbound and inboundDiagrams added to existing pages
WrpcPeer,PeerLink,RtcLink,PeerHostandMeshfit togetherclient.apicomes from (load(),use(),.d.ts)onRequestseesCorrections
#scheduleReconnectand#openOrClose. The first connect never waits. The fallback andrestore-failedtransitions were missing.failedis not final: theonlineevent oropen()restarts the cycle.retries: Infinitythe next candidate is never reached once a connection has been up.503when nobody listens on the address. NATS core publish cannot know. The in-process broker, Redis and RabbitMQ do answer503.traceparent/tracestatein message headers, nottp/tsmaxSenders, not the oldestn=)wrpc-enc)Verification
pnpm docs:buildpasses (dead links)#anchorlink resolves to an existing heading in the built HTMLnode --test tests/package/consistency.test.jspasses (26/26)Notes for reviewers
;inside a sequence-diagram message or note ends the statement and breaks the diagram, and a subgraph withdirection TBinside anLRflowchart can explode into a single very wide row.🤖 Generated with Claude Code