diff --git a/docs/todo.md b/docs/todo.md index 414f26d..7c7865c 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -51,6 +51,30 @@ - [x] AR-10 ~~想法→灵感迁移残留~~ ✅ 已统一(13 文件批量:i18n zh-CN + 后端错误 + LLM 描述/提示词 + store toast;en 待定 Ideas/Idea、docs 注释低优先略)(commit 65c475b) - [ ] AR-11 数据变更联动刷新(推荐方案A 后端 emit + store 监听)— 跨层 — 详见 [审查第五章](./02-架构设计/aichat-review-2026-06-14.md) +### 🟣 全栈审查待修项(2026-06-14) + +> 5 代理并行审查 Rust+Tauri+Vue 全栈(~25k 行)产出,详见 [fullstack-review-2026-06-14.md](./05-代码审查/fullstack-review-2026-06-14.md)。已去重:条件引擎/路径 canonicalize/localStorage 已在本看板他处记录;`do_promote` 误判已澄清(IPC 层真建项目,crate 留 TODO)。 + +**P0 — 安全** +- [ ] FR-S1 api_key 明文三连(DB 明文落盘 + IPC 传明文 + 前端仅 mask)— migrations.rs:445 / commands.rs:299 / Settings.vue:53 — 建议 OS keychain(`keyring` crate)+ list 返回 mask 占位 +- [ ] FR-S2 read_file TOCTOU(检查/读取两 syscall 间 symlink 替换破 1MB 限)+ write_file 无大小限制 — tool_registry.rs:364-417 — 单次 File::open 取 metadata+read;write 加 1MB 上限 +- [ ] FR-S3 approve_human_approval decision 无白名单校验,传 `""`/`"yes"` 可卡死 HumanNode — workflow.rs:185 — 命令层校验 ∈ {approved,rejected} + +**P1 — 体验/竞态** +- [ ] FR-R1 switchConversation 无切换 token,快速连点 A→B 网络乱序致 activeId 与 messages 错配 — useAiConversations.ts:44 — 加 latestSwitchId 丢弃过期响应 +- [ ] FR-R2 全局单看门狗 timer 主/分离窗口互踩,审批态被分离窗口 delta 误触发 130s 超时 — useAiStream.ts:18 — 按 convId 维护 Map +- [x] FR-C1 ~~formattedEvents 时间漂移~~ ✅ 事件入数组固 _ts(project.ts push + ProjectDetail 用 _ts)(commit cf18678) +- [x] FR-C2 ~~net_sentiment 矛盾~~ ✅ 统一三档(模板>0/<0/===0 + sentimentClass 同源 + i18n neutral)(commit cf18678) + +**P2 — 其余(见审查报告 §2-6)** +- [ ] FR-S4 SKILL.md 全文注入 system prompt 缺隔离标注 — commands.rs:67 +- [ ] FR-S5 ai_approve 跨对话越权(只按 tool_call_id 不校验对话归属)— audit.rs:111 +- [ ] FR-R4 complete() 同步路径无超时无重试,远端静默挂死整轮对话 — openai_compat.rs:230 +- [x] FR-C3 ~~Settings timer 泄漏~~ ✅ onUnmounted 清全部三个 timer(commit cf18678) +- [x] FR-C4 ~~MIGRATION_VERSION 死常量~~ ✅ 删(零代码引用,run() if 链自管版本)(commit cf18678) +- [x] FR-C5 ~~AiConversationDetail 缺 readonly~~ ✅ 加 readonly?: boolean(commit cf18678) +- [ ] FR-P1~P6 / FR-D1~D5 性能+重构项(dag O(V·E)、search_vector SELECT *、单连接 Mutex、findToolCall O(n)、confirmDialog 4 处重复、migrations if 链)— 见报告 §5-6 + ### 🟡 B-03b 复核后续(独立深度复核,2026-06-14) > B-03b 端到端补完(commit 4aa689e)后独立复核发现 2 加重 + 3 低优。**①为真实 bug**:取消链 IPC→set_cancelled→HumanNode is_cancelled→Err 通了,但 HumanNode 返 Err 后 executor run:115 `set_failed` 走 transition,而 Cancelled 不在 `is_legal` 转换图 → bail → 工作流因状态转换错误异常终止(非优雅标记取消)。补完时只验 IPC→HumanNode 链,漏验 HumanNode→executor Err 处理。 @@ -61,7 +85,7 @@ - [x] B-03b-R4 — **[评估维持]** set_* 改 &self 后调用方 &mut — &self 是放宽,&mut self 上下文调 &self 无害,清理为可选优化不影响正确性 - [x] B-03b-R5 — **[评估维持]** `lock().expect()` poison panic — poison=持锁 panic 严重错误,fail-fast 合理,非用户态可恢复 - [x] B-03b-R6 ~~human_node send 缺 await~~ ✅ 已修(human_node.rs:41 加 .await;async fn send 的 Future 不再被 let _ = 丢弃,Request 真进 channel)(commit 0bb96fc) -- [x] B-03b-R7 ~~前端契约失配~~ ✅ 已修(project.ts:214 type→snake_case + :215 取 event 本体扁平字段 + as unknown as 绕过联合类型)(commit 0bb96fc);**遗留**:types.ts event.type 收窄字面量联合(防再写错 type 字符串,报告 §4 第3项)待补 +- [x] B-03b-R7 ~~前端契约失配~~ ✅ 已修(project.ts:214 type→snake_case + :215 取 event 本体扁平字段 + as unknown as 绕过联合类型)(commit 0bb96fc);types.ts event.type 收窄字面量联合(WorkflowEventType 11 变体)已补(commit 3e1f119 Wave5) - [ ] B-03b-R8 — **[P0 根因]** 缺 human 节点端到端集成测试(前端无 human DAG 入口,demoDag 仅 script),单测绿但不覆盖 human→弹窗→审批→返回链路,是 R6/R7 存活土壤 - [ ] B-03b-R9 — **[P2]** 其余 8 项对抗裁定(③串扰/④单槽/⑤终态不清/⑥set_cancelled覆盖终态/⑦互斥/⑧approve不校验/⑨⑩Lagged/⑪failed_node空)多数潜伏或零危害,详见 [审查报告 §2](./02-架构设计/workflow-approval-review-2026-06-14.md)