Skip to content

chore: 补提本地遗落工作(pr-review skill / try/finally / 战斗画面建档 / miyoushe skill) - #2511

Merged
DoctorReid merged 11 commits into
mainfrom
chore/recover-2459-review-leftover
Jul 19, 2026
Merged

chore: 补提本地遗落工作(pr-review skill / try/finally / 战斗画面建档 / miyoushe skill)#2511
DoctorReid merged 11 commits into
mainfrom
chore/recover-2459-review-leftover

Conversation

@DoctorReid

@DoctorReid DoctorReid commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

背景

#2459 review 期间在本地分支做的衍生工作(+ 一个 miyoushe skill 增强),PR 用 author 原版 merge 后被遗落(未 push)。本 PR 补提,保留原 commit 历史。

内容

1. zzz-od-dev-pr-review skill(新增)

  • skills/zzz-od-dev-pr-review/SKILL.md + design.md
  • PR 审查验证方法论:L0~L4 分级、框架语义必查项、live 验证、冲突解决。

2. after_operation_done 加 try/finally(auto_battle_app.py)

3. 战斗画面建档(docs/game/screens/)

  • 按 screen-onboarding skill 重做:战斗画面(layout/按钮/血条/倒计时 vision 结果),整合原战斗系统/结束归档。
  • 配套测试仓 fixture 已就绪:zzz-od-test main(850b009/1d1de0a/4715622/6710e29,已 push)。

4. miyoushe 前瞻兑换码补公开活动 API 取码路径(skills/zzz-od-miyoushe/)

  • 取码分两路:脚本化优先走公开 API(复用 CI 脚本),浏览器读 DOM 降为备选。

验证

  • ruff check + py_compile 通过;9 commit cherry-pick 零冲突。

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 新功能
    • 新增“战斗画面”说明文档:进入时机/状态流转、战斗态判定与交互元素清单、识别要点与匹配区描述。
  • 文档
    • 更新屏幕描述索引:新增“战斗画面”条目与简介。
    • 新增 PR 审查与验证流程/方法论文档(分级规则、冲突与验证要求)。
    • 更新“前瞻兑换码”指引与设计:优先公开活动 API 脚本化获取,保留网页读取回退,并补充国服/国际服边界。
  • 问题修复
    • 优化自动战斗收尾:停止自动战斗异常时也会继续执行后续收尾流程。

DoctorReid and others added 8 commits July 19, 2026 13:03
沉淀 PR 审查验证方法论(从 30 个 open PR 实操提炼):
- L0~L4 验证分级(分诊→静态→背景→离线→live)
- 框架语义必查项(op_callback/round_wait-retry/@operation_node/execute 重置/node_from 路由)
- 先 merge main 再审(集成测试原则)
- 冲突→建档→解(游戏流程类先 live 建档再融合)
- live = 验证+熟悉游戏+顺路建档
- 解冲突后 import 冒烟
含 SKILL.md(方法论)+ design.md(决策理由+踩坑论据)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
- §0 加'用 PR 实际 HEAD(不要被本地 merge 污染)'
- §0 加'审完再决定改不改'(看到 comment 不先改,先 merge→审→评→改)
- §2 强化 after_operation_done 检查:必查子步骤数 + 异常风险 + try/finally 兜底(不只看 happy path)
论据:#2459 CodeRabbit 抓到 try/finally,初轮 review 漏了——skill 有这条但不够醒目,强化。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
CodeRabbit review(🟠 Major):stop_auto_battle 有多步收尾(stop_running + stop_context → _release_keys 等),
任一抛异常会跳过基类 after_operation_done(运行记录/通知/APPLICATION_STOP)。
用 try/finally 保证基类清理在 finally 里必跑,与框架'after_operation_done 必须 always run'语义一致。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
- 战斗画面:唯一稳定标识=攻击按钮模板(无 id_mark,框架走 is_normal_attack_btn_available 直查)
- 右上角动态:精英怪→血条,限时→倒计时(battle.yml 有 area 但非 id_mark)
- 战斗-菜单:esc/左上角弹出,精确匹配(返回箭头+文本)
- 战斗结果 area(完成/再来一次/撤退/已达成/退出/倒带)
- 自动化约束:战斗态判定/stop_auto_battle 多步 try/finally/战斗结束检测反缩进/ExitInBattle 闭环
截图来源:用户提供(.debug/images/_1784380*.png)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
- 正确位置 docs/game/screens/戦闘画面.md(之前错放在 docs/game/戦闘系統.md)
- skill §3 结构:frontmatter / 何时出現+状態流転 / 識別特徴 / 可交互元素 / 識別快照(黙認+精英两子態) / 備注
- 删除错位 doc(戦闘系統.md + 戦闘結束画面歸档.md)
- 登索引 screens/README.md
- 截図歸檔 .webp(测试仓 screens/戦闘画面/黙認+精英)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
vision 工具(analyze_image)正确用法已找到 + 记录 CLAUDE.local.md:
CDN URL 的 Windows 路径需 URL-encode(:->%3A, \->%5C)后传入。

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a2e722e0-0a89-4c03-8f2e-b5d03548452e

