Merge:'fix/patch0513'| 节点子识别套嵌重构为摊平#283
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> (cherry picked from commit 38f058c)
命名规则: - Rec,可单独使用的识别. - Anc,需要先设定锚点.多用于二步走. - Sub,不能纯Sub使用,必须搭配Rec.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (19)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
审阅者指南重构 pipeline JSON 中的节点识别逻辑,改为使用扁平化且可复用的子识别节点(用于主页、沙箱、加载中界面、滑块、OCR 等),更新返回键与沙箱检测到集中 hub 节点,并将 OCR 模型路径切换为 ppocr_v5,同时对 Global pipeline 中扁平化可复用识别节点的流程图flowchart LR
subgraph HomeReset
Global_ToHomePage_Reset[Global_ToHomePage_Reset\nAnd all_of]
Global_BackPageHub_Once[Global_BackPageHub_Once\nBack-button hub]
BackClick[Click back button]
Global_ToHomePage_Reset --> Global_BackPageHub_Once --> BackClick
end
subgraph SandBoxReset
Global_ToSandBox_Reset[Global_ToSandBox_Reset\nAnd all_of]
Global_ToSandBox_Reset --> Global_BackPageHub_Once
end
subgraph HomePageRecognition
Global_Main_Reset_Begin[Global_Main_Reset_Begin\nAnd all_of]
Rec_HomePage_GA_Ocr[Rec_HomePage_GA_Ocr\nOCR 抽抽乐]
Rec_HomePage_GA_Clr[Rec_HomePage_GA_Clr\nColorMatch 背景]
Global_Main_Reset_Begin --> Rec_HomePage_GA_Ocr
Global_Main_Reset_Begin --> Rec_HomePage_GA_Clr
end
subgraph SandBoxRecognition
Global_ToSandBox_Enter[Global_ToSandBox_Enter\nOr any_of]
Rec_SandBox_Pin_Tpl[Rec_SandBox_Pin_Tpl\nTemplateMatch pin]
Rec_SandBox_Run_Tpl[Rec_SandBox_Run_Tpl\nTemplateMatch Run]
Global_ToSandBox_Enter --> Rec_SandBox_Pin_Tpl
Global_ToSandBox_Enter --> Rec_SandBox_Run_Tpl
end
subgraph LoadingWait
Global_WaitingForLoading[Global_WaitingForLoading\nOr any_of]
Rec_Global_Wait_01[Rec_「Global_WaitingForLoading」_01]
Rec_Global_Wait_02[Rec_「Global_WaitingForLoading」_02]
Rec_Global_Wait_03[Rec_「Global_WaitingForLoading」_03]
Rec_Global_Wait_04[Rec_「Global_WaitingForLoading」_04]
Rec_Global_Wait_05[Rec_「Global_WaitingForLoading」_05]
Rec_Global_Wait_06[Rec_「Global_WaitingForLoading」_06]
Global_WaitingForLoading --> Rec_Global_Wait_01
Global_WaitingForLoading --> Rec_Global_Wait_02
Global_WaitingForLoading --> Rec_Global_Wait_03
Global_WaitingForLoading --> Rec_Global_Wait_04
Global_WaitingForLoading --> Rec_Global_Wait_05
Global_WaitingForLoading --> Rec_Global_Wait_06
end
subgraph QuickCartReset
Global_BackToQC1[Global_BackToQC1\nAnd all_of]
Global_QuickCart_MenuReset[Global_QuickCart_MenuReset\nQuick menu hub]
Global_BackToQC1 --> Global_QuickCart_MenuReset
end
重构后的滑块与 OCR 状态识别流程图flowchart LR
subgraph SliderState
Anc_SliderSwitch_GryOff_Clr[Anc_SliderSwitch_GryOff_Clr\nColorMatch 灰色]
Anc_SliderSwitch_YewOn_Clr[Anc_SliderSwitch_YewOn_Clr\nColorMatch 黄色]
Anc_SliderSwitch_Gry_TurnOn_Clr[Anc_SliderSwitch_Gry_TurnOn_Clr\nAnd all_of 灰色]
Anc_SliderSwitch_Yew_TurnOff_Clr[Anc_SliderSwitch_Yew_TurnOff_Clr\nAnd all_of 黄色]
Anc_SliderSwitch_Act_Turn[Anc_SliderSwitch_Act_Turn\nClick slider]
Anc_SliderSwitch_GryOff_Clr --> Anc_SliderSwitch_Gry_TurnOn_Clr --> Anc_SliderSwitch_Act_Turn --> Anc_SliderSwitch_YewOn_Clr
Anc_SliderSwitch_YewOn_Clr --> Anc_SliderSwitch_Yew_TurnOff_Clr --> Anc_SliderSwitch_Act_Turn --> Anc_SliderSwitch_GryOff_Clr
end
subgraph OcrButtonState
Anc_Ocr_Enable_Clr[Anc_Ocr_Enable_Clr\nColorMatch anchor 亮]
Anc_Ocr_Unable_Clr[Anc_Ocr_Unable_Clr\nColorMatch anchor 灰]
Sub_Ocr_Enable_Clr[Sub_Ocr_Enable_Clr\nColorMatch OCR 亮]
Sub_Ocr_Unable_Clr[Sub_Ocr_Unable_Clr\nColorMatch OCR 灰]
Anc_Ocr_Enable_Clr --> Sub_Ocr_Enable_Clr
Anc_Ocr_Unable_Clr --> Sub_Ocr_Unable_Clr
end
subgraph HomePageGachaHighlight
Rec_HomePage_GA_Ocr[Rec_HomePage_GA_Ocr\nOCR 抽抽乐]
Sub_HomePage_GA_Bright_Clr[Sub_HomePage_GA_Bright_Clr\nColorMatch 高亮]
Rec_HomePage_GA_Ocr --> Sub_HomePage_GA_Bright_Clr
end
文件级变更
提示与命令与 Sourcery 交互
自定义你的使用体验进入你的 dashboard 来:
获取帮助Original review guide in EnglishReviewer's GuideRefactors pipeline JSON node-recognition logic to use flattened reusable sub-recognition nodes (for home page, sandbox, loading, sliders, OCR, etc.), updates back-button and sandbox detection to central hub nodes, and switches the OCR model path to ppocr_v5 with minor gitignore adjustments. Flow diagram for flattened reusable recognition nodes in Global pipelineflowchart LR
subgraph HomeReset
Global_ToHomePage_Reset[Global_ToHomePage_Reset\nAnd all_of]
Global_BackPageHub_Once[Global_BackPageHub_Once\nBack-button hub]
BackClick[Click back button]
Global_ToHomePage_Reset --> Global_BackPageHub_Once --> BackClick
end
subgraph SandBoxReset
Global_ToSandBox_Reset[Global_ToSandBox_Reset\nAnd all_of]
Global_ToSandBox_Reset --> Global_BackPageHub_Once
end
subgraph HomePageRecognition
Global_Main_Reset_Begin[Global_Main_Reset_Begin\nAnd all_of]
Rec_HomePage_GA_Ocr[Rec_HomePage_GA_Ocr\nOCR 抽抽乐]
Rec_HomePage_GA_Clr[Rec_HomePage_GA_Clr\nColorMatch 背景]
Global_Main_Reset_Begin --> Rec_HomePage_GA_Ocr
Global_Main_Reset_Begin --> Rec_HomePage_GA_Clr
end
subgraph SandBoxRecognition
Global_ToSandBox_Enter[Global_ToSandBox_Enter\nOr any_of]
Rec_SandBox_Pin_Tpl[Rec_SandBox_Pin_Tpl\nTemplateMatch pin]
Rec_SandBox_Run_Tpl[Rec_SandBox_Run_Tpl\nTemplateMatch Run]
Global_ToSandBox_Enter --> Rec_SandBox_Pin_Tpl
Global_ToSandBox_Enter --> Rec_SandBox_Run_Tpl
end
subgraph LoadingWait
Global_WaitingForLoading[Global_WaitingForLoading\nOr any_of]
Rec_Global_Wait_01[Rec_「Global_WaitingForLoading」_01]
Rec_Global_Wait_02[Rec_「Global_WaitingForLoading」_02]
Rec_Global_Wait_03[Rec_「Global_WaitingForLoading」_03]
Rec_Global_Wait_04[Rec_「Global_WaitingForLoading」_04]
Rec_Global_Wait_05[Rec_「Global_WaitingForLoading」_05]
Rec_Global_Wait_06[Rec_「Global_WaitingForLoading」_06]
Global_WaitingForLoading --> Rec_Global_Wait_01
Global_WaitingForLoading --> Rec_Global_Wait_02
Global_WaitingForLoading --> Rec_Global_Wait_03
Global_WaitingForLoading --> Rec_Global_Wait_04
Global_WaitingForLoading --> Rec_Global_Wait_05
Global_WaitingForLoading --> Rec_Global_Wait_06
end
subgraph QuickCartReset
Global_BackToQC1[Global_BackToQC1\nAnd all_of]
Global_QuickCart_MenuReset[Global_QuickCart_MenuReset\nQuick menu hub]
Global_BackToQC1 --> Global_QuickCart_MenuReset
end
Flow diagram for refactored slider and OCR state recognitionflowchart LR
subgraph SliderState
Anc_SliderSwitch_GryOff_Clr[Anc_SliderSwitch_GryOff_Clr\nColorMatch 灰色]
Anc_SliderSwitch_YewOn_Clr[Anc_SliderSwitch_YewOn_Clr\nColorMatch 黄色]
Anc_SliderSwitch_Gry_TurnOn_Clr[Anc_SliderSwitch_Gry_TurnOn_Clr\nAnd all_of 灰色]
Anc_SliderSwitch_Yew_TurnOff_Clr[Anc_SliderSwitch_Yew_TurnOff_Clr\nAnd all_of 黄色]
Anc_SliderSwitch_Act_Turn[Anc_SliderSwitch_Act_Turn\nClick slider]
Anc_SliderSwitch_GryOff_Clr --> Anc_SliderSwitch_Gry_TurnOn_Clr --> Anc_SliderSwitch_Act_Turn --> Anc_SliderSwitch_YewOn_Clr
Anc_SliderSwitch_YewOn_Clr --> Anc_SliderSwitch_Yew_TurnOff_Clr --> Anc_SliderSwitch_Act_Turn --> Anc_SliderSwitch_GryOff_Clr
end
subgraph OcrButtonState
Anc_Ocr_Enable_Clr[Anc_Ocr_Enable_Clr\nColorMatch anchor 亮]
Anc_Ocr_Unable_Clr[Anc_Ocr_Unable_Clr\nColorMatch anchor 灰]
Sub_Ocr_Enable_Clr[Sub_Ocr_Enable_Clr\nColorMatch OCR 亮]
Sub_Ocr_Unable_Clr[Sub_Ocr_Unable_Clr\nColorMatch OCR 灰]
Anc_Ocr_Enable_Clr --> Sub_Ocr_Enable_Clr
Anc_Ocr_Unable_Clr --> Sub_Ocr_Unable_Clr
end
subgraph HomePageGachaHighlight
Rec_HomePage_GA_Ocr[Rec_HomePage_GA_Ocr\nOCR 抽抽乐]
Sub_HomePage_GA_Bright_Clr[Sub_HomePage_GA_Bright_Clr\nColorMatch 高亮]
Rec_HomePage_GA_Ocr --> Sub_HomePage_GA_Bright_Clr
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我发现了两个问题,并给出了一些整体性的反馈:
configure_ocr_model中的 OCR 模型路径目前被硬编码为ppocr_v5;建议将 OCR 版本或目录做成可配置(如果检测到 v4 则回退到 v4),这样在升级或回滚时就不需要改动代码。- 若干新的识别节点(例如
Sub_Ocr_*、Sub_SieveExpand_Yew_Clr)使用了非常泛化的 ROI 引用,比如"OCR";为每个上下文使用更明确的锚点名称,会让流水线更容易理解,也能降低不同界面之间 ROI 冲突的风险。 - 滑块开关流程使用了两个几乎完全对称的节点(
Anc_SliderSwitch_Gry_TurnOn_Clr和Anc_SliderSwitch_Yew_TurnOff_Clr),它们都会跳回Anc_SliderSwitch_Act_Turn;建议将其整合为一个可参数化或由状态驱动的节点,以减少重复代码,并降低未来修改时产生差异的风险。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- `configure_ocr_model` 中的 OCR 模型路径目前被硬编码为 `ppocr_v5`;建议将 OCR 版本或目录做成可配置(如果检测到 v4 则回退到 v4),这样在升级或回滚时就不需要改动代码。
- 若干新的识别节点(例如 `Sub_Ocr_*`、`Sub_SieveExpand_Yew_Clr`)使用了非常泛化的 ROI 引用,比如 `"OCR"`;为每个上下文使用更明确的锚点名称,会让流水线更容易理解,也能降低不同界面之间 ROI 冲突的风险。
- 滑块开关流程使用了两个几乎完全对称的节点(`Anc_SliderSwitch_Gry_TurnOn_Clr` 和 `Anc_SliderSwitch_Yew_TurnOff_Clr`),它们都会跳回 `Anc_SliderSwitch_Act_Turn`;建议将其整合为一个可参数化或由状态驱动的节点,以减少重复代码,并降低未来修改时产生差异的风险。
## Individual Comments
### Comment 1
<location path="assets/resource/base/pipeline/Global.json" line_range="398-406" />
<code_context>
},
"Global_BackToQC1_Fin": {
"desc": "找到图钉-点击返回主页",
- "recognition": "TemplateMatch",
- "roi": [
- 1122,
- 646,
- 40,
- 38
- ],
- "template": [
- "pin.png"
- ],
- "target": [
- 1186,
- 46
+ "recognition": "Or",
+ "any_of": [
+ "Rec_SandBox_Pin_Tpl",
+ "Rec_SandBox_Run_Tpl"
],
"post_delay": 1000,
"focus": "GO.卡带复位成功"
</code_context>
<issue_to_address>
**issue (bug_risk):** Global_BackToQC1_Fin 不再触发点击或定位到坐标,这可能会破坏原本“点击返回主页”的行为。
该节点之前会匹配图钉图标,并点击一个固定坐标以返回主页。现在它只对 `Rec_SandBox_Pin_Tpl` / `Rec_SandBox_Run_Tpl` 执行 `Or` 识别,并设置了 `post_delay` / `focus`,但没有任何 `action` 或 `target`。这意味着它只检测状态,而不会真正执行跳转。如果点击动作被移动到了其他地方,请重命名该节点/描述以反映其新的角色;否则,请重新加回一个显式点击(`action`,以及必要时的 `target`),或者通过 `next` 把点击委托出去。
</issue_to_address>
### Comment 2
<location path="assets/resource/base/pipeline/Global.json" line_range="643-645" />
<code_context>
},
- "Global_Main_Clr": {
- "desc": "【被引用节点】主界面是否无二级浮窗遮蔽",
+ "Anc_Ocr_Enable_Clr": {
+ "desc": "[识别]]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",
- "roi": "Main_OCR",
</code_context>
<issue_to_address>
**nitpick (typo):** Anc_Ocr_Enable_Clr 的描述字符串中有一个小的拼写错误。
当前字符串为 `"[识别]]对Ocr节点按钮再次色核,亮色"`,其中有一个多余的 `]`。请改为只保留一个右中括号,以与其他描述字符串的格式保持一致。
```suggestion
"Anc_Ocr_Enable_Clr": {
"desc": "[识别]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",
```
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈持续改进评审质量。
Original comment in English
Hey - I've found 2 issues, and left some high level feedback:
- The OCR model path in
configure_ocr_modelis now hardcoded toppocr_v5; consider making the OCR version or directory configurable (with a fallback to v4 if present) so upgrades or rollbacks don't require code changes. - Several new recognition nodes (e.g.,
Sub_Ocr_*,Sub_SieveExpand_Yew_Clr) use very generic ROI references like"OCR"; using more explicit anchor names for each context would make the pipelines easier to understand and reduce the risk of ROI collisions between different screens. - The slider switch flow uses two nearly symmetric nodes (
Anc_SliderSwitch_Gry_TurnOn_ClrandAnc_SliderSwitch_Yew_TurnOff_Clr) that both jump back toAnc_SliderSwitch_Act_Turn; consider consolidating this into a single parameterized or state-driven node to reduce duplication and potential divergence in future changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The OCR model path in `configure_ocr_model` is now hardcoded to `ppocr_v5`; consider making the OCR version or directory configurable (with a fallback to v4 if present) so upgrades or rollbacks don't require code changes.
- Several new recognition nodes (e.g., `Sub_Ocr_*`, `Sub_SieveExpand_Yew_Clr`) use very generic ROI references like `"OCR"`; using more explicit anchor names for each context would make the pipelines easier to understand and reduce the risk of ROI collisions between different screens.
- The slider switch flow uses two nearly symmetric nodes (`Anc_SliderSwitch_Gry_TurnOn_Clr` and `Anc_SliderSwitch_Yew_TurnOff_Clr`) that both jump back to `Anc_SliderSwitch_Act_Turn`; consider consolidating this into a single parameterized or state-driven node to reduce duplication and potential divergence in future changes.
## Individual Comments
### Comment 1
<location path="assets/resource/base/pipeline/Global.json" line_range="398-406" />
<code_context>
},
"Global_BackToQC1_Fin": {
"desc": "找到图钉-点击返回主页",
- "recognition": "TemplateMatch",
- "roi": [
- 1122,
- 646,
- 40,
- 38
- ],
- "template": [
- "pin.png"
- ],
- "target": [
- 1186,
- 46
+ "recognition": "Or",
+ "any_of": [
+ "Rec_SandBox_Pin_Tpl",
+ "Rec_SandBox_Run_Tpl"
],
"post_delay": 1000,
"focus": "GO.卡带复位成功"
</code_context>
<issue_to_address>
**issue (bug_risk):** Global_BackToQC1_Fin no longer triggers a click or targets a coordinate, which may break the intended ‘click to return home’ behavior.
This node used to match the pin icon and click a fixed coordinate to return home. It now only runs an `Or` recognition on `Rec_SandBox_Pin_Tpl` / `Rec_SandBox_Run_Tpl` and sets `post_delay`/`focus`, with no `action` or `target`. That means it detects the state but never performs the navigation. If the click moved elsewhere, please rename this node/description to reflect its new role; otherwise, reintroduce an explicit click (`action` and possibly `target`) or delegate it via `next`.
</issue_to_address>
### Comment 2
<location path="assets/resource/base/pipeline/Global.json" line_range="643-645" />
<code_context>
},
- "Global_Main_Clr": {
- "desc": "【被引用节点】主界面是否无二级浮窗遮蔽",
+ "Anc_Ocr_Enable_Clr": {
+ "desc": "[识别]]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",
- "roi": "Main_OCR",
</code_context>
<issue_to_address>
**nitpick (typo):** Minor typo in the Anc_Ocr_Enable_Clr description string.
The string currently reads `"[识别]]对Ocr节点按钮再次色核,亮色"` with a double `]`. Please change this to a single closing bracket to match the formatting of the other descriptions.
```suggestion
"Anc_Ocr_Enable_Clr": {
"desc": "[识别]对Ocr节点按钮再次色核,亮色",
"recognition": "ColorMatch",
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
🤖 DeepSeek 自动评审报告模型: 概览本次 PR 对全局流水线进行了大规模重构:将原先大量内嵌在 阻塞性问题(必须修改)
建议改进(非阻塞)
疑问 / 需要作者确认
建议在合并前务必运行对应 Pipeline 的冒烟测试,确保重构后的逻辑与原行为一致。 本评论由 GitHub Actions + DeepSeek 自动生成;最终判断以人工审查为准。 |
Summary by Sourcery
将全局流水线的识别逻辑重构为可复用的子节点,扩展对 UI 的识别覆盖范围,并更新 OCR 资源配置。
新功能:
改进:
构建:
ppocr_v5资源目录。.gitignore文件,避免将体积庞大或生成的模型文件提交到版本库中。Original summary in English
Summary by Sourcery
Refactor global pipeline recognition into reusable subnodes, extend UI recognition coverage, and update OCR assets configuration.
New Features:
Enhancements:
Build: