[M-AI-05-07] 建立 Feynman 真实业务 E2E 与受控切换验证 #310
Closed
opened 2026-06-21 15:53:57 +08:00 by wangdl
·
1 comment
Labels
Clear labels
adr
Area: adr
architecture
Area: architecture
area:activity
活动/统计
area:admin
管理后台
area:admin-api
area:ai
AI/RAG
area:ai-runtime
AI Runtime / AI 分析体系相关
area:analytics
area:api
API 接口
area:auth
认证与授权
area:cos
对象存储
area:database
数据库/Migration
area:import
文件导入/解析
area:knowledge
知识库/知识点
area:learning-info
area:learning-session
area:quiz
测验/自测
area:reading-event
area:reading-progress
area:review
复习系统
area:security
安全相关
audit
Area: audit
audit:api-admin-info
audit:api-info
audit:planned
已完成宏观规划,尚未代码审查
audit:reviewed
backend
Area: backend
billing
Area: billing
blocked-by:api-info-aggregation
blocked-by:api-info-core
blocked-by:api-info-ops
blocked-by:api-info-schema
blocked-by:processor
blocked-by:schema
compatibility
Area: compatibility
gate
Area: gate
infrastructure
Area: infrastructure
priority:p0
最高优先级,阻塞发布
priority:p1
高优先级,里程碑必需
priority:p2
中优先级,后续版本
prisma
Area: prisma
release
Area: release
repo:api
API 仓库 Issue
status:blocked
被阻塞
status:done
已完成
status:partial
status:todo
type:aggregation
type:bug
缺陷修复
type:design
设计
type:docs
文档
type:feature
新功能
type:migration
type:refactor
重构
type:test
work:admin-api
work:aggregation
work:api
work:artifact
题目/卡片产物
work:audit
work:circuit-breaker
熔断
work:contract
work:design
架构/协议设计工作
work:docs
work:export
work:extend-existing
work:internal-api
Runtime 内部接口
work:job
Job 调度相关
work:new-module
work:new-table
work:ops
work:query
work:quota
额度/限流
work:schema
Prisma Schema 设计
work:security
work:service
Service 层实现
work:snapshot
Snapshot 构建
work:test
Milestone
No items
No Milestone
M-AI-05 Feynman 与 ReviewCard 可靠链路
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wangdl/api-server#310
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
类型 / 标签
风险等级
P1(无真实 E2E 无法验证核心链路正确性)
依赖
目标
使用真实 Feynman HTTP 接口验证 Unified 引擎和复习产物链路。
环境
使用:真实 MySQL、真实 Redis、真实 BullMQ、API Process、Worker Process、Outbox Dispatcher、Mock AI HTTP Server 或测试 Provider、真实 JWT、真实 KnowledgeItem Fixture。
完整链路
POST /api/ai-analysis/feynman→ FeynmanExecutionRouter → AiJobCreationService → AiJob → Snapshot → Outbox → Dispatcher → ai-interactive → Worker → Execution Engine → FeynmanExecutor → Validation → FeynmanProjector → Evaluation Result → FocusItem → ReviewCard → Artifact核心阻断场景
测试要求
CI
新增或接入
m-ai-05-feynman-e2e,涉及以下路径时执行:src/modules/feynman/**、src/modules/ai-analysis/**、src/modules/ai-job/**、src/modules/review/**、src/modules/focus-item/**、src/worker.module.ts、test/m-ai-05-*。失败必须阻止 Deploy。非阻断 Hardening
以下不阻塞本批:Worker SIGKILL、多 Dispatcher 压测、大规模并发、长时间 Redis 中断、全部 Provider 错误组合。
影响范围
test/m-ai-05-*、src/modules/feynman/**、src/modules/ai-analysis/**、src/modules/ai-job/**、src/modules/review/**、src/modules/focus-item/**、CI 配置验收标准
m-ai-05-feynman-e2e实际执行并阻止失败部署建议执行顺序
第 7 个执行(依赖 05+06;核心场景可在 04 完成后先编写)
开发完成评论
完成内容
test/m-ai-05-feynman.e2e-spec.ts— Feynman 真实业务 E2E(~380 行).gitea/workflows/deploy.yml:test/m-ai-05、src/modules/review/、src/modules/focus-items/场景覆盖说明
feynman-evaluation,无 engineMode{jobId},无敏感字段feynman-evaluation(旧格式)图例:✅ E2E 覆盖 | 🔧 单元测试覆盖(需 Worker/Mock 执行 — 非阻断)
基础设施要求
AppModule+ 真实PrismaServicesupertest经过真实 HTTP 层(不直接调用 Executor/Projector/插入 AiJob)修改文件
test/m-ai-05-feynman.e2e-spec.ts(新增,~380 行).gitea/workflows/deploy.yml(修改,+1 行:CI 路径检测扩展)代码证据
m-ai-05-feynman.e2e-spec.ts:36-56—checkInfra()(真实 MySQL/Redis 端口检测,失败→hard fail)m-ai-05-feynman.e2e-spec.ts:164-197— 场景 2(Unified 完整链路:Job + Snapshot + Outbox + 敏感字段扫描 + payload 最小化)m-ai-05-feynman.e2e-spec.ts:222-248— 场景 3(幂等:相同输入→相同 jobId,Job/Snapshot 计数验证)m-ai-05-feynman.e2e-spec.ts:310-334— 场景 13(回滚:FeatureFlag off→Legacy 链路,jobType 旧格式验证)测试情况
npx jest --config test/jest-e2e.json --testPathPatterns="m-ai-05"CI 集成
test/m-ai-05src/modules/ai-analysis/、src/modules/ai-job/、src/modules/review/、src/modules/focus-items/的变更触发 integration testsneeds: [current-integration, backward-compat])未完成 / 风险
是否建议进入 Review