feat(ssa): Complete Phase 2A frontend integration - multi-step workflow end-to-end

Phase 2A: WorkflowPlannerService, WorkflowExecutorService, Python data quality, 6 bug fixes, DescriptiveResultView, multi-step R code/Word export, MVP UI reuse. V11 UI: Gemini-style, multi-task, single-page scroll, Word export. Architecture: Block-based rendering consensus (4 block types). New R tools: chi_square, correlation, descriptive, logistic_binary, mann_whitney, t_test_paired. Docs: dev summary, block-based plan, status updates, task list v2.0.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-20 23:09:27 +08:00
parent 23b422f758
commit 428a22adf2
62 changed files with 15416 additions and 299 deletions

View File

@@ -2153,12 +2153,14 @@ model SsaSession {
dataSchema Json? @map("data_schema") /// 数据结构LLM可见
dataPayload Json? @map("data_payload") /// 真实数据仅R可见
dataOssKey String? @map("data_oss_key") /// OSS 存储 key大数据
dataProfile Json? @map("data_profile") /// 🆕 Python 生成的 DataProfilePhase 2A
status String @default("active") /// active | consult | completed | error
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
messages SsaMessage[]
executionLogs SsaExecutionLog[]
workflows SsaWorkflow[] /// 🆕 多步骤流程Phase 2A
@@index([userId], map: "idx_ssa_session_user")
@@index([status], map: "idx_ssa_session_status")
@@ -2306,3 +2308,54 @@ model SsaInterpretation {
@@map("ssa_interpretation_templates")
@@schema("ssa_schema")
}
// ============================================================
// 🆕 Phase 2A 新增:多步骤流程管理
// ============================================================
/// SSA 多步骤流程
model SsaWorkflow {
id String @id @default(uuid())
sessionId String @map("session_id")
messageId String? @map("message_id") /// 关联的计划消息
status String @default("pending") /// pending | running | completed | partial | error
totalSteps Int @map("total_steps")
completedSteps Int @default(0) @map("completed_steps")
workflowPlan Json @map("workflow_plan") /// 原始计划 JSON
reasoning String? @db.Text /// LLM 规划理由
createdAt DateTime @default(now()) @map("created_at")
startedAt DateTime? @map("started_at")
completedAt DateTime? @map("completed_at")
session SsaSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
steps SsaWorkflowStep[]
@@index([sessionId], map: "idx_ssa_workflow_session")
@@index([status], map: "idx_ssa_workflow_status")
@@map("ssa_workflows")
@@schema("ssa_schema")
}
/// SSA 流程步骤
model SsaWorkflowStep {
id String @id @default(uuid())
workflowId String @map("workflow_id")
stepOrder Int @map("step_order") /// 步骤顺序1, 2, 3...
toolCode String @map("tool_code")
toolName String @map("tool_name")
status String @default("pending") /// pending | running | success | warning | error | skipped
inputParams Json? @map("input_params") /// 输入参数
guardrailChecks Json? @map("guardrail_checks") /// JIT 护栏检验结果
outputResult Json? @map("output_result") /// 执行结果
errorInfo Json? @map("error_info") /// 错误信息
executionMs Int? @map("execution_ms") /// 执行耗时(毫秒)
startedAt DateTime? @map("started_at")
completedAt DateTime? @map("completed_at")
workflow SsaWorkflow @relation(fields: [workflowId], references: [id], onDelete: Cascade)
@@index([workflowId], map: "idx_ssa_workflow_step_workflow")
@@index([status], map: "idx_ssa_workflow_step_status")
@@map("ssa_workflow_steps")
@@schema("ssa_schema")
}