存量积累:生图素人感约束+评图分+幂等防重跑+审核回路
- 015-017迁移:image_candidate 文案复审/AI视觉分/重生标记 - constants C7素人感约束(反电商摆拍对齐真实笔记)+C3叠字口子 - celery visibility_timeout=2h 防长任务被误判重投重复烧钱(task75教训) - image_scorer 评图分(只筛选+展示,真实信号才进飞轮权重) - storyboard/image_gen/pipeline_io 生图存量 - task_actions/tasks/task_service/flywheel 审核回路+飞轮存量 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
33
backend/alembic/versions/015_image_candidate_text_review.py
Normal file
33
backend/alembic/versions/015_image_candidate_text_review.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""015 image_candidates 表加 text_review 字段(标题文字校验闸门)
|
||||
|
||||
Revision ID: 015
|
||||
Revises: 014
|
||||
Create Date: 2026-06-16
|
||||
|
||||
gpt-image-2 渲染中文偶发错别字。生图后对 hook/特写图做 OCR 校验,错别字自动
|
||||
重生(上限2次);仍不过则放行该图并写 text_review 标记,前端提示运营人工筛。
|
||||
NULL=未校验或一次通过;有值=曾不过或重生过的记录(倩倩姐2026-06-16拍板)。
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "015"
|
||||
down_revision = "014"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column(
|
||||
"image_candidates",
|
||||
sa.Column(
|
||||
"text_review",
|
||||
sa.String(512),
|
||||
nullable=True,
|
||||
comment="标题文字校验结果JSON(NULL=通过;有值=曾不过/重生,needs_text_review)",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column("image_candidates", "text_review")
|
||||
@@ -0,0 +1,38 @@
|
||||
"""016 image_candidates 表加 AI 评图分字段(E12 飞轮·展示层)
|
||||
|
||||
Revision ID: 016
|
||||
Revises: 015
|
||||
Create Date: 2026-06-16
|
||||
|
||||
E12 AI评图分(倩倩姐2026-06-16拍板):生成时 AI 给图打分,高分优先展示,前端呈现
|
||||
"AI评X分"。
|
||||
|
||||
🔴 红线:AI评图分只做"生成时筛选+前端展示",绝不进飞轮权重(权重只认真实信号:
|
||||
选了哪张/改了什么/过审与否)。eval_score 仍留 NULL,AI分单独存 ai_visual_score,
|
||||
不复用 eval_score,避免 AI 主观分污染飞轮。
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "016"
|
||||
down_revision = "015"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column(
|
||||
"image_candidates",
|
||||
sa.Column("ai_visual_score", sa.Float(), nullable=True,
|
||||
comment="AI评图分0-100(展示+排序用,绝不进飞轮权重;eval_score另留NULL)"),
|
||||
)
|
||||
op.add_column(
|
||||
"image_candidates",
|
||||
sa.Column("ai_visual_note", sa.String(256), nullable=True,
|
||||
comment="AI评图一句话评语(前端展示)"),
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column("image_candidates", "ai_visual_note")
|
||||
op.drop_column("image_candidates", "ai_visual_score")
|
||||
30
backend/alembic/versions/017_image_candidate_is_regen.py
Normal file
30
backend/alembic/versions/017_image_candidate_is_regen.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""017 image_candidates 表加 is_regen 重生标记(R2 单张/单套重生)
|
||||
|
||||
Revision ID: 017
|
||||
Revises: 016
|
||||
Create Date: 2026-06-12
|
||||
|
||||
R2 单张/单套重生(倩倩姐2026-06-12拍板顺序P0):用户手动重生某张/某套图时,
|
||||
新产出 candidate 一律【新增不删旧】(守"数据归客户可导出"红线 + 飞轮能看到重生信号),
|
||||
用 is_regen 标记区分原始图与重生图。前端同 strategy+role 默认只展示最新那条,
|
||||
若倩倩姐后续要"对比旧图"也能从历史 candidate 取回,方案前后兼容不返工。
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "017"
|
||||
down_revision = "016"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column(
|
||||
"image_candidates",
|
||||
sa.Column("is_regen", sa.Boolean(), nullable=False, server_default=sa.false(),
|
||||
comment="True=用户手动重生产出(新增不删旧,前端同strategy+role默认只展示最新)"),
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column("image_candidates", "is_regen")
|
||||
Reference in New Issue
Block a user