Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude 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
Codex and Claude Opus 4.7
16d9bde4a0
docs/README: 修正版本徽章链接 version.py → douyin/core/version.py
...
文件已迁移到 douyin/core/version.py,徽章链接 (version.py) 是断链。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 13:18:58 +08:00
Codex and Claude Opus 4.7
e5c5ce06ee
docs/README: 更新"添加新功能"指引段
...
- 把"在项目根目录创建 douyin_xxx.py" 改为按职责放到对应子包
(douyin/core / douyin/fudai/core / douyin/detection 等)
- 把 douyin_fudai.py 标题改为 douyin/core/douyin_fudai.py
- 把 gui_app.py 标题改为 gui/gui_app.py
- 集成 GUI 后建议跑 tools/diagnostics/check_web_gui_config_sync.py 校验
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 13:17:10 +08:00
Codex and Claude Opus 4.7
20aefbb3a1
docs/README: 更新架构设计 ASCII 图反映重构后路径
...
- 用户界面层从 "gui_app.py / web_gui.py / run_cli.py" 改为
"bin/run_cli.py / bin/gui_app.py / bin/webgui_launcher.py"
- 底层操作层从 "operations/ device/screenshot/ocr" 改为
"douyin/core/underlying_operations.py + operations/ (向后兼容包装)"
(删除已删的 device_operations.py 提及)
- 路径配置从 "path_config.py" 改为 "douyin/core/path_config.py"
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 13:15:14 +08:00
Codex and Claude Opus 4.7
ae3f276f56
docs/README: 更新模块说明段反映重构后路径
...
修订"代码结构 > 核心模块说明"段中的过期内容:
- douyin/logging/:把已删的 douyin_logger.py 替换为现存的 unified_logger.py /
internal_loggers.py / action_logger.py / log_formatter.py / performance_tracker.py
- path_config.py:标题改为 douyin/core/path_config.py,补 get_high_value_rooms_path
- operations/:删掉已不存在的 device_operations.py,明确这是向后兼容包装层
- Underlying_Operations.py:标题改为 douyin/core/underlying_operations.py
- gui_app.py / web_gui.py:标题改为 gui/<file>.py(实现) + bin/<file>.py(启动器)
- run_cli.py:标题改为 bin/run_cli.py
- 补 bin/manage_logs.py 子段
- tools/:示例改成现实存在的 tools/diagnostics/ tools/coords/ 路径
- version.py:标题改为 douyin/core/version.py
douyin/other/:补登 douyin_high_value_room / douyin_live_room / douyin_lottery 三个模块
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 13:13:07 +08:00
Codex and Claude Opus 4.7
a46901ef5d
docs: 修正"根目录有 launcher 转发"的错误说明 + 入口命令改为 bin/
...
实际情况:根目录已不再保留 run_cli.py / gui_app.py / webgui_launcher.py /
manage_logs.py 的 launcher 转发,这些入口脚本统一在 bin/ 下,必须以
'python bin/run_cli.py ...' 形式调用。
之前的提交里我把"路径迁移说明"写成"入口仍可从仓库根直接运行"是错的,
本提交修正:
- README.md
- 项目架构段末尾的"历史小贴士"改为完整的迁移表,明确入口在 bin/ 下
- 5 处 'python run_cli.py' / 'python gui_app.py' / 'python webgui_launcher.py'
全部改为 'python bin/...' 形式(分别在快速开始、命令行用法、Web GUI 启动、
Issue 模板、测试模式段)
- docs/完整技术文档.md
- 头部"路径迁移说明"末尾的"仍可从仓库根直接运行"改为"必须用 bin/ 前缀"
文档里其他正文中的 'python run_cli.py …' 命令属于历史正文,迁移说明已在文档头部
统一指引读者改读为 bin/ 前缀,不再逐句修订(避免改动 7000+ 行文档主体)。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 13:10:07 +08:00
Codex and Claude Opus 4.7
9e189c711c
docs/README: 重写"项目架构"段反映 2026-05 重构后实际结构
...
老版目录树包含大量过期路径:
- 根目录 path_config.py / Underlying_Operations.py / run_cli.py(已迁到 douyin/core/ 与 bin/)
- fudai_detail_modules/ 顶级目录(已被 main 上的 PR 整体删除)
- operations/ 列出的 device_operations.py / image_operations.py 已删除
- 缺失 bin/、缺 io_utils.py、缺 douyin/core/path_config.py 与 underlying_operations.py、缺 webui/、缺 fudai_modules 子模块清单
重写为反映现实结构 + 末尾加历史小贴士,让读者遇到旧路径时能查到对应位置。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 13:05:32 +08:00
Codex and Claude Opus 4.7
c5c8def884
underlying_operations: 52 处 print → _uo_log
...
- 新增模块级 _uo_log(msg, level):与项目其他 print→logger 改造一致的模式,
优先走 logging(带 [OCR]/[截图]/[Underlying]/[警告]/[错误] 前缀),失败兜底 stdout
- 替换的内容包括:
- OCR 引擎初始化 / 延迟初始化(PaddleOCR / EasyOCR 切换)
- exec-out 截图 / 文件替换 / 回退方案的失败日志
- 滑动操作失败 / ADB 输入注入异常
- 中奖截图保存 / OCR 调试输出
- paste_text_at / click 等底层操作的调试输出
- 保留为 stdout:
- 设备选择交互(L220-247,含 input() 提示,需要用户在 stdout 看到)
- _uo_log helper 自身的最终兜底(L73)
回归:146 .py 全量编译通过;underlying_operations 类与 _LOGGER 加载正确;
test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 12:54:27 +08:00
Codex
80b35bcb6c
精修 WebUI v34:换主色 — Cyber Lime → Amber × Royal Indigo
...
- 用户反馈不要绿色配色;切换为琥珀橙 + 靛蓝
- primary 浅 #65a30d → #f59e0b (amber-500),深 #a3e635 → #fbbf24 (amber-400)
- on-primary 全部用深字(#1a0f00)保证 amber 上可读
- warning 与 amber 撞色:改 #ea580c (orange-600) / 深色 #fb923c (orange-400) 拉开
- 浅色底从冷青米 #f7f8f3 改暖米 #fbf7ec;深色加微暖 #0c0a07 / #16140e
- mesh blob / shadow-glow / focus-ring / overview-primary-bg / log-bg 全部同步暖系
- 65 个 token + inline 装饰色(rgba 与 hex)批量换色,0 残留绿色
- favicon SVG 同步:amber 渐变 + 深字播放三角 + indigo 装饰圆点
cache-bust v33 → v34
2026-05-21 12:53:05 +08:00
Codex and Claude Opus 4.7
cc1d4f0897
P3: 删除 3 个永远 FAIL 的字符串匹配测试
...
这三个脚本都是 grep 源码字符串模式做"验证",匹配的代码模式在历次重构里
早已改名/拆分/删除,导致它们长期失败、永远不会再 PASS:
- tests/test_delays.py
匹配的注释 "# 点击前延迟1秒" 已不存在于 douyin_yanghao.py
- tests/validation/validate_fudai_mapping_recording.py
匹配的字符串如 "basic_join_decision:设置福袋信息并记录映射表"、
"_record_room_title_and_pos" 已不存在
- tests/validation/validate_reservation_lock_protection.py
匹配的 "参与成功,处理锁定期并移除预约"、"protection_seconds=10" 已不存在
继续保留只会误导新人;该补的是基于行为/接口的真单元测试(pytest 引入再说),
而不是字符串模式断言。tests/validation/ 目录因此变空,一并删除。
剩余 tests/test_filter_logging.py(业务函数测试)继续保留,仍 PASS。
回归:149 -> 146 .py,全量 compileall 通过;test_filter_logging /
check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 12:43:52 +08:00
Codex
5efa0ebc8b
精修 WebUI v33:字体切换 — IBM Plex Sans + IBM Plex Mono
...
- body font 从 Manrope 改 IBM Plex Sans (Google Fonts)
- mono 从 JetBrains Mono 改 IBM Plex Mono(21 处全替换)
- HTML preload 同步加载 IBM Plex Sans 400/500/600/700 + Plex Mono 400/500/600/700 + Plex Serif (备选)
- 工程感更强、字形更有性格,配 lime × indigo 色系更贴
cache-bust v32 → v33
2026-05-21 12:43:05 +08:00
Codex
0e74bfba77
精修 WebUI v32:换配色 + 全局放大字号
...
配色反转:粉/青 → Cyber Lime × Royal Indigo
- primary:#ec4899 (粉) → #65a30d (lime-700),深色 #f472b6 → #a3e635
- secondary:#06b6d4 (青) → #4f46e5 (indigo-600),深色 #22d3ee → #818cf8
- on-primary:#ffffff → #0a1502 / #06120a (lime 上需深字保证可读性)
- 浅色 base 改暖青米白 #f7f8f3,深色改深炭蓝 #0a0c10 / #12161e (整体更冷静)
- mesh blob / shadow-glow / focus-ring / status ring 等所有彩色装饰同步换色
- favicon SVG 也同步:lime 渐变 + indigo 圆点
字号 / 控件全局放大
- token: text-xs 11→12, sm 12→13, base 13→15, md 14→16, lg 16→18, xl 22→24, 2xl 32→36
- leading-snug 1.35→1.4, leading-normal 1.5→1.55
- control-height 34→38px, rail-width 216→232px
- 硬编码 font-size 全部 +2px(脚本批量映射 9→11..16→18,反向顺序避免链式覆盖)
- min-height 30/32/34/36 → 32/34/36/38
cache-bust v31 → v32
2026-05-21 12:39:42 +08:00
Codex and Claude Opus 4.7
c92af75d02
docs/完整技术文档: 头部加路径迁移说明
...
文档主体(7363 行)撰写于项目大重构之前,正文中仍存在大量旧路径
(Underlying_Operations.py / path_config.py 在根目录,run_cli.py / gui_app.py
不在 bin/ 等)。全面改写风险高,改为在文档头部加一段醒目的"路径迁移说明",
列出新旧路径映射,让读者遇到旧路径时能查得到对应位置。
收益:
- 不破坏现有内部链接 / 锚点
- 读者一眼就能找到新旧路径对照
- 入口脚本(bin/)仍有根目录 launcher,文档里 python run_cli.py 命令仍可用
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 12:18:58 +08:00
Codex and Claude Opus 4.7
6ac99530d6
docs/README: 补登 ocr_engine_decision.md
...
main PR #6 新增了 docs/ocr_engine_decision.md(OCR 引擎选型决策记录),
但 docs/README.md 索引未同步。补到「系统说明(活文档)」分组。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 12:15:51 +08:00
Codex and Claude Opus 4.7
0c62696118
P3: 清理过期 TODO + 修正过期路径注释
...
- operations/__init__.py:
- 模块描述里 "Underlying_Operations.py 模块化" 改为
"douyin/core/underlying_operations.py 模块化拆分"(原文件已迁移)
- 删除 "TODO: 逐步迁移后改为从子模块导入"——
导入是有意保留的向后兼容层,不是待办
- douyin/reservation/core/__init__.py:
- 删除 "临时导入" "TODO: 迁移完成后改为从子模块导入"
- 这个 re-export 层也是有意保留的向后兼容设计
回归:140 .py 编译通过;operations + reservation.core 模块加载 OK;
test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 12:13:31 +08:00
Codex
9c3cf86f41
精修 WebUI v31:运行状态指示 / tab burst / 截图入场 / 数字千分隔符
...
logHeader 状态 pill
- logTitle ::before 圆点改 6px 渐变(粉→青)+ 6px primary halo
- ::after 加状态 chip:默认 "PAUSED" muted;body.is-running 时切 "● LIVE"(success 色 + glow border)
侧边导航 burst 反馈
- tab 切换时 sideNav 加 isBurst 类 380ms,触发 ::before 横/纵向 scaleY 1.3 / scaleX 1.6 的脉冲 + 光晕加强(10→18px)
- 同 tab 二次点击不触发;prefers-reduced-motion 下不动
截图入场动画
- preview img 从 opacity 0 + scale(0.985) → opacity 1 + scale(1),280ms 缓出
- 删除一处旧的重复规则
数字千分隔符
- 新增 fmtNum() 工具函数(toLocaleString en-US 千分隔,PID/Trace 不走)
- statLogLen / 9 个福袋统计 / 跳过 / 切换直播间 / 粉丝团等字段全部 fmt 化
- 大数字现在显示 "12,345" 风格,配合 JetBrains Mono tabular-nums 更易读
cache-bust v30 → v31
2026-05-21 12:11:09 +08:00
Codex and Claude Opus 4.7
0d01dabb69
P2 §5.3: 23 处 importlib.import_module → 静态 from import
...
把剩余 5 个文件里所有动态导入 douyin_screenshot_manager 的 importlib 调用
替换为顶部静态 from import 模式:
- douyin/detection/douyin_pixel.py 7 处
- douyin/detection/douyin_detection.py 8 处
- douyin/fudai/douyin_fudai_finder.py 4 处
- douyin/fudai/core/fudai_attend.py 2 处
- gui/gui_app.py 2 处
douyin_screenshot_manager 只引用 douyin.core.path_config,与上述 5 个文件
无循环依赖。bin/run_cli.py 的剩余 1 处 importlib 是有意为之
(绕过 package __init__ 遮蔽),保留。
收益:
- 可读性 + IDE 跳转/类型提示
- 每次调用省去 ~100µs 的 import_module 开销(detection 模块在热路径上调用密集)
- 死代码减少 ~92 行(5 个文件合计 -115 / +23)
回归:140 .py 编译通过;importlib 残留只剩 bin/run_cli 故意 1 处;
5 个模块导入 + fudai_analyse + should_skip_fudai_by_config 业务链路正常;
test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 12:06:23 +08:00
Codex
7001919642
精修 WebUI v30:进程心跳 / 滚动条 / 骨架 / 取景器 hover / SVG glow
...
全局 running 信号
- body.is-running 在视口顶部 fixed 2px 粉→青→粉横向 sweep glow line
- 2.8s 横向滚动 + 4px primary drop-shadow,进程"心跳"信号
滚动条
- 全局 webkit-scrollbar-thumb 改 180deg 粉→青渐变(55% mix)
- hover 升级为纯色 primary→secondary 渐变
骨架屏
- shimmer 渐变改为粉/青双色横扫(35% / 65% 节点 22% mix)
- 节奏 1.6s → 1.8s 更柔和
截图区取景器
- previewBracket hover 时 18→22px + drop-shadow 6→10px primary 75%
- 尺寸 + glow 同步过渡
Timeline 折线
- SVG defs 加 feGaussianBlur (1.6) + feMerge glow filter
- 折线 stroke-width 1.5→1.8 并应用 filter,霓虹光晕
- 与 chart hover 渐变协同
cache-bust v29 → v30
2026-05-21 12:03:44 +08:00
Codex
95255a4498
精修 WebUI v29:tooltip / 小按钮 hover / toggle / chevron / 深色复查
...
Tooltip
- 字体改 JetBrains Mono 10px 0.04em + text-strong;padding 加大;border 改 primary 35% mix
- box-shadow 三层:1px primary 描边 + 14px primary 40% halo + blur 10px
- 箭头方块同步换 primary 描边 + 90% mix 背景
小图标按钮统一 hover glow
- copyBtn / toastClose / shortcutsClose hover 改 primary 染色 + primary-soft 60% 背景 + 10px primary 45% halo
- 比之前的 muted 灰更有反馈感
Toggle switch
- checked 状态从单色 primary 改 90deg 粉→青渐变 + 12px primary 55% halo
- 圆球 thumb checked 时加 8px primary 40% glow
- focus-visible 在 focus-ring 之外再叠 12px primary halo
details/summary chevron
- 从 currentColor mask 改 linear-gradient (粉→青) mask + drop-shadow 4px primary 50%
- open 时旋转 90° + halo 升至 6px 70%
- 尺寸 10px → 14px
深色主题对比度复查
- mesh blob 不透明度全部 -2%(0.16/0.14/0.12 → 0.14/0.12/0.10),避免大背景过亮干扰阅读
- grain noise opacity:浅色 0.4→0.28,深色 0.6→0.35,保留质感但降低噪点强度
cache-bust v28 → v29
2026-05-21 12:03:44 +08:00
Codex
540ee24861
精修 WebUI v28:主容器 / panel / stat 卡 / 浮动按钮整体升级
...
主 Header
- 加 4% primary 顶部渐变 + radius-lg 顶部 hairline 改 65/65% 粉→青双色
- isScrolled 时边框改 primary-border + 24px primary halo box-shadow
- ::after 加 1px sweep glow line(200% 横向,6s 循环),仅 isScrolled 时 0.45 不透明显示
- secondaryActions 分隔线改渐变(透明→粉→透明),margin 增大
panel 容器
- 加 radial 双角光晕(左上粉 6% + 右下青 5%)+ surface
- 顶部 hairline 60% 双色渐变
- padding 18→22/24px 给装饰呼吸空间
- hover 时 border 30% primary mix(subtle)
工作区标题
- Eyebrow 字体改 JetBrains Mono 10px 0.18em + 6px 渐变圆点 + glow
- workspaceTitle 字号从 text-xl(22) 升至 26px + 700 weight + -0.02em 字距
stat 卡片
- 普通 stat:position relative + ::after 顶部 hairline (hover 时显示) + ::before 左侧 2px accent (跟 stateOk/Warn/Error 自动着色)
- hover 改 primary-soft 30% mix + 18px halo + 1px primary 描边
- statHero:加 8% primary radial + primary 22% border + 12% inner ring + 35% halo;::before accent 强制 primary→secondary 渐变
- statValue 字距 -0.015 → -0.025
浮动按钮
- scrollTopBtn 36→38px;border 用 primary 30% mix;背景加 radial 16% primary 圆光
- box-shadow 16px primary 30% halo;hover 时升至 24px 50% halo + 颜色全染 primary
cache-bust v27 → v28
2026-05-21 12:03:44 +08:00
Codex
b161a2c4a6
精修 WebUI v27:表单焦点光晕 + 图表渐变 + 浮层质感
...
表单 / 输入控件
- input/select/textarea caret-color 改 primary 粉
- focus-visible 三层光环:1px primary + 4px 22% halo + 14px 40% glow + 背景渐变到 primary-soft
- hover 改 primary-border(之前是 hover-border 灰)
- IP / port / path / number / yanghao_ 系列字段自动用 JetBrains Mono + ss01 + tnum
配置搜索框
- 同款三层 focus 光环;focus-within 时 search icon 染 primary
- kbd 徽章从 muted 改 primary 描边 + primary-soft 6% 背景 + primary-accent-text 粉字
- clear 按钮 hover 背景改 primary-soft
工作区头部
- 左侧 accent 改 3px primary→secondary 渐变 + 12px primary glow
- 加 ::after 顶部 hairline (粉→青渐变)
图表
- chartBlock 加 radial pink 角光 + 顶部 hairline + hover 1px primary 描边 + 22px halo
- chartTitle 字体改 JetBrains Mono 11px 0.1em uppercase + 6px 渐变圆点 (粉→青) + glow
- barTrack 加 inset 1px 阴影;barFill 改 cyan→pink 横向渐变 + 8px halo + ::after 跑光 shimmer 2.4s
- barValue 改 JetBrains Mono + ss01 + tnum
Toast
- 左侧 accent 条改成上下渐变(不再单色)
- icon 包圆形 chip:22×22 圆 + 12% 同色 mix 背景 + 60% 同色 10px halo
帮助层 (shortcutsCard)
- 顶部加 hairline 粉→青渐变(70% 不透明)
cache-bust v26 → v27
2026-05-21 12:03:44 +08:00
Codex
ac55428640
精修 WebUI v26:HUD 细节 — 把 chrome 全部往"控制台"推
...
侧边导航
- sideNav 加渐变粉头部 + counter-reset 通道编号;浮动指示条改 3px 粉→青渐变 + 10px glow
- tabBtn 左侧加 [01]–[11] mono 计数器(::before 用 counter() 生成);hover 时编号变粉
- tabBtn 右侧加可见性切换的 cyan dot(hover 0.7 / active 1)
- active:左渐变背景 + 1px primary 描边 + 编号高亮 + dot glow
- icon 颜色 hover/active 跟随 primary
章节标题
- sectionTitle 字体改 JetBrains Mono 10px 0.12em;圆点改"§ 01" 编号 chip(mono、leading-zero、primary 描边)
- ::after 加横线延展到右侧,渐变粉→透明
- 配置面板顶层加 counter-reset,每个 panel 内部继承计数
卡片
- cardTitle 加状态 chip(::after):默认 "READY",body.is-running 时切 "● LIVE"(绿色 + glow)
- cardTitle .sectionIcon 升级渐变填充 + primary glow
表格
- tableRow 加左侧 hover 渐变 accent stripe(粉→青)
- hover 背景从 surface-soft 改 primary-soft 30% 混合
- tableHead 改 JetBrains Mono 10px + primary 色 + 1px primary 描边 + 渐变背景
- mono 字段全局加 ss01 + tnum
预约卡
- 头部加 radial gradient 粉光晕(右上角)
- reservationItem hover 时左侧 3px 粉→青渐变 accent + 28px halo + translateY(-1)
- reservationIndex dot 改 radial pink + 8px glow
- reservationValue chip 改 JetBrains Mono 0.12em uppercase 粉色 pill
- isImminent / isDue 状态加 radial 警告/危险光晕底
日志
- log 字体改 JetBrains Mono + ss01;padding 加左侧 18px 留出光标位
- background 加 4px 周期性扫描线(cyan 4% mix)
- ::after 加 6×13 粉色光标 1.2s 闪烁(CRT 风)
Footer HUD
- 加 mono 12px / 0.12em 全大写;border-top 改 primary 22% mix
- 左:连接点 + 文字 + "SYS_OK" chip
- 右:PING <em>—</em>ms(实测 /api/version 响应时间,5s 一次)+ FPS <em>—</em>(每秒 RAF 计数)+ version + build
- em 内文字用 secondary/primary 色,mono 数字突出
- 移动端隐藏 PING/FPS
cache-bust v25 → v26
2026-05-21 12:03:44 +08:00
Codex
6fb7707abb
精修 WebUI v25:基调反转 — Operator's Terminal × Editorial
...
打破之前 Linear 极简,转向更装饰、更有质感的"控制台"美学。
字体与基调
- 字体栈:Manrope (body) + JetBrains Mono (数字/HUD) + Instrument Serif (备选),全部 Google Fonts
- 主色反转:Linear 紫 (#5e6ad2) → 抖音霓虹粉 (#ec4899) + 青蓝 (#06b6d4) 双 accent
- 浅色 base 改暖米白 (#fafaf7);深色改深蓝黑 (#08080c) 提亮饱和度
- body 加双层装饰:3 个 radial-gradient mesh blob + SVG turbulence grain noise (overlay 混合)
品牌标识
- brandMark 升级:6 段 conic-gradient (粉→品红→深粉→青→蓝青→粉);高光 radial drift 9s 缓慢动画;hover scale 1.03
- 内部加 SVG drop-shadow 让 logo 与彩色背景对比
按钮
- btnPrimary:linear-gradient (粉粉粉) + ::before 双层 mask conic 边框 hover 时 1.6s 旋转 + 6→10px 彩色 halo + text-shadow
- btnDanger 同款(红橙红)
- btnSoft hover 时显示粉色微光晕;btnDangerSoft hover 加 4px halo
- 所有按钮 hover translateY(-1px),active 回弹
卡片
- .card 顶部彩色 hairline (粉→青渐变),hover 时 opacity 0.45 → 0.85;hover 时 box-shadow 加 1px primary 描边 + 28px halo
- .overviewCard 同款顶部 hairline + 左侧 3px accent (primary 卡是 primary→secondary 渐变);hover translateY(-1px) + 32px halo
数字 hero
- overviewValue / statValue 改 JetBrains Mono + ss01 字符变体 + tnum + -0.025em 字距;深色主题加 24px primary glow text-shadow
状态点
- statusRunning 改 radial-gradient (mint→success) + 双色环涟漪(success + secondary 错峰 0.9s)+ 8/16px 双层光晕
- statusError 改 radial-gradient (粉→danger) + 12px halo + 1.6s pulse
实时截图区
- 加 4 个角的 viewfinder 取景器 brackets(primary 色 + drop-shadow glow)
- 运行中显示 REC 角标(红圆点 1s 闪烁 + 毛玻璃背景 + JetBrains Mono 字号)
- 空状态加 mesh radial blob (粉/青双色) + 加强扫描线对比
- hover 加 36px primary halo + box-shadow
cache-bust v24 → v25
2026-05-21 12:03:44 +08:00
Codex and Claude Opus 4.7
4f147d214e
P2 §5.3: 4 处单点 importlib.import_module → 静态 from import
...
把单次调用 douyin_screenshot_manager 的 importlib 改为 from-import:
- douyin/core/douyin_flow_control.py
- douyin/core/underlying_operations.py
- douyin/fudai/core/fudai_debug_utils.py
- douyin/stage/douyin_stage.py
douyin_screenshot_manager 只引用 douyin.core.path_config,与上述 4 个文件
无循环依赖,可以安全静态化。bin/run_cli.py 的 importlib 是有意为之
(绕过 package __init__ 遮蔽),保留。
收益:
- 可读性 + IDE 跳转/类型提示
- 每次调用省去 ~100µs 的 import_module 开销
回归:140 .py 编译通过;4 处 importlib 残留全清;
test_filter_logging / check_web_gui_config_sync 通过;
douyin_screenshot_manager 仍可正常加载。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 12:01:16 +08:00
Codex and Claude Opus 4.7
0700a378ec
stage + reservation: 孤立 print → logger
...
- douyin/stage/douyin_stage.py:阶段诊断起始处的 [DEBUG] print 改为
_LOGGER.debug,原本是诊断日志,走 logging 更合适
- douyin/reservation/douyin_reservation.py:当 _RESERVATION_ERROR_UTILS
不可用时的 print 兜底改为 _LOGGER.error,避免日志静默丢失
- 两处都新增模块级 logger
回归:140 .py 编译通过;test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 11:52:28 +08:00
Codex and Claude Opus 4.7
d5c9936c88
gui_app + base_interface: 内部错误 print → logger
...
gui/gui_app.py(8 处 sys.stderr print → _LOGGER):
- 配置读取失败、日志文件权限/写入错误(warning/error 级)
- pump_logs 内日志插入失败、循环异常、调度下次更新失败(error/warning 级)
- 顶部 import logging + 模块级 _LOGGER
douyin/core/fudai_modules/base_interface.py(2 处 print → _LOGGER):
- BaseFudaiMixin._safe_log 在主类无 _enhanced_log_kv 时的兜底改为 logger.info
- 顶部 import logging + 模块级 _LOGGER
保留为 stdout 的合理场景:
- bin/run_cli.py 的 [TEST]/[YANGHAO-ONLY] CLI 输出
- bin/manage_logs.py 的 CLI 工具输出
- gui/webgui_launcher.py: GUI 同时把 log 输出到控制台
- douyin/logging/internal_loggers.py: logger 模块自身的初始化失败兜底
- douyin/logging/douyin_logging{,_wrapper}.py: 日志系统内部的格式化输出
回归:140 .py 编译通过;test_filter_logging / check_web_gui_config_sync 通过;
gui.gui_app/web_gui/gui_core/base_interface 全部可加载,_LOGGER 名称正确。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 11:43:44 +08:00
zzz
7dd1c3ea88
Merge pull request '切换 OCR 默认引擎到 PaddleOCR v4-mobile 并简化预处理' ( #6 ) from claude/compassionate-sammet-469997 into main
...
Reviewed-on: simgreek/douyi_guaji_main#6
2026-05-21 11:37:35 +08:00
zzz
10ad6575c7
Merge branch 'main' into claude/compassionate-sammet-469997
2026-05-21 11:36:48 +08:00
Codex and Claude Opus 4.7
9a51b41c3d
docs: 归档过期报告 + 整体迁移 docs/optimization → docs/archive/optimization
...
A. docs/ 根目录下 5 篇过期/迁移类文档归档到 docs/archive/
- LOGGING_IMPROVEMENTS.md (日志系统迭代报告,与 archive/日志系统优化说明.md 重复)
- OCR性能分析报告.md (历史性能分析)
- 统一截图和分数记录说明.md (重构方案,已合并到代码)
- AI_PROJECT_SUMMARY.md (提到的 Underlying_Operations.py / path_config.py 路径已与 main 重构后不一致)
- param_usage.md (模块使用说明,零引用,模块本身有 docstring)
B. docs/optimization/ 整目录归档为 docs/archive/optimization/(7 篇)
- ADB_EXECOUT_OPTIMIZATION / OCR_PERFORMANCE_OPTIMIZATION
- SCREENSHOT_PERFORMANCE_DIAGNOSIS / SCREENSHOT_VERIFICATION_GUIDE
- STREAMING_SCREENSHOT_DISABLED / STREAMING_SCREENSHOT_COMPLETELY_DISABLED
- optimize_file_replace
全部是优化报告 / 已禁用功能记录,属于历史迭代而非活文档
C. docs/README.md 重写为按主题分组的索引,明确"活文档 vs 归档"边界
保留为活文档:
- 日志系统规范文档.md(被 3 处引用)
- 日志轮转功能说明.md(描述当前在用的轮转策略)
- 截图服务日志说明.md(描述当前服务行为)
- 完整技术文档.md / 流程图.md / 预约系统详细流程.md / 高价值房间重访功能说明.md
回归:纯文档归档不影响代码;140 .py 全量编译通过;
test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 11:19:28 +08:00
Codex
0131be7869
切换 OCR 默认引擎到 PaddleOCR v4-mobile 并简化预处理
...
- 默认引擎改为 PaddleOCR PP-OCRv4_mobile(实测 369ms/张,比 EasyOCR 629ms 更快且精度大幅提升,coupon 等关键图错字一片 -> 全对)
- EasyOCR 仅作回退,移除"小图自动放大+锐化+对比度增强"预处理(实测对 Paddle 是负优化,会引入伪影/重复字)
- analyse_pic_word 加 LRU 内容哈希缓存(256 条),重复读图直接命中
- analyse_pic_digits 从 200 行重复实现精简成 30 行委托 + 数字过滤
- 统一两处 OCR 初始化为 _build_paddle / _build_easyocr 工厂,消除重复
- 设置 FLAGS_use_mkldnn=false 绕开 Win + Paddle 3.x 的 oneDNN+PIR 不兼容 bug(实测 FLAGS_enable_pir_in_executor=0 也修不掉,关 oneDNN 是当前唯一可行解)
- 决策依据/速度数据/已知问题归档到 docs/ocr_engine_decision.md
- 业务接口完全向后兼容
2026-05-21 10:50:30 +08:00
Codex and Claude Opus 4.7
7fb0c3849c
P0 死代码清理:删 .backup / 空文件 / GUI 占位桩 / 占位目录 / 失效测试
...
A. 删除 3 个 .backup 文件(约 3.4K 行)
- douyin/detection/douyin_pixel.py.backup
- douyin/stage/douyin_stage_handler.py.backup
- gui/components/log_color_config.py.backup
B. 删除 0 字节文件
- douyin/other/douyin_stuck_guard.py
- docs/功能差异对比.md
- docs/archive/模块化代码对比说明.md
C. 删除 9 个 TODO + pass 占位组件(全仓零外部引用)
- gui/components/{config_manager,image_viewer,stats_display,
reservation_display,high_value_rooms_display,ocr_panel,main_window}.py
- gui/web_components/{proc_runner,http_handler}.py
D. 删除占位目录与失效测试入口
- douyin/detection/core/ 仅 re-export 占位
- douyin/fudai/finder/ 仅 re-export 占位
- tests/run_test.py 指向已删的 deleted_tests_backup/
附加:tools/diagnostics/check_web_gui_config_sync.py --help 字符串里
tools/web_gui_config_manifest.json 旧路径修正为 tools/dev/...
回归:154 → 141 个 .py,全量 compileall 通过;AST 扫描 0 处 import 残留;
gui.gui_app/web_gui/gui_core 仍可加载;fudai_analyse / should_skip_fudai_by_config
业务函数链路正常;test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 10:36:59 +08:00
zzz
c878491163
Merge pull request 'claude/wonderful-brattain-d1cfe0' ( #5 ) from claude/wonderful-brattain-d1cfe0 into main
...
Reviewed-on: simgreek/douyi_guaji_main#5
2026-05-21 10:26:16 +08:00
zzz
6ef04c1f37
Merge branch 'main' into claude/wonderful-brattain-d1cfe0
2026-05-21 10:24:10 +08:00
Codex and Claude Opus 4.7
71f3653354
补回上次合并丢失的关键路径修复 + .gitignore 补强 + 依赖版本对齐
...
上次冲突解决时跳过了 982f57e (P0 清理) 和 b6ae970 (路径修复) 两个 commit,
本提交补回其中影响运行时正确性和文档一致性的 7 处。
E. 路径错位修复
- douyin/core/douyin_fudai.py: _reservations_state_path 与 room_pos_map
状态目录改为优先调用 path_config.get_reservations_path()
- douyin/core/path_config.py: get_reservations_path 注释明确"实际位置 + 写入方"
- gui/components/mapping_utils.py: 删除错误兜底 douyin/state/reservations.json
- gui/components/mapping_table.py: 同步删除 douyin/state/room_pos_map.json 错误兜底
- gui/web_gui.py: get_reservations() 内的兜底由 douyin/state/ 修正为 douyin/core/state/
- bin/run_cli.py: 移除对已删空文件 douyin_reservation_ops.py 的 shim 加载
- douyin/reservation/douyin_reservation_ops.py: 删除 0 字节空文件
F. .gitignore 补强
- 新增 *.bak_* 拦截带日期后缀的备份命名(修复 *.bak 命中失败的场景)
G. 依赖版本对齐
- requirements-minimal.txt: paddleocr/paddlepaddle 改为 >=3.0.0,与 requirements.txt 一致
- README.md: 安装指引中 paddlepaddle==2.5.2 改为 >=3.0.0
回归:全量 .py compileall 通过;7 项断言(path_config 路径、douyin_fudai 切换、
3 处兜底已清、shim 已移除、空文件已删、.gitignore 补强、版本对齐)全部 PASS;
test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 10:18:17 +08:00
zzz
521b7b9e84
Merge branch 'main' into claude/wonderful-brattain-d1cfe0
2026-05-21 10:17:23 +08:00