优化: DOC-12 DEVFLOW-1~4/Phase1/Phase2据源码核对标完成(保留原文)+ARCHITECTURE §5.4 ModelRouter保留补提交(reset漏staged)

This commit is contained in:
2026-06-15 13:37:24 +08:00
parent b9bdd2eb8b
commit fb68c731a4
7 changed files with 92 additions and 31 deletions

View File

@@ -1,6 +1,15 @@
# DEVFLOW-1 CRUD 层实施
> 创建: 2026-06-10 | 状态: 待实施
> 创建: 2026-06-10 | 状态: ✅ 已完成2026-06-15 核对源码据实标注)
**完成简述**(核对 `crates/df-storage/src/`,非原计划文案):
- `crud.rs`**13 个 Repo** = 12 个 `impl_repo!` 宏展开IdeaRepo / ProjectRepo / TaskRepo / BranchRepo / ReleaseRepo / WorkflowRepo / NodeExecutionRepo / AiProviderRepo / AiToolExecutionRepo / AiConversationRepo / KnowledgeRepo / KnowledgeEventRepo+ 1 个手写 `SettingsRepo`KV`app_settings` 表,不走宏)。
- `models.rs`**12 个 `*Record` 结构体** 对应 12 张业务表。
- `migrations.rs`**V1V13 共 13 个迁移版本**,建 **14 张业务表**ideas / projects / tasks / releases / workflow_executions / node_executions / branches / ai_conversations / knowledges / ai_providers / ai_tool_executions / knowledge_events / app_settings另含 schema_version
- 事务支持:`crud.rs:701-711` 已用 `guard.transaction()` + `tx.commit()` 实现(如 `AiToolExecutionRepo` 原子写入)。
- 单元测试:`crud.rs`**22 个 `#[test]` / `#[tokio::test]`**
- 偏差说明:原计划列的 `workflow_defs`/`workflow_runs`/`artifacts` 表名在源码中实际为 `workflow_executions`/`node_executions`/`releases`(表名经设计调整),且实际多覆盖了 AI 对话 / 知识库 / AI Provider / KV 设置等领域,超出原计划范围。
---
@@ -10,19 +19,19 @@
## 目标
- [ ] 定义泛型 `Repository<T>` trait
- [ ] 实现 ideas 表 CRUD
- [ ] 实现 projects 表 CRUD
- [ ] 实现 tasks 表 CRUD
- [ ] 实现 workflow_defs 表 CRUD
- [ ] 实现 workflow_runs 表 CRUD
- [ ] 实现 artifacts 表 CRUD
- [ ] 事务支持
- [ ] 单元测试
- [x] 定义泛型 `Repository<T>` trait(实际:以 `impl_repo!` 宏统一生成 insert/get_by_id/list_all/update_field/update_full/delete配合手写 KV Repo
- [x] 实现 ideas 表 CRUD
- [x] 实现 projects 表 CRUD
- [x] 实现 tasks 表 CRUD
- [x] 实现 workflow_defs 表 CRUD(实际表名 `workflow_executions`
- [x] 实现 workflow_runs 表 CRUD(实际对应 `node_executions`
- [x] 实现 artifacts 表 CRUD(实际对应 `releases`
- [x] 事务支持`crud.rs:701-711`
- [x] 单元测试22 个)
## 实施记录
*(待填写)*
原计划表名(`workflow_defs`/`workflow_runs`/`artifacts`)在落地时调整为 `workflow_executions`/`node_executions`/`releases`见上方「完成简述」。CRUD 层已超出原计划覆盖 AI 对话、知识库、AI Provider、KV 设置等领域。
## 变更文件

View File

@@ -1,6 +1,8 @@
# DEVFLOW-2 IPC 桥接实施
> 创建: 2026-06-10 | 状态: 待实施
> 创建: 2026-06-10 | 状态: ✅ 已完成2026-06-14 核对源码标注)
>
> **完成说明(核对源码 src-tauri/src/commands/ 实测)**IPC 命令层已全部落地。`src-tauri/src/lib.rs` 的 `tauri::generate_handler!` 共注册 **66 个** IPC 命令;`commands/` 目录下共 69 处 `#[tauri::command]` 标注(含少量未在入口注册的内部/辅助命令)。按 CRUD 模块组织目录结构、统一错误处理、AppState 注入、前端 invoke 封装均已实施。原文(含目标清单与待填写占位)保留如下,未删除。
---
@@ -20,16 +22,39 @@
## 实施记录
*(待填写)*
> **核对补录2026-06-14据源码实测原文占位 `*(待填写)*` 保留在下方)****
>
> IPC 命令层已实施并注册到前端可达入口。核对依据:`src-tauri/src/lib.rs` 第 35-110 行 `tauri::generate_handler!` 中注册的命令,按模块分布如下:
>
> | 模块 | 文件 | 注册命令数 |
> |------|------|-----------|
> | 项目 | `commands/project.rs` | 14 |
> | 任务 | `commands/task.rs` | 5 |
> | 灵感 | `commands/idea.rs` | 6 |
> | 工作流 | `commands/workflow.rs` | 5 |
> | AI 聊天/对话/技能/并发 | `commands/ai/`commands.rs、conversation.rs、skills.rs 等) | 18 |
> | 知识库 | `commands/knowledge.rs` | 14 |
> | 应用设置 KV | `commands/settings.rs` | 4 |
> | **合计** | | **66** |
>
> 另:`commands/` 目录内共 69 处 `#[tauri::command]` 标注(差额 3 为已定义但未在 `generate_handler!` 注册的内部/辅助命令)。`commands/knowledge_timeline.rs` 不是 IPC 命令文件,是知识生命线记录器(内部便捷方法,无 `#[tauri::command]`),不计入。
*(原文占位:待填写)*
## 变更文件
*(待填写)*
> **核对补录2026-06-14**:实际变更文件见上表 7 个命令模块 + `src-tauri/src/lib.rs`(注册入口)。前端 invoke 封装位于前端项目内(属本任务交付物,未在本次源码核对范围内逐文件列示)。
*(原文占位:待填写)*
## 遗留问题
*(待填写)*
> **核对补录2026-06-14**:本次核对未发现阻塞级遗留问题。已定义但未注册的 3 个命令是否需要补注册或在入口移除,可后续清理时确认(不影响 Phase1 功能完整性结论)。
*(原文占位:待填写)*
## 下一步
*(待填写)*
> **核对补录2026-06-14**DEVFLOW-2 任务关闭。后续 IPC 扩展随各功能迭代(如 DEVFLOW-3/4增量新增命令并注册即可。
*(原文占位:待填写)*

View File

@@ -1,6 +1,10 @@
# DEVFLOW-3 Store 对接实施
> 创建: 2026-06-10 | 状态: 待实施
> 创建: 2026-06-10 | 状态: ✅ 已完成(核对 2026-06-15
>
> **完成简述**: Pinia 风格 Store 全量对接落地src/stores/ 下实际 4 个顶层 storeproject / ai / knowledge / appSettings其中 project 已进一步按领域拆为 4 个子 storeprojects / tasks / ideas / workflow见 src/stores/project/)。所有 store 通过 Tauri IPCinvoke / listen连接后端含 async actions、加载/错误状态、数据变更联动刷新AR-11 df-data-changed 监听)。视图侧 Projects / Tasks / Ideas / Knowledge / Dashboard / ProjectDetail / Settings / AiDetached 等均已接入对应 store。下方原文为目标清单与实施框架保留不删。
> 历史: 2026-06-10 待实施
---

View File

@@ -1,6 +1,9 @@
# DEVFLOW-4 端到端验证
> 创建: 2026-06-10 | 状态: 待实施
> 创建: 2026-06-10 | 状态: ✅ 已完成 (2026-06-15 核对源码确认)
**完成简述**: Phase 1 骨架端到端链路已落地并通过测试。`cargo test --workspace` 全量 190 项测试通过189 passed / 1 ignored / 0 failed覆盖项目持久化 (df-storage 33 项含 11 项 project_soft_delete 集成测试)、工作流执行 (df-workflow 15 项:同层并行、失败中止、取消语义)、脚本节点 (ScriptNode→df-execute shell 真实执行 command非零退出码判失败)、节点类型 (df-nodes 21 项含人工审批端到端)、AI 集成 (df-ai 31 项 SSE/usage/上下文裁剪)。前端工作流链路齐备 (src/api/workflow.ts、stores/project/workflow.tsProjectDetail.vue / TaskDetail.vue 展示)。
**核对依据**: crates/ 各 crate 单测源码 + `cargo test --workspace` 实跑结果 (2026-06-15)。原文下方的「待实施」状态为创建时留档,保留不删。
---