Skip to content

Merge:'fix/patch0513'| 节点子识别套嵌重构为摊平#283

Merged
sunyink merged 12 commits into
mainfrom
chore/reftosupnt
May 14, 2026
Merged

Merge:'fix/patch0513'| 节点子识别套嵌重构为摊平#283
sunyink merged 12 commits into
mainfrom
chore/reftosupnt

Conversation

@sunyink
Copy link
Copy Markdown
Owner

@sunyink sunyink commented May 14, 2026

Summary by Sourcery

将全局流水线的识别逻辑重构为可复用的子节点,扩展对 UI 的识别覆盖范围,并更新 OCR 资源配置。

新功能:

  • 为主页、沙盒按钮、加载界面、滑块开关、OCR 按钮和选中高亮等新增专用识别节点,以集中并复用 UI 检测逻辑。

改进:

  • 将全局流水线中嵌套的识别定义扁平化,改为引用共享识别节点,用于主页、沙盒导航、快速购物车以及加载状态等场景。
  • 优化 OCR 控件、主页扭蛋入口、沙盒图钉/运行变体、滑块开关以及筛选器/下拉选项的颜色匹配和模板匹配,以更好区分启用、禁用和高亮状态。
  • 引入共享的返回按钮中枢节点,用于从其他界面返回主页和沙盒,以减少重复逻辑。

构建:

  • 更新 OCR 模型配置以使用 ppocr_v5 资源目录。
  • 为 PC 模型资源添加 .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:

  • Add dedicated recognition nodes for home page, sandbox buttons, loading screens, slider switches, OCR buttons, and selection highlights to centralize and reuse UI detection logic.

Enhancements:

  • Flatten nested recognition definitions in the global pipeline into references to shared recognition nodes for home page, sandbox navigation, quick cart, and loading states.
  • Refine color- and template-matching for OCR controls, home page gacha entry, sandbox pin/run variants, slider switches, and sieve/dropdown selections to better distinguish enabled, disabled, and highlighted states.
  • Introduce a shared back-button hub node for returning to the home page and sandbox from other screens to reduce duplication.

Build:

  • Update OCR model configuration to use the ppocr_v5 assets directory.
  • Add a gitignore file for PC model assets to avoid checking in large or generated model files.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Warning

Rate limit exceeded

@sunyink has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 46 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0a148a8b-c87c-401e-8694-04d4537f12fb

📥 Commits

Reviewing files that changed from the base of the PR and between 2c7f3d6 and 16f40d7.

⛔ Files ignored due to path filters (3)
  • .gitignore is excluded by none and included by none
  • assets/resource/PC/model/.gitignore is excluded by none and included by none
  • configure.py is excluded by none and included by none
📒 Files selected for processing (19)
  • assets/resource/base/pipeline/Activities.json
  • assets/resource/base/pipeline/Arbitrage.json
  • assets/resource/base/pipeline/AutoBattle.json
  • assets/resource/base/pipeline/Collect_TeleportRecall.json
  • assets/resource/base/pipeline/Collect_skills.json
  • assets/resource/base/pipeline/Daily.json
  • assets/resource/base/pipeline/Equip.json
  • assets/resource/base/pipeline/EventBattle.json
  • assets/resource/base/pipeline/GACHA.json
  • assets/resource/base/pipeline/GACHA_ADV.json
  • assets/resource/base/pipeline/Global.json
  • assets/resource/base/pipeline/Mail.json
  • assets/resource/base/pipeline/PVP.json
  • assets/resource/base/pipeline/Pass.json
  • assets/resource/base/pipeline/QuestList.json
  • assets/resource/base/pipeline/Redemption.json
  • assets/resource/base/pipeline/SemiAuto.json
  • assets/resource/base/pipeline/Setup.json
  • assets/resource/base/pipeline/Weekly.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/reftosupnt

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 and usage tips.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 14, 2026

审阅者指南

重构 pipeline JSON 中的节点识别逻辑,改为使用扁平化且可复用的子识别节点(用于主页、沙箱、加载中界面、滑块、OCR 等),更新返回键与沙箱检测到集中 hub 节点,并将 OCR 模型路径切换为 ppocr_v5,同时对 .gitignore 做了少量调整。

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
Loading

重构后的滑块与 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
Loading

文件级变更

Change Details Files
将主页识别重构为使用共享的 OCR 与颜色子节点
  • 在全局重置流程中,用可复用的 Rec_HomePage_GA_Ocr 和 Rec_HomePage_GA_Clr 节点替换内联的主页面 OCR 与颜色检查
  • 更新之前使用 Main_OCR 和 Global_Main_Clr 的入口/选择动作,使其引用新的主页识别辅助节点
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/GACHA.json
assets/resource/base/pipeline/GACHA_ADV.json
assets/resource/base/pipeline/Activities.json
assets/resource/base/pipeline/Daily.json
assets/resource/base/pipeline/Weekly.json
将沙箱(pin/run)识别集中到可复用的模板节点中
  • 引入用于沙箱 pin 与冲刺按钮的识别节点 Rec_SandBox_Pin_Tpl、Rec_SandBox_Run_Tpl 和 Rec_SandBox_Pin3_Tpl
  • 在全局导航与重置流程中,用这些新的沙箱识别节点替换重复的 pin/run TemplateMatch 代码块
  • 新增颜色检查辅助节点 Sub_SandBox_Pin3_Bright_Clr,用于检测已选中 pin 状态
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/AutoBattle.json
assets/resource/base/pipeline/SemiAuto.json
assets/resource/base/pipeline/PVP.json
assets/resource/base/pipeline/Pass.json
将加载界面检测提取为具名的可复用识别节点
  • 将基于 Or 的复合 Global_WaitingForLoading 识别拆分为独立的 Rec_「Global_WaitingForLoading」_01–06 节点,覆盖模板、OCR 与颜色块
  • 更新 Global_WaitingForLoading,使其引用新的子识别节点,而不是在内部内联定义
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/QuestList.json
assets/resource/base/pipeline/EventBattle.json
assets/resource/base/pipeline/Arbitrage.json
assets/resource/base/pipeline/Collect_TeleportRecall.json
assets/resource/base/pipeline/Collect_skills.json
assets/resource/base/pipeline/Redemption.json
assets/resource/base/pipeline/Equip.json
assets/resource/base/pipeline/Mail.json
assets/resource/base/pipeline/Setup.json
将滑块开关识别/动作重构为更清晰的锚定颜色状态
  • 用新的状态检查节点 Anc_SliderSwitch_YewOn_Clr 和 Anc_SliderSwitch_GryOff_Clr 替换 Global_SliderSwitch_To_On/Off 和 Global_SliderSwitch_StateOn/Off
  • 引入 Anc_SliderSwitch_Gry_TurnOn_Clr、Anc_SliderSwitch_Yew_TurnOff_Clr 和 Anc_SliderSwitch_Act_Turn,通过锚定的滑块 ROI 以显式启用/禁用流程来处理切换
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/Setup.json
将 OCR 按钮颜色检测统一为锚点/子节点结构
  • 用锚定在 Ocr_clr 上的 Anc_Ocr_Enable_Clr 和 Anc_Ocr_Unable_Clr 替换 Global_Main_Clr 以及旧的 Global_Ocr_Clr_* 辅助节点
  • 新增子节点 Sub_Ocr_Enable_Clr 和 Sub_Ocr_Unable_Clr,用于通用 OCR 按钮背景高亮/灰色检测
  • 新增 Sub_HomePage_GA_Bright_Clr,用于利用 OCR 节点的 ROI 检测主页抽卡文本的高亮状态
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/Setup.json
assets/resource/base/pipeline/Activities.json
assets/resource/base/pipeline/Pass.json
将返回键与快速购物车重置识别集中化
  • 新增/统一 Global_BackPageHub_Once hub 节点,并更新 Global_ToHomePage_Reset 与 Global_ToSandBox_Reset,使其引用该节点而不是在内部内联 back-button 模板的 TemplateMatch
  • 更新 Global_BackToQC1,使其使用 Global_QuickCart_MenuReset,而不是对 BusinQuickIcoGE.png 进行原始模板匹配
  • 确保返回键模板在共享 hub 节点中包含 UI_qsback.png
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/AutoBattle.json
assets/resource/base/pipeline/Activities.json
assets/resource/base/pipeline/Arbitrage.json
assets/resource/base/pipeline/Pass.json
将 OCR 模型目录从 ppocr_v4 更新为 ppocr_v5,并为 PC 模型调整 gitignore
  • 在 configure_ocr_model 中将 OCR 资源目录从 ppocr_v4 修改为 ppocr_v5,使运行时使用新的模型集
  • 在 assets/resource/PC/model 下新增 .gitignore,用于控制对 PC 端模型产物的追踪
  • 对顶层 .gitignore 和各 pipeline JSON 做少量调整,以适配新的资源结构
