feat: 一键生成链路日志最小集 #205

Merged
xiaoxia merged 4 commits from feature/generation-logging-minimal into develop 2026-07-10 23:57:39 +08:00

4 Commits

Author SHA1 Message Date
用户CI Test 7fa0906352 fix: 修复 flake8 F541 f-string 无占位符
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 20s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 19s
CI/CD Pipeline / Frontend Lint (push) Successful in 2m37s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 3m25s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
移除 generation.py:452 处多余的 f 前缀,消除 CI lint 报错。
2026-07-10 22:53:49 +08:00
用户CI Test 57923eeae6 fix: P2 API异常信息泄露 + P3-1 逐素材下载日志
P2: generation_tasks.py:260 异常detail改为通用消息,避免泄露内部错误
P3-1: _download_library_assets 添加逐素材日志(asset_id/耗时/大小/成功失败)
      通过 gen_task.append_log 持久化到任务日志,前端可查
2026-07-10 22:53:46 +08:00
用户CI Test d32c86e71b fix: 更新 schema-metadata-snapshot 支持 logs 字段 2026-07-10 22:53:43 +08:00
用户CI Test 849a068a46 feat: 一键生成链路日志最小集
- Alembic 037: generation_tasks 表添加 logs TEXT 字段
- Domain 层: GenerationTask 添加 append_log/get_logs 方法(上限200条)
- Repository 层: _to_domain/create/update 映射 logs 字段
- API Schema: GenerationTaskResponse 添加 logs 字段 + JSON validator
- API Route: create_generation_task 添加请求/校验/入队/错误日志
- Worker: generate_video 全流程结构化日志
  - [task_id=xxx] [阶段] 消息 统一格式
  - 接收任务/下载素材/剪辑计划/渲染/OSS上传/完成/失败 各阶段埋点
  - _flush_logs 实时持久化到 DB(独立 session,异常安全)
- 18 个单元测试全部通过

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 22:53:37 +08:00