--- id: infra-integration-suite name: Full-surface integration suite + docs sync + publish prep status: completed depends_on: [gateway-publish, adapter-to-openapi, adapter-from-wss, adapter-mcp, ws-overlay-ops] scope: moderate risk: medium impact: project level: review tags: [infra, phase-4] --- ## Description Phase 4 hardening. (1) Integration suite exercising the full surface over DuplexStream + in-process WSS: gateway 6 endpoints, WS session (call + data channel + overlay), from_openapi import → call → error fidelity, from_wss import over the WS server, mcp feature interplay. (2) Docs sync: port-notes sections stripped from ported ADRs/specs after review, open-questions.md statuses updated (OQ-01/02 → resolved), README doc table final. (3) Publish prep: `cargo publish --dry-run --allow-dirty`, semver/API surface check against AGENTS.md conventions, Cargo.toml metadata polish. ## Acceptance Criteria - [x] `cargo test --all-features` green; clippy `-D warnings` green; fmt green - [x] Full-surface integration test passing (gateway + WS + one adapter each direction) - [x] Port notes stripped; OQ statuses updated - [x] `cargo publish --dry-run --allow-dirty` succeeds - [x] taskgraph shows all tasks completed ## References - docs/plans/implementation.md (§Build order, Phase 4) - AGENTS.md (verification commands, commit conventions) ## Notes The full-surface suite surfaced a real gap: the WS upgrade route was reserved but never wired into HttpAdapter's router (the ws-upgrade-session tests built their own axum server). Now wired in build_router with its own ws_bearer_auth layer (401 without a resolvable token — stricter than the shared bearer middleware, which permissively stashes Option for the gateway endpoints). ## Summary Phase 4 hardening complete. **Integration suite** (tests/full_surface.rs, mcp feature, 7 tests over real TCP with each accepted connection driven through ProtocolHandler::handle — the production path): - gateway 6 endpoints over HTTP: search (ACL-filtered), schema (GET + name query), call (round trip), batch, subscribe (SSE), publish surface presence; /openapi.json 6-endpoint projection validating against openapiv3; gateway error fidelity end-to-end (unknown op 404 NOT_FOUND); unauthenticated calls follow the ACL model (unrestricted op → allowed, unknown op → NOT_FOUND) - WS session over the same HttpAdapter (upgrade → channels → echo round-trip on channel 0) — required wiring the WS upgrade route into HttpAdapter's router (it was reserved but only wired in tests): WS_UPGRADE_PATH now serves ws_upgrade_handler under ws_bearer_auth (401 without a resolvable token), while gateway endpoints keep the permissive shared bearer middleware - from_openapi import → Internal-by-default (invisible from the wire, ADR-015) → External facade composing it via env.invoke → the upstream HTTP API called end-to-end - to_openapi projection over /openapi.json (6 paths, openapiv3-valid) and to_mcp over /mcp: MCP client initialize + tools/list (4 gateway tools) + search excluding Sub ops — the tool-gateway pattern **Docs sync**: all "## Port notes" sections stripped from the 28 ported ADRs/specs (inline port-note blockquotes rephrased as plain statements); OQ-01/OQ-02 statuses corrected to resolved across open-questions.md, overview.md, websocket.md, and the architecture README's OQ table. **Publish prep**: cargo publish --dry-run --allow-dirty succeeds (90 files); cargo doc --no-deps warning-free (crate::docs link targets resolved); no alknet references remain in src/; Cargo.toml metadata already complete (license, repository, keywords, categories, rust-version). Verified: cargo test (182 lib default), --all-features (227 lib + 29 integration across 4 suites), clippy -D warnings (default / test-support / all-features), fmt, doc, publish --dry-run.