Merged
Conversation
Migrate all 9 packages from Zod 3.22.x to Zod 4.3.6. This is a
breaking change for downstream TypeScript consumers who compile
against exported @peac/schema types (z.infer<> types are not
assignment-compatible across Zod majors).
Schema changes:
- z.record() single-arg form removed in Zod 4: add explicit
z.string() key schema in 5 locations (schema, control, mcp-server)
- .default({}) on object schemas requires output-type-compatible
values in Zod 4: use .prefault({}) for input-type defaults (policy.ts)
- ZodError.errors alias removed: use .issues in test assertions
- issue.path typed as PropertyKey[] (was (string | number)[]): add
casts at 2 call sites (protocol/issue.ts, cli/validators.ts)
No behavioral changes to schema validation, receipt issuance, or
verification. All 4138 tests pass across 167 test files.
Workspace enforcement:
- pnpm.overrides forces zod@^4.3.6 across all workspace packages
- Prevents mixed Zod 3/4 which causes runtime TypeError
Add HTTP transport alongside stdio for remote MCP client connectivity. Each session gets isolated McpServer + transport (CVE-2026-25536 defense). New files: - src/http-transport.ts: HTTP server with CORS, rate limiting, PRM - src/session-manager.ts: session lifecycle, TTL eviction, isolation Endpoints: POST /mcp (JSON-RPC), DELETE /mcp (terminate session), GET /health, GET /.well-known/oauth-protected-resource (conditional PRM) Security (DD-123): localhost-only default, CORS deny-all, 1MB body limit, per-session + per-IP rate limiting, Host/Origin validation, server timeouts CLI flags: --transport, --port, --host, --cors-origins, --authorization-servers, --public-url, --trust-proxy Tests: 25 new (session manager + HTTP transport integration)
Merged
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
--authorization-serversand--public-urlare configuredNew files
src/http-transport.ts: HTTP server setup, CORS, health endpoint, conditional PRM, request routingsrc/session-manager.ts: Mcp-Session-Id lifecycle, TTL eviction (default 30 min), max sessions (default 100), periodic sweeptests/http/http-transport.test.ts: 15 integration tests (health, 404, 405, session ID requirements, PRM, CORS, size limits, protocol version, preflight)tests/http/session-manager.test.ts: 10 unit tests (create, isolate, lookup, terminate, eviction, cleanup)Modified files
src/cli.ts: Added--transport,--port,--host,--cors-origins,--authorization-servers,--public-url,--trust-proxyflags with HTTP/stdio transport branchingsrc/infra/constants.ts: Added HTTP transport default constantsEndpoints
CLI flags
Test plan
Non-goals (explicitly deferred)
Spec deltas
Round 2 hardening (commit 0912520)
Trust-proxy upgrade
TrustProxyValueexpanded withlinklocal(169.254.0.0/16, fe80::/10),private(RFC 1918),all(discouraged) presets::ffff:) recognized in all presetsCVE-2026-25536 regression test
MCP compliance test matrix
docs/security/MCP-COMPLIANCE-MATRIX.md: 35 requirements mapped to test namesDeployer security checklist
docs/security/HTTP-TRANSPORT-SECURITY.md: production deployment guidance