Skip to content

chore: MCP 自启 + 预备编队画面建档 + harness 两仓协同 - #2618

Merged
DoctorReid merged 7 commits into
mainfrom
chore_20260801
Aug 1, 2026
Merged

chore: MCP 自启 + 预备编队画面建档 + harness 两仓协同#2618
DoctorReid merged 7 commits into
mainfrom
chore_20260801

Conversation

@DoctorReid

@DoctorReid DoctorReid commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

变更

1. MCP 主 server 开机自启(b508aa14)

tools/mcp/create_mcp_server_startup_shortcut.ps1 在 Startup 建快捷方式,登录后直接起主 server(Session 1,不经 daemon,仍能被 daemon 发现管理);start_mcp_server.ps1 重定向日志。backend doc 补自启说明。

2. 预备编队通用画面建档(9e4cc185 + 2a7c9d92)

预备编队列表是多玩法共用的通用画面(实战模拟室/防卫战/恶名狩猎/管理编辑),独立建档:

  • docs/game/screens/预备编队.md:两子态——选择(准备出战,有 SELECT/预备出战)/ 编辑管理(PredefinedTeamChecker 进,只能编辑不能选)。主体布局(2×3 卡片+1P/2P/3P+核心技 X/3+等级)、选队(+300px)、X/Y OCR 连写坑。
  • docs/develop/zzz/application/predefined_team_checker.md:识别预备编队角色校准工具 app doc。
  • 两子态实拍确认区别(编辑态无 SELECT/预备出战)。

3. harness 两仓协同(4d4abb20,cherry-pick 自 pr-2574)

docs(harness):两仓协同 git 验证 + 泛化非游戏流程(AGENTS.md / development_workflow.md / pr-finishing)。

配套测试仓

zzz-od-test #36:预备编队画面归档截图(选择/编辑两态)。

验证

  • 预备编队两子态:游戏内实拍(选择态实战模拟室 + 编辑态菜单-更多功能进)。
  • 编辑态实拍确认:无 SELECT/预备出战(只能编辑)。

Summary by CodeRabbit

  • 新功能

    • 支持 Windows 登录后自动启动服务,可配置主机与端口,并统一记录运行日志。
    • 新增预备编队页面及队伍识别工具说明,涵盖队伍选择、编辑与识别流程。
  • 文档

    • 完善主仓与测试仓协同开发、配对提交、分支检查及合并顺序说明。
    • 补充远程服务自启、预备编队页面索引及相关开发指南。

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f5e03e60-30e4-4361-9d06-18c8f6841eab

📥 Commits

Reviewing files that changed from the base of the PR and between cc8be62 and d0146bd.

📒 Files selected for processing (11)
  • AGENTS.md
  • docs/develop/development_workflow.md
  • docs/develop/zzz/application/predefined_team_checker.md
  • docs/develop/zzz/backend/entry.md
  • docs/develop/zzz/backend/remote-ssh.md
  • docs/game/screens/README.md
  • docs/game/screens/预备编队.md
  • skills/zzz-od-dev-pr-finishing/SKILL.md
  • skills/zzz-od-dev-pr-finishing/design.md
  • tools/mcp/create_mcp_server_startup_shortcut.ps1
  • tools/mcp/start_mcp_server.ps1
🚧 Files skipped from review as they are similar to previous changes (9)
  • tools/mcp/create_mcp_server_startup_shortcut.ps1
  • skills/zzz-od-dev-pr-finishing/SKILL.md
  • skills/zzz-od-dev-pr-finishing/design.md
  • docs/develop/development_workflow.md
  • docs/develop/zzz/application/predefined_team_checker.md
  • docs/game/screens/预备编队.md
  • docs/develop/zzz/backend/remote-ssh.md
  • docs/develop/zzz/backend/entry.md
  • docs/game/screens/README.md

📝 Walkthrough

Walkthrough

