Skip to content

fix(mobile): 修复 4 个开放 issue(#41 开售轮询 / #45 票价解析 / #51 搜索匹配 / #50 编码) - #53

Merged
currycan merged 1 commit into
masterfrom
fix/open-issues-41-45-50-51
Jul 11, 2026
Merged

fix(mobile): 修复 4 个开放 issue(#41 开售轮询 / #45 票价解析 / #51 搜索匹配 / #50 编码)#53
currycan merged 1 commit into
masterfrom
fix/open-issues-41-45-50-51

Conversation

@currycan

Copy link
Copy Markdown
Owner

概述

多 agent 根因分析 + 对抗验证后实施 4 个开放技术 issue 的修复,真机(REDMI Turbo 4 Pro / Android 16 / 大麦 9.0.26)验证通过。

Issue 优先级 根因一句话 状态
#41 轮询不能正常工作 P0 sell_start_timebtn_buy_view(9.0.2x 已废弃)锚点失效,guard 8s + 文案轮询 8s 对 Canvas 自绘 CTA 全盲,开抢晚 ~8s ✅ 真机
#45 票价文本识别错误 P1 _parse_price_hints 宽松正则从左取首个,两位日份(「30号」)被当票价吞掉真价
#51 + #50(匹配) 搜索/标题匹配失败 P1 标题匹配对词序/前缀/截断零容忍,打分与阈值脱节
#50(编码) Windows GBK 崩溃 P2 subprocess text=True 未指定 encoding,GBK 解 pm dump 巨量中文崩溃

Closes #41, #45, #51, #50

各 issue 修复要点

#41(P0,核心)

  • buy_button_guard:单一 btn_buy_view多 ID 候选(旧 ID 在前保 v8.x 兼容)+ 新增 get_cta_center_coords 坐标兜底
  • sale_waiter:重构 wait_for_sale_start交错轮询——Canvas 页开售前跳过昂贵/多余的 u2 查询,到点即坐标兜底并打 event=cta_canvas_fallback
  • orchestrator_is_buy_button_sold_out 多 ID 候选 + XML 文档序陷阱防御
  • page_probe/state_probe:详情页价格区容器多 ID(新增 info_v2_price_layout),修复 probe_only 在 9.0.2x 详情页恒「关键控件未就绪」(真机验证中发现的连带缺陷)

#45(P1)

  • prompt_parser:新增 _strip_schedule_fragments(剥离日期/时间/张数片段)+ _extract_numeric_price(票价/¥/元 上下文锚定优先、回溯封堵);_parse_price_range 同步先剥日程

#51 + #50 匹配(P1)

  • item_resolver:新增 title_similarity(子串/字符覆盖率 + bigram Dice)与 find_conflicting_city
  • event_navigator:城市冲突 veto + 标题模糊回退(≥0.75)+ clicked_title 锚定校验 + 失败卡黑名单 + 打分增强;失败时列 top-5 候选引导绝不自动点低置信候选,杜绝误买

#50 编码(P2)

  • 新增 mobile/proc_utils.run_capturedencoding='utf-8', errors='replace');env_snapshot / prompt_runner 迁移至统一封装;macOS/Linux 行为零变化

真机验证结果

质量门槛

poetry run test1162 passed, 1 xfailed,覆盖率 83.06%(基线 1067 passed / 81.92% → 净增 95 个测试,覆盖率不降反升,稳过 80% 门槛)。

注意事项 / 遗留跟进

  • 脚本陷阱start_ticket_grabbing.sh 不带 --probe 会强制改写配置为 if_commit_order=true 进正式提交模式;开发验证(到确认页不提交)须绕过脚本直接 python -m mobile.damai_appif_commit_order=false
  • SKU 页仍有 btn_buy_view 依赖(本 PR 只修详情页锚点),若大麦后续把 SKU 确认按钮也 Canvas 化需跟进
  • 匹配阈值(fuzzy 0.75 / 加分门槛 0.45 / 点击阈值 60)为离线校准,建议按真机标题分布采样微调

🤖 Generated with Claude Code

多 agent 根因分析 + 对抗验证后实施,真机(REDMI Turbo 4 Pro / 大麦 9.0.26)验证通过。

#41 (P0) 配 sell_start_time 后开抢晚 ~8s:btn_buy_view 在大麦 9.0.2x 已废弃,
  BuyButtonGuard 8s + 文案轮询 8s 对 Canvas 自绘 CTA 全盲。
  - buy_button_guard:单一 resource-id 改多 ID 候选 + get_cta_center_coords 坐标兜底
  - sale_waiter:重构 wait_for_sale_start 为交错轮询,Canvas 页开售前跳过昂贵 u2 查询,
    到点即坐标兜底(event=cta_canvas_fallback),开抢延迟从 ~8s 收紧到与开售同秒
  - orchestrator:_is_buy_button_sold_out 多 ID 候选 + 文档序陷阱防御
  - page_probe/state_probe:详情页价格区容器多 ID(info_v2_price_layout 新增),
    修复 probe_only 在 9.0.2x 详情页恒「关键控件未就绪」

#45 (P1) 票价识别错误:两位日份(「5月30号」的 30)被宽松正则当票价吞掉真价。
  - prompt_parser:新增 _strip_schedule_fragments(剥离日期/时间/张数)+ _extract_numeric_price
    (上下文锚定优先 + 回溯封堵),price_range 同步先剥日程片段

#51 + #50(匹配) (P1) 搜索/标题匹配对词序/前缀/截断零容忍:
  - item_resolver:新增 title_similarity(子串/覆盖率+bigram Dice)与 find_conflicting_city
  - event_navigator:城市冲突 veto + 标题模糊回退 + clicked_title 锚定 + 失败卡黑名单 +
    候选打分增强;失败时列 top-5 候选引导(绝不自动点低置信,杜绝误买)

#50(编码) (P2) Windows GBK 解 pm dump 巨量中文崩溃:
  - 新增 mobile/proc_utils.run_captured(encoding=utf-8, errors=replace)
  - env_snapshot / prompt_runner 迁移至统一封装;macOS/Linux 行为零变化

测试:1067→1162 passed(+95),覆盖率 81.92%→83.06%,稳过 80% 门槛。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

[BUG] 轮询不能正常工作?

1 participant