Repository navigation
spec(port): port specs/port/trios/crates/trios-server/src/mcp.t27 (Closes #9563) - #9803
Conversation
…oses gHashTag#9563) Port gHashTag/trios:crates/trios-server/src/mcp.rs (at 8b229e9489ee, 338 lines) as specs/port/trios/crates/trios-server/src/mcp.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The MCP service's decisions are ported as pure functions and tested (9 tests, 9 pass, 0 vacuous, 33 runtime asserts): the property descriptor shapes (a named type; the array-of-strings descriptor), the nineteen-tool catalog by count and by name (git basic and extended, gb, fs, kg), the per-tool facts (git_status's description and single string property, git_stage_files's two required properties with the array descriptor, git_log's integer limit defaulting to 10), the list answer's shape (the whole catalog, no meta, no next cursor), and the call wrapper's rules - absent arguments become JSON null, object and array results render pretty, strings pass through, everything else renders compact, exactly one content block, and a failed dispatch answers an Error-prefixed text with is_error set. The call_tool transport keeps its name with an undefined; body no test calls; the Rust ZST service keeps its empty struct shape under McpService_new. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 18/19 (only the call_tool transport untested, by design), test-report 9/9 pass, 0 BLOCKED, gen 213 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 13 helper names unique across 2040 specs, and the bare body scan adds no duplicate group (752 bodies / 221 groups 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 #9563 port — What is verified:
CI (head d3cb5f5): 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 #9563 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios:crates/trios-server/src/mcp.rs(at8b229e9489ee, 338 lines) asspecs/port/trios/crates/trios-server/src/mcp.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9563.The original serves the trios tool catalog over MCP:
build_tool_definitionsdeclares the tools,prop_type/prop_array_itemsbuild the JSON-Schema property descriptors,McpService::list_toolsanswers the catalog, andMcpService::call_tooldispatches a call and wraps its result.Per the issue's rule ("Port the decision, not the plumbing"), the six listed functions are ported under their names — five as tested pure functions, the
McpService_call_tooldispatch as anundefined;transport no test calls — and the decisions are ported with 9 tests (33 runtime asserts, 0 vacuous):prop_type— a property descriptor carrying its named type;prop_array_items— the array-of-strings descriptor (lines 13-24);build_tool_definitions— the nineteen-tool catalog by count, withtool_namecarrying every name: git basic and extended (status, stage_files, unstage_files, commit, create_branch, log, diff, stash, checkout), gb (list_branches, push_stack, workspace_status), fs (read_file, write_file, list_dir), kg (create_entity, create_edge, query, traverse) (lines 26-280);git_status's description and its single required string property;git_stage_files's two required properties with the array descriptor;git_log's integer limit defaulting to 10 (lines 57-108);McpService_new/McpService_list_tools— the Rust zero-sized struct keeps its empty shape, and the list answer carries the whole catalog with no meta and no next cursor (lines 281-295);arguments_become_null); object and array results render as pretty JSON text, strings pass through, everything else renders compact (result_text_kind); the answer is exactly one content block (content_block_count); a failed dispatch answers anError:-prefixed text with is_error set (call_result_is_error,error_text_prefix).The serde_json maps, the LazyLock static and the dispatch await are plumbing; the growable
Vec<Tool>is carried by the count and the name table.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: 18/19 tested — only theMcpService_call_tooltransport untested, by design.t27c test-report: 9 tests / 9 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 213 (> 12).grep -cE '^\s*(pub )?fn (prop_type|prop_array_items|build_tool_definitions|McpService_new|McpService_list_tools|McpService_call_tool)\(': 6.grep -cE '^\s*test\s+(["|[A-Za-z_])': 9 (≥ 6).git status --short— exactly this one file. The repo's lefthook pre-commit (foreign-budget,own-language) passed.dupe_scanby name: all 13 helper names unique across 2040 specs on a cleanorigin/masterworktree. Bare body scan: the new file adds no duplicate group — 752 duplicate bodies in 221 groups on base, identical with this spec present (2041 specs scanned).Dmitrii Fedorov (@dmitrii-f-t27)