Skip to content

spec(port): port specs/port/trios-railway/crates/trios-railway-mcp/src/main.t27 (Closes #9776) - #9848

Merged
gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9776-railway-mcp-v2
Oct 17, 2026
Merged

gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9776-railway-mcp-v2

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

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 #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 /healthz as 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 — main as an undefined; transport no test calls, root_handler and health_handler as 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_count and 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 — the ok liveness 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 the main transport 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).
  • Boundary: 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); main keeps 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)

…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))
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

@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 — crates/trios-railway-mcp/src/main.rs (gHashTag/trios-railway, at 8b229e9489ee, 114 lines) re-authored as specs/port/trios-railway/crates/trios-railway-mcp/src/main.t27. One file, one commit, head 76131bd6f, Closes #9776. This PR supersedes #9846, which I closed: its second commit (a helper rename) lacked the per-commit issue reference the L1 TRACEABILITY check requires, and this series does not force-push rewritten history — the identical final file lands here as one commit.

What is verified:

  • t27c parse OK, spec-status IMPLEMENTED, typecheck 0 errors / 0 warnings, coverage 16/17 (only the main transport untested, by design), t27c test-report 5 tests / 5 pass / 0 FAIL / 0 BLOCKED, 0 vacuous — the 8080 port fallback, the [::] bind, the dual-transport route table (/mcp, /sse, /message, /healthz), the 15-second keep-alive, the info log filter, the greeting and the ok liveness answer.
  • gen → 86 lines, 0 not yet implemented; the 3 required names count exactly 3; 5 test blocks; boundary exactly the one file.
  • dupe_scan: all 14 introduced names unique across 2040 specs (checked before the commit); main keeps 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/221 unchanged).
  • The t27b-native-run artifact of this head (commit 76131bd, run 39005752422): main.t27 row — reference pass, t27b pass, tests 5, invariants 0, asserts 14, blockers [], detail empty, reference_disagree: [].

CI (head 76131bd): required trio green — validate, check-linked-issue, parse-ratchet — and Check L1 TRACEABILITY green (the per-commit issue reference is present in the single commit); 26 checks pass overall, incl. emit-bitexact, t27b-native-linux, t27b-native-macos.

The 3 reds are the base-red trio, not this change: cli-tri (the #3324 include_str!), duplicate-bodies (only the known base names), t27b-native-ratchet (the same verdict red the Queen's port PRs carry; this spec's own row is reference pass + t27b pass — the registration debt is the UNLISTED class).

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)

@gHashTag
gHashTag merged commit 3530cad into gHashTag:master Oct 17, 2026
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port gHashTag/trios-railway:crates/trios-railway-mcp/src/main.rs (Rust, 3 functions) to specs/port/trios-railway/crates/trios-railway-mcp/src/main.t27

2 participants