140 lines
6.4 KiB
Markdown
140 lines
6.4 KiB
Markdown
---
|
||
name: unidesk-decision
|
||
description: UniDesk Decision Center 与秘书日程入口。用户说“你是我的秘书”“现在你是我的秘书”“秘书”“开始/继续今天的日程安排”“安排今天”“帮我排日程”,或提到提醒、待办、进展反馈、decision、决策中心、会议记录、工作日记、requirement 需求记录时立即使用。
|
||
---
|
||
|
||
# UniDesk Decision Center CLI
|
||
|
||
通过 `bun scripts/cli.ts decision ...` 管理 NC01 k8s Decision Center 的会议记录、决议和工作日记。当前生产运行面是 NC01 `unidesk/decision-center`,持久存储为 GitHub repo `pikasTech/decision-center-data`,PostgreSQL 只作为运行索引/cache。
|
||
|
||
**固定入口前缀**: `cd /root/unidesk && bun scripts/cli.ts decision ...`
|
||
|
||
---
|
||
|
||
## 决策面与执行面边界
|
||
|
||
- 主代理在秘书和顶级决策场景中负责决策面。
|
||
- 正式战略、方向选择、优先级、范围取舍、阶段门槛和管理原则写入 Decision Center。
|
||
- 决策驱动的提醒、跟踪项、等待项和管理待办写入 Todo Notes。
|
||
- Todo Notes 条目应直接引用对应 Decision Center 文号,例如 `DC-DCSN-P0-2026-006`。
|
||
- TaskTree 属于项目执行面,不属于秘书或顶级决策的默认写入目标。
|
||
- 只有任务已经明确到项目 workspace、TaskGroup/Task 层级、实施动作和交付验收时,才通过 `$unidesk-tasktree` 写入 TaskTree。
|
||
- 战略分析、方向决策、内测原则、跨项目优先级和仅需持续跟踪的事项不得写入 TaskTree。
|
||
- Decision Center 文号可以被既有执行任务引用,但主代理不得仅因产生了决策就自动新建 Task。
|
||
- 用户要求“记录决策并建立待办”但未明确要求执行面任务时,固定顺序如下:
|
||
1. 在 Decision Center 创建或更新正式决策文书。
|
||
2. 在对应 Todo Notes 清单新增或更新管理待办,并引用决策文号。
|
||
3. 只有用户进一步指定项目实施任务时,才进入 TaskTree。
|
||
- 发现决策面事项误写入 TaskTree 时,必须立即纠正。
|
||
- 使用 `$unidesk-tasktree` 删除误建任务。
|
||
- 保留 Decision Center 文书。
|
||
- 将对应事项写入 Todo Notes,并复核文号可见。
|
||
- 若误写已经提交,精确提交并推送撤销,不得夹带工作区其他并行修改。
|
||
- 遗留 MDTODO 的处理统一遵循 `$unidesk-tasktree`。
|
||
|
||
---
|
||
|
||
## 秘书触发
|
||
|
||
命中“你是我的秘书”、日程安排、提醒、待办或进展反馈后,必须在继续对话前立即加载 `docs/reference/secretary-reference.md`,不能先凭上下文给出排程。
|
||
|
||
秘书入口固定顺序:
|
||
|
||
1. 用 `TZ='Asia/Shanghai' date '+%Y-%m-%d %H:%M:%S %Z'` 拉取最新北京时间。
|
||
2. 用 `unidesk todo-note list` / `unidesk todo-note show <列表>` 读取 Todo Note 当前清单,再读取 Decision Center 最近工作日记;日记只读,不代替 Todo Note。
|
||
3. 根据硬约束和最新记录给出当前动作、时间盒、反馈格式。
|
||
4. 用户反馈后,先同步 Todo Note,再滚动安排下一段。
|
||
|
||
若任一 CLI、frontend、backend-core、Todo Note 或 Decision Center 请求失败,先调查并修复工具/服务,完成原入口复测后再回到日程;不得跳过故障继续凭印象排程,也不得用 Decision diary 绕过 Todo Note 写入故障。
|
||
|
||
Todo Note 日常维护固定使用资源命令,不手写 `/api/...` 或 JSON body:
|
||
|
||
```bash
|
||
unidesk todo-note list
|
||
unidesk todo-note show 大论文
|
||
unidesk todo-note add 大论文 --title "跟踪外审意见"
|
||
unidesk todo-note update 大论文 <todo-id> --title "新标题"
|
||
unidesk todo-note complete 大论文 <todo-id>
|
||
unidesk todo-note remind 大论文 <todo-id> --at 2026-07-31T18:00:00+08:00
|
||
```
|
||
|
||
`complete/reopen` 是幂等资源命令:遇到上游代理 `502/503/504` 时,CLI 会先读取实际 todo 状态,未达到目标状态才重试一次,并在第二次异常后做最终复核。`add` 等可能重复创建资源的命令不做盲重试。
|
||
|
||
---
|
||
|
||
## 记录管理
|
||
|
||
### 上传/列表/查看/健康
|
||
|
||
```bash
|
||
bun scripts/cli.ts decision upload <markdown-file>
|
||
bun scripts/cli.ts decision list [--include-body]
|
||
bun scripts/cli.ts decision show <id|docNo>
|
||
bun scripts/cli.ts decision health
|
||
```
|
||
|
||
`list` 默认只返回摘要,不包含完整 Markdown body。需要正文时加 `--include-body`。
|
||
|
||
大列表会返回 bounded 摘要和 `totalReturned`,避免跨 NC01 SSH/k8s 入口时被输出预算截断;需要单条完整正文时优先用 `show` 或 diary `show` 精确读取。
|
||
|
||
### 文书字段
|
||
|
||
```bash
|
||
--doc-no DC-... # 文档编号
|
||
--doc-type DCSN|GOAL|PLAN|RPRT|ACTN|ISSU|RETR|RQST|RESP|MINS
|
||
--doc-priority P0|P1|P2|P3
|
||
--year YYYY
|
||
--signer # 签署人
|
||
--issued-at # 签发日期
|
||
--effective-scope # 生效范围
|
||
--supersedes # 取代
|
||
--superseded-by # 被取代
|
||
```
|
||
|
||
`show` 和 `requirement update` 可使用 `id` 或 `docNo`。
|
||
|
||
---
|
||
|
||
## 需求记录
|
||
|
||
```bash
|
||
bun scripts/cli.ts decision requirement list
|
||
bun scripts/cli.ts decision requirement create --doc-type GOAL --doc-priority P1 --year 2026 --summary "目标摘要"
|
||
bun scripts/cli.ts decision requirement upsert --doc-no DC-GOAL-2026-001 --doc-type GOAL --summary "更新摘要"
|
||
bun scripts/cli.ts decision requirement update <id|docNo> --field ...
|
||
bun scripts/cli.ts decision requirement show <id|docNo>
|
||
```
|
||
|
||
管理 `goal|decision|blocker|debt|experiment` 需求记录。`docNo` 唯一,未传 `--doc-no` 但提供 `--doc-type/--doc-priority/--year` 时由服务分配下一个序号。
|
||
|
||
---
|
||
|
||
## 工作日记
|
||
|
||
### 导入
|
||
|
||
```bash
|
||
bun scripts/cli.ts decision diary import <markdown-file>
|
||
```
|
||
|
||
将带 `# YYYY年M月D日`、`# YYYY-MM-DD` 或 `# YYYY/M/D` 标题的工作日志拆成每天一篇写入 PostgreSQL。
|
||
|
||
写入后服务会同步 GitHub repo 存储;迁移或修复后用 `decision health` 和服务侧 `/api/storage/verify` 同时确认 cache 与 repo index 计数一致。
|
||
|
||
### 列表/历史/查看
|
||
|
||
```bash
|
||
bun scripts/cli.ts decision diary list [--include-body]
|
||
bun scripts/cli.ts decision diary history [--include-body]
|
||
bun scripts/cli.ts decision diary show <YYYY-MM-DD|id> [--source-file path]
|
||
```
|
||
|
||
`--source-file` 用于同一天存在多个导入来源时精确选择。
|
||
|
||
### 编辑/新增
|
||
|
||
```bash
|
||
bun scripts/cli.ts decision diary edit <YYYY-MM-DD|id> --body-file <path> [--title text] [--source-file path] [--tag tag]
|
||
bun scripts/cli.ts decision diary upsert <YYYY-MM-DD|id> --body-file <path> [--title text] [--source-file path] [--tag tag]
|
||
```
|