📥 Commits

Reviewing files that changed from the base of the PR and between 505dfc7 and 1111507.

📒 Files selected for processing (2)
  • skills/zzz-od-dev-pr-review/SKILL.md
  • skills/zzz-od-miyoushe/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • skills/zzz-od-miyoushe/SKILL.md
  • skills/zzz-od-dev-pr-review/SKILL.md

📝 Walkthrough

Walkthrough

新增战斗画面文档、PR审查验证技能和前瞻兑换码API流程说明,并调整自动战斗收尾逻辑,确保停止操作异常时仍执行基类处理。

Changes

战斗画面文档

Layer / File(s) Summary
战斗画面定义与识别规则
docs/game/screens/战斗画面.md
定义画面元数据、出现条件、子态流转、稳定识别锚点及战斗态判定规则。
交互元素与索引参考
docs/game/screens/战斗画面.md, docs/game/screens/README.md
补充交互元素、两套识别快照,并将战斗画面加入索引。

PR审查验证技能

Layer / File(s) Summary
审查验证方法设计
skills/zzz-od-dev-pr-review/design.md
规定技能边界、分级验证、冲突处理、目录落点及与现有技能的关系。
审查验证流程落地
skills/zzz-od-dev-pr-review/SKILL.md
定义从分诊、静态审查到离线、live验证和冲突收尾的执行流程。

自动战斗收尾处理

Layer / File(s) Summary
异常安全的操作收尾
src/zzz_od/application/battle_assistant/auto_battle/auto_battle_app.py
使用 try/finally 确保 stop_auto_battle() 异常时仍调用基类收尾逻辑。

前瞻兑换码获取流程

Layer / File(s) Summary
公开活动API流程说明
skills/zzz-od-miyoushe/design.md, skills/zzz-od-miyoushe/SKILL.md
新增基于活动ID的公开API抓码流程,并将浏览器DOM读取调整为交互式备选方案。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题明确概括了本次补提的主要内容,且与新增 skill、战斗画面建档和 try/finally 修改一致。
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/recover-2459-review-leftover

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: 6