configure.py
assets/resource/PC/model/.gitignore
.gitignore

提示与命令

与 Sourcery 交互

  • 触发新的审阅: 在 Pull Request 上评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub Issue: 在审阅评论下回复,请求 Sourcery 基于该评论创建 issue。也可以直接回复 @sourcery-ai issue,由此从该评论创建 issue。
  • 生成 Pull Request 标题: 在 PR 标题任意位置写上 @sourcery-ai 即可随时生成标题。也可以在 PR 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 Pull Request 总结: 在 PR 正文任意位置写上 @sourcery-ai summary,即可在对应位置生成 PR 总结。也可以在 PR 中评论 @sourcery-ai summary 来(重新)生成总结。
  • 生成审阅者指南: 在 PR 中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 PR 中评论 @sourcery-ai resolve,即可将所有 Sourcery 评论标记为已解决。如果你已经处理完所有评论且不想再看到它们,这会很有用。
  • 驳回所有 Sourcery 审阅: 在 PR 中评论 @sourcery-ai dismiss,即可驳回所有现有的 Sourcery 审阅。尤其适用于你想从头开始新的审阅时——别忘了之后再评论 @sourcery-ai review 触发新的审阅!

自定义你的使用体验

进入你的 dashboard 来:

  • 启用或禁用审阅功能,例如 Sourcery 自动生成的 PR 总结、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅指令。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Refactors 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 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
Loading

Flow diagram for refactored slider and OCR state recognition

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
Loading

File-Level Changes

Change Details Files
Refactor home-page recognition to use shared OCR and color subnodes
  • Replace inline main-page OCR and color checks with reusable Rec_HomePage_GA_Ocr and Rec_HomePage_GA_Clr nodes in global reset flows
  • Update entry/selection actions that previously used Main_OCR and Global_Main_Clr to reference the new home-page recognition helpers
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/GACHA.json
assets/resource/base/pipeline/GACHA_ADV.json
assets/resource/base/pipeline/Activities.json
assets/resource/base/pipeline/Daily.json
assets/resource/base/pipeline/Weekly.json
Centralize sandbox (pin/run) recognition into reusable template nodes
  • Introduce Rec_SandBox_Pin_Tpl, Rec_SandBox_Run_Tpl, and Rec_SandBox_Pin3_Tpl recognition nodes for sandbox pin and sprint buttons
  • Replace duplicated pin/run TemplateMatch blocks in global navigation and reset flows with references to the new sandbox recognition nodes
  • Add color-check helper Sub_SandBox_Pin3_Bright_Clr to detect selected pin state
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/AutoBattle.json
assets/resource/base/pipeline/SemiAuto.json
assets/resource/base/pipeline/PVP.json
assets/resource/base/pipeline/Pass.json
Extract loading-screen detection into named reusable recognition nodes
  • Factor the composite Or-based Global_WaitingForLoading recognition into separate Rec_「Global_WaitingForLoading」_01–06 nodes covering templates, OCR, and color blocks
  • Update Global_WaitingForLoading to reference the new sub-recognition nodes instead of inline definitions
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/QuestList.json
assets/resource/base/pipeline/EventBattle.json
assets/resource/base/pipeline/Arbitrage.json
assets/resource/base/pipeline/Collect_TeleportRecall.json
assets/resource/base/pipeline/Collect_skills.json
assets/resource/base/pipeline/Redemption.json
assets/resource/base/pipeline/Equip.json
assets/resource/base/pipeline/Mail.json
assets/resource/base/pipeline/Setup.json
Rework slider-switch recognition/actions into clearer anchored color states
  • Replace Global_SliderSwitch_To_On/Off and Global_SliderSwitch_StateOn/Off with new Anc_SliderSwitch_YewOn_Clr and Anc_SliderSwitch_GryOff_Clr state check nodes
  • Introduce Anc_SliderSwitch_Gry_TurnOn_Clr, Anc_SliderSwitch_Yew_TurnOff_Clr, and Anc_SliderSwitch_Act_Turn to handle toggling via anchored slider ROI with explicit enable/disable flows
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/Setup.json
Normalize OCR-button color detection into anchor/subnodes
  • Replace Global_Main_Clr and old Global_Ocr_Clr_* helpers with Anc_Ocr_Enable_Clr and Anc_Ocr_Unable_Clr anchored to Ocr_clr
  • Add Sub_Ocr_Enable_Clr and Sub_Ocr_Unable_Clr subnodes for generic OCR button background bright/gray detection
  • Add Sub_HomePage_GA_Bright_Clr to detect highlighted homepage gacha text using OCR node ROI
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/Setup.json
assets/resource/base/pipeline/Activities.json
assets/resource/base/pipeline/Pass.json
Centralize back-button and quick-cart reset recognition
  • Add/standardize Global_BackPageHub_Once hub node and update Global_ToHomePage_Reset and Global_ToSandBox_Reset to reference it instead of inlining TemplateMatch on back-button templates
  • Update Global_BackToQC1 to use Global_QuickCart_MenuReset rather than a raw template match for BusinQuickIcoGE.png
  • Ensure back-button templates include UI_qsback.png in the shared hub node
