Commit Graph
383 Commits
Author SHA1 Message Date
CodexandClaude Opus 4.5 85d7bb2525 补 douyin/detection/pixel 模块单元测试(+14 用例)
- pixel/popups 弹窗检测函数签名验证
- pixel/buttons 按钮检测函数签名验证
- pixel/stage 阶段检测函数签名验证
- shim 与子模块导出一致性验证

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 22:03:35 +08:00
CodexandClaude Opus 4.5 3269d3adf6 补 gui/components 模块单元测试(+22 用例)
- log_color_config 纯函数测试(get_operation_type/get_color_config)
- mapping_utils 纯函数测试(_format_timestamp)
- gui/components 子模块存在性验证

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 22:00:02 +08:00
CodexandClaude Opus 4.5 7ef5bc3e07 补 douyin/logging 模块单元测试(+30 用例)
- log_formatter 纯函数测试(format_debug_log/action_log/error_log 等)
- PerformanceTracker 类测试
- logging 子模块存在性验证

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 21:56:43 +08:00
CodexandClaude Opus 4.5 2c8879be7a 补 douyin/fudai/core 模块单元测试(+14 用例)
- validate_coords 纯函数测试(边界/修正/无效坐标)
- safe_image_load 函数测试
- fudai/core 子模块存在性验证

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 21:53:47 +08:00
CodexandClaude Opus 4.5 6ecedbbde1 补 douyin/handlers 模块单元测试(+13 用例)
- _adb_path 纯函数测试(环境变量、引号处理、operation 对象)
- SwipeHandler / PopupHandler / ScreenshotHandler 类存在性验证
- swipe_ops 函数签名检查

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 21:50:02 +08:00
CodexandClaude Opus 4.5 cdf8be0ded 补 operations 模块单元测试(+18 用例)
- OCR 缓存机制测试(cache_get/put/clear/stats)
- _img_fingerprint 哈希函数测试
- screenshot_operations / screenshot_service 类存在性验证

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 21:42:39 +08:00
CodexandClaude Opus 4.5 a6dee879e7 补 tools/dev/bump_version.py 单元测试(+10 用例)
- parse_semver 纯函数测试(含边界/异常)
- compute_next 版本号递增测试
- 集成测试:连续 bump 验证

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 21:37:19 +08:00
CodexandClaude Opus 4.5 9f7e8da57a 补 reservation_handler_pkg / stage_handler_pkg 单元测试(+12 用例)
- 验证 shim 与 pkg 导出一致性
- Handler 类方法签名检查
- 子模块导入测试

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-21 21:25:50 +08:00
CodexandClaude Opus 4.7 6bdf7b2527 补 5 个剩余子包的综合测试(test_remaining_pkgs.py +20 用例)
覆盖 5 个之前没专门测试的拆分子包,每个写"API 兼容 + 不抛异常"级别的测试
(业务函数依赖大量 analyser 状态 + 真实截图,深度业务测试留给端到端):

- detection_pkg
  + _ensure_detection_cache 创建 _detection_cache 与 _detection_cache_ttl
  + _ensure_detection_cache 多次调用幂等(不覆盖既有 cache)
  + 4 个对外 API callable
- fudai_detail_orchestrator_pkg
  + read_fudai_detail_once / _with_retries 可调用
  + 兼容 shim 与子包指向同一函数对象
- logging_wrapper_pkg.misc
  + log_step_time / log_error_with_context / log_performance_step /
    log_debug_info 不抛异常
  + get_performance_stats 返回 dict
- flow_control_pkg
  + 4 个对外 API callable
  + 兼容 shim 与子包指向同一函数对象
- detect_by_template (module-level)
  + 签名 (analyser, rx, pic, region) 正确
  + FudaiDetector.detect_by_template 类方法仍可调用(forwarding)
- underlying_operations_pkg 第二轮新增
  + save_reward_pic / set_clipboard_text / _swipe_with_sendevent_improved /
    select_device / analyse_pic_digits 可调用
  + set_clipboard_text 空文本短路返回 False(不调用 ADB)

回归:
- 全套 627 → 647(+20 用例)
- 全部 647 passed in 19s
- compileall exit 0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 21:04:14 +08:00
CodexandClaude Opus 4.7 af8145b8a8 补 fudai_filter_pkg / logging_pkg 单元测试 + 修 monitor 缺 datetime import
新增测试:
- test_fudai_filter_pkg (24)
  覆盖 helpers / should_skip / join_decision 三个子模块
  含 _is_short_countdown_text / is_watch_task_fudai / check_contain
  + should_skip_fudai_by_config 5 个业务场景断言(高价值通过 / 观看任务跳过 /
    低价值跳过 / 黑名单跳过 / 单间模式必参)
- test_logging_pkg (22)
  覆盖 _common 全局状态 + handlers 类构造 + cleanup 纯函数边界 + monitor
  类构造 + config 全部对外 API(get_logger 缓存 / get_caller_info /
  format_exception_info / LogContext / log_function_call 装饰器)

修复 1 个真实回归 bug:
- douyin/logging/douyin_logging_pkg/monitor.py 缺 from datetime import datetime
  (原文件用的是 from datetime import datetime, timedelta;拆分时只写了
  import 模块导致 datetime.now() 抛 NameError)
  修复后 LogRotationMonitor 可正常构造

回归:
- 全套 581 → 627 (+46 用例)
- 全部 627 passed in 22s
- compileall exit 0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 21:01:15 +08:00
CodexandClaude Opus 4.7 e417acfb7c 为 10 个已拆出的子包补单元测试(+226 用例)
新增 tests/ 下 10 个测试文件,把已拆出的子包从"被外部测试间接覆盖"提升到
"独立可测":

- test_web_gui_pkg (52)
  覆盖 logger / ansi / adb_compat / nested / stats_helpers
  含 _wg_log/_LOGGER 日志、ANSI 清理、点号路径、_parse_countdown_seconds 等
- test_underlying_operations_pkg (35)
  覆盖 adb_helpers / bounds / countdown / ocr_content / pic_path
  含 _adb_path 环境变量覆盖、check_countdown 多种格式、OCR 字符纠错
