Commit Graph
172 Commits
Author SHA1 Message Date
zycandClaude Opus 4.8 296888f0bf feat(core): 基础资产 Agent 化 — 商品三视图(image_edit 参考主图)+ 人物立绘/三视图异步生成 + 演员库/详情
- 商品三视图:有真实商品主图时走 image_edit,以主图为参考锁包装一致(品牌字/配色/外形/Logo)
- 人物:据「某一版立绘」异步生成配套三视图(image_edit,worker 内跑),立绘/三视图各存版本可切换
- 基础资产出图改异步(run_base_asset_task / generate_triview_task),Web 层不被慢出图占住
- 前端:演员库浏览/新增、人物详情(立绘+三视图+版本切换/下载/查看大图)、按 busyKey 的单卡并发 loading(genBusy,替代全局 genBusyKey,各按钮互不阻塞)
- dev:本地连云端 MySQL 复用连接(CONN_MAX_AGE/health check/connect_timeout),仅 development 生效
- 含 projects 测试补充

tsc + py_compile + 26 后端测试通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 15:10:22 +08:00
zycandClaude Opus 4.8 da0c7edfe2 perf(core): 资产/通知「取全部」改大页+并行,根治每次刷新串十几个请求
资产接口原固定 20/页且不支持 page_size,前端 allAssets 逐页串行翻完(190 资产=10 个
串行请求,每个 0.5~1.7s 依次等)→ 整页刷新好几秒。
- 后端:AssetViewSet 加 AssetPagination(page_size_query_param,上限 200)
- 前端:allAssets/allNotifications 改「首页大页(200/100)+ 剩余页 Promise.all 并行」
资产 ≤200 时 1 个请求取全;再多也并行不串行。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 14:52:19 +08:00
zycandClaude Opus 4.8 608c8aeb7f refactor(core): 基础资产改对逻辑+对齐设计稿(一组多版本候选 + 详情弹窗 asset-detail-grid)
逻辑(后端):用 BaseAssetGroup 本来的设计,不再每次生成新建组
- generate_base_asset 复用同实体的组(商品=唯一商品组;人物/场景按 label):追加 candidate + 采用最新
- 版本 = candidate_assets,采用/当前 = adopted_asset;采用/切换走真 adopt-base-asset(下游只认 adopted)
- 人物三视图绑定到「某一版立绘 asset」:metadata.triview_of=<立绘 asset id>,同立绘多次=同组追加候选
- generate-triview 端点改取 portrait_asset_id;attach-base-asset 坏参数 404 加固

设计(前端):
- 人物/场景卡对齐设计稿(.prompt-box 可编辑 + 重跑/替换 + 转圈态,区头 N 个 + 克制「+ 新增」)
- 详情弹窗整套换成设计稿 asset-detail-grid:左大立绘(3:4)+版本缩略条;右三视图 section(16:9 + 重跑/下载 + 单张大图 + 暂无 tip + v1/v2 版本条)+ 提示词 section;脚部 下载立绘 + 使用该资产;场景无三视图
- 商品三视图内联面板版本=candidate_assets、采用走真 adopt
- 修:.thumb/.v-thumb/.h-thumb 非 .placeholder 导致缩略图不显图 → 接 --mock-media-url

本地 playwright 截图实测:基础资产卡 + 详情弹窗均按设计稿渲染。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 14:01:15 +08:00
zycandClaude Opus 4.8 a9b7f077b9 feat(core): 基础资产页按流程文档补完 step4(人物/场景详情+演员库+三视图绑定立绘)
人物/场景:
- 卡片可点开详情弹窗:立绘大图(hover 右下角 下载/查看大图)+ 立绘版本切换 +
  提示词重跑(覆盖卡片立绘,归入同角色)+ 应用到当前项目;场景详情不显示三视图
- 进入基础资产自动生成脚本提取的待生成人物/场景(带 loading),每项目一次
- 「替换」→ 演员库 replace 回填;人物区头部「演员库」入口

三视图:与「某一版立绘」1:1 绑定(metadata.triview_of=立绘组id)
- 生成/重跑立绘 → 链式据该立绘 image_edit 出配套三视图(锁角色一致性)
- 详情切换立绘版本 → 三视图跟着切;可据当前立绘再出多版,下方版本小图可切
- 后端 generate_person_triview + 端点 generate-triview,复用 model_library 三视图 SOP

商品三视图弹窗:记录版本、切换查看、重跑生成、采用此版本

演员库(新建 components/actor-library.tsx 覆盖层):
- 平台预设演员 / 我的演员两 tab + 添加演员工作台(AI 生成 / 本地上传保存)
- 替换基础资产卡:新增后端 attach-base-asset(把现有资产挂为候选并采用)

