refactor: 规则中性化——剥离 PPT 业务,统一为订单示范域
把规则从原 ppt-gen 项目泛化为通用脚手架,覆盖 19 个文件: - ddd/architecture/design-discipline/error-codes/communication-* 等: 领域术语、错误码、消息示例、扩展点、状态流统一为「订单」示范域 - agent-dag/agent.md/agent-concurrency/agent-llm-*:DAG 节点、配置、并发、 LLM 适配从「对话→预览→生成→截图→合成」改为「intake→process→validate→finalize」 - backend-db:Session 实体/状态机/ORM/仓储/checkpoint 对齐新流水线 - 移除幻灯片专属依赖与产物:agent 去 playwright/python-pptx, Dockerfile 去 Chromium 系统库,.gitignore 去 *.pptx - 保留合法通用项:ANSI(PTY 处理)、Playwright(E2E 测试工具)、Gemini CLI(真实 provider) 验证:gemini-cli/openai-api 两变体生成退出 0,生成项目零 PPT 残留, backend/agent 骨架均可 import 运行。
This commit is contained in:
@@ -10,18 +10,18 @@ paths: ["backend/**", "agent/**"]
|
||||
|
||||
| 数据 | 保留策略 | 执行方 |
|
||||
|------|---------|--------|
|
||||
| `~/ppt-gen/{uuid}/`(HTML+截图+PPTX) | TTL 默认 24h;总磁盘超阈值(默认 5GB)按 LRU 清理 | Agent 后台定时任务(每小时扫一次) |
|
||||
| `{WORK_DIR}/{uuid}/`(会话产出的中间/结果文件) | TTL 默认 24h;总磁盘超阈值(默认 5GB)按 LRU 清理 | Agent 后台定时任务(每小时扫一次) |
|
||||
| SQLite 会话记录 | 保留 30 天,过期软删除→定期硬删 | Backend 定时任务 |
|
||||
| 日志文件 | loguru `rotation="100 MB"` + `retention="14 days"` + `compression="zip"` | 各服务 logging 配置 |
|
||||
|
||||
- 清理任务幂等、可重入;删除前校验路径在 workDir 内(防穿越)
|
||||
- 配置项:`SESSION_TTL_HOURS`、`MAX_DISK_GB`、`DB_RETENTION_DAYS`、`LOG_RETENTION_DAYS`
|
||||
- 会话结束(done/error)后,临时中间文件(preview_*.html)可立即清理,仅保留 slides.html + result.pptx
|
||||
- 会话结束(done/error)后,临时中间文件可立即清理,仅保留最终结果文件
|
||||
|
||||
## 数据存储概览
|
||||
## 数据存储概览(示范)
|
||||
|
||||
| 层 | 存储 | 内容 |
|
||||
|----|------|------|
|
||||
| Backend | SQLite(`~/ppt-gen/ppt_gen.db`) | 会话记录(id、topic、style、status、时间戳) |
|
||||
| Agent | 文件系统(`~/ppt-gen/{session_id}/`) | slides.html、preview_*.html、截图、result.pptx |
|
||||
| Frontend | localStorage | 图片源配置(Unsplash/Pexels API Key) |
|
||||
| Backend | SQLite(`{WORK_DIR}/app.db`) | 会话记录(id、状态、时间戳等) |
|
||||
| Agent | 文件系统(`{WORK_DIR}/{session_id}/`) | 会话产出的中间文件与最终结果 |
|
||||
| Frontend | localStorage | 客户端本地配置(如第三方 API Key) |
|
||||
|
||||
Reference in New Issue
Block a user