- test_reservation_logic_helpers (21)
  覆盖 helpers.py 5 个纯函数(_now_ts / _normalize_room_title /
  _calculate_string_similarity / _extract_content_core /
  _sort_reservations_inplace 排序稳定性)
- test_screenshot_manager_pkg (47)
  覆盖 paths.get_category_for_picname(5 类关键词分类)+
  get_latest_attempt_path / get_last_success_path(按 operation_type 路径推断)
  + 异步计数器
- test_gui_core_pkg (13)
  覆盖 RunParams dataclass 28 字段构造 + adb 函数 + read_config / write_config
  roundtrip
- test_fudai_core_pkg (17)
  覆盖 _FudaiOcrExecutorState 单例 + _get_fudai_ocr_executor 缓存复用 + 11
  个 thin_wrappers 与原实现等价行为
- test_handler_shells (8)
  覆盖 ReservationHandler / StageHandler / LoggingWrapper 三个薄壳类的
  staticmethod forwarding 完整性
- test_yanghao_pkg (14)
  覆盖 _yanghao_log(_log_kv 优先 + logger fallback + broken analyser
  兜底 + 未知 level 不抛)+ yanghao_get_recommend_seconds 默认值
- test_pixel_common (6)
  覆盖 _safe_open_screenshot_rgb 用 tmp_path 构造合法/损坏/截断/RGBA PNG
- test_fudai_finder_pkg (13)
  覆盖 5 个类(FudaiImageAcquirer / FudaiDetector / FudaiClickExecutor /
  FudaiDetailVerifier / FudaiFinder)实例化与组合关系,verify
  detect_by_template 类方法签名仍兼容(拆出后)

回归:
- 全套测试 355 → 581(+226 用例)
- 全部 581 passed / 1 skipped in 27s
- 新拆出的 12 个子包现在都有专门的单元测试覆盖

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 20:54:35 +08:00
CodexandClaude Opus 4.7 2d928c3856 FudaiDetector.detect_by_template 拆出(957→655,瘦身 302 行)
把 douyin/fudai/douyin_fudai_finder_pkg/detector.py 的 FudaiDetector.detect_by_template
(306 行 / 4 个 self.X)搬到独立子模块 detect_by_template.py(321 行)。

策略:
- self.analyser → analyser(参数)
- self.rx → rx(参数)
- 类方法保留为 1 行 forwarding:
    def detect_by_template(self, pic, region):
        return _impl(self.analyser, self.rx, pic, region)
- detector.py 内顶部 import detect_by_template 模块的实现

回归:
- 2 个文件 compileall 通过
- pytest 355 passed / 1 skipped
- FudaiFinder() 实例化正常,FudaiDetector.detect_by_template 类方法仍可访问
- module-level detect_by_template 可独立调用

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 20:31:27 +08:00
CodexandClaude Opus 4.7 57d99f3459 拆分 douyin_fudai_core (2205 → 2124 + 3 个子模块)
把 douyin/fudai/douyin_fudai_core.py 中工具/兼容部分搬到
douyin/fudai/douyin_fudai_core_pkg/ 子包:

- ocr_executor (46)    _FudaiOcrExecutorState 类 + _fudai_ocr_executor_state
                       全局实例 + _get_fudai_ocr_executor 池复用函数
- thin_wrappers (65)   11 个 [兼容] 薄壳 forwarding 函数
                       (attend_choujiang / check_lucky_draw_result /
                        is_watch_task_fudai / should_skip_fudai_by_config /
                        basic_join_decision 等)

巨型 get_fudai_contain (2062 行) 留在原文件。原文件从子包 import 后
re-export,外部全部不需修改:
- should_skip_fudai_by_config 24 处外部引用
- attend_choujiang 15 处 / is_watch_task_fudai 13 处 / basic_join_decision 13 处
- 其他 1-10 处

回归:
- 4 个新/改文件 compileall 通过
- pytest 355 passed / 1 skipped(其中 2 个新 _is_short_countdown_text 测试也通过)
- attend_choujiang shim ⇄ pkg 同一对象
- should_skip_fudai_by_config(高价值) 返回 (False, 'ok')
- _fudai_ocr_executor_state.workers = 0 全局实例正常

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 20:25:34 +08:00
CodexandClaude Opus 4.7 a337b4b93d underlying_operations 第三轮拆分(2434 → 2351,再瘦身 83 行)
新增 2 个子模块:

- device_select (新, 73)  select_device 设备选择交互(无 self.X)
- ocr_digits (新, 49)     analyse_pic_digits 数字 OCR 识别
                         (保留 analyser 参数以调 analyser.analyse_pic_word)

策略:
- select_device 的 self.X 全是 _adb_path / _adb_args,已经是 module-level,
  搬出后改用 from .adb_helpers import _adb_path, _adb_args 即可。
- analyse_pic_digits 用 self.analyse_pic_word(递归调用类内大方法)。
  搬到 module-level 后第一参数从 self 改名 analyser,类内 forwarding
  传 self 即可,外部 op.analyse_pic_digits(picname) 完全兼容。

回归:
- 4 个新/改文件 compileall 通过
- pytest 353 passed / 1 skipped
- underlying_operations.select_device / analyse_pic_digits 类方法和 module-level
  函数都可访问

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 20:12:40 +08:00
CodexandClaude Opus 4.7 57eacb3219 underlying_operations 第二轮拆分(2582 → 2434,再瘦身 148 行)
新增 3 个子模块 + 1 个函数搬到已有子模块:

- adb_helpers (38)         新增 _adb_args(构造 adb -s 命令行)
- reward_pic (新, 73)      save_reward_pic(中奖截图保存)
- swipe_sendevent (新, 47) _swipe_with_sendevent_improved(sendevent 滑动)
- clipboard (新, 75)       set_clipboard_text(设备剪贴板设置)

策略:4 个方法的 self.X 引用都是 self._adb_path / self._adb_args 这种
"无状态工具方法",可以替换为 module-level 函数调用。类内方法保留为
1 行 forwarding 调用 _impl_X。

