docs: add go mcp plan and process logs

This commit is contained in:
zhaoyilun
2026-07-05 19:18:56 +08:00
parent 87e0e47fbf
commit 63cda718ba
7 changed files with 2272 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Go MCP Library Decision
## N6 decision
选择官方 Go MCP SDK
- module`github.com/modelcontextprotocol/go-sdk`,固定版本 `v1.3.1`
- package`github.com/modelcontextprotocol/go-sdk/mcp`
不选择 `v1.6.1` 或 pre-release本机 Go 是 `go1.23.4 windows/amd64``v1.6.1` 的 module `go.mod``go 1.25.0`,当前节点不升级工具链。`v1.3.1` 是稳定版本,`go list -m -json` 显示 `GoVersion: "1.23.0"`,与本机兼容。
## Required decision fields
- package/module name`github.com/modelcontextprotocol/go-sdk/mcp` / `github.com/modelcontextprotocol/go-sdk v1.3.1`
- stdio supportyes。`go doc` 显示 `mcp.StdioTransport` 通过 stdin/stdout newline-delimited JSON 通信。
- tool registration style`mcp.NewServer(...)` 创建 server后续 N8 使用 `mcp.AddTool[In, Out](server, tool, handler)` 注册 typed tool handlerN6 不写 server code不注册工具。
- JSON schema supportyes。`mcp.AddTool` 可从 Go struct/map type 自动推断 input/output JSON schema并支持 `jsonschema` struct tag。
- maintenance risk官方 SDK维护风险低于社区 SDK但 MCP/SDK API 仍在快速演进。通过固定 `v1.3.1` 避免 pre-release 和 Go 1.25 要求,后续升级必须单独审批。
- why enough for four tools第一阶段只需要 stdio MCP server、四个 read-only tool 定义、typed 参数 schema、handler 调用 `internal/helperclient`。官方 SDK 已覆盖这些点,不需要 HTTP server、Python/Node runtime、后台 daemon 或多 MCP 框架。
## Verification notes
- `go list -m -versions github.com/modelcontextprotocol/go-sdk` 可列出 `v1.3.1``v1.6.1``v1.7.0-pre.1` 等版本。
- `go get github.com/modelcontextprotocol/go-sdk@v1.3.1` 成功。
- `go list github.com/modelcontextprotocol/go-sdk/mcp` 成功。
- `go doc github.com/modelcontextprotocol/go-sdk/mcp.StdioTransport``go doc github.com/modelcontextprotocol/go-sdk/mcp.AddTool``go doc github.com/modelcontextprotocol/go-sdk/mcp.NewServer` 成功。
- `go list -m all` 只出现一个 MCP-related dependency`github.com/modelcontextprotocol/go-sdk v1.3.1`

844
docs/go-mcp-minimal-plan.md Normal file
View File

