dsh-rolegroup 0.11.7 → 0.12.1

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 CHANGED
@@ -3,8 +3,115 @@
3
3
  本项目遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。
4
4
  版本纪律见 `AGENTS.md`「提交与发布」。
5
5
 
6
- > **`npm` 上一个已发布版本是 `0.6.1`。** 这期间开发中用过 0.6.2 / 0.6.3 / 0.8.0 等内部里程碑号,
7
- > 但都没有发布;下面 `0.7.0` 是**自 `0.6.1` 以来的累积变更**(按 semver 只升一个 minor,不跳号)。
6
+ > **历史注记**:`0.7.0` 发布前,npm 上的上一版本是 `0.6.1`;这期间开发中用过 0.6.2 / 0.6.3 / 0.8.0 等
7
+ > 内部里程碑号但都没发布,所以 `0.7.0` 是**自 `0.6.1` 以来的累积变更**(按 semver 只升一个 minor,不跳号)。
8
+ > 当前 npm 上的 latest 见 registry(2026-11-16 查 `dist-tags.latest` = `0.11.7`)。
9
+
10
+ ---
11
+
12
+ ## [0.12.1] — 2026-11-19
13
+
14
+ ### Fixed
15
+
16
+ - **实例配置不再携带已退役键 `modelSelectionSettings`**(dsh 0.2.2-rc.5 核对,2026-11-19)。该键在
17
+ 0.2.1-rc.1 起被上游改名为 `modelSelection`(升级指南
18
+ `docs/upgrade-guide/v0.2.1-rc.1/subagent-control-tools/guide.md:12`),
19
+ rc.5 的 schema 对旧键名**不消费也不报错**——传 `true` 也不会开启调用期路由字段。此前它一直躺在
20
+ `buildInstanceConfig` 里,靠 schemastery「未知键原样保留」侥幸无害;现删除,行为不变(缺省即 false)。
21
+ - 注释与文档同步:`lib/index.js` / `lib/roles.js` 头注中关于 `install(ctx, undefined)` 站立式组合、
22
+ `assertAllowedModelSelection` 白名单的说法改为按 rc.5 契约措辞(`modelSelection` 缺省 false → 不暴露
23
+ 调用期路由字段)。
24
+
25
+ ### Changed
26
+
27
+ - README 中英「本机实测」版本改为 0.2.2-rc.5(`engines.dsh` 保持 `>=0.2.1-rc.1`)。
28
+ - **设置页导航图标改用官方 `settings.section.icon` 槽位注册**(rc.5 新增,contract/slots.d.ts:85),
29
+ 替换旧的「data 属性 + scoped CSS mask」装饰 hack;registration id = section id(`rolegroup`)。
30
+ 组件是 settings-nav-icon.js 导出的真 React 组件(顶层 `import * as React from 'react'`——client
31
+ 环境不存在全局 React 注入点,第一版那么取导致图标渲染为空,2026-11-19 截图实证后修复);
32
+ `index.js` 经动态 import 取 NavGlyph 并 catch 兜底。**低版本 dsh(< rc.5)上该注册无消费方 =
33
+ 静默 no-op**,其余功能不受影响,故 engines.dsh 维持 `>=0.2.1-rc.1`;README 中英头部各加一行说明。
34
+ 浏览器验收通过(2026-11-19 用户确认图标出现)。
35
+ - 新增两条部署树断言(`tests/smoke.mjs`):① `buildInstanceConfig` 的输出经 rc.5 真实 Config schema
36
+ 逐字段解析通过且不含退役键;② 旧键名即使传 `true` 也不改变 `modelSelection` 缺省语义(no-op 锁定)。
37
+ 证伪:把 `modelSelectionSettings: false` 塞回实现 → 第 ① 条红。
38
+ - 图标迁移的断言:svg 描述 + size 回落、createElement 展开计数、退役字符串卫生检查、
39
+ gating 用例改按槽位名分流 + __dshRgStubImport 桩通道(node 不加载 react 依赖模块)。AGENTS.md 坑清单同步改写。
40
+
41
+ ### 验证(0.2.2-rc.5 真机)
42
+
43
+ - 启动报告 8/8 注册,`failed` / `invalid` / `problems` 全空(`~/.dsh/plugins/dsh-rolegroup/last-startup.json`,2026-11-19T02:37:33Z);
44
+ - schemastery 软链指向部署树 3.19.0,`npm run link:deps` 输出「无需改动」;
45
+ - `npm test` 158 passed;`npm run build:client` 重建产物含 `require("react")` 与 icon 槽位注册;
46
+ 浏览器实测图标出现(2026-11-19)。
47
+
48
+ ### 核对过的升级项(均不适用)
49
+
50
+ `v0.2.2-rc.4/web-search-deepseek-model-default`(只改 web 搜索默认提供方)、
51
+ `v0.2.2-rc.3/deepseek-refusal-code`(错误码改名,插件不消费)。委派、Agent Preset、settings、
52
+ manifest、schemastery 五个依赖面逐项对照 rc.5 安装版源码核验,契约全部存活。
53
+
54
+ Removes the retired `modelSelectionSettings` key from instance configs (renamed to `modelSelection`
55
+ upstream since 0.2.1-rc.1; rc.5's schema ignores it silently). Behavior unchanged — the default is
56
+ already false. Adds two deployment-tree assertions that parse our instance config through the real
57
+ rc.5 Config schema and pin the retired key as a no-op. Updates the verified-on version in both READMEs
58
+ to 0.2.2-rc.5.
59
+
60
+ ---
61
+
62
+ ## [0.12.0] — 2026-11-16
63
+
64
+ ### Added
65
+
66
+ - 新增 `/rg <任务>` 命令(`/rolegroup work <任务>` 长别名):向主会话注入一条
67
+ `source.kind='rolegroup'` 的委派指令;只主会话可用,子会话拒绝;不点名具体角色,按在册公告选择。
68
+
69
+ ### Changed
70
+
71
+ - 角色委派方法论:`analyst` / `reviewer` / `scout` 的 persona 增加核验纪律(逐字引用、`UNVERIFIED`、
72
+ `PARTIAL` 与 `FALSE` 的区分);`roleAnnouncement` 增加简报模板、父 agent 规范(子任务结论是输入不是裁决)
73
+ 和角色分流(代码定位/事实取证 → scout,带验收标准的收口核对 → reviewer,设计判断 → analyst;
74
+ 实现任务已有结构化计划或规格才派 coder,未形成计划的可先派 planner)。
75
+ - 依据:2026-11-16 的四臂对照。同一 `analyst` 下,中性简报逐字准确;加了“如果全真就说 5/5 TRUE”的简报
76
+ 把 5 条部分成立的命题全判 `TRUE` 并编造引用。完整记录在内部评测档案,不随仓库公开。
77
+ - 角色公告明确备用链只在配置提供 `fallbackModels` 时生效,示例路由改为 `kimi-coding/k3.1-pro`,并明确角色工具仅主会话可用。
78
+ - coder/planner 去方法论化:内置 persona 不再写死 TDD 与 plans.md;计划/规格路径由调用方简报给出(兼容 openspec
79
+ 的 tasks.md、superpowers 的 docs/plans/*.md、changeflow 的 plans/<change>.md),验证节奏以计划描述为准。
80
+ 注意传播断点:已在面板保存过角色的用户,其内联 persona 不受内置表变更影响,需「恢复官方推荐」或手动编辑才能切换到新默认。
81
+
82
+ ### Fixed
83
+
84
+ - 启动期改用备用档后,末次角色公告会按实际路由重发,并列出「已改用备用档」的角色;重挂失败或被 preset
85
+ 健康审计剔除的角色不会再同时出现在这条备用档提示里。
86
+ - 零在册角色且有降级时,公告只说明当前无角色、列出降级并给出 `/rolegroup doctor`,不再输出空角色列表、
87
+ `fallback` 分流或简报模板;降级段也删去了并不总成立的「其余角色不受影响」。零角色且无降级时公告返回空串。
88
+ - provider 已注册但模型未在广告列表的角色,除了启动日志,现在也会在公告中列出「模型未在广告列表」及
89
+ 「委派预检可能失败」;降级与该预警可并存,风险条目使用 resolved 实际备用路由,不再错写主路由。
90
+ - 修复路由解析返回角色副本后按对象 key 回收导致的 fiber/preset 残留;重挂失败立即按 toolName 从有效角色
91
+ 剔除并回收资源,后续审计 reject/timeout 不再把它留在 registered,也不影响其他健康角色。
92
+ - 修正公告的备用链与证据要求:不再声称所有角色都有备用链;代码、运行、图片与外部事实分别要求文件:行号、
93
+ 命令与输出、区域/坐标和原始来源,无法复现的按 UNVERIFIED 处理。
94
+ - 文档修正与精简:源码首装改为 `npm install --omit=peer` → `link:deps`,analyst 示例回到
95
+ `qwen3.8-max`,vision 备用链说明补齐账号档;删除过期的测试数量,合并重复安装说明并压缩 doctor 正常示例。
96
+
97
+ ### 验证
98
+
99
+ - `npm test` 154 passed;
100
+ - `npm run build:client` 连跑两次,产物 hash 一致(构建确定性);
101
+ - 真实 DSH 中 `/rolegroup doctor`:重载前后均 8 个角色在册,`failed` / `invalid` / `problems` 为空;
102
+ - 一次 `/rg` 实际委派:命中 `fallback`,返回了包名与版本;
103
+ - 插件停用再启用后,启动报告的时间字段有更新。
104
+
105
+ 截至定版时尚未执行 `npm publish`。
106
+
107
+ ### English summary
108
+
109
+ Adds `/rg` for role-based delegation from the main session. Changes delegation verification discipline
110
+ (verbatim citations, evidence requirements per fact type) and makes coder/planner methodology-neutral so
111
+ callers pass their own plan or spec paths. Fixes lifecycle cleanup (no leftover fiber/preset when
112
+ re-registration fails), warnings that now report the actual fallback route, and role announcement text that
113
+ no longer overclaims fallback chains or hides degradation states. Also corrects and trims the bilingual
114
+ installation, model, and diagnostics documentation.
8
115
 
9
116
  ---
10
117
 
package/README.en.md CHANGED
@@ -7,7 +7,10 @@ instance, so the tool name is the role name.
7
7
  The role/category binding is inspired by
8
8
  [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent) ("omo"); see §9.
9
9
 
10
- > Version **0.11.7** | dsh **≥ 0.2.1-rc.1** (verified on 0.2.2-rc.3) | MIT
10
+ > Version **0.12.1** | dsh **≥ 0.2.1-rc.1** (verified on 0.2.2-rc.5) | MIT
11
+ >
12
+ > The settings-page nav icon only shows on dsh ≥ 0.2.2-rc.5 (the official `settings.section.icon`
13
+ > slot exists from that version); everything else works on older releases.
11
14
 
12
15
  ---
13
16
 
@@ -30,11 +33,9 @@ delegation. The two can coexist in one deployment. A common pattern is to split
30
33
 
31
34
  | We do not | Why |
32
35
  |---|---|
33
- | **Orchestrate** (DAGs, multi-round collaboration, team pipelines) | That is the official Agent Teams' job; two orchestrators fight each other |
34
36
  | **Register an MCP server** | Dozens of tools inflate the tool list, the permission surface, and the prompt budget |
35
37
  | **Write a project-level state directory** (`.rolegroup/`) | We route work; we are not a runtime state machine — state belongs to the orchestration layer |
36
38
  | **Take over the main session's Agent Preset** | An explicit preset **replaces** the parent composition (§4); taking over means choosing for the user |
37
- | **Keep dual-shape branches for old dsh lines** | Since v0.6 we support ≥0.2.1 only; older lines get a clear error instead of half-working |
38
39
 
39
40
  When you need orchestration, state, or an MCP tool chain, compose other plugins — they do not replace this one.
40
41
 
@@ -49,12 +50,8 @@ dsh plugin --profile web add dsh-rolegroup
49
50
  You can also open the Plugins page, click "Add plugin", choose "Install a third-party plugin", enter
50
51
  `dsh-rolegroup`, and click "Install". Restart `dsh web` after installing.
51
52
 
52
- If a third-party market rewrite drops the plugin, add it again.
53
-
54
- ### Plugin market
55
-
56
- Open the Plugin Market, search for `dsh-rolegroup`, and install it. The market uses the same plugin manager
57
- underneath.
53
+ If a third-party market rewrite drops the plugin, add it again. You can also search for
54
+ `dsh-rolegroup` in the Plugin Market and install it — same flow underneath.
58
55
 
59
56
  ### From source
60
57
 
@@ -63,16 +60,19 @@ For development or local changes:
63
60
  ```sh
64
61
  git clone https://github.com/zhouxnsz/dsh-rolegroup.git
65
62
  cd dsh-rolegroup
63
+ npm install --omit=peer
66
64
  npm run link:deps
67
- npm install
68
65
  dsh plugin --profile web add "link:$PWD"
69
66
  ```
70
67
 
71
- `link:deps` symlinks the deployment's schemastery into this repo; the Settings panel needs it for source
72
- installs. Run `link:deps` before `npm install`: npm installs the `@deepseek-ai/schemastery` peer as a real
73
- copy, which blocks the symlink.
68
+ `--omit=peer` installs the esbuild devDependency without pulling the peer
69
+ `@deepseek-ai/schemastery` in as a real copy; `link:deps` then symlinks the deployment's schemastery into
70
+ this repo, which the Settings panel needs for source installs. The reverse order breaks: a plain
71
+ `npm install` puts a real copy there first, and `link:deps` **does not overwrite** an existing real
72
+ directory. If you already have one, delete `node_modules/@deepseek-ai/schemastery` and rerun `link:deps`.
74
73
 
75
- You can also mount it on the home layer:
74
+ You can also mount it on the home layer (use this only to survive profile rewrites; for regular
75
+ development use the `link:` install above):
76
76
 
77
77
  ```sh
78
78
  ln -sfn "$PWD" ~/.dsh/profiles/web/node_modules/dsh-rolegroup
@@ -95,6 +95,19 @@ dsh --profile web --dump-config | grep -A1 dsh-rolegroup # should show - id: d
95
95
  Restart `dsh web` and open a new session. The eight role tools should be in the tool list; you can also run
96
96
  `/rolegroup doctor` from the new session.
97
97
 
98
+ ### Delegate by role
99
+
100
+ Type:
101
+
102
+ ```
103
+ /rg <task>
104
+ ```
105
+
106
+ The plugin injects the task plus a "delegate by role" directive into the main session; the main model then
107
+ picks from the roles registered on this machine, writes briefs, and dispatches. `/rolegroup work <task>` is
108
+ the long alias. `/rg` is main-session only — child sessions get an error. It only triggers; whether to
109
+ dispatch is still the main model's call.
110
+
98
111
  After changing code, restart and open a new session. For panel saves, see §5.
99
112
 
100
113
  ## 3. Built-in roles
@@ -110,8 +123,8 @@ them in the panel. Model ids and the effective routes are whatever `/rolegroup d
110
123
  | Role | Built-in model | Responsibility |
111
124
  |---|---|---|
112
125
  | `analyst` | Qwen3.8 Max | Requirement clarification, path classification, plan review (do it / how), architecture decisions |
113
- | `planner` | Kimi K3.1 Pro | Plan design: file layout, task breakdown, interface contracts, writing `plans.md` |
114
- | `coder` | Kimi K3.1 Pro | Implementation: TDD red-green-refactor following `plans.md` steps |
126
+ | `planner` | Kimi K3.1 Pro | Plan design: file layout, task breakdown, interface contracts, writing the plan document |
127
+ | `coder` | Kimi K3.1 Pro | Implementation: follow the steps of the plan/spec document supplied in the brief and report evidence per step |
115
128
  | `reviewer` | Qwen3.8 Flash | Closing review: check acceptance criteria against evidence (was it actually done) |
116
129
  | `scout` | DeepSeek V4.1 Flash | Exploration and bulk search (returns `file:line` evidence) |
117
130
  | `scribe` | Qwen3.8 Flash | Documentation backfill, reports, spec maintenance |
@@ -120,8 +133,28 @@ them in the panel. Model ids and the effective routes are whatever `/rolegroup d
120
133
 
121
134
  ### Recommended bindings (official suggestion)
122
135
 
123
- See **[MODELS.en.md](./MODELS.en.md)** for the recommended model per role. "Recommended" and "built-in default"
124
- can differ — `reviewer` is one.
136
+ See **[MODELS.en.md](./MODELS.en.md)** for the built-in default model per role.
137
+
138
+ ### Delegation quality
139
+
140
+ Roles do not inherit the parent's context; the more specific the brief, the more usable the result. The
141
+ plugin gives the main model a fixed template in the system prompt:
142
+
143
+ - A brief should state: background, goal, constraints, acceptance, known facts (`file:line`), claims to verify;
144
+ - Factual conclusions need verifiable evidence: `file:line` for code, command and output for runtime results,
145
+ region/coordinates for images, and original sources for external facts;
146
+ quote verbatim, and unreproducible facts are marked UNVERIFIED;
147
+ - Do not prescribe the expected verdict distribution ("should be all true / should find problems"). The
148
+ 2026-11-16 comparison showed this wording makes `analyst` compress partially-true claims into `TRUE` and
149
+ fabricate quotes; the neutral briefs quoted verbatim.
150
+ - A subagent's conclusion is input, not a verdict. Spot-check quotes; do not adopt a confident report that
151
+ cannot show evidence.
152
+
153
+ Fallback chains apply only when a role configuration provides fallbackModels; an explicitly configured role
154
+ without that field does not inherit the built-in chain.
155
+ The degraded and model-unadvertised warnings can coexist, and preflight risk names the actual fallback route.
156
+
157
+ Use `scout` for code location and fact-finding, `reviewer` for acceptance-criteria closing review, and `analyst` for design judgement. For implementation, use `coder` when a structured plan or spec already exists (with its path supplied in the brief); if no plan has been formed, you may delegate to `planner` first.
125
158
 
126
159
  ## 4. Configuration
127
160
 
@@ -159,14 +192,11 @@ available, with repair hints when something is wrong. When a built-in fallback i
159
192
  > On a fresh machine, run `/rolegroup doctor` first to see which roles' primary routes are unavailable; change
160
193
  > bindings in the panel.
161
194
 
162
- Note: pasting text starting with `/` into the GUI composer sends it as a normal message, not a command. Type
163
- it by hand or pick it from the completion list.
164
-
165
195
  Example:
166
196
 
167
197
  > If a role's provider is not registered, an error block is appended below the table and the provider is
168
198
  > marked ❌. The role is not registered. This matters most for a fallback role: a skipped fallback route does
169
- > not exist. Built-in fallbacks point at dsh's own DeepSeek providers, which ship with every install:
199
+ > not exist. The built-in `fallback` role uses `deepseek-official` because that provider is always registered:
170
200
 
171
201
  ```
172
202
  ❌ fallback:provider "example-provider" 当前未注册(在用:deepseek-official, kimi-coding, qwen-token-plan-cn)
@@ -175,18 +205,9 @@ Example:
175
205
 
176
206
  ```
177
207
  dsh-rolegroup doctor — 8 个在册角色
178
- 快照时间 2026-10-25T12:00:00.000Z(0 天前)|配置来源 (内置默认表)
179
-
180
- 角色 绑定模型 provider 模型
181
- analyst qwen-token-plan-cn/qwen3.8-max ✅ ✅
182
- planner kimi-coding/k3.1-pro ✅ ✅
183
- coder kimi-coding/k3.1-pro ✅ ✅
184
- reviewer qwen-token-plan-cn/qwen3.8-flash ✅ ✅
185
- scout deepseek-official/deepseek-flash ✅ ✅
186
- scribe qwen-token-plan-cn/qwen3.8-flash ✅ ✅
187
- vision qwen-token-plan-cn/qwen3.8-flash ✅ ✅
188
- fallback deepseek-official/deepseek-flash ✅ ✅
189
-
208
+ analyst qwen-token-plan-cn/qwen3.8-max ✅ ✅
209
+ planner kimi-coding/k3.1-pro ✅ ✅
210
+ …
190
211
  ✅ 无异常
191
212
  ```
192
213
 
@@ -196,23 +217,17 @@ when the llm service is down the availability column shows ➖.
196
217
  ## 7. Development
197
218
 
198
219
  ```sh
199
- npm run link:deps # first after cloning: create the schemastery symlink
200
- npm install # then install the esbuild devDependency
201
- npm test # offline smoke suite, 158 cases; pretest runs link:deps
202
- npm run build:client # after editing src/client/** or lib/roles.js
220
+ npm install --omit=peer # esbuild devDependency, without schemastery as a real copy
221
+ npm run link:deps # symlink the deployment's schemastery into this repo
222
+ npm test # offline smoke suite (plain Node); pretest runs link:deps
223
+ npm run build:client # after editing src/client/** or lib/roles.js
203
224
  ```
204
225
 
205
- Run `link:deps` before `npm install`: npm installs the `@deepseek-ai/schemastery` peer as a real copy, which
206
- blocks the symlink. If you already ran `npm install`, delete `node_modules/@deepseek-ai/schemastery` and rerun
207
- `link:deps`. Without `npm install`, `npm test` fails with `ERR_MODULE_NOT_FOUND: esbuild`. Without
208
- `link:deps`, dsh prints
226
+ For the install order and why, see §2 "From source". Without `npm install`, `npm test` fails with
227
+ `ERR_MODULE_NOT_FOUND: esbuild`. Without `link:deps`, dsh prints
209
228
  `无法使用部署树的 @deepseek-ai/schemastery …` at startup and the plugin runs host-only: role tools still
210
- work, but the Settings section is missing.
211
-
212
- What `link:deps` does: the plugin is installed as a `link:`, so by Node's realpath rule it cannot import
213
- `@deepseek-ai/*` directly. Settings also requires the entry to export a schemastery `Config` statically,
214
- which cannot be resolved lazily. The script symlinks the deployment's schemastery into this repo; the symlink
215
- is not committed.
229
+ work, but the Settings section is missing. `pretest` runs `link:deps` automatically, but it likewise does
230
+ not overwrite an existing real copy.
216
231
 
217
232
  Layout:
218
233
 
package/README.md CHANGED
@@ -6,7 +6,10 @@ dsh 的角色化委派插件。先定义角色(名字、绑定模型、persona
6
6
  角色/类别绑定的思路参考了 [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent)(omo),
7
7
  详见 §9。
8
8
 
9
- > 版本 **0.11.7** | 要求 dsh **≥ 0.2.1-rc.1**(本机实测 0.2.2-rc.3)| MIT
9
+ > 版本 **0.12.1** | 要求 dsh **≥ 0.2.1-rc.1**(本机实测 0.2.2-rc.5)| MIT
10
+ >
11
+ > 设置页导航图标只在 dsh ≥ 0.2.2-rc.5 上显示(官方 `settings.section.icon` 槽位从该版本起提供);
12
+ > 低版本其余功能不受影响。
10
13
 
11
14
  ---
12
15
 
@@ -27,7 +30,6 @@ dsh 的角色化委派插件。先定义角色(名字、绑定模型、persona
27
30
 
28
31
  | 不做 | 为什么 |
29
32
  |---|---|
30
- | **不做编排**(DAG / 多轮协作 / 团队流水线) | 那是官方智能体团队的职责;两套编排会互相踩 |
31
33
  | **不注册 MCP server** | 几十个工具会把工具列表、权限面、prompt 预算一起撑大 |
32
34
  | **不写项目级状态目录**(`.rolegroup/`) | 我们做的是「路由」,不是「运行时状态机」;状态属于编排层 |
33
35
  | **不接管主会话的会话模式(Agent Preset)** | 显式 preset 是**替换**父组合(§4),接管等于替用户做选择 |
@@ -45,11 +47,8 @@ dsh plugin --profile web add dsh-rolegroup
45
47
  也可以在「插件」页 →「添加插件」→「安装第三方插件」,填 `dsh-rolegroup`,点「安装」。装好后重启
46
48
  `dsh web`。
47
49
 
48
- 如果第三方市场重写 profile 把插件清掉,重新 `add` 一次即可。
49
-
50
- ### 插件市场
51
-
52
- 打开「插件市场」,搜索 `dsh-rolegroup`,点安装。市场和上面的插件管理器走同一套安装流程。
50
+ 如果第三方市场重写 profile 把插件清掉,重新 `add` 一次即可。也可以在「插件市场」搜索
51
+ `dsh-rolegroup` 安装,走同一套流程。
53
52
 
54
53
  ### 从源码安装
55
54
 
@@ -58,15 +57,17 @@ dsh plugin --profile web add dsh-rolegroup
58
57
  ```sh
59
58
  git clone https://github.com/zhouxnsz/dsh-rolegroup.git
60
59
  cd dsh-rolegroup
60
+ npm install --omit=peer
61
61
  npm run link:deps
62
- npm install
63
62
  dsh plugin --profile web add "link:$PWD"
64
63
  ```
65
64
 
66
- `link:deps` 会把部署树的 schemastery 软链进来;源码安装时设置面板需要它。先跑 `link:deps` 再跑
67
- `npm install`:npm 会把 peer dependency `@deepseek-ai/schemastery` 装成真实副本,顺序反了会挡住软链。
65
+ `--omit=peer` 装 devDependency esbuild 而不把 peer `@deepseek-ai/schemastery` 装成真实副本;随后
66
+ `link:deps` 把部署树的 schemastery 软链进来,设置面板需要它。顺序反过来会踩坑:普通 `npm install`
67
+ 先装出真实副本,之后 `link:deps` 遇到真实目录**不覆盖**。已有真实副本时删掉
68
+ `node_modules/@deepseek-ai/schemastery` 再跑一次 `link:deps`。
68
69
 
69
- 也可以挂到 home 层:
70
+ 也可以挂到 home 层(仅当需要绕过 profile 重写时使用;常规开发用上面的 `link:` 安装):
70
71
 
71
72
  ```sh
72
73
  ln -sfn "$PWD" ~/.dsh/profiles/web/node_modules/dsh-rolegroup
@@ -77,8 +78,7 @@ cat >> ~/.dsh/cordis.patch.yml <<'YAML'
77
78
  YAML
78
79
  ```
79
80
 
80
- home 层不会被 profile 重写覆盖,但不会出现在「已安装」组,也没有启停开关。两种源码安装方式选一个,
81
- 不要同时用。
81
+ home 层不会被 profile 重写覆盖,但不会出现在「已安装」组,也没有启停开关。两种方式选一个,不要同时用。
82
82
 
83
83
  ### 验证
84
84
 
@@ -89,6 +89,18 @@ dsh --profile web --dump-config | grep -A1 dsh-rolegroup # 应出现 - id: dsh
89
89
  重启 `dsh web`,开一个新会话。工具列表里应该出现 8 个角色工具;也可以在新会话里跑
90
90
  `/rolegroup doctor`。
91
91
 
92
+ ### 按角色委派
93
+
94
+ 在会话里输入:
95
+
96
+ ```
97
+ /rg <任务>
98
+ ```
99
+
100
+ 插件会把任务和一段“按角色委派”的指令注入主会话;主模型据此从本机在册角色中选择、写简报并派发。
101
+ `/rolegroup work <任务>` 是长别名。`/rg` 只主会话可用,子会话调用会被拒绝;它只负责触发,
102
+ 是否派发仍由主模型判断。
103
+
92
104
  改代码后需要重启并开新会话。面板保存怎么生效,见 §5。
93
105
 
94
106
  ## 3. 内置角色
@@ -102,8 +114,8 @@ dsh --profile web --dump-config | grep -A1 dsh-rolegroup # 应出现 - id: dsh
102
114
  | 角色 | 内置绑定模型 | 职责 |
103
115
  |---|---|---|
104
116
  | `analyst` | Qwen3.8 Max | 需求澄清、路径分类、方案评审(做不做/怎么做)、架构决策 |
105
- | `planner` | Kimi K3.1 Pro | 计划设计:文件结构、任务拆分、接口契约、`plans.md` 落笔 |
106
- | `coder` | Kimi K3.1 Pro | 编码执行:按 `plans.md` 步骤 TDD 红-绿-重构 |
117
+ | `planner` | Kimi K3.1 Pro | 计划设计:文件结构、任务拆分、接口契约、计划文档落笔 |
118
+ | `coder` | Kimi K3.1 Pro | 编码执行:按计划/规格文档步骤实现并回填证据 |
107
119
  | `reviewer` | Qwen3.8 Flash | 收口审查:逐项核对验收标准与证据(做没做到) |
108
120
  | `scout` | DeepSeek V4.1 Flash | 探索定位、批量搜索(返回 `文件:行号` 证据) |
109
121
  | `scribe` | Qwen3.8 Flash | 文档回填、报告、spec 维护 |
@@ -112,7 +124,22 @@ dsh --profile web --dump-config | grep -A1 dsh-rolegroup # 应出现 - id: dsh
112
124
 
113
125
  ### 推荐绑定(官方建议)
114
126
 
115
- 各角色的官方推荐模型见 **[MODELS.md](./MODELS.md)**。表里「推荐」与「内置默认」可能不同,比如 `reviewer`。
127
+ 各角色的内置默认模型见 **[MODELS.md](./MODELS.md)**。
128
+
129
+ ### 委派质量
130
+
131
+ 角色不继承父会话上下文,简报越具体,返回越可用。插件在系统提示里给主模型一段固定模板:
132
+
133
+ - 简报至少写:背景、目标、约束、验收、已知事实(文件:行号)、待核验命题;
134
+ - 事实性结论必须有可核验依据:代码事实给文件:行号,运行结果给命令与输出,图片给区域/坐标,外部事实给原始来源;引用逐字,无法复现的按 UNVERIFIED 处理;
135
+ - 不要预设结论分布(不要写「应该全真/应该有问题」)。2026-11-16 的对照显示,这种写法会让 `analyst`
136
+ 把部分成立的命题压成 `TRUE` 并编造引用;中性简报逐字准确。
137
+ - 子任务结论是输入,不是裁决;主模型要抽查引用,重结论轻证据的回报不要直接采纳。
138
+
139
+ 备用链仅在角色配置提供 fallbackModels 时生效;显式配置的角色没写这个字段时,不继承内置链。
140
+ 降级与模型未广告预警可并存,预检风险使用实际备用路由。
141
+
142
+ 代码定位与事实取证用 `scout`;带验收标准的收口核对用 `reviewer`;设计判断用 `analyst`。实现任务已有结构化计划或规格时用 `coder`(路径随简报给出),未形成计划的可先派 `planner`。
116
143
 
117
144
  ## 4. 配置
118
145
 
@@ -160,18 +187,9 @@ doctor 会写明「主路由 X 不可用,已用内置备用档 Y」。
160
187
 
161
188
  ```
162
189
  dsh-rolegroup doctor — 8 个在册角色
163
- 快照时间 2026-10-25T12:00:00.000Z(0 天前)|配置来源 (内置默认表)
164
-
165
- 角色 绑定模型 provider 模型
166
- analyst qwen-token-plan-cn/qwen3.8-max ✅ ✅
167
- planner kimi-coding/k3.1-pro ✅ ✅
168
- coder kimi-coding/k3.1-pro ✅ ✅
169
- reviewer qwen-token-plan-cn/qwen3.8-flash ✅ ✅
170
- scout deepseek-official/deepseek-flash ✅ ✅
171
- scribe qwen-token-plan-cn/qwen3.8-flash ✅ ✅
172
- vision qwen-token-plan-cn/qwen3.8-flash ✅ ✅
173
- fallback deepseek-official/deepseek-flash ✅ ✅
174
-
190
+ analyst qwen-token-plan-cn/qwen3.8-max ✅ ✅
191
+ planner kimi-coding/k3.1-pro ✅ ✅
192
+ …
175
193
  ✅ 无异常
176
194
  ```
177
195
 
@@ -180,21 +198,16 @@ fallback deepseek-official/deepseek-flash ✅ ✅
180
198
  ## 7. 开发
181
199
 
182
200
  ```sh
183
- npm run link:deps # 首次 clone 后先跑:建 schemastery 软链
184
- npm install # 再装 devDependency esbuild
185
- npm test # 离线 smoke test,158 项;pretest 会自动跑 link:deps
186
- npm run build:client # 改了 src/client/** 或 lib/roles.js 后重建 lib/client.js
201
+ npm install --omit=peer # 装 devDependency esbuild,不把 schemastery 装成真实副本
202
+ npm run link:deps # 把部署树的 schemastery 软链进来
203
+ npm test # 离线 smoke suite(Node 直跑);pretest 会自动跑 link:deps
204
+ npm run build:client # 改了 src/client/** 或 lib/roles.js 后重建 lib/client.js
187
205
  ```
188
206
 
189
- 先跑 `link:deps` 再跑 `npm install`:npm 会把 `@deepseek-ai/schemastery` 这个 peer 装成真实副本,
190
- 顺序反了会挡住软链。如果已经装过,删掉 `node_modules/@deepseek-ai/schemastery` 再跑一次 `link:deps`。
191
- 不跑 `npm install`,`npm test` 会报 `ERR_MODULE_NOT_FOUND: esbuild`。不跑 `link:deps`,dsh 启动时会
192
- 打印 `无法使用部署树的 @deepseek-ai/schemastery …`,插件降级成 host-only:角色工具还能用,设置页
193
- 那一节会缺席。
194
-
195
- `link:deps` 是做什么的:插件以 `link:` 形式安装,按 Node 的 realpath 规则,没法直接 import
196
- `@deepseek-ai/*`;而 settings 要求条目静态导出 schemastery 的 `Config`,不能延迟解析。所以脚本把部署
197
- 树里的 schemastery 软链到本仓库,软链不会提交。
207
+ 安装顺序和原因见 §2「从源码安装」。不跑 `npm install`,`npm test` 会报
208
+ `ERR_MODULE_NOT_FOUND: esbuild`。不跑 `link:deps`,dsh 启动时会打印
209
+ `无法使用部署树的 @deepseek-ai/schemastery …`,插件降级成 host-only:角色工具还能用,设置页
210
+ 那一节会缺席。`pretest` 虽然自动跑 `link:deps`,但同样不会覆盖已存在的真实副本。
198
211
 
199
212
  目录:
200
213