外部调用全部不需修改:
- save_reward_pic 4 处外部 self.save_reward_pic 仍工作
- _adb_args / _swipe_with_sendevent_improved / set_clipboard_text 0 外部引用

回归:
- 5 个新/改文件 compileall 通过
- pytest 353 passed / 1 skipped
- 类的 _adb_args / save_reward_pic / set_clipboard_text /
  _swipe_with_sendevent_improved 4 个 forwarding 全部正确

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 20:07:23 +08:00
CodexandClaude Opus 4.7 254820e6dc 拆分 underlying_operations (3021 → 5 子模块 + 2582 行原文件)
把 douyin/core/underlying_operations.py 中 6 个零 self 引用的方法搬到
douyin/core/underlying_operations_pkg/ 子包,类内方法变成 1 行 forwarding。
原文件保留 underlying_operations 巨型类(>50 个实例方法用 self)。

新建子包:
- adb_helpers (34)   _adb_path / _pick_adbkeyboard_ime
- pic_path (65)      _find_pic_path 按名称查找图片路径
- ocr_content (228)  extract_ocr_content OCR 文本拼接 + 置信度
- countdown (179)    check_countdown 倒计时文本解析(含 OCR 字符纠错)
- bounds (17)        _parse_bounds 解析 UI dump 的 [x1,y1][x2,y2]

策略:6 个方法的 self 引用全为 0,纯算法逻辑直接搬到 module-level;
类内对应方法保留装饰器和签名,body 改为 1 行 forwarding 调用:
  @staticmethod
  def _adb_path() -> str:
      return _impl_adb_path()

外部调用全部不需修改:
- ``self._find_pic_path(...)``         实例方法 forwarding 仍工作
- ``cls._adb_path()``                  staticmethod forwarding 仍工作
- ``ReservationHandler._parse_bounds(...)`` 外部 5 处引用零修改

修复发现:
- countdown.py 原本 ``import datetime``(应为 ``from datetime import datetime,
  timedelta``),导致 datetime.now()/timedelta() 触发 NameError 后被外层
  except 吞掉返回 False。修正后 check_countdown('5:30') 正确返回 (330, <ts>)
- 子模块内部用 _uo_log,加本地实现避免对原文件的循环依赖

回归:
- 6 个新文件 + 改写后 underlying_operations.py compileall 通过
- pytest 353 passed / 1 skipped
- check_countdown / extract_ocr_content / _parse_bounds /
  _pick_adbkeyboard_ime / _find_pic_path / _adb_path 6 个 forwarding 全部正确

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 19:54:22 +08:00
CodexandClaude Opus 4.7 246c80498e 拆分 douyin_yanghao (922 → 4 子模块 + 788 行原文件保留 yanghao_idle)
把 douyin/other/douyin_yanghao.py 中 6 个独立小函数拆出到
douyin/other/douyin_yanghao_pkg/ 子包,巨型函数 yanghao_idle (756 行)
留在原文件,从子包 import 拿 _yanghao_log/_scaled_click/_do_comment 用。

新建子包:
- logger (40)         _yanghao_log + module logger
- click_helpers (75)  _scaled_click / _do_comment
- entrypoints (82)    yanghao_recommend_flow / yanghao_wait /
                      yanghao_get_recommend_seconds
                      (yanghao_recommend_flow 通过 lazy import 调用 yanghao_idle)

外部 import 路径不变:
``from douyin.other.douyin_yanghao import yanghao_recommend_flow / yanghao_wait /
yanghao_get_recommend_seconds`` 等仍可用(原文件 from yanghao_pkg import * re-export)。
- _scaled_click 4 处外部引用 / _yanghao_log 1 处 / 其他 0 处

回归:
- 4 个新文件 + 改写后 douyin_yanghao.py compileall 通过
- pytest 353 passed / 1 skipped
- _yanghao_log() / yanghao_get_recommend_seconds() 调用结果正常

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 19:08:49 +08:00
CodexandClaude Opus 4.7 badf64998d 拆分 douyin_flow_control (706 → 4 个子模块 + 23 行 shim)
把 douyin/core/douyin_flow_control.py 4 个独立顶层函数拆成
douyin/core/douyin_flow_control_pkg/ 子包:

- stage_handler (34)  handle_stage_after_diagnosis 阶段后状态记录
- find_open (537)     find_and_open_fudai_detail 找福袋并打开详情(最大头)
- filter (85)         filter_fudai_detail 配置筛选决策
- no_fudai (94)       handle_no_fudai_situation 无福袋时的简单流程

原文件改为 23 行 re-export shim,4 个公共符号全部保留。
- find_and_open_fudai_detail 4 处外部引用,其他 0 处
全部不需修改。

回归:
- 5 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- 旧 import 路径与新子包路径返回同一函数对象

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 19:03:43 +08:00
CodexandClaude Opus 4.7 a6bbdcc400 拆分 web_gui (2251 → 5 子模块 + 2148 行原文件保留 ProcRunner/Handler/main)
把 gui/web_gui.py 中 11 个独立 helper 拆出到 gui/web_gui_pkg/ 子包,
ProcRunner 巨型类(1514 行 / 25 实例方法 / 390 处 self)+ Handler 类
(588 行)+ main 留在原文件。

新建子包:
- logger (29)         _wg_log + module logger
- ansi (17)           strip_ansi_escape_codes + _ANSI_ESCAPE_RE
- adb_compat (44)     5 个 thin wrapper(forward 到 gui.gui_core_pkg)
- nested (18)         get_nested_value(点号路径配置读取)
- stats_helpers (71)  _parse_countdown_seconds / _bucket / _inc_map(ProcRunner 3 个 @staticmethod)

策略:8 个顶层 helper 直接搬子包;ProcRunner 内 3 个 @staticmethod 也搬,
类内改成 1 行 @staticmethod forwarding 保持 ProcRunner._parse_countdown_seconds
等调用兼容。原文件 import gui.web_gui_pkg 暴露 11 个公共符号。

