Files
yu-zhi-ran/scripts/show_status_report.py
Yuzhiran Dev fef435cc78 feat: 审查流程优化+采集定时调度+全链路LLM提示词升级
- 审查:移除 manual_review,改为迭代LLM修复(最多3次),合规分回写Topic
- 调度:scheduler 新增话题采集定时任务 scheduled_collect (01:30)
- 提示词:全链路8文件≈24个提示词升级,增强SEO/平台推荐/真人感
2026-05-14 21:52:02 +08:00

71 lines
2.6 KiB
Python

#!/usr/bin/env python3
import sys, datetime
from pathlib import Path
from collections import Counter
PROJECT_ROOT = Path(__file__).parent.parent
sys.path.insert(0, str(PROJECT_ROOT))
from db_helper import export_topics_to_json
DATA_DIR = PROJECT_ROOT / "automation" / "data"
TODAY = datetime.date.today().isoformat()
releases_dir = DATA_DIR / "releases" / TODAY
drafts_dir = DATA_DIR / "drafts" / TODAY
topics = export_topics_to_json()
by_status = {}
for t in topics:
s = t.get('status', '待处理')
by_status.setdefault(s, []).append(t)
print(f"\U0001f4ca 宇之然内容生成系统状态报告 ({TODAY})")
print(f"\n=== 1. 选题库总览 ===")
print(f"总选题数: {len(topics)}")
for s, arr in sorted(by_status.items()):
print(f" {s}: {len(arr)}")
print(f"\n=== 2. 今日 ({TODAY}) 已生成内容 ===")
if releases_dir.exists():
zhihu = list((releases_dir / 'zhihu').glob('*.html')) if (releases_dir / 'zhihu').exists() else []
wechat = list((releases_dir / 'wechat').glob('*.html')) if (releases_dir / 'wechat').exists() else []
xhs = list((releases_dir / 'xiaohongshu').glob('*.html')) if (releases_dir / 'xiaohongshu').exists() else []
print(f" 知乎: {len(zhihu)}")
print(f" 微信公众号: {len(wechat)}")
print(f" 小红书: {len(xhs)}")
topic_ids = set()
for f in zhihu:
topic_ids.add(f.stem.split('_')[1])
if topic_ids:
print(f" 涉及选题ID: {', '.join(sorted(topic_ids))}")
else:
print(" 今日无发布内容")
report_file = drafts_dir / "optimization_report.json"
if report_file.exists():
import json
report = json.loads(report_file.read_text(encoding='utf-8'))
print(f"\n=== 3. 合规优化结果 ===")
sm = report['summary']
print(f" 总文章数: {sm['total_articles']}")
print(f" 通过文章: {sm['passed_auto']}")
print(f" 平均合规分: {sm['average_score']:.1f}")
if sm['passed_auto'] > 0:
print(" ✅ 所有文章均已自动合规")
else:
print(f"\n=== 3. 合规优化结果 ===")
print(" 未找到优化报告")
ready = by_status.get('ready', [])
print(f"\n=== 4. 待发布选题(已合规)===")
if ready:
for t in sorted(ready, key=lambda x: x.get('priority_score', 0), reverse=True):
print(f" {t['id']}: {t['title'][:50]}")
else:
print(" 暂无待发布选题")
print(f"\n=== 5. 操作提示 ===")
print("1. 人工发布:将「待发布」选题的HTML发布到对应平台")
print("2. 发布后运行: python3 scripts/mark_published.py <选题ID>")
print("3. 或批量发布: python3 scripts/mark_published.py --all-ready")