- constants: 新增 TEXT_NARRATIVE_BY_STRATEGY(A痛点/B场景/C成分),与图片侧同轴 - build_prompt: 加 strategy_narrative 参数并注入 prompt - text_variants: 全链路透传(含优化轮) - run_text_generation: 改循环三套,text_count均摊(divmod余前补),跨套去重,打_strategy标记 - TextCandidate: 加 strategy String(4) 字段 + 迁移021(已upgrade head) - packaging: 打包按strategy精准配对文图(texts_by_strategy映射+三层兜底) - SSE text_candidate 事件携带 strategy 独立agent交叉验证7改造点全过,边界(text_count<3/无别名/不截断)无must-fix Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Clover Backend
FastAPI + Celery + MySQL + MongoDB + Redis
目录结构
backend/
app/
api/v1/ # 路由层(auth/products/tasks/review/delivery)
services/ # 业务逻辑层(按模块拆分)
models/ # SQLAlchemy ORM 模型(14张表)
middleware/ # workspace_guard 等中间件
workers/ # Celery 任务(只传task_id,worker内解密key)
constants/ # 策略命名中心文件,消除打架
utils/ # Fernet加密、SSE工具等
alembic/
versions/ # 001-004 migration 脚本
tests/ # TDD 测试用例
依赖(需装)
见 requirements.txt(待 BE agent 填)
启动
见 docker-compose.yml(待 BE agent 填)
铁律提醒
- API Key 绝不进 Celery 参数,只传 task_id
- FERNET_KEY 走环境变量
- 所有查询强制带 workspace_id