合并 dev 进来的火山真人审核绿/红盾到新的实体卡。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 12:00:56 +08:00
seaislee1209andClaude Opus 4.8 b30eaed838 feat(core): 火山人像素材库审核(绿/红盾)接入 + 端到端验证
- assets_client.py:照搬 AirDrama,volcengine SDK + AK/SK 签名(凭证走 settings.ASSETS_API)。
- review.py:真人资产送审/轮询编排。一团队一组(AssetReviewGroup,OneToOne),全 best-effort 不破坏主流程。
- 模型:AssetReviewGroup + Asset.review_status/review_remote_id/review_error(迁移 assets/0003)。
- 集成:真人基础资产生成后 transaction.on_commit 静默送审(services.generate_base_asset kind==person)。
- 端点 poll-reviews + 序列化暴露 review_status;前端基础资产趴每8s轮询、人物卡渲染 审核✓(绿)/审核✗·重生(红)/审核中,审核终态后停轮询。
- e2e 已验:送审→建组→processing→active(真拿到火山绿盾)。

对抗式交叉验证(2审查员,0 critical)修复:
- get_or_create_team_group 并发竞态:DB 唯一约束去重 + select_for_update 串行化远程建组,杜绝重复建组/丢送审。
- create_asset 返回空 Id 不再标 processing(否则卡死黄);processing 超 15 分钟兜底判 failed,未知 Status 记日志,防永久 processing + 无限轮询。

凭证暂借 AirDrama,.env 改 ASSETS_API_* 两行即可换;ASSETS_API_ENABLED=false 可一键关停。回归 18/18 过。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 10:51:23 +08:00
zycandClaude Opus 4.8 521f5f4535 fix(core): 脚本 agent 用通用字段解析,根治模型 schema 漂移致旁白/画面空
模型每次生成都换字段名(scene/screenDescription/画面…;dialogue 字符串 /
lines:[{role,content}] / caption…),逐一追变体是治标。改为通用解析:
- _pick_field:优先键命中 → 否则按关键词模糊匹配,跳过 bgMusic/note/shotNo 等非内容键
- 画面来源:visual/scene/screenDescription/画面… 任意命中
- 旁白来源:结构化 dialogue/lines 优先,其次整句 dialogue,再退 narration/voiceover/caption/字幕
实测覆盖 4 种真实/契约变体,全部正确填充;新增通用解析回归用例,23 测试通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 10:38:23 +08:00
zycandClaude Opus 4.8 0280c2e192 fix(core): 脚本 agent 再兼容 lines/caption 变体,补全旁白漏空
豆包不同型号吐不同 schema:Lite 用 dialogue(字符串)+subtitle;Pro 用
lines:[{role,content}]+caption。上一版只认 dialogue/subtitle,导致 Pro 变体
画面能填、旁白仍空。normalize_draft 再扩容:
- 口播来源并入 lines(每项 content/line/text)、voiceover;subtitle/caption 兜底
- 画面来源并入 visual_description
新增 lines/caption 变体回归用例,全套 22 测试通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 10:24:28 +08:00
zycandClaude Opus 4.8 a7f1b0da1e fix(core): 脚本 agent 兼容模型 ScriptDraft/shots 变体,修旁白/画面全空
豆包 Doubao-Seed-2.0-Lite 常不按扁平契约输出,而是回
{"ScriptDraft":{"basicInfo":...,"shots":[{scene,dialogue,subtitle}]}}。
normalize_draft 在顶层找不到 segments → 走补占位镜兜底 → 旁白/画面全空(只剩 role)。

normalize_draft 增加容错:
- 解开 {"ScriptDraft":{...}} 外壳;basicInfo 的 camelCase 时长/比例拍平
- shots → segments;每镜 scene→画面、dialogue/subtitle→旁白
- 防 dialogue 为整句字符串时被逐字符遍历
原扁平契约路径不受影响。新增 apps/ai/tests.py 3 个回归用例,全套 21 测试通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 10:09:09 +08:00
seaislee1209andClaude Opus 4.8 3d38c173e6 feat(core): 角色对白(剧情向按需)+ 聊天精准改一镜 + 模型下拉移位 + 全流程e2e + 交叉验证修复
新能力(均已端到端验证):
- 角色对白 dialogue:[{speaker,line}](speaker=null 即旁白)。默认口播,用户在聊天提要求才出多角色对白(剧情向);narration 保留扁平拼接兼容下游字幕/配音。skill 同步:默认不强制对白。
- 聊天精准改一镜:聊天说「第N镜改XX」→ agent 读全脚本上下文、只重写那一镜(target_index + 后端 _merge_single_segment 强制保其余镜原样),保衔接。
- 前端:分镜卡渲染对白/镜型/露出;模型下拉从顶部移到输入框下方小按钮(对齐 ChatGPT/Lovart)。

全流程 e2e 真跑通:商品→脚本→基础资产(gpt-image-2)→故事板(@图N 多图合成锁脸锁商品)→视频(Seedance 6.4分钟出片,带音效+人声)。

