Files
JARVIS/development-doc/plan/today-status-update/phase-ts-0-current-state.md

145 lines
3.7 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.
# Phase TS-0当前现状与目标
日期2026-04-08
状态:待实施
---
## 1. 阶段目标
先把当前代码里的真实能力、mock 能力、缺口和目标架构写清楚,避免后续实现直接在错误抽象上继续堆功能。
本阶段不改业务代码,重点是:
- 盘点真实数据流
- 盘点 mock 边界
- 明确业务 task 与 commander runtime task 的边界
- 输出目标三层架构
---
## 2. 当前代码现状
### 2.1 Chat 首页 Today Status
当前文件:
- `frontend/src/pages/chat/composables/useSidebarPlan.ts`
- `frontend/src/pages/chat/index.vue`
已真实存在的能力:
- `useSidebarPlan.ts` 已通过 `scheduleCenterApi.date()``scheduleCenterApi.month()` 加载真实数据
- `todayPlanCounters` 已基于真实 `todos / tasks / reminders / goals` 聚合统计
- Chat 首页已能打开 Today Status 抽屉
当前缺口:
- `sidebarFocusItems` 仍强制返回 `mockFocusItems`
- Today Status 的重点区、四象限、详情编辑并未接真实任务模型
### 2.2 Kanban UI
当前文件:
- `frontend/src/components/chat/KanbanPanel.vue`
- `frontend/src/components/chat/KanbanDetail.vue`
当前状态:
- `KanbanPanel.vue` 的四象限任务列表完全硬编码
- `KanbanDetail.vue` 的 task / subtasks / comments / history / assignee 都是本地 mock
- 子任务拖拽、完成状态、评论等均未持久化
### 2.3 业务任务模型
当前文件:
- `backend/app/models/task.py`
- `backend/app/routers/task.py`
- `frontend/src/api/task.ts`
当前状态:
- 只有基础 `Task`
- 只有简单 CRUD
- 没有业务级 `SubTask`
- 没有 `assignee` / `quadrant` / `conversation_id` / `dispatch_status`
### 2.4 Schedule Center
当前文件:
- `backend/app/routers/schedule_center.py`
- `frontend/src/pages/schedule-center/composables/useScheduleCenterPage.ts`
当前状态:
- 已经是当前最真实的日程聚合入口
- 已支持 todo / task / reminder / goal 的真实新增与刷新
-`date` 聚合结果还不够直接支撑 Today Status 四象限与 commander 状态
### 2.5 Commander / Agent runtime
当前文件:
- `backend/app/agents/schemas/task.py`
- `backend/app/routers/agent.py`
当前状态:
- runtime 中已有 `owner_agent_id / parent_task_id / child_task_ids` 等执行态字段
- 更适合做执行态拓扑和可视化
- 不适合直接作为业务 Task / SubTask 主模型
---
## 3. 目标架构
建议采用三层结构:
### 3.1 业务任务层
面向用户的长期任务实体:
- Task
- TaskSubTask
- assignee
- quadrant
- source
- conversation_id
- dispatch 状态
### 3.2 调度聚合层
通过 `schedule-center` 提供:
- 今日统计
- focus tasks
- quadrants
- commander summary
### 3.3 执行层
保留现有 commander / runtime
- 接收业务任务派发
- 内部做 task graph 执行
- 把状态回写业务 task/subtask
---
## 4. 核心文件清单
| 文件 | 操作 | 说明 |
|------|------|------|
| `frontend/src/pages/chat/composables/useSidebarPlan.ts` | 盘点 | 真实统计 + mock focus 边界 |
| `frontend/src/components/chat/KanbanPanel.vue` | 盘点 | 四象限 mock |
| `frontend/src/components/chat/KanbanDetail.vue` | 盘点 | 详情页 mock |
| `backend/app/models/task.py` | 盘点 | Task 字段缺口 |
| `backend/app/routers/task.py` | 盘点 | 仅简单 CRUD |
| `backend/app/routers/schedule_center.py` | 盘点 | 聚合能力现状 |
---
## 5. 验收标准
- [ ] 明确 Today Status 中哪些数据是真实的
- [ ] 明确哪些能力仍是 mock
- [ ] 明确业务 task 与 runtime task 的边界
- [ ] 给出业务层 / 聚合层 / 执行层三层架构
---
## 6. 依赖关系
```text
本阶段 → Phase TS-1
→ Phase TS-2
→ Phase TS-3
```
本阶段是后续所有实现文档的共识基础。