dsh-workplan 3.0.0 → 3.0.2
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 +51 -0
- package/README.en.md +20 -18
- package/README.md +33 -19
- package/README.zh.md +15 -19
- package/client.js +36 -67
- package/docs/cc/ADV-FSP-FUNCTIONAL-SPEC.md +16 -3
- package/docs/cc/ADV-TDS-TOE-DESIGN.md +3 -3
- package/docs/cc/AGD-OPS-SECURE-OPERATION.md +3 -7
- package/docs/cc/AVA-VULNERABILITY-ANALYSIS.md +19 -0
- package/docs/cc/SECURITY-TARGET.md +6 -6
- package/docs/collaboration.md +17 -16
- package/lib/approval-gate.js +144 -0
- package/lib/client.js +36 -67
- package/lib/criterion.js +22 -27
- package/lib/host.js +178 -40
- package/lib/llm-rules.js +2 -2
- package/lib/plan.js +176 -85
- package/lib/runtime.js +756 -829
- package/lib/watchdog.js +3 -0
- package/package.json +3 -2
- package/src/approval-gate.ts +168 -0
- package/src/client.ts +36 -67
- package/src/criterion.ts +22 -23
- package/src/host.ts +185 -40
- package/src/llm-rules.ts +2 -2
- package/src/plan.ts +166 -83
- package/src/runtime.ts +643 -693
- package/src/watchdog.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
|
+
## 3.0.2 — 2026-11-17
|
|
2
|
+
|
|
3
|
+
- **修复**:GitHub Actions Release 流水线补齐 `NPM_TOKEN` secret + `gh release create` 幂等(已存在则 upload --clobber),npm 发布不再 ENEEDAUTH/E403。
|
|
4
|
+
- **版本**:全仓版本号对齐 3.0.2。
|
|
5
|
+
|
|
6
|
+
## 3.0.1 — 2026-11-16
|
|
7
|
+
|
|
8
|
+
### 激活热修:`dsh_workplan_hold` / `dsh_workplan_release` 缺 output 契约导致插件启用失败(宿主 register 硬校验)
|
|
9
|
+
|
|
10
|
+
> **事故**:v3.0.1 在 DSH Web GUI 启用失败,横幅报错 `TypeError: tool "dsh_workplan_hold" must declare output { schema, render, presentationMeta? }`(`file:///…/dsh-workplan/lib/host.js`)。宿主 `ToolsService.register()`(dsh-tools)强制每个工具声明 `output { schema, render, presentationMeta? }`;这两个 3.0.1 新增工具把 `render` 直接挂在工具根上、整体缺 `output` 包裹,注册即抛 TypeError,整个插件条目激活失败(web/headless 两 profile 经符号链接同源皆挂,错误横幅停在第一个失败工具上,release 同款隐患一并修复)。插件自身 1195 例全绿却过不了宿主注册——测试套件此前没有任何用例按宿主契约校验工具定义,此次一并补上永久防线。
|
|
11
|
+
|
|
12
|
+
**治本改动(`src/host.ts`)**:
|
|
13
|
+
|
|
14
|
+
- 两个工具补齐 `output { schema, render }`:schema 覆盖 runtime 全部返回形(hold:`ok/planId/alreadyHeld/hold/code/error`;release:`ok/gateReleased/planId/note/hold/dispatch/code/error`),与文件内其它 12 个工具同款写法对齐;render 按宿主契约接收 `(args, value)` 并返回 `ContentBlock[]`(此前实现返回裸字符串,不符合契约)。
|
|
15
|
+
- 顺带修正 release 的 render 判定顺序:「未能解除」以 `gateReleased !== true` 为准——原实现只看 `ok === false`,会把「闸门已解除但 deepThink 门禁拒派发」误报成未解除(该分支 `ok` 恰为 `false` 但闸门已松,与工具描述「闸门保持已解除」矛盾)。
|
|
16
|
+
|
|
17
|
+
**回归**:新增 `tests/tool-output-contract.test.ts` 3 例(①全部 14 个已注册工具逐字复刻宿主 register 判定 + schema 形状 + render 返回 ContentBlock[];②注册工具集与 `tests/fixtures/tool-surface.json` 清单逐字一致;③hold/release 门禁文案三分支语义)。另经宿主真实校验器(`@deepseek-ai/dsh-tools` 的 `assertSupportedJsonSchema` / `validateJsonSchemaValue`)对编译产物 `lib/host.js` 冒烟:14/14 通过。全量 **1206 例:pass 1205 / fail 0 / cancelled 0**。
|
|
18
|
+
|
|
19
|
+
**生效方式**:已 `npm run build` 并同步 `lib/`(web 与 headless 两 profile 经符号链接同源生效),**须用户手工重启 dsh** 后生效(禁止 Agent 自行重启)。
|
|
20
|
+
|
|
21
|
+
### 与 DSH 0.2.2-rc.3 内置 subagent 插件的冲突修复(全量审计后的 4 条真冲突,修 3 条 + 1 条文档声明)
|
|
22
|
+
|
|
23
|
+
> **审计结论**:工具名/配置键/事件无碰撞,4 条真冲突全部位于「插件 ↔ 内置 subagent 宿主 API/设置」边界。本条修复 3 条,第 4 条(双派发通道)以文档声明收口(内置工具无 per-agent 开关,preset toolFilter 改动面过大)。
|
|
24
|
+
|
|
25
|
+
**治本改动(`src/runtime.ts` + `package.json` + `README.md`)**:
|
|
26
|
+
|
|
27
|
+
- **[P0] `interruptByParent` 已在新版宿主移除 ⇒ phase-0 旧会话不再被中断(白跑烧 token、与 phase-1 重复工作)**。新增 `interruptChildContinuable()`(runtime.ts):优先新版 `subagents.interrupt(target, { kind:'ancestor', agent })`(authority 携带活体祖先 Agent,语义等价于旧 'continuable':中断当前回合、保留收件箱可接续);旧版宿主自动回退 `interruptByParent`。三处调用点(selfEffortTool 接续、delegateTool direct/review 登记)全部改走该 helper。旧测试夹具只 mock 旧 API ⇒ 回退路径保持可用,全部旧测试不回改。
|
|
28
|
+
- **[P1a] 设置页 `subagent.maxDepth`(默认 1)与三层体系(需 2)语义错位**。经核实宿主源码,两条深度通道互不相干:设置页滑块只约束内置 subagent/subagent_fork 工具(经 `resolveMaxDepth()`),插件派发只认 `spec.maxDepth`(manager.ts `resolveChildDepth`),滑块任何位置都不影响负责人→专家流程。新增 `detectDepthOverrideConflict()` + `notifyDepthOverrideConflict()`:三处派发点在检测到该设置 <2 时向计划会话发**一次性**说明(讲清两通道设计、无需操作、如何保持一致),不阻断派发。
|
|
29
|
+
- **[P1b] 宿主并发上限 `ACTIVATION_LIMIT_REACHED` 原样透出**。新增 `describeSubagentActivationError()`:识别该错误(code 或 message 双口径),翻译为可行动中文提示(稍后重试 / 「设置 → 子代理」调大 `maxActiveSubagents`);非该类错误原样返回不吞错。三处 `startActivation` 错误路径接入。
|
|
30
|
+
- **[P2] `package.json` 补 `engines.dsh: ">=0.2.2-rc.3"`**:此前完全无版本护栏,`interruptByParent` 漂移失效无人知晓;此后由宿主 plugin-compatibility 显式拦截过低版本。
|
|
31
|
+
- **[P2] README 新增「和 DSH 内置的子代理是什么关系」章节**:声明双派发通道事实(内置 subagent/subagent_fork 在插件子会话仍可见、绕过则不经任何闸门),并说明两个设置项对本插件的不同影响。
|
|
32
|
+
|
|
33
|
+
**回归**:新增 `tests/workplan-301-subagent-api-compat.test.ts`(8 个用例:新 API 优先/旧版回退/静默失败/异常吞掉、深度冲突一次性告警与各无冲突分支、并发上限翻译与非上限原样返回)。
|
|
34
|
+
|
|
1
35
|
## 3.0.0 — 2026-11-14
|
|
2
36
|
|
|
37
|
+
### 2026-11-15 本地机制修复补丁(认可闸门 + 死锁自愈;版本号维持 3.0.0,经用户确认后再定是否升版)
|
|
38
|
+
|
|
39
|
+
> **事故**:wp-e745a477 —— 用户任务原文写明「有疑问先问用户,经用户认可后再开始执行」,插件却在第一条用户消息上自动生成计划并因 `autoDispatch` 默认 true 立即派发;T1 子会话缺上下文升级待指示后子会话失联,`NO_CHILD` / `ESCALATION_OPEN` / dispatch 被待指示行挡住,三条出口全堵,整盘卡死只能人工取消。
|
|
40
|
+
|
|
41
|
+
**治本改动(`src/approval-gate.ts` + `src/runtime.ts` + `src/plan.ts` + `src/host.ts`)**:
|
|
42
|
+
|
|
43
|
+
1. **认可闸门(keyword 半,默认开)**:计划创建时检测任务锚点里的「先经用户认可/批准/确认再执行」门槛语(8 类正则),命中则计划照出、按住不派(`dispatchHold` 落档,durable 回放与重启重建均还原),直到用户明确认可、主 Agent 调用 `dsh_workplan_release`。`DSH_WORKPLAN_APPROVAL_GATE=0/false/off` 只关这一半。
|
|
44
|
+
2. **认可闸门(manual 半)**:新增 `dsh_workplan_hold` / `dsh_workplan_release` 工具,关键词未命中时主 Agent 可显式按住/解除;解除登记 `gateHistory` 留痕并走 dispatch 全部既有闸门。plan 模式下 release 同 dispatch 被 toolGuard 拒绝。
|
|
45
|
+
3. **派发/收尾联动**:闸门按住时 `dsh_workplan_dispatch` 拒 `DISPATCH_HELD`;回合收尾 steer 与 headless 硬失败对 held 计划豁免(不再催派发);未派发 held 计划不被下一条用户消息自动取消。
|
|
46
|
+
4. **死锁自愈**:`dsh_workplan_instruct` 遇到 `NO_CHILD` / `NOT_DIRECT_CHILD` 不再硬失败——把 escalated 行复位为 `pending`(合法迁移边)并登记 `reviveInstruction`(durable 透传 + 重建子会话时由 `buildChildPrompt` 注入提示词),下一次 dispatch 重建全新子会话并带上下达的决定。
|
|
47
|
+
5. **止血配置**:`cordis.patch.yml` 一度置 `autoDispatch:false`,全量回归通过后恢复 `config:{}`(默认自动派发 + 关键词闸门保护)。
|
|
48
|
+
|
|
49
|
+
**回归**:新增 `tests/approval-gate.test.ts` 19 例(门槛语 8 命中/3 不误伤/总开关/isDispatchHeld/revive 补丁与 applyStatus 集成/提示词注入/durable 透传);`tests/fixtures/tool-surface.json` 登记 2 个新工具;全量 **1195 例:pass 1194 / fail 0 / cancelled 0**(基线 1175 全绿)。`docs/cc/ADV-FSP`(工具 12→14)与 `AVA`(AS-14/15)同步。
|
|
50
|
+
|
|
51
|
+
**生效方式**:已 `npm run build` 并同步 `lib/`(web 与 headless 两 profile 经符号链接同源生效),**须用户手工重启 dsh** 后生效(禁止 Agent 自行重启)。
|
|
52
|
+
|
|
53
|
+
|
|
3
54
|
> **定版依据**:用户 2026-11-14 明确要求「优化全部完美完成后,此插件版本定为 3.0.0」,并裁决发布方式为**仅本地**(改版本号 + 构建 + 回归 + 变更说明,不对外发布、不打 tag)。本节下方「low 任务禁止第三层下派」一段原为 2.5.5 候选改动,经用户裁决**整体保留为 3.0.0 基线的一部分**,故并入本节,不再单独定版。
|
|
4
55
|
>
|
|
5
56
|
> **基线原则**:2.5.4 已有的全部强制机制(四角色两轮深度思考门禁、复杂任务 ≥8 人、下属开工预估上报、单任务 ≤10 分钟判据、F1–F9 沟通格式)**一条不减**,本节 13 条改动只做叠加。
|
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/v3.0.2)
|
|
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@3.0.
|
|
83
|
+
dsh plugin --profile web add dsh-workplan@3.0.2
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
Restart the DSH Web process (or reload the page) so the bundle is picked up.
|
|
@@ -102,7 +102,7 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
102
102
|
4. Open **Task progress** in the sidebar:
|
|
103
103
|
|
|
104
104
|
- five headline numbers: **tasks / work items / done / in progress / blocked**;
|
|
105
|
-
- 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 (
|
|
105
|
+
- 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 (paused / stuck / not started) and resuming is one sentence away;
|
|
106
106
|
- expand any plan to see per-stage progress and who owns each work item.
|
|
107
107
|
|
|
108
108
|
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.
|
|
@@ -117,9 +117,9 @@ Every number is derived from the same task state — the panel can no longer cla
|
|
|
117
117
|
| `dsh_workplan_cancel` | Cancel a plan that has not been dispatched; never fabricates completion. |
|
|
118
118
|
| `dsh_workplan_replan` | Amend in place when the request changes: `cancel` / `replace` / `add`. Superseded rows are kept as history; the plan revision increases. Main agent only. |
|
|
119
119
|
| `dsh_workplan_escalate` | A child reports a blocker mid-run (question, options, recommendation) into the state machine and waits for direction, instead of only writing `BLOCKED` at the very end. |
|
|
120
|
-
| `dsh_workplan_instruct` | The main agent answers an escalation and issues direction; if delivery fails the instruction is queued for the next activation.
|
|
120
|
+
| `dsh_workplan_instruct` | The main agent answers an escalation and issues direction; if delivery fails the instruction is queued for the next activation. A 60-second acknowledgement reminder is advisory only and never blocks or aborts work. |
|
|
121
121
|
| `dsh_workplan_handoff` | Resolve cross-department needs: `list` / `assign` / `resolve` / `close`. Unresolved needs block delivery; when the asking row is waiting for direction, `resolve` delivers the answer straight into the child session. |
|
|
122
|
-
| `dsh_workplan_followup` | Send a closing note to a direct child that
|
|
122
|
+
| `dsh_workplan_followup` | Send a closing note to a stopped or paused direct child that already wrote its artifacts. |
|
|
123
123
|
| `dsh_workplan_verify` | Child agents submit their three-phase evidence for phase-3 (verification) checking; calls from phases 1–2 return `PHASE_GATE`. Passing verification is not completion — the completion gate re-checks the same evidence. |
|
|
124
124
|
| `dsh_workplan_lessons` | Read-only view of the permanent lesson memory: `list` / `search` / `stats`. Never changes plan state; used to audit what was remembered and which mistakes keep repeating. |
|
|
125
125
|
|
|
@@ -138,25 +138,27 @@ Phase 3 also requires a **retrospective** (`retrospective` inside `phases.verifi
|
|
|
138
138
|
|
|
139
139
|
A passing retrospective is appended to the **permanent lesson memory** at `~/.dsh/workplan/lessons.jsonl` (override with `DSH_WORKPLAN_LESSONS_FILE`). Before each dispatch, the most relevant lessons are ranked by department, project, keyword overlap, recurrence count and recency, then injected into the child prompt (max 8), labelled explicitly as historical data rather than new instructions. A repeated mistake increments `occurrences` and moves up the ranking instead of creating a duplicate — that is the self-iteration loop. A corrupt line is skipped instead of poisoning the whole file; the store keeps the most recent 500 records and writes atomically.
|
|
140
140
|
|
|
141
|
-
##
|
|
141
|
+
## Execution time, health checks, and resumes
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
**Department leads and domain experts have no whole-round, per-attempt, idle, or acknowledgement time limit.** Estimates are coordination information only: they never create deadlines or decide `done`. The legacy 10-minute completion criterion is disabled and cannot be re-enabled through environment variables. `extendMs` remains a compatibility input but returns `TIME_LIMITS_DISABLED` without changing a timer.
|
|
144
|
+
|
|
145
|
+
| Setting | Current behavior | Configuration |
|
|
144
146
|
|---|---|---|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
| Planner no-progress ceiling | 5 min
|
|
149
|
-
| Planner stall window | 90 s
|
|
150
|
-
| Planner absolute ceiling | 15 min
|
|
151
|
-
| Automatic resumes |
|
|
147
|
+
| Lead/expert round and attempt execution | **Unlimited**: ends on a real result, a real error, evidence/quality gates, or explicit user cancellation | Legacy `DSH_WORKPLAN_TOTAL_TIMEOUT_MS`, `DSH_WORKPLAN_CHILD_TIMEOUT_MS`, `totalTimeoutMs`, `childTimeoutMs`, and subtask `timeoutMs` never create a deadline |
|
|
148
|
+
| Idle and acknowledgement monitoring | Observation and reminders only; no time-only `blocked` status or abort | Legacy `DSH_WORKPLAN_IDLE_TIMEOUT_MS` does not limit execution |
|
|
149
|
+
| Dispatch tool | No `timeoutMs`; `async` returns immediately, while `wait` waits for actual settlement | Prefer `async` for long work, with `status` and explicit `cancel` |
|
|
150
|
+
| Planner no-progress ceiling | 5 min from the last output chunk; planning only, not lead/expert execution | `DSH_WORKPLAN_PLANNER_TIMEOUT_MS` |
|
|
151
|
+
| Planner stall window | 90 s of missing output after streaming starts; transport health only | `DSH_WORKPLAN_PLANNER_IDLE_TIMEOUT_MS` |
|
|
152
|
+
| Planner absolute ceiling | 15 min; planning only | Scales with `…_PLANNER_TIMEOUT_MS` |
|
|
153
|
+
| Automatic resumes | 2; non-time pause recovery, not an execution clock | `DSH_WORKPLAN_MAX_RESUMES` |
|
|
152
154
|
| Subagent concurrency | 5 (fixed) | — |
|
|
153
155
|
|
|
154
|
-
|
|
156
|
+
Individual model connections, Bash commands, and disposal waits retain their local health checks; they are not department task deadlines. Without automatic time-based termination, genuinely stuck work can keep consuming concurrency and spend, so use the dashboard/`status` and explicitly cancel or redirect it. Legacy deadlines, extension journals, timeout counts, and criterion fields remain readable history but never arm new timers.
|
|
155
157
|
|
|
156
|
-
|
|
158
|
+
Non-time settings can still be placed in the plugin config:
|
|
157
159
|
|
|
158
160
|
```jsonc
|
|
159
|
-
{ "
|
|
161
|
+
{ "maxResumes": 2 }
|
|
160
162
|
```
|
|
161
163
|
|
|
162
164
|
## Security and privacy
|
|
@@ -219,7 +221,7 @@ The fix removes the cached snapshot: every number is derived at serialisation ti
|
|
|
219
221
|
|
|
220
222
|
**Numbers are lower than before.** That is the fix: 1.4.3 derives them from real state, and the old numbers were frequently inflated.
|
|
221
223
|
|
|
222
|
-
**A subagent stopped moving.** Five minutes without
|
|
224
|
+
**A subagent stopped moving.** Five minutes without events no longer blocks or aborts it. Inspect the dashboard/`status`, then explicitly cancel the plan/subtask or send an `instruct` update. This preserves human control without killing long reasoning or large tasks.
|
|
223
225
|
|
|
224
226
|
## Uninstall
|
|
225
227
|
|
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/v3.0.2)
|
|
7
7
|
|
|
8
8
|
给 **DeepSeek Harness(DSH)** 加一段「先拆计划 → 真派部门子 Agent 去做 → 左侧栏实时看进度」的能力。不装 App、不改 DSH 源码、不换页面。
|
|
9
9
|
|
|
@@ -62,14 +62,14 @@ grep -RInE "child_process|execSync|eval\(|writeFileSync" src || echo "0 命中
|
|
|
62
62
|
|
|
63
63
|
| 要求 | 说明 |
|
|
64
64
|
|---|---|
|
|
65
|
-
| DeepSeek Harness |
|
|
65
|
+
| DeepSeek Harness | **≥ 0.2.2-rc.3**(官方 Web 版,`dsh web` / `--profile web` 跑的这套;`engines.dsh` 会拦截过低版本) |
|
|
66
66
|
| Node.js | **22 或更高**(`node -v` 自查) |
|
|
67
67
|
| 网络 | 安装时需要能访问 npm registry |
|
|
68
68
|
|
|
69
69
|
## 一键安装
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
dsh plugin --profile web add dsh-workplan@3.0.
|
|
72
|
+
dsh plugin --profile web add dsh-workplan@3.0.2
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
装完**重启一次 DSH Web**(或重新载入当前页面)让插件生效。
|
|
@@ -93,7 +93,7 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
93
93
|
4. 点左侧栏的**「任务进度」**,就能看到:
|
|
94
94
|
|
|
95
95
|
- 顶部五个数字:**几个任务 / 分配了多少件工作 / 做好了 / 正在做 / 卡住了**;
|
|
96
|
-
- 计划卡:分「进行中」「已结束」「已完成」三组,右上角是完成率。「已结束」=
|
|
96
|
+
- 计划卡:分「进行中」「已结束」「已完成」三组,右上角是完成率。「已结束」= 这一轮已经停了(没有东西在跑)但计划还没做完,卡片会写清停在哪儿(已暂停 / 卡住了 / 还没开始),说一句「继续」即可接着推进;
|
|
97
97
|
- 展开任意计划:每个阶段的进度、每件具体工作由哪个部门负责、当前状态。
|
|
98
98
|
|
|
99
99
|
5. 进度数字背后的每一行,都来自同一份任务状态——**不会再出现「显示 0 个正在做、但下面明明写着正在做」这种自相矛盾**(1.4.3 专门修的就是这个,见下文)。
|
|
@@ -110,9 +110,9 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
110
110
|
| `dsh_workplan_cancel` | 取消还没派发的计划,不会伪造任何「已完成」。 |
|
|
111
111
|
| `dsh_workplan_replan` | 需求变更时就地修订:`cancel` / `replace` / `add`,旧行标为「已取代」保留可追溯,计划版本号递增。主 Agent 专用。 |
|
|
112
112
|
| `dsh_workplan_escalate` | 子 Agent 执行中遇阻上报:问题、选项、建议进状态机,等主 Agent 指示;不再是「只能憋到结尾写 BLOCKED」。 |
|
|
113
|
-
| `dsh_workplan_instruct` | 主 Agent
|
|
113
|
+
| `dsh_workplan_instruct` | 主 Agent 回答请示并下达指示;失败则挂起,子任务下次激活时注入。60 秒无回执只提示,不按时间判失败或中止。 |
|
|
114
114
|
| `dsh_workplan_handoff` | 处置跨部门需求:`list` / `assign` / `resolve` / `close`。未处置会拦住交付;对「待指示」的行 `resolve` 会直接把答复投递给子会话。 |
|
|
115
|
-
| `dsh_workplan_followup` |
|
|
115
|
+
| `dsh_workplan_followup` | 给已中止或暂停、但产物已落盘的直接子会话补一条收尾说明。 |
|
|
116
116
|
| `dsh_workplan_verify` | 子 Agent 在**阶段三(验证阶段)**提交三阶段证据做核验;阶段一、二调用会返回 `PHASE_GATE`。核验通过≠完成,最终仍由完成判定复核。 |
|
|
117
117
|
| `dsh_workplan_lessons` | 只读查看**永久教训记忆**:`list` / `search` / `stats`。它只读文件,不改计划状态;用来核对「到底记住了什么、哪些错误在重复发生」。 |
|
|
118
118
|
|
|
@@ -165,26 +165,30 @@ DSH_WORKPLAN_LESSONS_FILE=/path/x.jsonl # 需要时用环境变量覆盖
|
|
|
165
165
|
|
|
166
166
|
完整的角色、数据契约、状态机、失败恢复与「改代码时必须同步的三处」,见 **[协作契约](https://github.com/abbaababa/dsh-workplan/blob/main/docs/collaboration.md)**;12 个部门的职责与交接清单见 **[部门职责与交接约定](https://github.com/abbaababa/dsh-workplan/blob/main/docs/departments.md)**。
|
|
167
167
|
|
|
168
|
-
##
|
|
168
|
+
## 执行时限、健康保护与续跑
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
**部门负责人和部门相关领域全球顶尖专家没有任务总时限、单次执行时限、无进展终止时限或回执终止时限。** 事前预估仅用于协调和向用户说明,不会派生截止时间,也不会影响 `done` 验收;`extendMs` 只保留旧调用兼容并返回 `TIME_LIMITS_DISABLED`,不会真的延期。历史上的 10 分钟完成判据已停用,环境变量不能重新开启。
|
|
171
|
+
|
|
172
|
+
| 项 | 当前行为 | 配置说明 |
|
|
171
173
|
|---|---|---|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
| 规划器无进展上限 | 5
|
|
176
|
-
| 规划器静默判定 | 90
|
|
177
|
-
| 规划器绝对上限 | 15
|
|
178
|
-
| 自动续跑次数 |
|
|
174
|
+
| 负责人/专家整轮与单次执行 | **无时限**,直到自然完成、真实错误、证据/质量门禁或用户显式取消 | 旧 `DSH_WORKPLAN_TOTAL_TIMEOUT_MS`、`DSH_WORKPLAN_CHILD_TIMEOUT_MS`、`totalTimeoutMs`、`childTimeoutMs`、子任务 `timeoutMs` 均不再形成截止 |
|
|
175
|
+
| 无进展与回执 | 保留观测和提醒,不因静默或回执超期自动 `blocked` / 中止 | 旧 `DSH_WORKPLAN_IDLE_TIMEOUT_MS` 不形成执行限制 |
|
|
176
|
+
| `dispatch` 工具 | 不声明工具执行期限;`async` 立即返回,`wait` 会一直等到本轮实际收束 | 长任务建议使用 `async`,配合 `status` 查询和显式 `cancel` |
|
|
177
|
+
| 规划器无进展上限 | 5 分钟(自上一个输出块起算;仅约束生成计划,不约束负责人/专家执行) | `DSH_WORKPLAN_PLANNER_TIMEOUT_MS` |
|
|
178
|
+
| 规划器静默判定 | 90 秒(仅规划输出传输健康保护) | `DSH_WORKPLAN_PLANNER_IDLE_TIMEOUT_MS` |
|
|
179
|
+
| 规划器绝对上限 | 15 分钟(仅规划器) | 随 `…_PLANNER_TIMEOUT_MS` 等比变化 |
|
|
180
|
+
| 自动续跑次数 | 2 次(处理可续跑的非时间暂停,不是执行时钟) | `DSH_WORKPLAN_MAX_RESUMES` |
|
|
179
181
|
| 并发子 Agent | 5 个(固定) | — |
|
|
180
182
|
|
|
181
|
-
|
|
183
|
+
单次模型网络请求、单条 Bash 命令和清理等待仍有各自的局部健康保护;它们不是部门任务的总时限,不能用一条慢命令的传输超时替代整个任务 deadline。后台任务也不能绕过用户显式取消。
|
|
184
|
+
|
|
185
|
+
没有自动时间终结后,真正卡住的执行可能持续占用并发和费用:请看板提示与 `status`,由用户明确取消或指示处理。旧记录中的 `deadlineAt`、延期日志、超时计数和判据字段只用于历史回放,不会重新武装计时器。
|
|
182
186
|
|
|
183
|
-
|
|
187
|
+
非时间的资源与续跑配置仍可写在启动 DSH 的 shell 或插件配置中,例如:
|
|
184
188
|
|
|
185
189
|
```jsonc
|
|
186
190
|
// cordis.patch.yml 里的 config 字段
|
|
187
|
-
{ "
|
|
191
|
+
{ "maxResumes": 2 }
|
|
188
192
|
```
|
|
189
193
|
|
|
190
194
|
## 安全与隐私(可以自己复核)
|
|
@@ -239,6 +243,16 @@ npm audit --omit=dev
|
|
|
239
243
|
|
|
240
244
|
</details>
|
|
241
245
|
|
|
246
|
+
## 和 DSH 内置的子代理是什么关系(重要)
|
|
247
|
+
|
|
248
|
+
DSH 本身自带「子智能体」能力(内置 subagent 工具)。本插件**不替换、也不关闭**它,两者同时存在,请知道这三件事:
|
|
249
|
+
|
|
250
|
+
1. **插件的部门负责人/专家**由插件统一派发和管理,走 `dsh_workplan_delegate` 等 11 个工具的全部闸门(事前预估、分工表、两轮深度思考、结算核验、汇报核验)。
|
|
251
|
+
2. **内置 subagent 工具在这些子会话里仍然可见**。如果模型绕过插件、直接调用内置 `subagent` / `subagent_fork`,那个人会话**不经过插件的任何闸门**(无台账、无核验、无执行管理),产物也不会自动进计划看板。发现看板外多出来路不明的子会话时,对它说「以后派活一律走 dsh_workplan」即可。
|
|
252
|
+
3. **设置页两个子代理选项对本插件的影响不同**(已核实宿主源码,两条通道互不相干):
|
|
253
|
+
- 「子代理最大深度」(`subagent.maxDepth`)**只管内置 subagent/subagent_fork 工具**——本插件的三层体系(你 → 部门负责人 → 专家)按派发契约固定申请第 2 层深度,宿主对插件契约单独放行,**该滑块在任何位置都不会影响、也不会拦阻**负责人派发给专家。首次检测到该设置 <2 时插件会一次性说明这一点(无需任何操作;想完全一致可把滑块调到 2,重启后恢复默认);
|
|
254
|
+
- 「子代理最大并发」(`maxActiveSubagents`)**对本插件生效**——超上限时插件会明确提示「稍后重试或调大该设置」。
|
|
255
|
+
|
|
242
256
|
## 常见问题
|
|
243
257
|
|
|
244
258
|
**装完没反应?**
|
|
@@ -251,7 +265,7 @@ npm audit --omit=dev
|
|
|
251
265
|
1.4.3 之后数字来自真实状态而不是缓存,所以会比旧版本「更小、但更准」(旧版本的完成率经常虚高)。
|
|
252
266
|
|
|
253
267
|
**子 Agent 卡住不动?**
|
|
254
|
-
5
|
|
268
|
+
插件不会再仅因 5 分钟没有新事件就自动判失败或中止。请查看「任务进度」和 `status`;确认需要停止时明确说「取消这个计划/子任务」,需要调整时用 `instruct` 下达指示。这样保留人工控制,也避免长时间深思或大型任务被误杀。
|
|
255
269
|
|
|
256
270
|
## 卸载
|
|
257
271
|
|
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/v3.0.2)
|
|
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@
|
|
72
|
+
dsh plugin --profile web add dsh-workplan@3.0.2
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
装完**重启一次 DSH Web**(或重新载入当前页面)让插件生效。
|
|
@@ -93,7 +93,7 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
93
93
|
4. 点左侧栏的**「任务进度」**,就能看到:
|
|
94
94
|
|
|
95
95
|
- 顶部五个数字:**几个任务 / 分配了多少件工作 / 做好了 / 正在做 / 卡住了**;
|
|
96
|
-
- 计划卡:分「进行中」「已结束」「已完成」三组,右上角是完成率。「已结束」=
|
|
96
|
+
- 计划卡:分「进行中」「已结束」「已完成」三组,右上角是完成率。「已结束」= 这一轮已经停了(没有东西在跑)但计划还没做完,卡片会写清停在哪儿(旧版预算/超时历史、真实异常 / 还没开始),说一句「继续」即可接着推进;
|
|
97
97
|
- 展开任意计划:每个阶段的进度、每件具体工作由哪个部门负责、当前状态。
|
|
98
98
|
|
|
99
99
|
5. 进度数字背后的每一行,都来自同一份任务状态——**不会再出现「显示 0 个正在做、但下面明明写着正在做」这种自相矛盾**(1.4.3 专门修的就是这个,见下文)。
|
|
@@ -112,7 +112,7 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
112
112
|
| `dsh_workplan_escalate` | 子 Agent 执行中遇阻上报:问题、选项、建议进状态机,等主 Agent 指示;不再是「只能憋到结尾写 BLOCKED」。 |
|
|
113
113
|
| `dsh_workplan_instruct` | 主 Agent 回答请示并下达指示;失败则挂起,子任务下次激活时注入。带 60s/180s 回执检查。 |
|
|
114
114
|
| `dsh_workplan_handoff` | 处置跨部门需求:`list` / `assign` / `resolve` / `close`。未处置会拦住交付;对「待指示」的行 `resolve` 会直接把答复投递给子会话。 |
|
|
115
|
-
| `dsh_workplan_followup` |
|
|
115
|
+
| `dsh_workplan_followup` | 给因真实异常或用户取消而中断、但产物已落盘的直接子会话补一条收尾说明。 |
|
|
116
116
|
|
|
117
117
|
在 **plan 模式**下只会给你看计划,`dispatch` 会被明确拦下并说明原因,不会偷偷开跑。
|
|
118
118
|
|
|
@@ -127,27 +127,23 @@ dsh plugin --profile web add "$(pwd)"
|
|
|
127
127
|
|
|
128
128
|
完整的角色、数据契约、状态机、失败恢复与「改代码时必须同步的三处」,见 **[协作契约](https://github.com/abbaababa/dsh-workplan/blob/main/docs/collaboration.md)**;12 个部门的职责与交接清单见 **[部门职责与交接约定](https://github.com/abbaababa/dsh-workplan/blob/main/docs/departments.md)**。
|
|
129
129
|
|
|
130
|
-
##
|
|
130
|
+
## 执行时限、健康保护与续跑(知道这些就不会误以为卡死)
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
**部门负责人和部门相关领域全球顶尖专家执行任务没有时限**:没有总时长、单次时长、空闲无进展、未回执或 10 分钟验收门槛。平台不会仅因执行较久、暂时没有新事件或未立即回执而中止、判 blocked、换人接手或拒绝 done。旧版 `totalTimeoutMs`、`childTimeoutMs`、`idleTimeoutMs`、`extendMs`、`timeoutMs` 及由此写入的旧 `deadlineAt` 都不会再生成计时器,只作为历史信息展示;派发工具也不再声明任何 `timeoutMs`。
|
|
133
|
+
|
|
134
|
+
| 项 | 当前行为 | 怎么改 |
|
|
133
135
|
|---|---|---|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
| 子 Agent 无进展判定 | 5 分钟 | `DSH_WORKPLAN_IDLE_TIMEOUT_MS` |
|
|
136
|
+
| 负责人/专家执行时限 | **无**(预估和时间告知仅作协调信息,不影响验收) | 无需配置 |
|
|
137
|
+
| 用户显式取消/真实错误 | 仍立即收束并保留盘上产物 | 用户直接取消任务 |
|
|
137
138
|
| 规划器无进展上限 | 5 分钟(**自上一个输出块起算**,一直在输出就一直顺延) | `DSH_WORKPLAN_PLANNER_TIMEOUT_MS` |
|
|
138
139
|
| 规划器静默判定 | 90 秒(输出开始后连一个字都不再来才算卡死) | `DSH_WORKPLAN_PLANNER_IDLE_TIMEOUT_MS` |
|
|
139
140
|
| 规划器绝对上限 | 15 分钟(= 无进展上限 × 3,有无产出都到此为止) | 随 `…_PLANNER_TIMEOUT_MS` 等比变化 |
|
|
140
|
-
| 自动续跑次数 |
|
|
141
|
+
| 自动续跑次数 | 2 次 | `DSH_WORKPLAN_MAX_RESUMES` |
|
|
141
142
|
| 并发子 Agent | 5 个(固定) | — |
|
|
142
143
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
环境变量写在启动 DSH 的那个 shell 里,或者写进插件配置:
|
|
144
|
+
这些规划器时限只保护“生成计划”这一步,不会作用到负责人或专家执行。执行阶段只由真实完成、真实错误、证据/质量门禁或用户取消改变;重试可由真实失败触发,不会因计时器到点触发。
|
|
146
145
|
|
|
147
|
-
|
|
148
|
-
// cordis.patch.yml 里的 config 字段
|
|
149
|
-
{ "totalTimeoutMs": 1800000 } // 30 分钟
|
|
150
|
-
```
|
|
146
|
+
旧版本写进 shell 或 `cordis.patch.yml` 的 `{ "totalTimeoutMs": 1800000 }` 可以继续被读取用于历史回放,但**不会生效**;不需要为了“无限执行”把它改成 0 或填极大值。
|
|
151
147
|
|
|
152
148
|
## 安全与隐私(可以自己复核)
|
|
153
149
|
|
|
@@ -212,8 +208,8 @@ npm audit --omit=dev
|
|
|
212
208
|
**数字和以前不一样了?**
|
|
213
209
|
1.4.3 之后数字来自真实状态而不是缓存,所以会比旧版本「更小、但更准」(旧版本的完成率经常虚高)。
|
|
214
210
|
|
|
215
|
-
**子 Agent
|
|
216
|
-
5
|
|
211
|
+
**子 Agent 很久没有新消息,是卡住了吗?**
|
|
212
|
+
不会因为 5 分钟没有新事件就自动判卡住、blocked 或换人。负责人和专家可以持续执行;你可以随时询问进度,或明确取消任务。只有真实完成、真实错误、证据/质量门禁不通过或你显式取消才会改变状态。若之前因旧版本自动中断,对主 Agent 说「续跑这个计划」即可从受阻处继续,已完成的产物不会重做。
|
|
217
213
|
|
|
218
214
|
## 卸载
|
|
219
215
|
|
package/client.js
CHANGED
|
@@ -225,29 +225,30 @@ window.__ModuleLoader__.load({
|
|
|
225
225
|
"vizOverall": "总体进度",
|
|
226
226
|
"allPlansHint": "上面是当前各会话最新计划的合计;历史计划不在此汇总,下面每张卡片只统计本计划。",
|
|
227
227
|
"openHint": "打开左侧「任务进度」看完整安排。",
|
|
228
|
-
"timeNegotiation": "
|
|
228
|
+
"timeNegotiation": "执行时间(无时限)",
|
|
229
|
+
"noTimeLimit": "部门负责人和全球顶尖专家执行无时限;预估仅供参考,不影响完成验收",
|
|
229
230
|
"reasoningEffort": "推理等级",
|
|
230
|
-
"estimateMinutes": "
|
|
231
|
-
"negotiatedCeiling": "
|
|
232
|
-
"derived": "
|
|
233
|
-
"negotiatedDeadline": "
|
|
231
|
+
"estimateMinutes": "预估时长(仅信息)",
|
|
232
|
+
"negotiatedCeiling": "历史上限(已失效)",
|
|
233
|
+
"derived": "历史派生",
|
|
234
|
+
"negotiatedDeadline": "历史截止(已失效)",
|
|
234
235
|
"startedAtLabel": "开始时间",
|
|
235
236
|
"remaining": "剩余",
|
|
236
237
|
"minutes": "分钟",
|
|
237
238
|
"seconds": "秒",
|
|
238
|
-
"timeExtensions": "
|
|
239
|
-
"startNotice": "
|
|
240
|
-
"timeWarning": "
|
|
241
|
-
"pendingAdjudication": "
|
|
242
|
-
"pendingAdjudicationHint": "
|
|
239
|
+
"timeExtensions": "历史延期记录(不再生效)",
|
|
240
|
+
"startNotice": "开工预估(仅信息)",
|
|
241
|
+
"timeWarning": "历史时间提示",
|
|
242
|
+
"pendingAdjudication": "历史待裁决标记",
|
|
243
|
+
"pendingAdjudicationHint": "这是旧记录;当前没有执行截止,以真实结果、验收证据或用户取消为准。",
|
|
243
244
|
"noticeChannel": "预告通道",
|
|
244
245
|
"noticeChannelObserved": "已观测到送达",
|
|
245
246
|
"noticeChannelAwaiting": "等待观测",
|
|
246
247
|
"noticeChannelNotObserved": "未观测到送达",
|
|
247
248
|
"reason": "原因",
|
|
248
|
-
"leaderEstimateFull": "
|
|
249
|
-
"leaderEstimatePartial": "下属开工预估部分和:{minutes} 分钟({reported}/{expected} 已上报{gaps}
|
|
250
|
-
"leaderEstimateOver": "
|
|
249
|
+
"leaderEstimateFull": "全部下属开工预估之和:{minutes} 分钟({reported}/{expected} 已上报)|仅用于协调,不构成时间判据",
|
|
250
|
+
"leaderEstimatePartial": "下属开工预估部分和:{minutes} 分钟({reported}/{expected} 已上报{gaps})|未报齐时如实显示部分和,不影响完成验收",
|
|
251
|
+
"leaderEstimateOver": "预估合计 {minutes} 分钟(仅信息,无超时或完成限制)",
|
|
251
252
|
"leaderEstimateMissing": ",缺:{names}",
|
|
252
253
|
"leaderEstimateFailed": ",报送失败:{names}",
|
|
253
254
|
},
|
|
@@ -459,29 +460,30 @@ window.__ModuleLoader__.load({
|
|
|
459
460
|
"vizOverall": "Overall progress",
|
|
460
461
|
"allPlansHint": "These totals cover the latest plan in each live session; older plans are not included. Each card below counts only its own plan.",
|
|
461
462
|
"openHint": "Open “Task progress” on the left for the full plan.",
|
|
462
|
-
"timeNegotiation": "
|
|
463
|
+
"timeNegotiation": "Execution time (no limit)",
|
|
464
|
+
"noTimeLimit": "Department leads and domain experts have no execution time limit; estimates are informational and do not affect acceptance",
|
|
463
465
|
"reasoningEffort": "Reasoning effort",
|
|
464
|
-
"estimateMinutes": "Estimate",
|
|
465
|
-
"negotiatedCeiling": "
|
|
466
|
-
"derived": "derived",
|
|
467
|
-
"negotiatedDeadline": "
|
|
466
|
+
"estimateMinutes": "Estimate (informational)",
|
|
467
|
+
"negotiatedCeiling": "Historical ceiling (inactive)",
|
|
468
|
+
"derived": "historical derived value",
|
|
469
|
+
"negotiatedDeadline": "Historical deadline (inactive)",
|
|
468
470
|
"startedAtLabel": "Started at",
|
|
469
471
|
"remaining": "remaining",
|
|
470
472
|
"minutes": "min",
|
|
471
473
|
"seconds": "s",
|
|
472
|
-
"timeExtensions": "
|
|
473
|
-
"startNotice": "Start
|
|
474
|
-
"timeWarning": "
|
|
475
|
-
"pendingAdjudication": "
|
|
476
|
-
"pendingAdjudicationHint": "
|
|
474
|
+
"timeExtensions": "Historical extensions (inactive)",
|
|
475
|
+
"startNotice": "Start estimate (informational)",
|
|
476
|
+
"timeWarning": "Historical time notice",
|
|
477
|
+
"pendingAdjudication": "Historical pending-decision marker",
|
|
478
|
+
"pendingAdjudicationHint": "Legacy record only; there is no execution deadline. Results, acceptance evidence, or explicit user cancellation determine completion.",
|
|
477
479
|
"noticeChannel": "Notice channel",
|
|
478
480
|
"noticeChannelObserved": "Delivery observed",
|
|
479
481
|
"noticeChannelAwaiting": "Awaiting observation",
|
|
480
482
|
"noticeChannelNotObserved": "Delivery not observed",
|
|
481
483
|
"reason": "reason",
|
|
482
|
-
"leaderEstimateFull": "
|
|
483
|
-
"leaderEstimatePartial": "Partial sum of delegate start estimates: {minutes} min ({reported}/{expected} reported{gaps}) |
|
|
484
|
-
"leaderEstimateOver": "
|
|
484
|
+
"leaderEstimateFull": "Sum of all delegate start estimates: {minutes} min ({reported}/{expected} reported) | Coordination only, not a time criterion",
|
|
485
|
+
"leaderEstimatePartial": "Partial sum of delegate start estimates: {minutes} min ({reported}/{expected} reported{gaps}) | Informational only; incomplete estimates do not affect acceptance",
|
|
486
|
+
"leaderEstimateOver": "Estimate total: {minutes} min (informational; no timeout or completion limit)",
|
|
485
487
|
"leaderEstimateMissing": ", missing: {names}",
|
|
486
488
|
"leaderEstimateFailed": ", delivery failed: {names}",
|
|
487
489
|
}
|
|
@@ -1573,13 +1575,13 @@ window.__ModuleLoader__.load({
|
|
|
1573
1575
|
return h('div', { className: 'dsh-wp-banner dsh-wp-banner--error', role: 'alert' }, h('div', { className: 'dsh-wp-section-title' }, t('error')), h('div', { className: 'dsh-wp-error-text' }, message || t('noResult')), h('button', { type: 'button', className: 'dsh-wp-button', style: { marginTop: '8px' }, onClick: onRetry }, t('retry')));
|
|
1574
1576
|
}
|
|
1575
1577
|
/*
|
|
1576
|
-
* [
|
|
1578
|
+
* [3.0.1] 看板:执行时间信息与历史回放。
|
|
1577
1579
|
*
|
|
1578
|
-
*
|
|
1579
|
-
* - 计划定义:estimateMinutes
|
|
1580
|
-
* - 状态行:startedAt/
|
|
1581
|
-
* timeNotice
|
|
1582
|
-
*
|
|
1580
|
+
* 负责人和专家执行无时限,客户端不得显示倒计时、协商上限或“到点会怎样”:
|
|
1581
|
+
* - 计划定义:estimateMinutes 仅参考;timeoutMs 是历史字段,不形成截止;
|
|
1582
|
+
* - 状态行:startedAt 仅用于已执行时长;deadlineAt/timeJournal/timeWarning/
|
|
1583
|
+
* pendingAdjudication 只作历史标记;timeNotice 是开工信息;
|
|
1584
|
+
* noticeChannel 是子→主送达观测;
|
|
1583
1585
|
* [T7] leaderEstimate(负责人时长聚合,服务端读时派生:全员 sent 表述完整等式,
|
|
1584
1586
|
* 否则部分和+缺口名单;null/缺失整块不渲染,客户端严禁求和)。
|
|
1585
1587
|
*
|
|
@@ -1588,24 +1590,10 @@ window.__ModuleLoader__.load({
|
|
|
1588
1590
|
*/
|
|
1589
1591
|
function TimeNegotiation({ item, subtask, t }) {
|
|
1590
1592
|
const estimate = positiveNumber(subtask?.estimateMinutes);
|
|
1591
|
-
const deadlineAt = positiveNumber(item?.deadlineAt);
|
|
1592
|
-
const startedAt = positiveNumber(item?.startedAt);
|
|
1593
1593
|
const journal = Array.isArray(item?.timeJournal) ? item.timeJournal : [];
|
|
1594
1594
|
const extensions = journal
|
|
1595
1595
|
.filter((entry) => entry?.action === 'extend' && positiveNumber(entry?.extendMs))
|
|
1596
1596
|
.slice(-3);
|
|
1597
|
-
/*
|
|
1598
|
-
* [2.2.3][N2] D2「协商上限」结构性不可达:计划里没有 timeoutMs 时,
|
|
1599
|
-
* 用 deadlineAt - startedAt - 已延期 派生一个只读上限,明确标注“派生”,
|
|
1600
|
-
* 不写回计划、不把派生值冒充用户授权值。
|
|
1601
|
-
*/
|
|
1602
|
-
const extensionTotal = extensions.reduce((sum, entry) => sum + Number(positiveNumber(entry?.extendMs) ?? 0), 0);
|
|
1603
|
-
const declaredCeiling = positiveNumber(subtask?.timeoutMs);
|
|
1604
|
-
const derivedCeiling = !declaredCeiling && startedAt && deadlineAt
|
|
1605
|
-
? Math.max(0, deadlineAt - startedAt - extensionTotal)
|
|
1606
|
-
: null;
|
|
1607
|
-
const ceiling = declaredCeiling ?? derivedCeiling;
|
|
1608
|
-
const ceilingLabel = declaredCeiling ? t('negotiatedCeiling') : `${t('negotiatedCeiling')}(${t('derived')})`;
|
|
1609
1597
|
const notice = item?.timeNotice && typeof item.timeNotice === 'object' ? item.timeNotice : null;
|
|
1610
1598
|
const warning = item?.timeWarning && typeof item.timeWarning === 'object' ? item.timeWarning : null;
|
|
1611
1599
|
const channel = item?.noticeChannel && typeof item.noticeChannel === 'object' ? item.noticeChannel : null;
|
|
@@ -1623,21 +1611,9 @@ window.__ModuleLoader__.load({
|
|
|
1623
1611
|
const leaderReported = leaderEstimate && Number.isInteger(leaderEstimate.reported) && leaderEstimate.reported >= 0 ? leaderEstimate.reported : null;
|
|
1624
1612
|
const leaderMinutes = leaderEstimate && Number.isFinite(Number(leaderEstimate.totalMinutes)) && Number(leaderEstimate.totalMinutes) >= 0 ? Number(leaderEstimate.totalMinutes) : null;
|
|
1625
1613
|
const leaderShown = leaderEstimate !== null && leaderExpected !== null && leaderReported !== null && leaderMinutes !== null;
|
|
1626
|
-
|
|
1627
|
-
return null;
|
|
1628
|
-
}
|
|
1629
|
-
const remainingMs = deadlineAt ? Math.max(0, deadlineAt - Date.now()) : null;
|
|
1630
|
-
const facts = [];
|
|
1614
|
+
const facts = [t('noTimeLimit')];
|
|
1631
1615
|
if (estimate)
|
|
1632
1616
|
facts.push(`${t('estimateMinutes')}:${estimate} ${t('minutes')}`);
|
|
1633
|
-
if (ceiling)
|
|
1634
|
-
facts.push(`${ceilingLabel}:${Math.round(ceiling / 60000)} ${t('minutes')}`);
|
|
1635
|
-
if (deadlineAt) {
|
|
1636
|
-
const left = remainingMs && remainingMs > 0
|
|
1637
|
-
? `(${t('remaining')} ${Math.max(1, Math.round(remainingMs / 60000))} ${t('minutes')})`
|
|
1638
|
-
: '';
|
|
1639
|
-
facts.push(`${t('negotiatedDeadline')}:${formatTime(deadlineAt)}${left}`);
|
|
1640
|
-
}
|
|
1641
1617
|
const notes = [];
|
|
1642
1618
|
if (notice) {
|
|
1643
1619
|
const declared = positiveNumber(notice.declaredMinutes);
|
|
@@ -1681,14 +1657,7 @@ window.__ModuleLoader__.load({
|
|
|
1681
1657
|
notes.push(leaderReported === leaderExpected
|
|
1682
1658
|
? fill(t('leaderEstimateFull'), { minutes: leaderMinutes, reported: leaderReported, expected: leaderExpected })
|
|
1683
1659
|
: fill(t('leaderEstimatePartial'), { minutes: leaderMinutes, reported: leaderReported, expected: leaderExpected, gaps }));
|
|
1684
|
-
|
|
1685
|
-
* [SCv2-T4][Q4-B/C21] 超判据告警:只读服务端下发的布尔
|
|
1686
|
-
* leaderEstimateOverCriterion(normaliseStatusEntry 派生),客户端
|
|
1687
|
-
* 严禁自行算术(client.ts 既定约定)。部分和 >10 同样告警(AC-Q4-2)。
|
|
1688
|
-
*/
|
|
1689
|
-
if (item?.leaderEstimateOverCriterion === true) {
|
|
1690
|
-
notes.push(fill(t('leaderEstimateOver'), { minutes: leaderMinutes }));
|
|
1691
|
-
}
|
|
1660
|
+
// 历史 leaderEstimateOverCriterion 字段不再渲染为告警;预估不构成时间判据。
|
|
1692
1661
|
}
|
|
1693
1662
|
return h('div', { className: 'dsh-wp-time' }, h('div', { className: 'dsh-wp-time-title' }, t('timeNegotiation')), facts.length > 0
|
|
1694
1663
|
? h('div', { className: 'dsh-wp-time-row' }, facts.map((fact, factIndex) => h('span', { key: String(factIndex) }, fact)))
|
|
@@ -13,7 +13,7 @@ G-08(ADV-FSP.1 独立接口规范缺失)。核对方法:工具名逐一来
|
|
|
13
13
|
|
|
14
14
|
TOE 对外暴露 **2 类接口**:9 个 Agent 工具(宿主注入给模型调用)+ 1 个本地 HTTP 路由(面板数据源)。
|
|
15
15
|
|
|
16
|
-
### 1.1 Agent 工具(
|
|
16
|
+
### 1.1 Agent 工具(14 个)/ Agent tools
|
|
17
17
|
|
|
18
18
|
| # | 工具 | 调用者 | 用途(一句话) | 关键参数 | 失败/拒绝行为 |
|
|
19
19
|
|---|---|---|---|---|---|
|
|
@@ -30,13 +30,26 @@ TOE 对外暴露 **2 类接口**:9 个 Agent 工具(宿主注入给模型调
|
|
|
30
30
|
| 11 | `dsh_workplan_lessons` | 根会话 / 子 Agent(只读) | 查看永久教训记忆(`list` / `search` / `stats`) | `action`、`department`、`query`、`limit` | 只读,不写计划状态、不提供写入动作;记忆只能由阶段三复盘通过后的完成判定写入 |
|
|
31
31
|
| 12 | `dsh_workplan_delegate` | 部门负责人子 Agent(2.3.9;2.5.0 强化) | 第三层派发:先提交「两轮深度思考」产物(第一轮全面、全盘、深入梳理研究思考自己的任务,第二轮基于其全部结果理清方法、流程、步骤),再把任务拆成更简单的单项工作分给本部门多名顶尖专家与组员 | `action: review/dispatch/status/self_effort`、`consolidation{problemAnalysis, approach, approachBasis, assignments[], taskReasoningEffort?}`、self_effort 携带 `reasoningEffort+complexityRationale+deepThink{problemAnalysis, approach, approachBasis}`(2.5.2 叶子执行前硬门禁) | 非部门负责人子会话(根会话 / 第三层叶子)拒绝;`review` 未登记时 `dispatch` 返回 `DELEGATE_CONSOLIDATION_MISSING`;两轮产物缺 approach/approachBasis 返回 `DELEGATE_CONSOLIDATION_INCOMPLETE`(2.5.1);分工表缺 expert 或 member 返回 `DELEGATE_ROLE_MIX_REQUIRED`;越界推理等级按模型家族集合钳制并留痕;`taskReasoningEffort` 非法返回 `DELEGATE_TASK_EFFORT_INVALID`,合法则钳制后写入状态行 `effortOverride`(五档白名单消毒 + durable 回放 + 尝试重置不清除),派发链每次激活经 `resolveTaskEffort` 优先读它,下级档位以成员 self_effort 自配为权威(分工表档仅建议;继承仅旧计划回放兼容);下级子会话 `maxDepth:2`,第四层由宿主深度上限硬拒 |
|
|
32
32
|
|
|
33
|
+
| 13 | `dsh_workplan_hold` | 主 Agent(仅根会话) | 认可闸门·显式按住:把尚未派发的计划置为「用户认可前不得派发」(3.0.0 本地修复;与任务锚点关键词识别互为双保险) | `planId?`, `reason` | 已派发的计划拒绝;已按住时幂等返回 |
|
|
34
|
+
| 14 | `dsh_workplan_release` | 主 Agent(仅根会话) | 认可闸门·解除并开跑:登记用户认可留痕(`gateHistory`,durable 回放不丢)后立即派发,语义与 `dsh_workplan_dispatch` 同一套闸门 | `planId?`, `note`, `deepThink?`, `mode?` | 非 held 计划返回 `NOT_HELD`;解除后派发若被 deepThink 等门禁拒绝,闸门保持已解除、认可事实无需重来 |
|
|
35
|
+
|
|
33
36
|
### 1.2 HTTP 路由(1 个)/ HTTP route
|
|
34
37
|
|
|
35
38
|
| 路由 | 方法 | 用途 | 安全头 | 说明 |
|
|
36
39
|
|---|---|---|---|---|
|
|
37
40
|
| `/dsh-workplan/plans` | GET | 返回面板所需的计划状态数据 | `x-content-type-options: nosniff`、`referrer-policy: no-referrer`(`HARDENING_HEADERS`,见 `tests/security-headers.test.ts`) | 非该路径一律拒绝(`src/runtime.ts` L5516);只读,无写入接口 |
|
|
38
41
|
|
|
39
|
-
### 1.3
|
|
42
|
+
### 1.3 宿主生命周期订阅(3 个)/ Host lifecycle subscriptions
|
|
43
|
+
|
|
44
|
+
这些事件是插件与 DSH 宿主的内部协作入口,不是新增模型工具或 HTTP 路由。
|
|
45
|
+
|
|
46
|
+
| 事件 | 触发时机 | 本插件行为 | 边界与失败防护 |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| `agent/pre-step` | 模型步骤开始前 | 识别真实任务、启动后台规划;在途规划期间允许后续 step 的不同真实任务取代旧规划 | 非根会话、内部通知、社交/状态/空泛续跑不启动或取消规划;相同任务去重 |
|
|
49
|
+
| `agent/inbox/inserted` | followup/queue 消息进入 live inbox | 收尾正在等待旧规划时,不同真实人类任务入队即中止旧规划,防止旧结果迟到覆盖 | 只认 `source.kind=user` 或省略的人类消息;同任务、状态问题和内部 workplan 通知不取消;旧规划经 `superseded + AbortController` 静默退出 |
|
|
50
|
+
| `agent/turn-stopping` | 自然收尾且 next-step inbox 为空 | 等待在途规划结算,并把成功/降级/澄清结果一次性交回主 Agent;随后执行既有未完成与认可闸门 | 若等待期间已由另一规划接替,旧 waiter 退出;held 计划交回后仍等待用户认可,不进入重复 steer |
|
|
51
|
+
|
|
52
|
+
### 1.4 不存在的接口(负面声明)/ Interfaces that do NOT exist
|
|
40
53
|
|
|
41
54
|
- 无网络出站调用、无遥测上报(零运行时依赖,`package.json` `dependencies` 为空)。
|
|
42
55
|
- 无鉴权/账户体系(见 ST 假设 A-1:宿主环境已鉴别,TOE 不自做鉴别)。
|
|
@@ -44,4 +57,4 @@ TOE 对外暴露 **2 类接口**:9 个 Agent 工具(宿主注入给模型调
|
|
|
44
57
|
|
|
45
58
|
## 2. SFR 对应 / SFR trace
|
|
46
59
|
|
|
47
|
-
接口行为与 ST(`docs/cc/SECURITY-TARGET.md`)SFR 的对应:审计留痕→FAU_GEN(状态变更全留档);访问控制→FDP_ACC/ACF(文件沙箱 + presented-write-guard);域隔离→FPT_SEP
|
|
60
|
+
接口行为与 ST(`docs/cc/SECURITY-TARGET.md`)SFR 的对应:审计留痕→FAU_GEN(状态变更全留档);访问控制→FDP_ACC/ACF(文件沙箱 + presented-write-guard);域隔离→FPT_SEP(子会话隔离);会话终止→FTA_SSL(负责人/专家执行无总时长、单次、空闲或无回执硬截止;旧时限配置与 deadline 仅历史回放,不再生成计时器;用户取消、真实错误与证据/质量门禁仍有效)。
|