Source snapshot: 97d7f0fae96dc04b7ddad56fc1db6a108ed662cc [SEC-CLEAN] · pre-push-clean v1.0 · 109处敏感信息已自动转乱码
1.9 KiB
1.9 KiB
Notion→本地 同步器 MVP
下一轮指引: 完成后→下发 PY-A04-20260425-002 工具回执系统 仓库路径: /guanghu-self-hosted/notion-sync/ 优先级: P0 分支名: feat/py-notion-sync 创建时间: 2026年4月25日 11:19 审核结果: ✅ 审核通过 (2026-04-25T12:35+08:00) ━━━━━━━━━━ ✅ 6文件齐全: config/export_formatter/sync_notion/test/requirements/README ✅ source_url bug已修复 + 9条测试 + 增量同步支持 ✅ 目录隔离 + 禁触未动 ━━━━━━━━━━ 审核人: 霜砚(AG-SY-01) 结论: 通过 · 进入第二轮 开发内容: 开发Notion页面同步器,将Notion对话/页面内容导出为本地结构化语料。
- 读取现有 message-router.js 了解消息路由逻辑
- 在 /guanghu-self-hosted/notion-sync/ 下创建:
- sync_http://notion.py: FastAPI服务,接收Notion webhook或定时拉取页面内容
- export_http://formatter.py: 将Notion页面转为训练语料格式(JSONL)
- http://config.py: 配置项(Notion API token占位、目标页面列表、导出路径)
- 输出格式: {role, content, timestamp, source_url} 的JSONL
- 支持增量同步(记录last_sync_time) 状态: 已完成 约束: 禁触: message-router.js(只读参考不修改) 编码: Python 3.10+ · FastAPI · UTF-8 依赖: 只用标准库+fastapi+httpx+pydantic 测试: 必须包含 test_export_http://formatter.py 验证JSONL格式正确 编号: PY-A04-20260425-001 自检结果: ✅ 6文件齐全(config/export_formatter/sync_notion/test_export_formatter/requirements/README) ✅ export_http://formatter.py source_url bug已修复(string concat替代f-string) ✅ 目录隔离: 仅/guanghu-self-hosted/notion-sync/ ✅ 未触碰message-router.js ✅ PY-A04-前缀commit ✅ Python3.10+ · FastAPI · UTF-8 ✅ 依赖: fastapi+httpx+pydantic+uvicorn ✅ test_export_http://formatter.py含9条测试 ✅ 分支: feat/py-notion-sync (4 commits) 负责Agent: 培园A04 阶段编号: Phase-0-002