外部 import 路径全部不变:
- find_adb_executable / read_config / list_adb_devices 等共 70+ 处外部引用
  全部不需修改(CONFIG_PATH 17 处 / read_config 17 处 / find_adb_executable
  18 处 / list_adb_devices 21 处 / write_config 10 处 / 其他 1-7 处)

回归:
- 6 个新文件 + 改写后 web_gui.py compileall 通过
- pytest 353 passed / 1 skipped
- _wg_log / strip_ansi_escape_codes / get_nested_value 调用结果正确
- ProcRunner._parse_countdown_seconds('1:30') = 90 (薄壳 forwarding OK)
- ProcRunner._bucket(15, [0,10,50,100]) = '10-50'
- ProcRunner._inc_map(m, 'k', 5) -> {'k': 5}
- ProcRunner() 实例化 OK

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:57:52 +08:00
CodexandClaude Opus 4.7 ef6ca4a650 拆分 gui_core (1594 → 4 子模块 + 1207 行原文件保留 Runner)
把 gui/gui_core.py 中 12 个独立顶层函数 + RunParams dataclass 拆出到
gui/gui_core_pkg/ 子包;Runner 巨型类(1164 行 / 13 实例方法 / 用 self
状态)原文件保留,仅做 import re-export。

新建子包:
- adb (79)         find_adb_executable / list_adb_devices / resolve_adb_device
- wifi_adb (323)   7 个 WiFi-ADB 函数
- config (46)      CONFIG_PATH / read_config / write_config
- run_params (45)  RunParams dataclass

策略:Runner 类内部用了 find_adb_executable 等顶层函数,所以原文件
``gui/gui_core.py`` 通过 ``from gui.gui_core_pkg import *`` re-export
14 个公共符号供 Runner 内部和外部代码继续使用。

外部 import 路径全部不变:
``from gui.gui_core import find_adb_executable / RunParams / Runner`` 等
所有 14 个公共符号都保留。
- find_adb_executable 20 处外部引用 / read_config 17 处 / list_adb_devices
  16 处 / 其他 1-7 处,全部不需修改

回归:
- 5 个新文件 + 改写后 gui_core.py compileall 通过
- pytest 353 passed / 1 skipped
- find_adb_executable() 调用正常返回 adb.EXE 绝对路径
- read_config() 读到 126 个 config keys
- RunParams.is_dataclass = True,28 个字段
- Runner 类正确暴露

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:49:05 +08:00
CodexandClaude Opus 4.7 c442335b34 拆分 douyin_stage_handler (1009 → 5 个子模块 + 26 行 shim)
把 douyin/stage/douyin_stage_handler.py 的 StageHandler 类(4 个
@staticmethod)拆成 douyin/stage/douyin_stage_handler_pkg/ 子包:

- diagnose (37)        diagnose_stage_from_current_screen 阶段诊断分发
- check_live (774)     check_in_live_room_by_icon 直播间图标检测(最大头)
- handle_detail (20)   handle_in_fudai_detail 福袋详情页处理
- handle_room (195)    handle_live_room_has_or_not_fudai 直播间福袋检测分发
- handler (32)         StageHandler 类(薄壳,每个方法 1 行 forwarding)

策略:4 个方法都是 @staticmethod 第一参数 analyser,搬到 module-level 后
类方法变成 1 行 forwarding。类内部 0 互调,外部 3 处 StageHandler.method
(douyin_fudai.py / fudai_stage_detection.py)保持不变。

外部 import 路径不变:
``from douyin.stage.douyin_stage_handler import StageHandler`` 仍可用。

回归:
- 6 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- StageHandler.diagnose / module-level diagnose 都正确指向 wrapper / 实现

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:36:41 +08:00
CodexandClaude Opus 4.7 4ab1b88fa0 拆分 douyin_logging_wrapper (1080 → 6 个子模块 + 59 行 shim)
把 douyin/logging/douyin_logging_wrapper.py 的 LoggingWrapper 类(8 个
@staticmethod)按职责拆成 douyin/logging/douyin_logging_wrapper_pkg/ 子包:

- _common (76)     共享:colorama / 占位类 / 模块实例
- enhanced (380)   enhanced_log_kv 主入口
- simple (216)     _enhanced_log_kv_simple 简化版
- detailed (356)   _enhanced_log_kv_detailed 详细版(最大头)
- misc (151)       5 个小型辅助方法(log_step_time / log_error_with_context /
                   log_performance_step / log_debug_info / get_performance_stats)
- wrapper (55)     LoggingWrapper 类(薄壳,每个方法 1 行 forwarding)

策略:8 个方法全是 @staticmethod 第一参数 analyser,搬到 module-level 后
类方法变成 1 行 forwarding。类内部互调(enhanced_log_kv → simple/detailed,
log_error_with_context → enhanced_log_kv)改为直接 import module-level 函数。

外部 import 路径不变:
``from douyin.logging.douyin_logging_wrapper import LoggingWrapper`` 仍可用
(原文件改成 59 行 re-export shim,含 18 个共享符号 / 4 个占位类)。

回归:
- 7 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- LoggingWrapper.get_performance_stats / module-level 函数 / Fore/Style 占位
  全部能正常调用

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:32:03 +08:00
CodexandClaude Opus 4.7 85bd488f66 拆分 douyin_reservation_handler (1314 → 6 个子模块 + 29 行 shim)
把 douyin/reservation/douyin_reservation_handler.py 按职责拆成
douyin/reservation/douyin_reservation_handler_pkg/ 子包:

- find_room (169)       find_room_pos_by_title 按标题查找直播间位置
- record_title (333)    record_room_title_and_pos 记录直播间标题与位置
- seek_room (319)       seek_reservation_room 回退到目标预约直播间
- direct_attend (441)   handle_reservation_direct_attend 预约直接参与
- dump_state (180)      _dump_room_pos_map_to_state 序列化映射到 state 文件
- handler (43)          ReservationHandler 类(薄壳,每个 staticmethod 1 行 forwarding)

策略亮点:原 ReservationHandler 4 个方法都是 @staticmethod 且第一个参数为
analyser,搬出来成 module-level 函数后,类方法变成 1 行 forwarding。
公共 API 100% 保留:ReservationHandler.method(analyser, ...) 完全不需要改。

外部 import 路径不变:
``from douyin.reservation.douyin_reservation_handler import ReservationHandler``
仍可用(原文件改成 29 行 re-export shim)。
- ReservationHandler 5 处外部引用
- find_room_pos_by_title 2 处外部引用
- handle_reservation_direct_attend / _dump_room_pos_map_to_state 各 1 处
全部不需修改。

回归:
- 7 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- ReservationHandler.find_room_pos_by_title / module-level 函数 / 顶层
  _dump_room_pos_map_to_state 都能正常调用

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 18:21:40 +08:00
CodexandClaude Opus 4.7 7715b93eca fix(manage_logs): 修复 douyin_logging 拆分后的 import 回归
douyin/logging/douyin_logging.py 在 e35e8a8 commit 拆分为子包后,
原文件改成 re-export shim,不再"恰好"暴露 module-level 的 path_config
和全局变量 _log_monitor。

bin/manage_logs.py 之前依赖这两个间接 import:
  from douyin.logging.douyin_logging import path_config        # 副作用
  from douyin.logging.douyin_logging import _log_monitor       # 全局变量

修复:
- path_config 改为直接从源头导入:from douyin.core import path_config
- _log_monitor 改为从子包内部状态读取:
  from douyin.logging.douyin_logging_pkg import _common as _logging_state
  _log_monitor = _logging_state._log_monitor

回归:
- bin/manage_logs.py --help / monitor / stats 三个子命令全部正常
- pytest 353 passed / 1 skipped 不变

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:48:17 +08:00
CodexandClaude Opus 4.7 2523668b4c 拆分 douyin_fudai_finder (1816 → 6 个子模块 + 29 行 shim)
把 douyin/fudai/douyin_fudai_finder.py 按 5 个类 + 1 顶层函数拆成
douyin/fudai/douyin_fudai_finder_pkg/ 子包:

- image_acquirer (91)    FudaiImageAcquirer 截图获取与预处理
- detector (957)         FudaiDetector 多算法识别(最大头)
- click_executor (220)   FudaiClickExecutor 点击执行
- detail_verifier (237)  FudaiDetailVerifier 详情页打开验证
- finder (392)           FudaiFinder 4 个组件的组合入口
- optimized_entry (59)   check_have_fudai_with_ready_screenshot_optimized 顶层入口

原文件改为 29 行 re-export shim,6 个公共符号全部保留。
- check_have_fudai_with_ready_screenshot_optimized 2 处外部引用
- 其他类全部为 internal class composition,0 处外部引用

回归:
- 7 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- 旧 import 路径与新子包路径返回同一类对象
- FudaiFinder 实例化后内部组件正确(acquirer / detector / executor / verifier)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:34:19 +08:00
CodexandClaude Opus 4.7 e7faceeb5f 拆分 fudai_detail_orchestrator (1043 → 2 个子模块 + 17 行 shim)
把 douyin/fudai/core/fudai_detail_orchestrator.py 按 2 个独立顶层函数拆成
douyin/fudai/core/fudai_detail_orchestrator_pkg/ 子包:

- read_once (546)         read_fudai_detail_once 单次福袋详情识别
- read_with_retries (513) read_fudai_detail_with_retries 带重试版本

原文件改为 17 行 re-export shim,2 个公共符号全部保留。
- read_fudai_detail_once 5 处外部引用
- read_fudai_detail_with_retries 5 处外部引用
全部不需修改。

子包名 _pkg 后缀避免与同目录 shim 文件 fudai_detail_orchestrator.py 冲突。

回归:
- 3 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- 旧 import 路径与新子包路径返回同一函数对象

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:23:02 +08:00
CodexandClaude Opus 4.7 9d1b0c1e36 拆分 douyin_logging (1412 → 5 个子模块 + 46 行 shim)
把 douyin/logging/douyin_logging.py 按职责拆成
douyin/logging/douyin_logging_pkg/ 子包:

- _common (21)     共享全局状态:_logging_configured / _logger_cache / _log_monitor
- handlers (206)   自定义 handler:RotatingDatedFileHandler / DatedFileHandler
- cleanup (282)    日志压缩与清理:compress_log_file / cleanup_old_logs / _load_*_policy
- monitor (337)    轮转监控:LogRotationMonitor / start/stop_log_monitor / get_log_stats
- config (652)     主配置入口:get_logger / configure_logging / log_function_call /
                   LogContext / get_caller_info / format_exception_info

原文件改为 46 行 re-export shim,15 个公共符号全部保留。
全局变量统一搬到 _common,子模块通过 ``from . import _common as _state``
访问 _state.X 形式(global 不能跨模块)。

子包名 douyin_logging_pkg 是为了避免与同目录下的 shim 文件
douyin_logging.py 冲突(同名包 vs 模块在 Python 中不能并存)。

回归:
- 6 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped(含 unified_logger MDC 13 个用例)
- 旧 import 路径与新子包路径返回同一函数对象
- get_logger 缓存机制(第二次调用返回同一对象)正常工作

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:13:34 +08:00
CodexandClaude Opus 4.7 74209035f7 拆分 douyin_reservation_logic (2702 → 7 个子模块 + 53 行 shim)
把 douyin/reservation/douyin_reservation_logic.py 按职责拆成
douyin/reservation/reservation_logic/ 子包:

- _common (57)             共享错误处理工具占位 + ReservationItem 类型
- helpers (130)            内部工具:标题归一化 / 相似度 / 排序 / 时间戳
- add (447)                add_reservation_core_logic 主入口(添加新预约)
- cleanup_validate (136)   validate_back_to_reservation / cleanup_expired_reservations
- queue_full (305)         handle_queue_full_wait_at_earliest 队列满时等待策略
- attend_window (1437)     process_reservation_attend_window 进入预约窗口(最大头)
- record (328)             record_high_value_reservation 高价值预约登记入口

