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:
@@ -1,8 +1,8 @@
|
||||
# SSA-Pro R 服务开发指南
|
||||
|
||||
> **文档版本:** v1.5
|
||||
> **文档版本:** v1.6
|
||||
> **创建日期:** 2026-02-18
|
||||
> **最后更新:** 2026-02-18(纳入专家配置体系 + 统一入口函数)
|
||||
> **最后更新:** 2026-02-20(纳入智能化演进共识 + 错误捕获管道设计)
|
||||
> **目标读者:** R 统计工程师
|
||||
|
||||
---
|
||||
@@ -237,6 +237,50 @@ function(req, tool_code) {
|
||||
|
||||
## 4. 错误码定义
|
||||
|
||||
### 🆕 4.0 错误捕获管道设计(为 Phase 3 靶向修改铺路)
|
||||
|
||||
> **重要**:结构化的错误捕获是 Phase 3 "靶向代码修改"能力的基础。
|
||||
>
|
||||
> 详细背景参考:`04-开发计划/06-智能化演进共识与MVP执行计划.md`
|
||||
|
||||
**Phase 3 的工作流程:**
|
||||
```
|
||||
工具执行报错 → 错误捕获管道 → 结构化 JSON → 反馈给 LLM → LLM 靶向修改代码
|
||||
```
|
||||
|
||||
**错误 JSON 结构要求(便于 LLM 理解):**
|
||||
```json
|
||||
{
|
||||
"status": "error",
|
||||
"error_code": "E002",
|
||||
"error_type": "business",
|
||||
"message": "列 'blood_pressure' 类型应为 numeric,实际为 character",
|
||||
"user_hint": "该列包含非数值数据,请检查数据格式",
|
||||
"context": {
|
||||
"tool_code": "ST_T_TEST_IND",
|
||||
"problematic_column": "blood_pressure",
|
||||
"expected_type": "numeric",
|
||||
"actual_type": "character",
|
||||
"sample_values": ["120", "130", "未知", "125"],
|
||||
"line_number": 45
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**关键字段说明:**
|
||||
|
||||
| 字段 | MVP 用途 | Phase 3 用途 |
|
||||
|------|---------|-------------|
|
||||
| `error_code` | 日志分类 | LLM 识别错误类型 |
|
||||
| `error_type` | 区分业务/系统错误 | LLM 判断是否可自愈 |
|
||||
| `message` | 开发调试 | LLM 理解错误原因 |
|
||||
| `user_hint` | 前端展示 | 保留 |
|
||||
| `context` | 🆕 可选 | LLM 靶向修改的关键信息 |
|
||||
|
||||
> **MVP 阶段行动**:错误响应中尽量包含 `context` 信息,为 Phase 3 积累"黄金数据集"。
|
||||
|
||||
---
|
||||
|
||||
```r
|
||||
# utils/error_codes.R
|
||||
# 📌 结构化错误码,便于 LLM 自愈
|
||||
|
||||
Reference in New Issue
Block a user