Repository navigation
spec(port): port specs/port/trios-railway/crates/trios-railway-mcp/src/main.t27 (Closes #9776) - #9848
Conversation
…c/main.t27 (Closes gHashTag#9776) Port gHashTag/trios-railway:crates/trios-railway-mcp/src/main.rs (at 8b229e9489ee, 114 lines) as specs/port/trios-railway/crates/ trios-railway-mcp/src/main.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The dual-transport MCP server's decisions are ported as pure functions and tested (5 tests, 5 pass, 0 vacuous, 14 runtime asserts): the PORT fallback of 8080 (presence flag), the IPv6 unspecified bind address for the Railway proxy, the route table - two transports (Streamable HTTP on /mcp, legacy SSE on /sse + /message) and four routes with /healthz - the 15-second SSE keep-alive, the info log-filter default, the greeting naming both transports, and the ok liveness answer. The main transport keeps its name with an undefined; body no test calls. Helper names are chosen unique across the 2040 specs (resolve_listen_port, mounted_route_count) - dupe_scan verified before the commit. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 16/17 (only the transport untested, by design), test-report 5/5 pass, 0 BLOCKED, gen 86 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 14 introduced names unique, bare body scan adds no duplicate group (752/221 unchanged). Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
|
@gHashTag Please merge this PR into master via the golden chain — rights on gHashTag/t27 are read-only for me (403), so the merge itself needs your action. What this is: the #9776 port — What is verified:
CI (head 76131bd): required trio green — The 3 reds are the base-red trio, not this change: After the merge I will: verify the spec file live on the merge SHA, confirm #9776 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios-railway:crates/trios-railway-mcp/src/main.rs(at8b229e9489ee, 114 lines) asspecs/port/trios-railway/crates/trios-railway-mcp/src/main.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9776.The original is the public MCP server with dual transport: MCP over BOTH the modern Streamable HTTP transport (
/mcp) and the legacy SSE transport (/sse+/message), with/healthzas the liveness probe, the IPv6 unspecified bind address for the Railway proxy, and the PORT fallback of 8080.Per the issue's rule ("Port the decision, not the plumbing"), the three listed functions are ported under their names —
mainas anundefined;transport no test calls,root_handlerandhealth_handleras the tested handler texts — and the decisions are ported with 5 tests (14 runtime asserts, 0 vacuous):resolve_listen_port/default_port— the PORT fallback: unset or unparseable falls back to 8080 (original lines 55-58);unspecified_bind_address—[::], so the IPv6-only Railway proxy reaches the server (lines 59-61);transport_count/mounted_route_countand the four route paths — the dual-transport route table:/mcp,/sse,/message,/healthz(lines 66-89);sse_keep_alive_secs— the 15-second SSE keep-alive (line 79);default_log_filter— the info default (lines 47-49);root_handler— the greeting naming both transports and where to reach them;health_handler— theokliveness answer.This PR supersedes #9846: its second commit (a helper rename) lacked the per-commit issue reference the L1 TRACEABILITY check requires, and rewriting pushed history needs a force-push this series never does — the same final file lands here as one commit with the reference.
Verification (all run live from the worktree root, zig 0.16.0)
t27c parse: OK.t27c spec-status: IMPLEMENTED.t27c typecheck: 0 errors, 0 warnings.t27c coverage: 16/17 tested — only themaintransport untested, by design.t27c test-report: 5 tests / 5 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 86 (> 12).grep -cE '^\s*(pub )?fn (main|root_handler|health_handler)\(': 3.grep -cE '^\s*test\s+(["|[A-Za-z_])': 5 (≥ 3).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 14 introduced names unique across 2040 specs (the helper names were checked BEFORE the commit — an earlier draft carried two colliding names, renamed here);mainkeeps its issue-mandated name, the 42-place pattern every port's entry point shares, with a non-identical body: the bare body scan adds no duplicate group (752 bodies / 221 groups on base, identical with this spec present).Dmitrii Fedorov (@dmitrii-f-t27)