@@ -0,0 +1,844 @@
# Go MCP Minimal Plan Nodes
> **Process rule:** This is the single active plan for the next phase. The final MCP direction is Go. Python MCP, Python tests, offline-lab/native-lab Python layers are not part of the active path.
**Goal:** Build a minimal Go MCP server that exposes the existing C# `ISphereWinHelper.exe` read-only operations as MCP tools.
**Architecture:** Go is the MCP/service layer. C# is the Windows/UI Automation execution layer. Go calls C# through one-shot stdin/stdout JSON using `isphere.helper.v1`.
**Tech Stack:** Go, MCP stdio, C# .NET Framework WinHelper, PowerShell verification scripts.
---
## 1. Node Tree
```text
N0 Baseline cleanup and direction lock
-> N1 C# WinHelper baseline verification
-> N2 Go module skeleton
-> N3 Go helper protocol contract
-> N4 Go helper process client
-> N5 Helper client live verification
-> N6 MCP library decision
-> N7 Go MCP server skeleton
-> N8 Four read-only MCP tool handlers
-> N9 MCP stdio smoke verification
-> N10 Operator runbook and process scripts
-> N11 Commit/review checkpoint
-> N12 Real logged-in UIA capture gate
```
Hard rule: **no node may start until the previous node's acceptance conditions are met.**
---
## 2. Node Details and Acceptance Conditions
## N0: Baseline cleanup and direction lock
**Purpose:** Ensure the project is no longer split between Python MCP and Go MCP.
**Preconditions:**
- Current branch is `codex/isphere-win-helper-first-phase` unless explicitly changed by the user.
- Python MCP temporary layer has been removed.
**Actions:**
- Confirm tracked files only include current docs/prompts/C# helper/scripts/evidence placeholders.
- Confirm no active `src/isphere_ai_bridge`, Python MCP package, or Python test suite is tracked.
- Confirm `docs/go-csharp-helper-boundary.md` remains the source boundary document.
**Expected outputs:**
- Clean project direction: C# helper now, Go MCP next.
- No Python MCP fallback path.
**Acceptance conditions:**
```powershell
git status --short
```
Pass if:
- No unexpected modified or untracked files exist except the active plan file while editing.
- `git ls-files` includes `native/ISphereWinHelper/*`.
- `git ls-files` does not include `src/isphere_ai_bridge/*`.
- `git ls-files` does not include `tests/test_*.py`.
**Stop conditions:**
- Python MCP files reappear.
- C# helper files are missing.
- Worktree has unrelated dirty files.
**Next node:** N1.
---
## N1: C# WinHelper baseline verification
**Purpose:** Prove the existing C# helper still works before writing Go code.
**Preconditions:**
- N0 accepted.
- `scripts/build-win-helper.ps1` exists.
- `scripts/verify-win-helper.ps1` exists.
**Actions:**
Run:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1
```
**Expected outputs:**
- `runs/win-helper/ISphereWinHelper.exe` is built locally.
- `version`, `self_check`, `scan_windows`, and `dump_uia` all run through JSON.
**Acceptance conditions:**
Pass if output contains:
```json
{"ok":true}
```
And confirms:
- `helper` path points to `runs\win-helper\ISphereWinHelper.exe`.
- `version` is `0.1.0`.
- `scan_window_count` is a number.
- `uia_available` is `true` or a valid boolean field.
- Temporary WinForms `dump_uia` succeeds.
**Stop conditions:**
- Build fails.
- Helper stdout is not JSON.
- `dump_uia` cannot capture the temporary WinForms window.
- Helper requires admin rights.
**Next node:** N2.
---
## N2: Go module skeleton
**Purpose:** Create the smallest Go project shell.
**Preconditions:**
- N1 accepted.
- Go toolchain is available on this machine.
**Actions:**
Create:
```text
go.mod
```
Initial module name:
```text
isphere-ai-bridge
```
Do not create server code yet.
**Expected outputs:**
- A Go module exists.
- No dependencies are added unless required by standard Go tooling.
**Acceptance conditions:**
Run:
```powershell
go version
go list ./...
```
Pass if:
- `go version` exits 0.
- `go list ./...` exits 0 or reports only the root module with no packages before packages are created.
- No Python files are added.
**Stop conditions:**
- Go is not installed.
- Module name conflicts with repository layout.
- Toolchain tries to create unrelated files outside the repo.
**Commit boundary:** optional; can be combined with N3.
**Next node:** N3.
---
## N3: Go helper protocol contract
**Purpose:** Model `isphere.helper.v1` in Go before process execution.
**Preconditions:**
- N2 accepted.
- `docs/go-csharp-helper-boundary.md` is available.
**Actions:**
Create:
```text
internal/helperclient/contract.go
internal/helperclient/client_test.go
```
Define minimal structs:
```text
HelperRequest
HelperResponse
HelperError
```
Required fields:
```text
protocol
request_id
op
timeout_ms
args
ok
data
error
warnings
```
**Expected outputs:**
- JSON marshaling generates `isphere.helper.v1` requests.
- JSON unmarshaling accepts C# helper success and error responses.
**Acceptance conditions:**
Run:
```powershell
go test ./internal/helperclient -run Contract -v
```
Pass if tests prove:
- `version` request marshals with `protocol="isphere.helper.v1"`.
- success response unmarshals with `ok=true` and `data.helper_name="ISphereWinHelper"`.
- error response unmarshals with `ok=false` and `error.code="WINDOW_NOT_FOUND"`.
- unknown data fields are preserved as JSON maps or raw JSON.
**Stop conditions:**
- Contract field names differ from C# helper output.
- Tests require a real helper process; N3 must be pure JSON only.
**Commit boundary:**
```powershell
git add go.mod internal/helperclient/contract.go internal/helperclient/client_test.go
git commit -m "feat: add go helper contract"
```
**Next node:** N4.
---
## N4: Go helper process client
**Purpose:** Let Go call `ISphereWinHelper.exe --json` with one request and one response.
**Preconditions:**
- N3 accepted.
- C# helper verification from N1 passes.
**Actions:**
Create:
```text
internal/helperclient/client.go
```
Implement:
```text
Client
Client.Call(ctx, op, args)
```
Client responsibilities:
- Resolve helper exe path.
- Start helper with `--json`.
- Write request JSON to stdin.
- Read stdout.
- Capture stderr.
- Enforce context timeout.
- Return structured Go error for missing helper, timeout, bad JSON, non-zero exit.
**Expected outputs:**
- Go can call C# helper without MCP.
- Process execution logic lives only in `internal/helperclient`.
**Acceptance conditions:**
Run:
```powershell
go test ./internal/helperclient -run Client -v
```
Pass if tests prove:
- Missing helper path returns a structured error.
- Bad helper output returns a structured error using a test stub.
- Timeout returns a structured error using a test stub.
- Real `version` call returns `ok=true` when helper is built.
**Stop conditions:**
- Client leaks helper processes after timeout.
- Client requires admin rights.
- Client writes logs/files by default.
- Client duplicates C# UIA logic.
**Commit boundary:**
```powershell
git add internal/helperclient/client.go internal/helperclient/client_test.go
git commit -m "feat: add win helper process client"
```
**Next node:** N5.
---
## N5: Helper client live verification
**Purpose:** Verify Go-to-C# works against the real helper on this machine.
**Preconditions:**
- N4 accepted.
- `scripts/verify-win-helper.ps1` passes.
**Actions:**
Run:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1
go test ./internal/helperclient -v
```
**Expected outputs:**
- C# helper works alone.
- Go helper client works against C# helper.
**Acceptance conditions:**
Pass if:
- PowerShell verification exits 0.
- Go tests exit 0.
- Test output includes a real `version` call.
- No tests click/type/send/upload/download.
**Stop conditions:**
- Tests only pass with mocked helper and never call the real C# helper.
- C# helper passes alone but Go client cannot call it.
**Commit boundary:** no separate commit unless tests/scripts changed.
**Next node:** N6.
---
## N6: MCP library decision
**Purpose:** Choose the Go MCP server library before writing server code.
**Preconditions:**
- N5 accepted.
- Network/package access is available or a local dependency strategy is chosen.
**Actions:**
Evaluate one current Go MCP library or official SDK option.
Record the decision inside the implementation commit or a short docs section. Do not create a large architecture document.
Decision must answer:
```text
package/module name
stdio support yes/no
tool registration style
JSON schema support
maintenance risk
why this is enough for four tools
```
**Expected outputs:**
- One MCP server package is selected.
- No competing MCP framework remains in the codebase.
**Acceptance conditions:**
Pass if:
```powershell
go list -m all
```
shows exactly one MCP-related Go dependency, or no external MCP dependency if a minimal stdio implementation is deliberately chosen.
Also pass if:
- The decision does not add HTTP server dependencies.
- The decision does not require Python or Node runtime.
- The decision supports stdio.
**Stop conditions:**
- MCP package cannot build on Windows.
- Package requires a background daemon.
- Package forces HTTP-only transport.
- Multiple MCP packages are added without a reason.
**Commit boundary:** can be combined with N7.
**Next node:** N7.
---
## N7: Go MCP server skeleton
**Purpose:** Create a Go binary that can start as an MCP stdio server.
**Preconditions:**
- N6 accepted.
**Actions:**
Create:
```text
cmd/isphere-mcp/main.go
```
Optional only if it keeps `main.go` small:
```text
internal/mcpserver/server.go
```
Do not register real tools yet if the library supports a clean empty server test. If the library requires tools immediately, register only placeholder-free real tool definitions from N8.
**Expected outputs:**
- `go build ./cmd/isphere-mcp` creates a binary.
- Server starts in stdio mode.
**Acceptance conditions:**
Run:
```powershell
go test ./...
go build ./cmd/isphere-mcp
```
Pass if:
- Build exits 0.
- No Python runtime is required.
- No C# helper is launched during simple server construction tests.
**Stop conditions:**
- Server starts an HTTP listener.
- Server invokes C# helper during initialization.
- Build requires unrelated services.
**Commit boundary:** can be combined with N8.
**Next node:** N8.
---
## N8: Four read-only MCP tool handlers
**Purpose:** Expose the first four read-only WinHelper operations through Go MCP.
**Preconditions:**
- N7 accepted.
- `internal/helperclient` accepted.
**Actions:**
Create:
```text
internal/tools/winhelper.go
internal/tools/winhelper_test.go
```
Register exactly these tools:
```text
win_helper_version
win_helper_self_check
win_helper_scan_windows
win_helper_dump_uia
```
Tool behavior:
```text
win_helper_version -> helper op version
win_helper_self_check -> helper op self_check
win_helper_scan_windows -> helper op scan_windows
win_helper_dump_uia -> helper op dump_uia
```
**Expected outputs:**
- Four tool definitions exist.
- Tool handlers call `internal/helperclient`.
- No handler performs UI logic directly.
**Acceptance conditions:**
Run:
```powershell
go test ./internal/tools -v
go test ./...
```
Pass if tests prove:
- Exactly four WinHelper tools are registered for this phase.
- Tool names match the list above.
- Tool schemas include only needed parameters:
- `include_all_visible` for scan.
- `hwnd`, `max_depth`, `include_text`, `max_children` for dump.
- No send/search/file tools exist.
**Stop conditions:**
- A fifth real action tool is added.
- A handler clicks, types, sends, uploads, downloads, or edits files.
- Tool code bypasses `internal/helperclient`.
**Commit boundary:**
```powershell
git add cmd/isphere-mcp internal/mcpserver internal/tools go.mod go.sum
git commit -m "feat: add minimal go mcp server"
```
**Next node:** N9.
---
## N9: MCP stdio smoke verification
**Purpose:** Verify the Go MCP binary can run over stdio and expose the four tools.
**Preconditions:**
- N8 accepted.
**Actions:**
Create if useful:
```text
scripts/verify-go-mcp.ps1
```
The script should:
- Build C# helper.
- Build Go MCP binary.
- Start Go MCP over stdio or use the MCP library test harness.
- List tools.
- Confirm the four expected tools exist.
- Call at least `win_helper_version`.
**Expected outputs:**
- A repeatable local verification command.
**Acceptance conditions:**
Run:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1
```
Pass if output includes:
```json
{"ok":true}
```
And confirms:
- Four tool names are present.
- `win_helper_version` returns `ISphereWinHelper`.
- No real iSphere login is required.
- No message/file/search action is present.
**Stop conditions:**
- Verification needs manual interaction.
- Verification needs Python.
- Tool listing cannot be automated.
**Commit boundary:**
```powershell
git add scripts/verify-go-mcp.ps1
git commit -m "test: add go mcp verification script"
```
**Next node:** N10.
---
## N10: Operator runbook and process scripts
**Purpose:** Make the current tool usable by a human operator without reading code.
**Preconditions:**
- N9 accepted.
**Actions:**
Create:
```text
docs/go-mcp-runbook.md
```
Update only if needed:
```text
README.md
```
Runbook must include:
- Build C# helper.
- Verify C# helper.
- Build Go MCP.
- Verify Go MCP.
- Configure MCP client command.
- Allowed tools.
- Explicit non-goals.
- Real-login UIA capture procedure.
**Expected outputs:**
- A user can run the first phase without asking for hidden context.
**Acceptance conditions:**
Pass if runbook includes exact commands for:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1
go test ./...
go build ./cmd/isphere-mcp
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1
```
And includes these boundaries:
```text
no login automation
no send message
no send file
no receive/download file
no process injection
no hook
no memory reading
```
**Stop conditions:**
- Runbook says Python MCP is required.
- Runbook implies sending is implemented.
- Runbook omits approval boundaries for future sends.
**Commit boundary:**
```powershell
git add docs/go-mcp-runbook.md README.md
git commit -m "docs: add go mcp runbook"
```
**Next node:** N11.
---
## N11: Commit and review checkpoint
**Purpose:** Freeze the first Go MCP phase before real iSphere data is introduced.
**Preconditions:**
- N10 accepted.
**Actions:**
Run:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1
go test ./...
go build ./cmd/isphere-mcp
git status --short
```
**Expected outputs:**
- All local verification passes.
- Worktree is clean after commits.
**Acceptance conditions:**
Pass if:
- `git status --short` has no output.
- Latest commits are small and tied to N3/N4/N8/N9/N10.
- No Python MCP files exist.
- No search/send/file tools exist.
**Stop conditions:**
- Any verification fails.
- Unrelated generated files are staged.
- Worktree contains ignored build outputs outside `runs/`.
**Next node:** N12.
---
## N12: Real logged-in UIA capture gate
**Purpose:** Capture real iSphere UIA evidence after the user provides/login context.
**Preconditions:**
- N11 accepted.
- User has copied real install/user files if needed.
- User manually opens and logs in to iSphere.
- iSphere main window is visible.
**Actions:**
Use Go MCP tools:
```text
win_helper_scan_windows
win_helper_dump_uia
```
Save output under:
```text
runs/real-loggedin-lab/uia-dumps/
```
**Expected outputs:**
- One or more real iSphere UIA dump JSON files.
- Window metadata showing process name/title/handle.
**Acceptance conditions:**
Pass if:
- Candidate iSphere/IMPlatform window is found.
- UIA root node is a window/control tree.
- Dump includes enough fields to identify controls:
- `name`
- `control_type`
- `automation_id`
- `class_name`
- `children`
- No clicking, typing, sending, uploading, receiving, or downloading occurs.
- No passwords/tokens are captured.
**Stop conditions:**
- User is not logged in.
- No candidate window appears.
- UIA tree is empty or inaccessible.
- Captured data contains sensitive secrets that need redaction before reporting.
**Next node:** Future selector design. Do not implement selectors until N12 passes.
---
## 3. Global Acceptance Rules
Every node must satisfy these rules:
1. No Python MCP code.
2. No real send/search/file action before N12.
3. No process injection, hook, credential extraction, token extraction, or memory reading.
4. No broad `git add -A`; stage exact paths.
5. Every code node uses tests first.
6. Every completion claim needs a fresh verification command.
7. Every failed gate stops the plan and requires a short report before continuing.
---
## 4. Current Next Node
Current next node is:
```text
N0 -> N1 -> N2
```
Immediate next action:
```text
Run N1 C# baseline verification, then start N2 Go module skeleton.
```
Do not start N8 or N12 early.

View File

@@ -0,0 +1,340 @@
# Business Manager Review
## 2026-07-05 执行前审批
- 当前节点N0 -> N1 执行前审批;本轮只允许做 N0/N1 验证,不进入 N2。
- 本轮目标:
- N0确认项目方向已清理并锁定为 Go MCP + C# HelperPython MCP 不作为活动路径;本轮不恢复 Python MCP。
- N1只运行 `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1`,验收 `ok=true`,并确认 C# helper 四个只读 op 可用:`version` / `self_check` / `scan_windows` / `dump_uia`
- 明确禁止:不写 Go 代码、不创建 `go.mod`、不改 C#、不提交新功能、不做搜索/发送/文件/自动登录/注入/hook/读内存/规避安防。
- 业务判断:符合最终目标。先锁定 Go MCP + C# Helper 的边界,再验证既有 C# Helper 的只读能力,是进入 Go MCP 最小实现前必须完成的低风险前置动作,能够避免在基础能力不稳定时提前投入 Go 层开发。
- 是否跑偏:未跑偏。本轮只做方向确认和 helper 基线验证,没有扩大到 Python MCP、Go 开发或业务自动化能力。
- 是否过度设计:未过度设计。验收点集中在一个验证脚本和四个只读 op范围足够小符合最小闭环原则。
- 是否遗漏:业务侧无关键遗漏。需注意执行阶段只能产出 N0/N1 的证据结论;即使 N1 通过,也只代表允许申请下一轮评审,不代表本轮可直接进入 N2。
- 是否允许进入下一轮:允许进入本轮 N0/N1 验证执行;不批准进入 N2。
- 业务经理结论:批准执行 N0/N1。执行人必须严格按本轮边界验证不得新增实现、不恢复 Python MCP、不创建 Go 工程骨架。N1 通过后再提交下一轮进入 N2 的审批。
## 2026-07-05 N0/N1 终审
- 当前节点N0/N1 完成后的业务经理终审;评估是否允许下一轮进入 N2。
- 本轮目标:
- N0确认项目方向锁定为 Go MCP + C# Windows Helper排除 Python MCP 活动路径,确认 C# helper 文件存在且 Go/Python 工程骨架未提前出现。
- N1验证既有 C# helper 的四个只读 op`version` / `self_check` / `scan_windows` / `dump_uia`,并确认验证脚本输出 `ok=true`、helper 位于 `runs\win-helper\ISphereWinHelper.exe`、version 为 `0.1.0``scan_window_count` 为数字、`uia_available` 为有效布尔字段。
- 保持边界:本轮不得进入 N2不得新增搜索联系人、打开会话、发送消息、发送文件、接收文件、自动登录、注入、hook、读内存、规避安防等能力。
- 业务判断:通过本轮 N0/N1。N0 已证明方向和工作树边界符合“先 C# 只读 helper后 Go MCP”的最小路径N1 已证明 helper 基线可运行,四个只读能力具备继续被 Go 层包装的业务价值。pi 和 opencode 两轮审查均未发现阻塞项,非阻塞质量项不影响本轮基线通过。
- 是否跑偏:未跑偏。执行结果停留在 N0/N1 范围内,未创建 `go.mod`,未启动 Go module skeleton未恢复 Python MCP未引入联系人搜索、会话打开、消息/文件收发、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。当前仍是一次性 C# CLI + 四个只读 op + PowerShell 验证脚本没有常驻服务、HTTP、named pipe、gRPC、插件框架、selector 学习系统或多余依赖。opencode 提到的 timeout、`--json`、envelope、全局节点上限、编译警告属于后续质量补强不构成本轮过度设计或返工理由。
- 是否遗漏无阻塞性业务遗漏。已覆盖本轮最关键的方向锁定、只读能力验证、边界确认和独立审查。需带入后续的非阻塞事项是N2 只能做 Go module skeleton后续 N3/N4 前再处理或明确 timeout、CLI 合约、响应 envelope、UIA 输出规模限制等质量项。
- 是否允许进入下一轮:允许进入下一轮,但只允许推进 N2Go module skeleton。N2 范围仅限确认 Go 工具链、创建最小 `go.mod`、模块名 `isphere-ai-bridge`、运行 `go version``go list ./...`;不得写 Go server、helper client、MCP tools不得新增依赖仍不得实现搜索/打开会话/发送/文件/自动登录/注入/hook/读内存/规避安防能力。
- 业务经理结论:批准 N0/N1 通过;不要求返工;不停止项目。下一轮可以只推进 N2Go module skeleton。N2 完成后必须再次提交审批,不能自动进入 N3 或更后节点。
## 2026-07-05 N2 执行前审批
- 当前节点:第二轮执行前审批;仅评估是否允许进入本轮 N2Go module skeleton不评估、不批准 N3。
- 本轮目标:
- 确认 Go 工具链可用:运行 `go version`
- 创建最小 `go.mod`module 名固定为 `isphere-ai-bridge`
- 运行 `go list ./...` 验证最小 Go module 可被 Go 工具链识别。
- 更新 `docs/process/go-implementation-log.md` 记录 N2 执行证据。
- 明确禁止:不创建 server code不创建 `cmd/isphere-mcp`,不创建 `internal/helperclient`,不创建 MCP tool handlers不添加 MCP 依赖,不改 C#,不恢复 Python MCP不提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断符合最终目标。N2 只是在 N0/N1 已通过后建立 Go MCP 路线的最小工程入口,交付价值是让后续 Go 协议契约、helper client、MCP server 有明确模块边界;当前不进入业务能力实现,风险低、范围清晰。
- 是否跑偏:未跑偏。拟定动作与 N2 计划一致,只创建最小 `go.mod` 并做 Go 工具链验证,同时记录过程日志;没有进入 N3 的协议建模、N4 的 helper 调用、N7/N8 的 MCP server/tools也没有扩展到真实业务动作。
- 是否过度设计:未过度设计。本轮不引入依赖、不建目录框架、不写 server、不写 helper client、不做工具注册只保留 Go module skeleton符合最小闭环。
- 是否遗漏无阻塞性遗漏。N2 的关键前置是 N1 已通过,本轮已具备;关键验收是 `go version``go list ./...`、无 Python 文件、无额外依赖、无 server/tool 代码。执行人需把命令结果和文件边界写入 `docs/process/go-implementation-log.md`,并在失败时停止而不是扩大范围。
- 是否允许进入下一轮:允许进入本轮 N2 执行;不允许进入 N3。N2 完成后必须再次提交审批,不能自动开始 Go helper protocol contract、helper process client 或 MCP server 工作。
- 业务经理结论:批准本轮只执行 N2Go module skeleton。不要求返工不停止项目。执行范围仅限 Go 工具链确认、最小 `go.mod``go list ./...` 和 N2 过程日志;任何超出 N2 的代码、依赖、目录或业务能力都需另行审批。
## 2026-07-05 N2 终审
- 当前节点:第二轮 N2 Go module skeleton 完成后的业务经理终审;评估 N2 是否通过,以及是否允许下一轮进入 N3。
- 本轮目标:
- 在 N0/N1 已通过的前提下,只建立 Go MCP 路线的最小 Go module skeleton。
- 确认 Go 工具链可用:`go version` 输出 `go version go1.23.4 windows/amd64`
- 创建最小 `go.mod`,内容为 `module isphere-ai-bridge``go 1.23`,无 `require`
- 运行 `go list ./...`,输出 `matched no packages` warning 且退出码为 0符合无 package 骨架阶段的验收条件。
- 保持边界:不创建 `cmd/isphere-mcp``internal/helperclient``internal/tools``go.sum``.go` 文件,不改 C#,不恢复 Python MCP不实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断N2 通过。当前产物只解决“Go 工程入口是否可用”这个最小业务前置问题,为下一步 Go helper protocol contract 提供模块根pi 和 opencode 两轮审查均确认无依赖、无 server/helper/tools 代码、无 N3 越界和无伪造验证,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 N2Go module skeleton没有提前进入 N3 的协议结构体和测试,没有进入 N4 的 C# helper 进程调用,也没有进入 N7/N8 的 MCP server 或工具处理器,更没有进入 N12 的真实登录 UIA 捕获。
- 是否过度设计:未过度设计。当前只有最小 `go.mod`,无 `require`、无 `go.sum`、无 Go 源码、无目录框架、无 MCP 依赖、无 server 空壳,符合“先建最小模块,再逐节点推进”的原则。
- 是否遗漏无阻塞性遗漏。N2 关键验收已覆盖Go 工具链存在、module 名正确、`go list ./...` 退出码为 0、无 Python MCP、无 N3/N4/N8/N12 越界文件或能力。`matched no packages` warning 在 N2 无 package 阶段可接受;`go.mod` 未跟踪是待后续按精确路径提交的流程事项,不影响业务通过。
- 是否允许进入下一轮:允许进入下一轮 N3但只允许做 N3 Go helper protocol contract。N3 必须是纯 JSON contract 测试,只能围绕 `isphere.helper.v1` 的请求/响应/error/warnings 字段做 marshal/unmarshal 测试;不得真实启动 C# helper不得实现 helper process client不得进入 N4不得创建 MCP server/tool handlers不得进入 N8/N12也不得批准搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务经理结论:批准 N2 通过;不要求返工;不停止项目。下一轮可以只推进 N3Go helper protocol contract。N3 完成后必须再次提交业务终审,不能自动进入 N4 或更后节点。
## 2026-07-05 N3 执行前审批
- 当前节点:第三轮执行前审批;仅评估是否允许进入本轮 N3Go helper protocol contract不评估、不批准 N4。
- 本轮目标:
- 在 N2 Go module skeleton 已通过的前提下,创建 `internal/helperclient/contract.go``internal/helperclient/client_test.go`
- 只做 `isphere.helper.v1` 的纯 JSON 协议建模,定义 `HelperRequest` / `HelperResponse` / `HelperError`
- 字段覆盖:`protocol``request_id``op``timeout_ms``args``ok``data``error``warnings`
- 通过契约测试验证:`version` request marshal 后 `protocol="isphere.helper.v1"`success response unmarshal 后 `ok=true``data.helper_name="ISphereWinHelper"`error response unmarshal 后 `ok=false``error.code="WINDOW_NOT_FOUND"`unknown data fields 可保留为 map 或 raw JSON。
- 运行 `go test ./internal/helperclient -run Contract -v`,并更新 `docs/process/go-implementation-log.md` 记录 N3 执行证据。
- 明确禁止:不写 `internal/helperclient/client.go`,不启动真实 C# helper不实现进程调用不创建 MCP server 或 MCP tools不添加 MCP 依赖或其他外部依赖,不改 C#,不恢复 Python MCP不提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断符合最终目标。N3 的交付价值是先把 Go 与 C# 之间的 `isphere.helper.v1` 数据契约固定下来,让后续 N4 进程调用有稳定输入输出模型;当前仍不触碰真实 helper、不触碰 UI、不触碰 MCP server 和业务动作,风险可控,顺序正确。
- 是否跑偏:未跑偏。拟定动作与 N3 计划一致,只做协议结构和纯 JSON marshal/unmarshal 契约测试;没有进入 N4 的 helper process client没有启动 C# helper没有进入 N7/N8 的 MCP server/tools也没有扩展到真实搜索、会话、消息或文件能力。
- 是否过度设计:未过度设计。本轮只允许最小 contract 文件和契约测试,不引入外部依赖、不加 MCP 框架、不设计 server、不做抽象层扩张、不创建业务工具符合“先契约、后进程调用”的最小闭环。
- 是否遗漏无阻塞性遗漏。N3 的关键前置是 N2 已通过且边界文档可用;关键验收是字段完整、成功/失败响应可解析、未知 data 字段可保留、测试为纯 JSON 且不真实启动 C# helper。执行人需在失败时停止并记录不得用真实 helper 调用或 N4 代码来补救 N3 测试。
- 是否允许进入下一轮:允许进入本轮 N3 执行;不允许进入 N4。N3 完成后必须再次提交审批,不能自动开始 helper process client、真实 helper 启动、MCP server、MCP tools 或任何业务动作能力。
- 业务经理结论:批准本轮只执行 N3Go helper protocol contract。不要求返工不停止项目。执行范围仅限 `isphere.helper.v1` 纯 JSON contract 建模、契约测试和 N3 过程日志;任何超出 N3 的进程调用、依赖、server/tool 或真实业务能力都需另行审批。
## 2026-07-05 N3 终审
- 当前节点:第三轮 N3 Go helper protocol contract 完成后的业务经理终审;评估 N3 是否通过,以及是否允许下一轮进入 N4。
- 本轮目标:
- 在 N2 已通过的前提下,只完成 `isphere.helper.v1` 的 Go 侧纯 JSON contract 建模。
- 新增 `internal/helperclient/contract.go``internal/helperclient/client_test.go`,定义 `HelperRequest` / `HelperResponse` / `HelperError`
- 字段覆盖 `protocol``request_id``op``timeout_ms``args``ok``data``error``warnings`
- 用纯 JSON 测试验证 version request marshal、success response unmarshal、error response unmarshal、unknown data fields 保留。
- 验证链路包含 Red`go test ./internal/helperclient -run Contract -v` 因缺少结构体失败Green`go test ./internal/helperclient -run Contract -v -count=1` 通过;补充:`go test ./... -count=1` 通过。
- 保持边界:不创建 `internal/helperclient/client.go`,不启动真实 C# helper不实现进程调用不创建 MCP server/tools不添加外部依赖不改 C#,不恢复 Python MCP不实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断N3 通过。当前交付把 Go 与 C# 的协议边界从文档落到了最小 Go contract 和纯 JSON 测试上,为 N4 的进程调用提供必要前置pi 和 opencode 审查均确认 Contract 测试通过、unknown data 保留可信、无外部依赖、无 N4 越界和无真实 helper 启动,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 N3 的协议建模和 marshal/unmarshal 测试,没有提前实现 `client.go`、helper 进程调用、路径解析、stdin/stdout、timeout、stderr 捕获,也没有创建 MCP server/tools未跳到 N5/N8/N12。
- 是否过度设计:未过度设计。当前仅有最小 contract 文件和契约测试,没有 client interface、mock helper 框架、MCP 抽象、server skeleton、审计/审批目录或额外依赖;符合“先固定 JSON contract再做进程 client”的最小推进原则。
- 是否遗漏无阻塞性遗漏。N3 核心验收已覆盖字段完整、version request protocol、success response 的 ok/helper_name、error response 的 WINDOW_NOT_FOUND、unknown data fields 保留、纯 JSON 测试且不启动 C# helper。opencode 提到的 `timeout_ms` marshal 断言、response envelope 断言属于后续可补强的 contract 质量项,不影响本轮业务通过;若补强,也只能在 contract 测试内补,不得借此进入 N4 之外能力。
- 是否允许进入下一轮:允许进入下一轮 N4但只允许做 N4 Go helper process client。N4 范围应限于 `internal/helperclient/client.go``Client` / `Client.Call(ctx, op, args)`、helper exe 路径解析、以 `--json` 启动 helper、stdin/stdout JSON、stderr 捕获、context timeout、missing helper / bad JSON / timeout / non-zero exit 的结构化错误,以及在 helper 已构建时 real `version` call 验证。仍不得做 MCP server/tools不得进入 N5/N8/N12不得搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务经理结论:批准 N3 通过;不要求返工;不停止项目。下一轮可以只推进 N4Go helper process client。N4 完成后必须再次提交业务终审,不能自动进入 N5 或更后节点。
## 2026-07-05 N4 执行前审批
- 当前节点:第四轮执行前审批;仅评估是否允许进入本轮 N4Go helper process client不评估、不批准 N5。
- 本轮目标:
- 在 N3 Go helper protocol contract 已通过、N1 C# helper 基线已验证的前提下,创建 `internal/helperclient/client.go`
-`internal/helperclient/client_test.go` 增加 Client 测试。
- 实现 `Client``Client.Call(ctx, op, args)`,让 Go 能以一次性进程方式调用 `ISphereWinHelper.exe --json`
- 只负责 helper exe 路径解析、以 `--json` 启动 helper、向 stdin 写 request JSON、读取 stdout、捕获 stderr、执行 context timeout、对 missing helper / timeout / bad JSON / non-zero exit 返回结构化 Go error。
- 在 helper 已由 N1 构建的前提下,验证真实 helper 的 `version` 调用返回 `ok=true`
- 运行 `go test ./internal/helperclient -run Client -v`,可额外运行 `go test ./... -count=1`,并更新 `docs/process/go-implementation-log.md` 记录 N4 执行证据。
- 明确禁止:不创建 MCP server不创建 MCP tools不修改 C# helper不添加 MCP 依赖或其他外部依赖,不复制 C# UIA 逻辑到 Go不点击/输入/发送/上传/下载,不提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断符合最终目标。N4 的业务价值是把已通过的 Go JSON contract 与既有 C# helper 串成最小进程调用能力,为后续 live verification 和 MCP 包装打基础;当前仍不触碰 MCP server/tools也不引入业务动作只验证 helper 的只读 `version` 调用,边界清晰、风险可控。
- 是否跑偏:未跑偏。拟定动作与 N4 计划一致,只做 Go 到 C# helper 的一次性 process client没有进入 N5 的完整 live verification 节点,没有进入 N7/N8 的 MCP server/tools没有做 UIA 业务逻辑复制,也没有扩展到搜索、会话、消息或文件能力。
- 是否过度设计:未过度设计。本轮只允许 `internal/helperclient` 内的 process client 与对应测试不允许新增依赖、MCP 框架、server skeleton、工具注册、审计/审批目录或长期驻留通信机制;符合一次性 CLI 调用的最小闭环。
- 是否遗漏无阻塞性遗漏。N4 关键验收应覆盖 missing helper、bad JSON、timeout、non-zero exit 的结构化错误,以及真实 helper `version` 返回 `ok=true`;还需确认 timeout 后不泄漏 helper 进程、不要求管理员权限、不默认写日志/文件、不复制 C# UIA 逻辑。执行人需在失败时停止并记录,不得通过扩大到 N5/MCP/server/tool 或真实业务动作来补救。
- 是否允许进入下一轮:允许进入本轮 N4 执行;不允许进入 N5。N4 完成后必须再次提交审批,不能自动开始 Helper client live verification、MCP library decision、MCP server、MCP tools 或任何搜索/发送/文件/自动登录/注入/hook/读内存/规避安防能力。
- 业务经理结论:批准本轮只执行 N4Go helper process client。不要求返工不停止项目。执行范围仅限 helper process client、Client 测试、真实 `version` 只读调用验证和 N4 过程日志;任何超出 N4 的 MCP、业务动作或系统底层能力都需另行审批。
## 2026-07-05 N4 终审
- 当前节点:第四轮 N4 Go helper process client 完成后的业务经理终审;评估 N4 是否通过,以及是否允许下一轮进入 N5。
- 本轮目标:
- 在 N3 已通过、N1 C# helper 基线已验证的前提下,实现 Go helper process client。
- 新增/修改 `internal/helperclient/client.go``internal/helperclient/client_test.go`,实现 `Client``Client.Call(ctx, op, args)`
- 只承担 helper exe 路径解析、以 `--json` 启动 helper、向 stdin 写入 request JSON、读取 stdout、捕获 stderr、执行 context timeout、对 missing helper / timeout / bad JSON / non-zero exit 返回结构化 Go error。
- 验证真实 helper 的 `version` 调用,日志显示调用 `runs\win-helper\ISphereWinHelper.exe` 并返回 `helper_name=ISphereWinHelper`
- 验证链路包含 Red`go test ./internal/helperclient -run Client -v` 因缺少 `Client` / errors 失败Green`go test ./internal/helperclient -run Client -v -count=1` 五个 Client 测试全部 PASS补充`go test ./... -count=1` 通过;`go list -m all` 仅有 `isphere-ai-bridge`
- 保持边界:未创建 MCP server/tools/cmd未修改 C#,未添加依赖,未复制 C# UIA 逻辑,未实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断N4 通过。当前交付把 N3 的 JSON contract 与 N1 的 C# helper 基线连接成最小 Go-to-C# 进程调用能力,且只验证只读 `version` 调用pi 和 opencode 审查均确认真实 helper 调用不是 skip、Client 测试通过、timeout 后未发现残留进程、stderr 捕获已验证、无外部依赖、无 MCP 和业务动作越界,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 N4 的 helper process client没有提前进入 N5 的完整 live verification 节点,没有进入 N6 的 MCP library decision没有创建 N8 的 MCP tools也没有进入 N12 的真实登录 UIA 捕获;未扩展到点击、输入、搜索、会话、消息或文件能力。
- 是否过度设计:未过度设计。当前仍是标准库进程调用和结构化错误处理,没有常驻 helper、HTTP、gRPC、named pipe、MCP 抽象、server skeleton、工具注册、审批/审计目录或额外框架;`Client.Call` 是通用 process client API不是业务动作 API。
- 是否遗漏无阻塞性遗漏。N4 核心验收已覆盖missing helper、bad JSON、timeout、non-zero exit/stderr、真实 helper `version` call、无进程残留、无管理员权限要求、无默认写日志/文件、无 UIA 逻辑复制。opencode 提到的 envelope/request id 校验、`--json` 和 stdin 请求内容更强断言、uuid-string 严格格式属于后续可补强质量项,不影响本轮业务通过;补强时仍不得扩大到 MCP 或业务动作能力。
- 是否允许进入下一轮:允许进入下一轮 N5但只允许做 N5 Helper client live verification。N5 范围只能运行 `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1``go test ./internal/helperclient -v`,确认 C# helper 单独通过、Go helper client 真实调用通过、测试输出包含真实 `version` call、且无 click/type/send/upload/download。N5 不写功能代码,不进入 N6不做 MCP library decision不创建 MCP server/tools不进入 N8/N12不批准搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务经理结论:批准 N4 通过;不要求返工;不停止项目。下一轮可以只推进 N5Helper client live verification。N5 完成后必须再次提交业务终审,不能自动进入 N6 或更后节点。
## 2026-07-05 N5 执行前审批
- 当前节点:第五轮执行前审批;仅评估是否允许进入本轮 N5Helper client live verification不评估、不批准 N6。
- 本轮目标:
- 在 N4 Go helper process client 已通过的前提下,做 Go-to-C# 的真实本机联调验证。
- 运行 `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1`,确认 C# helper 单独验证退出 0。
- 运行 `go test ./internal/helperclient -v`,确认 Go helperclient 测试退出 0。
- 确认 Go 测试输出包含真实 `version` 调用,证明不是只靠 mock/stub 通过。
- 确认验证过程没有点击、输入、发送、上传、下载等 UI 或业务动作。
- 更新过程日志:至少更新 `docs/process/go-implementation-log.md`;如本轮重新参与并记录 C# helper 验证,则可更新 `docs/process/csharp-helper-log.md`
- 明确禁止:不写功能代码,不创建 MCP server/tools不添加依赖不改 C#,不进入 N6不提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断符合最终目标。N5 的业务价值是把 C# helper 单独可用和 Go helper client 可真实调用这两个事实做一次端到端验证,确保后续 MCP 选型和包装不是建立在 mock 或局部测试上;本轮只验证现有能力,不新增功能,风险低、边界清晰。
- 是否跑偏:未跑偏。拟定动作与 N5 计划一致,只运行 PowerShell helper 验证和 Go helperclient 测试;没有进入 N6 的 MCP library decision没有创建 MCP server/tools也没有扩展到搜索、会话、消息、文件或真实 UI 操作能力。
- 是否过度设计:未过度设计。本轮不写代码、不加依赖、不加脚本框架、不做 server/tool 设计,只做两条既定验证命令和过程日志,符合 live verification 的最小闭环。
- 是否遗漏无阻塞性遗漏。N5 关键验收已覆盖PowerShell 验证退出 0、Go helperclient 测试退出 0、测试输出包含真实 `version` call、没有 click/type/send/upload/download。执行人还需在失败时停止并记录不能通过修改功能代码、进入 N6 或扩大到 MCP/server/tool 来补救。
- 是否允许进入下一轮:允许进入本轮 N5 执行;不允许进入 N6。N5 完成后必须再次提交审批,不能自动开始 MCP library decision、MCP server、MCP tools 或任何搜索/发送/文件/自动登录/注入/hook/读内存/规避安防能力。
- 业务经理结论:批准本轮只执行 N5Helper client live verification。不要求返工不停止项目。执行范围仅限 PowerShell helper 验证、Go helperclient 测试、真实 `version` 调用确认和过程日志;任何超出 N5 的 MCP 选型、功能代码或业务动作都需另行审批。
## 2026-07-05 N5 终审
- 当前节点:第五轮 N5 Helper client live verification 完成后的业务经理终审;评估 N5 是否通过,以及是否允许下一轮进入 N6。
- 本轮目标:
- 在 N4 已通过的前提下,只做 Go-to-C# 的真实本机联调验证,不写功能代码。
- 运行 `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1`,确认 C# helper 单体验证退出 0输出 `ok=true`、version `0.1.0``scan_window_count=30``uia_available=true`
- 运行 `go test ./internal/helperclient -v`,确认 Go helperclient 测试退出 0 且输出 PASS。
- 确认 Go 测试输出包含真实 helper version 调用:`real helper version ok: helper_name=ISphereWinHelper path=...runs\win-helper\ISphereWinHelper.exe`
- C# helper 验证仍只涉及 `version` / `self_check` / `scan_windows` / `dump_uia` 四个只读 op。
- 保持边界:本轮只追加过程日志,未改 Go/C# 功能代码,未创建 MCP server/tools/cmd未添加依赖未进入 N6未实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断N5 通过。当前交付证明 C# helper 单体可用、Go helperclient 能真实调用已构建 helper且不是只靠 mock/stub 通过pi 和 opencode 审查均确认现场复跑通过、真实 helper 没有 skip、无 N6/N8 越界、无 MCP 依赖、无业务动作能力,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 N5 live verification没有开始 N6 的 MCP library decision没有创建 N7 的 MCP server skeleton没有创建 N8 的 MCP tools也没有进入 N12 的真实登录 UIA 捕获;验证过程未扩展到点击、输入、搜索、会话、消息、文件、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。本轮只运行既定 PowerShell helper 验证和 Go helperclient 测试并追加过程日志没有新增依赖、脚本框架、MCP 方案、server/tool 设计、常驻服务或额外抽象。
- 是否遗漏无阻塞性遗漏。N5 核心验收已覆盖PowerShell helper 验证退出 0、Go helperclient 测试退出 0、Go 测试输出包含真实 `version` call、C# helper 单体验证覆盖四个只读 op、无 click/type/send/upload/download。`go test ./...``go list -m all` 的补充复核也显示 Go 测试通过且无外部依赖;工作树未提交属于流程提交事项,不影响业务通过。
- 是否允许进入下一轮:允许进入下一轮 N6但只允许做 N6 MCP library decision。N6 只能选择一个 Go MCP 方案或明确最小 stdio 实现,并回答 package/module name、stdio support、tool registration style、JSON schema support、maintenance risk、why enough for four tools可以产生短决策记录或依计划记录在实现提交中但不得写 server不得注册工具不得创建 MCP tools不得进入 N7/N8/N12不得批准搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务经理结论:批准 N5 通过;不要求返工;不停止项目。下一轮可以只推进 N6MCP library decision。N6 完成后必须再次提交业务终审,不能自动进入 N7 或更后节点。
## 2026-07-05 N6 执行前审批
- 当前节点:第六轮执行前审批;仅评估是否允许进入本轮 N6MCP library decision不评估、不批准 N7。
- 本轮目标:
- 在 N5 Helper client live verification 已通过的前提下,选择 Go MCP server 的技术方案,但不写 server 代码。
- 评估一个 Go MCP 官方 SDK/库方案,或明确选择最小 stdio 方案。
- 必须记录决策字段:`package/module name``stdio support``tool registration style``JSON schema support``maintenance risk``why this is enough for four tools`
- 允许使用官方来源和 Go module 命令做核验;已核验资料显示 `github.com/modelcontextprotocol/go-sdk` 为官方 Go SDK具备 `mcp.NewServer``mcp.AddTool``mcp.StdioTransport` 等能力pkg.go.dev 也显示支持 client/server、Transport、StdioTransport、AddTool 自动 schema本机 Go 为 `go1.23.4 windows/amd64`,且 `go list -m -versions github.com/modelcontextprotocol/go-sdk` 可访问版本。
- 如果选择外部 SDK只允许添加对应 Go module 依赖;如果选择最小 stdio则不加依赖。
- 运行 `go list -m all` 做验收,并更新 `docs/process/go-implementation-log.md`;如确需短决策文档,可以创建极小文档,但不得创建大型架构文档。
- 明确禁止:不写 server code不创建 `cmd/isphere-mcp`,不创建 `internal/mcpserver``internal/tools`,不注册工具,不调用 C# helper不进入 N7不提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断符合最终目标。N6 的业务价值是在写 MCP server 前先定清楚唯一 MCP 技术路线,避免后续同时引入多个框架或临时拼接协议;当前只做选型和依赖边界确认,不实现服务、不注册工具、不触碰业务动作,风险可控,顺序正确。
- 是否跑偏:未跑偏。拟定动作与 N6 计划一致,只做 MCP library decision没有进入 N7 的 Go MCP server skeleton没有创建 N8 的 tools也没有进入 N12 的真实登录 UIA 捕获;不调用 C# helper不扩大到搜索、会话、消息或文件能力。
- 是否过度设计:未过度设计。本轮只允许选择一个方案或最小 stdio并记录短决策不允许大型架构文档、多框架并行、server 空壳、工具注册、审批/审计抽象或额外业务层。若选官方 SDK只允许必要 module 依赖;若选最小 stdio则保持无依赖。
- 是否遗漏无阻塞性遗漏。N6 关键验收应覆盖:明确唯一方案、说明 stdio 支持、说明工具注册方式、说明 JSON schema 支持、说明维护风险、说明为什么足够四个只读工具,并用 `go list -m all` 证明只有一个 MCP 相关依赖或无外部 MCP 依赖。执行人需在发现 Windows 不可构建、强制后台 daemon、HTTP-only、或多个 MCP 包混入时停止并记录,不得通过直接写 server 或 tools 来绕过选型。
- 是否允许进入下一轮:允许进入本轮 N6 执行;不允许进入 N7。N6 完成后必须再次提交审批,不能自动开始 Go MCP server skeleton、tool registration、MCP handlers、C# helper 调用或任何搜索/发送/文件/自动登录/注入/hook/读内存/规避安防能力。
- 业务经理结论:批准本轮只执行 N6MCP library decision。不要求返工不停止项目。执行范围仅限 MCP 方案评估、唯一方案记录、必要依赖边界和 `go list -m all` 验收;任何超出 N6 的 server、tools、业务动作或底层能力都需另行审批。
## 2026-07-05 N6 终审
- 当前节点:第六轮 N6 MCP library decision 完成后的业务经理终审;评估 N6 是否通过,以及是否允许下一轮进入 N7。
- 本轮目标:
- 在 N5 已通过的前提下,只完成 Go MCP 技术方案选型,不写 server code不注册工具。
- 选择官方 Go MCP SDKmodule `github.com/modelcontextprotocol/go-sdk v1.3.1`package `github.com/modelcontextprotocol/go-sdk/mcp`
- 不选择 `v1.6.1` 或 pre-release本机为 `go1.23.4 windows/amd64``v1.6.1` 要求 `go 1.25.0`,当前节点不升级工具链。
- 已记录决策字段package/module name、stdio support、tool registration style、JSON schema support、maintenance risk、why enough for four tools。
- 已用 `go doc` 验证 `mcp.StdioTransport``mcp.AddTool``mcp.NewServer` 可用;已用 `go list -m all` 验证只有一个 MCP-related dependency。
- 产物集中在 `docs/go-mcp-library-decision.md``go.mod``go.sum``docs/process/go-implementation-log.md`;未写 server code未创建 `cmd/isphere-mcp``internal/mcpserver``internal/tools`,未注册工具,未调用 C# helper未修改 C#。
- 业务判断N6 通过。当前交付把后续 MCP server 的技术路线固定为官方 Go SDK 的一个兼容版本,且明确了 stdio、typed tool registration、JSON schema 和维护风险pi 与 opencode 审查均确认字段完整、`go test ./...` 通过、`go.sum` 只含 SDK v1.3.1、无 N7/N8 越界、无 C# 或脚本修改,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 N6 library decision没有创建 N7 的 server skeleton没有创建 N8 的 tools没有进入 N9 smoke verification 或 N12 真实登录 UIA 捕获;也没有调用 C# helper、注册工具或扩展到搜索、会话、消息、文件、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。只选择一个官方 SDK 版本并创建极小决策文档,没有多 MCP 框架并行、HTTP/gRPC/named pipe、后台 daemon、server 目录、tools 目录、审批/审计抽象或大型架构文档。SDK 的传递依赖来自官方 module graph不等于引入第二套 MCP 方案。
- 是否遗漏无阻塞性遗漏。N6 核心验收已覆盖:唯一 MCP 方案、stdio support、tool registration style、JSON schema support、maintenance risk、四个工具适配理由、`go list -m all` 验收、Windows Go 版本兼容判断、未引入 HTTP-only/daemon/Python/Node 路径。`go.mod` 中 SDK 暂为 indirect 是因为 N6 不允许写 import后续 N7/N8 首次使用时可自然调整,不影响业务通过。
- 是否允许进入下一轮:允许进入下一轮 N7但只允许做 N7 Go MCP server skeleton。N7 范围应限于创建 `cmd/isphere-mcp/main.go`,必要时创建极小 `internal/mcpserver/server.go`,让 Go binary 可以构建并以 stdio server 方式启动;不得注册四个真实 tools除非 SDK 强制必须有工具时也应尽量避免真实 handler 并保持 placeholder-free不得进入 N8不得创建 `internal/tools`,不得调用 C# helper不得进入 N9/N12不得批准搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务经理结论:批准 N6 通过;不要求返工;不停止项目。下一轮可以只推进 N7Go MCP server skeleton。N7 完成后必须再次提交业务终审,不能自动进入 N8 或更后节点。
## 2026-07-05 N7 执行前审批
- 当前节点:第七轮执行前审批;仅评估是否允许进入本轮 N7Go MCP server skeleton不评估、不批准 N8。
- 本轮目标:
- 在 N6 MCP library decision 已通过的前提下,使用已选定的官方 Go MCP SDK 创建最小 MCP stdio server skeleton。
- 创建 `cmd/isphere-mcp/main.go`
- 可选创建 `internal/mcpserver/server.go` 和极小 server construction 测试,前提是为了保持 `main.go` 小且可测。
- 使用 N6 选定 SDK 构造 MCP server并支持 stdio mode 启动。
- 运行 `go test ./...``go build ./cmd/isphere-mcp`
- 明确禁止:不注册四个真实 `win_helper_*` tools不创建 `internal/tools`,不调用 C# helper不实现 tool handlers不进入 N8不新增第二个 MCP SDK不恢复 Python MCP不提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断符合最终目标。N7 的业务价值是把 N6 选定的 MCP SDK 落成一个可构建、可启动的最小 stdio server 壳,为后续 N8 注册四个只读工具做运行入口;当前仍不暴露工具、不调用 helper、不触碰业务动作边界清晰、顺序正确。
- 是否跑偏:未跑偏。拟定动作与 N7 计划一致,只做 server skeleton 和构建验证;没有进入 N8 的工具注册和 tool handler没有调用 C# helper没有进入 N9 smoke verification 或 N12 真实登录 UIA 捕获,也没有扩展到搜索、会话、消息、文件、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。本轮只允许最小 `cmd/isphere-mcp/main.go`,可选极小 `internal/mcpserver/server.go` 和 construction 测试;不允许第二个 MCP SDK、HTTP/gRPC/named pipe、后台 daemon、工具目录、审批/审计抽象、大型架构文档或业务工具层。
- 是否遗漏无阻塞性遗漏。N7 关键验收应覆盖:`go test ./...` 通过、`go build ./cmd/isphere-mcp` 通过、server 以 stdio mode 为目标、不需要 Python runtime、不在简单 server construction 测试中启动 C# helper、不启动 HTTP listener。若 SDK 强制必须有工具,应尽量不注册真实工具,且不得实现真实 handler 或进入 N8。
- 是否允许进入下一轮:允许进入本轮 N7 执行;不允许进入 N8。N7 完成后必须再次提交审批,不能自动开始四个真实 tool 注册、`internal/tools`、helper handler、Go-to-C# tool 调用、MCP smoke verification 或任何搜索/发送/文件/自动登录/注入/hook/读内存/规避安防能力。
- 业务经理结论:批准本轮只执行 N7Go MCP server skeleton。不要求返工不停止项目。执行范围仅限 MCP stdio server skeleton、可选极小 server construction 测试、`go test ./...``go build ./cmd/isphere-mcp`;任何超出 N7 的 tools、helper 调用、N8/N9/N12 或业务动作都需另行审批。
## 2026-07-05 N7 终审
- 当前节点:第七轮 N7 Go MCP server skeleton 完成后的业务经理终审;评估 N7 是否通过,以及是否允许下一轮进入 N8。
- 本轮目标:
- 在 N6 已通过的前提下,只创建最小 Go MCP stdio server skeleton。
- 新增/修改 `cmd/isphere-mcp/main.go``internal/mcpserver/server.go``internal/mcpserver/server_test.go``go.mod``go.sum` 和 Go 过程日志。
- 使用 N6 选定的官方 Go MCP SDK 构造空 MCP server并以 stdio mode 作为启动方式。
- Red`go test ./internal/mcpserver -v``undefined: NewServer` 失败Green`go test ./internal/mcpserver -v -count=1` PASS`go test ./... -count=1` PASS`go build ./cmd/isphere-mcp` PASS临时 exe 已删除。
- 保持边界:未创建 `internal/tools`,无 `AddTool` / tool registration无 helperclient import未调用 C# helper未改 C#,未新增第二套 MCP 框架,未实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务判断N7 通过。当前交付把 N6 选定的 MCP SDK 落成了可测试、可构建的最小 stdio server 壳,为后续 N8 注册四个只读 WinHelper tools 提供入口pi 和 opencode 审查均确认测试/build 通过、无 N8 越界、无 helper 启动、无 HTTP/gRPC/named pipe/Python runtime、无第二套 MCP 框架,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 N7 server skeleton没有注册四个真实 `win_helper_*` tools没有创建 `internal/tools`,没有实现 tool handlers没有调用 C# helper没有进入 N9 smoke verification 或 N12 真实登录 UIA 捕获,也没有扩展到搜索、会话、消息、文件、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。当前只有 `cmd/isphere-mcp` 和极小 `internal/mcpserver`,测试只验证空 server 可构造;没有业务 tool 层、HTTP listener、gRPC、named pipe、后台 daemon、审批/审计抽象、复杂配置系统、大型架构文档或第二套 MCP 框架。`go.mod/go.sum` 的变化属于首次 import SDK 后的必要 module 元数据,不构成过度设计。
- 是否遗漏无阻塞性遗漏。N7 核心验收已覆盖:`go test ./...` 通过、`go build ./cmd/isphere-mcp` 通过、server 面向 stdio mode、不需要 Python runtime、简单 server construction 测试不启动 C# helper、不启动 HTTP listener、构建产物已清理。`go test ./...` 包含既有 helperclient 测试可能触发真实 helper version这不影响 N7 专项 server construction 边界;后续如需验证 server metadata可在不进入工具注册的前提下补强。
- 是否允许进入下一轮:允许进入下一轮 N8但只能做四个只读 MCP tool handlers`win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia`。N8 必须只创建/维护 `internal/tools` 相关 tool definitions 和测试tool handlers 只能通过 `internal/helperclient` 调用 helper op不得新增第五个工具不得实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防不得进入 N9/N12。
- 业务经理结论:批准 N7 通过;不要求返工;不停止项目。下一轮可以只推进 N8Four read-only MCP tool handlers。N8 完成后必须再次提交业务终审,不能自动进入 N9 或更后节点。
## 2026-07-05 N8 执行前审批
- 当前节点:第八轮执行前审批;仅评估是否允许进入本轮 N8Four read-only MCP tool handlers不评估、不批准 N9。
- 本轮目标:
- 在 N7 Go MCP server skeleton 已通过、`internal/helperclient` 已通过的前提下,创建 `internal/tools/winhelper.go``internal/tools/winhelper_test.go`
- 注册且只注册四个只读 MCP tools`win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia`
- 工具映射必须固定为:`win_helper_version -> version``win_helper_self_check -> self_check``win_helper_scan_windows -> scan_windows``win_helper_dump_uia -> dump_uia`
- handlers 必须通过 `internal/helperclient` 调用,不得直接做 UIA、窗口枚举、控件树遍历或其他 Windows 操作逻辑。
- schema 参数只允许scan 使用 `include_all_visible`dump 使用 `hwnd``max_depth``include_text``max_children`version/self_check 不应引入业务动作参数。
- 运行 `go test ./internal/tools -v``go test ./...`
- 明确禁止:不添加第五个工具,不实现搜索联系人、打开会话、发送消息、发送文件、接收文件,不自动登录,不注入、不 hook、不读内存、不规避安防不让 handler 点击、输入、发送、上传、下载或编辑文件,不绕过 `internal/helperclient`,不进入 N9。
- 业务判断符合最终目标。N8 的业务价值是把前期已验证的 C# helper 四个只读 op 暴露为 MCP 工具,形成第一阶段最小可用工具面;范围限定为四个只读能力,且通过 helperclient 统一调用,能保持 Go/C# 分层和后续审计边界。
- 是否跑偏:未跑偏。拟定动作与 N8 计划一致,只做四个只读 WinHelper MCP tools没有进入 N9 smoke verification没有进入 N12 真实登录 UIA 捕获,也没有扩展到联系人搜索、会话打开、消息/文件收发、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。本轮只允许一个 `internal/tools` 包和对应测试,不允许第五个工具、业务动作工具、独立 UIA/窗口逻辑、第二套 MCP SDK、额外服务框架、审批/审计大框架或复杂抽象;四个工具正好对应已验证的四个只读 helper op。
- 是否遗漏无阻塞性遗漏。N8 关键验收应覆盖注册工具数量恰好为四个、工具名完全匹配、tool schema 只包含允许参数、handler 映射到正确 helper op、handler 通过 `internal/helperclient` 调用、没有 send/search/file 工具、没有点击/输入/发送/上传/下载/编辑文件行为。执行人需在发现第五个工具、直接 UIA 逻辑或绕过 helperclient 时停止并记录。
- 是否允许进入下一轮:允许进入本轮 N8 执行;不允许进入 N9。N8 完成后必须再次提交审批,不能自动开始 MCP stdio smoke verification、`scripts/verify-go-mcp.ps1`、真实 MCP client 调用、N12 真实登录 UIA 捕获或任何搜索/发送/文件/自动登录/注入/hook/读内存/规避安防能力。
- 业务经理结论:批准本轮只执行 N8Four read-only MCP tool handlers。不要求返工不停止项目。执行范围仅限四个只读 tool definitions/handlers、`internal/tools` 测试、`go test ./internal/tools -v``go test ./...`;任何超出 N8 的第五工具、业务动作、N9/N12 或底层能力都需另行审批。
## 2026-07-05 N8 终审
- 当前节点:第八轮 N8 Four read-only MCP tool handlers 完成后的业务经理终审;评估 N8 是否通过,以及是否允许下一轮进入 N9。
- 本轮目标:
- 在 N7 已通过的前提下,只创建四个只读 WinHelper MCP tool handlers。
- 新增/修改 `internal/tools/winhelper.go``internal/tools/winhelper_test.go`,并接入 `internal/mcpserver/server.go` / `server_test.go`
- 只注册四个工具:`win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia`
- 工具映射固定为:`win_helper_version -> version``win_helper_self_check -> self_check``win_helper_scan_windows -> scan_windows``win_helper_dump_uia -> dump_uia`
- handler 通过 `HelperCaller` / `internal/helperclient` 调用,不直接实现 UIA、WindowScanner、UiaDumper、user32、FindWindow、SendKeys 等窗口或控件逻辑。
- schema 范围符合计划version/self_check 无业务参数scan 只有 `include_all_visible`dump 只有 `hwnd``max_depth``include_text``max_children`
- Redtools 测试因 undefined 实现失败mcpserver WinHelper 测试因空工具名失败Green`go test ./internal/tools -v -count=1` PASS`go test ./... -count=1` PASS。
- 保持边界:未创建 N9 script未新增第五个工具未实现 search/open/send/file/login未修改 C# 或脚本未实现点击、输入、发送、上传、下载、编辑文件、注入、hook、读内存、规避安防。
- 业务判断N8 通过。当前交付把前期已验证的四个 C# helper 只读 op 暴露成 MCP 工具形成第一阶段最小工具面pi 和 opencode 审查均确认工具数量、名称、op 映射、schema 参数和 helperclient 调用链符合计划,现场测试通过,且无第五工具、无直接 UI 操作、无 N9 越界,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 N8 四个只读 tool handlers没有创建 `scripts/verify-go-mcp.ps1`,没有进入 N9 smoke verification没有进入 N10 runbook 或 N12 真实登录 UIA 捕获;也没有扩展到联系人搜索、会话打开、消息/文件收发、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。当前只新增 `internal/tools` 和必要的 mcpserver 接入测试,没有第五个工具、业务动作工具、独立 UIA/窗口逻辑、第二套 MCP SDK、额外服务框架、审批/审计大框架或复杂抽象;四个工具正好对应第一阶段四个只读 helper op。
- 是否遗漏无阻塞性遗漏。N8 核心验收已覆盖工具数量恰好四个、工具名完全匹配、schema 只含允许参数、handler 映射到正确 helper op、handler 通过 `internal/helperclient` 调用、没有 send/search/file 工具、没有点击/输入/发送/上传/下载/编辑文件行为。真实 MCP stdio smoke 和真实 `win_helper_version` 通过 MCP 返回 `ISphereWinHelper` 是 N9 范围,不构成本轮遗漏。
- 是否允许进入下一轮:允许进入下一轮 N9但只能做 MCP stdio smoke verification。N9 可创建 `scripts/verify-go-mcp.ps1`,用于构建 C# helper、构建 Go MCP binary、通过 stdio 或 SDK test harness 列出 tools、确认四个工具存在、至少调用 `win_helper_version` 并确认返回 `ISphereWinHelper`;不得实现新工具,不得新增第五个工具,不得加入搜索/会话/发送/文件/自动登录/注入/hook/读内存/规避安防能力,不得进入 N10/N12。
- 业务经理结论:批准 N8 通过;不要求返工;不停止项目。下一轮可以只推进 N9MCP stdio smoke verification。N9 完成后必须再次提交业务终审,不能自动进入 N10 或更后节点。
## 2026-07-05 N9 执行前审批
- 当前节点:第九轮执行前审批;仅评估是否允许进入本轮 N9MCP stdio smoke verification不评估、不批准 N10。
- 本轮目标:
- 在 N8 Four read-only MCP tool handlers 已通过的前提下,只做 MCP stdio smoke verification。
- 创建 `scripts/verify-go-mcp.ps1`,作为可重复本地验证命令。
- 脚本自动构建 C# helper自动构建 Go MCP binary。
- 脚本通过 MCP stdio 或 SDK/test harness 自动 list tools确认四个工具存在且仅限当前阶段四个工具。
- 至少调用 `win_helper_version`,确认返回 `ISphereWinHelper`
- 输出包含 `{"ok":true}` 或等价 JSON 成功结果。
- 运行 `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1`,并更新过程日志。
- 明确禁止:不实现新工具,不改四个 tool handlers 的业务范围不实现搜索、发送、文件、自动登录、注入、hook、读内存不需要真实 iSphere 登录,不进入 N10。
- 业务判断符合最终目标。N9 的业务价值是把 N7 的 stdio server 壳和 N8 的四个只读工具做一次自动化烟测,证明二进制能通过 MCP 通道暴露预期工具并调用最小只读 `version` 能力;当前只验证已有能力,不新增业务功能,边界清晰、风险可控。
- 是否跑偏:未跑偏。拟定动作与 N9 计划一致,只创建并运行 smoke verification 脚本;没有进入 N10 runbook/process scripts没有进入 N12 真实登录 UIA 捕获,也没有扩展到搜索、会话、发送、文件、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。本轮只允许一个验证脚本和过程日志,不允许新增工具、改 handler 范围、引入第二套 MCP 框架、创建复杂测试平台、要求人工交互或真实 iSphere 登录;构建 helper 和 Go binary、list tools、调用 `win_helper_version` 已足够验证当前阶段交付。
- 是否遗漏无阻塞性遗漏。N9 关键验收应覆盖:脚本退出 0、输出 `ok=true` 或等价 JSON、四个工具名存在且无第五工具、`win_helper_version` 返回 `ISphereWinHelper`、无需真实 iSphere 登录、无 message/file/search action、验证不需要手工交互、无需 Python。执行人若发现 tool listing 不能自动化、验证需要手动操作、或 C# helper/Go MCP 任一构建失败,应停止并记录,不能通过新增工具或扩大业务动作来补救。
- 是否允许进入下一轮:允许进入本轮 N9 执行;不允许进入 N10。N9 完成后必须再次提交审批,不能自动开始 operator runbook、README 更新、N12 真实登录 UIA 捕获、搜索/发送/文件/自动登录/注入/hook/读内存/规避安防能力。
- 业务经理结论:批准本轮只执行 N9MCP stdio smoke verification。不要求返工不停止项目。执行范围仅限 `scripts/verify-go-mcp.ps1`、自动构建/列工具/调用 `win_helper_version`、成功 JSON 输出和过程日志;任何超出 N9 的新工具、业务动作、N10/N12 或底层能力都需另行审批。
## 2026-07-05 N9 终审
- 当前节点:第九轮 N9 MCP stdio smoke verification 完成后的业务经理终审;评估 N9 是否通过,以及是否允许下一轮进入 N10。
- 本轮目标:
- 在 N8 已通过的前提下,只做 MCP smoke verification不新增工具、不扩展业务能力。
- 创建 `scripts/verify-go-mcp.ps1`
- 脚本构建 C# helper构建 Go MCP binary并通过官方 Go MCP SDK harness 自动执行 initialize/connect、tools/list、tools/call `win_helper_version`
- 脚本执行 `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1` 退出 0。
- 输出包含 C# helper 构建成功、Go MCP binary 构建成功、`ok=true``helper_name=ISphereWinHelper``tool_count=4`、四个工具名、`python_runtime_required=false``real_isphere_login_required=false``action_tools_present=false`
- 保持边界:未进入 N10无 runbook未实现新工具未修改四个 tool handlers 的业务范围未实现搜索、发送、文件、自动登录、注入、hook、读内存不需要真实 iSphere 登录。
- 业务判断N9 通过。当前交付提供了可重复的 Go MCP 验证脚本,能证明 C# helper 可构建、Go MCP binary 可构建、MCP 层可列出四个工具并调用最小只读 `win_helper_version` 返回 `ISphereWinHelper`pi 和 opencode 审查均确认脚本不是裸硬编码 `ok=true`有工具名、tool_count、helper_name 和 action tools 断言,无 N10 runbook 和业务动作越界,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 N9 smoke verification没有创建 `docs/go-mcp-runbook.md` 或 README runbook 内容,没有进入 N10/N11/N12也没有新增工具、改变 handler 范围、要求真实 iSphere 登录、扩展到搜索/会话/发送/文件/自动登录或底层绕过能力。
- 是否过度设计:未过度设计。本轮只新增一个验证脚本和过程日志,脚本使用计划允许的 SDK/test harness 路径完成 initialize/list/call 验证没有新增服务、daemon、HTTP/gRPC/named pipe、第二套 MCP 框架、复杂验证平台或运行手册。PowerShell 直接 stdio 的 BOM 问题通过计划允许的 harness 路径解决,不构成过度设计。
- 是否遗漏无阻塞性遗漏。N9 核心验收已覆盖:脚本退出 0、输出成功 JSON、四个工具名存在且 tool_count=4、`win_helper_version` 返回 `ISphereWinHelper`、无需真实 iSphere 登录、无需 Python、无 message/file/search action。pi/opencode 未复跑完整脚本是因为只读审查约束避免创建临时构建产物,属于非阻塞观察;实现日志已记录完整脚本 green 执行证据。
- 是否允许进入下一轮:允许进入下一轮 N10但只允许做 Operator runbook and process scripts。N10 可创建 `docs/go-mcp-runbook.md`,必要时更新 README内容应覆盖构建 C# helper、验证 C# helper、构建 Go MCP、验证 Go MCP、配置 MCP client command、允许工具、明确非目标、真实登录 UIA capture procedure。不得实现新功能不得新增工具不得进入 N11/N12不得实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防。
- 业务经理结论:批准 N9 通过;不要求返工;不停止项目。下一轮可以只推进 N10Operator runbook and process scripts。N10 完成后必须再次提交业务终审,不能自动进入 N11 或更后节点。
## 2026-07-05 N10 执行前审批
- 当前节点:第十轮执行前审批;仅评估是否允许进入本轮 N10Operator runbook and process scripts不评估、不批准 N11。
- 本轮目标:
- 在 N9 MCP stdio smoke verification 已通过的前提下,只创建操作者运行手册和必要过程说明,让人类操作者不用读代码也能运行第一阶段工具。
- 创建 `docs/go-mcp-runbook.md`
- 仅在确有必要时更新 `README.md`,不得把 README 扩成大型文档。
- Runbook 必须包含Build C# helper、Verify C# helper、Build Go MCP、Verify Go MCP、Configure MCP client command、Allowed tools、Explicit non-goals、Real-login UIA capture procedure。
- Runbook 必须包含 exact commands`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1``go test ./...``go build ./cmd/isphere-mcp``powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1`
- Runbook 必须明确边界no login automation、no send message、no send file、no receive/download file、no process injection、no hook、no memory reading。
- 更新过程日志。
- 明确禁止:不实现新功能,不改 MCP tool handlers不新增工具不进入 N11不真实采集 iSphere 登录数据不实现搜索、发送、文件、自动登录、注入、hook、读内存。
- 业务判断符合最终目标。N10 的业务价值是把已经验证通过的 C# helper、Go MCP binary、四个只读工具和验证脚本整理成可操作手册降低交付使用门槛当前只做文档化和边界说明不新增能力风险低、交付价值明确。
- 是否跑偏:未跑偏。拟定动作与 N10 计划一致,只创建 runbook 和必要 README 摘要;没有进入 N11 commit/review checkpoint没有进入 N12 真实登录 UIA 捕获,也没有实现搜索、发送、文件、自动登录或底层绕过能力。
- 是否过度设计:未过度设计。本轮只允许一个操作 runbook 和必要 README 更新,不允许大型架构文档、额外脚本框架、功能代码、工具扩展或真实采集;手册内容聚焦构建、验证、配置、允许工具、非目标和后续真实登录 UIA 捕获流程。
- 是否遗漏无阻塞性遗漏。N10 关键验收应覆盖四条 exact commands、四个允许工具、明确 non-goals、MCP client command 配置、真实登录 UIA capture procedure以及 no login automation/no send message/no send file/no receive/download file/no process injection/no hook/no memory reading 等边界。若 runbook 暗示 Python MCP 必需、暗示已支持发送、或遗漏未来发送审批边界,应停止并修正。
- 是否允许进入下一轮:允许进入本轮 N10 执行;不允许进入 N11。N10 完成后必须再次提交审批,不能自动开始 commit/review checkpoint、N12 真实登录 UIA 捕获、搜索/发送/文件/自动登录/注入/hook/读内存/规避安防能力。
- 业务经理结论:批准本轮只执行 N10Operator runbook and process scripts。不要求返工不停止项目。执行范围仅限 `docs/go-mcp-runbook.md`、必要 README 更新和过程日志;任何超出 N10 的功能代码、工具扩展、真实采集、N11/N12 或底层能力都需另行审批。
## 2026-07-05 N10 终审
- 当前节点:第十轮 N10 Operator runbook and process scripts 完成后的业务经理终审;评估 N10 是否通过,以及是否允许下一轮进入 N11。
- 本轮目标:
- 在 N9 已通过的前提下,只创建操作者运行手册和必要过程说明。
- 创建 `docs/go-mcp-runbook.md`README 未修改。
- Runbook 覆盖 Build C# helper、Verify C# helper、Build Go MCP、Verify Go MCP、Configure MCP client command、Allowed tools、Explicit non-goals、Real-login UIA capture procedure。
- Runbook 包含四条 exact commands`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1``go test ./...``go build ./cmd/isphere-mcp``powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1`
- Runbook 明确边界no login automation、no send message、no send file、no receive/download file、no process injection、no hook、no memory reading。
- 保持边界:未改功能代码、未改 MCP tool handlers、未新增工具、未改 C#、未进入 N11/N12未真实采集 iSphere 登录数据。
- 业务判断N10 通过。当前交付把已验证的 C# helper、Go MCP、四个只读工具、验证命令和使用边界整理为操作者可执行手册降低交付使用门槛pi 和 opencode 审查均确认 runbook 要求齐全、未暗示 Python MCP 或发送/搜索/文件能力已实现、无 README/功能/C#/依赖/脚本越界,具备进入下一轮审批的条件。
- 是否跑偏:未跑偏。执行内容停留在 runbook不进入 N11 commit checkpoint不进入 N12 真实采集,不实现新功能或业务动作。
- 是否过度设计:未过度设计。仅创建 `docs/go-mcp-runbook.md`README 未修改,没有大型文档体系、额外脚本框架或功能扩展。
- 是否遗漏无阻塞性遗漏。四条命令、允许工具、明确非目标、MCP client command、real-login UIA capture procedure 和关键安全边界均已覆盖。后续提交状态清理属于 N11 范围,不构成本轮遗漏。
- 是否允许进入下一轮:允许进入下一轮 N11但只允许做 Commit and review checkpoint。N11 应运行验证命令、检查 `git status --short`、按计划做小提交/审查 checkpoint不得进入 N12不得真实采集 iSphere 登录数据,不得实现搜索/发送/文件/自动登录/注入/hook/读内存/规避安防。
- 业务经理结论:批准 N10 通过;不要求返工;不停止项目。下一轮可以只推进 N11Commit and review checkpoint。N11 完成后必须再次提交业务终审,不能自动进入 N12。
## 2026-07-05 N11 执行前审批
- 当前节点:第十一轮执行前审批;仅评估是否允许进入本轮 N11Commit and review checkpoint不评估、不批准 N12。
- 本轮目标:
- 在 N10 Operator runbook 已通过终审的前提下,冻结第一阶段 Go MCP 产物,避免在真实 iSphere 数据引入前继续积累未提交变更。
- 运行验证命令:`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1``powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1``go test ./...``go build ./cmd/isphere-mcp``git status --short`
- 精确 stage 允许文件,禁止 `git add -A` 或 broad stage不得提交 build 临时产物。
- 提交当前 N0-N10 产物,保持提交范围清晰。
- N11 审查完成后保证最终工作区 clean如审查日志追加造成 dirty应在同一 N11 内做最终 process checkpoint 精确提交。
- 明确禁止:不进入 N12不真实采集 iSphere 登录 UIA不实现新功能不新增工具不改四个 tool handlers 的业务范围不实现搜索、发送、文件、自动登录、注入、hook、读内存。
- 业务判断:允许进入本轮 N11。N11 的业务价值是把 N0-N10 已验收的第一阶段成果固化为可审查、可回滚、可交付的 Git checkpoint并在 N12 真实登录 UIA capture gate 前建立干净边界;本轮目标符合最终目标,不新增业务能力,只做验证、精确提交和审查闭环。
- 是否跑偏:未跑偏。拟定动作与 N11 计划一致,聚焦验证命令、状态检查、精确 stage、小提交和审查 checkpoint没有进入 N12没有真实采集登录态 UIA也没有扩大到搜索/会话/发送/文件/自动登录或底层绕过能力。
- 是否过度设计:未过度设计。两段提交节奏属于 N11 审查闭环的必要安排:先提交 N0-N10 产物,再提交审查过程中追加的 process logs目的是避免“审查后又 dirty”的流程缺口不引入额外架构、功能、工具或复杂发布流程。
- 是否遗漏无阻塞性遗漏。N11 需要补齐的关键验收已覆盖:四条验证命令、`git status --short`、精确 stage、禁止 broad stage、禁止 build 临时产物、提交范围清晰、最终 clean。若任一验证失败、出现无关生成物被 staged、工作区残留非 `runs/` 构建输出、或出现 Python MCP/search/send/file tools应停止并返工。
- 是否允许进入下一轮:允许进入本轮 N11 执行;不允许进入 N12。N11 只能做 Commit and review checkpoint完成后必须再次提交业务终审不能自动开始 real logged-in UIA capture gate。
- 业务经理结论:批准本轮只执行 N11Commit and review checkpoint。批准“两段提交节奏”A. 实现智能体先运行验证并精确提交 N0-N10 产物B. pi/opencode/业务经理审查追加各自日志后,由实现智能体在同一 N11 内做最终 process checkpoint 精确提交,再由主协调核对 `git status --short` clean。不要求替代节奏若无法保持精确 stage 或最终 clean应停止并报告。

View File

@@ -0,0 +1,40 @@
# C# WinHelper N1 baseline verification log
## 2026-07-05 16:19:25 +08:00
- 当前 helper 状态N1 baseline verification 通过helper 已构建/验证于 `runs\win-helper\ISphereWinHelper.exe`
- 是否修改 C# 文件:否。
- 验证命令:`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1`
- 验证结果:
- 命令退出码0。
- 输出成功字段:`ok=true`
- helper 路径:`E:\coding\codex\isphere-ai-bridge\runs\win-helper\ISphereWinHelper.exe`,符合 `runs\win-helper\ISphereWinHelper.exe`
- version`0.1.0`
- 只读 op 可用性:`version` / `self_check` / `scan_windows` / `dump_uia` 均由 `verify-win-helper.ps1` 调用并通过断言。
- `scan_window_count``30`,为数字。
- `uia_available``true`,为有效布尔字段。
- 临时 WinForms `dump_uia`:成功;验证脚本创建临时 WinForms 窗口后执行 `dump_uia`,并断言 root `control_type == "Window"`,本次未抛错且退出 0。
- 是否保持只读边界:是;本轮仅运行构建/验证脚本与只读 helper op未实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存或规避安防能力。
- 关键输出:
- `{"ok":true,"configuration":"Release","platform":"anycpu","csc":"C:\\WINDOWS\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe","source_dir":"E:\\coding\\codex\\isphere-ai-bridge\\native\\ISphereWinHelper","output":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe"}`
- `{"ok":true,"helper":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe","version":"0.1.0","scan_window_count":30,"uia_available":true}`
## 2026-07-05 17:58:24 +08:00 - N5 C# helper live verification
- 当前 helper 状态N5 live verification 中的 C# helper 单体验证通过helper 构建/验证输出路径为 `runs\win-helper\ISphereWinHelper.exe`
- 是否修改 C# 文件:否。
- 验证命令:`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1`
- 验证结果:
- 命令退出码0。
- 输出成功字段:`ok=true`
- helper 路径:`E:\coding\codex\isphere-ai-bridge\runs\win-helper\ISphereWinHelper.exe`,指向 `runs\win-helper\ISphereWinHelper.exe`
- version`0.1.0`
- 只读 op 范围:仍只涉及 `version` / `self_check` / `scan_windows` / `dump_uia` 四个 op。
- `scan_window_count``30`,为数字。
- `uia_available``true`,为有效布尔字段。
- 临时 WinForms `dump_uia`:成功;脚本创建临时 WinForms 窗口后执行 `dump_uia` 并断言根节点 `control_type == "Window"`,本次未抛错且退出 0。
- 是否保持只读边界:是;本轮未点击、输入、发送、上传、下载,未实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存或规避安防能力。
- N5 计划复核:`docs/go-mcp-minimal-plan.md` 的 N5 要求 helper live verification本 C# helper 维护范围仅确认 C# helper 单体验证状态,未进入 N6。
- 关键输出:
- `{"ok":true,"configuration":"Release","platform":"anycpu","csc":"C:\\WINDOWS\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe","source_dir":"E:\\coding\\codex\\isphere-ai-bridge\\native\\ISphereWinHelper","output":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe"}`
- `{"ok":true,"helper":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe","version":"0.1.0","scan_window_count":30,"uia_available":true}`

View File

@@ -0,0 +1,276 @@
# Go Implementation Log
## 2026-07-05 N0 基线确认
- 当前节点N0 Baseline cleanup and direction lock。
- 修改文件docs/process/go-implementation-log.md。
- 新增测试:无;本轮只做只读基线确认,不写 Go 代码,不创建 go.mod不改 C#。
- 执行命令:
- `Get-Content -LiteralPath docs/go-mcp-minimal-plan.md -Raw`
- `git branch --show-current`
- `git status --short`
- `git ls-files -- 'native/ISphereWinHelper/*'`
- `git ls-files -- 'src/isphere_ai_bridge/*'`
- `git ls-files -- 'tests/test_*.py'`
- `Test-Path -LiteralPath docs/go-csharp-helper-boundary.md -PathType Leaf`
- `git ls-files -- 'go.mod'`
- 结果:
- 当前分支为 `codex/isphere-win-helper-first-phase`
- `git status --short` 仅显示计划/过程文档:`docs/go-mcp-minimal-plan.md``docs/process/`
- `git ls-files` 包含 `native/ISphereWinHelper/HelperProtocol.cs``Program.cs``UiaDumper.cs``WindowScanner.cs`
- `git ls-files` 不包含 `src/isphere_ai_bridge/*`
- `git ls-files` 不包含 `tests/test_*.py`
- `docs/go-csharp-helper-boundary.md` 存在。
- 不存在已跟踪 `go.mod`
- 未解决问题:无 N0 阻塞项;注意当前计划文件与过程文档仍处于未跟踪状态,后续由对应节点/负责人按范围处理。
- 下一步建议:进入 N1 前先运行 `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1`,通过后再启动 N2 Go module skeleton。
## 2026-07-05 N2 Go module skeleton
- 当前节点N2 Go module skeleton。
- 修改文件go.moddocs/process/go-implementation-log.md。
- 新增测试:无;本轮只创建最小 Go module skeleton未创建 package/server code。
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N2 内容。
- `go version`
- `Set-Content -LiteralPath go.mod` 写入最小 module 元数据。
- `go list ./...`
- `git status --short --untracked-files=all`
- 结果:
- Go 工具链可用:`go version go1.23.4 windows/amd64`
- `go.mod` 已创建,内容仅包含 `module isphere-ai-bridge``go 1.23`,未添加 `require` 依赖。
- `go list ./...` 输出 `go: warning: "./..." matched no packages`,退出码为 0符合 N2 无 package 可接受条件。
- 未创建 `cmd/isphere-mcp``internal/helperclient``internal/tools`,未改 C#,未恢复 Python MCP。
- 未解决问题:无 N2 阻塞项;仓库中仍存在其他智能体维护的未跟踪过程文档,未在本轮修改。
- 下一步建议:等待业务经理批准 N3 后,再按计划创建 `internal/helperclient/contract.go` 和契约测试;当前不进入 N3。
## 2026-07-05 N3 Go helper protocol contract
- 当前节点N3 Go helper protocol contract。
- 修改文件internal/helperclient/client_test.gointernal/helperclient/contract.godocs/process/go-implementation-log.md。
- 新增测试:新增 `TestContractVersionRequestMarshalsProtocol``TestContractSuccessResponsePreservesDataFields``TestContractErrorResponseUnmarshalsErrorCode`,均为纯 JSON contract 测试,不启动真实 C# helper。
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N3 内容。
- `Get-Content -LiteralPath docs/go-csharp-helper-boundary.md -Raw` 读取协议边界。
- red`go test ./internal/helperclient -run Contract -v`
- `gofmt -w internal/helperclient/contract.go internal/helperclient/client_test.go`
- green`go test ./internal/helperclient -run Contract -v`
- 补充验证:`go test ./...`
- `git status --short --untracked-files=all`
- 结果:
- red 阶段按预期失败,错误为缺少实现:`undefined: HelperRequest``undefined: HelperResponse``red_exit=1`
- 已创建最小结构 `HelperRequest``HelperResponse``HelperError`JSON 字段包含 `protocol``request_id``op``timeout_ms``args``ok``data``error``warnings`
- `HelperResponse.Data` 使用 `map[string]json.RawMessage`,可保留 unknown data fields。
- green 阶段通过:三个 Contract 测试均 PASS`green_exit=0`
- 补充 `go test ./...` 通过,`all_exit=0`
- 未创建 `internal/helperclient/client.go`,未启动真实 C# helper未创建 MCP server/tools/cmd未添加外部依赖。
- 未解决问题:无 N3 阻塞项;`go.mod` 和其他过程文档仍为未跟踪状态,属于前序/其他智能体上下文,本轮未提交。
- 下一步建议:等待业务经理批准 N4 后,再实现 `internal/helperclient/client.go` 的进程调用;当前不进入 N4。
## 2026-07-05 N4 Go helper process client
- 当前节点N4 Go helper process client。
- 修改文件internal/helperclient/client.gointernal/helperclient/client_test.godocs/process/go-implementation-log.md。
- 新增测试:新增 `TestClientMissingHelperPathReturnsStructuredError``TestClientBadHelperOutputReturnsStructuredError``TestClientTimeoutReturnsStructuredError``TestClientNonZeroExitCapturesStderrAsStructuredError``TestClientRealVersionCallWhenHelperIsBuilt`。测试 stub 使用 `t.TempDir()` 下临时 Go stub 源码和临时 exe不在仓库内创建额外脚本/二进制源文件;真实 version 测试只调用已存在的 `runs/win-helper/ISphereWinHelper.exe`
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N4 内容。
- `Get-Content -LiteralPath internal/helperclient/contract.go -Raw` 读取既有 contract。
- red`go test ./internal/helperclient -run Client -v`
- `gofmt -w internal/helperclient/client.go internal/helperclient/client_test.go`
- green`go test ./internal/helperclient -run Client -v -count=1`
- 补充验证:`go test ./... -count=1`
- `git status --short --untracked-files=all`
- 结果:
- red 阶段按预期失败,错误为缺少实现:`undefined: Client``undefined: ErrorCodeMissingHelper``undefined: ErrorCodeBadJSON``undefined: ErrorCodeTimeout``undefined: ClientError``red_exit=1`
- 已创建 `Client``Client.Call(ctx, op, args)` 和结构化 `ClientError`
- 默认 helper 路径解析到 repo 下 `runs/win-helper/ISphereWinHelper.exe`,测试可传入明确 `HelperPath`
- `Client.Call` 启动 helper with `--json`,向 stdin 写入 `isphere.helper.v1` 请求 JSON读取 stdout捕获 stderrcontext timeout 后由 `exec.CommandContext` 终止进程。
- missing helper、timeout、bad JSON、non-zero exit 均返回结构化 Go errornon-zero exit 捕获 stderr 和 exit code。
- green 阶段通过:五个 Client 测试均 PASS真实 version 输出 `real helper version ok: helper_name=ISphereWinHelper path=E:\coding\codex\isphere-ai-bridge\runs\win-helper\ISphereWinHelper.exe``client_green_exit=0`
- 补充 `go test ./... -count=1` 通过,`all_exit=0`
- 未创建 MCP server/tools/cmd未创建 `internal/tools`/`internal/mcpserver`,未改 C# helper未添加外部依赖未复制 C# UIA 逻辑到 Go。
- 未解决问题:无 N4 阻塞项;本轮未提交,其他过程文档仍由各自智能体维护。
- 下一步建议:等待业务经理批准 N5 后,再运行 C# helper 验证脚本与完整 `go test ./internal/helperclient -v`;当前不进入 N5。
## 2026-07-05 N5 Helper client live verification
- 当前节点N5 Helper client live verification。
- 修改文件docs/process/go-implementation-log.md。
- 新增测试:无;本轮只执行 live verification不修改 Go/C# 代码。
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N5 内容。
- `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1`
- `go test ./internal/helperclient -v`
- `Select-String` 检查验证脚本与 helperclient 代码/测试中是否出现 `click/send/upload/download` 等动作词。
- `git status --short --untracked-files=all`
- 结果:
- PowerShell C# helper 验证退出 0输出包含 `{"ok":true,"configuration":"Release","platform":"anycpu"..."output":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe"}`
- PowerShell helper 运行验证退出 0输出包含 `{"ok":true,"helper":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe","version":"0.1.0","scan_window_count":30,"uia_available":true}``verify_win_helper_exit=0`
- Go helperclient 测试退出 0`PASS``ok isphere-ai-bridge/internal/helperclient 4.329s``helperclient_test_exit=0`
- Go 测试输出包含真实 version 调用:`real helper version ok: helper_name=ISphereWinHelper path=E:\coding\codex\isphere-ai-bridge\runs\win-helper\ISphereWinHelper.exe`
- 验证脚本涉及 helper op`version``self_check``scan_windows``dump_uia`;未执行点击/输入/发送/上传/下载。
- `click/send/upload/download/发送/上传/下载/点击` 动作词检查无命中。
- 未解决问题:无 N5 阻塞项;本轮未提交,既有未跟踪计划/过程文档和 Go N2-N4 文件仍保持原状。
- 下一步建议:等待业务经理批准 N6 后,再进入 MCP library decision当前不进入 N6。
## 2026-07-05 N6 MCP library decision
- 当前节点N6 MCP library decision。
- 修改文件docs/go-mcp-library-decision.mdgo.modgo.sumdocs/process/go-implementation-log.md。
- 新增测试:无;本轮只做 MCP library decision不写 server code、不注册工具、不调用 C# helper。
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N6 内容。
- `go version`
- `go list -m -versions github.com/modelcontextprotocol/go-sdk`
- `go list -m -json github.com/modelcontextprotocol/go-sdk@v1.6.1`
- 读取 Go module cache 中 `v1.6.1.mod` 和各稳定版本 go line。
- `go get github.com/modelcontextprotocol/go-sdk@v1.3.1`
- `go list github.com/modelcontextprotocol/go-sdk/mcp`
- `go doc github.com/modelcontextprotocol/go-sdk/mcp.StdioTransport`
- `go doc github.com/modelcontextprotocol/go-sdk/mcp.AddTool`
- `go doc github.com/modelcontextprotocol/go-sdk/mcp.NewServer`
- `go list -m all`
- `git status --short --untracked-files=all`
- 结果:
- 最终选择官方 SDKmodule `github.com/modelcontextprotocol/go-sdk v1.3.1`package `github.com/modelcontextprotocol/go-sdk/mcp`
- 不选择 `v1.6.1`/pre-release本机 `go version go1.23.4 windows/amd64``v1.6.1.mod``go 1.25.0``v1.3.1` 为稳定版本且 `GoVersion: "1.23.0"`
- `go get github.com/modelcontextprotocol/go-sdk@v1.3.1` 成功;`go.mod` 更新为 `go 1.23.0``toolchain go1.23.4`,并加入 `github.com/modelcontextprotocol/go-sdk v1.3.1 // indirect`N6 禁止写 server code尚无 import因此保持 Go 工具生成的 indirect 状态);`go.sum` 新增 SDK 校验和。
- `go doc` 验证 `mcp.StdioTransport``mcp.AddTool``mcp.NewServer` 可用;`AddTool` 支持 typed handler 和自动 JSON schema 推断。
- `go list -m all` 退出 0只出现一个 MCP-related dependency`github.com/modelcontextprotocol/go-sdk v1.3.1`;其余为 SDK transitive dependencies。
- 已创建极小决策文档 `docs/go-mcp-library-decision.md`,包含 package/module name、stdio support、tool registration style、JSON schema support、maintenance risk、why enough for four tools。
- 未创建 `cmd/isphere-mcp``internal/mcpserver``internal/tools`;未写 server code未注册工具未调用 C# helper未修改 C# helper。
- 未解决问题:无 N6 阻塞项;后续 N7 首次引入 package import 后Go 工具可能将 SDK 从 indirect 调整为 direct。
- 下一步建议:等待业务经理批准 N7 后,再创建最小 Go MCP server skeleton当前不进入 N7。
## 2026-07-05 N7 Go MCP server skeleton
- 当前节点N7 Go MCP server skeleton。
- 修改文件cmd/isphere-mcp/main.gointernal/mcpserver/server.gointernal/mcpserver/server_test.gogo.modgo.sumdocs/process/go-implementation-log.md。
- 新增测试:新增 `TestNewServerConstructsEmptyMCPServer`,只验证空 MCP server 可构造;测试不启动 stdio、不调用 C# helper、不导入 helperclient。
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N7 内容。
- `Get-Content -LiteralPath docs/go-mcp-library-decision.md -Raw` 读取 N6 SDK 决策。
- `go doc github.com/modelcontextprotocol/go-sdk/mcp.NewServer`
- `go doc github.com/modelcontextprotocol/go-sdk/mcp.Server.Run`
- `go doc github.com/modelcontextprotocol/go-sdk/mcp.StdioTransport`
- 初次 red`go test ./internal/mcpserver -v`
- `go mod download all`
- `go mod tidy`
- 正确 red`go test ./internal/mcpserver -v`
- `gofmt -w internal/mcpserver/server.go internal/mcpserver/server_test.go cmd/isphere-mcp/main.go`
- green`go test ./internal/mcpserver -v -count=1`
- required`go test ./... -count=1`
- required`go build ./cmd/isphere-mcp`
- `Select-String` 检查 main/server/test 中无 `helperclient``internal/tools``AddTool`、HTTP listener、Python、`ISphereWinHelper`
- `git status --short --untracked-files=all`
- 结果:
- 初次 red 暴露 SDK import 后缺少 go.sum 传递校验和:`missing go.sum entry for module providing package github.com/google/jsonschema-go/jsonschema``server_red_exit=1`
- 因 N7 首次实际 import `github.com/modelcontextprotocol/go-sdk/mcp`,执行 `go mod download all``go mod tidy` 补齐必要 module 元数据;`go.mod` 将 SDK 调整为 direct require并记录 SDK 的间接依赖;未添加第二个 MCP SDK。
- 正确 red 阶段按预期失败,错误为缺少实现:`undefined: NewServer``server_red_after_tidy_exit=1`
- 已实现 `internal/mcpserver.NewServer()`,只调用 `mcp.NewServer` 构造无 feature/无 tool 的 server。
- 已实现 `cmd/isphere-mcp/main.go`,只在 `mcp.StdioTransport` 上运行 server。
- green 阶段通过:`TestNewServerConstructsEmptyMCPServer` PASS`mcpserver_green_exit=0`
- `go test ./... -count=1` 通过:`cmd/isphere-mcp [no test files]``internal/helperclient` ok`internal/mcpserver` ok`all_green_exit=0`
- `go build ./cmd/isphere-mcp` 退出 0构建临时产生的 `isphere-mcp.exe` 已删除,未保留额外构建产物。
- 源码扫描无 `helperclient` import、无 `internal/tools`、无 `AddTool`/tool registration、无 HTTP listener、无 Python runtime、无 C# helper 调用。
- 未解决问题:无 N7 阻塞项;`go.mod/go.sum` 的 N7 变化是 SDK 包首次导入后的必要 module 元数据更新。
- 下一步建议:等待业务经理批准 N8 后,再创建 `internal/tools` 并注册四个 read-only `win_helper_*` tools当前不进入 N8。
## 2026-07-05 N8 Four read-only MCP tool handlers
- 当前节点N8 Four read-only MCP tool handlers。
- 修改文件internal/tools/winhelper.gointernal/tools/winhelper_test.gointernal/mcpserver/server.gointernal/mcpserver/server_test.godocs/process/go-implementation-log.md。
- 新增测试:新增 `TestWinHelperToolsRegisterExactlyFourReadOnlyTools``TestWinHelperToolSchemasExposeOnlyAllowedParameters``TestWinHelperHandlersCallHelperClientAbstractionWithCorrectOps`;扩展 `TestNewServerRegistersN8WinHelperToolsWithoutCallingHelper`,使用 SDK in-memory transport 验证 server list tools不启动真实 C# helper。
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N8 内容。
- `Get-Content` 读取既有 `internal/mcpserver``internal/helperclient` 代码。
- `go doc` 查看 `mcp.Tool``mcp.AddTool``mcp.ToolHandlerFor``mcp.CallToolResult`、in-memory transport 与 client API。
- red`go test ./internal/tools -v`
- mcpserver 接入 red`go test ./internal/mcpserver -run WinHelper -v`
- `gofmt -w internal/tools/winhelper.go internal/tools/winhelper_test.go internal/mcpserver/server.go internal/mcpserver/server_test.go`
- green`go test ./internal/tools -v -count=1`
- required`go test ./... -count=1`
- `Select-String` 扫描 N8 Go 源码中是否存在禁止工具名/动作词、直接 UIA/窗口实现、helperclient import、`mcp.AddTool` 数量。
- `git status --short --untracked-files=all`
- 结果:
- tools red 阶段按预期失败:`undefined: RegisterWinHelperTools``undefined: VersionArgs``undefined: SelfCheckArgs``undefined: ScanWindowsArgs``undefined: DumpUIAArgs``tools_red_exit=1`
- mcpserver 接入 red 阶段按预期失败server tool names 为 `[]string{}`,期望四个 `win_helper_*` tools`mcpserver_red_exit=1`
- 已实现并只注册四个工具:`win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia`;源码中 `mcp.AddTool` 恰好四处。
- 参数结构限制version/self_check 无业务参数scan 只有 `include_all_visible`dump 只有 `hwnd``max_depth``include_text``max_children`
- handler 通过 `HelperCaller` 抽象调用 `internal/helperclient`,映射 op 为 `version``self_check``scan_windows``dump_uia`;测试使用 fake caller 验证映射,不调用真实 helper。
- `internal/mcpserver.NewServer()` 最小接入四个工具,构造/列工具不启动 C# helper。
- green 阶段通过:三个 internal/tools 测试均 PASS`tools_green_rerun_exit=0`
- `go test ./... -count=1` 通过:`cmd/isphere-mcp [no test files]``internal/helperclient` ok`internal/mcpserver` ok`internal/tools` ok`all_green_rerun_exit=0`
- 禁止范围检查:未创建 `scripts/verify-go-mcp.ps1`;未出现 N9 script未创建第五个工具未实现 search/open/send/file/login未发现直接 UIA API/WindowScanner/UiaDumper/user32/FindWindow/SendKeys 等逻辑。
- 未解决问题:无 N8 阻塞项;当前工具调用测试仍使用 fake caller真实 MCP stdio smoke 留到 N9。
- 下一步建议:等待业务经理批准 N9 后,再创建并运行 `scripts/verify-go-mcp.ps1`;当前不进入 N9。
## 2026-07-05 N9 MCP stdio smoke verification
- 当前节点N9 MCP stdio smoke verification。
- 修改文件scripts/verify-go-mcp.ps1docs/process/go-implementation-log.md。
- 新增测试:新增可重复运行的 PowerShell smoke verification 脚本;脚本构建 C# helper、构建 Go MCP binary并用官方 Go MCP SDK in-memory harness 自动执行 initialize/connect、tools/list、tools/call `win_helper_version`
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N9 内容。
- red`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1`,在脚本缺失时运行。
- `Get-Content` 读取 `scripts/build-win-helper.ps1``scripts/verify-win-helper.ps1`、当前 mcpserver/tools 代码。
- 创建 `scripts/verify-go-mcp.ps1`
- green`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1`
- `git status --short --untracked-files=all`
- 结果:
- red 阶段按预期失败:`The argument 'scripts\verify-go-mcp.ps1' to the -File parameter does not exist``verify_go_mcp_red_exit=-196608`
- 初版 stdio PowerShell verifier 暴露 Windows PowerShell stdin BOM/encoding 问题Go SDK 报 `invalid character 'ï' looking for beginning of value`;按 N9 允许路径切换为 SDK/test harness不扩大修改 Go/C# 代码。
- 最终脚本调用 `scripts\build-win-helper.ps1` 构建 C# helper输出包含 `{"ok":true,..."output":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe"}`
- 最终脚本构建 Go MCP binary 到系统临时目录,并在结束时清理临时目录。
- SDK harness 自动执行 initialize/connect、tools/list、tools/call `win_helper_version`;输出包含 `{"action_tools_present":false,"helper_name":"ISphereWinHelper","initialized":true,"ok":true,"python_runtime_required":false,"real_isphere_login_required":false,"tool_count":4,"tools":["win_helper_dump_uia","win_helper_scan_windows","win_helper_self_check","win_helper_version"],"transport":"sdk_in_memory"}`
- 最终脚本输出包含 `{"ok":true,"verification":"go_mcp_sdk_harness","go_mcp_binary_built":true,"helper_name":"ISphereWinHelper","tool_count":4,..."action_tools_present":false}``verify_go_mcp_exit=0`
- 未要求真实 iSphere 登录;未引入 Python runtime未创建新工具未实现 search/send/file/autologin/injection/hook/memory-read。
- 未解决问题:无 N9 阻塞项PowerShell 5 直接 stdio 写入存在 BOM 兼容问题,当前脚本使用计划允许的 SDK harness 路径完成同等 MCP 初始化、列工具和调用工具验证。
- 下一步建议:等待业务经理批准 N10 后,再创建 operator runbook当前不进入 N10。
## 2026-07-05 N10 Operator runbook and process scripts
- 当前节点N10 Operator runbook and process scripts。
- 修改文件docs/go-mcp-runbook.mddocs/process/go-implementation-log.md。
- 新增测试:无;本轮只新增 operator runbook并用 PowerShell/Select-String 做轻量文档覆盖验证。
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N10 内容。
- `Get-Content -LiteralPath README.md -TotalCount 80` 检查 README 是否已有明显 Go MCP 入口;未发现专门入口,因此不改 README。
- 创建 `docs/go-mcp-runbook.md`
- `Select-String -LiteralPath docs/go-mcp-runbook.md -SimpleMatch` 验证 required commands、boundary phrases、四个 allowed tool names、runbook required sections。
- `git status --short --untracked-files=all`
- 结果:
- 已创建 `docs/go-mcp-runbook.md`,面向 operator覆盖 Build C# helper、Verify C# helper、Build Go MCP、Verify Go MCP、Configure MCP client command、Allowed tools、Explicit non-goals、Real-login UIA capture procedure。
- Runbook 原样包含必需命令:`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1``go test ./...``go build ./cmd/isphere-mcp``powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1`
- Runbook 包含四个 allowed tools`win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia`
- Runbook 包含边界:`no login automation``no send message``no send file``no receive/download file``no process injection``no hook``no memory reading`,并明确无 Python MCP fallback、不实现搜索/会话/发送/文件/自动登录。
- Runbook 写明 future send/file operations 必须有人类审批和审计,当前阶段未实现。
- 轻量验证通过:`runbook_validation=ok required_count=23`
- 本轮未修改 Go/C# 功能代码,未新增工具,未改 MCP handlers未创建 N10 以外的 runbook未进入 N11未提交。
- 未解决问题:无 N10 阻塞项;仓库仍保留前序 N2-N9 的未跟踪实现/过程文件,未在本轮回退或提交。
- 下一步建议:等待业务经理批准 N11 后,再执行 commit/review checkpoint当前不进入 N11。
## 2026-07-05 N11-A verification and precise commit
- 当前节点N11-A verification and precise commit for N0-N10 artifacts。
- 修改文件docs/process/go-implementation-log.md。
- 新增测试:无;本轮只执行 N11-A 验证、清理临时构建产物、精确提交既有 N0-N10 产物。
- 执行命令:
- `Get-Content/Select-String` 读取 `docs/go-mcp-minimal-plan.md` 的 N11 内容。
- `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1`
- `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1`
- `go test ./...`
- `go build ./cmd/isphere-mcp`
- `git status --short`
- `Remove-Item -LiteralPath isphere-mcp.exe -Force` 清理顶层临时 build 产物。
- `git status --short --untracked-files=all`
- 精确 `git add <具体路径...>`,禁止 `git add -A`
- 小提交docs/process、Go helper/MCP、verify script、runbook。
- 结果:
- `verify-win-helper.ps1` 退出 0输出包含 `{"ok":true,"helper":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe","version":"0.1.0","scan_window_count":30,"uia_available":true}`
- `verify-go-mcp.ps1` 退出 0输出包含 `{"ok":true,"verification":"go_mcp_sdk_harness","go_mcp_binary_built":true,"helper_name":"ISphereWinHelper","tool_count":4,"tools":["win_helper_dump_uia","win_helper_scan_windows","win_helper_self_check","win_helper_version"],"python_runtime_required":false,"real_isphere_login_required":false,"action_tools_present":false}`
- `go test ./...` 退出 0`cmd/isphere-mcp [no test files]``internal/helperclient` ok`internal/mcpserver` ok`internal/tools` ok。
- `go build ./cmd/isphere-mcp` 退出 0生成的顶层 `isphere-mcp.exe` 已删除,未提交 build 产物。
- `git status --short` 在提交前仅显示 N0-N10 候选产物和临时 `isphere-mcp.exe`;临时 exe 已清理。
- 未解决问题N11-A 不进入 N12不真实采集登录 UIA不实现新功能/新工具。N11-B 将在审查日志追加后执行最终 process checkpoint 提交。
- 下一步建议:完成 N11-A 精确提交后,等待业务经理/主协调进入 N11-B当前不进入 N12。