本次变更新增测试仓协同提交规则、预备编队相关文档,以及 Windows 登录时启动 MCP Server 的 PowerShell 脚本和配置说明。

Changes

测试仓协同流程

Layer / File(s) Summary
测试仓协同规则
AGENTS.md, docs/develop/development_workflow.md
明确测试仓同名分支、配对提交、关联 PR 和测试仓优先合并规则。规则适用于所有涉及测试仓改动的开发。
关联 PR 分支校验
skills/zzz-od-dev-pr-finishing/SKILL.md, skills/zzz-od-dev-pr-finishing/design.md
PR 收尾流程通过 Git 检查测试仓同名分支的未合并改动,不再只检查 open PR。

预备编队文档

Layer / File(s) Summary
预备编队识别与管理说明
docs/game/screens/README.md, docs/game/screens/预备编队.md, docs/develop/zzz/application/predefined_team_checker.md
新增预备编队画面索引、页面状态、队伍识别、OCR 规则和 PredefinedTeamChecker 管理流程说明。

MCP Server 登录自启

Layer / File(s) Summary
MCP Server 启动脚本
tools/mcp/start_mcp_server.ps1
新增主机和端口参数、工作目录切换、日志目录创建及 MCP Server 启动逻辑。标准输出和错误输出写入统一日志。
Windows 登录自启与运行说明
tools/mcp/create_mcp_server_startup_shortcut.ps1, docs/develop/zzz/backend/entry.md, docs/develop/zzz/backend/remote-ssh.md
新增 Startup 快捷方式创建脚本,并说明登录自启、日志路径及 SSH daemon 的管理关系。

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WindowsStartup
  participant create_mcp_server_startup_shortcut.ps1
  participant start_mcp_server.ps1
  participant MCPServer
  WindowsStartup->>create_mcp_server_startup_shortcut.ps1: 创建 Startup 快捷方式
  create_mcp_server_startup_shortcut.ps1->>start_mcp_server.ps1: 登录后启动 MCP Server 脚本
  start_mcp_server.ps1->>MCPServer: 使用 uv run 启动主服务
Loading

Possibly related PRs

