From 70556391dd12ad4ce23a4c05850db892f59a2407 Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Thu, 12 Nov 2026 23:12:29 +0100 Subject: [PATCH] Docs(mcp): record the Go MCP overall acceptance Run the section 5 checklist end to end against the debug Go server and a Windows debug ghost: nine tools called, tools/list at 22578 B, twenty consecutive terminal_exec calls with zero failures, read_file SHA-256 matched, 30 audit entries with device/tool/code/ms, and --subset passing in both 9-tool and readonly 7-tool modes. Race tests stay clean. Two checklist items get corrected rather than ticked: hub did change (SendToConn in M6 and the terminal lease generation in M4a, both needed and unit tested), and the MFC regression has no target because the whole milestone range touches no C++ file. Note the running Release binary is an older build reporting the old tool names; it was left alone. Co-Authored-By: deepseek-flash --- docs/Mcp_Go_Minimal_Implementation_Plan.md | 40 ++++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/docs/Mcp_Go_Minimal_Implementation_Plan.md b/docs/Mcp_Go_Minimal_Implementation_Plan.md index 71aafcf..735dc09 100644 --- a/docs/Mcp_Go_Minimal_Implementation_Plan.md +++ b/docs/Mcp_Go_Minimal_Implementation_Plan.md @@ -440,22 +440,40 @@ gofmt -l . ; go vet ./... ; go test ./... ; go test -race ./mcp/... go build ./cmd ``` -MFC 侧测试(`%TEMP%\yama_step1_scripts\*`)本计划不改 C++ 代码,只在 M8 之后回归一次 -`verify_live_6555.py` 确认没被共享常量改动影响(本计划只加常量,理论上无影响)。 +MFC 侧测试:M0–M8 的改动全在 `server/go`、`tools/mcp_tools` 与文档,**没有触碰任何 +C++ / 客户端文件**(`git diff --name-only 5f124fc..HEAD` 可证),因此原计划的 +`verify_live_6555.py` 回归没有对象。注意:本机在跑的 Release `Yama_x64.exe` 是更早的 +构建(`tools/list` 仍是 `list_online_hosts` 旧名),按约束未重启它;这与本次改动无关, +也不影响上述结论。 --- ## 5. 整体验收(对齐设计 §11) -- [ ] 9 个工具全部可调用;`tools/list` 响应 < 24 KB -- [ ] `terminal_exec` 连续 20 条命令零失败;超时后轮询取回完整输出 -- [ ] 浏览器开着终端时 `terminal_exec` → `-32003`,人的会话不受影响 -- [ ] `read_file` 读 `.env` 字节级一致,SHA-256 与远端 `sha256sum` 相同 -- [ ] `get_screenshot` Windows / Linux 各一张,Linux 走 BGRX→JPEG -- [ ] 审计每次 `mcp.tool.call` 一条,`device/tool/code/ms` 齐全 -- [ ] `verify_tools.py --subset` 通过(9 个 / 只读 7 个两种模式) -- [ ] `go test -race ./mcp/...` 无数据竞争 -- [ ] `hub` 零改动(`git diff --stat server/go/hub` 为空) +验收日期 2026-11-12。现场:`Bin\YamaGo_x64.exe -port 16543 -http-port 18090` + +`x64\Debug\ghost.exe`(Windows 11)+ WSL Ubuntu 24.04 ghost,临时 token/devices/audit。 + +- [x] 9 个工具全部可调用;`tools/list` 响应 < 24 KB + —— 22578 B(只读 18288 B);九个工具逐一实调通过 +- [x] `terminal_exec` 连续 20 条命令零失败;超时后轮询取回完整输出 + —— 同一会话 20 条 `echo ACCEPT_n` 全部取回哨兵(M4b 另有超时轮询实测) +- [x] 浏览器开着终端时 `terminal_exec` → `-32003`,人的会话不受影响 + —— `session_test.go:192` 证明浏览器持租约时返回 `ErrTerminalBusy`, + `tools_term.go:273` 映射为 `-32003`;另有 `terminal_close` 不动浏览器租约的用例 +- [x] `read_file` 读 `.env` 字节级一致,SHA-256 与远端 `sha256sum` 相同 + —— Windows 与 WSL 两边分别实测(M7);本轮 CRLF/单引号样本再验一次 +- [x] `get_screenshot` Windows / Linux 各一张,Linux 走 BGRX→JPEG + —— Windows 1024x304 JPEG 本轮实测;Linux 在 M5 实测(WSLg 下画面全黑是 + Xwayland 的已知限制,屏幕子连接与 BGRX→JPEG 链路本身通过) +- [x] 审计每次 `mcp.tool.call` 一条,`device`/`tool`/`code`/`ms` 齐全 + —— 本轮 30 条,样例含 `"device"`/`"tool"`/`"code"`/`"ms"` +- [x] `verify_tools.py --subset` 通过(9 个 / 只读 7 个两种模式) + —— 读写 9、`YAMA_MCP_READONLY=1` 7 均 PASS;两种反向错配均按预期 FAIL +- [x] `go test -race ./mcp/...` 无数据竞争 +- [ ] `hub` 零改动 —— **不成立且不可取**:`hub` 新增 `SendToConn`(M6,往任意子连接 + 回包必须走编码器)与终端租约代数 `terminalGen` / `OpenTerminalSessionLease` + (M4a,防止失去租约的查看者关掉别人的 shell)。两项都是设计遗漏、实现阶段补的, + 均有单测;`hub` 原有对外行为不变。 ---