dsh-workplan 2.1.3 → 2.1.5
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 +25 -0
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/docs/release-records/_release_notes_2.1.2_20261106.md +44 -0
- package/docs/release-records/_t2_version_determination_20261106.md +39 -0
- package/docs/release-records/_t5_external_reverify_20261106.md +18 -0
- package/docs/release-records/release-dryrun-report-20261106.md +74 -0
- package/docs/release-records/release-record-2.1.3-20261106.md +82 -0
- package/docs/release-records/release-steps-20261106.md +129 -0
- package/lib/departments.js +19 -0
- package/lib/host.js +1 -1
- package/lib/plan.js +6 -3
- package/package.json +1 -1
- package/src/departments.ts +22 -0
- package/src/host.ts +1 -1
- package/src/plan.ts +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
## 2.1.5 — 2026-11-07
|
|
2
|
+
|
|
3
|
+
**把「接收分配任务的部门人员」升级为该领域全球顶尖专家,而非普通部门人员(要求 1 + 2 同步落到源码)。**
|
|
4
|
+
|
|
5
|
+
### 问题
|
|
6
|
+
|
|
7
|
+
子 Agent 提示词里执行者只是「某部门的执行 Agent」,规划器给子任务填的 role 也只是「部门内角色」,
|
|
8
|
+
没有任何机制要求执行者以顶尖专家水准工作,导致分工到位但执行深度不足。
|
|
9
|
+
|
|
10
|
+
### 改了什么
|
|
11
|
+
|
|
12
|
+
- `src/departments.ts` 新增 `DEPARTMENT_EXPERT_STANDARD`(planner / child 两段文案的单一事实源,
|
|
13
|
+
规划器与子 Agent 提示词共用,不会各自漂移)。
|
|
14
|
+
- 规划器提示词:可用部门列表标注「执行者都是来自全球相关领域的顶尖专家(不是普通部门人员)」,
|
|
15
|
+
JSON 示例 role 改为按全球顶尖专家定位填写。
|
|
16
|
+
- 子 Agent 提示词:首句后新增「专家定位」段(先根因与全局、证据可复核、经得起同行评审、
|
|
17
|
+
不交浅层补丁不遗留问题),「执行要求」新增同标准首条。
|
|
18
|
+
- 版本号 2.1.5 全量同步(package.json / package-lock / meta.version / README×3 / tool-surface fixture)。
|
|
19
|
+
|
|
20
|
+
### 安装
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install dsh-workplan@2.1.5
|
|
24
|
+
```
|
|
25
|
+
|
|
1
26
|
## 2.1.3 — 2026-11-06
|
|
2
27
|
|
|
3
28
|
**修复规划器超时复发的真正根因:把单次规划器调用的墙钟上限从写死的常量改成可配置项。**
|
package/README.en.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> **Two selling points, one line: a full ISO/IEC 15408:2026 evidence pack you can verify with 5 commands, and a one-command install with zero runtime dependencies.**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/abbaababa/dsh-workplan/actions/workflows/verify.yml)
|
|
6
|
-
[](https://github.com/abbaababa/dsh-workplan/releases/tag/v2.1.5)
|
|
7
7
|
|
|
8
8
|
Adds "plan first → dispatch real department subagents → watch progress in the sidebar" to **DeepSeek Harness (DSH)**. No app, no DSH source patch, no page replacement.
|
|
9
9
|
|
|
@@ -80,7 +80,7 @@ The full contract — roles, data shapes, state machine, recovery, and the three
|
|
|
80
80
|
## Install
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
|
-
dsh plugin --profile web add dsh-workplan@2.1.
|
|
83
|
+
dsh plugin --profile web add dsh-workplan@2.1.5
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
Restart the DSH Web process (or reload the page) so the bundle is picked up.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> **两个卖点,一句话:ISO/IEC 15408:2026 全套安全证据,5 条命令自己验;安装一条命令、零第三方运行时依赖。**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/abbaababa/dsh-workplan/actions/workflows/verify.yml)
|
|
6
|
-
[](https://github.com/abbaababa/dsh-workplan/releases/tag/v2.1.5)
|
|
7
7
|
|
|
8
8
|
给 **DeepSeek Harness(DSH)** 加一段「先拆计划 → 真派部门子 Agent 去做 → 左侧栏实时看进度」的能力。不装 App、不改 DSH 源码、不换页面。
|
|
9
9
|
|
|
@@ -69,7 +69,7 @@ grep -RInE "child_process|execSync|eval\(|writeFileSync" src || echo "0 命中
|
|
|
69
69
|
## 一键安装
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
dsh plugin --profile web add dsh-workplan@2.1.
|
|
72
|
+
dsh plugin --profile web add dsh-workplan@2.1.5
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
装完**重启一次 DSH Web**(或重新载入当前页面)让插件生效。
|
package/README.zh.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> **两个卖点,一句话:ISO/IEC 15408:2026 全套安全证据,5 条命令自己验;安装一条命令、零第三方运行时依赖。**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/abbaababa/dsh-workplan/actions/workflows/verify.yml)
|
|
6
|
-
[](https://github.com/abbaababa/dsh-workplan/releases/tag/v2.1.5)
|
|
7
7
|
|
|
8
8
|
给 **DeepSeek Harness(DSH)** 加一段「先拆计划 → 真派部门子 Agent 去做 → 左侧栏实时看进度」的能力。不装 App、不改 DSH 源码、不换页面。
|
|
9
9
|
|
|
@@ -69,7 +69,7 @@ grep -RInE "child_process|execSync|eval\(|writeFileSync" src || echo "0 命中
|
|
|
69
69
|
## 一键安装
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
dsh plugin --profile web add dsh-workplan@2.1.
|
|
72
|
+
dsh plugin --profile web add dsh-workplan@2.1.5
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
装完**重启一次 DSH Web**(或重新载入当前页面)让插件生效。
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# dsh-workplan 2.1.2 发布说明(Release Notes)
|
|
2
|
+
|
|
3
|
+
发布日期:2026-11-06 | 版本号:2.1.2 | 升级类型:patch(bug 修复)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 一句话说明
|
|
8
|
+
|
|
9
|
+
修复自动任务拆分「稳定超时被误报成意外中断」的问题:把规划器的思考时间上限从 2 分钟放宽到 5 分钟,并让真正超时时报出明确原因。
|
|
10
|
+
|
|
11
|
+
## 一、问题是什么(通俗版)
|
|
12
|
+
|
|
13
|
+
插件在接到一个复杂任务时,会先花一段时间自动把它「拆分」成几个子任务,再分派给各部门去执行。这一步是有时间上限的:
|
|
14
|
+
|
|
15
|
+
1. 之前的上限只有 **2 分钟(120 秒)**。当任务描述特别长、要求特别多时,拆分还没做完,就被定时器强制打断了;
|
|
16
|
+
2. 更糟的是,底层的大模型接口把「超时被打断」这件事,**误报成了「请求意外中断」**(`DeepSeek Messages request aborted`),看起来像网络偶发故障,根本看不出真正原因是「时间到了」。
|
|
17
|
+
|
|
18
|
+
结果就是:复杂任务每次都会稳定失败,但日志却让人以为是「偶发中断」,排查方向被带偏。
|
|
19
|
+
|
|
20
|
+
## 二、改了什么(只有这两处)
|
|
21
|
+
|
|
22
|
+
1. 把拆分的时间上限从 **2 分钟(120 秒)放宽到 5 分钟(300 秒)**,给复杂任务留足拆分时间。
|
|
23
|
+
2. 当确实是「超时」被打断时,不再被误报成「意外中断」,而是明确抛出「规划器超时:任务分解未在时限内完成」的清晰报错。
|
|
24
|
+
|
|
25
|
+
改动只涉及 `lib/runtime.js` 与 `src/runtime.ts` 两个文件(+14/−2),没有改其它任何功能。
|
|
26
|
+
|
|
27
|
+
## 三、安装
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install dsh-workplan@2.1.2
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
(版本号 2.1.2 为 patch 升级,属 bug 修复级别。)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 四、版本号与内容一致性核对清单
|
|
38
|
+
|
|
39
|
+
| # | 核对项 | 结果 | 证据 |
|
|
40
|
+
|---|---|---|---|
|
|
41
|
+
| C1 | 发布说明标题与正文版本号均为 **2.1.2**,与 T2 目标版本号一致 | ✅ 一致 | 本文档标题与正文、`CHANGELOG.md` 顶部 `## 2.1.2 — 2026-11-06`;T2 结论 `2.1.2`(patch,远端 404 未占用) |
|
|
42
|
+
| C2 | 只陈述已验证的两处修正(120000→300000、新增 PLANNER_TIMEOUT 明确报错),无虚构事实 | ✅ 一致 | `git diff`:`lib/runtime.js` 与 `src/runtime.ts` 各 +7/−1(共 +14/−2);`PLANNER_TIMEOUT_MS` 两文件均为 `300000`;新增 `throw new PlanError('规划器超时…','PLANNER_TIMEOUT')` |
|
|
43
|
+
| C3 | 改动范围陈述准确(仅 2 文件、+14/−2) | ✅ 一致 | `git diff --stat`:`lib/runtime.js` 与 `src/runtime.ts` 各 8 行改动(+7/−1)→ 合计 14 insertions / 2 deletions |
|
|
44
|
+
| C4 | 对外语句通俗易懂、无内部术语堆砌 | ✅ 通过 | 全文用「拆分」「时间上限」「意外中断」等白话表述,无 `runPlanner`/`abortError`/`PlanError` 等内部标识符直接出现在正文(仅作为代码引用保留必要的字段名说明) |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# T2 版本确定与发布渠道核对记录(2026-11-06)
|
|
2
|
+
|
|
3
|
+
本文件为可复现证据记录,供 T4(运维发布)接手。
|
|
4
|
+
|
|
5
|
+
## 一、包信息(读取 package.json)
|
|
6
|
+
|
|
7
|
+
| 字段 | 值 |
|
|
8
|
+
|---|---|
|
|
9
|
+
| name | `dsh-workplan` |
|
|
10
|
+
| 当前 version | `2.1.1` |
|
|
11
|
+
| publishConfig.access | `public` |
|
|
12
|
+
| main | `lib/host.js` |
|
|
13
|
+
| repository | git+https://github.com/abbaababa/dsh-workplan.git |
|
|
14
|
+
|
|
15
|
+
## 二、版本冲突结论(A2)
|
|
16
|
+
|
|
17
|
+
- 远端 registry 已发布版本共 28 个,其中已含 `2.1.1`,且 `latest` dist-tag 指向 `2.1.1`。
|
|
18
|
+
- 本地 `package.json` 版本仍为 `2.1.1`,与远端冲突,**不可重复发布**(npm 拒绝覆盖已发布版本)。
|
|
19
|
+
- 「修正后的最新源代码」= `PLANNER_TIMEOUT_MS` 120000 → 300000 的超时修复,属于**未提交的工作区改动**(`git status`:`M lib/runtime.js`、`M src/runtime.ts`)。
|
|
20
|
+
- 远端 2.1.1 tarball 内 `PLANNER_TIMEOUT_MS = 120000`(旧值),本地为 `300000`,证明该修复**确为 2.1.1 之后的新改动**,尚未对外发布。
|
|
21
|
+
- **目标发布版本号:`2.1.2`**(patch 升级,属 bug 修复级别,符合 semver 递增规则)。`2.1.2` 远端返回 HTTP 404,未被占用。
|
|
22
|
+
|
|
23
|
+
## 三、版本号规范性(A1)
|
|
24
|
+
|
|
25
|
+
- `2.1.2` 符合 semver `MAJOR.MINOR.PATCH` 规范(严格正则通过)。
|
|
26
|
+
|
|
27
|
+
## 四、发布渠道与凭证(A3)
|
|
28
|
+
|
|
29
|
+
- 发布渠道:`https://registry.npmjs.org/`
|
|
30
|
+
- 发行 tag:`latest`(默认;package.json 无自定义 dist-tag,publishConfig 仅 access=public)
|
|
31
|
+
- 凭证:`~/.npmrc` 已配置 `//registry.npmjs.org/:_authToken`(40 字符,前缀 `npm_`,值已脱敏不落盘)。
|
|
32
|
+
- 凭证可用性验证(可复现):
|
|
33
|
+
- `npm whoami --cache /tmp/t2-npmcache` → `open-dsh`(通过)
|
|
34
|
+
- 直连 `GET https://registry.npmjs.org/-/whoami`(Authorization: Bearer <token>)→ `{"username":"open-dsh"}`(通过)
|
|
35
|
+
|
|
36
|
+
## 五、已知环境风险(需转达 T4)
|
|
37
|
+
|
|
38
|
+
- 默认 npm 缓存目录 `/Users/open/.npm/_cacache/tmp` 存在 root 属主文件,导致 `npm whoami`(不带 --cache)报 `EPERM`。
|
|
39
|
+
- **规避方式**:发布时使用 `npm publish --cache /tmp/<可写目录>`,或先 `sudo chown -R 501:20 /Users/open/.npm`(需提权,子 Agent 无此权限)。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# T5 外部渠道回验结果(2026-11-06)
|
|
2
|
+
|
|
3
|
+
## A1 外部渠道可检索到目标版本号
|
|
4
|
+
- `GET https://registry.npmjs.org/dsh-workplan/2.1.2` → HTTP 200
|
|
5
|
+
- 返回 version=2.1.2, name=dsh-workplan
|
|
6
|
+
- `GET https://registry.npmjs.org/dsh-workplan` → dist-tags = {"latest":"2.1.2"}
|
|
7
|
+
|
|
8
|
+
## A2 远端内容与本地修正后代码关键点一致
|
|
9
|
+
- 远端 tarball 本地计算 shasum = ac65faefcd1065386bf66f7533e9295cffaecd5b
|
|
10
|
+
(与 registry dist.shasum 完全一致)
|
|
11
|
+
- 远端 package/package.json version = 2.1.2(本地 package.json 同为 2.1.2)
|
|
12
|
+
- 远端 package/lib/runtime.js:97 = `export const PLANNER_TIMEOUT_MS = 300000;`
|
|
13
|
+
本地 lib/runtime.js:97 = `export const PLANNER_TIMEOUT_MS = 300000;` → 一致
|
|
14
|
+
- 远端 package/src/runtime.ts:175 = `export const PLANNER_TIMEOUT_MS = 300000`
|
|
15
|
+
本地 src/runtime.ts:175 = `export const PLANNER_TIMEOUT_MS = 300000` → 一致
|
|
16
|
+
|
|
17
|
+
## A3 超时迹象
|
|
18
|
+
- 无。全程命令均在数秒内返回,未触发任何 step 超时。
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# dsh-workplan release.sh 干跑测试报告(T3 · 质量验证)
|
|
2
|
+
|
|
3
|
+
- 日期:2026-11-06
|
|
4
|
+
- 测试对象:`plugins/dsh-workplan/release.sh`(408 行)
|
|
5
|
+
- 环境:macOS arm64,GNU bash 3.2.57(1)-release
|
|
6
|
+
- 仓库基线(测试前记录):HEAD `7c054e9702376a19950978e2967810ad0d36261f`,分支 `main`,工作区仅未跟踪 `?? release.sh`,tag `v2.1.4` 不存在
|
|
7
|
+
- 输入:T2 产物 `release.sh` + T1 清单 `RELEASE_STEPS_T1.md`
|
|
8
|
+
|
|
9
|
+
## A1 · 语法检查
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
$ bash -n release.sh
|
|
13
|
+
(exit 0)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
结论:**通过**。macOS 系统 bash 3.2(最严苛的常见 bash 版本)下语法解析零错误。
|
|
17
|
+
|
|
18
|
+
## A2 · 命令顺序比对(干跑输出 vs T1 清单)
|
|
19
|
+
|
|
20
|
+
干跑命令:`bash release.sh --version 2.1.4 --summary "T3 干跑验证" --dry-run` → **exit 0**,30 条「将执行」按序打印。
|
|
21
|
+
|
|
22
|
+
| T1 步骤(RELEASE_STEPS_T1.md) | 干跑输出(实际顺序) | 一致 |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| 步骤0 版本四处声明点 | ② npm version(package.json+lock)→ sed src/host.ts → CHANGELOG 顶部插入 | ✓ |
|
|
25
|
+
| 步骤1 git status --short | ① 工作区检查(porcelain + --short) | ✓ |
|
|
26
|
+
| 步骤1 npm run check | ③ 第 1 条 `npm run check` | ✓ |
|
|
27
|
+
| 步骤1 npm test | ③ 第 2 条 `npm test` | ✓ |
|
|
28
|
+
| 步骤1 npm run build && git diff --exit-code | ③ 第 3、4 条 `npm run build` → `git diff --exit-code -- lib client.js` | ✓ |
|
|
29
|
+
| 步骤2 git add -A / commit / tag -a | ④ add → commit → tag(三条按序) | ✓ |
|
|
30
|
+
| 步骤2 git push origin main / vX | ④ push main → push v2.1.4 | ✓ |
|
|
31
|
+
| 步骤3 clone --depth 1 --branch vX | ⑤ git clone(mktemp 临时目录,比 T1 的 /tmp 固定路径更安全) | ✓ |
|
|
32
|
+
| 步骤3 npm ci && build && npm pack | ⑤ 按序打印 | ✓ |
|
|
33
|
+
| 步骤3 sha256sum | ⑤ 记录制品 sha256 | ✓ |
|
|
34
|
+
| 步骤3 gh release create(带 tgz) | ⑥ 带 tgz + --notes-file | ✓ |
|
|
35
|
+
| 步骤3 curl -sIL 验证制品 | ⑥ 末尾 curl 校验 HTTP 200(在 npm 发布之前,与 T1 步骤3→4 顺序一致) | ✓ |
|
|
36
|
+
| 步骤4 npm whoami / npm publish | ⑦ 按序打印 | ✓ |
|
|
37
|
+
| 步骤4 npm view X / npm view latest | ⑦ 两条 view 验证 | ✓ |
|
|
38
|
+
| 步骤5/6 索引源 PR / 发布记录 | 不代做,结尾 warn 列为人工收尾(T1 明确标注「非本仓库权限」) | ✓ |
|
|
39
|
+
| 步骤7 回滚 | --rollback 分支:gh release delete(tag 保留)、npm unpublish 仅打印、索引源仅提示 | ✓ |
|
|
40
|
+
|
|
41
|
+
**顺序结论**:检查 → 版本四处同步 → check/test/build/diff → add/commit/tag/push → clone/ci/build/pack/sha256 → gh release create → curl 验证 → npm whoami/publish → npm view ×2——与 T1「顺序铁律」逐环节一致。
|
|
42
|
+
|
|
43
|
+
合理差异说明(均不改变顺序判定):
|
|
44
|
+
1. 脚本新增前置检查(工具存在、分支、tag 不存在、版本确为新)——落实 T1 前置条件,不是重排。
|
|
45
|
+
2. 版本同步扩展到三语 README + tests/fixtures/tool-surface.json——依据 `tests/version-sync.test.ts:45`(断言 README.md/README.en.md 必须含 `dsh-workplan@<新版本>`),防止重蹈 2.1.2 CI #399/#400 红叉。
|
|
46
|
+
3. T1 清单 #4 `npm run verify` 是 CI 聚合命令;脚本按 RELEASING.md §1 细分为 check→test→build→diff,顺序等价。
|
|
47
|
+
|
|
48
|
+
## 安全检查(无越权操作)
|
|
49
|
+
|
|
50
|
+
- `sudo|launchctl|systemctl|kill|pkill|reboot|shutdown|chmod|chown|curl -X`:**0 命中**。
|
|
51
|
+
- `npm unpublish` 4 处命中全部是注释/警告文本(release.sh:25,51,93,368),**无一处执行**。
|
|
52
|
+
- `rm -rf` 仅 1 处(release.sh:328),目标是 `mktemp -d` 生成的临时目录。
|
|
53
|
+
- 不重启任何服务、不写 `~/.dsh`、不安装依赖(与脚本头部声明边界一致)。
|
|
54
|
+
- 干跑全程**零网络请求、零文件改动**:干跑后 `git status --short` 仍为 `?? release.sh`、HEAD 仍 `7c054e9`。
|
|
55
|
+
|
|
56
|
+
## 边界测试
|
|
57
|
+
|
|
58
|
+
| 用例 | 结果 |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `--help` | exit 0 ✓ |
|
|
61
|
+
| 缺 `--version` | 报错 exit 1,无副作用 ✓ |
|
|
62
|
+
| `--rollback --dry-run` | exit 0,`gh release delete` 仅打印、tag 保留 ✓ |
|
|
63
|
+
| 文件可执行位 | `-rwx--x--x`,用法文档的 `./release.sh` 可直接运行 ✓ |
|
|
64
|
+
|
|
65
|
+
## 缺陷清单
|
|
66
|
+
|
|
67
|
+
- **D-01(非阻塞,文档性瑕疵)**:头部注释 `release.sh:45-46` 把「⑧ curl 验证」列在「⑦ npm 发布」之后;实际代码在 `do_gh_release` 内先 curl 验证(release.sh:341-343)再 npm 发布,且该顺序与 T1 一致。仅注释编号与代码不符,不影响执行顺序与 A2 判定。建议后续顺手修正注释。
|
|
68
|
+
|
|
69
|
+
## 结论
|
|
70
|
+
|
|
71
|
+
- **A1 语法检查:通过**(bash -n exit 0)。
|
|
72
|
+
- **A2 模拟输出命令顺序与 T1 清单一致:通过**(17 行映射表逐条一致,合理差异 3 项均已注明依据)。
|
|
73
|
+
- **安全检查:通过**(无越权操作、零副作用)。
|
|
74
|
+
- 遗留:D-01 注释瑕疵(不阻塞交付)。
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Release record — dsh-workplan 2.1.3 (2026-11-06)
|
|
2
|
+
|
|
3
|
+
本文件是可复现的发布记录,供后续排查与追溯使用。每一项都可用文中给出的命令重新验证。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 一、这一版要解决什么
|
|
8
|
+
|
|
9
|
+
| 版本 | 改了什么 | 够不够 |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| 2.1.1 | 把规划器超时从 120s 提到 300s | ❌ 只是推迟了超时 |
|
|
12
|
+
| 2.1.2 | 明确区分「真超时」与「偶发中断」,不再误报 | ⚠️ 报错变清楚了,但超时照样复发 |
|
|
13
|
+
| **2.1.3** | **把单次规划器调用的墙钟上限改成可配置项** | ✅ 治本 |
|
|
14
|
+
|
|
15
|
+
**根因(2.1.3 之前一直没解决的)**:规划器是**单次 LLM 调用**,用写死的常量做墙钟超时。
|
|
16
|
+
任务越复杂(长上下文 + 多子任务结构化 JSON),单次调用耗时越长,到点必被杀。
|
|
17
|
+
2.1.1 只把 120s 改成 300s,等于把「必然发生」推迟到 5 分钟后,仍然必然发生。
|
|
18
|
+
|
|
19
|
+
**2.1.3 的解法**:`plannerTimeoutMs` 变成可配置项,链路打通
|
|
20
|
+
`host.ts`(配置 / 环境变量)→ `runtime.ts`(`WorkplanRuntimeOptions`)→ `runPlanner`(`setTimeout`)。
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 二、改动清单
|
|
25
|
+
|
|
26
|
+
| 文件 | 改动 |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `src/host.ts` | `WorkplanConfig` 新增 `plannerTimeoutMs?: number`;`apply()` 里 `plannerTimeoutMs: numericSetting(config.plannerTimeoutMs, 'DSH_WORKPLAN_PLANNER_TIMEOUT_MS')` |
|
|
29
|
+
| `src/runtime.ts` | `WorkplanRuntimeOptions` 新增 `plannerTimeoutMs?: number`;`runPlanner` 改为 `const plannerTimeoutMs = Number(options.plannerTimeoutMs ?? PLANNER_TIMEOUT_MS)`,`setTimeout` 用它;调用点传入 `options?.limits?.plannerTimeoutMs` |
|
|
30
|
+
| `lib/runtime.js` / `lib/host.js` | 由 `npm run build` 生成(与 src 同步) |
|
|
31
|
+
| `package.json` / `package-lock.json` / `src/host.ts`(meta.version) / `README.md` / `README.en.md` / `README.zh.md` / `tests/fixtures/tool-surface.json` | 版本号 7 处同步至 `2.1.3` |
|
|
32
|
+
| `CHANGELOG.md` | 新增 `## 2.1.3 — 2026-11-06` 条目 |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 三、怎么用(新增能力)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# 复杂任务(长上下文 / 多子任务)放宽规划器时限,毫秒
|
|
40
|
+
export DSH_WORKPLAN_PLANNER_TIMEOUT_MS=900000 # 15 分钟
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
未设置时回落到默认 `300000`(5 分钟)。也可用配置文件 `plannerTimeoutMs`。
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 四、发布与回验证据
|
|
48
|
+
|
|
49
|
+
| 渠道 | 结果 | 复验命令 |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| npm | 已发布 `2.1.3`,`dist-tags.latest = 2.1.3` | `npm view dsh-workplan dist-tags.latest` |
|
|
52
|
+
| npm tarball 内容 | 含修复 | `curl -sL $(npm view dsh-workplan@2.1.3 dist.tarball) \| tar -xzO package/lib/runtime.js \| grep plannerTimeoutMs` |
|
|
53
|
+
| GitHub Release | 已建,含安装包 `dsh-workplan-2.1.3.tgz` | `gh release view v2.1.3 --repo abbaababa/dsh-workplan` |
|
|
54
|
+
| git tag | `v2.1.3` 已推送(指向 `cc3562e`) | `git ls-remote --tags origin \| grep v2.1.3` |
|
|
55
|
+
| GitHub Actions | `verify` 全绿 | https://github.com/abbaababa/dsh-workplan/actions/runs/42192179962 |
|
|
56
|
+
| 本地测试 | 580/580 通过 | `npm run verify` |
|
|
57
|
+
| build 幂等 | 通过(CI 第 6 步 `git diff --exit-code -- lib client.js` 必为 0) | `npm run build && git diff --exit-code -- lib client.js` |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 五、2.1.2 的 CI 红叉(已修复,供参考)
|
|
62
|
+
|
|
63
|
+
2.1.2 首次推送时 CI `verify` 红叉(run `42172640105`),580 项中 2 项失败:
|
|
64
|
+
|
|
65
|
+
- `#399 package.json, package-lock.json and meta.version stay in sync` → `'2.1.2' !== '2.1.1'`
|
|
66
|
+
- `#400 CHANGELOG and README mention the version being shipped` → `README.md must install dsh-workplan@2.1.2`
|
|
67
|
+
|
|
68
|
+
**根因**:2.1.2 发布时只 bump 了 `package.json`,漏改 `package-lock.json`(两处)、
|
|
69
|
+
`src/host.ts` 的 meta.version、三语 README 的徽章与安装命令、`tests/fixtures/tool-surface.json`。
|
|
70
|
+
仓库自带的 `tests/version-sync.test.ts` 当场抓到(这正是该测试存在的意义)。
|
|
71
|
+
|
|
72
|
+
**修复**:commit `c2ec7b2` 补齐 7 处,红叉转绿(run `42188255718`)。
|
|
73
|
+
|
|
74
|
+
**注意**:npm 上已发布的 `2.1.2` 包内文档仍是旧版本号(npm 不允许覆盖已发布版本),
|
|
75
|
+
不影响插件功能;2.1.3 起包内外一致。
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 六、回滚方式
|
|
80
|
+
|
|
81
|
+
- 代码:`git revert cc3562e && git push origin main`;撤销 tag:`git tag -d v2.1.3 && git push origin :refs/tags/v2.1.3`
|
|
82
|
+
- npm:发布 72 小时内可 `npm unpublish dsh-workplan@2.1.3`;超时则 `npm deprecate dsh-workplan@2.1.3 "请升级到修复版本"` 并另发修复版。
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# dsh-workplan 发布流程梳理(T1 交付物)
|
|
2
|
+
|
|
3
|
+
> 仓库根:`/Users/open/Documents/Stocks/plugins/dsh-workplan`(自身含 `.git`,工作区 `/Users/open/Documents/Stocks` 不是 git 仓库)
|
|
4
|
+
> 当前版本:`2.1.3`(`package.json:3`、`package-lock.json:3,9`、`src/host.ts` 的 `meta.version`、CHANGELOG 顶部 `## 2.1.3 — 2026-11-06`)
|
|
5
|
+
> 本文所有命令均标注来源:RELEASING.md 章节、package.json scripts、.github/workflows/verify.yml,或前期对话(m00001)实测事实。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 一、发布步骤(有序列表)
|
|
10
|
+
|
|
11
|
+
### 步骤 0 · 版本号规则与四处声明点
|
|
12
|
+
- 版本号只有四个声明点,由 `tests/version-sync.test.ts` 断言一致(`RELEASING.md:12-19`):
|
|
13
|
+
1. `package.json` 的 `version`
|
|
14
|
+
2. `package-lock.json` 的 `version` 与 `packages[""].version`
|
|
15
|
+
3. `src/host.ts` 的 `meta.version`
|
|
16
|
+
4. `CHANGELOG.md` 的 `## <version> — <date>`
|
|
17
|
+
- 改版本时必须四处同步改,否则 CI `npm test` 中的 version-sync 断言会失败。
|
|
18
|
+
- 来源:RELEASING.md §0(行 6-19)
|
|
19
|
+
|
|
20
|
+
### 步骤 1 · 发布前检查(全部通过才继续)
|
|
21
|
+
```bash
|
|
22
|
+
git status --short # 工作区干净,无未提交改动 [RELEASING.md §1:25]
|
|
23
|
+
npm run check # = tsc --noEmit [package.json scripts:69]
|
|
24
|
+
npm test # = build + 全部用例 [package.json scripts:70]
|
|
25
|
+
npm run build && git diff --exit-code -- lib client.js # 重新构建后 lib/client.js 无差异 [RELEASING.md §1:32]
|
|
26
|
+
```
|
|
27
|
+
- `npm test` 会先 `npm run build` 再跑全部用例;任一失败不打 tag。
|
|
28
|
+
- (可选/历史探针,不并入 npm test)headless W5 跨版本 A/B 探针:`node scripts/w5-cross-version-check.mjs ...`,需 tag `v1.8.19` 与夹具,判据 `RESULT: PASS` 且 EXIT=0(`RELEASING.md §1.4:41-70`)。该步当前有已知偏差,未确认前只记未通过。
|
|
29
|
+
- 来源:RELEASING.md §1(行 21-35、41-90)
|
|
30
|
+
|
|
31
|
+
### 步骤 2 · 提交与打标签
|
|
32
|
+
```bash
|
|
33
|
+
git add -A
|
|
34
|
+
git commit -m "Release 2.1.3: <一句话说明>"
|
|
35
|
+
git tag -a v2.1.3 -m "v2.1.3 <说明>"
|
|
36
|
+
git push origin main
|
|
37
|
+
git push origin v2.1.3
|
|
38
|
+
```
|
|
39
|
+
- 来源:RELEASING.md §2(行 92-100);实际 tag `v2.1.2`、`v2.1.3` 已存在于仓库(`git tag` 实测)
|
|
40
|
+
|
|
41
|
+
### 步骤 3 · GitHub Release + 制品(必须带 tgz)
|
|
42
|
+
```bash
|
|
43
|
+
# 干净检出打包,避免把本地未跟踪文件打进制品
|
|
44
|
+
rm -rf /tmp/dsh-workplan-pack && git clone --depth 1 --branch v2.1.3 \
|
|
45
|
+
git@github.com:abbaababa/dsh-workplan.git /tmp/dsh-workplan-pack
|
|
46
|
+
cd /tmp/dsh-workplan-pack && npm ci && npm run build && npm pack
|
|
47
|
+
sha256sum dsh-workplan-2.1.3.tgz # macOS: shasum -a 256
|
|
48
|
+
|
|
49
|
+
# 建 Release 并上传制品
|
|
50
|
+
gh release create v2.1.3 /tmp/dsh-workplan-pack/dsh-workplan-2.1.3.tgz \
|
|
51
|
+
--repo abbaababa/dsh-workplan \
|
|
52
|
+
--title "v2.1.3 — <说明>" \
|
|
53
|
+
--notes-file docs/release-notes-2.1.3.md
|
|
54
|
+
|
|
55
|
+
# 验证制品可下载(HTTP 200,大小一致)
|
|
56
|
+
curl -sIL -o /dev/null -w '%{http_code} %{size_download}\n' \
|
|
57
|
+
https://github.com/abbaababa/dsh-workplan/releases/download/v2.1.3/dsh-workplan-2.1.3.tgz
|
|
58
|
+
```
|
|
59
|
+
- 历史教训(1.6.0):Release 必须带 `assets`,否则索引源 `tarball:` 指向 GitHub Release 会 404。
|
|
60
|
+
- 来源:RELEASING.md §3(行 102-126)
|
|
61
|
+
- 实测事实(前期对话 m00001 + `gh release view v2.1.3`):`v2.1.3` Release 已建,含 `dsh-workplan-2.1.3.tgz`,URL `https://github.com/abbaababa/dsh-workplan/releases/tag/v2.1.3`
|
|
62
|
+
|
|
63
|
+
### 步骤 4 · npm 发布
|
|
64
|
+
```bash
|
|
65
|
+
npm whoami # 必须是拥有该包发布权的账号
|
|
66
|
+
npm publish # 已登录直接发;CI 用 NPM_TOKEN + --provenance
|
|
67
|
+
npm view dsh-workplan@2.1.3 version dist.tarball # 验证已发布
|
|
68
|
+
npm view dsh-workplan@latest version # 必须等于新版本
|
|
69
|
+
```
|
|
70
|
+
- 来源:RELEASING.md §4(行 128-135)
|
|
71
|
+
- 实测事实(前期对话 m00001):`npm view` → `version=2.1.3 latest=2.1.3`,tarball `https://registry.npmjs.org/dsh-workplan/-/dsh-workplan-2.1.3.tgz`
|
|
72
|
+
- 注意:本地 `npm view` 在本次环境因沙箱 EPERM 缓存权限被拒,但以 RELEASING.md §4 文档命令 + 前期对话实测输出为准。
|
|
73
|
+
|
|
74
|
+
### 步骤 5 · 索引源(dsh-plugin-catalog,上游 CI,非本仓库权限)
|
|
75
|
+
- 链路:awesome-dsh-plugin 条目 → CI 探测 npm `dist-tags.latest` → 构建 `docs/index.json` → 发布 npm 包 `dsh-plugin-catalog` → jsDelivr → DSH 插件市场。
|
|
76
|
+
- 本仓库只完成「条目 PR」(改 `data/plugins/abbaababa__dsh-workplan.yml` 的 `tarball:` 指向刚发布的 Release),catalog 的 npm 发版由上游 CI 触发。
|
|
77
|
+
- 来源:RELEASING.md §5(行 137-155)
|
|
78
|
+
|
|
79
|
+
### 步骤 6 · 发布后记录
|
|
80
|
+
- 在 `docs/release-record-<version>-<date>.md` 写可复核证据:tag、commit、npm `shasum`、Release 制品 URL 与 sha256、catalog 版本、复验命令输出。
|
|
81
|
+
- 来源:RELEASING.md §6(行 157-161);实测 `git log` 顶条 `7c054e9 docs: add reproducible release record for 2.1.3`
|
|
82
|
+
|
|
83
|
+
### 步骤 7 · 回滚
|
|
84
|
+
- npm:`npm unpublish dsh-workplan@<version>`(24h 内)或发 `-fix` 补丁。
|
|
85
|
+
- GitHub:`gh release delete v<version>`,tag 保留。
|
|
86
|
+
- 索引源:改回上一可用 `tarball` 并提 PR。
|
|
87
|
+
- 来源:RELEASING.md §7(行 163-167)
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 二、CI(自动验证,非手动步骤)
|
|
92
|
+
|
|
93
|
+
`.github/workflows/verify.yml` 在 `push: main` 与 `pull_request` 触发(`verify.yml:3-6`):
|
|
94
|
+
1. `actions/checkout@v4`(`verify.yml:15-16`)
|
|
95
|
+
2. `actions/setup-node@v4`,node 22,cache npm(`verify.yml:18-22`)
|
|
96
|
+
3. `npm ci`(`verify.yml:24-25`)
|
|
97
|
+
4. `npm run verify`(`verify.yml:27-28` = `npm run check && npm test`)
|
|
98
|
+
5. `git diff --exit-code -- lib client.js` 失败当提交产物过期(`verify.yml:30-31`)
|
|
99
|
+
|
|
100
|
+
- 实测事实(前期对话 m00001):2.1.2 与 2.1.3 的 CI run 均 success(run `42188255718`、`42192179962`)。
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 三、关键命令清单(一键脚本可直接复用)
|
|
105
|
+
|
|
106
|
+
| 序 | 命令 | 作用 | 来源 |
|
|
107
|
+
|---|---|---|---|
|
|
108
|
+
| 1 | `npm run build` | 构建:`rm -rf dist && tsc -p tsconfig.json && cp dist/*.js lib/ && cp dist/client.js client.js` | package.json:68 |
|
|
109
|
+
| 2 | `npm run check` | 类型检查 `tsc --noEmit` | package.json:69 |
|
|
110
|
+
| 3 | `npm test` | build + 全量用例 | package.json:70 |
|
|
111
|
+
| 4 | `npm run verify` | `check && test` | package.json:71 |
|
|
112
|
+
| 5 | `git status --short` | 发布前工作区干净检查 | RELEASING.md:25 |
|
|
113
|
+
| 6 | `git diff --exit-code -- lib client.js` | 构建产物无差异 | RELEASING.md:32 |
|
|
114
|
+
| 7 | `git add -A && git commit -m "..." && git tag -a vX -m "..."` | 提交并打注释 tag | RELEASING.md:95-97 |
|
|
115
|
+
| 8 | `git push origin main && git push origin vX` | 推送分支与 tag | RELEASING.md:98-99 |
|
|
116
|
+
| 9 | `git clone --depth 1 --branch vX ... && npm ci && npm run build && npm pack` | 干净打包生成 tgz | RELEASING.md:109-111 |
|
|
117
|
+
| 10 | `gh release create vX <tgz> --repo abbaababa/dsh-workplan --title "..." --notes-file ...` | 建 Release 并上传制品 | RELEASING.md:115-118 |
|
|
118
|
+
| 11 | `curl -sIL -o /dev/null -w '%{http_code} %{size_download}\n' <release-url>` | 验证制品可下载 | RELEASING.md:124-125 |
|
|
119
|
+
| 12 | `npm whoami` / `npm publish` | 登录校验 + 发布 | RELEASING.md:131-132 |
|
|
120
|
+
| 13 | `npm view dsh-workplan@X version dist.tarball` / `npm view dsh-workplan@latest version` | 验证已发布且 latest 正确 | RELEASING.md:133-134 |
|
|
121
|
+
| 14 | CI:checkout → setup-node22 → `npm ci` → `npm run verify` → `git diff --exit-code -- lib client.js` | 推送即自动验证 | verify.yml:15-31 |
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 四、给 T2(脚本工程)的要点提示
|
|
126
|
+
- 顺序铁律:检查 → 改版本四处 → 构建 → 测试 → 提交打 tag → 推 tag → GitHub Release(带 tgz) → npm publish → 验证。
|
|
127
|
+
- 两处「非本仓库权限」:索引源 catalog 由上游 CI 触发(步骤 5)、服务重启/加载新代码由运行环境负责(不在脚本内,前期对话中用户手动重启 PID 9137)。
|
|
128
|
+
- `npm publish` 需 `NPM_TOKEN` 或已登录账号;`gh release` 需 `gh` 已登录且对 `abbaababa/dsh-workplan` 有写权限。
|
|
129
|
+
- 回滚命令(步骤 7)建议也纳入脚本的 `--rollback` 分支。
|
package/lib/departments.js
CHANGED
|
@@ -25,6 +25,25 @@
|
|
|
25
25
|
* contradiction that is strong enough to be worth a retry (e.g. a picture-book
|
|
26
26
|
* task growing a penetration-testing subtask).
|
|
27
27
|
*/
|
|
28
|
+
/**
|
|
29
|
+
* [2.1.5] Expert-persona standard: personnel who receive assigned work are top
|
|
30
|
+
* global experts in their field, not ordinary department staff.
|
|
31
|
+
*
|
|
32
|
+
* Single source of truth for the persona, consumed by the planner prompt (how
|
|
33
|
+
* the planner must staff and grade a subtask) and by the child-agent prompt
|
|
34
|
+
* (how the executing agent must hold itself). Keeping it here means both
|
|
35
|
+
* prompts cannot drift apart — the same rule the 1.12.0 catalogue applies to
|
|
36
|
+
* responsibilities.
|
|
37
|
+
*/
|
|
38
|
+
export const DEPARTMENT_EXPERT_STANDARD = Object.freeze({
|
|
39
|
+
/** Shown to the planner: who receives each assignment and how to grade it. */
|
|
40
|
+
planner: '每个部门的执行者都是该部门内来自全球相关领域的顶尖专家(不是普通部门人员):'
|
|
41
|
+
+ '分配时按专家定位填写 role,验收时按专家水准要求根因、证据与可复核性。',
|
|
42
|
+
/** Shown to the executing child agent: the persona it must act as. */
|
|
43
|
+
child: '你代表该领域来自全球的顶尖专家水准(不是普通部门人员):'
|
|
44
|
+
+ '先抓根因与全局再落地,结论必须有可复核证据,方案要经得起同行评审,'
|
|
45
|
+
+ '不留浅层补丁、不遗留问题。',
|
|
46
|
+
});
|
|
28
47
|
/**
|
|
29
48
|
* Twelve departments, same ids and labels as `DEPARTMENTS` in plan.ts.
|
|
30
49
|
* A unit test asserts the two tables never drift.
|
package/lib/host.js
CHANGED
|
@@ -1364,7 +1364,7 @@ export function apply(ctx, config = {}) {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
export const meta = {
|
|
1366
1366
|
name,
|
|
1367
|
-
version: '2.1.
|
|
1367
|
+
version: '2.1.5',
|
|
1368
1368
|
promptOrder: PROMPT_ORDER,
|
|
1369
1369
|
routes: ['/dsh-workplan/plans', '/dsh-workplan/vendor/chart.umd.js'],
|
|
1370
1370
|
};
|
package/lib/plan.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* runtime and by unit tests.
|
|
8
8
|
*/
|
|
9
9
|
import { createHash, randomUUID } from 'node:crypto';
|
|
10
|
-
import { DEPARTMENT_CAPABILITIES, departmentCapability } from './departments.js';
|
|
10
|
+
import { DEPARTMENT_CAPABILITIES, DEPARTMENT_EXPERT_STANDARD, departmentCapability } from './departments.js';
|
|
11
11
|
import { MAX_TASK_ANCHOR_CHARS } from './understanding.js';
|
|
12
12
|
import { isMappingDigest, verifyMappingDigest } from './supersede-digest.js';
|
|
13
13
|
import { phaseSummaryLine, threePhasePromptLines, validatePhaseEvidence } from './three-phase.js';
|
|
@@ -1088,7 +1088,8 @@ export function buildPlannerPrompt(taskText, cwd, conversationContext = '', budg
|
|
|
1088
1088
|
'- 每个子任务必须写 estimateMinutes(整数 1-15):你预估它需要多少分钟。宁可估高,不要估低。',
|
|
1089
1089
|
'- 规模大就如实拆成多轮,不要为了塞进一轮而把多个交付物压进一个子任务。',
|
|
1090
1090
|
'',
|
|
1091
|
-
'
|
|
1091
|
+
'可用部门(每个部门的执行者都是来自全球相关领域的顶尖专家,不是普通部门人员):',
|
|
1092
|
+
DEPARTMENT_EXPERT_STANDARD.planner,
|
|
1092
1093
|
departments,
|
|
1093
1094
|
'',
|
|
1094
1095
|
`工作目录:${directory}`,
|
|
@@ -1135,7 +1136,7 @@ export function buildPlannerPrompt(taskText, cwd, conversationContext = '', budg
|
|
|
1135
1136
|
' "title": "子任务",',
|
|
1136
1137
|
' "department": "engineering",',
|
|
1137
1138
|
' "departmentRationale": "为什么是该部门:命中哪条职责、对应任务哪个要素",',
|
|
1138
|
-
' "role": "
|
|
1139
|
+
' "role": "部门内角色(按该领域全球顶尖专家定位填写,如「资深架构师·全球顶尖水准」)",',
|
|
1139
1140
|
' "objective": "目标",',
|
|
1140
1141
|
' "method": ["具体方法/步骤"],',
|
|
1141
1142
|
' "inputs": ["输入;未知写待确认"],',
|
|
@@ -4197,6 +4198,7 @@ export function buildChildPrompt({ plan, subtask, stage, dependencyResults, cwd,
|
|
|
4197
4198
|
*/
|
|
4198
4199
|
return defuseSessionReferenceText([
|
|
4199
4200
|
`你是「${departmentLabel(subtask.department)}」部门的执行 Agent,只负责下面这一个子任务。`,
|
|
4201
|
+
`专家定位:${DEPARTMENT_EXPERT_STANDARD.child}`,
|
|
4200
4202
|
'',
|
|
4201
4203
|
`全局任务:${understanding.originalRequest ?? '(未记录)'}`,
|
|
4202
4204
|
`最终交付物:${understanding.deliverable ?? '(未记录)'}`,
|
|
@@ -4233,6 +4235,7 @@ export function buildChildPrompt({ plan, subtask, stage, dependencyResults, cwd,
|
|
|
4233
4235
|
: []),
|
|
4234
4236
|
'',
|
|
4235
4237
|
'执行要求:',
|
|
4238
|
+
'- 以全球顶尖专家标准执行:先诊断根因再动手,产出与证据要能通过同行复核,不交浅层补丁、不遗留问题。',
|
|
4236
4239
|
'- 只完成本子任务,不擅自扩大范围;不要派生新的 Agent。',
|
|
4237
4240
|
'- 你没有派发权限,也不能重启或安装任何服务;遇到这类步骤,必须先上报(见下方「遇阻上报」),再停止推进等待指示,不要空转。',
|
|
4238
4241
|
'- 不得编造事实、文件、命令结果或证据;无法确认时明确写“未验证”。',
|
package/package.json
CHANGED
package/src/departments.ts
CHANGED
|
@@ -26,6 +26,28 @@
|
|
|
26
26
|
* task growing a penetration-testing subtask).
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* [2.1.5] Expert-persona standard: personnel who receive assigned work are top
|
|
31
|
+
* global experts in their field, not ordinary department staff.
|
|
32
|
+
*
|
|
33
|
+
* Single source of truth for the persona, consumed by the planner prompt (how
|
|
34
|
+
* the planner must staff and grade a subtask) and by the child-agent prompt
|
|
35
|
+
* (how the executing agent must hold itself). Keeping it here means both
|
|
36
|
+
* prompts cannot drift apart — the same rule the 1.12.0 catalogue applies to
|
|
37
|
+
* responsibilities.
|
|
38
|
+
*/
|
|
39
|
+
export const DEPARTMENT_EXPERT_STANDARD = Object.freeze({
|
|
40
|
+
/** Shown to the planner: who receives each assignment and how to grade it. */
|
|
41
|
+
planner:
|
|
42
|
+
'每个部门的执行者都是该部门内来自全球相关领域的顶尖专家(不是普通部门人员):'
|
|
43
|
+
+ '分配时按专家定位填写 role,验收时按专家水准要求根因、证据与可复核性。',
|
|
44
|
+
/** Shown to the executing child agent: the persona it must act as. */
|
|
45
|
+
child:
|
|
46
|
+
'你代表该领域来自全球的顶尖专家水准(不是普通部门人员):'
|
|
47
|
+
+ '先抓根因与全局再落地,结论必须有可复核证据,方案要经得起同行评审,'
|
|
48
|
+
+ '不留浅层补丁、不遗留问题。',
|
|
49
|
+
})
|
|
50
|
+
|
|
29
51
|
export interface DepartmentCapability {
|
|
30
52
|
id: string
|
|
31
53
|
zh: string
|
package/src/host.ts
CHANGED
|
@@ -1493,7 +1493,7 @@ export function apply(ctx: any, config: WorkplanConfig = {}) {
|
|
|
1493
1493
|
|
|
1494
1494
|
export const meta = {
|
|
1495
1495
|
name,
|
|
1496
|
-
version: '2.1.
|
|
1496
|
+
version: '2.1.5',
|
|
1497
1497
|
promptOrder: PROMPT_ORDER,
|
|
1498
1498
|
routes: ['/dsh-workplan/plans', '/dsh-workplan/vendor/chart.umd.js'],
|
|
1499
1499
|
}
|
package/src/plan.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { createHash, randomUUID } from 'node:crypto'
|
|
11
11
|
|
|
12
|
-
import { DEPARTMENT_CAPABILITIES, departmentCapability } from './departments.js'
|
|
12
|
+
import { DEPARTMENT_CAPABILITIES, DEPARTMENT_EXPERT_STANDARD, departmentCapability } from './departments.js'
|
|
13
13
|
import { MAX_TASK_ANCHOR_CHARS } from './understanding.js'
|
|
14
14
|
import { isMappingDigest, verifyMappingDigest } from './supersede-digest.js'
|
|
15
15
|
import { phaseSummaryLine, threePhasePromptLines, validatePhaseEvidence } from './three-phase.js'
|
|
@@ -1149,7 +1149,8 @@ export function buildPlannerPrompt(taskText: any, cwd: any, conversationContext:
|
|
|
1149
1149
|
'- 每个子任务必须写 estimateMinutes(整数 1-15):你预估它需要多少分钟。宁可估高,不要估低。',
|
|
1150
1150
|
'- 规模大就如实拆成多轮,不要为了塞进一轮而把多个交付物压进一个子任务。',
|
|
1151
1151
|
'',
|
|
1152
|
-
'
|
|
1152
|
+
'可用部门(每个部门的执行者都是来自全球相关领域的顶尖专家,不是普通部门人员):',
|
|
1153
|
+
DEPARTMENT_EXPERT_STANDARD.planner,
|
|
1153
1154
|
departments,
|
|
1154
1155
|
'',
|
|
1155
1156
|
`工作目录:${directory}`,
|
|
@@ -1196,7 +1197,7 @@ export function buildPlannerPrompt(taskText: any, cwd: any, conversationContext:
|
|
|
1196
1197
|
' "title": "子任务",',
|
|
1197
1198
|
' "department": "engineering",',
|
|
1198
1199
|
' "departmentRationale": "为什么是该部门:命中哪条职责、对应任务哪个要素",',
|
|
1199
|
-
' "role": "
|
|
1200
|
+
' "role": "部门内角色(按该领域全球顶尖专家定位填写,如「资深架构师·全球顶尖水准」)",',
|
|
1200
1201
|
' "objective": "目标",',
|
|
1201
1202
|
' "method": ["具体方法/步骤"],',
|
|
1202
1203
|
' "inputs": ["输入;未知写待确认"],',
|
|
@@ -4282,6 +4283,7 @@ export function buildChildPrompt({
|
|
|
4282
4283
|
*/
|
|
4283
4284
|
return defuseSessionReferenceText([
|
|
4284
4285
|
`你是「${departmentLabel(subtask.department)}」部门的执行 Agent,只负责下面这一个子任务。`,
|
|
4286
|
+
`专家定位:${DEPARTMENT_EXPERT_STANDARD.child}`,
|
|
4285
4287
|
'',
|
|
4286
4288
|
`全局任务:${understanding.originalRequest ?? '(未记录)'}`,
|
|
4287
4289
|
`最终交付物:${understanding.deliverable ?? '(未记录)'}`,
|
|
@@ -4318,6 +4320,7 @@ export function buildChildPrompt({
|
|
|
4318
4320
|
: []),
|
|
4319
4321
|
'',
|
|
4320
4322
|
'执行要求:',
|
|
4323
|
+
'- 以全球顶尖专家标准执行:先诊断根因再动手,产出与证据要能通过同行复核,不交浅层补丁、不遗留问题。',
|
|
4321
4324
|
'- 只完成本子任务,不擅自扩大范围;不要派生新的 Agent。',
|
|
4322
4325
|
'- 你没有派发权限,也不能重启或安装任何服务;遇到这类步骤,必须先上报(见下方「遇阻上报」),再停止推进等待指示,不要空转。',
|
|
4323
4326
|
'- 不得编造事实、文件、命令结果或证据;无法确认时明确写“未验证”。',
|