assets/resource/base/pipeline/Global.json
assets/resource/base/pipeline/AutoBattle.json
assets/resource/base/pipeline/Activities.json
assets/resource/base/pipeline/Arbitrage.json
assets/resource/base/pipeline/Pass.json
Update OCR model directory from ppocr_v4 to ppocr_v5 and adjust gitignore for PC models
  • Change the OCR assets directory in configure_ocr_model from ppocr_v4 to ppocr_v5 so runtime uses the new model set
  • Add a .gitignore under assets/resource/PC/model to control tracking of PC-side model artifacts
  • Minor adjustments in top-level .gitignore and pipeline JSONs to align with new asset structure
configure.py
assets/resource/PC/model/.gitignore
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - 我发现了两个问题,并给出了一些整体性的反馈:

  • configure_ocr_model 中的 OCR 模型路径目前被硬编码为 ppocr_v5;建议将 OCR 版本或目录做成可配置(如果检测到 v4 则回退到 v4),这样在升级或回滚时就不需要改动代码。
  • 若干新的识别节点(例如 Sub_Ocr_*Sub_SieveExpand_Yew_Clr)使用了非常泛化的 ROI 引用,比如 "OCR";为每个上下文使用更明确的锚点名称,会让流水线更容易理解,也能降低不同界面之间 ROI 冲突的风险。
  • 滑块开关流程使用了两个几乎完全对称的节点(Anc_SliderSwitch_Gry_TurnOn_ClrAnc_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>

Sourcery 对开源项目免费——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈持续改进评审质量。
Original comment in English

Hey - I've found 2 issues, and left some high level feedback:

  • 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.
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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread assets/resource/base/pipeline/Global.json
Comment thread assets/resource/base/pipeline/Global.json
@github-actions
Copy link
Copy Markdown
Contributor

🤖 DeepSeek 自动评审报告

模型deepseek-v4-pro 触发workflow_dispatch Diff 截断:是 输出截断:否 改动文件:22 个(其中 0 个二进制已跳过)

概览

本次 PR 对全局流水线进行了大规模重构:将原先大量内嵌在 And / Or 中的识别块抽取为独立的 Rec_* / Sub_* 节点,并在组合节点中通过节点名称字符串直接引用,整体提升了可维护性与复用性。同时调整了部分颜色匹配、滑块开关等识别逻辑。大部分改动符合 MaaFW Pipeline v5.7+ 的节点引用规范,但存在若干 roi 引用断裂的风险,可能导致识别失败,需修正。

阻塞性问题(必须修改)

  • 文件assets/resource/base/pipeline/Arbitrage.jsonArbitrage_Sell_PackShopListSwichArbitrage_ItemList_Sorting_Remove 等节点的重构
    问题:原 And 组合中,OCR 识别通过 "sub_name": "template" 提供 box,后续 ColorMatch 通过 "roi": "template" 引用该 box。重构后 OCR 仍为内联,但删除了 sub_name,同时引用的 Sub_SieveExpand_Yew_Clr 节点内部 roi 写死为 "Templateroi",而该 sub_name 并不存在。
    原因:根据文档《任务流水线协议》的 roi 字段说明,识别范围由 roiroi_offset 共同决定;若 roi 为字符串且引用了不存在的子识别名,将无法正确限定 ColorMatch 的识别区域,可能退化为全图识别或报错,破坏原有逻辑。
    建议:要么保留 And 中 OCR 的 "sub_name": "template",并让 Sub_SieveExpand_Yew_Clrroi 改为 "template";要么将 OCR 也抽取为独立识别节点,并在 And 中通过节点名称引用(但需确保该节点输出被正确锚定或复用无法使用 sub_name 引用方式,当前最佳实践是保留 sub_name 的字段,或使用 target 等机制)。

  • 文件assets/resource/base/pipeline/Arbitrage.jsonArbitrage_Cooking_* 相关节点(多处)
    问题:类似地,Sub_「Arbitrage_Cooking」_Clr 节点内部 roi: "Templateroi",但引用该节点的 And 组合中,前置 TemplateMatch 并未设置 sub_name: "Templateroi"(原代码疑似缺失该 sub_name,但无论如何 extract 后应保持原有的引用关系)。
    原因:同上,roi 引用失效。
    建议:检查原始逻辑,确保 ColorMatch 的 roi 能正确引用到 TemplateMatch 的匹配结果。若原代码确实未使用 sub_name,则 roi 需改为固定坐标或其他有效表示。

建议改进(非阻塞)

  • 节点命名风格:新增节点名称中包含全角括号 「」 和中文,虽然技术上允许,但建议统一使用 ASCII 标识符,避免编码与日志解析潜在问题。
  • 引用完整性:大量节点被重命名或替换(如 Global_Main_ClrSub_HomePage_GA_Bright_ClrGlobal_Ocr_Clr_Enable_SubSub_Ocr_Enable_Clr 等),建议跑一次全局搜索,确认已无残留的旧节点引用。
  • 注释一致性:新增的 Rec_* 节点大多补充了 desc,有利于维护,但个别旧节点的 desc 表述可能与新识别逻辑有细微偏差(如 "Sub_Ocr_Enable_Clr" 作为启用状态的颜色检测,desc 可更明确),建议一并 review。
  • 锚点节点命名Anc_Ocr_Enable_Clr 等以 Anc_ 开头的节点实为普通识别节点,并非 Pipeline 的 Anchor 锚点,容易误解;可考虑改用 Rec_Sub_ 前缀以避免混淆。

疑问 / 需要作者确认

  • 跨文件节点引用:新增的 Rec_HomePage_GA_OcrSub_HomePage_GA_Bright_ClrGlobal_BackToQC1 等节点定义未出现在本次 diff 中,请确认它们已存在于其他 pipeline JSON 文件中(如 Global.json 或专门存放识别节点的文件),且文件加载顺序确保引用可达。
  • roi: "Templateroi" 的来源:重构前 Arbitrage_Cooking_*ColorMatchroi 即为 "Templateroi",但与其搭配的 TemplateMatch 在 diff 中无 sub_name 字段,请确认原逻辑是否已正确依赖该引用,抑或存在历史遗留的无效 roi。
  • ColorMatch 与 OCR 连用场景:除上述两个场景外,请复查所有将 ColorMatch 提取为独立节点后仍保留字符串 roi 的地方,确保其引用的子识别依然有效,否则应改为固定坐标或调整 And 结构。
  • 文档版本要求And/Or 中直接引用节点名称需要 v5.7 支持,请确认当前项目使用的 MaaFW 版本不低于此,以防运行时错误。

建议在合并前务必运行对应 Pipeline 的冒烟测试,确保重构后的逻辑与原行为一致。


本评论由 GitHub Actions + DeepSeek 自动生成;最终判断以人工审查为准。

@sunyink sunyink merged commit 8f06f9b into main May 14, 2026
21 checks passed
@sunyink sunyink deleted the chore/reftosupnt branch May 14, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants