From ddd7e5c17e23cb648b8f6d81acab7d5b1b7bb206 Mon Sep 17 00:00:00 2001 From: yibo Date: Sat, 17 Oct 2026 22:53:54 +0800 Subject: [PATCH] refactor(wechat-viewer): 聊天/doctor/重新生成改走 dsh,profile 管理下线;停用学习管线 cron --- CLAUDE.md | 2 +- device/crontab.txt | 3 +-- device/pixelphone/digest/wechat-group-digest/scripts/gen_digest_html.py | 28 ++++++++++++++++++++++------ device/wechat-viewer/app.py | 47 ++++++++++++++++++++++++++--------------------- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index c7d7bea..d8e0925 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -53,7 +53,7 @@ Pixel 上微信发送/跟踪的落地,纯设备内运行(不依赖 Mac): | `~/.dsh/skills/` | 保留的 ~47 个 skill(**必须平铺**,dsh 不递归嵌套目录);原 597 个 Hermes skill 仍在 `~/.hermes/skills/`,只待归档 | | `~/.dsh/profiles/{headless,web}/cordis.patch.yml` | 默认模型 `zai-coding/glm-5.3-flash`、persona(原 SOUL.md)、手机 MCP 接入 | | `/data/adb/service.d/{crond,dsh-web,wechat-reply-watcher}.sh` | Magisk 开机自启(Hermes gateway 相关脚本已挪到 `/data/adb/retired/`) | -| Termux `crond`(`crontab -l`,见 `device/crontab.txt`) | 取代 Hermes cron:reply-sender 5min、viewer 看门狗 10min、学习管线、BOSS 简历 6h、gate-audit、**TGO 日报 01/02/03 点链**(`daily-digest.sh gen|img|send`)+ 每小时 TGO 预摘要 | +| Termux `crond`(`crontab -l`,见 `device/crontab.txt`) | 取代 Hermes cron:reply-sender 5min、viewer 看门狗 10min、BOSS 简历 6h(**学习管线 cron 已于 2026-10-17 停用**:`learn-and-build` 产出写进 Hermes skill/memory,下线后无落点)、gate-audit、**TGO 日报 01/02/03 点链**(`daily-digest.sh gen|img|send`)+ 每小时 TGO 预摘要 | **微信自动回复引擎**:member(闲聊)走 `~/dsh/run-reply-member.sh`(无工具、`read-only`、人设取自 `~/pixelphone/SOUL.md`,对方是任意陌生人,输入不可信),admin(任务)走 `~/dsh/run-headless.sh`(全工具);orchestrator 里已无 Hermes 分支。admin 读 `~/.dsh/skills/reply-task-executor`,手机 MCP 已放开;但 `WECHAT_REPLY_NO_DIRECT_SEND=1` 闸门仍会让 `wechat_hook_send.send_*` 直发被拒,**发送只能走 orchestrator**。不可信内容的任务(viewer 文章摘要)用 `--patch ~/dsh/patches/no-phone.yml` 关掉手机 MCP。 diff --git a/device/crontab.txt b/device/crontab.txt index 14724e7..31fc02b 100644 --- a/device/crontab.txt +++ b/device/crontab.txt @@ -6,8 +6,6 @@ D=/data/data/com.termux/files/home/pixelphone/scripts L=/data/data/com.termux/files/home/pixelphone/cron-logs */5 * * * * python3 $D/reply-sender.py >> $L/reply-sender.log 2>&1 */10 * * * * bash $D/wechat-viewer-watchdog.sh >> $L/viewer-watchdog.log 2>&1 -0 */2 * * * bash $D/learn-pipeline-trigger.sh >> $L/learn-classify.log 2>&1 -0 * * * * bash $D/learn-executor.sh >> $L/learn-executor.log 2>&1 0 */6 * * * bash $D/boss-resume.sh >> $L/boss-resume.log 2>&1 0 6 * * * bash $D/gate-audit-cron.sh >> $L/gate-audit.log 2>&1 # TGO 日报链(取代 Hermes 调度器):01 生成 / 02 出图 / 03 发送;失败下个整点重试(窗口内每 10 分钟) @@ -18,3 +16,4 @@ L=/data/data/com.termux/files/home/pixelphone/cron-logs 0 * * * * pgrep -f tgo_summarize_batch >/dev/null || python3 $D/tgo_summarize_batch.py >> $L/tgo-summary.log 2>&1 # 原图保存 A+B(旧调度器定频 02/06/10/14/18/22 点,放 :15 避开 02:00 出图;约30分钟接管屏幕,锁屏/微信未起自动跳过) 15 2,6,10,14,18,22 * * * bash $D/orig-save.sh >> $L/orig-save.log 2>&1 +# 学习管线(learn-pipeline-trigger 每 2h / learn-executor 每小时)已于 2026-10-17 停用:learn-and-build 的产出写进 Hermes 的 skill/memory,Hermes 下线后无落点。恢复需先改 learn-and-build 的落点。 diff --git a/device/pixelphone/digest/wechat-group-digest/scripts/gen_digest_html.py b/device/pixelphone/digest/wechat-group-digest/scripts/gen_digest_html.py index 4d47e35..fce14c2 100644 --- a/device/pixelphone/digest/wechat-group-digest/scripts/gen_digest_html.py +++ b/device/pixelphone/digest/wechat-group-digest/scripts/gen_digest_html.py @@ -309,6 +309,7 @@ def build_media_section(date: str, prof: dict = None) -> str: import html as _html parts.append('
') for m in imgs: + u = _url(m) # meta 行:发送人 · HH:MM · 群名(2026-10-08 用户要求补充显示) bits = [] if (m.get("sender") or "").strip(): @@ -325,24 +326,39 @@ def build_media_section(date: str, prof: dict = None) -> str: if cap else "") parts.append( f'
' - f'' - f'{m.get(' + f'' + f'{m.get(' f'{meta_html}{cap_html}
' ) parts.append("
") if vids: + import html as _html parts.append('
') for m in vids: - parts.append( - f'' - ) + u = _url(m) + if u.lower().split("?")[0].endswith(".mp4"): + # 完整视频文件在本地/已上传:
") if files: import html as _html parts.append('