docs(proposals): VEP-0004 — HTTP transport for vouch serve (draft) - #104
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR introduces an HTTP transport for the Vouch knowledge base via ChangesHTTP Transport Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@plind-junior This PR is ready for review. I've added the HTTP transport feature to be used for claude code and codex integration |
|
LGTM! |
…nnel Closes #176. Promotes VEP-0004 from draft to accepted by delivering the spec-compliant HTTP transport the five Claude surfaces require (Claude.ai Custom Connectors, Claude mobile write, Anthropic Managed Agents, Messages-API mcp_servers, Computer Use). The vouch-native /rpc envelope from PR #104 keeps working byte-for-byte; the new /mcp endpoint is what unblocks the Claude surfaces. What changes: * src/vouch/http_server.py rewritten on Starlette + uvicorn. One ASGI app mounts FastMCP's StreamableHTTPASGIApp at /mcp (and /messages alias), plus the existing /rpc, /healthz, /capabilities routes. /health is a new alias for /healthz so Claude.ai's connector validator can probe it. * Bearer auth becomes multi-token. The legacy --token still works; the new accept-list is read from config.yaml under a serve: section that supports bearer_tokens: [list] and bearer_token: env:VAR for env-var-referenced secrets. * FastMCP runs stateless + json_response mode so curl-shaped clients don't need to track Mcp-Session-Id between calls. * adapters/http-tunnel/ ships three reference deployments: a base Dockerfile, a fly.toml for managed-TLS, and a cloudflare-tunnel compose.yml for no-open-port self-hosting. Each treats the bearer token as the trust boundary -- vouch refuses to bind a non-loopback host without at least one token. * tests/test_http_server_mcp.py adds 14 tests covering MCP initialize, tools/list, tools/call kb_status round-trip, /messages alias, bearer-required-when-set, multi-token accept-list, /health alias, config.yaml YAML parsing (list + env-ref + missing-env-ref + empty section), and three regression tests that prove the legacy /rpc, /healthz, and /capabilities surface still behaves exactly as before. * tests/test_http_server.py: the negative-Content-Length test is updated to accept uvicorn's transport-layer 4xx response (which is at least as safe as the prior application-layer 400-JSON path). * proposals/VEP-0004-http-transport.md: status draft -> accepted, open-questions block resolved (bespoke REST vs MCP -> both; config vs flags -> both; default port stays 8731), endpoint table updated. Why "max-feature": #176 is a high-leverage unblock for Bittensor/Gittensor contributors who run multiple AI agents in parallel, so the spec-compliant path, the multi-token rotation story, and the public-internet reference deployments all need to ship together -- a partial fix would leave the trust-boundary story half-documented and force every operator to figure it out from scratch. The kb.* surface is unchanged: 44 tools, same parameter and result shapes across stdio, JSONL, /rpc, /mcp. CI: ruff clean, mypy clean, 330 pytest passed (316 prior + 14 new + 0 regressions).
Summary
vouch serve(--transport http), per the project process that requires a written, maintainer-accepted proposal before any code for a new transport (feat: HTTP transport forvouch serve(--transport http) [VEP] #94 is tagged [VEP]).proposals/README.mdasdraft.Why a VEP and not a code PR
proposals/README.mdrequires a VEP for "any new transport," reviewed and markedacceptedbefore implementation. HTTP transport qualifies, so this opens the design for discussion rather than shipping a server.What the VEP proposes
vouch serve --transport http [--host 127.0.0.1] [--port …] [--token …] [--allow-public], reusing the existing shared_handle_requestdispatch table (samekb.*surface as MCP/JSONL — no new methods).POST /rpccarrying the same JSONL envelope as VEP-0002; plus unauthenticatedGET /capabilitiesandGET /healthz.127.0.0.1; refuses any non-loopback bind unless--allow-publicand a bearer token are set. Constant-time token compare, no TLS in-process (reverse-proxy terminates), CORS denied. The review gate is unchanged.http.server).Open questions for reviewers (in the VEP)
host/port/tokenbelong inconfig.yaml.Test Plan
proposals/VEP-0004-http-transport.md(statusdraft) and the index row inproposals/README.mdRefs #94 (implementation lands in separate PRs once/if the VEP is accepted)
Summary by CodeRabbit
Release Notes
New Features
vouch serve --transport http) exposing RPC, capabilities, and health check endpointsDocumentation