Suggested labels: test-branch

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了 MCP 自启、预备编队画面建档和 harness 两仓协同三个主要变更,内容清晰且与变更集相关。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore_20260801

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/develop/zzz/application/predefined_team_checker.md`:
- Line 5: 将 PredefinedTeamChecker 的首次说明中的“devtools
app”改为直白中文定义,明确其为开发工具应用、不参与玩法流程,仅用于校准并回写 team_config;保留 PredefinedTeamChecker
这一代码标识符,并补充一个简短使用例子以符合术语首次出现规范。
- Around line 13-15: 更新文档中头像识别区域的描述,明确其实际范围为横坐标 x - 10 至 x + 800、纵坐标 y 至 y +
250,并保留 800×250 区域的上下边界含义;以 predefined_team_checker.py 中 avatar_rect 的实现为准,避免描述为
x 至 x + 800。

In `@docs/game/screens/预备编队.md`:
- Line 19: 统一两个文档中的核心技计数格式:在 docs/game/screens/预备编队.md 第19行将“核心技 X/3”改为“核心技
X/Y”,并引用第28行定义 Y 为队伍人数;在 docs/develop/zzz/application/predefined_team_checker.md
第21行同步改为“核心技 X/Y”。
- Line 60: 将该文档中的描述限定为“选择子态的卡片元素”:仅说明 ChoosePredefinedTeam
负责选择子态的硬编码坐标识别,并补充管理态由 PredefinedTeamChecker 通过队名 OCR 定位队伍后计算 avatar_rect
识别头像,避免将整个预备编队画面的识别都归因于选择逻辑。

In `@skills/zzz-od-dev-pr-finishing/design.md`:
- Line 31: 在设计文档第 11 条的测试仓 PR 查询步骤中,为 gh pr list --head <分支>
明确指定测试仓仓库上下文,使用测试仓对应的 --repo 参数或等效的测试仓目录查询方式;保留后续 git 分支差异检查及其“不以 open PR
判定是否有配套改动”的流程。

In `@skills/zzz-od-dev-pr-finishing/SKILL.md`:
- Line 66: Update the test-repository verification guidance around the git
fetch/log command to explicitly identify the remote and source branch used for
the test-repository PR branch. Align that branch with the one consumed by
.github/workflows/test-check.yml, and ensure the instructions account for
fetching or otherwise validating the local same-named branch before comparing it
with https/main.

In `@tools/mcp/start_mcp_server.ps1`:
- Around line 44-47: Update the command in the try block of the PowerShell
startup script so `--env-file .env` is included only when the `.env` file
exists; otherwise run the same `uv` server command without that option. Preserve
the existing host, port, logging redirection, and server module behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 702f7535-f1e9-4f89-8b15-795a40efa980

📥 Commits

Reviewing files that changed from the base of the PR and between bb44c00 and 4d4abb2.

📒 Files selected for processing (11)
  • AGENTS.md
  • docs/develop/development_workflow.md
  • docs/develop/zzz/application/predefined_team_checker.md
  • docs/develop/zzz/backend/entry.md
  • docs/develop/zzz/backend/remote-ssh.md
  • docs/game/screens/README.md
  • docs/game/screens/预备编队.md
  • skills/zzz-od-dev-pr-finishing/SKILL.md
  • skills/zzz-od-dev-pr-finishing/design.md
  • tools/mcp/create_mcp_server_startup_shortcut.ps1
  • tools/mcp/start_mcp_server.ps1

Comment thread docs/develop/zzz/application/predefined_team_checker.md Outdated
Comment thread docs/develop/zzz/application/predefined_team_checker.md
Comment thread docs/game/screens/预备编队.md Outdated
Comment thread docs/game/screens/预备编队.md Outdated
Comment thread skills/zzz-od-dev-pr-finishing/design.md
Comment thread skills/zzz-od-dev-pr-finishing/SKILL.md
Comment thread tools/mcp/start_mcp_server.ps1 Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/mcp/start_mcp_server.ps1`:
- Around line 44-45: Update the $EnvArg assignment to pass --env-file .env only
when Test-Path ".env" uses -PathType Leaf, while preserving the empty argument
when .env is missing or is a directory.
- Around line 46-52: 在启动命令的 try 块中,紧接着 `cmd /c` 调用检查
`$LASTEXITCODE`;当其为非零时输出包含退出码的错误信息,并使用该退出码退出脚本,确保启动失败不会继续报告成功。保留现有 `catch` 处理未捕获
PowerShell 异常的逻辑。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a9c2d932-86cf-4ffb-9b8f-5611c1d121d8

📥 Commits

Reviewing files that changed from the base of the PR and between 109a81b and 2371963.

📒 Files selected for processing (3)
  • docs/develop/zzz/application/predefined_team_checker.md
  • docs/game/screens/预备编队.md
  • tools/mcp/start_mcp_server.ps1
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/develop/zzz/application/predefined_team_checker.md
  • docs/game/screens/预备编队.md

Comment thread tools/mcp/start_mcp_server.ps1 Outdated
Comment thread tools/mcp/start_mcp_server.ps1

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/mcp/start_mcp_server.ps1 (1)

34-35: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

仅在日志路径是目录时跳过创建。

Test-Path $LogDir 对普通文件和目录都返回 $true。如果 .debug\zzz_od_mcp 被普通文件占用,脚本会跳过 Line 35Line 49 把 stdout/stderr 重定向到 .debug\zzz_od_mcp\main_server.log 时无法创建日志文件,MCP Server 启动失败。请使用 -PathType Container