原文件改为 53 行 re-export shim,17 个公共符号全部保留。
- process_reservation_attend_window 7 处外部引用
- handle_queue_full_wait_at_earliest 5 处外部引用
- _now_ts 5 处 / cleanup_expired_reservations 4 处 / _sort_reservations_inplace 4 处
- 其他 5 处以下
全部不需修改。

回归:
- 8 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- 旧 import 路径与新子包路径返回同一函数对象
- _now_ts / _normalize_room_title / _calculate_string_similarity 等纯函数
  调用结果与拆分前一致

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:03:55 +08:00
CodexandClaude Opus 4.7 787c4e8eec 拆分 douyin_detection (1756 → 3 个子模块 + 22 行 shim)
把 douyin/detection/douyin_detection.py 按职责拆成
douyin/detection/detection_pkg/ 子包:

- _common (14)    _ensure_detection_cache 共享缓存初始化
- detail (323)    check_detail_height + check_in_fudai_detail(详情页相关)
- finder (1438)   check_have_fudai_with_ready_screenshot(找福袋图标主入口,最大头)

原文件改为 22 行 re-export shim,4 个公共符号全部保留。
- check_in_fudai_detail 5 处外部引用
- check_have_fudai_with_ready_screenshot 3 处外部引用
- check_detail_height 2 处外部引用
全部不需修改。

子包名 detection_pkg 是为了避免与同目录下的 shim 文件 douyin_detection.py
潜在的命名混淆。

回归:
- 4 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- 旧 import 路径与新子包路径返回同一函数对象

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 16:55:24 +08:00
CodexandClaude Opus 4.7 19e347e6c1 拆分 fudai_filter (1090 → 3 个子模块 + 24 行 shim)
把 douyin/fudai/core/fudai_filter.py 按职责拆成
douyin/fudai/core/fudai_filter_pkg/ 子包:

- helpers (126)        小工具:_is_short_countdown_text / check_contain / is_watch_task_fudai
- should_skip (483)    should_skip_fudai_by_config 配置筛选总决策
- join_decision (524)  basic_join_decision 最终参与决策

原文件改为 24 行 re-export shim,5 个公共符号全部保留。
- check_contain 16 处外部引用
- should_skip_fudai_by_config 14 处外部引用
- is_watch_task_fudai 10 处外部引用
- basic_join_decision 7 处外部引用
- _is_short_countdown_text 5 处外部引用
全部不需修改。

子包名 fudai_filter_pkg 是为了避免与同目录下的 shim 文件 fudai_filter.py
循环 import(同名包 vs 模块在 Python 中不能并存)。

回归:
- 4 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped(test_filter_logging 29 用例全过)
- 旧 import 路径与新子包路径返回同一函数对象

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 16:47:45 +08:00
CodexandClaude Opus 4.7 c0b8ff3ba6 拆分 douyin_pixel (1172 → 4 个子模块 + 33 行 shim)
把 douyin/detection/douyin_pixel.py 按职责拆成
douyin/detection/pixel/ 子包:

- _common (32)     _safe_open_screenshot_rgb
- popups (444)     优惠券 / 红包 / 抽奖结果弹窗检测
- buttons (340)    参与按钮 / 粉丝团加入红色区域检测
- stage (436)      直播间图标 / 福袋详情 / 综合阶段状态读取

原文件改为 33 行 re-export shim,9 个公共符号全部保留。
detect_fudai_detail_page 等 6 处外部引用、detect_attend_button_red_area
等 2 处外部引用全部不需修改。

回归:
- 5 个新文件 + shim compileall 通过
- pytest 353 passed / 1 skipped
- 旧 import 路径与新子包路径返回同一函数对象

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 16:37:06 +08:00
CodexandClaude Opus 4.7 bf7f30996e 拆分 douyin_screenshot_manager (1705 → 6 个子模块 + 79 行 shim)
把巨型文件 douyin/handlers/douyin_screenshot_manager.py 按职责拆成
douyin/handlers/screenshot_manager/ 子包:

- _common (79)     共享 logger / 全局状态 / 异步计数器
- paths (205)      OCR 目录、调试存档目录、各类路径
- save_files (173) save_latest_attempt / save_last_success / save_*_from_file / cleanup_ocr_dir
- async_save (360) _debug_save_loop + 工作线程启停(global 状态走 _common._state.X)
- cleanup (293)    debug_captures 目录清理与轮转
- save_image (731) save_debug_image 主入口(最大头)

原文件改为 79 行 re-export shim,30 个公共符号全部保留。
外部 29 处 save_debug_image / 6 处 save_latest_attempt / 等
import 路径不变,零调用方修改。

回归:
- 子包 7 文件 + shim compileall 通过
- pytest 353 passed / 1 skipped(与拆分前完全一致)
- 旧 import 路径与新子包路径返回同一函数对象
- AST 验证 30 个期望符号全部正确暴露

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 16:25:59 +08:00
CodexandClaude Opus 4.7 a6ce16f9c4 docs/README: 版本日志段引向 CHANGELOG.md + git tags + 发布流程
- 把 V3.0.0–V3.3.3 的散落条目统一到 CHANGELOG.md,README 只保留最近 3 个版本作为快照
- 加发布流程段:bump_version.py 用法 + test_version_consistency.py 守门
- 顶部链向 CHANGELOG.md 与 git tags 页面

回归:36 个路径引用全部存在;353 个测试通过。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 15:28:21 +08:00
CodexandClaude Opus 4.7 e35e8a85bd 建立版本管理体系:CHANGELOG + bump 脚本 + pyproject 元数据 + 一致性测试
新增:
- CHANGELOG.md:Keep a Changelog 1.1.0 格式,回填 V3.0.0–V3.3.3 历史
- tools/dev/bump_version.py:一键 bump major/minor/patch,
  同步 version.py / pyproject.toml / CHANGELOG.md,并创建 git tag。
  支持 --dry-run / --no-tag。
- tests/test_version_consistency.py:9 个用例确保
  version.py、pyproject.toml、CHANGELOG.md 三处版本号一致