对抗式交叉验证(3 审查员)修复:
- 改稿用基准稿时长 effective_duration(prompt head + normalize + merge),避免请求默认 60 把 90s/6镜稿尾镜截掉/单镜改空转。
- target_index 越界服务端早返回报错、不计费;模型未产出目标镜时抛错释放额度(不静默空转)。
- 前端「第N镜」正则收窄为 镜|场(去掉会误判「第3个卖点」的 个|段)。
- 回归:测试 setUp 停用 seed 中转站文本模型,保证命中可 mock 的 provider(18/18 过)。

CLAUDE.md 加「AI 生成 Agent 化架构」一节供后续维护。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 05:09:51 +08:00
seaislee1209andClaude Opus 4.8 163a6627ba fix(core/frontend): 脚本趴左侧显示最近一版(重新生成即更新)+ 分镜卡补结构化字段
- currentScript 改「最近一版」而非「采用版优先」:右侧 agent 重新生成后左侧立即显示新稿(下游故事板/视频仍按后端 is_adopted,互不影响)
- 分镜卡补「标记」行:镜型(钩子/痛点/卖点/CTA)+ 商品露出,只读展示 ScriptDraft 结构化字段

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 03:35:05 +08:00
seaislee1209andClaude Opus 4.8 07a13224fe docs: 交接文档反映对抗审查修复 + 待推送状态
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 03:23:16 +08:00
seaislee1209andClaude Opus 4.8 a625f86b38 fix(core): 对抗式交叉验证发现的 4 个 critical + 关键 major
- 额度泄漏(critical):流式 agent 客户端断连抛 GeneratorExit(BaseException)逃过 except,
  预扣额度冻结。改 try/finally + settled 标志兜底释放。
- 默认图像模型(critical):0006 只停用 yunqi,没停火山 Seedream(bootstrap 种入 active 且更早),
  get_default_model 仍选 Seedream → 参考图分镜/模特库被架空。改为停用所有非 tokenssr 图像模型 +
  provider down→up 自愈置 active。
- 故事板参考提示词(critical):image_edit 分支复用 request_payload['prompt'](恒真)→ refs 版
  锁脸锁商品提示词成死代码,参考图白传。改为强制用 refs 版提示词。
- 凭证解析(major):build_provider 官方直连分支丢了 DB api_key,与中转站路径优先级不一致。
  统一走 resolve_provider_credentials。
- JSON 抽取(major):_extract_json 取首个围栏块(易抓示例块)+ rfind('}') 越界。改为取末个
  合法草稿块 + 字符串感知的括号配平扫描。
- 前端兜底(major):流式已成功(saved)但收尾抖动时 catch 仍回退旧端点 → 重复生成+扣费。
  改为按 ok/收到事件 判定,只在零事件时回退。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 03:21:06 +08:00
seaislee1209andClaude Opus 4.8 6464001f84 feat(core): AI 生成 Agent 化 — 多模型流式脚本 agent + 可插拔 Provider + gpt-image-2 参考图 + 模特库
- 后端·可插拔 Provider 层:通用 OpenAICompatibleProvider(tokenssr 等中转站,base_url+api_key,零改代码换站)+ ModelProvider.api_key
- 后端·脚本 agent:结构化 ScriptDraft 契约 + 加载电商 skill + 出稿/改稿一体对话 agent(3模式/多模型)+ 流式 SSE 端点(DRF SSE renderer)
- 后端·图像:gpt-image-2 参考图出图 + 故事板 @图1@图2@图3 多锚点合成(锁脸锁商品);Seedance 打开 generate_audio
- 后端·模特库:gpt-image-2 生成器(9:16氛围图→16:9白底三视图)+ seed_demo_models 管理命令
- DB·迁移:tokenssr 中转站 + 多模型 seed(豆包/GPT-5.5/Gemini + gpt-image-2);ScriptSegment 结构化字段
- 前端·脚本趴:接真 SSE(工具卡 + 思考流)+ 模型下拉 + 3模式 + 改稿;agentScriptStream
- skills/ecommerce-video-script 电商脚本技能(运行时依赖)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 03:12:03 +08:00
zycandClaude Opus 4.8 a0ffb6fc8e fix(core): 彻底修进入新建项目串台旧项目脚本
上一版没根治:action() 的后台 refreshProjectDetail 用旧 activeProjectId 拉到旧项目,
异步写回 projectDetail,而 pipelineProject=projectDetail||activeProject 无条件优先用它,
导致刚建的空项目仍渲染上一个项目的脚本(实测 Playwright 复现)。
改为渲染时校验 projectDetail.id===activeProjectId 才采用,否则回退 activeProject(列表项
已含完整嵌套脚本)。配合上一版的乐观 setProjectDetail/插入 projects + key=project.id,
新建项目即时显示空态+行30 三选项。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 18:27:44 +08:00
zycandClaude Opus 4.8 3313269438 fix(core): 修复新建项目脚本助手串台旧项目脚本(Playwright 实测发现)
后台 hydrate 期间进入刚建的项目,pipelineProject 会先闪出旧项目(projectDetail 滞后),
脚本助手 chat 用旧项目的 currentScript 初始化并持久化到新项目 key,导致空项目错显
「已有3镜脚本」、行30 三选项不出现。修:
- 新建项目 onCreate 即时 setProjectDetail(created)+插入 projects,pipeline 不再闪旧项目
- PipelinePage 按 project.id key,切项目时 chat 等状态干净重挂
- chat auto 派生提示(「已有N镜」)不落 localStorage,杜绝跨项目串台

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 18:15:28 +08:00
zycandClaude Opus 4.8 366e077c05 feat(脚本): 按流程文档重写脚本阶段(自动提取人物/场景 + 标签胶囊改写 + 基础资产按标签 seed)
后端:
- 出稿后新增轻量提取调用,从脚本抽取人物/场景标签及每个标签的建议生图提示词,
  写入 project.metadata(cast/scenes/cast_prompts/scene_prompts)
- 提取调用接入计费闭环(reserve→charge/release,记为 script_optimization);
  best-effort:无模型/预扣失败/调用失败/解析失败都吞掉返回空,绝不阻断出稿
- generate_base_asset 增加 label,落 group.metadata,把生成结果归回脚本标签卡

前端:
- 设定卡风格补齐到 5 个(真实测评/痛点种草/小红书种草/开箱测评/对比展示)
- 标签改为待确认胶囊流:增删不立即落库,排进队列在输入框上方显示可撤销胶囊,
  点发送才整体重写;待删划线、待加虚线
- 基础资产人物/场景按提取标签逐个 seed 卡,显示 AI 提示词、可改后生成

测试:新增提取+计费+release+label 共 4 个用例,全套 24 个通过(sqlite test 设置)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 17:59:41 +08:00
zycandClaude Opus 4.8 76b3ce94f9 test: 添加 QA 测试清单与流程文档
core/test/ 测试产物:测试清单 xlsx、截图 _imgs/_imgs2、流程.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 17:25:24 +08:00
zycandClaude Opus 4.8 9be2042520 fix(core): 测试清单 行24/28-39/46 — 流水线脚本&资产/消息页 + 单镜重跑后端接口
前端流水线(pipeline.tsx):脚本助手三选项指引(AI全生/一句话/自带脚本)+来源风格推荐;
风格/人物设定卡并持久化到 project.metadata;Enter发送/Shift+Enter换行;长文折叠10行;
生成进度流提示;分镜人物/场景标签可编辑并持久化+点击添加分镜;单镜重跑/删除即时反馈;
脚本助手记录按项目 localStorage 持久化;Stage2 基础资产补替换/重跑/可编辑提示词;
三视图采用弹窗+缺三视图气泡。
消息页(messages):复用全站 .search-inline 搜索框、去掉小标题背景方块。
视频项目(projects):列表按创建时间倒序,新建置顶。
性能:action 改后台 hydrate,消除创建/确认后白等(行29/37)。

后端(projects/ai):新增单镜 AI 重跑接口 POST /projects/{id}/rerun-script-segment/
(regenerate_script_segment 服务,复用 AITask+计费 reserve/charge/release;+2 单测)。

前端 build 通过;后端 check 0/无新迁移/apps.projects 14 测试通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 16:51:32 +08:00
zycandClaude Opus 4.8 f7a403ead3 fix(core): 测试清单 行16-33 — 商品详情/视频项目/新建向导/图片生成 批量修复
商品库+详情(行16-23):AI素材空状态缺省页;三视图16:9+版本历史切换+采用按钮;
详情「生成视频」预勾选商品、快捷生成图带入商品;管理商品编辑态保留底部统计;
删除商品 icon+DELETE ITEM 文案、乐观删除防重复点击;卡片图铺满占位区。

视频项目+新建向导(行24-28):筛选脚本来源按真实数据渲染;新建项目内「创建新商品」
右侧抽屉+创建后自动选中;开始栏 sticky 常驻;默认选中商品即显示卖点、未填完禁用开始;
去掉脚本风格/人物设定区块。

图片生成工作台(行29-33):模特单选;生成中改 spinner 动态图标+按钮间距;多任务并行;
重跑追加批次而非覆盖+更多按钮 hover 气泡菜单+「加入资产库/取消」切换与提示弹窗;
多批次本地持久化恢复。

收尾:App.tsx 接 initialProductId/preselectProductId/onCreateProduct/onAdoptTriView;
全局 toast 自动消失(成功3s/错误5s)修复行17③/22「右上角提示一直挂着」。

tsc -b && vite build 通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 15:10:26 +08:00
zycandClaude Opus 4.8 57018fb101 fix(core): 测试清单 行4-15 — 记住我7天/工作台布局/商品创建选择弹窗/上传图持久化/清空筛选
- 记住我7天:勾选才持久化token+预填用户名,7天过期强制重登(localStorage vs sessionStorage)
- 工作台:最近项目进度/状态列对齐、快捷&提示卡片圆角边框、余额按钮金额左对齐
- 商品创建成功改为复用弹窗,选择 继续创建/去新建项目;主图随创建上传持久化
- 商品卡显示真实主图、点视频进详情视频项目tab
- 商品库/视频项目补 清空筛选 按钮

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 14:13:52 +08:00
iye b2288a2652 feat(frontend): polish login and design tokens 2026-06-16 12:30:45 +08:00
zycandClaude Opus 4.8 77c037495e 异步生图兜底:回收僵尸出图任务(worker 崩溃后退还被占额度)
worker 崩溃/重启可能留下卡在 RESERVED 的出图任务,额度被一直占住、前端也永远等不到。
每次新提交时顺手回收:>10 分钟仍 RESERVED 的标记失败并退还预留额度(与导出僵尸清理同思路,
无需额外定时任务)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 16:41:23 +08:00
zycandClaude Opus 4.8 a749be5837 单图生成改为异步(Celery+AITask+前端轮询),与视频同架构
把独立生图从「请求内同步出图」改成异步任务,彻底根治整站 502:
- 后端 enqueue_standalone_images:Web 请求只建任务+预留额度(秒级),慢 ARK 出图派发给
  Celery worker(generate_standalone_image_task)。Web 层不再被 ~30s 请求占住 worker,
  健康探针不会被饿死 → 整站 502 从根上消失。
- run_standalone_image_task:worker 内单张出图,成功落库扣费/失败退费,幂等(只处理 RESERVED,
  重复投递不二次扣费)。
- 提交成功后浏览器关闭/断网,worker 仍把图生成并落库,重开素材库即可见(异步天然抗断连)。
- 视图 POST 返回 202+任务列表,新增 GET ?ids= 轮询状态并带回成图;前端 submit+poll。
- count 上限 4→12,与 UI 一致。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 16:38:06 +08:00
zycandClaude Opus 4.8 3472c3cc9c 修复整站502(健康探针被慢请求饿死)+全部模特死链+图片并发限流
- 后端 gunicorn 加 --threads 4:纯 sync worker 下几张图就占满 3 worker,
  健康探针 /api/health/ 拿不到 worker→超时→pod 判不就绪→流量被掐→整站502。
  图片生成 I/O 密集,加线程后慢请求不再饿死探针/其他接口。
- 前端图片生成并发上限 2:每张仍独立短请求,但不再 N 条一起砸单 pod 致 OOM。
- ai-tools 全部模特→ 接成展开/收起全部模特(原为纯 span 死链,模特>6 时第7个起选不到)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 16:15:49 +08:00
zycandClaude Opus 4.8 9c3e4e5c8b 图片生成改为每张一条并行请求,根治多图生成超时 500
根因:多图生成走一条 HTTP 串行出 N 张,4 张累计 >120s 被 gunicorn 强杀 worker → 500
(日志实锤 SystemExit on ARK response.begin)。采纳用户建议拆成「每张一条请求」:

- App.tsx generateImages: 拆成 N 条并行单张请求(Promise.allSettled),单张约 30s 不超时,
  并行后总耗时≈单张(比串行快 N 倍),任一张失败只丢那张(各自独立扣费/回滚)
- Dockerfile: gunicorn --timeout 120→300,给慢 ARK 留余量(双保险)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 15:38:08 +08:00
zycandClaude Opus 4.8 a8852345db 修复线上视频导出卡死(OOM)+ 导出健壮性加固
根因:后端容器内存 limit 仅 768Mi,ffmpeg 编码 1080P 竖屏时内存峰值超限被
K8s OOMKill,导出后台线程随 Pod 重启而死,任务永远停在 35%(本地无 limit 29s 出片)。

- k8s/core/api-deployment.yaml: 后端内存 limit 768Mi→2Gi、requests 256→512Mi,
  给 ffmpeg 足够编码空间(根治)
- export.py: ffmpeg subprocess 加 900s 超时(卡死不再永久 RUNNING)+ -threads 2 降内存峰值
- views.py: submit-export 清理超 5 分钟未结束的僵尸任务,前端不再无限转圈

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 13:58:18 +08:00
zycandClaude Opus 4.8 5e2bc0fc5a 修复线上视频导出失败 + 配音预览音画同步
- Dockerfile: 补装 ffmpeg 与中文字体 fonts-noto-cjk,修线上导出报
  "No such file or directory: 'ffmpeg'" 及字幕中文方块;换阿里云 apt 源防构建超时
- export.py: 字幕字体加载加 Noto CJK glob 兜底,适配不同版本 fonts-noto-cjk
- pipeline.tsx: 配音预览改 Web Audio 精确排程(借鉴 WebAV)——预解码 +
  source.start(when,offset) + 增量重排,正在发声的句绝不掐断,消除字幕音错位与卡顿

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 13:20:30 +08:00
zycandClaude Fable 5 ec90960a56 ci: 触发构建(Gitea 重启后验证流水线恢复)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-15 10:50:38 +08:00
zycandClaude Fable 5 0bcde3072d ci: 重新触发部署流水线(上次 push 未生成 Actions run)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-15 10:17:43 +08:00
zycandClaude Fable 5 216a711291 后端生成闸+多项修复;前端全站更新;QA 审计与报告
后端:
- 新增 celery_health 生成前置闸——无 worker 在线时图片/视频生成入口
  一律 503,防"提交到 ARK 后无人轮询、结果悬空+额度冻结"的数据丢失
- 拼接导出:帧率跟随源众数、字幕逐句重映射、原声/BGM 混音修复
- 资金核算审计脚本 + genesis 账目回填 + 滞留预留清理命令
- 接入 yunqi provider 与豆包 TTS 模型(catalog/migrations/bootstrap 命令)

前端:全站页面更新(pipeline/library/products/projects/team/account 等),
新增共享 pager 分页组件

QA:刷新 function-audit 全量输出,新增 full-qa 报告
文档:BP 产品介绍资料、design/CLAUDE.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-15 10:06:15 +08:00
zycandClaude Fable 5 890cb9ab67 chore(core/qa): function-audit toolchain + parity/audit reports + pixel-perfect skill
- qa/function-audit: playwright 行为审计工具(audit.mjs/verify-modals.mjs/pages.json)
  + 18 页审计产出(*.audit.md/json、summary、运行日志)
- qa/visual-parity: 调试/测量辅助脚本(_dbg*.mjs/_measure.mjs/_off.mjs)
- core/还原度核对报告.md: 18 页 pixelmatch 核对结果(含 vite 代理陈旧坑记录)
- core/还原与接口待办.md: 逐页还原度/真实数据/交互接入待办总表
- .claude/skills/pixel-perfect-react: 像素级还原 React 的 SKILL 文档
- frontend/public/_devlogin.html: 临时本地登录辅助页(可删)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 09:41:30 +08:00
zycandClaude Opus 4.8 3fac38c5ef feat(core): notification inbox infinite scroll + command palette fix (+ pending WIP)
消息中心:全量渲染 → 真·后端分页滚动加载
- backend(ops/views): NotificationPagination(10/页,page_size 可覆盖)+
  响应回 type_counts(按收件人绝对计数,不受分页/搜索影响)
- frontend(messages): 自管分页,滚到底加载下一批;tab/搜索走服务端并重置到第1页;
  代号作废在途旧请求防切换卡空白;乐观标已读;「已加载 X / Y」分母用当前筛选总数
- api/App/types: listNotifications 支持 page/page_size/search;allNotifications 携带 type_counts

命令面板(侧边栏搜索):修复点开后 UI 错位
- app-shell: 遮罩 className 漏了基类 shell-command-bg(只有 .show)致无定位塌到左下;
  补回基类 + header 类名对齐 .shell-command-h
- messages-page.css: 工作台收进视口高度,收件箱在面板内滚动

本次提交一并带入此前若干未提交 WIP(account/ai-tools/library/pipeline/products/settings +
accounts/ai/assets/billing/projects 后端),按用户要求整体推 dev。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 09:37:41 +08:00
zycandClaude Opus 4.8 aa4bdeac83 chore(core/backend): update .env (DB_BIND_ADDRESS + trim CSRF origins)
- DB_BIND_ADDRESS → 192.168.124.137
- DJANGO_CSRF_TRUSTED_ORIGINS: drop api.airshelf.airlabs.art

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 14:53:16 +08:00
zycandClaude Opus 4.8 0873e724bf feat(core/frontend): pipeline stage editor (burn-in controls) + double-submit guard & button greying
Pipeline (脚本→资产→故事板→视频→拼接):
- Stage1 render real script shots + wire 确认脚本→adopt (advance stage)
- Stage2 add person/scene AI-生成 buttons + clickable category tabs
- Stage4 auto-poll videos to completion + per-segment upload + real frame thumbnails + download
- Stage5 real timeline editor: clips undo/redo/split/copy/delete/drag-reorder/zoom,
  subtitle style + per-clip text editor, transition select (xfade preview),
  BGM upload + volume, save draft, export-with-save → shows/download final MP4
- embedded asset URLs everywhere (beat assets pagination)

UX: re-entry guard in action() (no double-submit anywhere) + greyed :disabled
styles for btn-aigen/chat-mode/pill-cta/tl-action so generate buttons visibly
disable while generating.

Also includes prior uncommitted frontend work: settings preferences/sessions/avatar,
asset delete, account/team/products pages, fonts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 14:46:42 +08:00
zycandClaude Opus 4.8 92826dec14 feat(core/backend): pipeline continuity + threaded ffmpeg burn-in export + upload/save-timeline
Video pipeline (script→assets→storyboard→video→stitch):
- robust split_script_into_segments (4 non-empty scenes), scene-aware storyboard/video prompts
- link VideoSegment→ScriptSegment + storyboard-frame reference image (graceful text fallback)
- idempotent poll_video_segment (no double-charge on repeated polling)
- threaded export (no Celery worker needed) + poll-export endpoint
- run_export_job rewritten to filter_complex: per-clip trim, xfade transitions,
  subtitle burn-in (Pillow PNG overlay; this ffmpeg lacks libass), BGM mix
- upload-video-segment / upload-bgm / save-timeline endpoints
- serializers embed asset preview URLs (beat assets pagination); Pillow added to requirements

Also includes prior uncommitted backend work: account preferences/sessions,
billing trend, product/asset endpoints, accounts 0002 migration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 14:46:16 +08:00
seaislee1209andClaude Opus 4.8 8959946241 fix(core/frontend): settings password-error styling (.pw-err)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 17:23:56 +08:00
seaislee1209andClaude Opus 4.8 64b0f3a1aa feat(core/frontend): restore ModelPhotoDemoPage A/B static showcase to baselines (§1 last item)
ModelPhotoDemoPage variant A/B pixel-restored to model-photo-demo-a/b.html (product rail + model grid +
batch result cards / task-stream layout). Sibling AssetFactoryPage/ImageWorkbenchPage untouched.
+ QA: shot-aitools.mjs / shot-pipeline.mjs. verified: tsc --noEmit clean; A/B + model-photo screenshots match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 17:14:56 +08:00
seaislee1209andClaude Opus 4.8 2242241c3b feat(core/frontend): ai-tools per-mode layouts (image=chat-stream / model=person picker / cover=platform) + pipeline real unread bell
- ImageWorkbenchPage now renders mode-specific layouts matching each baseline:
  image -> chat-stream (conversation list + hero + prompt chips + chat input bar);
  model -> product rail + 真人模特 cards (assets category=person, fallback Ava/Luna/Mia/Zoe) + per-model count;
  cover -> platform-kit picker. Generation (onGenerate) wiring + loading/empty/fail states preserved.
