dsh-workplan 1.5.2 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +180 -1
- package/README.en.md +20 -6
- package/README.md +20 -8
- package/client.js +196 -29
- package/lib/host.js +78 -6
- package/lib/plan.js +474 -11
- package/lib/runtime.js +619 -87
- package/package.json +1 -1
- package/src/client.ts +193 -32
- package/src/host.ts +81 -5
- package/src/plan.ts +476 -11
- package/src/runtime.ts +608 -83
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,153 @@
|
|
|
1
|
+
## 1.7.0 — 2026-10-30
|
|
2
|
+
|
|
3
|
+
**「协作契约」版:让主 Agent 与各部门在全程共享同一份事实。**
|
|
4
|
+
|
|
5
|
+
1.6.0 的协作审查([docs/review-collaboration-20261030.md](docs/review-collaboration-20261030.md),17 条断点 C1–C17)
|
|
6
|
+
暴露了同一个根因:**派出去的部门与主 Agent 之间没有可核对的契约**。派发期间主 Agent 全盲;
|
|
7
|
+
子 Agent 交回任何非空文本就算完成;依赖只看状态不看产物;主 Agent 的改判会被子 Agent 的结算覆盖,
|
|
8
|
+
也活不过一次刷新。本版把「谁在做什么、凭什么算做完、改判以谁为准」收敛成代码里唯一的判定表。
|
|
9
|
+
|
|
10
|
+
### 新增
|
|
11
|
+
|
|
12
|
+
- **结构化结果契约**(`src/plan.ts#adjudicateResult`、`#parseEvidenceBlock`):子 Agent 在输出末尾回传
|
|
13
|
+
`WORKPLAN_EVIDENCE` 块,含 `status` / `blockedReason` / `acceptance[]` / `artifacts[]` / `needs[]`。
|
|
14
|
+
八种情形写死在 `adjudicateResult`:`blocked` / `partial` → 受阻;任一验收 `fail` → 受阻(`failed`);
|
|
15
|
+
全 `pass` → 完成(`structured`);含 `unverified` → 完成但标 `unverified`;无块但首行 `BLOCKED:` → 旧格式受阻;
|
|
16
|
+
坏块 → 受阻(`unparsable`)。只有 `structured` 可直接采信,其余在结果消息「验收核对」段逐项列出,交给主 Agent 复核。
|
|
17
|
+
- **异步派发与只读观测**:`dsh_workplan_dispatch` 新增 `mode: "wait" | "async"`(默认 `wait`)。`async` 立即返回
|
|
18
|
+
`running: true` 与实时状态,本轮结束时仍自动写入 durable 结果消息;新增只读工具 `dsh_workplan_status`,
|
|
19
|
+
可从会话记录重建计划,刷新或重启后也能回答「做到哪了」。`wait` 遇到进行中的派发会**汇合**(`joined: true`)
|
|
20
|
+
并返回完整结果,不再只回一个 `alreadyRunning: true`。
|
|
21
|
+
- **写保护**:`dsh_workplan_update` 新增 `expectedRevision` 与 `force`。基于旧快照的写入返回 `STALE_WRITE`;
|
|
22
|
+
计划执行中改判运行中的子任务返回 `TASK_RUNNING`(`force: true` 才覆盖,并记录为人工改判)。每次写入递增
|
|
23
|
+
`revision`,人工改判以 durable `workplan-update` 消息落盘,刷新后仍然生效。
|
|
24
|
+
- **产物门禁**:结算时逐个核实子 Agent 声明的 `file` 产物,缺失的记入 `missingArtifacts`;依赖它的下游不解锁,
|
|
25
|
+
受阻文案点名上游 `T1「标题」`、原因与缺失文件。可用 `artifactGate: false` 关闭(排障/旧计划回放)。
|
|
26
|
+
- **跨部门 brief 与 needs 转达**:子 Agent 提示词带上「兄弟部门进展」(谁、做什么、产出什么、已完成摘要),
|
|
27
|
+
并明确「需要协作请写进 needs,由主 Agent 转达」;结果消息新增「跨部门待转达」段,要求逐条处理。
|
|
28
|
+
- **重试回灌**:重试只发生一次且规则确定——硬超时/中止/预算到点不重试,停滞或未完成且剩余时间足够才重试;
|
|
29
|
+
第二次尝试的提示词带上一次的 `code` 与原因,不再原样重撞同一堵墙。
|
|
30
|
+
- **时间预算预估**:规划器必须为每个子任务写 `estimateMinutes`,计划卡提示本轮预算是否够用。
|
|
31
|
+
|
|
32
|
+
### 修正
|
|
33
|
+
|
|
34
|
+
- 子 Agent 输出不再被二次截断:背景由「计划时刻采样并截断到 5000 字」改为派发前 `recentConversation` 的 7000 字,
|
|
35
|
+
`buildChildPrompt` 直接使用入参。
|
|
36
|
+
- 依赖受阻文案从「依赖未完成或上游受阻」改为带上上游标题、原因与缺失产物。
|
|
37
|
+
- 结构化证据块解析失败不再默认完成,而是显式 `blocked/unparsable`。
|
|
38
|
+
|
|
39
|
+
### 兼容与迁移
|
|
40
|
+
|
|
41
|
+
- 旧会话无需迁移:没有结构化块的旧结果按 `legacy` 读作「完成但未验证」,结果消息会提示主 Agent 复核;
|
|
42
|
+
`strict: false` 保留 1.6.0 的判定,供旧计划回放使用。
|
|
43
|
+
- `update` 原有参数与语义不变,新增参数全部可选。
|
|
44
|
+
- `PLAN_VERSION` 仍为 1;旧计划消息可原样回放。
|
|
45
|
+
|
|
46
|
+
### 文档
|
|
47
|
+
|
|
48
|
+
- 新增[协作契约](docs/collaboration.md)(角色、数据契约、状态机、失败恢复、写者所有权)与
|
|
49
|
+
[部门职责与交接约定](docs/departments.md);新增 [RELEASING.md](RELEASING.md) 发布清单;
|
|
50
|
+
更新中英文 README 至 1.7.0 并去掉过期的测试数字硬编码。
|
|
51
|
+
|
|
52
|
+
### 验收
|
|
53
|
+
|
|
54
|
+
- `npm test` 179 个用例全绿;新增 7 个测试文件,覆盖证据契约、派发模式、写保护、产物门禁、
|
|
55
|
+
跨部门 brief、重试回灌与 host 工具 schema;`npm run check` 通过。
|
|
56
|
+
- 原计划的 1.6.1(纯文档修复)已并入本版,不再单独发号。
|
|
57
|
+
|
|
58
|
+
## 1.6.0 — 2026-10-29
|
|
59
|
+
|
|
60
|
+
**「会话终止」收敛版**。用户截图圈出 `session-7129faea-d4bd-4ed5-a081-769496e07ceb`:
|
|
61
|
+
这一轮对话早就结束了(没有任何东西在跑),面板红圈的分组仍写着**「进行中」**,卡片还停在
|
|
62
|
+
「预算用完,可续跑」。本次让**宿主会话生命周期**成为「到底有没有在跑」的唯一事实源,并把
|
|
63
|
+
该结论落成新的独立阶段 `ended` / 独立分组「已结束」,同时修掉回放路径上把失败写入计为完成的
|
|
64
|
+
第二个打架点。
|
|
65
|
+
|
|
66
|
+
### 事故与根因
|
|
67
|
+
|
|
68
|
+
事故会话的关键事实(来自会话日志回放):
|
|
69
|
+
|
|
70
|
+
1. 插件**只订阅 `agent/pre-step`**(`src/host.ts:286`),`turn/end`、`session/event`、
|
|
71
|
+
`session/disposed` 一个都不消费 → **会话结束这件事对插件不可见**;
|
|
72
|
+
2. 计划阶段只由「派发动作」写入(`executing` / `paused` / `blocked` …),派发结束后
|
|
73
|
+
再没有任何代码把它改回来,于是阶段永久停在被最后一次派发写下的值;
|
|
74
|
+
3. 唯一存在的兜底只覆盖一种情形:**从未派发**且 `pending` 超过 10 分钟才改判 `cancelled`
|
|
75
|
+
(`src/runtime.ts` 的 `STALE_PENDING_MS` 分支),对「派发过、会话结束」完全无效;
|
|
76
|
+
4. 客户端把**除 done 以外的一切阶段**都塞进「进行中」组
|
|
77
|
+
(分组条件只有 `planPhaseOf(...) !== 'done'`)→ `paused` / `blocked` / `pending` /
|
|
78
|
+
`executing` / `degraded` 全部显示成「进行中」;
|
|
79
|
+
5. 回放路径 `reconstructFromSession` 见到 `dsh_workplan_update` 调用就 `applyStatus`,
|
|
80
|
+
**忽略宿主 `tool/result` 的 `message.isError`** → 该会话里一次失败的写入被记成完成
|
|
81
|
+
(面板显示 7/12,真实完成 6/12),刷新前后又一次「数据源打架」。
|
|
82
|
+
|
|
83
|
+
结论:这是**插件缺陷**,不是上游缺失——宿主侧 `turn/start` / `turn/end`(含
|
|
84
|
+
`aborted.reason.kind` 的 `user` / `parent` / `hook` / `disposed`)事件齐全且已落盘。
|
|
85
|
+
|
|
86
|
+
### 改动
|
|
87
|
+
|
|
88
|
+
- **`src/runtime.ts`**
|
|
89
|
+
- 新增并导出 `sessionTurnState(session)`:从会话日志末尾向前扫最近 200 条
|
|
90
|
+
(`TURN_BOUNDARY_SCAN`),先遇 `turn/start` ⇒ 这一轮还开着,先遇 `turn/end` ⇒
|
|
91
|
+
已结束并带出 `reason.kind` 与 `aborted` 子原因;扫不到 ⇒ `unknown`(**绝不猜**)。
|
|
92
|
+
读日志而不是加事件订阅:日志既是实时事实也是回放事实,实时与刷新后必然同源。
|
|
93
|
+
- `serialisePlan()`(实时与回放共用的唯一出口)在既有的过期 `pending` 兜底之后、
|
|
94
|
+
不变量自检之前收敛:`planPhase` 不是 `done` / `cancelled` 且这一轮已结束 ⇒
|
|
95
|
+
阶段改为 `ended`,原阶段写进 `suspendedPhase`,并附带 `endReason` /
|
|
96
|
+
`endReasonDetail` / `endedAt`。**`done` 不参与改写**(否则直接违反不变量 I8)。
|
|
97
|
+
- **`turn/end` 不等于「取消」或「完成」**:一轮结束后可以随时续跑,因此只把
|
|
98
|
+
「没有东西在跑」这件事表达出来,不动 `record.phase`——用户说「继续」、日志出现
|
|
99
|
+
新的 `turn/start` 后,下一份载荷自然回到原派发阶段,无反向迁移逻辑。
|
|
100
|
+
- 回放改为**先登记、后定案**:`tool/call` 只记 `callId → 参数`,等配对
|
|
101
|
+
`tool/result` 到达才采纳;`message.isError === true` 丢弃,无结果同样不采纳
|
|
102
|
+
(保守优先于乐观)。跨计划的迟到结果按 `planId` 拒绝,不污染新计划。
|
|
103
|
+
- **`src/client.ts`**
|
|
104
|
+
- 新增阶段 `ended`(中「已结束,可续跑」/ 英「Ended (resumable)」)与**第三个独立分组
|
|
105
|
+
「已结束」**,位置在「进行中」与「已完成」之间;分组、组头计数、卡片胶囊继续共用
|
|
106
|
+
`planPhaseOf` 单一结论。
|
|
107
|
+
- 新增 `phaseLabel()`:徽标两段式表达「终态 + 原阶段」(如
|
|
108
|
+
「已结束,可续跑 · 预算用完,可续跑」「已结束,可续跑 · 卡住了」),
|
|
109
|
+
不再用一个词暗示还在跑,也不丢「停在哪儿」这个关键信息。
|
|
110
|
+
- 「已结束」组保留「需处理」角标(判定用后端下发的 `suspendedPhase`),
|
|
111
|
+
组头按 `endedAt` 排序(最近结束在前);有进行中/已结束计划时「已完成」组默认收起。
|
|
112
|
+
- 图表口径随之改名:环图为「未结束 / 已完成」,柱图为「未结束计划的完成度」,
|
|
113
|
+
已结束但未完成的计划一并计入「未结束」。
|
|
114
|
+
- 新增 `.dsh-wp-group--ended` 样式:灰点、**不脉冲**——「没有东西在跑」不允许用动画表达。
|
|
115
|
+
- **版本**:`1.5.2 → 1.6.0`(minor)。载荷新增字段、客户端新增分组,属**向后兼容的对外
|
|
116
|
+
扩展**而非纯 bugfix:旧客户端读新载荷只会忽略 `ended` 相关字段并把计划当 `pending`,
|
|
117
|
+
不会崩溃,但**看不到「已结束」**,所以建议同步升级。
|
|
118
|
+
|
|
119
|
+
### 测试(新增 17 条,全部可复跑)
|
|
120
|
+
|
|
121
|
+
- `tests/session-end-convergence.test.ts`(12 条,后端/载荷级):正常结束、异常中断
|
|
122
|
+
(`aborted/user`)、进程级中断(`aborted/disposed`)、**正在跑不误判**、全部完成仍是
|
|
123
|
+
`done` 且无不变量违规、结束后说「继续」阶段回退、刷新幂等、双会话隔离、
|
|
124
|
+
扫描上限返回 `unknown`、回放只采纳成功写入(isError / 无结果 / 成功三态)。
|
|
125
|
+
- `tests/ended-group.test.ts`(5 条,渲染级):`ended` 计划只进「已结束」组、组名不再出现
|
|
126
|
+
「进行中」、徽标两段式、卡住的计划仍报「需处理」、无 `ended` 时不渲染空组、
|
|
127
|
+
「已完成」组折叠规则。
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
npm test # 137 tests / 137 pass / 0 fail
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 验证方式(任何人都可复跑)
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# 1) 完整回归(含本次新增的 17 条用例)
|
|
137
|
+
cd /Users/open/Documents/Stocks/plugins/dsh-workplan && npm test
|
|
138
|
+
# 2) 只跑本次的两个新用例文件
|
|
139
|
+
node --test dist-tests/tests/session-end-convergence.test.js dist-tests/tests/ended-group.test.js
|
|
140
|
+
# 3) 面板验收(人工):打开一个「已结束、未完成」的会话,
|
|
141
|
+
# 任务进度面板应把它放在「已结束」组,徽标写「已结束,可续跑 · …」;
|
|
142
|
+
# 说一句「继续」后,同一张卡应回到「进行中」。
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 兼容与升级
|
|
146
|
+
|
|
147
|
+
- 已装 1.5.x 的用户:升级后刷新页面即可,「已结束」组立即生效;
|
|
148
|
+
- 若面板在升级后仍显示「进行中」:先确认宿主版本已把 `turn/end` 落盘(1.6.0 依赖它,
|
|
149
|
+
未落盘时会保持原判定而不是误判),再确认浏览器已加载新 `client.js`。
|
|
150
|
+
|
|
1
151
|
## 1.5.2 — 2026-10-29
|
|
2
152
|
|
|
3
153
|
**「完成语义」统一版**。用户截图圈出一张 `14/14` 全部做完、环形进度 `100%` 的计划卡,
|
|
@@ -99,7 +249,36 @@
|
|
|
99
249
|
|
|
100
250
|
### 发布
|
|
101
251
|
|
|
102
|
-
-
|
|
252
|
+
- 两个渠道、同一份制品(2026-10-29 13:22–13:25 +08:00 实测,发布已完成):
|
|
253
|
+
- git:`https://github.com/abbaababa/dsh-workplan.git` 的 annotated tag `v1.5.2` → `666b0fe`;
|
|
254
|
+
- npm:公共 registry `https://registry.npmjs.org/dsh-workplan` 的 `1.5.2`(`dist-tags.latest`)。
|
|
255
|
+
- **状态**:
|
|
256
|
+
- `git push origin main` → `b0e0b76..666b0fe main -> main`(快进,exit 0);
|
|
257
|
+
- `git push origin v1.5.2` → `* [new tag] v1.5.2 -> v1.5.2`(exit 0);
|
|
258
|
+
- 远端复核(`git ls-remote`):`refs/heads/main` = `666b0fee483b…`,
|
|
259
|
+
`refs/tags/v1.5.2` = `155c601c73d7…` → `^{}` = `666b0fee483b…`;
|
|
260
|
+
- `npm publish ./dsh-workplan-1.5.2.tgz --access public --ignore-scripts`
|
|
261
|
+
(在 `git worktree add --detach /tmp/dsh-wp-1.5.2 v1.5.2` 的干净快照上先 `npm pack`,
|
|
262
|
+
再发布该 `.tgz`,22 个文件全部取自 tag 提交)→ `+ dsh-workplan@1.5.2`(exit 0);
|
|
263
|
+
- `https://registry.npmjs.org/dsh-workplan/1.5.2` → **HTTP 200**,
|
|
264
|
+
`time['1.5.2']` = `2026-10-29T05:24:48.346Z`(13:24:48 +08:00),`dist-tags.latest` = `1.5.2`;
|
|
265
|
+
- 消费者视角:空白目录 `npm i dsh-workplan@1.5.2` →
|
|
266
|
+
`meta = {"name":"dsh-workplan","version":"1.5.2",…}`(22 个文件)。
|
|
267
|
+
- **已发布制品的校验值**(registry 实测,与本地 `.tgz` 逐字节一致):
|
|
268
|
+
- npm `shasum`(SHA-1):`2159024d69c05b3aeeefd5e7ff2f208ec05c67a2`
|
|
269
|
+
- npm `integrity`(SHA-512 SRI):`sha512-sY7UgT09JwfRFe61HKCOCH7wLz0xbdAxyLla3WO8xoyZ/T6Yxb6H/IqRFf9LEX9EsnW7+z4jcHICms6RKPmTzQ==`
|
|
270
|
+
- 本地 `.tgz` SHA-256:`4482f202d098bbaec35051e54440d0d2be6e0099b6d6606e3c582b88e1aee9fa`
|
|
271
|
+
(269 264 字节,解包 888 135 字节,22 个文件)
|
|
272
|
+
- 发布顺序:先分支、后标签、再 npm,避免出现「远端有 tag 而 npm 没有」的半发布态。
|
|
273
|
+
- registry 传播延迟实测约 45 秒(直连 404×3 → 200)。
|
|
274
|
+
- **CI 说明**:tag 提交 `666b0fe` 的 verify 运行 `40823115340` 为 failure——20 个用例在
|
|
275
|
+
Node 22 上被 `cancelledByParent`(`Promise resolution is still pending but the event loop
|
|
276
|
+
has already resolved`),与 1.5.1 / 1.5.0 / 1.4.3 的推送运行失败原因完全相同(各 20 条),
|
|
277
|
+
属**既有 CI 缺陷**,与本次改动无关,也不影响制品(测试不入包)。根因是运行时把轮次预算/
|
|
278
|
+
空闲计时器 `unref` 掉后,Node 22 在事件循环清空时取消挂起的测试。已在
|
|
279
|
+
`9f0de34`(只改 `tests/` 两个文件,`git diff v1.5.2 -- . ':!tests' ':!docs' ':!scripts'` 为空)
|
|
280
|
+
用「测试期间持有一个 ref 句柄、`after` 钩子释放」修掉;对应运行 `40823694198` 全绿。
|
|
281
|
+
- 命令原文与发布后验证:见 `docs/release-record-1.5.2-20261029.md`。
|
|
103
282
|
|
|
104
283
|
### 回滚
|
|
105
284
|
|
package/README.en.md
CHANGED
|
@@ -20,6 +20,19 @@ For every new task with a real goal, the plugin inserts three beats:
|
|
|
20
20
|
|
|
21
21
|
Greetings, thanks, and status questions ("how far along are we?") do not trigger a plan.
|
|
22
22
|
|
|
23
|
+
## How departments collaborate (what 1.7.0 actually does)
|
|
24
|
+
|
|
25
|
+
Every work item carries a department label (Engineering, Research, Design, Product, Data, QA, Security, DevOps, Writing, Operations, Legal, Finance). **The label drives the prompt and the stats, not an org chart**:
|
|
26
|
+
|
|
27
|
+
- Departments **cannot talk to each other directly**. Cross-department information goes through the main agent, or through files both sides can read.
|
|
28
|
+
- A downstream task sees only the **summary** of its `dependsOn` upstreams — not sibling tasks, not the upstream's full conversation. Upstreams must put the artifact's absolute path and acceptance steps in the summary.
|
|
29
|
+
- A stage is a display grouping, **not an execution gate**; `dependsOn` decides order.
|
|
30
|
+
- Each child receives a **read-only brief of its sibling tasks** (who, what, expected outputs, summaries of finished work). It cannot contact them directly: cooperation requests go into `needs`, and the result message collects them under "cross-department hand-offs" for the main agent.
|
|
31
|
+
- A child returns a structured evidence block (`status` / `acceptance` / `artifacts` / `needs`). **Non-empty output no longer means done**: `partial`, any failed acceptance item, or an unparsable block is blocked; only all-`pass` is trusted directly, everything else is flagged "unverified" for the main agent.
|
|
32
|
+
- Declared `file` artifacts are checked; a missing artifact keeps downstream tasks locked and names the upstream plus the missing file.
|
|
33
|
+
|
|
34
|
+
The full contract — roles, data shapes, state machine, recovery, and the three places to update together — is in **[Collaboration contract](https://github.com/abbaababa/dsh-workplan/blob/main/docs/collaboration.md)**; per-department duties and handoff checklists are in **[Departments and handoffs](https://github.com/abbaababa/dsh-workplan/blob/main/docs/departments.md)**.
|
|
35
|
+
|
|
23
36
|
## Requirements
|
|
24
37
|
|
|
25
38
|
| Item | Detail |
|
|
@@ -31,7 +44,7 @@ Greetings, thanks, and status questions ("how far along are we?") do not trigger
|
|
|
31
44
|
## Install
|
|
32
45
|
|
|
33
46
|
```bash
|
|
34
|
-
dsh plugin --profile web add dsh-workplan@1.
|
|
47
|
+
dsh plugin --profile web add dsh-workplan@1.7.0
|
|
35
48
|
```
|
|
36
49
|
|
|
37
50
|
Restart the DSH Web process (or reload the page) so the bundle is picked up.
|
|
@@ -53,7 +66,7 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
53
66
|
4. Open **Task progress** in the sidebar:
|
|
54
67
|
|
|
55
68
|
- five headline numbers: **tasks / work items / done / in progress / blocked**;
|
|
56
|
-
- plan cards grouped into **In progress** and **Completed**, each with a completion rate;
|
|
69
|
+
- plan cards grouped into **In progress**, **Ended** and **Completed**, each with a completion rate. **Ended** means the turn has stopped (nothing is running) while the plan is still unfinished; the card also says where it stopped (budget spent / stuck / not started) and resuming is one sentence away;
|
|
57
70
|
- expand any plan to see per-stage progress and who owns each work item.
|
|
58
71
|
|
|
59
72
|
Every number is derived from the same task state — the panel can no longer claim "0 in progress" while the list below shows work running. That inconsistency is exactly what 1.4.3 fixed.
|
|
@@ -62,8 +75,9 @@ Every number is derived from the same task state — the panel can no longer cla
|
|
|
62
75
|
|
|
63
76
|
| Tool | Purpose |
|
|
64
77
|
|---|---|
|
|
65
|
-
| `dsh_workplan_dispatch` | Dispatch the current plan
|
|
66
|
-
| `
|
|
78
|
+
| `dsh_workplan_dispatch` | Dispatch the current plan and write results back. `mode:"wait"` (default) waits for the round; `mode:"async"` returns immediately and keeps running in the background. Idempotent. |
|
|
79
|
+
| `dsh_workplan_status` | Read-only: ask how far along the plan is. Rebuilt from the session log, so it survives a restart or reload. |
|
|
80
|
+
| `dsh_workplan_update` | Main agent only: correct a subtask's status and evidence. Takes `expectedRevision` to prevent lost updates; in-flight subtasks are refused unless `force:true`. |
|
|
67
81
|
| `dsh_workplan_cancel` | Cancel a plan that has not been dispatched; never fabricates completion. |
|
|
68
82
|
|
|
69
83
|
In **plan mode** the plan is shown for review and `dispatch` is explicitly refused with a reason.
|
|
@@ -97,7 +111,7 @@ Limits can also be set in the plugin config:
|
|
|
97
111
|
Verify it yourself:
|
|
98
112
|
|
|
99
113
|
```bash
|
|
100
|
-
npm view dsh-workplan@
|
|
114
|
+
npm view dsh-workplan@latest dependencies
|
|
101
115
|
grep -RInE "writeFileSync|child_process|eval\(" src
|
|
102
116
|
npm audit --omit=dev
|
|
103
117
|
```
|
|
@@ -153,7 +167,7 @@ dsh plugin --profile web remove dsh-workplan
|
|
|
153
167
|
```bash
|
|
154
168
|
npm ci
|
|
155
169
|
npm run check # tsc --noEmit
|
|
156
|
-
npm test #
|
|
170
|
+
npm test # all tests (the count changes between versions; trust the output and CI), including count invariants and the progress chart
|
|
157
171
|
npm run build # src/*.ts → lib/*.js, client.js
|
|
158
172
|
npm run preview # regenerate the 1.4.3 / 1.5.0 card comparison under docs/preview
|
|
159
173
|
```
|
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
## 一键安装
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
dsh plugin --profile web add dsh-workplan@1.
|
|
36
|
+
dsh plugin --profile web add dsh-workplan@1.7.0
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
装完**重启一次 DSH Web**(或重新载入当前页面)让插件生效。
|
|
@@ -57,23 +57,35 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
57
57
|
4. 点左侧栏的**「任务进度」**,就能看到:
|
|
58
58
|
|
|
59
59
|
- 顶部五个数字:**几个任务 / 分配了多少件工作 / 做好了 / 正在做 / 卡住了**;
|
|
60
|
-
-
|
|
60
|
+
- 计划卡:分「进行中」「已结束」「已完成」三组,右上角是完成率。「已结束」= 这一轮已经停了(没有东西在跑)但计划还没做完,卡片会写清停在哪儿(预算用完 / 卡住了 / 还没开始),说一句「继续」即可接着推进;
|
|
61
61
|
- 展开任意计划:每个阶段的进度、每件具体工作由哪个部门负责、当前状态。
|
|
62
62
|
|
|
63
63
|
5. 进度数字背后的每一行,都来自同一份任务状态——**不会再出现「显示 0 个正在做、但下面明明写着正在做」这种自相矛盾**(1.4.3 专门修的就是这个,见下文)。
|
|
64
64
|
|
|
65
65
|
纯打招呼、道谢、问「做到哪了」不会触发拆解,不会平白多出一堆子 Agent。
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## 四个模型工具(你不用直接调用)
|
|
68
68
|
|
|
69
69
|
| 工具 | 作用 |
|
|
70
70
|
|---|---|
|
|
71
|
-
| `dsh_workplan_dispatch` |
|
|
72
|
-
| `
|
|
71
|
+
| `dsh_workplan_dispatch` | 派发当前计划,把结果写回会话。默认 `mode:"wait"` 等结束;`mode:"async"` 立刻返回、后台继续。重复调用是幂等的。 |
|
|
72
|
+
| `dsh_workplan_status` | 只读:问到哪了。重启或刷新后也能从会话记录重建。 |
|
|
73
|
+
| `dsh_workplan_update` | 主 Agent 核对结果、修正某个子任务状态与证据。带 `expectedRevision` 防覆盖,运行中默认拒绝(`force:true` 才覆盖)。子 Agent 不能调用。 |
|
|
73
74
|
| `dsh_workplan_cancel` | 取消还没派发的计划,不会伪造任何「已完成」。 |
|
|
74
75
|
|
|
75
76
|
在 **plan 模式**下只会给你看计划,`dispatch` 会被明确拦下并说明原因,不会偷偷开跑。
|
|
76
77
|
|
|
78
|
+
## 部门怎么协作(1.7.0 的真实能力)
|
|
79
|
+
|
|
80
|
+
计划里的每件工作都带一个部门标签(工程研发、研究分析、设计、产品、数据、质量验证、安全、运维、文档写作、运营、法务合规、财务)。**标签决定提示词与统计口径,不是组织架构**:
|
|
81
|
+
|
|
82
|
+
- 部门之间**不能直接对话**;跨部门信息由主 Agent 转达,或落到双方都能读的工作区文件。但每个子 Agent 的提示词里会带上**兄弟部门的只读一览**(谁、做什么、产出什么、已完成摘要),需要协作就写进 `needs`,结果消息会汇总成「跨部门待转达」交给主 Agent 逐条处理。
|
|
83
|
+
- 下游只看到 `dependsOn` 里上游的**摘要**与完整体检结果,看不到上游的完整对话。所以上游必须把「产物绝对路径 + 怎么验收」写进摘要;声明为 `file` 的产物会被逐个核实,**缺失就不给下游解锁**。
|
|
84
|
+
- 子 Agent 在输出末尾回传结构化证据块(`status` / `acceptance` / `artifacts` / `needs`)。**非空输出不再等于完成**:`partial`、任一条验收失败、坏块都判受阻,只有全 `pass` 才可直接采信,其余在结果消息里标「未验证」等主 Agent 核对。
|
|
85
|
+
- 阶段(stage)只是展示分组,**不是执行门槛**;真正决定先后的是 `dependsOn`。
|
|
86
|
+
|
|
87
|
+
完整的角色、数据契约、状态机、失败恢复与「改代码时必须同步的三处」,见 **[协作契约](https://github.com/abbaababa/dsh-workplan/blob/main/docs/collaboration.md)**;12 个部门的职责与交接清单见 **[部门职责与交接约定](https://github.com/abbaababa/dsh-workplan/blob/main/docs/departments.md)**。
|
|
88
|
+
|
|
77
89
|
## 预算、超时与续跑(知道这些就不会误以为卡死)
|
|
78
90
|
|
|
79
91
|
| 项 | 默认值 | 怎么改 |
|
|
@@ -84,7 +96,7 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
84
96
|
| 自动续跑次数 | 4 次 | `DSH_WORKPLAN_MAX_RESUMES` |
|
|
85
97
|
| 并发子 Agent | 5 个(固定) | — |
|
|
86
98
|
|
|
87
|
-
|
|
99
|
+
预算用尽不是失败:计划会变成「**本轮预算用尽,可续跑**」,已完成的不重跑,剩下的下次接着做。被判定卡住的子任务只卡它自己,不会拖垮整个计划;重试只会发生一次,第二次的提示词会带上一次的失败原因,不会原样重撞。
|
|
88
100
|
|
|
89
101
|
环境变量写在启动 DSH 的那个 shell 里,或者写进插件配置:
|
|
90
102
|
|
|
@@ -104,7 +116,7 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
104
116
|
自己复核:
|
|
105
117
|
|
|
106
118
|
```bash
|
|
107
|
-
npm view dsh-workplan@
|
|
119
|
+
npm view dsh-workplan@latest dependencies # 应为空
|
|
108
120
|
grep -RInE "writeFileSync|child_process|eval\(" src # 应无命中
|
|
109
121
|
npm audit --omit=dev
|
|
110
122
|
```
|
|
@@ -164,7 +176,7 @@ dsh plugin --profile web remove dsh-workplan
|
|
|
164
176
|
```bash
|
|
165
177
|
npm ci
|
|
166
178
|
npm run check # tsc --noEmit
|
|
167
|
-
npm test #
|
|
179
|
+
npm test # 全部测试(数量随版本变化,以命令输出与 CI 为准),含计数不变量与进度图表用例
|
|
168
180
|
npm run build # 编译 src/*.ts → lib/*.js、client.js
|
|
169
181
|
npm run preview # 重新生成 docs/preview 里的 1.4.3 / 1.5.0 卡头对比页
|
|
170
182
|
```
|