Files
DevFlow/URGENT.md
绝尘 44d1c6a00c 优化: 文档路径同步 + 审查登记 + 消息级溯源设计文档
- PROGRESS/URGENT 文档分类后子目录路径修正
- 待审查.md 登记 CR-260619-08 intent + CR-260619-09 PhaseB+C(均  PASS)
- 新增消息级溯源设计(消息拆分存储 + 知识/审计/灵感全链路消息级定位)
2026-06-19 18:58:49 +08:00

87 lines
5.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🔴 加急待办清单
> ⚠️ **2026-06-14 快照,已停用(仅留历史)**
> 下述 5 个 P0AC3 / FR-S7 / FR-S8 / B-03b-R8 / FR-S1已全部迁入 `docs/todo.md` 并完成(均标记 `- [x] ✅`),后续跟踪请看 `docs/todo.md`。本文件不再维护,原文保留以备决策史追溯。
>
> 来源DevFlow 任务系统核对 + docs/todo.md2026-06-14 汇总
> 说明:仅收录 P0用户可感硬伤 / 数据安全 / 功能不可用)+ 关键 P1 项
---
## P0 — 必须优先修复
### 1. B-260614-AC3 历史中毒无自愈(对话永久卡死)
- **现象**:畸形 tool_use/tool_result 一旦入历史,用户重发 → `build_for_request` 带毒 → 服务端 500 → 永久死循环,用户「再也对话不了」
- **根因**`stream_recv.rs` 收 500 时只 `emit AiError + return None`,不清理毒历史;`agentic.rs` 直接 `return``ContextManager` 中毒消息原封不动
- **修法**`stream_llm` 收 500/格式错时,检测 `ContextManager` 最后一轮未闭合 tool 配对assistant 有 tool_call 但无对应 tool_result剔除该对或提供「修复当前对话」IPC 操作
- **涉及文件**`src-tauri/src/commands/ai/{stream_recv.rs, agentic.rs}``crates/df-ai/src/context.rs`
### 2. FR-S7 write_file 覆盖已有非空文件无确认/备份
- **现象**2026-06-14 实测事故——AI 误把 write_file 当 edit 用,只传头部 3 行把 PROGRESS.md 762 行/72KB 覆盖成 248 字节
- **根因**`tool_registry.rs` write_file handler 无目标文件存在性检测,直接覆盖
- **修法**:覆盖非空文件前自动备份 `.bak` 或检测目标存在强制走 edit_file写入后返回新旧大小对比差异巨大时 warn
- **涉及文件**`src-tauri/src/commands/ai/tool_registry.rs`
### 3. FR-S8 路径 sandbox 系统性逃逸
- **现象**`validate_path` 三处缺陷可被绕过AI 工具能读写 workspace 外文件
- **根因**:① 子串 `..` 检测对绝对路径无效 ② `canonicalize` 仅覆盖已存在路径write_file 新建漏) ③ Windows `starts_with` 大小写敏感
- **修法**:统一 canonicalize不存在取最长存在前缀+ 大小写不敏感 prefix 比较 + parent 校验 + symlink 不跟随
- **涉及文件**`src-tauri/src/commands/ai/tool_registry.rs:19-21,53-69`
### 4. B-03b-R8 缺 human 节点端到端集成测试
- **现象**:前端无 human DAG 入口demoDag 仅 script单测绿但不覆盖 human→弹窗→审批→返回链路
- **影响**:审批闭环的 R6/R7 类 bug 存活土壤,无测试兜底
- **修法**:前端加 human DAG 入口(测试用 DAG端到端验证 审批弹窗→通过/拒绝→工作流继续/取消
- **涉及文件**`src/views/ProjectDetail.vue``crates/df-nodes/src/human_node.rs`
### 5. FR-S1 api_key 明文落盘(剩余项)
- **现状**IPC mask 已修commit 49ac060前端不持明文。**剩余**DB `migrations.rs:446 api_key TEXT NOT NULL` 明文落盘
- **修法**:迁移 keyring 单列存储(`keyring` crateDB 不存原始 key
- **涉及文件**`crates/df-storage/src/migrations.rs``src-tauri/src/commands/ai/commands.rs`
---
## P1 — 重要,尽快处理
### 6. B-260614-AC1 anthropic_compat tool_use_id None 发 null
- **现象**`tool_call_id` 为 None 时序列化为 `"tool_use_id": null`,触发服务端 500
- **修法**None 时 skip 该 tool_result 块或填占位 id + warn
- **涉及文件**`crates/df-ai/src/anthropic_compat.rs:297`
### 7. AR-6 Low 工具失败语义冲突
- **现象**:工具执行失败时 emit AiError 置 `streaming=false` 但 agentic loop 续跑,残留文本 flush 又"完成",状态紊乱
- **涉及文件**`src-tauri/src/commands/ai/{audit.rs, agentic.rs:195}`
### 8. F-260614-01 模型能力系统 Phase 1
- **说明**设计已完成。ModelCapability 数据模型 + ModelRouter 重写 + 7 调用点接入 + Settings 模型池编辑 UI + AiChat 模型下拉
- **涉及文件**`crates/df-ai/``src-tauri/src/commands/ai/``src/views/Settings.vue``src/components/AiChat.vue`
### 9. F-260614-07 df-ai-core trait 下沉拆 crate架构前置
- **说明**:解锁 F-03灵感对抗评估接 LLM。统一为全局 AI trait 下沉独立 cratedf-ideas/df-nodes 依赖 trait 而非 df-ai 具体 impl
- **设计文档**`docs/02-架构设计/已编号方案/F-07-df-ai-core-trait下沉设计-2026-06-14.md`
### 10. T-260614-01 多项未 tauri dev 实测
- **说明**Sprint 9-18 积累的未实测项——评分 IPC / promote_idea / token 落库 / 知识库 Tier 1 全栈 / LLM 并发 Semaphore / 知识生命线
- **风险**:编译通过 ≠ 运行正确,多轮未实测积压隐患
### 11. T-260614-02 切对话不中断路由运行时实测
- **说明**Sprint 8 A 路线场景 2/3 部分场景未运行时验证
---
## 速查矩阵
| # | 编号 | 优先级 | 类型 | 一句话 |
|---|------|--------|------|--------|
| 1 | AC3 | P0 | Bug | 对话永久卡死,无自愈 |
| 2 | FR-S7 | P0 | 安全 | write_file 覆盖无备份 |
| 3 | FR-S8 | P0 | 安全 | 路径 sandbox 可逃逸 |
| 4 | B-03b-R8 | P0 | 测试 | 审批闭环无端到端测试 |
| 5 | FR-S1 | P0 | 安全 | api_key DB 明文落盘 |
| 6 | AC1 | P1 | Bug | tool_use_id null 触发 500 |
| 7 | AR-6 | P1 | Bug | 工具失败状态紊乱 |
| 8 | F-01 | P1 | 功能 | 模型能力系统 Phase 1 |
| 9 | F-07 | P1 | 架构 | df-ai-core trait 下沉 |
| 10 | T-01 | P1 | 验收 | 多项未 tauri dev 实测 |
| 11 | T-02 | P1 | 验收 | 切对话不中断实测 |