
CodexandClaude Opus 4.7
61cdf7b445
refactor(fudai): 抽 _handle_in_fudai_detail 步骤1 第二次打开分支 (2216 → 2079)
新增 handle_second_open_branch helper:
- 取 _last_fudai_detail_tuple;缺失/无效则重新读取(兜底)
- 有效缓存:从 countdown_tuple 提取 future_ts/原始秒数 + 设到 self
- 调 attend_choujiang:成功清标志 / 失败累加计数 / 异常 fall through
顺手修了一个 latent bug:first-open 抽出后 caller 还在用 step3_start /
skip / skip_reason 这些已不在作用域里的变量。改成从 self._last_fudai_detail_tuple
重新取 detail,去掉无意义的 step3_elapsed 日志,step4 的 skip 参数
直接传 (False, "") —— skip 已在 first-open 内部处理完。
净减 146 行嵌套样板。新增 6 个 second-open 单元测试覆盖:
- 缓存缺失重读 + fall through
- 短 tuple 触发重读
- attend 成功清标志清失败计数
- attend 失败累加计数
- attend 异常 fall through
- 缓存有效时正确设置 _current_fudai_future_ts
至此 _handle_in_fudai_detail 总长 506 → 215 行(-58%),
douyin_fudai.py 累计 4121 → 2079(-2042 行 / -50%)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 22:18:33 +08:00
..
2026-05-21 14:09:02 +08:00
2026-05-21 15:02:08 +08:00
2026-05-21 22:21:03 +08:00
2026-05-21 14:45:49 +08:00
2026-05-21 22:15:34 +08:00
2026-05-21 22:03:35 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 22:42:58 +08:00
2026-05-21 20:54:35 +08:00
2026-05-21 21:53:47 +08:00
2026-05-21 21:01:15 +08:00
2026-05-21 20:54:35 +08:00
2026-05-21 22:38:43 +08:00
2026-05-21 22:07:15 +08:00
2026-05-21 22:00:02 +08:00
2026-05-21 20:54:35 +08:00
2026-05-21 14:15:14 +08:00
2026-05-22 22:18:33 +08:00
2026-05-21 21:25:50 +08:00
2026-05-21 20:54:35 +08:00
2026-05-21 21:50:02 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 22:24:15 +08:00
2026-05-21 14:09:02 +08:00
2026-05-22 20:16:37 +08:00
2026-05-22 19:08:09 +08:00
2026-05-21 14:45:49 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 21:56:43 +08:00
2026-05-21 21:01:15 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 21:42:39 +08:00
2026-05-21 22:12:54 +08:00
2026-05-21 15:11:54 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 14:56:56 +08:00
2026-05-22 20:46:23 +08:00
2026-05-21 20:54:35 +08:00
2026-05-22 19:20:29 +08:00
2026-05-21 21:04:14 +08:00
2026-05-21 14:25:35 +08:00
2026-05-21 20:54:35 +08:00
2026-05-22 01:22:56 +08:00
2026-05-21 22:09:35 +08:00
2026-05-22 19:20:29 +08:00
2026-05-21 20:54:35 +08:00
2026-05-21 22:28:26 +08:00
2026-05-21 22:17:54 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 21:37:19 +08:00
2026-05-21 20:54:35 +08:00
2026-05-21 22:45:46 +08:00
2026-05-21 14:09:02 +08:00
2026-05-21 15:17:56 +08:00
2026-05-21 20:54:35 +08:00
2026-05-21 14:09:02 +08:00
2026-05-22 19:59:19 +08:00
2026-05-22 19:32:04 +08:00
2026-05-21 22:48:38 +08:00
2026-05-21 20:54:35 +08:00