Skip to content

refactor(SellProduct): 修复优先售卖不生效的问题#1813

Merged
MistEO merged 10 commits intov2from
fix/sell-product-match
Apr 1, 2026
Merged

refactor(SellProduct): 修复优先售卖不生效的问题#1813
MistEO merged 10 commits intov2from
fix/sell-product-match

Conversation

@he0119
Copy link
Copy Markdown
Contributor

@he0119 he0119 commented Apr 1, 2026

实际商品列表 OCR 结果普遍带有 |、] 等 UI 前缀,例如 |紫晶质瓶、|荞愈胶囊、|优质芽针针剂

fixed #1806

Sourcery 摘要

更新 SellProduct 流水线和位置信息元数据,以改进前哨站位置识别并修复优先出售行为。

Bug 修复:

  • 通过将生成的物品案例与位置标识符和预期位置文本模式对齐,修复优先出售行为。

功能增强:

  • 为苔原和五菱前哨站位置添加本地化和基于正则的预期文本模式以及可读性更高的人类描述。
  • 将 SellProduct 流水线输出重构为按前哨站划分的 JSON 文件,并提供一个整合的 Sell.json 配置。
  • 重命名并扩展 SellProduct 生成器配置和模板,以分离任务生成与流水线生成流程。

文档:

  • 更新 SellProduct 的 README,增加关于任务和流水线配置的明确生成器使用示例。
Original summary in English

Summary by Sourcery

优化 SellProduct 流水线和元数据,更好地识别前哨据点位置,并确保在苔原和五菱定居点之间的优先售卖行为表现正确。

Bug 修复:

  • 调整售卖尝试的锚点与物品选择步骤对齐,这样当首选物品存在或缺失时,优先售卖才能被正确触发。

功能改进:

  • 为苔原和五菱前哨据点新增本地化和基于正则表达式的预期 OCR 文本模式以及可读性更高的人类描述,以提升位置识别效果。
  • 在生成的 SellProduct 位置配置中加入位置描述和预期文本,并将切换物品的分支从以 NodePrefix 为键改为以 LocationId 为键。
  • 将 SellProduct 流水线输出拆分为按前哨据点划分的 JSON 文件,并生成一个汇总的 Sell.json 配置,同时引入专用的任务和流水线生成器配置及模板。

文档:

  • 更新 SellProduct README,增加使用独立生成器配置生成任务和流水线配置的明确示例。
Original summary in English

Summary by Sourcery

Refine SellProduct pipelines and metadata to better recognize outpost locations and ensure priority selling behaves correctly across tundra and Wuling settlements.

Bug Fixes:

  • Align sell-attempt anchors with item selection steps so priority selling triggers correctly when a preferred item is present or missing.

Enhancements:

  • Add localized and regex-based expected OCR text patterns and human-readable descriptions for tundra and Wuling outpost locations to improve location recognition.
  • Include location descriptions and expected text in generated SellProduct location configurations and switch item cases to be keyed by LocationId instead of NodePrefix.
  • Split SellProduct pipeline outputs into per-outpost JSON files with an aggregated Sell.json configuration and introduce dedicated task and pipeline generator configs and templates.

Documentation:

  • Update SellProduct README with explicit examples for generating task and pipeline configurations using separate generator configs.

@he0119 he0119 marked this pull request as ready for review April 1, 2026 09:22
@he0119 he0119 requested review from Joe-Bao and Copilot April 1, 2026 09:22
Copy link
Copy Markdown
Contributor

@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 - 我在这里留下了一些高层次的反馈:

  • buildItemCases 中,nodePrefix 参数现在传入的是 LocationId,而不是原先的节点前缀,因此重命名该参数(以及任何相关变量)以反映它不再是节点前缀,会更加清晰且不易出错。
  • 你在 SETTLEMENT_MAP 的一些条目中添加了 TextExpected,并且也在 LOCATIONS 中输出了 TextExpected,但这里没有展示从 SETTLEMENT_MAP/SETTLEMENTS 映射到 LOCATIONS 的过程;值得确认的是,在新的前哨站配置中,TextExpected 是否确实被传播到了 loc 中,而不是依然为 undefined