View File

@@ -0,0 +1,431 @@
# opencode review log
## 2026-07-05 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md
- docs/go-csharp-helper-boundary.md
- docs/process/go-implementation-log.md
- docs/process/csharp-helper-log.md
- scripts/build-win-helper.ps1
- scripts/verify-win-helper.ps1
- native/ISphereWinHelper/HelperProtocol.cs
- native/ISphereWinHelper/Program.cs
- native/ISphereWinHelper/WindowScanner.cs
- native/ISphereWinHelper/UiaDumper.cs
- .gitignore
- git status / git ls-files 边界输出
### 结构问题
- 未发现 Go/C# 边界混乱Go 层尚未创建C# helper 只保留 Windows/UIA 执行层;当前 switch 仅暴露 version、self_check、scan_windows、dump_uia 四个只读 op。
- 未发现过度设计没有常驻服务、HTTP、named pipe、gRPC、插件框架、selector 学习系统。
- 轻微结构风险Program.cs 接收 timeout_ms 但未在 C# 侧执行超时;当前依赖 Go 未来进程级超时会更明确。建议后续在进入 Go client 前明确“Go 强制超时、C# best-effort”或补 C# 侧计时保护。
- 轻微接口风险helper 启动时传入 --json但 Program.cs 当前不解析 args行为上仍输出 JSON不影响 N1不过 CLI 合约还没有显式校验。
### 代码问题
- 未发现真实动作越界未实现搜索联系人、打开会话、发送消息、发送文件、接收文件、自动登录、注入、hook、读内存或规避安防能力。
- 未发现不必要外部依赖:无 go.mod/go.sumC# 仅使用 .NET Framework / Win32 / UIAutomation / System.Web.Extensions。
- WindowScanner 的 iSphere/IMPlatformClient/impp/importal 评分字符串属于窗口候选识别硬编码,当前阶段可接受;不是假通过,但后续真实环境需要用真实 UIA evidence 校验。
- UiaDumper 的 max_children 是每层/每节点限制,不是全局节点上限;在高 max_depth/max_children 下可能输出过大或耗时过长。当前脚本使用低深度通过,建议后续增加全局节点/耗时限制。
- build-win-helper.ps1 使用 /warn:0能减少环境噪音但会隐藏 C# 编译警告;当前不阻塞,后续代码增长时建议打开警告。
### 测试问题
- verify-win-helper.ps1 确认覆盖 version、self_check、scan_windows、dump_uia并额外验证 missing hwnd 和临时 WinForms 窗口 dump_uia。
- 验证脚本解析 helper stdout JSON并在 helper 退出码非 0 时失败;未看到伪造 ok=true 的路径。
- 覆盖缺口:脚本未断言响应 envelope 的 protocol/request_id/op也未测试 unsupported op / invalid request建议作为后续 N1 质量补强,不阻塞当前基线。
- 本轮未重新运行 verify-win-helper.ps1避免产生新的构建/运行副作用;结论基于脚本静态审查和已有 C# helper 日志。
### 是否建议返工
- 不建议返工。
- 建议继续保持 N0/N1 已通过的边界,不进入 N2 以外的后续能力;进入 N2 前可把 timeout_ms/--json/envelope 断言列为小补强项。
### 结论
- 当前实现与计划主线一致C# helper 是一次性 CLI只读 UIA/窗口探测Go MCP 尚未开始;没有 go.mod、Python MCP、测试套件或越界动作。
- 当前没有发现不必要依赖、过度设计、伪造验证或假通过。
## 2026-07-05 第二轮 N2 Go module skeleton 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N2 Go module skeleton
- docs/go-csharp-helper-boundary.md复核 Go/C# 分层和当前阶段边界)
- docs/process/go-implementation-log.md复核 N2 执行记录)
- go.mod
- git status / git ls-files / Test-Path / go list 边界输出
### 结构问题
- 未发现进入 N3未创建 `internal/helperclient``internal/tools``cmd/isphere-mcp`,也未发现任何 `.go` 源文件。
- `go.mod` 当前只是 N2 要求的最小 Go module skeleton模块名为 `isphere-ai-bridge`,与计划一致。
- Go/C# 边界仍清晰Go 侧只有 module 元数据,没有 helper protocol contract、process client、MCP server 或 tool handlerC# helper 仍是 Windows/UIA 执行层。
- 未发现过度设计没有新增目录框架、server 空壳、抽象层、MCP 依赖或工具注册代码。
### 代码问题
- `go.mod` 内容只有 `module isphere-ai-bridge``go 1.23`,无 `require`,未引入不必要依赖。
- 未发现 `go.sum`,未发现 Go 源码文件因此不存在提前实现搜索联系人、打开会话、发送消息、文件收发、自动登录、注入、hook、读内存、规避安防等能力。
- 未发现硬编码业务动作或假实现;当前唯一新增的 Go 相关内容是模块元数据。
- 注意:`go.mod` 目前在 `git status` 中是未跟踪文件;这符合 N2 “创建 go.mod”的事实但后续提交时需按计划精确 stage不要 broad `git add -A`
### 测试问题
- 已复核 `go version``go version go1.23.4 windows/amd64`
- 已复核 `go list ./...`:输出 `go: warning: "./..." matched no packages`,退出码 `0`,符合 N2 对无 package skeleton 的接受条件。
- 当前阶段无 Go package、无 Go test这是 N2 范围内可接受状态;不应要求 N3 的 contract test。
- 路径复核结果:`go.sum=false``cmd/isphere-mcp=false``internal/helperclient=false``internal/tools=false``go_files=0`
### 是否建议返工
- 不建议返工。
- 建议维持当前 N2 边界,等待业务经理批准后才进入 N3N3 前不要补写 contract.go、client_test.go 或任何 server/tool 代码。
### 结论
- 第二轮 N2 结果与计划一致:只创建最小 `go.mod`,无依赖、无 Go 源码、无 N3 内容、无越界动作。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证或假通过。
## 2026-07-05 第三轮 N3 Go helper protocol contract 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N3 Go helper protocol contract
- docs/go-csharp-helper-boundary.md复核 `isphere.helper.v1` 请求/响应协议边界)
- docs/process/go-implementation-log.md复核 N3 red/green/补充验证记录)
- go.mod
- internal/helperclient/contract.go
- internal/helperclient/client_test.go
- git status / git ls-files / Test-Path / go test / go list -m all 边界输出
### 结构问题
- 未发现进入 N4`internal/helperclient/client.go=false`,未实现 helper 进程调用、路径解析、stdin/stdout、timeout、stderr 捕获等 N4 内容。
- 未发现 MCP server/tools 提前创建:`cmd/isphere-mcp=false``internal/tools=false``internal/mcpserver=false`
- 当前 Go 侧只有 `internal/helperclient/contract.go``internal/helperclient/client_test.go` 两个 `.go` 文件,范围符合 N3 “纯 JSON contract”。
- Go/C# 边界仍清晰Go N3 仅建模 `isphere.helper.v1` JSON 结构;未启动 C# helper未复制 UIA/窗口扫描逻辑。
- 未发现过度设计:没有 client interface、mock helper、server skeleton、审计/审批目录、MCP 抽象或额外框架。
### 代码问题
- `HelperRequest` 字段覆盖 `protocol``request_id``op``timeout_ms``args``HelperResponse` 字段覆盖 `protocol``request_id``op``ok``data``error``warnings``HelperError` 覆盖 `code``message`,与 N3 要求一致。
- `HelperResponse.Data` 使用 `map[string]json.RawMessage`,能保留未知 data 字段,符合 N3 验收点。
- `go.mod` 仍只有 module/go 版本;`go list -m all` 仅输出 `isphere-ai-bridge`,未引入外部依赖,未生成 `go.sum`
- 未发现提前实现搜索联系人、打开会话、发送消息、文件收发、自动登录、注入、hook、读内存、规避安防等能力代码中未出现 `exec.Command``Start-Process``--json``net/http`、MCP/tool 调用。
- 非阻塞质量项:测试未显式断言 `timeout_ms` 已被 marshal也未断言 response 的 `protocol/request_id/op` 回填;结构体已具备字段,建议 N3 后续如补强测试时只补 contract 测试,不进入 N4。
- 非阻塞质量项:`Warnings []string` 对当前空数组可用;若 C# 未来返回非字符串 warning 对象,需要再评估是否改为 `[]json.RawMessage` 或结构化 warning。
### 测试问题
- 已复核 `go test ./internal/helperclient -run Contract -v -count=1`3 个 Contract 测试 PASS退出码 `0`
- 已复核 `go test ./... -count=1`PASS退出码 `0`
- 测试是纯 JSON marshal/unmarshal未启动真实 C# helper符合 N3 “不依赖真实 helper 进程”的要求。
- 当前测试覆盖 N3 核心验收点version request protocol、success response ok/helper_name/unknown field、error response ok=false/error.code=WINDOW_NOT_FOUND。
- 未复现 Red 阶段因为本轮只读审查不回退代码Red 证据来自 `docs/process/go-implementation-log.md` 的记录。
### 是否建议返工
- 不建议返工。
- 建议保持当前 N3 边界,等待业务经理批准后才进入 N4不要在本轮补 `client.go`、helper 启动逻辑、MCP server 或 tools。
### 结论
- 第三轮 N3 结果与计划一致:实现了最小 Go JSON contract 和 contract 测试,无外部依赖、无 `go.sum`、无 N4 client、无 MCP server/tools、无真实 helper 调用。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证或假通过。
## 2026-07-05 第四轮 N4 Go helper process client 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N4 Go helper process client
- docs/go-csharp-helper-boundary.md复核一次性 CLI、stdin/stdout JSON、Go/C# 分层边界)
- docs/process/go-implementation-log.md复核 N4 red/green/真实 helper version 记录)
- go.mod
- internal/helperclient/client.go
- internal/helperclient/contract.go
- internal/helperclient/client_test.go
- git status / Test-Path / go test / go list -m all / Select-String 边界输出
### 结构问题
- 未发现进入 N5本轮只实现 `internal/helperclient.Client` 进程调用;未新增 `scripts/verify-go-mcp.ps1`、未执行 Go MCP 层验证,也未创建 N5 之外的流程脚本。
- 未发现提前创建 MCP server/tools/cmd`cmd/isphere-mcp=false``internal/tools=false``internal/mcpserver=false`
- Go/C# 边界仍清晰Go 只负责 helper 路径解析、启动 C# helper、stdin 写 JSON、stdout/stderr 读取、context timeout 和结构化 Go error未复制 C# UIA、窗口枚举或控件树逻辑。
- `Client.Call(ctx, op, args)` 保持 N4 通用 process client API没有业务动作方法未出现 search/send/file/login 等专用 API。
- 未发现过度设计:没有接口工厂、常驻 helper、HTTP/gRPC/named pipe、MCP 抽象、审批/审计目录或额外框架。
### 代码问题
- `client.go` 使用标准库 `os/exec` 调用 helper with `--json`stdin 写入 `HelperRequest`stdout 反序列化 `HelperResponse`stderr/exit code 纳入 `ClientError`,符合 N4 职责。
- 缺失 helper、timeout、bad JSON、non-zero exit 均有结构化错误码,范围清晰。
- `go.mod` 仍只有 module/go 版本;`go list -m all` 仅输出 `isphere-ai-bridge`,无外部依赖,未生成 `go.sum`
- `git status --short -- native/ISphereWinHelper scripts` 为空,未改 C# helper 或脚本。
- 未发现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等越界能力Go 文件中未命中这些动作关键字,也未出现 UIAutomation/AutomationElement/SendKeys 等 UI 操作逻辑。
- 非阻塞质量项:`newRequestID()` 当前生成 32 位 hex 字符串,不是带 hyphen 的 UUID 字符串C# 当前只按 opaque string 回显N4 不阻塞但若严格遵守边界文档“uuid-string”可在后续小补强。
- 非阻塞质量项:`Client.Call` 未校验 helper 响应的 `protocol/request_id/op` 是否与请求一致;当前 N4 验收未强制,但后续可补,减少错线响应或伪响应风险。
- 非阻塞质量项:测试未直接断言 stub 收到 `--json` 和 stdin 请求内容;代码路径已可见,但后续可增加专门 stub 验证,提升防回归强度。
### 测试问题
- 已复核 `go test ./internal/helperclient -run Client -v -count=1`5 个 Client 测试全部 PASS退出码 `0`
- 真实 helper version 测试本轮实际执行并通过,日志包含 `helper_name=ISphereWinHelper path=E:\coding\codex\isphere-ai-bridge\runs\win-helper\ISphereWinHelper.exe`
- 已复核 `go test ./... -count=1`PASS退出码 `0`
- `go list -m all` 退出码 `0`,仅有根模块,无不必要依赖。
- 测试覆盖 missing helper、bad JSON、timeout、non-zero exit/stderr、真实 version call未执行搜索、发送、文件、登录或 UI 动作。
- 未复现 Red 阶段因为本轮只读审查不回退代码Red 证据来自 `docs/process/go-implementation-log.md` 的记录。
### 是否建议返工
- 不建议返工。
- 建议保持当前 N4 边界,等待业务经理批准后才进入 N5不要在本轮补 MCP server/tools/cmd也不要扩大到业务动作。
### 结论
- 第四轮 N4 结果与计划一致:实现了 Go helper process client能调用现有 C# helper 的真实 `version`,无外部依赖、无 MCP server/tools、无 C# 修改、无 UIA 逻辑复制、无业务动作越界。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证或假通过。
## 2026-07-05 第五轮 N5 Helper client live verification 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N5 Helper client live verification
- docs/go-csharp-helper-boundary.md复核一次性 CLI、stdin/stdout JSON、只读 helper 边界)
- docs/process/go-implementation-log.md复核 N5 helper live verification 记录)
- docs/process/csharp-helper-log.md复核 N5 C# helper 单体验证记录)
- go.mod
- internal/helperclient/client.go
- internal/helperclient/contract.go
- internal/helperclient/client_test.go
- git status / Test-Path / go test / go list -m all / Select-String 边界输出
### 结构问题
- 未发现进入 N6未新增 MCP library decision 记录,`go.mod` 无 MCP 依赖,`go list -m all` 仅输出根模块 `isphere-ai-bridge`
- 未发现提前创建 MCP server/tools/cmd`cmd/isphere-mcp=false``internal/tools=false``internal/mcpserver=false``scripts/verify-go-mcp.ps1=false`
- N5 本身是 live verification 节点;过程日志显示本轮只追加 Go 日志C# helper 日志也声明未改 C# 文件,结构没有因 N5 被扩大。
- Go/C# 边界仍清晰Go helperclient 只负责启动 helper、stdin/stdout JSON、stderr/exit code、timeout 和结构化错误C# helper 仍只负责 `version` / `self_check` / `scan_windows` / `dump_uia`
- 未发现过度设计没有新目录框架、MCP 框架、HTTP/gRPC/named pipe、常驻 helper、审批/审计抽象或业务工具层。
### 代码问题
- `git status --short -- native/ISphereWinHelper scripts` 为空,未发现 C# helper 或脚本修改。
- 当前 Go 文件仍只有 `internal/helperclient/client.go``contract.go``client_test.go` 三个文件;未新增业务动作代码。
- 关键词检查未命中搜索联系人、打开会话、发送消息、文件收发、自动登录、注入、hook、读内存、UIAutomation/AutomationElement/SendKeys 等越界实现。
- 未发现不必要依赖:`go.mod` 仍只有 module/go 版本,未生成 `go.sum`
- 未发现硬编码假通过:真实 helper version 测试读取默认路径 `runs\win-helper\ISphereWinHelper.exe` 并断言响应 `helper_name=ISphereWinHelper`C# helper 日志中的 `verify-win-helper.ps1` 覆盖四个只读 op 和临时 WinForms `dump_uia`
- 非阻塞质量项沿用 N4后续仍可补响应 `protocol/request_id/op` 校验,以及让 `newRequestID()` 严格符合 UUID 格式;这不是 N5 阻塞项。
### 测试问题
- 本轮未重新运行 `scripts\verify-win-helper.ps1`,原因是审查职责为只读,避免构建脚本再次写入 `runs/`C# helper 验证结果依据 Go/C# 过程日志交叉复核。
- 已复核 `go test ./internal/helperclient -v -count=1`Contract 与 Client 测试全部 PASS退出码 `0`,输出包含真实 helper version 调用 `helper_name=ISphereWinHelper path=E:\coding\codex\isphere-ai-bridge\runs\win-helper\ISphereWinHelper.exe`
- 已复核 `go test ./... -count=1`PASS退出码 `0`
- 已复核 `go list -m all`:退出码 `0`,仅输出 `isphere-ai-bridge`
- C# helper 日志显示 `powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1` 退出码 `0`,输出 `ok=true``version=0.1.0``scan_window_count=30``uia_available=true`,且只涉及 `version/self_check/scan_windows/dump_uia`
### 是否建议返工
- 不建议返工。
- 建议保持当前 N5 结论,等待业务经理批准后才进入 N6不要在当前轮次选择 MCP library、添加依赖、创建 server/tools/cmd 或扩大业务能力。
### 结论
- 第五轮 N5 结果与计划一致:完成 helper live verificationGo helperclient 能调用真实 C# helper 的 `version`C# helper 单体验证覆盖四个只读 op未发现 N6、MCP server/tools、外部依赖、C# 修改或业务动作越界。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证或假通过。
## 2026-07-05 第六轮 N6 MCP library decision 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N6 MCP library decision
- docs/go-mcp-library-decision.md
- docs/process/go-implementation-log.md复核 N6 执行记录)
- go.mod
- go.sum
- internal/helperclient/client.go
- internal/helperclient/contract.go
- internal/helperclient/client_test.go
- git status / Test-Path / git ls-files / go list -m all / go test / go doc / Select-String 边界输出
### 结构问题
- 未发现进入 N7`cmd/isphere-mcp=false``internal/mcpserver=false`,未写 server skeleton未调用 `mcp.NewServer` 的 Go 代码。
- 未发现进入 N8`internal/tools=false`,未注册 `win_helper_*` 工具,未创建 tool handler。
- N6 产物集中在库决策文档和 Go module 元数据:`docs/go-mcp-library-decision.md``go.mod``go.sum`Go 源码仍只有 `internal/helperclient` 三个既有文件。
- Go/C# 边界未被破坏:本轮没有调用 C# helper、没有修改 C# helper/脚本Go 侧也没有新增窗口/UIA/业务动作代码。
- 未发现过度设计:没有 HTTP server、gRPC、named pipe、后台 daemon、多 MCP 框架、server 目录或工具目录。
### 代码问题
- `go.mod` 当前为 `go 1.23.0``toolchain go1.23.4`,并仅新增 `require github.com/modelcontextprotocol/go-sdk v1.3.1 // indirect`N6 未写 import因此保持 indirect 属于 Go 工具当前状态,后续 N7/N8 首次 import 后可自然变 direct。
- `go.sum` 仅包含 `github.com/modelcontextprotocol/go-sdk v1.3.1` 两条校验和;未出现 `v1.6.1``v1.7.0``go 1.25` 版本线。
- `go list -m all` 显示 SDK 的 transitive module graph但 MCP-related dependency 只有 `github.com/modelcontextprotocol/go-sdk v1.3.1` 一个;未发现第二个 MCP 框架。
- `go doc` 复核通过:`mcp.StdioTransport` 支持 stdin/stdout newline-delimited JSON`mcp.AddTool` 支持 typed handler 和 JSON schema 推断;`mcp.NewServer` 存在但当前未在代码中使用。
- 关键词检查显示 MCP SDK 相关符号只出现在决策文档,不在 Go 源码中;未提前实现 server/tool。
- 未发现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等越界能力。
- 非阻塞注意:`go list -m all` 包含 SDK 的若干传递依赖(如 jsonschema、oauth2、x/sys 等);这来自官方 SDK module graph当前没有项目代码 import 这些包,不构成额外框架选择,但后续 N7/N8 应避免再引入第二套 MCP 或 HTTP server 依赖。
### 测试问题
- 已复核 `go test ./... -count=1`PASS退出码 `0`
- 已复核 `go list -m all`:退出码 `0`,输出包含 `github.com/modelcontextprotocol/go-sdk v1.3.1`,未出现其他 MCP-related module。
- 已复核 `go doc github.com/modelcontextprotocol/go-sdk/mcp.StdioTransport``AddTool``NewServer`:均退出码 `0`,与决策文档中的 stdio/tool/schema 说法一致。
- `git status --short -- native/ISphereWinHelper scripts` 为空,未发现 C# helper 或脚本修改。
- `git ls-files``cmd/isphere-mcp/*``internal/mcpserver/*``internal/tools/*``scripts/verify-go-mcp.ps1``src/isphere_ai_bridge/*``tests/test_*.py` 无输出,未发现提前进入 N7/N8 或恢复 Python 路径。
### 是否建议返工
- 不建议返工。
- 建议保持当前 N6 边界,等待业务经理批准后才进入 N7N7 前不要创建 `cmd/isphere-mcp``internal/mcpserver``internal/tools`,也不要注册工具或扩大业务能力。
### 结论
- 第六轮 N6 结果与计划一致:只完成 MCP library decision选择 `github.com/modelcontextprotocol/go-sdk v1.3.1` / `mcp` 包,记录了 stdio、AddTool、schema、维护风险和适配四个工具的理由未写 server code、未注册工具、未调用 C# helper、未改 C#。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证或假通过。
## 2026-07-05 第七轮 N7 Go MCP server skeleton 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N7 Go MCP server skeleton
- cmd/isphere-mcp/main.go
- internal/mcpserver/server.go
- internal/mcpserver/server_test.go
- go.mod
- go.sum
- docs/process/go-implementation-log.md复核 N7 red/green/build 记录)
- internal/helperclient/client.go / contract.go / client_test.go边界关键词复核
- git status / Test-Path / git ls-files / go list -m all / go test / go build / Select-String 边界输出
### 结构问题
- 未发现进入 N8`internal/tools=false``git ls-files -- internal/tools/*` 无输出Go 源码中未出现 `AddTool``mcp.AddTool``win_helper_*` 工具注册。
- N7 server skeleton 范围清晰:`cmd/isphere-mcp/main.go` 仅创建 context、调用 `mcpserver.NewServer()` 并用 `mcp.StdioTransport` 运行;`internal/mcpserver/server.go` 仅封装 `mcp.NewServer` 和 server metadata。
- `internal/mcpserver/server_test.go` 只验证空 MCP server 可构造,不启动 stdio、不调用 C# helper、不导入 helperclient。
- Go/C# 边界仍清晰:`cmd/isphere-mcp``internal/mcpserver` 未导入 `internal/helperclient`,未解析 helper 路径,未调用 `ISphereWinHelper.exe`C# helper/脚本状态为空修改。
- 未发现过度设计:没有业务 tool 层、HTTP listener、gRPC、named pipe、后台 daemon、审批/审计抽象、第二套 MCP 框架或复杂配置系统。
### 代码问题
- `server.go``ServerName``ServerTitle``ServerVersion` 是 server metadata 常量,属于 N7 skeleton 必需信息,不是业务假实现。
- `main.go` 使用 `mcp.StdioTransport`,符合 N7 stdio server skeleton 目标;没有 HTTP server 或 Python/Node runtime。
- `go.mod` 现在将 `github.com/modelcontextprotocol/go-sdk v1.3.1` 调整为 direct require并列出 SDK 需要的 indirect dependencies这是首次 import SDK 包后的正常 module 元数据变化。
- `go.sum` 包含 SDK 及其传递依赖校验和;未发现第二个 MCP SDK 或 `v1.6.1`/`v1.7.0`/`go 1.25` 版本线。
- `go list -m all` 中出现的 transitive modules 来自官方 SDK 依赖图;当前项目源码未引入第二个 MCP 框架,也未新增 HTTP server 代码。
- 关键词检查未发现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等越界能力`ISphereWinHelper` 仅存在于既有 helperclient 代码/测试,不在 N7 server skeleton 中。
- 非阻塞质量项N7 当前只有“server 可构造”测试,未验证 `ServerName/Title/Version` 是否进入 SDK Implementation如果 SDK 提供稳定 accessor后续可补不影响 N7 骨架验收。
### 测试问题
- 已复核 `go test ./... -count=1``cmd/isphere-mcp [no test files]``internal/helperclient` PASS`internal/mcpserver` PASS退出码 `0`
- 已复核构建:使用 `go build -o NUL ./cmd/isphere-mcp` 退出码 `0`,并确认工作区没有留下 `isphere-mcp.exe`
- 已复核 `go list -m all`:退出码 `0`MCP-related dependency 仍为 `github.com/modelcontextprotocol/go-sdk v1.3.1`,未发现第二个 MCP 框架。
- `git status --short -- native/ISphereWinHelper scripts` 为空,未发现 C# helper 或脚本修改。
- 本轮未复现 Red 阶段因为只读审查不回退代码Red 证据来自 `docs/process/go-implementation-log.md`,记录最终因 `undefined: NewServer` 失败,随后 green/build 通过。
### 是否建议返工
- 不建议返工。
- 建议保持当前 N7 边界,等待业务经理批准后才进入 N8N8 前不要创建 `internal/tools`,不要注册 `AddTool`,不要引入 helperclient 到 server skeleton也不要扩大到业务动作。
### 结论
- 第七轮 N7 结果与计划一致:创建了最小 Go MCP stdio server skeleton可测试、可构建未注册工具、未创建 `internal/tools`、未导入 helperclient、未调用 C# helper、未改 C#。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证或假通过。
## 2026-07-05 第八轮 N8 Four read-only MCP tool handlers 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N8 Four read-only MCP tool handlers
- internal/tools/winhelper.go
- internal/tools/winhelper_test.go
- internal/mcpserver/server.go
- internal/mcpserver/server_test.go
- cmd/isphere-mcp/main.go
- go.mod
- go.sum
- docs/process/go-implementation-log.md复核 N8 red/green 记录)
- git status / Test-Path / git ls-files / go list -m all / go test / Select-String 边界输出
### 结构问题
- 未发现进入 N9`scripts/verify-go-mcp.ps1=false``git ls-files -- scripts/verify-go-mcp.ps1` 无输出,未创建 MCP stdio smoke verification 脚本。
- N8 范围集中在 `internal/tools``internal/mcpserver` 接入;`cmd/isphere-mcp/main.go` 未扩展业务逻辑。
- `internal/tools/winhelper.go` 通过 `RegisterWinHelperTools(server, caller)` 注册工具;`internal/mcpserver.NewServer()` 仅接入该注册函数并传入 `helperclient.Client{}`,构造阶段未调用 C# helper。
- Go/C# 边界清晰tool handler 只通过 `HelperCaller` / `internal/helperclient` 调 helper op未复制 C# UIA、WindowScanner、UiaDumper、user32、FindWindow、SendKeys 等逻辑。
- 未发现过度设计:没有额外插件框架、审批/审计层、HTTP/gRPC/named pipe、后台 daemon 或第二套 MCP 框架。
### 代码问题
- `mcp.AddTool``internal/tools/winhelper.go` 中恰好 4 处。
- 只注册四个工具名:`win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia`;未发现第五个工具。
- 参数结构符合 N8version/self_check 无业务参数scan 只有 `include_all_visible`dump 只有 `hwnd``max_depth``include_text``max_children`
- handler op 映射符合边界:`version``self_check``scan_windows``dump_uia`;没有 search/open/send/file/login 等业务动作 op。
- 生产 Go 文件动作词检查无命中:未出现 send/search/file/conversation/receive/upload/download/login 等业务动作词。
- 测试中出现 `send/search/file/login/upload/download/receive` 仅用于 forbidden tool-name 检查,不是实现动作。
- `go.mod` / `go.sum` 未显示新增第二个 MCP 框架;`go list -m all` 仍只有一个 MCP-related dependency`github.com/modelcontextprotocol/go-sdk v1.3.1`。SDK 传递依赖属于既有官方 SDK 依赖图。
- 非阻塞质量项:`DumpUIAArgs``MaxDepth``MaxChildren` 在 handler 中转为 `float64` 后传给 helper args当前测试按 MCP JSON number 行为验证C# `Convert.ToInt32` 可接受,暂不阻塞。
- 非阻塞质量项helper 返回 `ok:false` 时当前仍作为 tool output map 返回而不是 Go error这与协议“业务失败用 JSON ok:false 表达”一致,但后续 runbook 可明确客户端如何展示失败。
### 测试问题
- 已复核 `go test ./internal/tools -v -count=1`3 个 internal/tools 测试全部 PASS退出码 `0`
- 已复核 `go test ./... -count=1``cmd/isphere-mcp [no test files]``internal/helperclient` PASS`internal/mcpserver` PASS`internal/tools` PASS退出码 `0`
- tests 覆盖 exactly four tool names、schema 参数、handler 通过 fake caller 调用 helper op未调用真实 C# helper。
- `internal/mcpserver` 测试通过 in-memory transport 列出四个工具,不启动 stdio、不执行 helper。
- `git status --short -- native/ISphereWinHelper scripts` 为空,未发现 C# helper 或脚本修改。
- 未复现 Red 阶段因为只读审查不回退代码Red 证据来自 `docs/process/go-implementation-log.md`,记录 undefined 注册函数/参数结构和空工具列表失败,随后 green 通过。
### 是否建议返工
- 不建议返工。
- 建议保持当前 N8 边界,等待业务经理批准后才进入 N9N9 前不要创建 `scripts/verify-go-mcp.ps1`,不要做 stdio smoke 脚本,也不要扩大到搜索/会话/发送/文件/登录能力。
### 结论
- 第八轮 N8 结果与计划一致:只注册四个只读 WinHelper MCP toolshandler 经 `internal/helperclient` 调用 C# helper 协议 op无第五个工具、无直接 UI 操作、无 C# 修改、无 N9 脚本、无业务动作越界。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证或假通过。
## 2026-07-05 第九轮 N9 MCP stdio smoke verification 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N9 MCP stdio smoke verification
- scripts/verify-go-mcp.ps1
- docs/process/go-implementation-log.md复核 N9 red/green 记录)
- internal/tools/winhelper.go
- internal/mcpserver/server.go
- go.mod / go.sum / 当前 Go 测试与 git 状态输出
- PowerShell Parser / Select-String / Test-Path / git ls-files 边界输出
### 结构问题
- 未发现进入 N10`docs/go-mcp-runbook.md=false``git ls-files -- docs/go-mcp-runbook.md` 无输出,`README.md` 未修改。
- N9 新增范围集中在 `scripts/verify-go-mcp.ps1`;未新增 runbook、配置文档或 operator 操作说明。
- 验证脚本结构符合 N9先构建 C# helper再构建 Go MCP binary再通过官方 Go MCP SDK harness 自动 initialize/connect、tools/list、tools/call `win_helper_version`
- 脚本使用 SDK in-memory harness 而不是直接运行已构建二进制 stdio过程日志说明原因是 Windows PowerShell stdin BOM/encoding 问题,且 N9 计划允许“use the MCP library test harness”。脚本也明确输出 `transport=sdk_in_memory`,未伪装成真实 stdio binary run。
- 未发现过度设计没有新增服务、daemon、HTTP/gRPC/named pipe、N10 runbook、部署配置或第二套验证框架。
### 代码问题
- 脚本会构建 Go MCP binary 到系统临时目录,并在 finally 清理;会把临时 SDK harness 写到 `runs\go-mcp-harness-*` 并在 finally 清理。该设计可重复运行,但如果进程被强杀,可能残留 ignored `runs` 临时目录;这是非阻塞运维风险。
- 脚本最终 JSON 明确包含 `ok=true``helper_name``tool_count``tools``python_runtime_required=false``real_isphere_login_required=false``action_tools_present=false`
- `action_tools_present=false` 不是裸写假通过harness 先遍历 tool name 并检查 forbiddenTermssend/search/file/login/conversation/upload/download/receive/autologin发现即 fail随后才输出 false。
- `helper_name=ISphereWinHelper` 不是硬编码假通过harness 调用 `win_helper_version` 后从 structured content 的 `data.helper_name` 读取并断言等于 `ISphereWinHelper`
- `tool_count=4` 不是硬编码假通过harness 通过 `ListTools` 获取 toolNames排序后与四个期望工具名比较并断言长度为 4。
- 未发现 N9 脚本实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存或规避安防动作词只出现在 forbiddenTerms 或 false 输出字段中。
- `go list -m all` 仍只有一个 MCP-related dependency`github.com/modelcontextprotocol/go-sdk v1.3.1`;未发现新增不必要 MCP 依赖。
- C# helper 源码和既有 `build-win-helper.ps1` / `verify-win-helper.ps1` 无修改;新增脚本 `scripts/verify-go-mcp.ps1` 属于 N9 范围。
### 测试问题
- 本轮未重新运行 `scripts\verify-go-mcp.ps1`,因为本轮硬性约束是不创建任何文件(除追加本审查文档);该脚本会构建 helper/binary 并创建临时 harness 目录。审查改用静态脚本审查、过程日志复核和 Go 测试复核。
- 已复核 PowerShell 脚本语法:`Parser.ParseFile` 返回 `parse_ok=true`
- 已复核 `go test ./... -count=1``cmd/isphere-mcp [no test files]``internal/helperclient` PASS`internal/mcpserver` PASS`internal/tools` PASS退出码 `0`
- 已复核 `go list -m all`:退出码 `0`MCP-related dependency 仍为 `github.com/modelcontextprotocol/go-sdk v1.3.1`
- 已复核工具数量:`internal/tools/winhelper.go``mcp.AddTool` 数量为 4工具名仍是 `win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia`
- `git status --short -- native/ISphereWinHelper` 为空,`scripts/build-win-helper.ps1``scripts/verify-win-helper.ps1` 为空修改;`scripts/verify-go-mcp.ps1` 是本 N9 新增脚本。
- 未复现 N9 red/green 脚本执行因为只读审查不回退或重跑构建脚本Red/Green 证据来自 `docs/process/go-implementation-log.md`,其中记录最终 `verify_go_mcp_exit=0` 和关键 JSON 输出。
### 是否建议返工
- 不建议返工。
- 建议保持当前 N9 边界,等待业务经理批准后才进入 N10N10 前不要创建 runbook不要新增业务工具不要扩大到搜索/会话/发送/文件/登录能力。
### 结论
- 第九轮 N9 结果与计划一致:新增可重复 MCP smoke verification 脚本,验证 C# helper 构建、Go MCP binary 构建、MCP initialize/list/call `win_helper_version`,并确认四个工具、无 action tools、无需 Python、无需真实 iSphere 登录。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证、硬编码假通过、N10 runbook 或业务动作越界。
## 2026-07-05 第十轮 N10 Operator runbook 审查记录
### 审查文件
- docs/go-mcp-minimal-plan.md重点复核 N10 Operator runbook and process scripts
- docs/go-mcp-runbook.md
- docs/process/go-implementation-log.md复核 N10 执行记录)
- README.md / cmd / internal / go.mod / go.sum / native/ISphereWinHelper / scripts 的 git 状态输出
- internal/tools/winhelper.go / internal/mcpserver/server.go / cmd/isphere-mcp/main.go 的工具与边界抽查输出
### 结构问题
- Runbook 结构完整,包含 Prerequisites、Build C# helper、Verify C# helper、Build Go MCP、Verify Go MCP、Configure MCP client command、Allowed tools、Explicit non-goals and safety boundaries、Real-login UIA capture procedure、Troubleshooting。
- N10 计划要求的八类内容均已覆盖:构建/验证 C# helper、构建/验证 Go MCP、配置 MCP client command、允许工具、明确非目标、real-login UIA capture procedure。
- Real-login UIA capture procedure 明确标注为 later real-login capture gate要求 explicit approval不要求当前执行这是 N10 runbook 范围内的操作说明,不是提前进入 N12。
- 未发现进入 N11`git log -1 --oneline` 仍为 `87e0e47 chore: remove temporary python mcp layer`,未执行 N11 commit/review checkpoint。
- README 状态为空,未发现 README 修改N10 实现日志说明检查过 README 后选择不改符合“only if needed”。
- 工作区仍保留前序 N2-N10 的未跟踪实现/过程文件;未发现本轮回退他人改动或提交。
### 代码问题
- 本轮为文档轮,未发现 tracked code/script/native/README diff`git diff --name-only -- README.md cmd internal go.mod go.sum native/ISphereWinHelper scripts` 为空。
- `docs/go-mcp-runbook.md` 原样包含四条 N10 必需命令:`powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1``go test ./...``go build ./cmd/isphere-mcp``powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1`
- Runbook 只列出四个允许工具:`win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia``internal/tools/winhelper.go``mcp.AddTool` 数量仍为 4。
- Runbook 明确写出 N10 必需边界:`no login automation``no send message``no send file``no receive/download file``no process injection``no hook``no memory reading`,并额外列出 no search contacts、no open conversation、no automatic login、no Python MCP fallback。
- Go/C# 边界表达清晰C# helper 是 Windows/UI Automation execution layerGo MCP 是 stdio server 和四个只读 tool handlerRunbook 没有要求 Python MCP fallback 或 Go 侧复制 UIA/窗口逻辑。
- 未发现伪造或硬编码假通过说法Runbook 使用“Expected output includes”描述操作者应看到的验证结果并指向现有验证脚本没有声称未运行的本轮验证已经通过。
- 未发现暗示业务能力已实现Runbook 明确当前阶段不自动登录、不搜索联系人、不打开会话、不发送消息、不发送/接收文件future send/file operations 被写为“if ever approved”且“not implemented in this phase”。
- 未发现新增不必要脚本或依赖N10 新增范围是 `docs/go-mcp-runbook.md``go.mod` 仍只有官方 MCP SDK direct require其他为 SDK indirect dependencies。
### 测试问题
- N10 是文档/运行手册节点,本身不要求新增 Go 测试或执行会生成产物的 smoke 脚本。
- 已复核 `go list -m all`:退出码 `0`MCP-related dependency 仍为 `github.com/modelcontextprotocol/go-sdk v1.3.1`,未发现第二个 MCP SDK。
- 已复核 `go test ./... -count=1``cmd/isphere-mcp [no test files]``internal/helperclient` PASS`internal/mcpserver` PASS`internal/tools` PASS退出码 `0`
- 未重新执行 `scripts\verify-go-mcp.ps1`,因为本轮审查约束是不创建任何文件(除追加本审查文档),该脚本会构建 helper/binary 并创建临时 harness 目录;本轮改用 runbook 内容核验、Go 测试和 git 状态复核。
- 已用 `Select-String -SimpleMatch` 复核必需命令、四个工具名、边界短语和 `not implemented` 均在 runbook 中存在。
### 是否建议返工
- 不建议返工。
- 建议保持当前 N10 边界,等待业务经理批准后才进入 N11N11 前不要提交、不要新增业务工具、不要扩大到搜索/会话/发送/文件/登录能力。
### 结论
- 第十轮 N10 结果与计划一致:新增 operator runbook覆盖构建、验证、MCP client 配置、四个只读工具、非目标边界和未来 real-login UIA capture procedureREADME 未改,功能代码未改,未新增依赖或脚本,未进入 N11。
- 未发现过度设计、不必要依赖、Go/C# 边界混乱、伪造验证、硬编码假通过或暗示未实现业务能力。

314
docs/process/pi-review.md Normal file
View File

@@ -0,0 +1,314 @@
## 2026-07-05 16:23:55 +08:00 pi 审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划/审批/日志docs/go-mcp-minimal-plan.mddocs/process/business-manager-review.mddocs/process/go-implementation-log.mddocs/process/csharp-helper-log.md。
- 验证脚本scripts/verify-win-helper.ps1scripts/build-win-helper.ps1。
- C# Helper 关键源码native/ISphereWinHelper/Program.csHelperProtocol.csWindowScanner.csUiaDumper.cs。
- 边界检查git status --short --untracked-files=allgit ls-files文件系统中 go.mod/*.go 检查native/scripts 禁止能力关键词检查。
### 发现的问题
- 未发现阻塞问题。
- N1 验证不是硬编码成功verify-win-helper.ps1 会调用 build-win-helper.ps1本次复核用 -SkipBuild 避免重新写构建产物),并通过 helper --json 实际调用 version、self_check、scan_windows、dump_uiadump_uia 还会创建临时 WinForms 窗口并断言 root control_type 为 Window。
- 已做新鲜复核powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1 -SkipBuild 退出码 0输出 {"ok":true,"helper":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe","version":"0.1.0","scan_window_count":30,"uia_available":true}。
- 未见 N2 越界git ls-files -- 'go.mod' '*.go' 'src/isphere_ai_bridge/*' 'tests/test_*.py' 无输出;文件系统 go.mod/*.go 检查无输出。
- 未见提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等能力native/scripts 关键词检查仅命中 message 字段、control_type、build 脚本 File 参数等非能力实现内容。
- 低风险观察verify-win-helper.ps1 会输出 helper_version 和 uia_available但脚本没有单独硬断言 helper_version 必须等于 0.1.0、uia_available 必须为布尔类型;本次实际输出符合 N1 验收,因此不构成阻塞。
- 工作树观察:存在未跟踪过程/计划文档 docs/go-mcp-minimal-plan.md、docs/process/business-manager-review.md、docs/process/csharp-helper-log.md、docs/process/go-implementation-log.md以及审查期间新出现的 docs/process/opencode-review.md未见代码文件或 Go 工程文件越界。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N2也不代表本轮可直接实施 N2。进入 N2 仍应按流程另行获批。
### 结论
N0/N1 的实现与验证证据可信未发现硬编码成功、伪造测试结果或绕过计划节点的阻塞证据。N1 的测试确实覆盖 helper 的四个只读 op并通过临时 WinForms 窗口验证 dump_uia 的实际 UIA 行为。建议作为低风险通过本轮 pi 审查。
## 2026-07-05 17:29:28 +08:00 pi 第二轮审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划与审批docs/go-mcp-minimal-plan.md 的 N2docs/process/business-manager-review.md 的 N2 执行前审批。
- 实现证据go.moddocs/process/go-implementation-log.md 的 N2 记录。
- 验证命令go versiongo list ./...go list -m allgit status --short --untracked-files=all。
- 边界检查Test-Path cmd/isphere-mcp、internal/helperclient、internal/tools、go.sumgit ls-files -- '*.go' 等PowerShell 文件系统 .go/go.sum 检查native/scripts 禁止能力关键词复核。
### 发现的问题
- 未发现阻塞问题。
- N2 实现真实go.mod 当前内容仅为 module isphere-ai-bridge 和 go 1.23,符合最小 Go module skeleton。
- Go 工具链复核通过go version 输出 go version go1.23.4 windows/amd64。
- N2 验证命令复核通过go list ./... 输出 warning matched no packagesgo_list_exit=0符合 N2 无 package 阶段的验收条件。
- 最小依赖复核通过go list -m all 仅输出 isphere-ai-bridgego_list_m_exit=0go.mod 无 requirego.sum 不存在。
- 未发现进入 N3cmd/isphere-mcp=Falseinternal/helperclient=Falseinternal/tools=Falsegit ls-files -- '*.go' 等无输出;文件系统 .go/go.sum 检查无输出。
- 未发现硬编码成功或伪造结果:结论来自实际读取 go.mod 和现场执行 go version/go list/go list -m all不是只引用实现智能体报告。
- 未发现提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等能力本轮没有新增 .go 代码native/scripts 关键词复核仅命中 HelperProtocol 的 message 字段等非业务动作内容。
- 工作树观察git status 显示 go.mod 以及过程/计划文档未跟踪;其中 go.mod 是 N2 预期产物docs/process/pi-review.md 是本审查允许追加的过程文档。未见 N3 目录或 Go 源码文件。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N3也不代表可直接实施 N3。进入 N3 仍应按流程另行获批。
### 结论
第二轮 N2 的 Go module skeleton 实现可信、范围最小、无外部依赖,验证命令真实覆盖 N2 要求;未发现绕过计划节点进入 N3未发现伪造测试结果或提前实现禁止能力。建议低风险通过本轮 pi 审查。
## 2026-07-05 17:39:38 +08:00 pi 第三轮审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划与审批docs/go-mcp-minimal-plan.md 的 N3docs/process/business-manager-review.md 的 N3 执行前审批。
- 实现证据internal/helperclient/contract.gointernal/helperclient/client_test.gogo.moddocs/process/go-implementation-log.md 的 N3 记录。
- 验证命令go test ./internal/helperclient -run Contract -v -count=1go test ./... -count=1go list -m allgo test ./internal/helperclient -run '^TestContractSuccessResponsePreservesDataFields$' -v -count=1git status --short --untracked-files=all。
- 边界检查Test-Path internal/helperclient/client.go、cmd/isphere-mcp、internal/tools、go.sumgit ls-files -- '*.go' 等PowerShell 文件系统 .go/go.sum 检查Go 源码禁止能力关键词复核。
### 发现的问题
- 未发现阻塞问题。
- N3 实现真实contract.go 定义 HelperRequest、HelperResponse、HelperError字段覆盖 protocol、request_id、op、timeout_ms、args、ok、data、error、warnings没有进程调用代码。
- Contract 测试真实覆盖 N3 行为TestContractVersionRequestMarshalsProtocol 验证 version request 的 protocol/request_id/op/argsTestContractSuccessResponsePreservesDataFields 验证 ok=true、data.helper_name=ISphereWinHelper 且 extra_unknown 未丢失TestContractErrorResponseUnmarshalsErrorCode 验证 ok=false、error.code=WINDOW_NOT_FOUND、data null 处理。
- 现场复跑通过go test ./internal/helperclient -run Contract -v -count=1 三个 Contract 测试均 PASSexit=0。
- 补充复跑通过go test ./... -count=1 输出 ok isphere-ai-bridge/internal/helperclientexit=0。
- unknown data fields 保留方式可信HelperResponse.Data 使用 map[string]json.RawMessage单测 payload 中 extra_unknown 被检查存在,专项复跑 TestContractSuccessResponsePreservesDataFields 通过。
- 未发现外部依赖go.mod 仅 module isphere-ai-bridge 和 go 1.23Select-String 未发现 require/replace/excludego list -m all 仅输出 isphere-ai-bridgego.sum 不存在。
- 未发现进入 N4internal/helperclient/client.go=Falsecmd/isphere-mcp=Falseinternal/tools=Falsego.sum=False文件系统 .go/go.sum 检查仅发现 internal/helperclient/client_test.go 和 contract.go。
- 未发现提前启动 C# helper 或实现进程调用Go 源码关键词复核未命中 os/exec、exec.Command、--json、Start-Process 等进程调用内容;仅命中测试样例中的 ISphereWinHelper 字符串。
- 未发现提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等能力。
- 非阻塞观察Red 阶段失败无法在当前已实现状态下不改代码复现,只能通过 go-implementation-log 审查其记录;这不影响当前 Green 和边界复核结论。unknown 字段测试目前验证 key 未丢失,结合 RawMessage 类型可满足“保留为 raw JSON”的 N3 要求。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N4也不代表可直接实施 N4。进入 N4 仍应按流程另行获批。
### 结论
第三轮 N3 的纯 JSON contract 实现可信,测试真实覆盖 request marshal、success/error response unmarshal 和 unknown data 保留未发现硬编码成功、伪造测试结果、外部依赖、C# helper 启动或 N4 进程调用越界。建议低风险通过本轮 pi 审查。
## 2026-07-05 17:52:01 +08:00 pi 第四轮审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划与审批docs/go-mcp-minimal-plan.md 的 N4docs/process/business-manager-review.md 的 N4 执行前审批。
- 实现证据internal/helperclient/client.gointernal/helperclient/client_test.gointernal/helperclient/contract.gogo.moddocs/process/go-implementation-log.md 的 N4 记录。
- 验证命令go test ./internal/helperclient -run Client -v -count=1go test ./... -count=1go list -m allgit status --short --untracked-files=all。
- 边界检查Test-Path cmd/isphere-mcp、internal/tools、internal/mcpserver、go.sumgit ls-files 对 N5/N8 相关路径检查PowerShell 文件系统 .go/go.sum 检查Go 源码禁止业务能力关键词复核Get-Process helper-stub/ISphereWinHelper 泄漏复核。
### 发现的问题
- 未发现阻塞问题。
- N4 实现真实client.go 定义 Client、Client.Call(ctx, op, args) 和 ClientError默认 helper 路径解析到 repo 下 runs\win-helper\ISphereWinHelper.exe使用 exec.CommandContext(helperPath, "--json") 启动 helperstdin 写入 isphere.helper.v1 请求 JSONstdout 解析为 HelperResponsestderr/exit code/stdout 保留在结构化错误中。
- 现场复跑 Client 测试通过go test ./internal/helperclient -run Client -v -count=1 五个 Client 测试全部 PASSexit=0。
- 真实 helper version 测试不是伪造:本次测试日志明确输出 real helper version ok: helper_name=ISphereWinHelper path=E:\coding\codex\isphere-ai-bridge\runs\win-helper\ISphereWinHelper.exe说明没有 skip确实调用了 runs\win-helper\ISphereWinHelper.exe。
- process client 行为测试覆盖可信missing helper 返回 MISSING_HELPERbad helper output 返回 BAD_JSONtimeout 测试使用 10 秒 sleep stub 和 100ms context并断言耗时不超过 3 秒non-zero exit stub 退出码 7 且断言 stderr 包含 stub stderr boom真实 helper version 返回 ok=true 且 helper_name=ISphereWinHelper。
- timeout/进程泄漏风险已做复核:实现使用 exec.CommandContext 绑定 contexttimeout 测试通过且耗时约 1.53 秒;测试后 Get-Process helper-stub/ISphereWinHelper 输出 NO_HELPER_PROCESSES_FOUND。
- stderr 捕获已验证client.go 将 cmd.Stderr 指向 bytes.BufferClientError.Stderr 保存 stderrTextTestClientNonZeroExitCapturesStderrAsStructuredError 断言 stderr 内容和 ExitCode=7。
- 补充复跑通过go test ./... -count=1 输出 ok isphere-ai-bridge/internal/helperclientexit=0。
- 未发现外部依赖go list -m all 仅输出 isphere-ai-bridgeexit=0go.mod 未发现 require/replace/excludego.sum 不存在。
- 未发现进入 N5/N8cmd/isphere-mcp=Falseinternal/tools=Falseinternal/mcpserver=Falsego.sum=Falsegit ls-files 对相关路径无输出;文件系统 .go/go.sum 检查仅发现 internal/helperclient/client_test.go、client.go、contract.go。
- 未发现复制 C# UIA 逻辑到 Goclient.go 只做路径解析、进程启动、stdin/stdout/stderr、timeout 和错误封装,未实现 window scan、UIA dump 或 selector 逻辑。
- 未发现提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等能力Go 源码禁止业务能力关键词复核无输出。
- 非阻塞观察Red 阶段失败无法在当前已实现状态下不改代码复现,只能通过 go-implementation-log 审查其记录;这不影响当前 Green、真实 helper 调用和边界复核结论。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N5也不代表可直接实施 N5。进入 N5 仍应按流程另行获批。
### 结论
第四轮 N4 的 Go helper process client 实现可信,测试真实覆盖 missing helper、bad JSON、timeout、non-zero exit/stderr 捕获和真实 helper version 调用未发现硬编码成功、伪造测试结果、外部依赖、N5/N8 越界、MCP server/tools 创建、C# 修改或禁止业务能力。建议低风险通过本轮 pi 审查。
## 2026-07-05 18:01:28 +08:00 pi 第五轮审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划与审批docs/go-mcp-minimal-plan.md 的 N5docs/process/business-manager-review.md 的 N5 执行前审批。
- 实现/验证证据docs/process/go-implementation-log.md 的 N5 记录docs/process/csharp-helper-log.md 的 N5 记录scripts/verify-win-helper.ps1internal/helperclient/client_test.gogo.mod。
- 验证命令powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-win-helper.ps1 -SkipBuildgo test ./internal/helperclient -v -count=1go list -m allgit status --short --untracked-files=all。
- 边界检查Test-Path cmd/isphere-mcp、internal/tools、internal/mcpserver、go.sumgit ls-files 对 N6/N8 相关路径检查PowerShell 文件系统 .go/go.sum 检查verify-win-helper.ps1/helperclient 源码禁止业务动作关键词复核。
### 发现的问题
- 未发现阻塞问题。
- N5 验证真实go-implementation-log 和 csharp-helper-log 均记录本轮只做 live verification未报告功能代码变更。
- 本次复跑 PowerShell helper 验证使用 -SkipBuild原因是本轮审查只允许追加 pi-review.md避免重写构建产物verify-win-helper.ps1 在 -SkipBuild 下仍实际调用 version、self_check、scan_windows、dump_uia并创建临时 WinForms 窗口验证 dump_uia。复跑退出码 0输出 {"ok":true,"helper":"E:\\coding\\codex\\isphere-ai-bridge\\runs\\win-helper\\ISphereWinHelper.exe","version":"0.1.0","scan_window_count":30,"uia_available":true}。
- Go helperclient live test 复跑通过go test ./internal/helperclient -v -count=1 退出码 0Contract 测试和 Client 测试全部 PASS。
- Go test 确实包含 real helper version 调用:本次测试日志出现 real helper version ok: helper_name=ISphereWinHelper path=E:\coding\codex\isphere-ai-bridge\runs\win-helper\ISphereWinHelper.exe说明 TestClientRealVersionCallWhenHelperIsBuilt 没有 skip确实调用了 runs\win-helper\ISphereWinHelper.exe。
- 未发现伪造测试结果:结论来自现场复跑 PowerShell helper 验证和 Go test而非只引用智能体报告。
- 未发现进入 N6go list -m all 仅输出 isphere-ai-bridgego.mod 未发现 require/replace/excludego.sum 不存在;没有 MCP library decision 产物。
- 未发现进入 N8/MCP server/toolscmd/isphere-mcp=Falseinternal/tools=Falseinternal/mcpserver=Falsegit ls-files 对这些路径无输出;文件系统 .go/go.sum 检查仅发现 internal/helperclient/client_test.go、client.go、contract.go。
- verify-win-helper.ps1 的 op 范围复核为 version、self_check、scan_windows、dump_uia未发现点击、输入、发送、上传、下载相关 API 或业务动作实现。
- helperclient/verify 脚本禁止业务动作关键词复核无输出:未发现 SearchContact、OpenSession、SendMessage、SendFile、ReceiveFile、auto login、hook、inject、ReadProcessMemory、OpenProcess、WriteProcessMemory、CreateRemoteThread、SetWindowsHookEx、点击/输入/发送/上传/下载等能力。
- 工作树观察git status 显示 go.mod、internal/helperclient 代码文件和多个过程文档仍未跟踪;本轮 pi 审查仅追加 docs/process/pi-review.md未改代码。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N6也不代表可直接实施 N6。进入 N6 仍应按流程另行获批。
### 结论
第五轮 N5 live verification 可信C# helper 单体验证通过Go helperclient 测试通过,且 Go 测试日志明确证明真实调用 runs\win-helper\ISphereWinHelper.exe 的 version op未发现伪造测试结果、N6/N8 越界、MCP 依赖或点击/输入/发送/上传/下载等禁止能力。建议低风险通过本轮 pi 审查。
## 2026-07-05 18:13:25 +08:00 pi 第六轮审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划与审批docs/go-mcp-minimal-plan.md 的 N6docs/process/business-manager-review.md 的 N6 执行前审批。
- 决策与依赖证据docs/go-mcp-library-decision.mdgo.modgo.sumdocs/process/go-implementation-log.md 的 N6 记录。
- 现场验证命令go versiongo list github.com/modelcontextprotocol/go-sdk/mcpgo list -m -json github.com/modelcontextprotocol/go-sdkgo list -m allgo doc github.com/modelcontextprotocol/go-sdk/mcp.StdioTransportgo doc github.com/modelcontextprotocol/go-sdk/mcp.AddToolgo doc github.com/modelcontextprotocol/go-sdk/mcp.NewServergit status --short --untracked-files=all。
- 边界检查Test-Path cmd/isphere-mcp、internal/tools、internal/mcpservergit ls-files 对 cmd/tools/mcpserver/verify-go-mcp.ps1 检查;文件系统 .go 检查Go 源码中 MCP server/tool 注册关键词和禁止业务能力关键词复核。
### 发现的问题
- 未发现阻塞问题。
- N6 决策真实docs/go-mcp-library-decision.md 选择官方 SDK module github.com/modelcontextprotocol/go-sdk v1.3.1package github.com/modelcontextprotocol/go-sdk/mcpgo.mod 当前包含 require github.com/modelcontextprotocol/go-sdk v1.3.1 // indirectgo.sum 仅有该 SDK 的两条校验和记录。
- 兼容性复核通过go version 输出 go version go1.23.4 windows/amd64go list -m -json github.com/modelcontextprotocol/go-sdk 显示 Version v1.3.1、GoVersion 1.23.0。
- package 可用性复核通过go list github.com/modelcontextprotocol/go-sdk/mcp 退出 0输出 github.com/modelcontextprotocol/go-sdk/mcp。
- stdio 能力复核通过go doc mcp.StdioTransport 显示其通过 stdin/stdout 使用 newline-delimited JSON 通信。
- tool registration/JSON schema 复核通过go doc mcp.AddTool 显示 AddTool adds a tool and typed tool handler并在 input/output schema 为 nil 时从 Go type 推断 JSON schema支持 jsonschema struct tag。
- server skeleton 入口仅作为后续能力被确认go doc mcp.NewServer 显示 NewServer 创建无 feature 的 MCP server需要后续 AddTool 等方法添加功能;本轮未写 server code。
- go list -m all 现场复跑退出 0模块列表中与 MCP 相关的条目只有 github.com/modelcontextprotocol/go-sdk v1.3.1MCP_RELATED_COUNT=1。其余为 SDK transitive dependencies不是额外 MCP 框架。
- 决策文档字段完整:已包含 package/module name、stdio support、tool registration style、JSON schema support、maintenance risk、why enough for four tools并说明不需要 HTTP server、Python/Node runtime、后台 daemon 或多 MCP 框架。
- 未发现硬编码成功或伪造命令结果:结论来自现场 go list/go doc/go.mod/go.sum 读取,而非只引用实现智能体报告。
- 未发现进入 N7cmd/isphere-mcp=Falseinternal/tools=Falseinternal/mcpserver=Falsegit ls-files 对这些路径和 scripts/verify-go-mcp.ps1 无输出;文件系统 .go 检查仅发现 internal/helperclient/client.go、client_test.go、contract.go。
- 未发现 Go server/tool 注册代码:文件系统 .go 中未命中 modelcontextprotocol、mcp.NewServer、AddTool、StdioTransport、Server{、Tool{ 等关键词;说明 SDK 仅被选型和加入依赖,未进入 N7/N8 实现。
- 未发现提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等能力helperclient Go 源码禁止业务能力关键词复核无输出。
- 工作树观察git status 显示 docs/go-mcp-library-decision.md、go.mod、go.sum、internal/helperclient 代码文件和多个过程文档仍未跟踪;本轮 pi 审查仅追加 docs/process/pi-review.md未改代码或 go.mod/go.sum。
- 非阻塞观察:由于 N6 尚未 import SDKgo.mod 中 SDK 处于 // indirect 状态;这与 N6 只做 library decision、不写 server code 的边界一致,后续 N7 首次 import 后可由 Go 工具调整为 direct。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N7也不代表可直接实施 N7。进入 N7 仍应按流程另行获批。
### 结论
第六轮 N6 MCP library decision 可信:官方 Go MCP SDK v1.3.1 与本机 Go 1.23.4 兼容stdio、typed AddTool 和 JSON schema 推断能力经 go doc 现场验证go list -m all 仅有一个 MCP-related dependency未发现伪造结果、N7/N8 越界、server/tool 代码、额外 MCP 框架或禁止业务能力。建议低风险通过本轮 pi 审查。
## 2026-07-05 18:26:20 +08:00 pi 第七轮审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划与审批docs/go-mcp-minimal-plan.md 的 N7docs/process/business-manager-review.md 的 N7 执行前审批。
- 实现证据cmd/isphere-mcp/main.gointernal/mcpserver/server.gointernal/mcpserver/server_test.gogo.moddocs/process/go-implementation-log.md 的 N7 记录。
- 现场验证命令go test ./internal/mcpserver -v -count=1go test ./... -count=1go build ./cmd/isphere-mcpgo list -m allgit status --short --untracked-files=all。
- 边界检查Test-Path internal/tools、cmd/isphere-mcp、internal/mcpserver、isphere-mcp.exegit ls-files 对 internal/tools 和 scripts/verify-go-mcp.ps1 检查PowerShell 文件系统 .go/.exe 检查N7 源码中 AddTool、helperclient import、HTTP listener、gRPC、named pipe、Python runtime、C# helper、禁止业务能力关键词复核进程残留检查。
### 发现的问题
- 未发现阻塞问题。
- N7 实现真实cmd/isphere-mcp/main.go 创建 context 后调用 mcpserver.NewServer并以 mcp.StdioTransport 运行internal/mcpserver/server.go 只用 mcp.NewServer 创建带 Name/Title/Version 的空 MCP serverserver_test.go 只验证 NewServer 返回非 nil。
- server construction 测试复跑通过go test ./internal/mcpserver -v -count=1 输出 TestNewServerConstructsEmptyMCPServer PASSexit=0。
- 全量 Go 测试复跑通过go test ./... -count=1 输出 cmd/isphere-mcp [no test files]、internal/helperclient ok、internal/mcpserver okexit=0。
- build 真实通过go build ./cmd/isphere-mcp 退出码 0。本次审查前确认 isphere-mcp.exe 不存在build 生成 isphere-mcp.exe 后已删除,清理后 EXE_EXISTS_AFTER_CLEANUP=False。
- 未发现硬编码成功或伪造测试结果:结论来自现场 go test 和 go build 复跑,以及源码读取,不是只引用实现智能体报告。
- 未发现进入 N8internal/tools=Falsegit ls-files 对 internal/tools 和 scripts/verify-go-mcp.ps1 无输出PowerShell 检查返回 NO_INTERNAL_TOOLS_DIR。
- 未注册工具N7 三个源码文件中未命中 AddTool、internal/tools 或 Tool handler 相关实现server.go 只调用 mcp.NewServer。
- server construction 不启动 C# helperinternal/mcpserver 源码和测试未导入 helperclient未命中 ISphereWinHelper、exec.Command、Start-Process 等进程调用关键词;复核后未发现 ISphereWinHelper 或 isphere-mcp 残留进程。说明空 server 构造测试未触发 helper。
- 未引入 HTTP listener/gRPC/named pipe/Python runtimeN7 源码关键词复核无 net/http、ListenAndServe、grpc、named pipe/npipe、python 命中。
- 未发现提前实现搜索联系人、打开会话、发送消息、发送/接收文件、自动登录、注入、hook、读内存、规避安防等能力N7 源码禁止业务能力关键词复核无输出。
- go list -m all 退出 0仍只使用 N6 选定的 github.com/modelcontextprotocol/go-sdk v1.3.1 及其传递依赖,未发现第二个 MCP SDK。
- 工作树观察git status 显示 cmd/isphere-mcp/main.go、internal/mcpserver/server.go、server_test.go、go.mod、go.sum、helperclient 文件和过程文档仍未跟踪;本轮 pi 审查仅追加 docs/process/pi-review.md未改代码。
- 非阻塞观察go test ./... 会包含既有 internal/helperclient 测试,其中 real version 测试可能启动 C# helper但 N7 关注的是 simple server construction test 不启动 C# helper。本次 internal/mcpserver 专项测试和 N7 源码复核均满足该边界。
- 非阻塞观察Red 阶段失败无法在当前已实现状态下不改代码复现,只能通过 go-implementation-log 审查其记录;这不影响当前 Green、build 和边界复核结论。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N8也不代表可直接实施 N8。进入 N8 仍应按流程另行获批。
### 结论
第七轮 N7 Go MCP server skeleton 实现可信:空 MCP server 构造测试、全量 Go 测试和 go build 均现场通过build 产物已清理未发现伪造结果、N8 越界、internal/tools、AddTool/tool 注册、HTTP listener、helperclient/C# helper 调用或禁止业务能力。建议低风险通过本轮 pi 审查。
## 2026-07-05 18:40:31 +08:00 pi 第八轮审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划与审批docs/go-mcp-minimal-plan.md 的 N8docs/process/business-manager-review.md 的 N8 执行前审批。
- 实现证据internal/tools/winhelper.gointernal/tools/winhelper_test.gointernal/mcpserver/server.gointernal/mcpserver/server_test.godocs/process/go-implementation-log.md 的 N8 记录。
- 现场验证命令go test ./internal/tools -v -count=1go test ./internal/mcpserver -run WinHelper -v -count=1go test ./... -count=1go list -m allgit status --short --untracked-files=all。
- 边界检查Test-Path scripts/verify-go-mcp.ps1git ls-files 对 scripts/verify-go-mcp.ps1/internal/tools 检查PowerShell 搜索 mcp.AddTool 数量、工具名、helper op 映射、schema 字段、helperclient 调用链、直接 UIA/窗口 API、send/search/file/autologin/injection/hook/memory 等关键词。
### 发现的问题
- 未发现阻塞问题。
- N8 实现真实internal/tools/winhelper.go 新增 RegisterWinHelperTools、HelperCaller、四个参数结构和 callHelperinternal/mcpserver.NewServer 已接入 tools.RegisterWinHelperTools(server, helperclient.Client{})。
- 现场复跑 internal/tools 测试通过go test ./internal/tools -v -count=1 三个测试均 PASSexit=0。
- 现场复跑 mcpserver 接入测试通过go test ./internal/mcpserver -run WinHelper -v -count=1 中 TestNewServerRegistersN8WinHelperToolsWithoutCallingHelper PASSexit=0。
- 全量 Go 测试复跑通过go test ./... -count=1 输出 cmd/isphere-mcp [no test files]、internal/helperclient ok、internal/mcpserver ok、internal/tools okexit=0。
- 只注册四个工具:源码中 mcp.AddTool 恰好 4 处,分别对应 win_helper_version、win_helper_self_check、win_helper_scan_windows、win_helper_dump_uia测试也通过 ListTools 断言工具名集合完全等于这四个。
- 工具名与 helper op 映射正确win_helper_version -> versionwin_helper_self_check -> self_checkwin_helper_scan_windows -> scan_windowswin_helper_dump_uia -> dump_uiaTestWinHelperHandlersCallHelperClientAbstractionWithCorrectOps 使用 fake HelperCaller 验证了调用顺序和 op。
- schema/argument fields 范围正确VersionArgs/SelfCheckArgs 无 JSON 字段ScanWindowsArgs 仅 include_all_visibleDumpUIAArgs 仅 hwnd、max_depth、include_text、max_children测试同时通过结构体 tag 和 MCP input schema properties 断言。
- handler 未绕过 helperclient生产代码通过 HelperCaller 接口和默认 helperclient.Client{} 调用 caller.Call(ctx, op, args);未在 internal/tools 中实现窗口枚举、UIA dump 或 C# helper 之外的业务逻辑。
- 未发现直接 UIA/窗口实现internal/tools 和 internal/mcpserver 源码未命中 UIAutomation、AutomationElement、WindowScanner、UiaDumper、user32、FindWindow、SendKeys、EnumWindows、InvokePattern 等关键词。
- 未进入 N9scripts/verify-go-mcp.ps1=Falsegit ls-files 对 scripts/verify-go-mcp.ps1 无输出;未创建 smoke verification 脚本。
- 未发现 send/search/file/autologin/injection/hook/memory 越界能力:生产源码未命中 SearchContact、OpenSession、SendMessage、SendFile、ReceiveFile、Upload、Download、auto login、hook、inject、ReadProcessMemory、OpenProcess、WriteProcessMemory、CreateRemoteThread、SetWindowsHookEx、点击/输入/发送/上传/下载等能力;测试中出现 send/search/file 等词仅用于 forbidden words 断言,不是能力实现。
- 未发现硬编码成功或伪造测试结果:结论来自现场 go test 复跑、源码读取、AddTool 计数和 schema/op 映射检查,不是只引用实现智能体报告。测试使用 fake HelperCaller 是为了验证 handler 映射和参数,不代表伪造真实 helper 行为;真实 MCP stdio smoke 按计划留到 N9。
- go list -m all 退出 0仍只使用 N6 选定的 github.com/modelcontextprotocol/go-sdk v1.3.1 及其传递依赖,未发现第二个 MCP SDK。
- 工作树观察git status 显示 internal/tools/winhelper.go、winhelper_test.go、internal/mcpserver 修改文件、helperclient 文件、cmd、go.mod/go.sum 和过程文档仍未跟踪;本轮 pi 审查仅追加 docs/process/pi-review.md未改代码。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N9也不代表可直接实施 N9。进入 N9 仍应按流程另行获批。
### 结论
第八轮 N8 四个只读 MCP tool handlers 实现可信:只注册四个 win_helper_* 工具工具名、helper op 映射和 schema 参数均符合计划handler 通过 internal/helperclient 调用且未直接实现 UIA/窗口逻辑现场测试全部通过未发现伪造结果、N9 越界、第五工具、send/search/file/autologin/injection/hook/memory 等禁止能力。建议低风险通过本轮 pi 审查。
## 2026-07-05 18:56:19 +08:00 pi 第九轮审查
### 审查范围
- 工作目录E:\coding\codex\isphere-ai-bridge。
- 计划与审批docs/go-mcp-minimal-plan.md 的 N9docs/process/business-manager-review.md 的 N9 执行前审批。
- 实现/验证证据scripts/verify-go-mcp.ps1docs/process/go-implementation-log.md 的 N9 记录internal/tools/winhelper.gointernal/mcpserver/server.gointernal/mcpserver/server_test.go。
- 只读复核命令Test-Path docs/go-mcp-runbook.md、scripts/verify-go-mcp.ps1、runs/win-helper/ISphereWinHelper.exegit status --short --untracked-files=allSelect-String 复核 verify-go-mcp.ps1 的 build、SDK harness、tools/list、tools/call、Assert-True、cleanup、forbiddenTerms 和最终 JSON 输出PowerShell 复核 tools/mcpserver 中 mcp.AddTool、win_helper_*、越界动作关键词。
- 未复跑完整 scripts\verify-go-mcp.ps1该脚本会调用 build-win-helper.ps1、创建临时 Go MCP binary、在 runs 下创建临时 harness 目录再删除;本轮硬性约束要求不要创建任何文件(除 pi-review.md 追加),因此为避免违反约束,本次只做源码/日志/边界审查。
### 发现的问题
- 未发现阻塞问题。
- N9 脚本存在且内容真实scripts/verify-go-mcp.ps1=True脚本会构建 C# helper、构建 Go MCP binary、写入临时 SDK harness并在 finally 中删除 tempRoot 和 harnessDir。
- 脚本不是简单硬编码 ok=true最终 ok=true 之前有 Assert-True 检查 harnessJson.ok、helper_name == ISphereWinHelper、tool_count == 4harness 内部会 initialize/connect、ListTools、CallTool win_helper_version并检查 structuredContent.ok、data.helper_name。
- 四个 tools 验证逻辑真实:脚本 expectedTools 为 win_helper_version、win_helper_self_check、win_helper_scan_windows、win_helper_dump_uiaharness 对 tools/list 结果排序后要求 len(toolNames)==4 且集合完全等于 expectedTools。
- win_helper_version 调用验证真实:脚本使用 session.CallTool(ctx, Name=win_helper_version, Arguments={}),检查 callResult.IsError 为 false、structured ok 为 true、data.helper_name 为 ISphereWinHelper。
- action tools 检查存在:脚本 forbiddenTerms 包含 send、search、file、login、conversation、upload、download、receive、autologin若任一工具名包含这些词会 fail。最终 action_tools_present=false 是在该检查通过后输出。
- N9 过程日志记录脚本 green 执行 exit 0输出包含 ok=true、helper_name=ISphereWinHelper、tool_count=4、四个 tool 名、python_runtime_required=false、real_isphere_login_required=false、action_tools_present=false。本次未现场复跑完整脚本原因见审查范围。
- 未发现 N10 越界docs/go-mcp-runbook.md=False未发现 runbook 文件。
- 未发现新增工具 beyond fourinternal/tools 中 mcp.AddTool 为四处,工具名仍为四个 win_helper_*mcpserver 接入测试期望这四个名称。
- 未发现 send/search/file/autologin/injection/hook/memory 越界能力tools/mcpserver 生产源码未命中 SearchContact、OpenSession、SendMessage、SendFile、ReceiveFile、Upload、Download、auto login、hook、inject、ReadProcessMemory、OpenProcess、WriteProcessMemory、CreateRemoteThread、SetWindowsHookEx、点击/输入/发送/上传/下载等能力;测试中出现 send/search/file 等词仅用于 forbidden words 断言。
- helper 文件存在runs/win-helper/ISphereWinHelper.exe=True符合脚本调用目标的前置状态。
- 工作树观察git status 显示 scripts/verify-go-mcp.ps1、cmd、internal/tools/mcpserver/helperclient、go.mod/go.sum 和过程文档仍未跟踪;本轮 pi 审查仅追加 docs/process/pi-review.md未改代码。
- 非阻塞观察:脚本当前使用 SDK in-memory harness 验证 initialize/list/call并构建 Go MCP binary未直接运行生成的 cmd/isphere-mcp stdio 进程。N9 计划允许“start over stdio or use MCP library test harness”因此不构成阻塞。
- 非阻塞观察:由于本轮硬约束禁止创建文件,未现场复跑完整 verify-go-mcp.ps1若业务经理要求更强独立运行证据需要在允许创建/清理临时构建产物的审批下复跑。
### 风险等级
低。
### 是否阻止进入下一轮
不阻止进入下一轮审批/准备;但本轮 pi 审查没有进入 N10也不代表可直接实施 N10。进入 N10 仍应按流程另行获批。
### 结论
第九轮 N9 smoke verification 脚本实现可信:脚本包含真实 build、SDK harness initialize/connect、tools/list、tools/call win_helper_version、四工具集合校验、helper_name/tool_count 断言和 action tool 禁止词检查;未发现 ok=true/tool_count 纯伪造、额外 action tools、N10 runbook 或搜索/发送/文件/自动登录/注入/hook/读内存等越界能力。建议低风险通过本轮 pi 审查;完整复跑因本轮“不得创建文件”约束未执行,作为非阻塞观察记录。
## 2026-07-05 第十轮 N10 pi 审查
- 审查范围:
- `docs/go-mcp-minimal-plan.md` 的 N10 Operator runbook and process scripts 节点。
- `docs/go-mcp-runbook.md`
- `docs/process/go-implementation-log.md` 的 N10 记录。
- `README.md` 状态、`git status --short --untracked-files=all`、tracked/staged diff、近期提交记录。
- 使用 `Select-String` 复核必需命令、四个允许工具、非目标边界、Python MCP/发送/搜索/文件相关表述;未使用 `rg`
- 审查证据:
- Runbook 覆盖必需命令:`scripts\verify-win-helper.ps1``go test ./...``go build ./cmd/isphere-mcp``scripts\verify-go-mcp.ps1`
- Runbook 覆盖四个允许工具:`win_helper_version``win_helper_self_check``win_helper_scan_windows``win_helper_dump_uia`,并列出允许参数。
- Runbook 覆盖边界:`no login automation``no send message``no send file``no receive/download file``no process injection``no hook``no memory reading`,并额外列出 no search contacts/open conversation/automatic login/Python MCP fallback。
- Runbook 明确 `Python is not required``Python MCP is not part of this path`,未暗示 Python MCP 是必需项。
- Runbook 明确 message/file/search action tool 不存在future send/file operations 需明确人工审批和审计,当前阶段未实现。
- `git status --short -- README.md``git diff --name-only -- README.md` 无输出,未发现 README 修改。
- `git diff --name-only``git diff --cached --name-only` 无输出,未发现 tracked/staged 代码或文档差异;当前工作树仍包含前序节点留下的未跟踪 Go/script/docs 文件。
- 近期提交记录未显示 N10/N11 提交Go 日志明确“未进入 N11未提交”。
- 发现的问题:
- 未发现阻塞问题。
- 观察项:工作树仍有前序未跟踪实现文件,属于多智能体累积状态;本轮审查没有回退或修改这些文件。
- 风险等级:低。
- 是否阻止进入下一轮不阻止进入下一轮审批N11 仍需业务经理单独批准后再执行。
- 结论N10 runbook 文档覆盖计划要求的命令、允许工具、MCP client command、explicit non-goals、real-login UIA capture procedure未发现硬编码成功、伪造验证、Python MCP 必需表述、发送/搜索/文件能力已实现暗示、README 修改、提交或 N11 越界迹象。