🤖 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/game/screens/战斗画面.md`:
- Around line 17-18: 在文档中“子态”及其他受影响表格的标题或列表项与表格之间补充一个空行,修复 markdownlint 的 MD058
检查;仅调整这些表格前的空白行,不修改表格内容。
- Around line 13-23:
更新“战斗结果”子态的出口说明,在现有“完成/再来一次/退出/撤退”之后补充“已达成”和“倒带”,确保与上方战斗结果操作列表保持一致。
- Around line 27-29: 统一攻击按钮的描述,改为“战斗态稳定锚点”,避免表述为全局唯一标识;更新
docs/game/screens/战斗画面.md 第27-29行,并在第81-82行明确保留其不适合作为全局唯一精确匹配标识的说明;同步更新
docs/game/screens/README.md 第14行的索引简介。

In `@skills/zzz-od-dev-pr-review/SKILL.md`:
- Line 20: 更新测试仓对应说明,统一使用 zzz-od-test/screens/<screen_name>/<state>.webp
格式;将“默认.png”替换为可读的状态名和 .webp 扩展名,并保持与 zzz-od-dev-screen-onboarding/SKILL.md 的
fixture 命名契约一致。
- Around line 8-9: 统一 SKILL.md 中 L0 与 L1/L2 的适用范围表述:修改“L1/L2 总做”规则,明确仅对未在 L0
判定为不适用的 PR 强制执行;同步调整 L0 跳过规则及其覆盖的前端、CI、纯 git 启动逻辑说明,消除后续检查是否必须执行的歧义。
- Around line 15-16: 在 PR 审查流程中,将现有的 git merge origin/main 步骤更新为先执行 git fetch
origin main 刷新远程引用,再执行 git merge origin/main;保留使用提交者分支和合并主分支的既有流程。
🪄 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

Run ID: e38f93cd-b6b0-48e8-8f0b-6764036414fb

📥 Commits

Reviewing files that changed from the base of the PR and between 91add0b and 19dbde9.

📒 Files selected for processing (5)
  • docs/game/screens/README.md
  • docs/game/screens/战斗画面.md
  • skills/zzz-od-dev-pr-review/SKILL.md
  • skills/zzz-od-dev-pr-review/design.md
  • src/zzz_od/application/battle_assistant/auto_battle/auto_battle_app.py

Comment thread docs/game/screens/战斗画面.md Outdated
Comment thread docs/game/screens/战斗画面.md
Comment thread docs/game/screens/战斗画面.md Outdated
Comment thread skills/zzz-od-dev-pr-review/SKILL.md Outdated
Comment thread skills/zzz-od-dev-pr-review/SKILL.md Outdated
Comment thread skills/zzz-od-dev-pr-review/SKILL.md Outdated
CI(tools/ci/update_redemption_code.py)用米游社直播间 H5 背后的
event/miyolive/* 公开活动接口取码——匿名 + 仅 x-rpc-act_id 头,
无 DS / cookie / 风控,比浏览器读 DOM 轻、稳、免登录。
- SKILL.md:取码分两路,脚本化优先走公开 API(复用 CI 脚本),
  浏览器读 DOM 降为交互式调试备选
- design.md:三段端点(home/new→index→refreshCode)+ 过期算法
  (start+1 天 23:59:59)+ 指向 CI 现成实现

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@DoctorReid DoctorReid changed the title chore: 补提 #2459 review 遗落工作(pr-review skill / try/finally / 战斗画面建档) chore: 补提本地遗落工作(pr-review skill / try/finally / 战斗画面建档 / miyoushe skill) Jul 19, 2026

@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: 1

🤖 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 `@skills/zzz-od-miyoushe/SKILL.md`:
- Around line 35-40: 更新公开活动 API 说明,避免将匿名、免 DS、免 cookie 和不触发人机表述为永久保证,改为标注“截至
2026 年 7 月 18 日实测”。同时在 API 返回异常或遭遇限流时,明确无人值守流程应回退到浏览器 DOM 路径,并保留该路径作为备用方案。
🪄 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

Run ID: 90e29efe-a420-47e9-bae9-f7ab710a39ad

📥 Commits

Reviewing files that changed from the base of the PR and between 19dbde9 and 7072fce.

📒 Files selected for processing (2)
  • skills/zzz-od-miyoushe/SKILL.md
  • skills/zzz-od-miyoushe/design.md

Comment thread skills/zzz-od-miyoushe/SKILL.md
DoctorReid and others added 2 commits July 19, 2026 13:30
- pr-review SKILL.md: L0/L1/L2 措辞统一;merge 前先 fetch origin main;测试仓也必须切 PR 同名分支(+ merge origin/main);fixture 路径契约统一;补 #2348 测试误合测试仓 main 致所有 PR test-check 全红的教训
- 战斗画面.md: 战斗结果出口补已达成/倒带;表格前空行(MD058);锚点'唯一稳定标识'改为'战斗态稳定锚点'(非全局唯一)
- miyoushe SKILL.md: 公开活动 API 匿名/免 DS 改为'当前实测'限定
- README 索引: 战斗画面锚点表述同步

Co-Authored-By: Claude Code <noreply@anthropic.com>
- pr-review SKILL.md: fixture 契约改为 screens/<screen_name>/<state>.webp(与 screen-onboarding 一致,非 .png)
- miyoushe SKILL.md: 公开 API 补'截至 2026-07-18 实测' + 接口异常/限流回退浏览器 DOM 路径

Co-Authored-By: Claude Code <noreply@anthropic.com>
@DoctorReid
DoctorReid merged commit d26ad7a into main Jul 19, 2026
8 checks passed
@DoctorReid
DoctorReid deleted the chore/recover-2459-review-leftover branch July 19, 2026 05:45
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 22, 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.

2 participants