docs(wire): catch the wire protocol spec up to what the code actually does - #39
Open
rustyconover wants to merge 1 commit into
Open
docs(wire): catch the wire protocol spec up to what the code actually does#39rustyconover wants to merge 1 commit into
rustyconover wants to merge 1 commit into
Conversation
The wire protocol spec was last touched at 2505b28 and had drifted nine releases. Three request-metadata keys had never been written down, the HTTP half was a release behind on headers and endpoints, and two of its claims would actively mislead a porter. Corrected: - Capability discovery is `OPTIONS {prefix}/health`, not `{prefix}/__capabilities__`. No such route exists in the library; the reference client has never probed it, and neither does the shared conformance suite. The only `__capabilities__` responder in the tree is one a local test fixture adds for itself. - A server implementation error is `200` + `X-VGI-RPC-Error: true`, never `500` — the body is where the typed error lives, and intermediaries discard bodies on 5xx. Stated as its own subsection, because a client that branches on status code alone reads every failure as a success. - The exception's class no longer picks the status (58c93a7), so the "TypeError → 400" row is gone. - Added 413, which the request-size cap has always returned. Newly documented, each of them wire-visible and none of them mentioned anywhere in the spec until now: - `vgi_rpc.protocol_version` — the enforced cross-language version contract, including the exact major+minor rule, the `__describe__` exemption, and why it is the contract and `protocol_hash` is not. - `vgi_rpc.error_kind` — open set, with the four well-known values. - `vgi_rpc.cancel` — presence-is-the-signal, on both pipe and HTTP. - `vgi_rpc.location.sha256` — optional to emit, mandatory to verify. - Content-encoding negotiation, including why `X-VGI-Accept-Encoding` outranks `Accept-Encoding` and why `identity` is listed but never advertised. - Sticky sessions, as a wire surface plus a pointer to the full spec. - The real endpoint list and the full response-header set. Docs-only; `mkdocs build --strict` is clean and every in-page anchor resolves against the built HTML. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
docs/WIRE_PROTOCOL.mdwas last updated at2505b28(~v0.36). Nine releases later it had drifted: three request-metadata keys had never been written down, the HTTP half was a release behind on headers and endpoints, and two of its claims would actively mislead someone writing a port.Corrected
OPTIONS {prefix}/__capabilities__vgi_rpc/. The reference client probesOPTIONS {prefix}/health(http/_client.py:1788), and so does the cross-language conformance suite. The only__capabilities__responder in the tree is onetests/serve_conformance_http.pyadds for itself.500_set_http_statustranslates every 500 into200+X-VGI-RPC-Error: true(http/server/_responses.py:120-136).413when the body exceedsVGI-Max-Request-Bytes.The
200-not-500correction gets its own subsection rather than a table row, because it has a consequence worth stating outright: a client that classifies by status code alone reads every application failure as a success. The body is where the typed error lives, and intermediaries routinely discard bodies on 5xx — which is the whole reason for the translation.Newly documented
Each of these is wire-visible and had zero mentions in the spec:
vgi_rpc.protocol_version— the enforced cross-language version contract. Exact major+minor rule, patch ignored,__describe__exempt,ProtocolVersionErrorcarryingerror_kind. Includes why this is the cross-language contract andprotocol_hashis not.vgi_rpc.error_kind— open set, four well-known values (method_not_implemented,protocol_version_mismatch,session_lost,server_draining).vgi_rpc.cancel— presence-is-the-signal, on both the pipe lockstep exchange and the HTTP/exchangerequest.vgi_rpc.location.sha256— optional to emit, mandatory to verify, computed pre-compression and checked post-decompression.VGI-Supported-Encodings,X-VGI-Accept-Encoding,X-VGI-Content-Encoding. Covers why the custom accept header outranks the generic one (general-purpose HTTP clients inject their own, and gzip measured ~an order of magnitude slower than zstd on large Arrow bodies), and whyidentityis honourable but never advertised.DELETE {prefix}/__session__, failure kinds) and pointing atdocs/sticky-sessions-spec.mdfor the normative contract, matching how the spec already handles proxy-proof and unauthorized.Verification
mkdocs build --strict— clean.id=attributes in the built HTML; all resolve.ruff format --check/ruff check— clean.uv run pytest— 4062 passed, 163 skipped.Docs-only; no code changes.
🤖 Generated with Claude Code