dsh-subagent-dispatch-control 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +225 -2
- package/client.js +9781 -0
- package/cordis.patch.yml +13 -0
- package/docs/BOOST-EVIDENCE.md +259 -0
- package/docs/CONFORMANCE.md +236 -0
- package/docs/FACTS-CONTRACT.md +368 -0
- package/docs/FLOW-COVERAGE.md +215 -0
- package/docs/PACKAGE-README.md +858 -0
- package/docs/RANGE-PLAN.md +357 -0
- package/docs/SECURITY-NOTES.md +110 -0
- package/docs/SPLIT-PLAN.md +604 -0
- package/docs/STAGE3-CONTRACT.md +287 -0
- package/docs/TIER-ROUTING.md +275 -0
- package/docs/badge/CONFORMANCE.md +246 -0
- package/docs/badge/DETAIL.md +319 -0
- package/docs/badge/PROJECTIONS.md +264 -0
- package/docs/badge/TEST-PLAN.md +252 -0
- package/docs/images/badge-menu.png +0 -0
- package/docs/images/dispatch.png +0 -0
- package/docs/images/header.png +0 -0
- package/docs/images/pair-header.png +0 -0
- package/docs/images/pair-panel.png +0 -0
- package/docs/images/panel.png +0 -0
- package/docs/wiki/Home.md +43 -0
- package/docs/wiki//344/275/277/347/224/250/346/214/207/345/215/227.md +116 -0
- package/docs/wiki//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +103 -0
- package/docs/wiki//346/225/205/351/232/234/346/216/222/346/237/245.md +94 -0
- package/icon.svg +12 -0
- package/lib/badge-policy.mjs +502 -0
- package/lib/badge-sync.mjs +385 -0
- package/lib/command.mjs +490 -0
- package/lib/completion.mjs +288 -0
- package/lib/concurrency.mjs +2555 -0
- package/lib/dispatch-command.mjs +181 -0
- package/lib/dispatch-gate.mjs +924 -0
- package/lib/facts-store.mjs +183 -0
- package/lib/gate-state.mjs +465 -0
- package/lib/gate.mjs +886 -0
- package/lib/index.js +309 -0
- package/lib/inject.mjs +195 -0
- package/lib/interrupt.mjs +376 -0
- package/lib/ledger.mjs +948 -0
- package/lib/lifecycle.mjs +274 -0
- package/lib/messages.mjs +532 -0
- package/lib/notice.mjs +769 -0
- package/lib/plan-gate.mjs +385 -0
- package/lib/projection.mjs +978 -0
- package/lib/report.mjs +290 -0
- package/lib/route.mjs +346 -0
- package/lib/run-registry.mjs +402 -0
- package/lib/services.mjs +293 -0
- package/lib/stuck.mjs +567 -0
- package/lib/tier-config.mjs +212 -0
- package/lib/tier-policy.mjs +167 -0
- package/lib/tier-state.mjs +137 -0
- package/lib/todo-gate.mjs +1672 -0
- package/lib/tools.mjs +2912 -0
- package/locale/en.json +9 -0
- package/locale/zh.json +9 -0
- package/package.json +58 -4
- package/vendor/node_modules/@deepseek-ai/cosmokit/LICENSE +21 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/README.md +30 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/lib/index.js +418 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/package.json +32 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/src/array.ts +42 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/src/index.ts +12 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/src/misc.ts +78 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/src/string.ts +113 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/src/time.ts +92 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/src/types.ts +168 -0
- package/vendor/node_modules/@deepseek-ai/cosmokit/src/volatile.ts +86 -0
- package/vendor/node_modules/@deepseek-ai/schemastery/LICENSE +21 -0
- package/vendor/node_modules/@deepseek-ai/schemastery/README.md +393 -0
- package/vendor/node_modules/@deepseek-ai/schemastery/lib/index.cjs +635 -0
- package/vendor/node_modules/@deepseek-ai/schemastery/lib/index.mjs +635 -0
- package/vendor/node_modules/@deepseek-ai/schemastery/package.json +39 -0
- package/vendor/node_modules/@deepseek-ai/schemastery/src/index.ts +962 -0
- package/vendor/node_modules/@standard-schema/spec/LICENSE +21 -0
- package/vendor/node_modules/@standard-schema/spec/README.md +198 -0
- package/vendor/node_modules/@standard-schema/spec/dist/index.cjs +18 -0
- package/vendor/node_modules/@standard-schema/spec/dist/index.js +0 -0
- package/vendor/node_modules/@standard-schema/spec/package.json +39 -0
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# dsh-subagent-dispatch-control 的 Cordis patch 条目(单包:徽标 + 派发管控)。
|
|
2
|
+
# 形状与 01-route-badge/cordis.patch.yml 一致:顶层 - insert:,内嵌 - id / name。
|
|
3
|
+
#
|
|
4
|
+
# id 必须保持 subagent-route-badge(M1 约束,2026-11-29 63-合并):
|
|
5
|
+
# dsh-settings 的 describe() 用 loader 条目 id 作为 namespace(entry.options.id),
|
|
6
|
+
# 02 的 UI_SELECTION_NS 与 01 徽标 client 的 NS 均硬编码该字符串;把 id 改成
|
|
7
|
+
# team-preflight 或新包名会让 01 既有 settings 数据(会话路由表)读不到。
|
|
8
|
+
# name 用合并后的新包名(= package.json name);lib/index.js 的 export const name
|
|
9
|
+
# 与该 id 对齐为同一个字符串。
|
|
10
|
+
- insert:
|
|
11
|
+
- id: subagent-route-badge
|
|
12
|
+
name: 'dsh-subagent-dispatch-control'
|
|
13
|
+
config: {}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# BOOST 实践证据卡(LEV-1–8)
|
|
2
|
+
|
|
3
|
+
> ⚠️ 本文件为 2026-11-19 快照,可能与当前实现不一致;引用前请以代码与实跑测试为准。
|
|
4
|
+
|
|
5
|
+
> 文档性质:**逐实践静态证据清单 + 可复现验证方法**,不是 BOOST 评级、不是认证、不是市场准入。
|
|
6
|
+
> 生成日期:2026-11-19
|
|
7
|
+
> 被测对象:`dsh-team-preflight@1.1.0`(本文件是 2026-11-19 的 **1.1.0 历史快照**;当前交付版为 `@1.4.0`,见 `package.json:3`)
|
|
8
|
+
> ⚠ 版本变更后部分可验证命题已变化,请先读 §12「勘误(对照现行 v1.4.0)」再引用本文。
|
|
9
|
+
> 规范依据:`dsh-plugin-guide@0.5.9` 的 `docs/boost.md`(LEV-1–8 与十三字段证据卡规则)
|
|
10
|
+
> 运行环境:Node `v24.21.0` / `win32 x64`;命令均在插件目录执行
|
|
11
|
+
> 写作用域:本文件为只读证据文档;未修改 `lib/`、`test*.mjs`、`README.md`、`docs/FACTS-CONTRACT.md`。
|
|
12
|
+
|
|
13
|
+
## 0. 读法:静态证据 ≠ measured 卡
|
|
14
|
+
|
|
15
|
+
`dsh-plugin-guide/docs/boost.md:31-87` 要求一张 measured 证据卡恰好包含十三个字段:`subject` / `host` / `method` / `scope` / `command` / `result` / `negativeControl` / `generatedAt` / `expiresAt` / `recordHash` / `claimLevel` / `issuer` / `selfAssessed`。缺任一字段即按 `not-measured` 处理(`boost.md:77-87`)。
|
|
16
|
+
|
|
17
|
+
本文件**不是**这样的证据卡:没有真实宿主环境、没有 negative control、没有 `recordHash`,也没有 token/缓存/重启次数的测量。因此:
|
|
18
|
+
|
|
19
|
+
- 下表的「证据」是**静态源码证据**(文件:行号 + 可复现 grep/断言名);
|
|
20
|
+
- 每一条 LEV 的测量状态都是 `not-measured`(或明确写「不适用」);
|
|
21
|
+
- `dsh-levels` 的 `boost.state` 仍是 `not-measured`,八项全部 `not-measured`。
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
boost.state = "not-measured"
|
|
25
|
+
reason = "no --boost-evidence file; benchmarks/evidence cards are not run by this tool"
|
|
26
|
+
LEV-1..LEV-8 = not-measured
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 1. LEV-1–8 汇总
|
|
30
|
+
|
|
31
|
+
| LEV | 实践(boost.md:14-23) | 本插件使用情况 | 最强静态证据 | 如何验证 | 测量状态 |
|
|
32
|
+
|---|---|---|---|---|---|
|
|
33
|
+
| LEV-1 | reversible effects(effects) | **部分**:`ctx.effect`(1.1.0 时 2 处;⚠ v1.4.0 为 7 处,见 §12.2),1 处有 label,1 处无 label | `lib/projection.mjs:283-287`(labelled cleanup);`lib/services.mjs:128-135`(unlabelled prompt section) | `node test/test-functional.mjs` F14(7 条断言);`grep -n "ctx.effect" lib/*.mjs` | `not-measured` |
|
|
34
|
+
| LEV-2 | waiting correctly(inject/get) | **是** | `lib/index.js:33` `export const inject = ['tools']`;可选服务全部 `ctx.get?.()`(见 §3) | `node test/test-integration.mjs` §11;`grep -rn "ctx\.[A-Za-z]" lib/` | `not-measured` |
|
|
35
|
+
| LEV-3 | hot configuration(volatile config) | **否(不适用)**:无 Config/schema/volatile 字段 | `grep -rn "export const Config\|export const schema\|volatile" lib/ package.json` 无输出 | 同上;没有可测的热配置 | `not-measured`(不适用) |
|
|
36
|
+
| LEV-4 | event discipline(event modes) | **是** | `lib/inject.mjs:111`(tools/execute + 唯一 `return next()` 在 :171);`lib/notice.mjs:77-78`(tools/post-execute + `await next()`);`lib/notice.mjs:303`(tools/result 观察者) | `node test/test.mjs` [11](next 只调用一次);`node test/test-functional.mjs` F11/F12 | `not-measured` |
|
|
37
|
+
| LEV-5 | seams and isolation(seams) | **是** | `lib/tools.mjs:288` `ctx.get?.('userQuestions')`;`lib/services.mjs:66` `ctx.get?.('settings')`;纯模块无 `ctx`/`import`(§5) | `node test/test-integration.mjs` §11(`preflight 无未声明服务的直接访问`);`grep -rn "^import" lib/*.mjs` | `not-measured` |
|
|
38
|
+
| LEV-6 | stable prefix / assembly(stable prompt prefixes) | **是(静态)** | `lib/tools.mjs:105-127`、`:178-206` 静态 tool schema;`lib/services.mjs:128-135` 固定系统提示段 | `node test/test.mjs` [26](6 条断言);`grep -n "tool:suggest_concurrency" lib/services.mjs` | `not-measured`(无 prompt token/cache 测量) |
|
|
39
|
+
| LEV-7 | bounded parallel / long work(bounded parallel/jobs) | **部分**:不自行并行/长任务;通过 `isConcurrencySafe` 参与宿主调度 | `lib/tools.mjs:136`(只读工具可并发)、`:213`(`ask:false` 才可并发);`grep -nE "Promise.all\|setTimeout\|setInterval\|child_process" lib/*` **1.1.0 时**无输出(⚠ v1.4.0 有命中,见 §12.1) | `node test/test.mjs` [19](默认 false / ask:false true);`node test/test-functional.mjs` F15 | `not-measured`(无 job/取消可测) |
|
|
40
|
+
| LEV-8 | composition / evidence cards(composition) | **部分**:单插件 manifest,无 bundle patch/preset;本文件不是十三字段卡 | `package.json:30-37`(`dsh.kind=plugin`,无 `bundle`);`package.json:13-17`(files 仅 lib/README/LICENSE——**1.1.0 时点口径**;v1.4.1 实为 lib/client.js/README.md/LICENSE,包根另有 cordis.patch.yml,见 §9 订正) | `cat package.json`;`npx -y -p dsh-standards@1.6.12 dsh-levels . --format json` | `not-measured` |
|
|
41
|
+
|
|
42
|
+
## 2. LEV-1 reversible effects
|
|
43
|
+
|
|
44
|
+
**结论:部分使用。**
|
|
45
|
+
|
|
46
|
+
静态证据:
|
|
47
|
+
|
|
48
|
+
- `lib/projection.mjs:283-287`:共享投影单元的 cleanup 被 `ctx.effect` 认领,第二个参数是 label `'team-preflight: session policy projection'`;cleanup 内 `policyDisposed.add(ctx)`、`handle.dispose()`、`policyHandles.delete(ctx)`。注册竞态在 `:270-304` 处理(`policyDisposed` 检查 + `policyPending.finally` 清理)。
|
|
49
|
+
- `lib/services.mjs:128-135`:系统提示段用 `ctx.effect(() => systemPrompt.section({...}))` 注册;返回 disposer,但**未传 label**(`ctx.effect` 第二参数缺失)。这是本实践的一个小缺口。
|
|
50
|
+
- `grep -nE "setTimeout|setInterval|child_process|spawn|new WebSocket|\\.connect\\(" lib/*.mjs lib/*.js` → **1.1.0 时无匹配**;⚠ 现行 v1.4.0 已有命中(`lib/stuck.mjs` 的 `setInterval` 卡死看门狗、`lib/tools.mjs` 的 `askWithDeadline` 内 `setTimeout`),本句「插件没有定时器」对现行版为假,见 §12.1。
|
|
51
|
+
|
|
52
|
+
如何验证:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
node test/test-functional.mjs # F14 卸载清理:ctx.effect cleanup 后 dispose 恰好 1 次(7 条断言)
|
|
56
|
+
grep -n "ctx.effect" lib/*.mjs
|
|
57
|
+
grep -nE "setTimeout|setInterval|child_process|spawn" lib/*.mjs lib/*.js || true
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
F14 的断言包括:apply 级 `state.effects.length === 6`(W4-26 后:投影 + 并发闸 + 进度闸 + 完成提醒 + 卡死看门狗 + 委派后提示 disposer)、`disposeCount === 1`、卸载后读路径降级且 register 次数仍为 1(按符号名检索,不写会漂移的行号)。
|
|
61
|
+
|
|
62
|
+
**测量状态:`not-measured`。** 没有真实宿主重启前后 effect 计数基线、没有 negative control、没有 20 次重复;不能声称“重启回到 baseline”。
|
|
63
|
+
|
|
64
|
+
## 3. LEV-2 waiting correctly(inject/get)
|
|
65
|
+
|
|
66
|
+
**结论:是。**
|
|
67
|
+
|
|
68
|
+
静态证据:
|
|
69
|
+
|
|
70
|
+
- `lib/index.js:33`:`export const inject = ['tools']` —— 必需服务只有 `tools`,Cordis 保证 apply 在工具服务就绪后执行。
|
|
71
|
+
- 可选服务全部走 `ctx.get?.()`:`lib/inject.mjs:45`(tools)、`lib/projection.mjs:132` 与 `:272`(sessionProjections)、`lib/services.mjs:43`(agentTeams)、`:66`(settings)、`:98`(tools)、`:122`(systemPrompt)、`lib/tools.mjs:288`(userQuestions)。
|
|
72
|
+
- `lib/projection.mjs:209-228`:读路径先 `policyHandles.get(ctx)`,为空时 `await policyPending.get(ctx)` 等待 apply 已发起的注册;不新建注册(P1-2)。
|
|
73
|
+
- `grep -nE "setTimeout|setInterval" lib/*.mjs lib/*.js` → **1.1.0 时无匹配**;⚠ v1.4.0 已含 `setInterval`/`setTimeout`(见 §12.1),「没有轮询」仅对 1.1.0 成立。
|
|
74
|
+
|
|
75
|
+
如何验证:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
node test/test-integration.mjs # §11:preflight 的 inject 声明可解析 / 声明了 tools / 无未声明服务的直接访问
|
|
79
|
+
node test/test.mjs # [27] P1-2:读路径不注册(工具执行期零状态变更)
|
|
80
|
+
grep -rn "ctx\.[A-Za-z]" lib/*.mjs lib/*.js
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`test-integration.mjs` §11 的断言名:`preflight 的 inject 声明可解析`、`preflight 声明了 tools(实际: tools)`、`preflight 无未声明服务的直接访问`(`test-integration.mjs:858-864`);它扫描 `lib/` 下全部源文件(`:876-881`)。
|
|
84
|
+
|
|
85
|
+
**测量状态:`not-measured`。** 没有在真实 Cordis 宿主验证“必需服务就绪后 apply”与“可选服务缺失不阻塞加载”;fixture 只模拟了 get 的返回值。
|
|
86
|
+
|
|
87
|
+
## 4. LEV-3 hot configuration(volatile config)
|
|
88
|
+
|
|
89
|
+
**结论:否(不适用)。**
|
|
90
|
+
|
|
91
|
+
静态证据:
|
|
92
|
+
|
|
93
|
+
- `grep -rn "export const Config\|export const schema\|volatile" lib/ package.json` → 无输出。插件没有声明任何配置 schema,也没有 `volatile()` 字段。
|
|
94
|
+
- `package.json` 中没有 `dsh.config` 或 `config` 字段(见 `package.json:30-37` 的 `dsh` 块)。
|
|
95
|
+
- 唯一相关的外部读取是 route-badge 的 settings namespace:`lib/services.mjs:37-38` 定义 `UI_SELECTION_NS = 'subagent-route-badge'`,`:64-86` 通过 `ctx.get?.('settings').describe()` 读取界面选择。这是**其他插件的设置**,不是本插件的热配置,也不能推出“修改后 0 次重启”。
|
|
96
|
+
|
|
97
|
+
如何验证:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
grep -rn "export const Config\|export const schema\|volatile" lib/ package.json
|
|
101
|
+
node -e "const p=require('./package.json'); console.log(Object.keys(p))"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**测量状态:`not-measured`(不适用)。** 本插件没有可调配置面;不编造“volatile 配置通过”。
|
|
105
|
+
|
|
106
|
+
## 5. LEV-4 event discipline(event modes)
|
|
107
|
+
|
|
108
|
+
**结论:是。**
|
|
109
|
+
|
|
110
|
+
静态证据:
|
|
111
|
+
|
|
112
|
+
- `lib/inject.mjs:110-172`:`ctx.on('tools/execute', async (exec, next) => {...})`;唯一 `return next()` 位于 `:171`,在 try/catch 之外;注释 `:112-121` 说明历史事故是 try 内调用 next 导致双执行,现已修正。
|
|
113
|
+
- `lib/notice.mjs:75-285`:`ctx.on('tools/post-execute', async (exec, result, next) => {...})`;开头 `const downstream = await next()`(`:78`),后续只在 downstream 上附加 `additionalContexts` / `content`,不重复调用 next。
|
|
114
|
+
- `lib/notice.mjs:288-318`:`ctx.on('tools/result', (exec, result) => {...})` 是观察者,不调用 next —— 这是官方 `practices.md` 建议的最终结果观察点(注释 `:291-301`)。
|
|
115
|
+
- `grep -nE "@mode|serial\(|bail\(|parallel\(" lib/*.mjs lib/*.js` → 无匹配;事件模式依赖宿主 waterfall 契约。
|
|
116
|
+
|
|
117
|
+
如何验证:
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
node test/test.mjs # [11] 审计回归:next() 只调用一次(P1-2)(test.mjs:626)
|
|
121
|
+
node test/test-functional.mjs # F11 post-execute 提示 / F12 tools/result 路由标记
|
|
122
|
+
grep -n "ctx.on(" lib/*.mjs
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**测量状态:`not-measured`。** 没有真实宿主的事件时序、错误路径、双执行计数测量;fixture 走的是复刻 waterfall。
|
|
126
|
+
|
|
127
|
+
## 6. LEV-5 seams and isolation(seams)
|
|
128
|
+
|
|
129
|
+
**结论:是。**
|
|
130
|
+
|
|
131
|
+
静态证据:
|
|
132
|
+
|
|
133
|
+
- `lib/tools.mjs:288`:`const questions = ctx.get?.('userQuestions')`,走官方 userQuestions seam(等价 `ask_user_question`),没有 import 或直接访问其实现。
|
|
134
|
+
- `lib/services.mjs:66`:`ctx.get?.('settings')`,读 route-badge 的 settings namespace;`:43` `ctx.get?.('agentTeams')`;`lib/projection.mjs:132` 与 `:272` `ctx.get?.('sessionProjections')`。
|
|
135
|
+
- 零实现 import:`grep -n "^import" lib/*.mjs` 只有本地 `./*.mjs` 与 `node:crypto`(`lib/notice.mjs:8`);没有 `@deepseek-ai/*` 运行时 import(`package.json:22-29` 的 `@deepseek-ai/dsh` 只是可选 peerDependency)。
|
|
136
|
+
- 纯模块:`lib/concurrency.mjs`(无 import,纯函数 `scoreTask`,`:228`)、`lib/messages.mjs`(无 import,唯一文案出口)、`lib/report.mjs:17-29` 只 import `./messages.mjs`;`lib/route.mjs:174` 的 `resolveEffectiveRoute` 是纯导出,inject/notice/tools 共用同一判断。
|
|
137
|
+
- `lib/index.js` 只做装配:import 5 个本地模块并依次调用 `installPolicyProjection` / `installAutoRouteInjection` / `installPostExecuteNotice` / `installResultDiagnostics` / `registerTools` / `installConcurrencyPrompt`(`lib/index.js:17-21,39-60`)。
|
|
138
|
+
|
|
139
|
+
如何验证:
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
node test/test-integration.mjs # §11 扫描 lib/ 全部源文件的 ctx.X 直接访问(精确 10 个源文件的断言见 §14)
|
|
143
|
+
grep -n "^import" lib/*.mjs
|
|
144
|
+
node test/test.mjs # 纯函数/单测
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**测量状态:`not-measured`。** 没有隔离/多实例/每 agent 上下文的宿主测量;这里的“seam”是静态导入面判断。
|
|
148
|
+
|
|
149
|
+
## 7. LEV-6 stable prefix / assembly(stable prompt prefixes)
|
|
150
|
+
|
|
151
|
+
**结论:是(静态实现),但没有缓存测量。**
|
|
152
|
+
|
|
153
|
+
静态证据:
|
|
154
|
+
|
|
155
|
+
- `lib/tools.mjs:102-146`:`makeCheckTool` 的 `name`、`description`、`parameters` 都是字面量(`description` 在 `:105-109`,参数 schema 在 `:110-127`),每次 apply 生成的字节内容稳定。
|
|
156
|
+
- `lib/tools.mjs:175-231`:`makeConcurrencyTool` 的 `description`/`parameters` 同样是字面量(`:178-206`)。
|
|
157
|
+
- `lib/services.mjs:128-135`:系统提示段 `name: 'tool:suggest_concurrency'`、固定 `order`(基于 `getSectionOrder('TOOL_SUBAGENT') + 1`)、固定 `text`(`:131-134`),不含 per-call nonce 或临时变量。
|
|
158
|
+
- 动态内容全部留在工具**结果**(`buildReport` / `buildConcurrencyReport`),不进入系统提示或工具声明。
|
|
159
|
+
|
|
160
|
+
如何验证:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
node test/test.mjs # [26b] 系统提示引导:并发前先问用户(W7-016 重编号;按符号检索,不写行号)
|
|
164
|
+
grep -n "tool:suggest_concurrency" lib/services.mjs
|
|
165
|
+
grep -n "description:" lib/tools.mjs
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**测量状态:`not-measured`。** 没有真实 provider 的 `cache_read_input_tokens / prompt_tokens` 对比,也没有 5 次会话 × 2 次调用的实验;不能声称稳定前缀命中缓存。若要升级为 measured 卡,需按 `boost.md:101-124` 的方式做 provider 采集并填满十三字段。
|
|
169
|
+
|
|
170
|
+
## 8. LEV-7 bounded parallel / long work(bounded parallel/jobs)
|
|
171
|
+
|
|
172
|
+
**结论:部分使用(插件自身不做并行/长任务,只声明可并发性)。**
|
|
173
|
+
|
|
174
|
+
静态证据:
|
|
175
|
+
|
|
176
|
+
- `lib/tools.mjs:136`:`check_subagent_selection` 的 `isConcurrencySafe: () => true`(纯读,不注册/不写状态);`lib/tools.mjs:213`:`suggest_concurrency` 的 `isConcurrencySafe: (args) => args?.ask === false`(默认等待用户确认,不能与其他工具并发)。
|
|
177
|
+
- `lib/tools.mjs:154-155` 注释明确:“只给建议 + 请用户确认,不执行派发”;插件不创建子代理、不跑 job。
|
|
178
|
+
- `grep -nE "Promise.all|Promise.race|setTimeout|setInterval|child_process|spawn\\(|execSync|job" lib/*.mjs lib/*.js` → **1.1.0 时无匹配**;⚠ v1.4.0 命中 `setTimeout`/`setInterval`/`Promise.race`(tools.mjs),此处结论仅对 1.1.0 成立,见 §12.1。
|
|
179
|
+
|
|
180
|
+
如何验证:
|
|
181
|
+
|
|
182
|
+
```sh
|
|
183
|
+
node test/test.mjs # [19] 并发建议工具:四维评分与决策(test.mjs:775-784:默认 false / ask:false true)
|
|
184
|
+
node test/test-functional.mjs # F15 10 路并发 check_subagent_selection 结果一致且只注册 1 次
|
|
185
|
+
grep -nE "Promise.all|setTimeout|setInterval|child_process|spawn" lib/*.mjs lib/*.js || true
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**测量状态:`not-measured`。** 没有 job 生命周期、取消传播或长任务吞吐的可测对象;“bounded”只体现在工具并发声明与 F15 的 10 路只读调用。
|
|
189
|
+
|
|
190
|
+
## 9. LEV-8 composition / evidence cards(composition)
|
|
191
|
+
|
|
192
|
+
**结论:部分使用;本文件不是有效证据卡。**
|
|
193
|
+
|
|
194
|
+
静态证据:
|
|
195
|
+
|
|
196
|
+
- `package.json` 的 `dsh` 块:`dsh.manifestVersion = 1`、`dsh.kind = "plugin"`;**1.1.0 时** `capabilities: ["tools:register"]`、`labels: []`(**v1.4.0 现为 `capabilities` 含 `system-prompt:write`、`labels` 含 `prompt-modification`;并新增 `cordis.patch.yml`,见 §12**);仍无 `dsh.bundle` / preset 字段。
|
|
197
|
+
- `package.json` 的 `files`:**1.1.0 时**为 `lib` / `README.md` / `LICENSE`(v1.4.0 现含 `client.js`);这是单插件发布,不是 bundle 组合。
|
|
198
|
+
- 本文件按 LEV 分节提供静态证据,但**没有** `recordHash`、`host`、`negativeControl` 等十三字段,按 `boost.md:77-87` 不能当作 measured 证据卡。
|
|
199
|
+
|
|
200
|
+
如何验证:
|
|
201
|
+
|
|
202
|
+
```sh
|
|
203
|
+
cat package.json
|
|
204
|
+
npx -y -p dsh-standards@1.6.12 dsh-levels . --format json # boost.state = not-measured
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**测量状态:`not-measured`。** 没有 bundle patch/preset 可验证;没有有效证据卡,故 BOOST 不升级。
|
|
208
|
+
|
|
209
|
+
## 10. 附:进程内状态的有界性(支撑 LEV-1 / LEV-5)
|
|
210
|
+
|
|
211
|
+
任务要求特别核对 WeakMap 去重表的有界性。当前 `lib/` 的进程内可变结构全部按对象弱引用或按 ctx 隔离:
|
|
212
|
+
|
|
213
|
+
| 结构 | 位置 | 键/值 | 有界性 | 清理 |
|
|
214
|
+
|---|---|---|---|---|
|
|
215
|
+
| `warnedOnce` | `lib/services.mjs:16` | `WeakMap<ctx, Set<string>>` | 每个 ctx 一个 Set;key 是固定告警键或 `no-definition:<toolName>` / `probe-threw:<toolName>`,受工具数量约束 | ctx 被回收即回收;无全局 Map |
|
|
216
|
+
| `policyHandles` | `lib/projection.mjs:85` | `WeakMap<ctx, handle>` | 每个 ctx 一个 handle | cleanup 中 `delete`(`:286`) |
|
|
217
|
+
| `policyPending` | `lib/projection.mjs:99` | `WeakMap<ctx, Promise>` | 每个 ctx 至多一个 Promise | `pending.finally` 中 `delete`(`:301-304`) |
|
|
218
|
+
| `policyDisposed` | `lib/projection.mjs:109` | `WeakSet<ctx>` | 每个 ctx 一个布尔标记 | ctx 回收;apply 开始 `delete`(`:270`) |
|
|
219
|
+
| `injectedExecutions` | `lib/inject.mjs:86` | `WeakSet<exec>` | 每个 exec 一个标记 | exec 被回收 |
|
|
220
|
+
| `lastSnapshotBySession` | `lib/notice.mjs:24` | `WeakMap<session, string>` | 每个会话一个字符串 | 失败委派时 `delete`(`:117`);会话对象回收即回收;注释 `:17-23` 说明用 WeakMap 防止 session id 字符串 Map 无界增长 |
|
|
221
|
+
|
|
222
|
+
验证:`grep -n "WeakMap\|WeakSet" lib/*.mjs`;`node test/test-integration.mjs` §13(同 session 多路并发不串,见 README 集成覆盖表第 13 行)与 `node test/test-functional.mjs` F15(10 路并发一致、只注册一次)。
|
|
223
|
+
|
|
224
|
+
## 11. 结论
|
|
225
|
+
|
|
226
|
+
- **没有任何 LEV 达到 measured。** `dsh-levels` 仍输出 `boost.state = not-measured`、`LEV-1..8 = not-measured`。
|
|
227
|
+
- 静态使用情况:LEV-2、LEV-4、LEV-5、LEV-6 为“是”;LEV-1、LEV-7、LEV-8 为“部分”;LEV-3 为“否(不适用)”。
|
|
228
|
+
- 本文只证明“代码中存在该实践的形状”,不证明运行时效果;不要把本文件读成 BOOST 评级、认证或通过。
|
|
229
|
+
|
|
230
|
+
## 12. 勘误(对照现行交付版 v1.4.0,2026-11-24)
|
|
231
|
+
|
|
232
|
+
> §1–§11 是 2026-11-19 对 `@1.1.0` 的快照证据。交付版已演进到 `@1.4.0`(`package.json:3`),
|
|
233
|
+
> 下列**可验证命题**在当前版本已不再成立,特此勘误,以免后续维护 / 审查被误导。以下均由本机实跑 `grep` 复核。
|
|
234
|
+
|
|
235
|
+
### 12.1「插件没有定时器」结论为假(仅对 1.1.0 成立)
|
|
236
|
+
|
|
237
|
+
`grep -rnE 'setInterval|setTimeout' lib/` 在当前 v1.4.0 命中(以下按**符号名**定位,不写行号以避免随版本漂移):
|
|
238
|
+
|
|
239
|
+
- **卡死看门狗**(`lib/stuck.mjs`):`timer = setIntervalFn(check, stuckCheckMs)` —— 真实 `setInterval`,由看门狗返回的 disposer 经 `ctx.effect` 接线清理;
|
|
240
|
+
- **提问超时截止**(`lib/tools.mjs` 的 `askWithDeadline`):`timer = setTimeout(() => { ... })` —— 真实 `setTimeout`。
|
|
241
|
+
|
|
242
|
+
因此 §2(LEV-1 原「无匹配:插件没有定时器」)、§3(LEV-2「没有轮询等待」)、
|
|
243
|
+
§8(LEV-7「没有并行池」)中「无定时器 / 无轮询 / 无 setTimeout」的表述,**对 v1.4.0 为假**。
|
|
244
|
+
LEV-1 的可逆效果证据需相应纳入 stuck 看门狗的 `clearInterval` 清理(`lib/stuck.mjs` 的返回 disposer 经 `ctx.effect` 接线)。
|
|
245
|
+
|
|
246
|
+
### 12.2 `ctx.effect` 调用点为 7 处,不是「2 处」
|
|
247
|
+
|
|
248
|
+
`grep -rn 'ctx\.effect' lib/` 在 v1.4.0 的活动调用点共 **7 处**(按装配点/符号名定位,不写行号):
|
|
249
|
+
`lib/index.js` 装配层 **4 处**(并发确认闸 cleanup、todo 闸 cleanup、完成提醒+派发闸合并 cleanup、stuck 看门狗 cleanup 各 1),
|
|
250
|
+
`lib/projection.mjs` 的 `installPolicyProjection` **1 处**,
|
|
251
|
+
`lib/services.mjs` 的 `systemPrompt.section` 写入 **2 处**。§1 汇总表 LEV-1 行与 §2 的「2 处」为 1.1.0 旧值,已过时。
|
|
252
|
+
|
|
253
|
+
### 12.3 行号与基线会随版本漂移
|
|
254
|
+
|
|
255
|
+
- §1–§11 的分文件行号(如 `lib/projection.mjs:283-287`、`lib/services.mjs:128-135`)是 1.1.0 行号,
|
|
256
|
+
v1.4.0 已漂移;引用前请以符号名(`installPolicyProjection` / `beginRegistration` 等)与实跑 `grep` 为准。
|
|
257
|
+
- 四套件基线以实跑为准,见 `FLOW-COVERAGE.md` §6.1 与各测试文件当前输出。
|
|
258
|
+
|
|
259
|
+
> §11「没有任何 LEV 达到 measured」仍然成立;本勘误只订正静态事实,不改变 `boost.state = not-measured`。
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# 插件开发规范符合性
|
|
2
|
+
|
|
3
|
+
本文档记录两个插件按 DSH 官方插件规范(`dsh-plugin-guide` + `dsh-standards`)
|
|
4
|
+
的自检结果,以及踩过的坑。
|
|
5
|
+
|
|
6
|
+
> 版本区间头注:本文 @02-team-preflight 1.4.1 / @01-route-badge 1.3.1(2026-11-24 复核;manifest 现值见 capabilities 表——M5 增 system-prompt:write / prompt-modification)。
|
|
7
|
+
|
|
8
|
+
> **本报告不是认证、安全审计或市场准入。** `dsh-standards` 是第三方检查器,
|
|
9
|
+
> 与 DSH 官方无关。ENTRY `recognized` 不等于运行时通过,`static` 不是 pass,
|
|
10
|
+
> `not-run` 不是 pass。
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 一、检查结果
|
|
15
|
+
|
|
16
|
+
检查器:`dsh-standards@1.6.12`,宿主版本 `0.2.2-rc.3`。
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx -y dsh-standards@1.6.12 check <plugin-dir> \
|
|
20
|
+
--scope entry --entry-claim static --no-exec --host-version 0.2.2-rc.3
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
| 插件 | Status | Blocking | Hygiene | 说明 |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| `@local/dsh-subagent-route-badge` | **pass** | 0 | 0 | ENTRY recognized |
|
|
26
|
+
| `dsh-team-preflight` | **pass** | 0 | 0 | ENTRY recognized |
|
|
27
|
+
|
|
28
|
+
### 三层状态(`dsh-levels`)
|
|
29
|
+
|
|
30
|
+
| 层 | 状态 | 说明 |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| ENTRY | `recognized`(static claim) | 包形状、入口、patch、版本范围、metadata 均通过 |
|
|
33
|
+
| FLOW | `not-run` | 未执行 J1–J8 用户旅程;**不是 pass** |
|
|
34
|
+
| BOOST | `not-measured` | 未做 LEV-1–8 实践取证;**不是 pass** |
|
|
35
|
+
|
|
36
|
+
**FLOW 和 BOOST 需要运行时证据,当前未采集。** 按证据纪律,这里如实记为
|
|
37
|
+
`not-run` / `not-measured`,不写成通过。
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 二、manifest 契约(按官方 recipe)
|
|
42
|
+
|
|
43
|
+
两个插件都采用官方 `recipes.md` 的最小 `package.json` 形状:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"name": "...",
|
|
48
|
+
"version": "1.3.0",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"type": "module",
|
|
51
|
+
"main": "./index.js",
|
|
52
|
+
"exports": { ".": "./index.js" },
|
|
53
|
+
"files": ["index.js", "cordis.patch.yml"],
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=24.9.0",
|
|
56
|
+
"dsh": ">=0.2.2-0 <0.3.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@deepseek-ai/dsh": ">=0.2.2-0 <0.3.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"@deepseek-ai/dsh": { "optional": true }
|
|
63
|
+
},
|
|
64
|
+
"dsh": {
|
|
65
|
+
"manifestVersion": 1,
|
|
66
|
+
"kind": "plugin",
|
|
67
|
+
"bundle": { "patch": "./cordis.patch.yml" },
|
|
68
|
+
"capabilities": [],
|
|
69
|
+
"labels": []
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `engines.dsh` 的 `-0` 下界是必须的
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
"dsh": ">=0.2.2-0 <0.3.0" ✅ 包含 0.2.2-rc.3
|
|
78
|
+
"dsh": ">=0.2.2 <0.3.0" ❌ 不包含(prerelease 排在 release 之前)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
宿主自 `0.2.1-alpha.4` 起**只读这个字段**,有它时忽略 `peerDependencies`。
|
|
82
|
+
写错会让宿主拒绝加载。
|
|
83
|
+
|
|
84
|
+
### `capabilities` 按静态触发面声明
|
|
85
|
+
|
|
86
|
+
| 插件 | 静态触发 | 声明 |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| badge | 无(`ctx.tools.register` / `ctx.fs` / `ctx.web` 等均未命中) | `[]` |
|
|
89
|
+
| preflight | `ctx.tools.register(`(另有 `systemPrompt.section` 写入,见下) | `["tools:register", "system-prompt:write"]` |
|
|
90
|
+
|
|
91
|
+
**`[]` 是显式的「不使用任何能力」声明,不是占位。** 一旦声明了数组(哪怕空),
|
|
92
|
+
任何未声明的静态触发都会从 WARN 升级为 **FAIL**。
|
|
93
|
+
|
|
94
|
+
### `labels` 只在需要时声明
|
|
95
|
+
|
|
96
|
+
`C-13.2` 只在特定能力下要求 label:
|
|
97
|
+
|
|
98
|
+
| 能力 | 必需 label |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `system-prompt:write` | `prompt-modification` |
|
|
101
|
+
| `llm:adapter` + `network:egress` | `third-party-model-provider` |
|
|
102
|
+
| `network:ingress` | `remote-access` |
|
|
103
|
+
| 声明了 `dsh.upstream` | `mirror` |
|
|
104
|
+
|
|
105
|
+
preflight 声明 `labels: ["prompt-modification"]`(与其经 `ctx.get?.('systemPrompt').section(...)` 写系统提示的语义对齐;`dsh-standards` 静态扫描因触发形态不同未报,但语义上确属 `system-prompt:write`);badge 不写系统提示,仍为 `labels: []`。
|
|
106
|
+
|
|
107
|
+
**禁止**使用 `official` / `verified` / `certified` / `secure` / `audited`
|
|
108
|
+
——这些词会被当作背书声明,直接 FAIL。
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 三、踩过的坑
|
|
113
|
+
|
|
114
|
+
### 坑 1:`ctx.configForms` 直接访问让整个 client 插件不加载
|
|
115
|
+
|
|
116
|
+
**症状**:徽标 UI 完全不显示。但 bundle 加载、模块解析、slot 契约全部正常。
|
|
117
|
+
|
|
118
|
+
**根因**:`configForms` 是可选服务,故意没写进 `inject: ['slots','locale']`。
|
|
119
|
+
但 Cordis 的 context 是 **Proxy**,get 陷阱对未 inject 的属性**同步抛错**
|
|
120
|
+
(`cordis/src/reflect.ts:152`):
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
throw new Error(`cannot get property "configForms" without inject`)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
而 `apply` 里有 4 处 `ctx.configForms` 直接访问,**第一处就在函数开头**。
|
|
127
|
+
于是 `apply` 立即抛错,末尾的 `ctx.slots.inject(...)` 永远执行不到。
|
|
128
|
+
|
|
129
|
+
**修复**:所有可选服务必须走 `ctx.get()`(`reflect.get`,不做 inject 检查):
|
|
130
|
+
|
|
131
|
+
```js
|
|
132
|
+
const configFormsOf = () => {
|
|
133
|
+
try {
|
|
134
|
+
return ctx.get?.('configForms')
|
|
135
|
+
} catch {
|
|
136
|
+
return undefined
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**防护**:`test-integration.mjs` 第 10 节做源码扫描——任何 `ctx.X` 直接访问,
|
|
142
|
+
若 X 既不在 `inject` 里、又不在 `ctx.inject([...])` 可选注入里,测试失败。
|
|
143
|
+
|
|
144
|
+
### 坑 2:`wire` 缺 `viewSchema` 让全部会话历史加载失败
|
|
145
|
+
|
|
146
|
+
**症状**:`failed to project session "...": Cannot read properties of undefined
|
|
147
|
+
(reading 'parse')(gateway/internal)`,所有会话打不开。
|
|
148
|
+
|
|
149
|
+
**根因**:投影注册表写的是
|
|
150
|
+
|
|
151
|
+
```js
|
|
152
|
+
if (def.wire !== undefined) values[key] = def.wire.viewSchema.parse(...)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
——**只看 `wire` 是否存在,不检查 `viewSchema`**。于是
|
|
156
|
+
`wire: { summary: false }`(想省掉会话摘要 payload)会让 `def.wire` 为 truthy
|
|
157
|
+
而 `viewSchema` 为 undefined,直接崩。
|
|
158
|
+
|
|
159
|
+
**第二条致命路径**:与官方共享 key 时,`wire.summary` 必须一致
|
|
160
|
+
(`index.ts:419`)。官方定义无 `wire`,`summary` 是 `undefined`;
|
|
161
|
+
传 `false` 就 `false !== undefined` → 抛 `refusing to share`。
|
|
162
|
+
|
|
163
|
+
**修复**:
|
|
164
|
+
- preflight(共享 key):硬性断言 `if ('wire' in definition) throw`
|
|
165
|
+
- badge(独立 key):`assertWireShape()` 要求三字段齐备
|
|
166
|
+
|
|
167
|
+
**规则**:`wire` 要么三字段齐备,要么整个省略。**不存在「只给 summary」的写法。**
|
|
168
|
+
|
|
169
|
+
详见 `docs/PROJECTIONS.md`。
|
|
170
|
+
|
|
171
|
+
### 坑 3:模块级 await(`DSC-10`)
|
|
172
|
+
|
|
173
|
+
**症状**:检查器报 `WARN C-10.1`。
|
|
174
|
+
|
|
175
|
+
**原写法**:
|
|
176
|
+
|
|
177
|
+
```js
|
|
178
|
+
const z = await loadSchemastery() // 模块级 await
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**问题**:模块级 await 让每个 importer 的求值等待,宿主无法注入清理。
|
|
182
|
+
更糟的是 `loadSchemastery()` 失败时**静默降级**成没有 volatile 的 fallback
|
|
183
|
+
schema,导致 settings 通道神秘失效——用户只看到「插件没装」。
|
|
184
|
+
|
|
185
|
+
**修复**:改用静态 import,失败会在加载期清晰抛出。
|
|
186
|
+
|
|
187
|
+
```js
|
|
188
|
+
import zImport from './vendor/node_modules/@deepseek-ai/schemastery/lib/index.mjs'
|
|
189
|
+
const z = typeof zImport === 'function' && typeof zImport.object === 'function'
|
|
190
|
+
? zImport
|
|
191
|
+
: undefined
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### 坑 4:`PostToolDecision.content` 是**替换**语义
|
|
195
|
+
|
|
196
|
+
**症状**:委派子代理时,工具输出变成只有路由标记,子代理名称丢失。
|
|
197
|
+
|
|
198
|
+
**根因**:误用 `downstream.content`(决策对象,没有 content)而非
|
|
199
|
+
`result.content`(执行结果)。`content` 是替换不是追加,于是原输出被整个替换。
|
|
200
|
+
|
|
201
|
+
**修复**:从 `result.content` 取原内容再拼接。
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 四、未完成的证据
|
|
206
|
+
|
|
207
|
+
按证据纪律,以下项**未采集**,不能写成通过:
|
|
208
|
+
|
|
209
|
+
| 项 | 状态 | 需要什么 |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| FLOW J1–J8 | `not-run` | 安装/卸载/启用/禁用/配置/首次成功/权限/升级的运行时记录 |
|
|
212
|
+
| BOOST LEV-1–8 | `not-measured` | 逐实践的十三字段证据卡 |
|
|
213
|
+
| ENTRY runtime claim | `NA` | `--runtime` 或 `--host` 的实际启动证据 |
|
|
214
|
+
| 安全审计 | 未做 | `--scope security` 是静态扫描,不等于安全审计 |
|
|
215
|
+
|
|
216
|
+
**ENTRY 的 `recognized` 只说明包能被识别。** 它不保证运行时行为正确,
|
|
217
|
+
也不覆盖 FLOW(用户旅程是否顺畅)和 BOOST(是否用好 Cordis)。
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 五、复现检查
|
|
222
|
+
|
|
223
|
+
```sh
|
|
224
|
+
# 单元测试(纯函数逻辑)
|
|
225
|
+
cd ~/.dsh/plugins/dsh-team-preflight && node test/test.mjs
|
|
226
|
+
|
|
227
|
+
# 集成测试(含投影契约、client inject 扫描)
|
|
228
|
+
cd ~/.dsh/plugins/dsh-team-preflight && node test/test-integration.mjs
|
|
229
|
+
|
|
230
|
+
# 官方 ENTRY 检查
|
|
231
|
+
npx -y dsh-standards@1.6.12 check <plugin-dir> \
|
|
232
|
+
--scope entry --entry-claim static --no-exec --host-version 0.2.2-rc.3
|
|
233
|
+
|
|
234
|
+
# 三层自检
|
|
235
|
+
npx -y -p dsh-standards@1.6.12 dsh-levels <plugin-dir> --format json
|
|
236
|
+
```
|