# 推文日报卡住后缺少完成态探针 候选 ID:`tweet-automation-watchdog` ## 诊断流程样例 ### 场景 推文日报 runner 已运行 20 分钟,终端没有中间日志,用户只需要今天的日报成品。 ### 输入 - repo: `~/Documents/Codex/2026-04-21-https-github-com-haopenglau-skills/repo` - date: `2026-05-26` - pid: 当前仍在运行的日报进程 PID - fallback roster: 最近一次 raw artifact 中的账号列表 ### 命令 ```bash python scripts/twitter_daily_watchdog.py --repo . --date 2026-05-26 --pid 12345 --timeout-minutes 10 ``` ### 检查 1. 读取配置,发现 `skills.twitter-fetcher.users` 缺失,记录使用最近 raw artifact 回退账号列表。 2. 查找今天的 raw JSON 和 markdown,确认两者是否存在、mtime 是否晚于 runner 启动时间。 3. 连续两次采样 raw/markdown 文件大小,判断是否还在写入。 4. 解析 raw,统计账号覆盖、推文数、错误字段和空结果账号。 5. 检查 PID 是否仍存活;若存活但文件稳定且日志无新增,标记为 `stalled_after_artifact`。 ### 预期输出 ```json { "status": "stalled_after_artifact", "raw_path": "tmp/twitter_raw/2026-05-26.json", "markdown_path": "out/twitter_daily/2026-05-26.md", "pid_alive": true, "artifact_stable": true, "recommended_action": "return_artifacts_and_terminate_pid" } ``` ### 使用结果 父流程直接把 `raw_path` 和 `markdown_path` 回传给用户;随后清理残留 PID,避免下一轮日报自动化和旧进程重叠。