修改:
- pyproject.toml 加 [project] 元数据,version=3.3.3(PEP 440 形式,
  与 douyin/core/version.py 同步;后者带 V 前缀,是单一事实来源)

后续会给 V3.0.0 → V3.3.3 补打 git tag。

回归:353 个 pytest 用例通过;bump_version dry-run 三种模式(patch/minor/major/set)
全部输出正确。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 15:17:56 +08:00
CodexandClaude Opus 4.7 778c021272 tests: 新增 param_usage_tracker 单元测试 (13 用例)
douyin/utils/param_usage_tracker:
  - track_param:写一条 / extra 字段合并 / 多次 append / unrepresentable 值兜底
  - track_call 装饰器:参数记录 / include_args=False / 保留 __name__ /
    异常正常传播 / kwargs 记录
  - read_entries:文件不存在 / 读回写入内容 / limit 限制 / 跳过坏行

用 monkeypatch 把 _get_log_path 重定向到 tmp_path,避免污染 state/。

回归:tests/ 344 passed / 1 skipped。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 15:11:54 +08:00
CodexandClaude Opus 4.7 ca4941b66d tests: 新增 ActionLogger + track_action 装饰器测试 (10 用例)
douyin/logging/action_logger:
  - ActionLogger 5 个 log_* 方法:log_step / log_operation / log_decision /
    log_state_change / log_ocr,覆盖带/不带 elapsed、含 kwargs 等场景
  - log_operation 大量 kwargs 不应导致格式化失败
  - track_action 装饰器:透传返回值、默认用函数名、异常正常传播、kwargs 透传

回归:tests/ 331 passed / 1 skipped。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 15:02:08 +08:00
CodexandClaude Opus 4.7 7d31075ce3 tests: 新增 PerformanceTracker 单元测试 (13 用例)
douyin/logging/performance_tracker.PerformanceTracker 6 个方法:
  - start_timer/end_timer:基本时长测量、未知 id 返回 0、二次 end 幂等
  - get_elapsed:进行中 / 未知 / end 后的行为
  - track_function:装饰器透传值 + 记录时长 + 异常路径仍记录
  - track_step:自定义 name 记录
  - get_statistics:空 / 多次平均

回归:tests/ 321 passed / 1 skipped。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:56:56 +08:00
CodexandClaude Opus 4.7 dba43e18f9 tests: 新增 check_contain + log_formatter 测试 (41 用例)
- test_check_contain.py:fudai_filter.check_contain 黑名单关键词检查
  * 空黑名单 / 命中 / 未命中 / None / 空字符串
  * 命中后短路(不继续遍历)
  * 黑名单空字符串关键词不误匹配
  * 缺 contains_not_want 属性 / broken _log_kv 兜底

- test_log_formatter.py:9 个格式化纯函数
  * format_action_log / format_debug_log / format_error_log(前缀 + tag + 字段)
  * format_parameters / format_variables / format_call_stack
  * format_exception(含 traceback)
  * add_colors(默认绿 / red / 未知颜色兜底)
  * add_separators(带/不带 label)
  * beautify_log_output / colorize_log_line(不抛 + 一致性)