建议修改
-if (-not (Test-Path $LogDir)) {
+if (-not (Test-Path -Path $LogDir -PathType Container)) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/mcp/start_mcp_server.ps1` around lines 34 - 35, Update the LogDir
existence check in the MCP server startup script to use Test-Path with -PathType
Container, so directory creation is skipped only when $LogDir is an existing
directory; preserve the New-Item behavior when the path is missing or occupied
by a file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tools/mcp/start_mcp_server.ps1`:
- Around line 34-35: Update the LogDir existence check in the MCP server startup
script to use Test-Path with -PathType Container, so directory creation is
skipped only when $LogDir is an existing directory; preserve the New-Item
behavior when the path is missing or occupied by a file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cb6de958-89ae-4afc-9445-e1f81687b8b2

📥 Commits

Reviewing files that changed from the base of the PR and between 2371963 and cc8be62.

📒 Files selected for processing (1)
  • tools/mcp/start_mcp_server.ps1

DoctorReid and others added 7 commits August 1, 2026 20:06
tools/mcp/create_mcp_server_startup_shortcut.ps1 在 Startup 文件夹建快捷方式,登录后直接起主 server(Session 1,不经 daemon,仍能被 daemon 按进程命令行发现并管理 status/stop/restart);start_mcp_server.ps1 把日志重定向到 .debug/zzz_od_mcp/main_server.log(与 GUI/daemon start 一致)。entry.md/remote-ssh.md 补开机自启说明。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
预备编队是多玩法共用的通用画面(实战模拟室/防卫战/恶名狩猎/管理编辑),独立建档:
- docs/game/screens/预备编队.md:两子态(选择=准备出战,有 SELECT/预备出战;编辑=PredefinedTeamChecker 管理,只能编辑),布局(2×3 卡片+1P/2P/3P+核心技X/3+等级),选队点队名右侧+300px
- docs/develop/zzz/application/predefined_team_checker.md:识别预备编队角色校准工具 app doc(菜单→预备编队→OCR队名+模板代理人→写回 team_config→翻页)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
实拍编辑/管理子态(PredefinedTeamChecker 从菜单-更多功能进):主体布局同选择子态(2×3 卡片+1P/2P/3P+核心技X/3+等级),但无 SELECT/预备出战/TEAM 选中态(只能编辑不能选出战),印证两子态区别。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
主仓 PR 合并后才发现测试仓 11 个未合 commit(分支有改动但没开 PR),
收尾时查 open PR 为空误判"无配套"。根因:两仓协同方法论困在
development_workflow「游戏自动化功能」章节,backend / 重构等非游戏
流程改动覆盖不到。

- AGENTS.md「提交流程与协作边界」加两仓协同指令(通用,不限游戏流程)
- development_workflow.md §4 泛化适用范围到所有涉及测试仓改动
- pr-finishing §6 加 git 验证兜底(open PR 空 ≠ 无配套)+ design.md 决策 11

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
AGENTS.md「同开关联 PR」补:跨仓链接用 OneDragon-Anything/<repo>#<N> 或完整 URL,禁裸 #N(GitHub 识别成本仓而非目标仓)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
- start_mcp_server.ps1(Major):.env 不存在时不传 --env-file,避免 uv 启动失败导致自启起不来。
- predefined_team_checker.md:定义 devtools app + 写实际坐标(x-10 到 x+800)。
- 预备编队.md:核心技统一 X/Y(分母=人数)+ 备注补充管理子态 PredefinedTeamChecker 也用 avatar_rect。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
CodeRabbit 增量 review 2 条:
- .env 用 Test-Path -PathType Leaf(排除 .env 是目录的边界,目录会让 uv 失败)。
- cmd /c 后检查 $LASTEXITCODE 非零则 exit(ErrorActionPreference 对原生命令无效,非零退出码不进 catch,否则启动失败仍报成功)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@DoctorReid
DoctorReid merged commit f95c7d3 into main Aug 1, 2026
9 of 10 checks passed
@DoctorReid
DoctorReid deleted the chore_20260801 branch August 1, 2026 12:39
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant