 CodexandClaude Opus 4.7
|
feaf555657
|
refactor(reservation): 拆出 attend_window 排序+超时检查(1222→1163,-59 行)
- sort_reservations_with_logging:就地排序 + 前后写日志(含异常吞噬)
- check_total_timeout:超时检查 + 写日志(含异常吞噬)
修复一个真实 bug:拆出 attend_window_helpers.py 时遗漏 import time,导致
check_total_timeout 内的 time.time() 抛 NameError,被外层 try/except 吞噬,
函数永远返回 False。原主文件不存在该 bug。
新增 6 个单元测试(含 import time 缺失场景的 swallow exception 验证),
1267 → 1273 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 04:17:29 +08:00 |
|
 CodexandClaude Opus 4.7
|
89f001e5a4
|
refactor(reservation): 拆出 attend_window 已参与/无效ft/目标日志(1309→1222,-87 行)
- check_already_participated:检测是否已参与过该预约(5s 误差),命中则弹出队头
- discard_invalid_future_ts:future_ts 无效时丢弃队头
- log_target_reservation_details:记录目标预约的 future_ts/value/pos_seen/content
新增 11 个单元测试,1256 → 1267 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 04:10:24 +08:00 |
|
 CodexandClaude Opus 4.7
|
e9e8e322c6
|
refactor(reservation): 拆出 attend_window 等待开奖检查 + 锁定期晋升(1375→1309,-66 行)
- check_waiting_for_reservation_lottery:等待预约福袋开奖时不抢占其他预约
- maybe_promote_locked_reservation:锁定期内把锁定预约移到队头,
若已不在队列则清除锁定期
新增 8 个单元测试,1248 → 1256 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 04:06:28 +08:00 |
|
 CodexandClaude Opus 4.7
|
c7c6c51d20
|
refactor(reservation): 拆出 attend_window 计算+日志辅助(1437→1375,-62 行)
process_reservation_attend_window 中两个互不依赖的子块抽到 attend_window_helpers:
- compute_dynamic_ahead:根据回退步数 + 单步延迟动态计算提前进入参与窗口秒数(纯函数)
- log_attend_window_check_details:输出锁定期 / 时间窗口诊断结构化日志
新增 13 个单元测试覆盖各种边界(零步 / 截断 / 大延迟 / 异常兜底 / 锁定期内外)。
1050 → 1063 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 02:08:11 +08:00 |
|