回归:tests/ 308 passed / 1 skipped。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:45:49 +08:00
CodexandClaude Opus 4.7 a39da30d16 docs/README: 把 pic/ 与 douyin/core/state/ 的 markdown 链接改为内联代码
这些目录是 .gitignored 的运行时生成目录,仓库里不存在实体,
作为 markdown 链接会渲染成断链;改为内联代码 \`pic/\` /
\`douyin/core/state/reservations.json\` 表达"运行时路径"语义。

修复 3 处:调试技巧段、故障排查段、FAQ 高价值预约段。

回归:267 个 pytest 用例通过;README 33 个路径引用全部存在。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:35:46 +08:00
CodexandClaude Opus 4.7 601e701823 docs/README: 把 pic/ logs/ state/ 等运行时目录的 markdown 链接改为内联代码
这些目录在 .gitignore 里(运行时生成),通过 markdown 链接 [pic/](pic/) 跳转
没意义;改为 \`pic/\`、\`logs/\`、\`state/\` 内联代码标记,更准确。
顺手把 douyin/core/state/reservations.json 的链接也改为内联代码(同样在 .gitignore)。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:29:18 +08:00
CodexandClaude Opus 4.7 f6c9bb938c tests: 新增 reservation_error_utils 单元测试 (23 用例)
覆盖 douyin/reservation/core/reservation_error_utils 4 个工具函数:
  - format_reservation_context:空输入 / item / queue / 长字符串截断 /
    长队列截 5 项 / kwargs 合并 / 异常输入兜底
  - validate_reservation_item:合法项 / 缺字段 / 非字典 / 0/负值 /
    格式错误
  - safe_write_state:成功 / PermissionError / OSError / ValueError 路径
  - log_reservation_error:走 _log_kv / 无 analyser / broken analyser

回归:tests/ 267 passed / 1 skipped。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:25:35 +08:00
CodexandClaude Opus 4.7 872722522c docs/README: 系统性重构 + 修正 AI_PROJECT_SUMMARY 链接
- 系统性重写 README(1700+ 行 → 700 行):
  - 顶部加目录索引,主体改为表格 + 简明列表
  - 重新组织"快速开始"为三种启动方式(GUI / CLI / Web GUI),命令示例
    全部用 bin/<entry>.py 形式
  - 「核心功能」改为 11 项一行表格,配合超链接
  - 「技术架构」段简化为核心栈 + 检测层次表 + 架构图,删除冗长描述
  - 详细配置说明改为多个分组表格,命中率高
  - 引用 docs/ 子文档统一加 markdown 链接,便于跳转

- 修正过期链接:[docs/AI_PROJECT_SUMMARY.md] → [docs/archive/AI_PROJECT_SUMMARY.md]
  (main 上 PR #5 把它归档了,README 重写时引到了旧路径)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:25:12 +08:00
CodexandClaude Opus 4.7 87d0fe2db8 tests: 把 GUI ⇄ WebUI 配置同步检查纳入 pytest
包装 tools/diagnostics/check_web_gui_config_sync.py 为单元测试:
- test_gui_webui_keys_synced:用 check_sync() 检测 GUI 与 WebUI 配置 key 漂移;
  失败时打印 "缺哪些 key" + "怎么修复"
- test_manifest_shape:build_manifest() 应产出预期形状 + 共享 key 数量级合理

每次有人改 webui/index.html 或 gui/gui_app.py,pytest 都能立即发现 key 漂移,
避免之前那种"GUI 改了 WebUI 没改"的常见缺陷。

回归:tests/ 244 passed / 1 skipped。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:15:14 +08:00
CodexandClaude Opus 4.7 ecffba94b4 P3 §7: 引入 pytest 基础设施 + 9 个核心模块冒烟/单元测试
§7-1 pytest 基础设施
  - pyproject.toml 加 [tool.pytest.ini_options]
    (testpaths / python_files / strict markers / smoke + slow marker 注册)
  - tests/conftest.py 自动把项目根加到 sys.path

§7-2 核心模块测试(242 passed, 1 skipped)
  - test_filter_logging.py(重写为 pytest):should_skip_fudai_by_config
    + is_watch_task_fudai + _is_short_countdown_text 共 29 用例
  - test_time_utils.py:parse_mm_ss + extract_2digits 共 22 用例
  - test_douyin_text_utils.py:4 个 OCR 解析函数 25 用例
  - test_douyin_utils.py:extract_prize_value_yuan + normalize_countdown_text 21 用例
  - test_path_config.py:10 个路径函数结构断言 + 路径间互不重复 20 用例
  - test_logger_helpers.py:8 个 print→logger helper 的统一接口测试 20 用例
  - test_unified_logger_mdc.py:MDC 7 个方法 + 线程隔离 13 用例
  - test_io_utils.py:_verify_png_integrity / _safe_replace_file /
    _ensure_parent_dir 11 用例
  - test_imports.py:78 个核心模块的 import 冒烟 + 关键类/函数导出验证

修订老测试
  - test_ocr_comparison.py:用 pytest.importorskip 跳过缺失的 psutil/easyocr/paddleocr,
    并整体标 @pytest.mark.slow(需要 'pytest -m slow' 才会跑)
  - test_webgui.py:原会真的启 HTTP 服务卡死,改为 import 冒烟 + helper 调用测试

README
  - 重写 "## ✅ 测试" 段,给出实际可用的 pytest 命令、测试约定、marker 说明

回归:tests/ 142 项测试 PASS / 1 SKIP / 0 FAIL;全部纯函数 + 不依赖 ADB / OCR / 设备。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 14:09:02 +08:00
CodexandClaude Opus 4.7 818c3139b1 docs: 收尾 DEBUG_IMAGE_SYSTEM + ocr_engine_decision 路径
- DEBUG_IMAGE_SYSTEM.md: 'path_config.py' → 'douyin/core/path_config.py'
- ocr_engine_decision.md: 'Underlying_Operations.py' → 'douyin/core/underlying_operations.py'

至此活文档(除 docs/完整技术文档.md 头部对照表里的旧→新示例外)已无
裸路径残留。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 13:38:47 +08:00
CodexandClaude Opus 4.7 941bbc2475 docs: 命令行示例与核显说明改新路径
- docs/完整技术文档.md:7 处 'python run_cli.py …' 命令统一改为
  'python bin/run_cli.py …',与重构后入口位置对齐(头部小贴士那
  一行的示例字符串保留作为对照说明)
- docs/核显GPU加速说明.md:'修改 Underlying_Operations.py' 改为
  'douyin/core/underlying_operations.py'

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 13:35:19 +08:00
CodexandClaude Opus 4.7 c802f62796 docs/完整技术文档: 批量替换叙述性旧路径为新路径
把全文(除头部"路径迁移说明"对照表外)所有反引号包裹的旧路径标识符
更新为重构后位置:

- \`Underlying_Operations.py\` → \`douyin/core/underlying_operations.py\` (23 处)
- \`path_config.py\` → \`douyin/core/path_config.py\` (7 处)
- \`run_cli.py\` → \`bin/run_cli.py\` (15 处)
- \`unified_logger.py\` → \`douyin/logging/unified_logger.py\` (1 处)
- \`Underlying_Operations.<method>()\` → \`underlying_operations.<method>()\` (6 处)

头部 "⚠️ 路径迁移说明" 对照表内的旧路径作为示例保留。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 13:32:35 +08:00
CodexandClaude Opus 4.7 b6d2836e84 docs/完整技术文档: 可执行 import 示例改为新路径
8 处 from Underlying_Operations / from path_config / python -c "..."
示例改为 douyin.core.underlying_operations / douyin.core.path_config,
确保读者复制粘贴能跑通。

文档头部"路径迁移说明"表里左侧"旧"列保留旧路径作为对照;正文叙述性
提及(如 "见 Underlying_Operations.get_screenshot() 实现")暂保留,
读者依靠头部表对照即可。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 13:30:14 +08:00
CodexandClaude Opus 4.7 af4fc9168b docs/完整技术文档: fudai_detail_modules → douyin/fudai/core/fudai_detail_orchestrator
main PR b137aea 把 fudai_detail_modules/ 6 个模块合并到 douyin/fudai/core/,
其中 fudai_detail_reader.py 因与 core/ 已有同名文件冲突,重命名为
fudai_detail_orchestrator.py。

修订文档里 5 处旧引用:
- L155、L236:变更记录里的 fudai_detail_reader.py 改为新位置 + 标注旧路径
- L209:python -c 示例 import 改为新模块路径
- L256:py_compile 示例改为新文件路径
- L523:get_fudai_contain 调用位置改为新位置(顺手把"具体行号"改为
  "以代码当前状态为准",因为行号会随重构持续变化,硬编码价值低)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 13:26:24 +08:00
CodexandClaude Opus 4.7 a84ec29145 docs/DEBUG_IMAGE_SYSTEM: Underlying_Operations.py → douyin/core/underlying_operations.py
文件已迁移到 douyin/core/,文档里两处"实现位置"的路径修正为新位置。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 13:21:36 +08:00