面向 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- In `buildItemCases`, the `nodePrefix` argument is now being passed `LocationId` instead of the original node prefix, so it would be clearer and less error-prone to rename the parameter (and any related variables) to reflect that it is no longer a node prefix.
- You added `TextExpected` to some entries in `SETTLEMENT_MAP` and also emit `TextExpected` from `LOCATIONS`, but the mapping from `SETTLEMENT_MAP`/`SETTLEMENTS` into `LOCATIONS` isn’t shown here; it’s worth verifying that `TextExpected` is actually propagated into `loc` and not left as `undefined` for the new outpost configurations.

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

Hey - I've left some high level feedback:

  • In buildItemCases, the nodePrefix argument is now being passed LocationId instead of the original node prefix, so it would be clearer and less error-prone to rename the parameter (and any related variables) to reflect that it is no longer a node prefix.
  • You added TextExpected to some entries in SETTLEMENT_MAP and also emit TextExpected from LOCATIONS, but the mapping from SETTLEMENT_MAP/SETTLEMENTS into LOCATIONS isn’t shown here; it’s worth verifying that TextExpected is actually propagated into loc and not left as undefined for the new outpost configurations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `buildItemCases`, the `nodePrefix` argument is now being passed `LocationId` instead of the original node prefix, so it would be clearer and less error-prone to rename the parameter (and any related variables) to reflect that it is no longer a node prefix.
- You added `TextExpected` to some entries in `SETTLEMENT_MAP` and also emit `TextExpected` from `LOCATIONS`, but the mapping from `SETTLEMENT_MAP`/`SETTLEMENTS` into `LOCATIONS` isn’t shown here; it’s worth verifying that `TextExpected` is actually propagated into `loc` and not left as `undefined` for the new outpost configurations.

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

该 PR 旨在修复 SellProduct 在“优先售卖”场景下不生效的问题(OCR 结果带有 |] 等 UI 前缀导致匹配失败),并同步重构 SellProduct 流水线产物的组织方式,提升据点识别与配置可维护性。

Changes:

  • 为“优先物品选择”OCR 节点增加字符清洗(replace),并在换货流程中加入“优先货品未识别到”的锚点处理与提示节点。
  • 重构 SellProduct 流水线输出:按据点拆分为 Outposts/*.json,新增整合入口 Sell.json,并补充生成器配置(task/pipeline 分离)。
  • 调整任务模板与生成数据结构:以 LocationId 统一节点前缀,并在生成时将“售卖尝试节点”的锚点与物品 case 对齐。

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/pipeline-generate/SellProduct/task-template.jsonc 任务模板改用 LocationId 对应流水线节点开关
tools/pipeline-generate/SellProduct/task-config.json 指向新的 task 模板文件名
tools/pipeline-generate/SellProduct/README.md 更新生成命令示例(task/pipeline 两套 config)
tools/pipeline-generate/SellProduct/pipeline-template.jsonc 新增按据点生成的流水线模板(含 replace、锚点结构)
tools/pipeline-generate/SellProduct/pipeline-config.json 新增 pipeline 生成配置,输出到 Outposts 目录
tools/pipeline-generate/SellProduct/data.mjs 扩展据点元数据与 item cases 生成逻辑(含优先缺失处理锚点)
assets/tasks/SellProduct.json 任务中为 SellAttempt 节点补充锚点覆盖,配合优先缺失处理
assets/resource/pipeline/SellProduct/ValleyIV.json 删除旧的“整区合并”流水线文件
assets/resource/pipeline/SellProduct/Sell.json 新增整合入口(地区售卖入口节点)
assets/resource/pipeline/SellProduct/Outposts/*.json 新增/更新按据点拆分的流水线节点定义
assets/resource/pipeline/SellProduct/ChangeGoods.json 增加优先货品 miss handler 的锚点分支与提示节点

@he0119 he0119 force-pushed the fix/sell-product-match branch from a4cebbf to 461a75c Compare April 1, 2026 13:25
@he0119 he0119 force-pushed the fix/sell-product-match branch from b30d332 to 55e35a3 Compare April 1, 2026 13:36
@MistEO MistEO changed the title fix(SellProduct): 修复优先售卖不生效的问题 refactor(SellProduct): 修复优先售卖不生效的问题 Apr 1, 2026
@MistEO MistEO merged commit 3eac9e3 into v2 Apr 1, 2026
18 checks passed
@MistEO MistEO deleted the fix/sell-product-match branch April 1, 2026 15:01
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.

地区据点售卖物品的“优先售卖”不生效

3 participants