A8多套打包+M4归档+R5多图:存量功能备份

A8 多套交付包(packaging_task.py):
- 修复交付包只打第1条混乱note的bug,按ImageCandidate.strategy分A/B/C组
- 每组生独立note_0N夹(6图+文案.txt),同seq留最新去重,老数据兼容
- task74端到端验:3套各6图,独立agent7项交叉验证全过

M4 归档(tasks.py/exports.py/前端):
- list_tasks加date_from/date_to/product_id筛选+product_name批量填(防N+1)
- 新增exports.py:产品JSON导出+标杆CSV导出(UTF-8 BOM)
- 前端HistoryFilters日期/产品筛选+产品列+打回原因红banner
- response.py加raise_param_error;独立agent验A1/A2/A9通过

R5 产品多图(product_images.py/020迁移/前端):
- product_images表+5端点(上传/列/改场景/设主图/删图)
- 生图按ROLE_SCENE_PREFERENCE选对应场景图,回落primary
- 前端ProductImageManager多图画廊

R6 账号config拆页(settings/):
- 配置页按角色拆/settings(运营+组长+admin)+/config(仅admin)
- Key只显末4位不显余额(守红线)

核销表对齐真实代码状态:D1改稿框/M7裂变/E12评图分纠偏为已完成(曾漏回写)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
yangqianqian
2026-06-18 17:32:49 +08:00
parent 285791c12f
commit 4bed7425a8
41 changed files with 1211 additions and 236 deletions

View File

@@ -131,6 +131,38 @@ angle本条角度标签/ coverTitle封面大字≤10字/ imageBrief
硬性格式只输出JSON不要markdown代码块字符串内用中文引号「」。"""
# ── 第2环标杆爆款配方 → 文案 prompt借方法层结构禁抄竞品原话──────────────
_BM_DIM_LABELS: list[tuple[str, str]] = [
("title_formula", "标题公式"),
("opening_hook", "开篇钩子"),
("content_structure", "内容结构"),
("selling_point_style", "卖点表达风格"),
("emotion_tone", "情绪基调"),
("topic_tags", "话题标签思路"),
]
def _build_benchmark_block(refs: list[dict]) -> str:
"""把标杆 8维配方渲染成 prompt 块。只借'方法结构',硬约束禁抄竞品品牌/功效原话。"""
if not refs:
return ""
lines: list[str] = []
for i, f in enumerate(refs[:3], 1): # 最多取3条标杆避免prompt膨胀
dims = [f"{label}=「{str(f.get(key, '')).strip()}"
for key, label in _BM_DIM_LABELS if str(f.get(key, "")).strip()]
if dims:
lines.append(f" 标杆{i}" + "".join(dims))
if not lines:
return ""
body = "\n".join(lines)
return (
"\n【对标爆款配方参考(只借方法层结构,绝不照抄)】\n"
f"{body}\n"
"硬性约束:仅参考上面的标题套路/开篇方式/结构节奏/情绪基调来组织本产品文案;"
"禁止照搬竞品品牌名、产品名、功效原话或具体数字;产品信息一律以本产品为准。"
)
def build_prompt(product: dict, count: int, extra_rules: str = "") -> str:
"""
组装文案生成 user_prompt。
@@ -153,6 +185,7 @@ def build_prompt(product: dict, count: int, extra_rules: str = "") -> str:
angle_hint = f"文案角度要覆盖:{''.join(angles)}(每条用不同角度)。" if angles else ""
brand_rule = f"每条正文和标题中植入品牌词「{brand_kw}」一次(自然融入,不生硬)。" if brand_kw else ""
benchmark_block = _build_benchmark_block(product.get("benchmark_refs") or [])
lines = [
f"产品:{name}",
@@ -161,6 +194,7 @@ def build_prompt(product: dict, count: int, extra_rules: str = "") -> str:
angle_hint,
brand_rule,
custom,
benchmark_block,
f"\n【Q1随机变量池·每条身份/起因/小缺点各不相同,严格按下方分配使用】",
combos_text,
extra_rules,