- pipeline.tsx: bespoke topbar bell now shows real unreadCount (was hardcoded 12); App.tsx threads it.
verified: tsc --noEmit clean; screenshot confirms image-optimize matches chat-stream baseline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 17:06:30 +08:00
seaislee1209andClaude Opus 4.8 579fb7cefa chore(core/frontend): remove dead codex-era exact-* code (§6)
Removed unused codex/iframe-era modules (confirmed no live imports; public/exact/*.html design baselines kept):
- routes/exact-document.tsx, routes/exact-html.ts (~1.6MB generated), routes/exact-dashboard.tsx, routes/exact-pages/ (24 files)
- exact-pages.css + its main.tsx import; index.ts ExactDashboardApp re-export
App.tsx uses the real Dashboard; nothing referenced the removed cluster.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 16:58:38 +08:00
seaislee1209andClaude Opus 4.8 099bf0e6aa feat(core/frontend): wire settings/avatar/image-gen + real data render (library/product-detail/pipeline)
App.tsx: thread saveProfile/changePassword/uploadAvatar/generateImages handlers + assets prop to pages.
- settings.tsx: profile save / password modal / avatar upload wired; notification/theme prefs -> localStorage
- library.tsx + product-detail: asset thumbnails + grids render real TOS preview_url
- ai-tools ImageWorkbenchPage: 生成图片 wired to /api/ai/generate-image, renders returned assets
- pipeline.tsx stage2-5: base_assets/storyboard/video_segments(adopted_asset)/timeline(clips/subtitles/bgm)
  rendered from real project data; graceful empty states
- types.ts: +VideoSegment.adopted_asset, +Timeline.subtitle_tracks/bgm_tracks
verified: tsc --noEmit clean; screenshots confirm pipeline stages 2-5 + product-detail render real data+images
(demo asset object_keys re-pointed to image objects so thumbnails resolve)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 16:20:10 +08:00
seaislee1209andClaude Opus 4.8 603584b46b feat(core/backend): expose video segment adopted_asset + timeline subtitle/bgm tracks for pipeline rendering
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 16:01:00 +08:00
seaislee1209andClaude Opus 4.8 a8f4608d10 feat(core): standalone image-gen endpoint + api.ts methods (profile/password/avatar/generate-image)
- POST /api/ai/generate-image/ — project-less image generation (AITask.project nullable, no schema change),
  reuses VolcanoArk image_generation + credit reserve/charge; modes image/model/cover.
  Verified: manage.py check clean; 2 active IMAGE models present (doubao-seedream-4.5/5.0).
  (Real generation calls Volcano API + charges credit — not yet live-tested to avoid spend.)
- api.ts: updateProfile / changePassword / uploadAvatar / generateImage

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 15:51:36 +08:00
seaislee1209andClaude Opus 4.8 aad9bd683b feat(core/backend): account settings endpoints (profile PATCH / change password / avatar upload)
§4 settings-save backend (no schema change; User already has phone/avatar_url):
- me/ now GET+PATCH (update name/phone/email)
- POST me/password/ — verify old password, set new (>=8), reissue token
- POST me/avatar/ — multipart -> TOS upload -> presigned avatar_url
Verified: profile PATCH 200, password change round-trip 200, original login restored.
Note: notification/theme prefs have no User storage field -> will persist client-side (no migrate per rules).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 15:41:05 +08:00
seaislee1209andClaude Opus 4.8 8f80247e0d chore(core): idempotent demo seed (airshelf team) + data screenshot script
- seed_demo.py: ORM-only demo data for airshelf team — 2 products (w/ images+selling points),
  11 assets referencing real TOS objects (thumbnails resolve to real images), one COMPLETED
  project with full pipeline graph (script/base_assets/storyboard/video_segments/timeline) so
  pipeline stage2-5 has real data to render. Idempotent (skips if demo product exists). No schema changes.
- shot-data.mjs: capture dashboard/products/library with seeded data via 127.0.0.1:5180
- verified: products page shows real cover images via TOS preview_url

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:48:13 +08:00
seaislee1209andClaude Opus 4.8 8bcf7615df feat(core/backend): serve TOS presigned preview_url for asset files
AssetFile.preview_url was stored blank on upload, so all thumbnails fell back to placeholders.
Make preview_url a SerializerMethodField that signs a TOS GET URL from object_key on read
(falls back to stored value, or "" when TOS unconfigured / no key). Verified: presigned URL
for an existing object returns HTTP 200 image/png.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:39:06 +08:00
seaislee1209andClaude Opus 4.8 78fd7ee13d feat(core/frontend): P1 pixel restoration (settings/messages/wizard/product-create faithful; ai-tools draft)
- settings.tsx + settings-page.css: restore to settings.html (left-nav + sections), real user/team data
- messages.tsx + messages-page.css: rich inbox restore (filters/detail/props grid) on real notifications
- projects.tsx ProjectWizardPage + project-wizard-page.css: restore to projects-new.html
- products.tsx ProductCreateUploadPage + product-create-page.css: restore to product-create-v2 baseline
- ai-tools.tsx (AssetFactory/ImageWorkbench) + ai-tools-page.css: DRAFT unified studio shell;
  deviates from per-page baselines (image-optimize should be chat-stream; model-photo product+person picker)
  -> pending rework alongside P3 standalone image-gen decision
- shot-p1.mjs: playwright visual-parity capture (react vs exact baseline; uses 127.0.0.1 not localhost)
- verified: tsc --noEmit clean; screenshots confirm settings/wizard/product-create/messages faithful

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:25:19 +08:00
seaislee1209andClaude Opus 4.8 25bf3293df feat(core/frontend): wire P0 team mgmt / recharge / notifications
- App.tsx: load notifications, expose team/recharge/notification handlers, real unread bell count (was hardcoded 12)
- team.tsx: create/edit/reset-password/remove member + team recharge modals
- account.tsx: recharge via wechat/alipay buttons + custom amount
- messages.tsx: real notification inbox, mark-read on select, mark-all-read
- verified: tsc --noEmit clean; e2e create->update->reset->recharge->mark-read->delete all green

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 12:48:51 +08:00
zycandClaude Opus 4.8 d41e487f08 feat(k8s): 新增 core 真应用(前端+Django API+Celery worker)构建与部署
- core/frontend: Vite 多阶段镜像 + nginx 同源反代 /api,/admin,/static(零 CORS)
- core/backend: Django gunicorn 镜像 + entrypoint(自动 migrate/collectstatic)+ WhiteNoise
- k8s/core: api/worker/web Deployment+Service + ingress(airshelf-web.airlabs.art)
- workflow: 追加 core 前后端 build/push,从 core/backend/.env 套生产覆盖生成 env Secret 后部署
- .gitignore 放行 core/backend/.env;.env 白名单加入 airshelf-web 域名
- 含前端 WIP 还原改动

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 10:21:41 +08:00
zyc cfdcd84a30 feat: add AirShelf core implementation 2026-06-05 10:21:40 +08:00
iye 2ba1058329 feat: refine asset media and project setup flows 2026-06-01 13:42:52 +08:00