dsh-standards 1.6.10 → 1.6.12
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/31-DS-C/346/235/241/346/254/276.md +83 -57
- package/31-DSH-ENTRY/345/205/245/351/227/250/350/247/204/350/214/203.md +2 -1
- package/34-/344/270/211/345/261/202/345/210/206/347/272/247/346/250/241/345/236/213-GB-GBT-GBZ/347/261/273/346/257/224.md +2 -2
- package/40-checker/README.md +6 -6
- package/40-checker/samples/entry18.json +1 -1
- package/40-checker/scripts/build-sidecar.mjs +69 -7
- package/40-checker/scripts/collect-fixtures.mjs +5 -1
- package/40-checker/scripts/land-runtime-artifacts.mjs +184 -0
- package/40-checker/scripts/m2-runner.mjs +5 -2
- package/40-checker/scripts/repo-anchor-check.mjs +206 -0
- package/40-checker/src/author-cli.mjs +1 -1
- package/40-checker/src/cli.mjs +11 -3
- package/40-checker/src/declarations.mjs +52 -5
- package/40-checker/src/index.mjs +1 -1
- package/40-checker/src/manifest.mjs +6 -2
- package/CHANGELOG.md +49 -0
- package/README.en.md +5 -5
- package/README.es.md +5 -5
- package/README.hi.md +5 -5
- package/README.md +8 -3
- package/README.pt.md +5 -5
- package/docs/coverage.md +1 -1
- package/docs/repo-anchors-rc3-2026-11-14.md +58 -0
- package/package.json +3 -2
- package/spec/dsc-clauses.json +1 -1
- package/spec/examples/boost-card.example.json +2 -2
- package/spec/examples/flow-evidence.example.json +4 -4
- package/spec/reference-suite.json +9 -6
- package/spec/schemas/boost-card.schema.json +2 -2
- package/spec/schemas/conformance.schema.json +1 -2
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> **v1 历史命名**:v2 以 `89-三套标准命名决定.md` 为准(DSH-ENTRY / DSH-FLOW / DSH-BOOST);本文件保留旧码作历史,不在新文档引用。
|
|
4
4
|
|
|
5
|
-
> **版本**:v1.0.0-rc.
|
|
6
|
-
> **日期**:2026-11-07
|
|
7
|
-
> **依据**:`01-项目纲领.md`、`03-可行性与条款草案.md`、`10-输入/源码取证索引.md`、`00-索引.md`、`20-研究底稿/B-Cordis契约可判定性矩阵.md`、`20-研究底稿/C-安全基线与权限面.md`、`20-研究底稿/E-一致性检查器可行性.md`,以及 `deepseek-harness`
|
|
5
|
+
> **版本**:v1.0.0-rc.3(T1 定稿候选;2026-11-07 增补 C-15~C-22 安全扩展;2026-11-14 rc3 锚与 REPO 行号复核)
|
|
6
|
+
> **日期**:2026-11-07(rc3 复核 2026-11-14)
|
|
7
|
+
> **依据**:`01-项目纲领.md`、`03-可行性与条款草案.md`、`10-输入/源码取证索引.md`、`00-索引.md`、`20-研究底稿/B-Cordis契约可判定性矩阵.md`、`20-研究底稿/C-安全基线与权限面.md`、`20-研究底稿/E-一致性检查器可行性.md`,以及 `deepseek-harness` 源码实测(**rc3 commit `38a6a5c965aa99ab525161efb7cc5cf1fe62fced`,2026-11-13,DSH `0.2.2-rc.3`**;2026-10-30 的 `ce7073d5…` / `0.2.2-alpha.2` 一组见 §1.5 历史锚)与 2026-11-07 安全审计(宿主 `0.2.2-rc.1`;**security scope 证据仅到 rc.1,rc3 未复跑**)。
|
|
8
8
|
> **覆盖条款**:C-1 ~ C-22(22 条编号)。C-1~C-14 是基线/入口面;C-15~C-22 是 2026-11-07 新增的 **security scope** 扩展,默认 DS-C package/listing 判定不变。C-10/C-18/C-19/C-20/C-22 为 advisory;C-3 仅 listing profile;C-21 是 security 强制项但 **WARN-only、不阻断**(listing 同)。
|
|
9
9
|
> **已知未完成项**:
|
|
10
10
|
> 1. 检查器已实现(T2):16 tests;10 个 GitHub 样本 + 4 个 npm bundle 的 L0;L1–L3 13/14 真实包(`41`/`81`)。本文件仍只定义检查项 ID、判定方式与覆盖门。
|
|
@@ -83,26 +83,29 @@ DS-C 的符合性绑定五元锚,缺一不可:
|
|
|
83
83
|
```json
|
|
84
84
|
{
|
|
85
85
|
"repo": "deepseek-ai/deepseek-harness",
|
|
86
|
-
"commit": "
|
|
86
|
+
"commit": "38a6a5c965aa99ab525161efb7cc5cf1fe62fced",
|
|
87
87
|
"scanner": "dsh-plugin-verify@<semver>",
|
|
88
|
-
"dsh": "0.2.2-
|
|
89
|
-
"cordis": "4.0
|
|
88
|
+
"dsh": "0.2.2-rc.3",
|
|
89
|
+
"cordis": "4.1.0"
|
|
90
90
|
}
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
本 commit 的三个版本轴必须分开记录,不能合并成一个"DSH 版本":
|
|
94
94
|
|
|
95
|
-
| 轴 |
|
|
95
|
+
| 轴 | rc3 实测 | 证据 |
|
|
96
96
|
|---|---|---|
|
|
97
|
-
| Harness 根包版本 | `0.2.2-
|
|
98
|
-
| vendored Cordis 包版本 | `4.0
|
|
99
|
-
| Cordis 上游基线 | `4.0.0-rc.11` | `REPO/vendor/README.md:
|
|
97
|
+
| Harness 根包版本 | `0.2.2-rc.3` | `REPO/package.json` 的 `version`;`getDshRuntimeVersion()` 实际读的是 `packages/boot/app-boot/package.json`(rc3 同为 `0.2.2-rc.3`,见 `REPO/packages/boot/app-boot/src/plugin-compatibility.ts:44-49`) |
|
|
98
|
+
| vendored Cordis 包版本 | `4.1.0` | `REPO/vendor/cordis/package.json` 的 `version` |
|
|
99
|
+
| Cordis 上游基线 | `4.0.0-rc.11` | `REPO/vendor/README.md:15` |
|
|
100
|
+
| Node 引擎线(附加轴,不是五元锚之一) | `>=24.9.0` | `REPO/package.json` 的 `engines.node` |
|
|
100
101
|
|
|
101
|
-
|
|
102
|
+
**历史锚(2026-10-30,`0.2.2-alpha.2`)**:commit `ce7073d51254c26cd63b22a60835b8f948deb447`、dsh `0.2.2-alpha.2`、cordis `4.0.6-alpha.1`。这一组只用于阅读 2026-10-30~11-01 产出的旧结果(`40-checker/results/**`),**不得**再用作当前符合性绑定。
|
|
103
|
+
|
|
104
|
+
**任何条款在 `cordis` 轴跨 minor 后必须重跑适配层**;rc3 的 cordis 由 `4.0.6-alpha.1` 变为 `4.1.0` 仅是 vendored 包版本号变化(rc3 审计实测该目录源码与 alpha.2 逐字节相同),不构成 minor 跨版,但仍要求以新锚重跑后才可引用。徽章必须带 `reviewedAt` 与 `expiresAt`。宿主 minor bump 后旧徽章标记 `stale`,不得继续展示为有效。
|
|
102
105
|
|
|
103
106
|
### 1.6 本标准不做什么
|
|
104
107
|
|
|
105
|
-
- **不做安全审计**:`ctx.*` 的 seam 不是权限边界。三处源码自陈:`fs-sandbox` 的 fence 是 "policy check in TRUSTED code … NOT a kernel boundary"(`REPO/packages/fs/fs-sandbox/src/index.ts:10-16`);`plugin-manager/tools.ts:
|
|
108
|
+
- **不做安全审计**:`ctx.*` 的 seam 不是权限边界。三处源码自陈:`fs-sandbox` 的 fence 是 "policy check in TRUSTED code … NOT a kernel boundary"(`REPO/packages/fs/fs-sandbox/src/index.ts:10-16`);`plugin-manager/tools.ts:109` 明写 "installed Host code runs outside the workspace sandbox";`cordis-host-runner/sandbox.ts:7` 明写 "is not containment"。
|
|
106
109
|
- **不做运行时沙箱/门控**:同进程插件可 `import node:fs` / 裸 `fetch` 绕过一切 seam(`20/C` §4(d-2))。C-11/C-12 只做**装载期声明一致性 + 披露**。
|
|
107
110
|
- **不证明"无恶意"**:C-15~C-22 是风险线索与阻断项,不是恶意软件判定。静态检查只能发现已知形态;运行时拼路径、远程取代码、反射调用都不可判。任何 PASS 都不得写成"安全""已审计""无风险"。
|
|
108
111
|
- **不排名、不打分、不设 star/下载量门槛**。
|
|
@@ -152,8 +155,8 @@ DS-C 的符合性绑定五元锚,缺一不可:
|
|
|
152
155
|
- 生态实例:`Tencent/WeKnora` 的目录条目无安装命令证据(`10-输入/生态调研报告.md:171`),说明"清单/入口"在目录侧经常没有可核验的锚点;C-1 只能判包内事实,判不了目录条目的完整性。
|
|
153
156
|
|
|
154
157
|
**证据锚点**:
|
|
155
|
-
- `REPO/packages/util/package-manifest/src/types.ts:8-29`:`DshPackageManifest` 要求 `name`、`version`;`dsh`
|
|
156
|
-
- `REPO/packages/util/plugin-market-index/src/index.ts:29`:npm 包名正则;`:
|
|
158
|
+
- `REPO/packages/util/package-manifest/src/types.ts:8-29`:`DshPackageManifest` 要求 `name`、`version`;`dsh` 字段(`:28`)只定义 `manifestVersion`/`bundle`/`profile`/`client`(`DshManifest` 声明 `:32-41`)。
|
|
159
|
+
- `REPO/packages/util/plugin-market-index/src/index.ts:29`:npm 包名正则;`:271-292`:市场条目必须有 `name` 与 `versions`;`:303-320`:`parseMarketIndex` 入口。
|
|
157
160
|
- `REPO/docs/defensive-patterns/package-surface.md:7-20`:Loader 只接受"函数插件四件套"或"默认导出服务类",两者不得混用。
|
|
158
161
|
- `REPO/packages/boot/app-boot/src/profile-plugins.ts:65-83`:`readProfilePlugins()` 只读已安装 manifest,不执行代码。
|
|
159
162
|
|
|
@@ -167,8 +170,8 @@ DS-C 的符合性绑定五元锚,缺一不可:
|
|
|
167
170
|
"type": "module",
|
|
168
171
|
"exports": { ".": "./lib/index.js" },
|
|
169
172
|
"files": ["lib", "locale"],
|
|
170
|
-
"engines": { "dsh": ">=0.2.2-
|
|
171
|
-
"peerDependencies": { "@deepseek-ai/cordis": ">=4.0
|
|
173
|
+
"engines": { "dsh": ">=0.2.2-0 <0.3.0" },
|
|
174
|
+
"peerDependencies": { "@deepseek-ai/cordis": ">=4.1.0 <5" },
|
|
172
175
|
"dsh": { "manifestVersion": 1, "kind": "plugin" }
|
|
173
176
|
}
|
|
174
177
|
```
|
|
@@ -196,31 +199,33 @@ DS-C 的符合性绑定五元锚,缺一不可:
|
|
|
196
199
|
|
|
197
200
|
| 值 | 条件 |
|
|
198
201
|
|---|---|
|
|
199
|
-
| PASS | `engines.dsh` 存在、合法、被当前 runtime
|
|
200
|
-
| WARN |
|
|
202
|
+
| PASS | `engines.dsh` 存在、合法、被当前 runtime 满足;**或**无 `engines.dsh` 但至少一个 dsh peer 范围合法且被满足(peer 替代声明,**较弱**;rc3 宿主的 `unmetRequirements` 把 peer 当等价门,检查器同判 PASS,见下) |
|
|
203
|
+
| WARN | C-2.4:`engines.dsh` 与 dsh peers 的结论冲突(宿主以 `engines.dsh` 单独裁决) |
|
|
201
204
|
| FAIL | 两者皆无;`engines.dsh` 非法/空/不满足;peer 不满足 |
|
|
202
205
|
| NA | `dsh.kind` 非 plugin/bundle |
|
|
203
206
|
|
|
207
|
+
**实现对齐(1.6.11)**:`40-checker/src/manifest.mjs` 的 C-2 分支与 `40-checker/test/c2-exports.test.mjs` 的 peer-only 用例都产出 C-2.1/C-2.2 PASS(`DSC-02 = PASS`),与本表一致;报告须在 reason/peer 说明里注明「peer 替代声明,较弱」。
|
|
208
|
+
|
|
204
209
|
**已知反例**:
|
|
205
|
-
- `dsh-purge-plus` 适配到 `0.2.1-rc.2
|
|
210
|
+
- `dsh-purge-plus` 适配到 `0.2.1-rc.2`,宿主(2026-10 当时)已到 `0.2.2-alpha.2`,装上去就坏(`01-项目纲领.md:34` P0-3;`10-输入/生态调研报告.md:91`)。rc3 下宿主是 `0.2.2-rc.3`,同类漂移仍成立。
|
|
206
211
|
- 宿主 `plugin-compatibility.ts:62` 在"既无 `engines.dsh` 又无 `peerDependencies`"时 `return {}`,即**无声明 = 兼容**;这是本条款要堵的洞。
|
|
207
212
|
- 构造反例:`engines.dsh: ">=0.2.1-rc.2"` 在 prerelease 语义下可能满足,但插件实际用了 0.2.2 才有的 API;版本声明正确不等于行为正确,C-4 只补一半。
|
|
208
213
|
|
|
209
214
|
**证据锚点**:
|
|
210
215
|
- `REPO/packages/boot/app-boot/src/plugin-compatibility.ts:55-74`:`unmetRequirements`;`:62` 无 peer 即返回空对象;`:69-71` 只看 `@deepseek-ai/dsh*` peer;`:87-102` `evaluatePluginCompatibility(manifest, exemptions, runtimeVersion)`。
|
|
211
216
|
- `REPO/packages/boot/app-boot/src/plugin-compatibility.ts:110-117`:`pluginCompatibilityWarning` 给出精确版本豁免通道(`--accept-risk` / `allow-version`)。
|
|
212
|
-
- `REPO/vendor/README.md:
|
|
217
|
+
- `REPO/vendor/README.md:15`:Cordis 上游基线 `4.0.0-rc.11`;`REPO/vendor/cordis/package.json` 的 `4.1.0` 是 Harness 发布版本,不是上游基线。
|
|
213
218
|
|
|
214
219
|
**正面示例**:
|
|
215
220
|
|
|
216
221
|
```json
|
|
217
|
-
{ "engines": { "dsh": ">=0.2.2-
|
|
222
|
+
{ "engines": { "dsh": ">=0.2.2-0 <0.3.0" } }
|
|
218
223
|
```
|
|
219
224
|
|
|
220
225
|
或(无 `engines.dsh` 时):
|
|
221
226
|
|
|
222
227
|
```json
|
|
223
|
-
{ "peerDependencies": { "@deepseek-ai/dsh-tools": ">=0.2.2-
|
|
228
|
+
{ "peerDependencies": { "@deepseek-ai/dsh-tools": ">=0.2.2-0 <0.3.0" } }
|
|
224
229
|
```
|
|
225
230
|
|
|
226
231
|
**建议分级**:DS-C 强制。**本条款比宿主更严**:宿主允许"无声明即兼容",DS-C 不允许;这是有意为之,因为无声明的插件无法被五元锚约束。
|
|
@@ -259,9 +264,9 @@ DS-C 的符合性绑定五元锚,缺一不可:
|
|
|
259
264
|
- CLI 把 `args` 原样转给 pnpm(`REPO/apps/cli/src/plugin.ts:92-98`),spec 面很宽;没有本条款,pnpm 接受什么就装什么。
|
|
260
265
|
|
|
261
266
|
**证据锚点**:
|
|
262
|
-
- `REPO/packages/boot/plugin-manager/src/install-spec.ts:
|
|
267
|
+
- `REPO/packages/boot/plugin-manager/src/install-spec.ts:70-93`:`parseInstallSpec` 的四种形态与拒绝规则;`:131` `NON_REGISTRY_VALUE`。
|
|
263
268
|
- `REPO/packages/boot/plugin-manager/src/build-approval.ts:78-83`:`blockedBuildNames` 从 pnpm 输出提取构建脚本;`:63-72` `recordPendingBuilds` 写入 `allowBuilds`。
|
|
264
|
-
- `REPO/packages/util/plugin-market-index/src/index.ts:
|
|
269
|
+
- `REPO/packages/util/plugin-market-index/src/index.ts:194-209`:`source` 只接受 npm/git,git 必须 40hex;`:211-220` `engines.dsh` 不得 `workspace:`;`:243-256` 精确 SemVer;`:303-320` 总校验。
|
|
265
270
|
- `REPO/apps/cli/src/plugin.ts:92-98`:参数转发给 pnpm。
|
|
266
271
|
|
|
267
272
|
**正面示例**(listing 模式):
|
|
@@ -273,7 +278,7 @@ DS-C 的符合性绑定五元锚,缺一不可:
|
|
|
273
278
|
"version": "1.2.3",
|
|
274
279
|
"publishTimestamp": 1760000000,
|
|
275
280
|
"source": { "type": "npm" },
|
|
276
|
-
"engines": { "dsh": ">=0.2.2-
|
|
281
|
+
"engines": { "dsh": ">=0.2.2-0 <0.3.0" }
|
|
277
282
|
}]
|
|
278
283
|
}
|
|
279
284
|
```
|
|
@@ -308,7 +313,7 @@ DS-C 的符合性绑定五元锚,缺一不可:
|
|
|
308
313
|
|
|
309
314
|
**已知反例**:
|
|
310
315
|
- 插件 `inject` 了一个没人提供的服务 → PENDING,打印 nothing,无错误(`REPO/docs/cordis-tutorial/06-composition-and-hmr.md:63`;`REPO/docs/cordis-tutorial/03-services.md:72`)。
|
|
311
|
-
- `dsh-purge-plus` 适配到 `0.2.1-rc.2
|
|
316
|
+
- `dsh-purge-plus` 适配到 `0.2.1-rc.2`,宿主(2026-10 当时)已到 `0.2.2-alpha.2`:版本漂移使"装载前兼容性判定"不可靠(`10-输入/生态调研报告.md:91`;`01-项目纲领.md:34`)。rc3 下同类漂移仍成立。
|
|
312
317
|
- 构造反例:入口 `import` 一个未声明的 peer,抛出 `ERR_MODULE_NOT_FOUND`;C-4.1 直接 FAIL。
|
|
313
318
|
|
|
314
319
|
**证据锚点**:
|
|
@@ -486,6 +491,8 @@ assert.deepEqual(keys(ctx.reflect.store), before.reflectKeys)
|
|
|
486
491
|
assert.equal(ctx.registry.size, before.registrySize)
|
|
487
492
|
```
|
|
488
493
|
|
|
494
|
+
> **rc3 有效(future-only 注)**:`ctx.root` 与 `await ctx.root.fiber.await()` 在 DSH `0.2.2-rc.3`(vendored cordis `4.1.0`)里仍然存在——`Context.root` / `Service.resolveConfig` 均未移除,本示例**不是 rc3 错误**。下一版(rc3 之后的 `v0.2.2-rc.2` 指南 `cordis-root-and-intercept-metadata`)才会改为 `ctx[Context.root]` / `resolveIntercept`;届时再迁移,现在不要提前改。
|
|
495
|
+
|
|
489
496
|
**建议分级**:DS-C 强制。这是"不破坏宿主"的唯一机械证据。
|
|
490
497
|
|
|
491
498
|
**边界说明**:C-7 的 PASS **不证明**"没有未登记资源泄漏"。报告必须写 `leakScope: registered-only`,不得把 C-7 PASS 宣传成"无泄漏"。
|
|
@@ -658,11 +665,11 @@ export function apply(ctx: Context) {
|
|
|
658
665
|
|
|
659
666
|
| 子项 | 检查 | 结果 |
|
|
660
667
|
|---|---|---|
|
|
661
|
-
| C-11.1 | `dsh.capabilities` 是字符串数组,每个 ID 在 §8.1
|
|
668
|
+
| C-11.1 | `dsh.capabilities` 是字符串数组,每个 ID 在 §8.1 判定闭集或保留表内 | 非法 ID → FAIL;保留 ID → 接受(不 FAIL),C-11.5 记 NA;字段缺失 → WARN |
|
|
662
669
|
| C-11.2 | **字段存在时**,高信号触发必须申报(映射见下表) | 字段存在且漏报 → FAIL;字段缺失 → 不评估,C-11 整体 WARN(过渡期) |
|
|
663
670
|
| C-11.3 | bundle patch 不得启用 `@deepseek-ai/dsh-plugin-manager/tools` | 启用 → FAIL |
|
|
664
671
|
| C-11.4 | 源码/配置中 `danger-full-access` 的 AST 字符串字面量;注释、等值比较、文档字符串不算(见下) | 真实授权/命令上下文或未知上下文 → WARN |
|
|
665
|
-
| C-11.5 | 声明了但静态未观测到对应触发 | WARN(**不等于未使用/过度声明**:`node:fs
|
|
672
|
+
| C-11.5 | 声明了但静态未观测到对应触发 | WARN(**不等于未使用/过度声明**:`node:fs` 的读/写调用已作为观测证据;动态调用仍不在触发面内)。**NA(not-run)**:无源码、该能力无静态观测面(`credentials:provider`)、**保留 ID**(本版不判定)、或**扫描截断**(`coverage=partial`,reason 记 `source scan truncated …`)——截断是覆盖缺口,不是过度声明 |
|
|
666
673
|
|
|
667
674
|
**C-11.2 触发映射**:
|
|
668
675
|
|
|
@@ -686,20 +693,20 @@ export function apply(ctx: Context) {
|
|
|
686
693
|
| 值 | 条件 |
|
|
687
694
|
|---|---|
|
|
688
695
|
| PASS | C-11.1 字段存在/合法;C-11.2 无漏报;C-11.3 未启用;C-11.4 无命中 |
|
|
689
|
-
| WARN | 字段缺失(过渡期,C-11.2 不评估);C-11.4 命中;C-11.5
|
|
696
|
+
| WARN | 字段缺失(过渡期,C-11.2 不评估);C-11.4 命中;C-11.5 静态未观测(不等于过度声明);触发信号不确定(动态调用)。C-11.5 的「无源码/无观测面/扫描截断」记 NA,不记 WARN |
|
|
690
697
|
| ERROR | AST 解析失败导致 C-11.4 not-run(coverage=not-run,不冒充 PASS) |
|
|
691
698
|
| FAIL | 非法 ID;字段存在但 C-11.2 漏报;C-11.3 启用 |
|
|
692
699
|
| NA | `dsh.kind` 非 plugin/bundle |
|
|
693
700
|
|
|
694
701
|
**已知反例**:
|
|
695
702
|
- `@deepseek-ai/dsh-plugin-manager/tools` 在 base 层默认 `disabled: true`(`REPO/packages/bundle/base/cordis.patch.yml:16-18`);某个 bundle 把它打开,等于把"模型自安装"能力放给所有会话。
|
|
696
|
-
- `plugin_manager` 工具的风险提示自己写着 "installed Host code runs outside the workspace sandbox"(`REPO/packages/boot/plugin-manager/src/tools.ts:
|
|
703
|
+
- `plugin_manager` 工具的风险提示自己写着 "installed Host code runs outside the workspace sandbox"(`REPO/packages/boot/plugin-manager/src/tools.ts:109`);`installBundle` 在 `plugin-manager/src/index.ts:969`,工具入口在 `tools.ts:150`。
|
|
697
704
|
- `@Remote` 未标注的方法"cannot be called",但标注了就进入 Client 面(`REPO/docs/api-gateway.md:9`);一个插件可能无意中把内部方法暴露出去。
|
|
698
705
|
|
|
699
706
|
**证据锚点**:
|
|
700
|
-
- `REPO/packages/util/package-manifest/src/types.ts:
|
|
701
|
-
- `REPO/packages/boot/plugin-manager/src/tools.ts:
|
|
702
|
-
- `REPO/packages/boot/plugin-manager/src/index.ts:
|
|
707
|
+
- `REPO/packages/util/package-manifest/src/types.ts:32-41`:`dsh` 字段当前只有 `manifestVersion`/`bundle`/`profile`/`client`,**没有** `capabilities`/`labels`/`upstream`。本条款字段是标准扩展,宿主本 commit 不读取。
|
|
708
|
+
- `REPO/packages/boot/plugin-manager/src/tools.ts:109,150`:安装工具的风险与 `installBundle` 调用。
|
|
709
|
+
- `REPO/packages/boot/plugin-manager/src/index.ts:969`:`installBundle` 的公开方法。
|
|
703
710
|
- `REPO/packages/bundle/base/cordis.patch.yml:16-18`:`tool-plugin-manager` 默认 disabled。
|
|
704
711
|
- `REPO/docs/api-gateway.md:9`:`@Remote`/`@RemoteScope` 的暴露语义。
|
|
705
712
|
- `REPO/packages/boot/app-boot/src/profile-plugins.ts:65-83`:只读 manifest 的天然检查点。
|
|
@@ -716,7 +723,7 @@ export function apply(ctx: Context) {
|
|
|
716
723
|
}
|
|
717
724
|
```
|
|
718
725
|
|
|
719
|
-
**建议分级**:DS-C 强制(C-11.1~C-11.3);C-11.4/C-11.5 为 WARN;C-11.5
|
|
726
|
+
**建议分级**:DS-C 强制(C-11.1~C-11.3);C-11.4/C-11.5 为 WARN;C-11.5 在无源码、该能力无静态观测面、**或扫描截断**时记 NA(not-run),不记 WARN(扫描截断时 `coverage=partial`,与 `60-权限与标注规范.md:101` 一致)。
|
|
720
727
|
|
|
721
728
|
**边界说明**:`dsh.capabilities` **不是权限门控**。宿主不读它,也没有运行时沙箱;它只是"装载期声明 + UI 披露"。一个插件完全可以声明 `[]` 然后裸 `import node:fs`,C-11 抓不到。这是 D5 的已知边界,必须在徽章文案里写明"非安全审计"。
|
|
722
729
|
|
|
@@ -758,7 +765,7 @@ export function apply(ctx: Context) {
|
|
|
758
765
|
**证据锚点**:
|
|
759
766
|
- `REPO/packages/credentials/credentials-local/src/index.ts:2-6`:文件头声明 backing file 路径;`:61` `CREDENTIALS_FILENAME`;`:687,703` 权限模式。
|
|
760
767
|
- `REPO/packages/credentials/credentials/src/index.ts:234`:`listRecords()` 抽象方法。
|
|
761
|
-
- `REPO/packages/boot/plugin-manager/src/tools.ts:
|
|
768
|
+
- `REPO/packages/boot/plugin-manager/src/tools.ts:109`:安装的 Host code 在 workspace sandbox 之外。
|
|
762
769
|
- `REPO/packages/fs/fs-sandbox/src/index.ts:10-16`:"NOT a kernel boundary"。
|
|
763
770
|
|
|
764
771
|
**正面示例**:
|
|
@@ -808,10 +815,10 @@ export function apply(ctx: Context) {
|
|
|
808
815
|
- `tabbit-browser/dsh-plugin` 已 404 仍被收录(`10-输入/生态调研报告.md:264`)——生命周期/状态字段缺失的典型(R-11/R-12 管)。
|
|
809
816
|
|
|
810
817
|
**证据锚点**:
|
|
811
|
-
- `REPO/packages/util/package-manifest/src/types.ts:
|
|
818
|
+
- `REPO/packages/util/package-manifest/src/types.ts:32-41`:`dsh` 没有 `labels`/`upstream` 字段;本条款字段是标准扩展。
|
|
812
819
|
- `10-输入/生态调研报告.md:36-59,171,264`:生态实例与数字(唯一来源)。
|
|
813
820
|
- `20-研究底稿/C-安全基线与权限面.md:242-252`:三类分法与标注建议。
|
|
814
|
-
- `REPO/packages/util/plugin-market-index/src/index.ts:
|
|
821
|
+
- `REPO/packages/util/plugin-market-index/src/index.ts:295-296`:format-1 会"ignore and drop"未定义成员;新增字段不会破坏旧解析器,但旧解析器读不到。
|
|
815
822
|
|
|
816
823
|
**正面示例**:
|
|
817
824
|
|
|
@@ -1148,10 +1155,10 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1148
1155
|
"standard": { "id": "DS-C", "version": "1.0.0" },
|
|
1149
1156
|
"anchor": {
|
|
1150
1157
|
"repo": "deepseek-ai/deepseek-harness",
|
|
1151
|
-
"commit": "
|
|
1158
|
+
"commit": "38a6a5c965aa99ab525161efb7cc5cf1fe62fced",
|
|
1152
1159
|
"scanner": "dsh-plugin-verify@0.1.0",
|
|
1153
|
-
"dsh": "0.2.2-
|
|
1154
|
-
"cordis": "4.0
|
|
1160
|
+
"dsh": "0.2.2-rc.3",
|
|
1161
|
+
"cordis": "4.1.0"
|
|
1155
1162
|
},
|
|
1156
1163
|
"subject": { "mode": "package", "profile": "package", "kind": "plugin", "name": "@acme/dsh-greet", "version": "1.2.3" },
|
|
1157
1164
|
"checks": [
|
|
@@ -1230,7 +1237,7 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1230
1237
|
- monorepo 根目录不评级;根 `package.json` 只作为构建上下文。若根本身也是可安装包,按它自己的包评。
|
|
1231
1238
|
- 兄弟包不继承等级:A 包 DS-C 不代表 B 包 DS-C;B 包 FAIL 不连坐 A 包。
|
|
1232
1239
|
- 共享代码包(不单独安装)→ `NA`,理由 "internal package, not installable"。
|
|
1233
|
-
- 市场条目必须能定位到包:format-1 的 `repository.directory` 已支持(`REPO/packages/util/plugin-market-index/src/index.ts:
|
|
1240
|
+
- 市场条目必须能定位到包:format-1 的 `repository.directory` 已支持(`REPO/packages/util/plugin-market-index/src/index.ts:187-192`);T3 的 schema 补丁应要求 monorepo 条目带 `directory`。
|
|
1234
1241
|
- 同一版本号在不同包路径下是不同主体;五元锚里加 `packagePath` 作为 `subject` 的子字段。
|
|
1235
1242
|
|
|
1236
1243
|
### 5.3 Q5:skill-only / 主题 / 客户端形态怎么处理
|
|
@@ -1264,7 +1271,7 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1264
1271
|
|
|
1265
1272
|
### 6.4 C-11/C-12/C-13 的字段是标准扩展,不是宿主现状
|
|
1266
1273
|
|
|
1267
|
-
`03` §三(c) 直接写 `dsh.labels`,但 `packages/util/package-manifest/src/types.ts:
|
|
1274
|
+
`03` §三(c) 直接写 `dsh.labels`,但 `packages/util/package-manifest/src/types.ts:32-41` 没有这个字段,宿主也不读。本文件保留字段,但把"缺失"定为 WARN(过渡期),并在徽章文案里写明"声明,不是门控"。建议 `03` 的 §三(a)/(c) 加"字段为本标准提案,宿主采纳前只读不门控"。
|
|
1268
1275
|
|
|
1269
1276
|
### 6.5 MVP 13 项覆盖不了 13 条 DS-C
|
|
1270
1277
|
|
|
@@ -1272,11 +1279,11 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1272
1279
|
|
|
1273
1280
|
### 6.6 版本轴措辞
|
|
1274
1281
|
|
|
1275
|
-
`03` §七.1 写"Cordis 4.0.0-rc.11";`01` §十一只说"宿主仍在 rc"
|
|
1282
|
+
`03` §七.1 写"Cordis 4.0.0-rc.11";`01` §十一只说"宿主仍在 rc",没有区分三个轴。rc3 实测:根包 `0.2.2-rc.3`、vendored manifest `4.1.0`、`vendor/README.md:15` 记录的上游基线 `4.0.0-rc.11`。三个轴不是同一个东西。建议 `01`/`03` 改用 §1.5 的三轴写法,避免把上游基线当现值。
|
|
1276
1283
|
|
|
1277
1284
|
### 6.7 两处研究底稿的行号/资产漂移
|
|
1278
1285
|
|
|
1279
|
-
- `03` §四说 `parseMarketIndex` 是"191 行规则"
|
|
1286
|
+
- `03` §四说 `parseMarketIndex` 是"191 行规则";rc3 的 `packages/util/plugin-market-index/src/index.ts` 是 334 行,`parseMarketIndex` 在 `:303-320`。建议改为"334 行模块,核心校验 :303-320"。
|
|
1280
1287
|
- `20/E` 提到的 `packageProblems()` 在 `scripts/verify-package-meta.ts:115`,是 monorepo 的 `verify-*` 脚本,不在 `packages/` 的可发布包里。T2 不能直接 import;需要剥一层(复制规则)或自写等价校验。建议 E 路把该资产标为"B 档:剥一层"。
|
|
1281
1288
|
|
|
1282
1289
|
### 6.8 C-1 的 license 只到 WARN
|
|
@@ -1287,18 +1294,18 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1287
1294
|
|
|
1288
1295
|
## 七、附录 A · 证据核验表
|
|
1289
1296
|
|
|
1290
|
-
>
|
|
1297
|
+
> 行号为 rc3 commit(`38a6a5c9`)实测:2026-11-14 按 rc3 重取了已知漂移的锚(`plugin-manager/src/index.ts`、`tools.ts`、`cordis-host-runner/sandbox.ts`、`package-manifest/src/types.ts`、`vendor/README.md`、`install-spec.ts`),并顺带复取了 `plugin-market-index/src/index.ts` 的行号;其余条目在 rc3 上抽检仍命中、未逐条复跑。标"输入"的生态数字来自 `10-输入/生态调研报告.md`,按 §8 不重新联网核验。
|
|
1291
1298
|
|
|
1292
1299
|
| # | 锚点 | 证明什么 | 状态 |
|
|
1293
1300
|
|---|---|---|---|
|
|
1294
1301
|
| 1 | `REPO/packages/util/package-manifest/src/types.ts:8-29` | manifest 必填 name/version;dsh 字段范围 | 已核验 |
|
|
1295
|
-
| 2 | `REPO/packages/util/package-manifest/src/types.ts:
|
|
1296
|
-
| 3 | `REPO/packages/util/plugin-market-index/src/index.ts:29,
|
|
1297
|
-
| 4 | `REPO/packages/util/plugin-market-index/src/index.ts:
|
|
1298
|
-
| 5 | `REPO/packages/util/plugin-market-index/src/index.ts:
|
|
1302
|
+
| 2 | `REPO/packages/util/package-manifest/src/types.ts:32-41` | **没有** capabilities/labels/upstream | 已核验(缺失) |
|
|
1303
|
+
| 3 | `REPO/packages/util/plugin-market-index/src/index.ts:29,271-292,303-320` | 包名/条目/索引校验 | 已核验 |
|
|
1304
|
+
| 4 | `REPO/packages/util/plugin-market-index/src/index.ts:194-220,243-256` | source/engines/精确 SemVer | 已核验 |
|
|
1305
|
+
| 5 | `REPO/packages/util/plugin-market-index/src/index.ts:295` | 未定义成员被 ignore/drop | 已核验 |
|
|
1299
1306
|
| 6 | `REPO/packages/boot/app-boot/src/plugin-compatibility.ts:55-74,87-102` | 版本兼容裁决 | 已核验 |
|
|
1300
1307
|
| 7 | 同上 `:62` | 无 peer 声明即 `return {}` | 已核验 |
|
|
1301
|
-
| 8 | `REPO/packages/boot/plugin-manager/src/install-spec.ts:
|
|
1308
|
+
| 8 | `REPO/packages/boot/plugin-manager/src/install-spec.ts:70-93` | `parseInstallSpec` | 已核验 |
|
|
1302
1309
|
| 9 | `REPO/packages/boot/plugin-manager/src/build-approval.ts:63-83` | `blockedBuildNames`/`pendingBuilds` | 已核验 |
|
|
1303
1310
|
| 10 | `REPO/apps/cli/src/plugin.ts:92-98` | args 原样转 pnpm | 已核验 |
|
|
1304
1311
|
| 11 | `REPO/vendor/cordis/src/fiber.ts:147-154` | FiberState 六态;const enum | 已核验 |
|
|
@@ -1329,12 +1336,12 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1329
1336
|
| 36 | `REPO/packages/preset/agent-preset-registry/src/mount.ts:213` | preset 服务泄漏硬失败 | 已核验 |
|
|
1330
1337
|
| 37 | `REPO/packages/credentials/credentials-local/src/index.ts:61,687,703` | backing file/权限 | 已核验 |
|
|
1331
1338
|
| 38 | `REPO/packages/credentials/credentials/src/index.ts:234` | `listRecords()` | 已核验 |
|
|
1332
|
-
| 39 | `REPO/packages/boot/plugin-manager/src/tools.ts:
|
|
1333
|
-
| 40 | `REPO/packages/boot/plugin-manager/src/index.ts:
|
|
1339
|
+
| 39 | `REPO/packages/boot/plugin-manager/src/tools.ts:109,150` | sandbox 之外/installBundle | 已核验 |
|
|
1340
|
+
| 40 | `REPO/packages/boot/plugin-manager/src/index.ts:969` | `installBundle` | 已核验 |
|
|
1334
1341
|
| 41 | `REPO/packages/bundle/base/cordis.patch.yml:16-18` | plugin-manager/tools 默认 disabled | 已核验 |
|
|
1335
1342
|
| 42 | `REPO/docs/api-gateway.md:9` | `@Remote` 暴露语义 | 已核验 |
|
|
1336
1343
|
| 43 | `REPO/packages/fs/fs-sandbox/src/index.ts:10-16` | NOT a kernel boundary | 已核验 |
|
|
1337
|
-
| 44 | `REPO/packages/extensions/cordis-host-runner/src/sandbox.ts:
|
|
1344
|
+
| 44 | `REPO/packages/extensions/cordis-host-runner/src/sandbox.ts:7` | is not containment | 已核验 |
|
|
1338
1345
|
| 45 | `REPO/docs/defensive-patterns/package-surface.md:7-20,227-233` | Loader 导出形态/顶层 await | 已核验 |
|
|
1339
1346
|
| 46 | `REPO/docs/cordis-tutorial/02-lifecycle-and-effects.md:9-27,84-94` | effect/清理顺序 | 已核验 |
|
|
1340
1347
|
| 47 | `REPO/docs/cordis-tutorial/03-services.md:52-72` | inject 与 PENDING | 已核验 |
|
|
@@ -1346,7 +1353,7 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1346
1353
|
| 53 | `REPO/AGENTS.md:133,136,140` | 注册即 effect/waterfall/缝三层 | 已核验 |
|
|
1347
1354
|
| 54 | `REPO/docs/capability-seams.md:733,741,743,748` | shell/fs/subagents/jobs 缝 | 已核验 |
|
|
1348
1355
|
| 55 | `REPO/packages/core/agent-loop/README.md:164` | KV cache 前缀 | 已核验 |
|
|
1349
|
-
| 56 | `REPO/docs/tool-catalog.md:
|
|
1356
|
+
| 56 | `REPO/docs/tool-catalog.md:8` | schema 不可静态知 | 已核验 |
|
|
1350
1357
|
| 57 | `REPO/packages/boot/app-boot/src/config-schema/projector.ts:124-134` | volatile containment | 已核验 |
|
|
1351
1358
|
| 58 | `REPO/packages/core/agent-loop/src/index.ts:292,296` | inject/volatile 模范 | 已核验 |
|
|
1352
1359
|
| 59 | `10-输入/生态调研报告.md:36-59,91,171,264` | 生态实例/数字 | 输入(未重抓) |
|
|
@@ -1356,7 +1363,7 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1356
1363
|
|
|
1357
1364
|
## 八、附录 B · 字段与词汇
|
|
1358
1365
|
|
|
1359
|
-
### 8.1 `dsh.capabilities` 最小闭集(15
|
|
1366
|
+
### 8.1 `dsh.capabilities` 最小闭集(15 项判定 + 16 项保留)
|
|
1360
1367
|
|
|
1361
1368
|
| ID | 触发信号(静态可判) | 说明 |
|
|
1362
1369
|
|---|---|---|
|
|
@@ -1376,7 +1383,26 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1376
1383
|
| `remote:expose` | `@Remote`/`@RemoteScope` | 对外 Remote 方法 |
|
|
1377
1384
|
| `plugin:install` | `ctx.pluginManager.installBundle/removeBundle` | 自安装/卸载插件 |
|
|
1378
1385
|
|
|
1379
|
-
|
|
1386
|
+
**保留 ID(本版不参与判定,允许声明)**:以下 ID 在 DSH 0.2.2-rc.3 宿主里有对应 seam,但本版的静态触发映射 / FAIL 策略未定。C-11.1 **接受**保留 ID(不记非法),C-11.5 对它们记 **NA(not-run)** 而不是 WARN;C-11.2 的 FAIL 面**不扩大**——保留 ID 不能替代任何判定闭集里的 ID(例如声明 `computer:control` 不等于声明 `shell`)。保留表的增删是标准的破坏性变更;把某项升入判定闭集,必须同时补 C-11.2 触发映射、观测面与测试。
|
|
1387
|
+
|
|
1388
|
+
| 保留 ID | rc3 宿主 seam(`super(ctx, '<name>')`) | 说明 |
|
|
1389
|
+
|---|---|---|
|
|
1390
|
+
| `mcp:client` | `mcpManager`(客户端侧) | MCP 客户端连接 |
|
|
1391
|
+
| `mcp:manage` | `mcpManager`(注册/管理) | 管理 MCP server 配置 |
|
|
1392
|
+
| `mcp:resources` | `mcpResources` | MCP 资源访问 |
|
|
1393
|
+
| `browser` | `browserUse`(粗粒度保留名) | 浏览器自动化 |
|
|
1394
|
+
| `browser:control` | `browserUse` | 浏览器控制(细化名) |
|
|
1395
|
+
| `computer:control` | `computerUse`、`cuaAccess` | 桌面 / computer-use 控制 |
|
|
1396
|
+
| `ssh:connect` | `ssh` | SSH 连接 |
|
|
1397
|
+
| `terminal:control` | `terminals`、`webTerminals`、`terminalController` | 终端控制 |
|
|
1398
|
+
| `sandbox:override` | `sandbox`、`sandboxPolicy` | 放宽 / 改写沙箱策略 |
|
|
1399
|
+
| `approval:override` | `approval` | 审批 / 放行覆盖 |
|
|
1400
|
+
| `authorization:delegate` | `authorization` | 授权委托 |
|
|
1401
|
+
| `remote-access:use` | `remoteAccess` | 宿主远程访问 |
|
|
1402
|
+
| `session-log:egress` | `sessionLogDeepSeek` | 会话日志外发 |
|
|
1403
|
+
| `webhook:rule` | Webhook 规则面 | 保留(原有) |
|
|
1404
|
+
| `theme:ui` | 主题 / UI 面 | 保留(原有) |
|
|
1405
|
+
| `client:ui` | Client UI 面 | 保留(原有) |
|
|
1380
1406
|
|
|
1381
1407
|
### 8.2 `dsh.labels` 最小闭集(5 项)
|
|
1382
1408
|
|
|
@@ -1396,7 +1422,7 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
|
|
|
1396
1422
|
|
|
1397
1423
|
### 8.4 新增字段的兼容性
|
|
1398
1424
|
|
|
1399
|
-
宿主当前会忽略 `package.json` 里未定义的 `dsh.*` 字段(`types.ts:
|
|
1425
|
+
宿主当前会忽略 `package.json` 里未定义的 `dsh.*` 字段(`types.ts:32-41` 只声明四个);市场 format-1 解析器会"ignore and drop"未定义成员(`index.ts:295`)。因此新增字段**不会破坏旧解析器**,但旧解析器读不到——这正是 T3 要给 schema 打补丁的原因。
|
|
1400
1426
|
|
|
1401
1427
|
---
|
|
1402
1428
|
|
|
@@ -95,7 +95,8 @@
|
|
|
95
95
|
|
|
96
96
|
> 这不是“18/18 可用”;是“18/18 能被识别,7/18 在 base-only + gate 下全行 ACTIVE”。完整 base+web-app 未跑,4 个 pending 不得写成 pass。
|
|
97
97
|
>
|
|
98
|
-
> **0.2.2-alpha.3 补充(2026-11-04
|
|
98
|
+
> **0.2.2-alpha.3 补充(2026-11-04,历史)**:ENTRY 还要按 Node `>=24.9.0`、`engines.dsh` 优先(0.2.1-alpha.4+)、Typert `create()`、`dsh-client-runtime` 已移除来核对。
|
|
99
|
+
> **0.2.2-rc.3 补充(2026-11-14)**:现行锚为 `dsh=0.2.2-rc.3`(tag `38a6a5c9`)/ vendored `cordis=4.1.0`(upstream `4.0.0-rc.11`)/ Node `>=24.9.0`;`engines.dsh` 写 `>=0.2.2-0 <0.3.0`;`ctx.root` 在 rc3 仍有效(下一版才迁移);详见 `35` §7.1。
|
|
99
100
|
|
|
100
101
|
---
|
|
101
102
|
|
|
@@ -173,10 +173,10 @@ DSH 插件生态里,“合格”至少有三层含义,而且它们不是同
|
|
|
173
173
|
|
|
174
174
|
### 10.1 六条边界事实
|
|
175
175
|
|
|
176
|
-
| # | 机制 | 宿主实际做什么 | 插件能做什么 / 宿主不做什么 |
|
|
176
|
+
| # | 机制 | 宿主实际做什么 | 插件能做什么 / 宿主不做什么 | 证据锚(rc3 `38a6a5c9` 复核 2026-11-14;宿主 `0.2.2-rc.3`,行号抽检) |
|
|
177
177
|
|---|---|---|---|---|
|
|
178
178
|
| 1 | 同进程加载 | 插件入口在宿主 Node 进程里 `import`;`apply()` 与宿主同权限;安装页只有静态 trust 文案,没有加载期信任提示 | 可 `import node:fs` / `node:child_process`,裸 `fetch`,读写同用户可及的任何文件;无运行时沙箱 | `packages/boot/plugin-manager`、`vendor/loader`;`packages/client/ui-plugin-manager/src/client/locales.ts:386` |
|
|
179
|
-
| 2 | capabilities | `dsh.capabilities` 是本标准新增字段;宿主 `DshManifest` 只声明 `manifestVersion`/`bundle`/`profile`/`client`,**不读、不校验、不门控** | 声明 `[]` 后仍可做任何事;漏报/造假不会被宿主拒绝 | `packages/util/package-manifest/src/types.ts:
|
|
179
|
+
| 2 | capabilities | `dsh.capabilities` 是本标准新增字段;宿主 `DshManifest` 只声明 `manifestVersion`/`bundle`/`profile`/`client`,**不读、不校验、不门控** | 声明 `[]` 后仍可做任何事;漏报/造假不会被宿主拒绝 | `packages/util/package-manifest/src/types.ts:32-41` |
|
|
180
180
|
| 3 | sandbox | 只约束**子进程**的文件写;网络与进程可见性"不在词汇内";读访问不限制;源码自陈 "is not containment" | 插件自己的 `node:fs`/`fetch`/`spawn` 绕过 seam;子进程网络也不被拦 | `packages/sandbox/src/index.ts:27-28`;`cordis-host-runner/sandbox.ts:7`;`packages/fs/fs-sandbox/src/index.ts:10-16` |
|
|
181
181
|
| 4 | approval | 只有 `tools/pre-execute` 的 `ask` 与 sandbox 升级会审批;工具实现自身不强制;审批者无身份校验 | 插件注册的工具可直接 `allow`;插件自己的 fetch/fs/spawn 不经过审批;`installBundle` 的 `@Remote` 路径无审批 | `packages/core/tools/src/pipeline.ts:449`;`packages/sandbox/src/escalation.ts:172`;`plugin-manager/src/index.ts:872` |
|
|
182
182
|
| 5 | `!!js` 配置 | bundle patch 的 YAML 自定义 tag 经 `new Function` 求值;配置在**加载期**变成可执行代码 | 一个看似声明式的 patch 字段即可执行任意表达式;静态扫描代码闭包看不到它 | `packages/boot/app-boot/src/index.ts:561`;loader `config/utils` |
|
package/40-checker/README.md
CHANGED
|
@@ -104,7 +104,7 @@ node bin/dsh-plugin-verify.mjs ./my-plugin --scope entry --entry-claim static
|
|
|
104
104
|
|
|
105
105
|
# plugin:必须 L1 真跑,才算 runtime
|
|
106
106
|
node bin/dsh-plugin-verify.mjs ./my-plugin --scope entry \
|
|
107
|
-
--runtime /path/to/cordis/lib/index.js --runtime-version 0.2.2-
|
|
107
|
+
--runtime /path/to/cordis/lib/index.js --runtime-version 0.2.2-rc.3
|
|
108
108
|
|
|
109
109
|
# bundle:默认 require,有 --host 时跑 G0–G3(无 host 则 incomplete)
|
|
110
110
|
node bin/dsh-plugin-verify.mjs ./my-bundle --scope entry --host /path/to/app-boot/lib/index.js
|
|
@@ -112,7 +112,7 @@ node bin/dsh-plugin-verify.mjs ./my-bundle --scope entry --host /path/to/app-boo
|
|
|
112
112
|
# 兼容旧数据:只跑 server entry,明确标 proxy,不冒充 bundle
|
|
113
113
|
node bin/dsh-plugin-verify.mjs ./my-bundle --scope entry \
|
|
114
114
|
--entry-runtime server-entry --treat-as-plugin \
|
|
115
|
-
--runtime /path/to/cordis/lib/index.js --runtime-version 0.2.2-
|
|
115
|
+
--runtime /path/to/cordis/lib/index.js --runtime-version 0.2.2-rc.3
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
- `interop-static` 只表示可识别/可安装,不是通过;只有 `interop-runtime` 才是通过。
|
|
@@ -164,8 +164,8 @@ node bin/dsh-flow-collect.mjs --package ./my-plugin --sandbox --out flow-evidenc
|
|
|
164
164
|
```bash
|
|
165
165
|
node bin/dsh-plugin-verify.mjs ./my-plugin \
|
|
166
166
|
--runtime /path/to/deepseek-harness/vendor/cordis/lib/index.js \
|
|
167
|
-
--runtime-version 0.2.
|
|
168
|
-
--cordis-version 4.0
|
|
167
|
+
--runtime-version 0.2.2-rc.3 \ # 省略时自动取 `dsh --version`(宿主实际版本)
|
|
168
|
+
--cordis-version 4.1.0
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
- 只对 `kind: plugin` 跑;`bundle`/`client` 默认输出 NA。`--treat-as-plugin` 可对 bundle 的 server entry 跑(见下)。
|
|
@@ -194,13 +194,13 @@ node bin/dsh-plugin-verify.mjs ./my-plugin \
|
|
|
194
194
|
|
|
195
195
|
**覆盖度与分桶(加性)**:`coverage` 统计报告携带的**全部**检查(完整跑是 14 项)——`pass/warn/fail/na/notRun/error` 都按 `checks[]` 实算,`total` 是总数;`coverage.notRun` 含 ERROR/未跑与缺失的强制项,`na` 再单列。`metrics = {checked, total, declaredFields}` 中的 `declaredFields` 是 5 个可选声明面(capabilities/labels/commitments/disclosure/engines.dsh)中实际声明的个数,只作上下文、不进结论。`buckets.blocking`(FAIL)、`buckets.hygiene`(WARN,`DSC-11/12/13` 标 `declaration`)、`buckets.notChecked`(NA/not-run/ERROR)是 text 的渲染顺序。`entryBlocking` 增加 `checked`/`notChecked`:`pass` 仅在 6 个阻断前提(C-1.1/1.2/1.4、C-3.1/3.2/3.5;runtime claim 再加 C-2.2/2.3)**都**产出 detail 且无 FAIL 时为 true——没给 `--install-spec`/`--market-index` 时 C-3.x 未查,`pass` 必为 false。
|
|
196
196
|
|
|
197
|
-
**锚**:`anchor.dsh` 默认取宿主 `dsh --version`(`anchor.runtimeSource=host`);显式 `--runtime-version` 时 `runtimeSource=cli`,与宿主不一致则 `anchor.suspect=true`;找不到 dsh 才回退常量并标 `
|
|
197
|
+
**锚**:`anchor.dsh` 默认取宿主 `dsh --version`(`anchor.runtimeSource=host`);显式 `--runtime-version` 时 `runtimeSource=cli`,与宿主不一致则 `anchor.suspect=true`;找不到 dsh 才回退常量并标 `default`(`anchor.suspect=true`)。
|
|
198
198
|
|
|
199
199
|
## 6. 已知限制
|
|
200
200
|
|
|
201
201
|
1. **C-3 只在 listing 模式可判**;package 模式是 NA,仅附供应链 advisory 证据。
|
|
202
202
|
2. **L1–L3 已覆盖 13/14 个真实包**:4 个 npm bundle + 9/10 GitHub 源码样本 C-4/C-7 PASS;仅 `dsh-vision-router` 构建后仍缺 `lib/session-affinity.js` FAIL。host farm 用 `scripts/host-farm.mjs` 搭建,仍是临时目录。
|
|
203
|
-
3. **C-8.2 的 revision/epoch 在 Cordis 4.0.5 构建里不可观测**,因此 good fixture 的 C-8 是 WARN;4.0
|
|
203
|
+
3. **C-8.2 的 revision/epoch 在 Cordis 4.0.5 构建里不可观测**,因此 good fixture 的 C-8 是 WARN;rc3 vendored `4.1.0` 源码仍有 `_revision`(`vendor/cordis/src/fiber.ts:209`),换运行时后应变 PASS(rc3 下未重跑复验)。
|
|
204
204
|
4. **C-13 只判声明一致性**;没有 `dsh.capabilities` 的插件无法被分类,高风险样本需要人工/市场复核(见 41)。
|
|
205
205
|
5. **C-10 是 advisory**,不产生 FAIL;危险 AST/句柄泄漏仍不进强制级。
|
|
206
206
|
6. `dsh.commitments`/`dsh.disclosure` 缺失只记 NA/WARN;C-12 不会因“没写承诺”而 FAIL。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema": "dsh-entry18-manifest/1",
|
|
3
3
|
"description": "The 18 deduplicated ENTRY packages: 10 GitHub + 8 npm. id/name/version come from 40-checker/results/entry/18/summary.json. source/spec select the installable artifact: a published npm tarball at the exact version when it exists, otherwise a shallow clone of the repo.",
|
|
4
4
|
"profile": "base",
|
|
5
|
-
"targetDshVersion": "0.2.2-
|
|
5
|
+
"targetDshVersion": "0.2.2-rc.3",
|
|
6
6
|
"count": 18,
|
|
7
7
|
"sources": {
|
|
8
8
|
"github": 10,
|
|
@@ -13,8 +13,15 @@
|
|
|
13
13
|
* Entry fields are a superset of the original `dsh-market-sidecar/1` shape
|
|
14
14
|
* (subject/levels/evidence/validity/lifecycle/selfAssessed are unchanged):
|
|
15
15
|
* title/repo/license from the published package.json, null when absent
|
|
16
|
-
* scope {dsh, cordis, platform} from
|
|
17
|
-
*
|
|
16
|
+
* scope {dsh, cordis, platform} from the package's OWN
|
|
17
|
+
* declarations (dsh.engines / npm engines / cordis
|
|
18
|
+
* peerDependencies+dependencies); null when the package
|
|
19
|
+
* declares nothing. A check anchor is never copied in:
|
|
20
|
+
* "checked at 0.2.2-rc.3" is not "requires 0.2.2-rc.3".
|
|
21
|
+
* anchor {dsh, cordis, commit, source, suspect}: the five-element
|
|
22
|
+
* anchor the audit actually ran under (from
|
|
23
|
+
* audit.checker.anchor), kept separate from scope so a
|
|
24
|
+
* reader can tell what was checked and what was declared.
|
|
18
25
|
* checks checker results as {id,result,coverage} only; detailed
|
|
19
26
|
* reasons stay in the report, never in the sidecar
|
|
20
27
|
* evidence url/sha256 kept for compatibility; reportUrl/
|
|
@@ -56,6 +63,8 @@ const FORBIDDEN = new Set(['advice', 'issuer', 'recordHash', 'verifyUrl', 'score
|
|
|
56
63
|
const NOT_CLAIMED = ['official', 'certification', 'security-audit', 'endorsement', 'ordering', 'comparison', 'warranty']
|
|
57
64
|
const CHECK_KEYS = new Set(['id', 'result', 'coverage'])
|
|
58
65
|
const SCOPE_KEYS = new Set(['dsh', 'cordis', 'platform'])
|
|
66
|
+
const ANCHOR_KEYS = new Set(['dsh', 'cordis', 'commit', 'source', 'suspect'])
|
|
67
|
+
const ANCHOR_SOURCES = new Set(['cli', 'host', 'default'])
|
|
59
68
|
const CHECKED_BY_KEYS = new Set(['checker', 'command', 'securityCommand'])
|
|
60
69
|
const SECURITY_KEYS = new Set(['state', 'checks', 'summary', 'command'])
|
|
61
70
|
const SECURITY_STATES = new Set(['checked', 'partial', 'not-run'])
|
|
@@ -260,19 +269,43 @@ function platformFromPackage(meta) {
|
|
|
260
269
|
return [os.join('/'), cpu.join('/')].filter(Boolean).join('-')
|
|
261
270
|
}
|
|
262
271
|
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
/**
|
|
273
|
+
* `scope` answers "what does this package declare it runs on?" — it is built
|
|
274
|
+
* only from the package's own manifest fields. A missing declaration stays
|
|
275
|
+
* null; the checker's own anchor must never be presented as a package
|
|
276
|
+
* requirement (that made 28 of 50 entries claim a 0.2.2-rc.3 range they never
|
|
277
|
+
* wrote, and leaked the old 4.0.6-alpha.1 default into 14 cordis scopes).
|
|
278
|
+
*/
|
|
279
|
+
function inferScope(meta) {
|
|
265
280
|
const dshEngines = meta?.dsh?.engines && typeof meta.dsh.engines === 'object' ? meta.dsh.engines : {}
|
|
266
281
|
const engines = meta?.engines && typeof meta.engines === 'object' ? meta.engines : {}
|
|
267
282
|
const peer = meta?.peerDependencies && typeof meta.peerDependencies === 'object' ? meta.peerDependencies : {}
|
|
268
283
|
const deps = meta?.dependencies && typeof meta.dependencies === 'object' ? meta.dependencies : {}
|
|
269
284
|
return {
|
|
270
|
-
dsh: firstString(dshEngines.dsh, engines.dsh
|
|
271
|
-
cordis: firstString(dshEngines.cordis, engines.cordis, peer['@deepseek-ai/cordis'], deps['@deepseek-ai/cordis']
|
|
285
|
+
dsh: firstString(dshEngines.dsh, engines.dsh),
|
|
286
|
+
cordis: firstString(dshEngines.cordis, engines.cordis, peer['@deepseek-ai/cordis'], deps['@deepseek-ai/cordis']),
|
|
272
287
|
platform: platformFromPackage(meta),
|
|
273
288
|
}
|
|
274
289
|
}
|
|
275
290
|
|
|
291
|
+
/**
|
|
292
|
+
* `anchor` answers "what did the checks run against?" — it is copied from the
|
|
293
|
+
* level audit, never from the package manifest and never defaulted here. A
|
|
294
|
+
* missing audit anchor stays absent; a partial one keeps null axes. `source`
|
|
295
|
+
* and `suspect` are the checker's runtimeSource three-state semantics.
|
|
296
|
+
*/
|
|
297
|
+
function inferAnchor(audit) {
|
|
298
|
+
const raw = audit?.checker?.anchor
|
|
299
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null
|
|
300
|
+
const dsh = firstString(raw.dsh)
|
|
301
|
+
const cordis = firstString(raw.cordis)
|
|
302
|
+
const commit = firstString(raw.commit)
|
|
303
|
+
const source = firstString(raw.runtimeSource)
|
|
304
|
+
const suspect = typeof raw.suspect === 'boolean' ? raw.suspect : null
|
|
305
|
+
if (dsh === null && cordis === null && commit === null) return null
|
|
306
|
+
return { dsh, cordis, commit, source, suspect }
|
|
307
|
+
}
|
|
308
|
+
|
|
276
309
|
function extractChecks(report, name, version) {
|
|
277
310
|
if (!report || !Array.isArray(report.checks)) return []
|
|
278
311
|
if (report.subject && typeof report.subject === 'object') {
|
|
@@ -495,6 +528,7 @@ function entryFromAudit(audit, options, levelFile) {
|
|
|
495
528
|
const command = firstString(options.checkedCommand) ?? (levels.entry.claim === 'runtime'
|
|
496
529
|
? 'dsh-levels <package-dir> --format json'
|
|
497
530
|
: 'dsh-levels <package-dir> --no-runtime --format json')
|
|
531
|
+
const anchor = inferAnchor(audit)
|
|
498
532
|
|
|
499
533
|
return {
|
|
500
534
|
key: `${name}@${version}`,
|
|
@@ -503,7 +537,8 @@ function entryFromAudit(audit, options, levelFile) {
|
|
|
503
537
|
title: firstLine(meta.description),
|
|
504
538
|
repo: normalizeRepo(meta.repository),
|
|
505
539
|
license: normalizeLicense(meta.license),
|
|
506
|
-
scope: inferScope(meta
|
|
540
|
+
scope: inferScope(meta),
|
|
541
|
+
...(anchor ? { anchor } : {}),
|
|
507
542
|
levels,
|
|
508
543
|
checks,
|
|
509
544
|
...(security ? { security } : {}),
|
|
@@ -646,6 +681,33 @@ function validateSidecar(sidecar) {
|
|
|
646
681
|
}
|
|
647
682
|
}
|
|
648
683
|
}
|
|
684
|
+
// Optional and additive: entries produced before the scope/anchor split have
|
|
685
|
+
// no anchor. When present it records the check anchor, never a requirement.
|
|
686
|
+
if (entry.anchor !== undefined) {
|
|
687
|
+
if (!entry.anchor || typeof entry.anchor !== 'object' || Array.isArray(entry.anchor)) {
|
|
688
|
+
throw new Error(`${key}: anchor must be an object`)
|
|
689
|
+
}
|
|
690
|
+
for (const field of Object.keys(entry.anchor)) {
|
|
691
|
+
if (!ANCHOR_KEYS.has(field)) throw new Error(`${key}: anchor.${field} is not part of the sidecar contract`)
|
|
692
|
+
}
|
|
693
|
+
for (const field of ['dsh', 'cordis', 'commit']) {
|
|
694
|
+
const value = entry.anchor[field]
|
|
695
|
+
if (value !== null && value !== undefined && (typeof value !== 'string' || value === '')) {
|
|
696
|
+
throw new Error(`${key}: anchor.${field} must be a non-empty string or null`)
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
if (entry.anchor.commit !== undefined && entry.anchor.commit !== null && !HEX40.test(String(entry.anchor.commit))) {
|
|
700
|
+
throw new Error(`${key}: anchor.commit must be 40 hex chars or null`)
|
|
701
|
+
}
|
|
702
|
+
if (entry.anchor.source !== undefined && entry.anchor.source !== null && !ANCHOR_SOURCES.has(entry.anchor.source)) {
|
|
703
|
+
throw new Error(`${key}: anchor.source must be cli, host, default or null`)
|
|
704
|
+
}
|
|
705
|
+
if (entry.anchor.suspect !== undefined && entry.anchor.suspect !== null && typeof entry.anchor.suspect !== 'boolean') {
|
|
706
|
+
throw new Error(`${key}: anchor.suspect must be boolean or null`)
|
|
707
|
+
}
|
|
708
|
+
const recorded = ['dsh', 'cordis', 'commit'].filter(field => entry.anchor[field] !== null && entry.anchor[field] !== undefined)
|
|
709
|
+
if (recorded.length === 0) throw new Error(`${key}: anchor must record at least one of dsh/cordis/commit`)
|
|
710
|
+
}
|
|
649
711
|
if (entry.checks !== undefined) {
|
|
650
712
|
if (!Array.isArray(entry.checks)) throw new Error(`${key}: checks must be an array`)
|
|
651
713
|
const seen = new Set()
|
|
@@ -9,6 +9,8 @@ import fs from 'node:fs'
|
|
|
9
9
|
import path from 'node:path'
|
|
10
10
|
import { spawnSync } from 'node:child_process'
|
|
11
11
|
import { fileURLToPath } from 'node:url'
|
|
12
|
+
import { DEFAULT_RUNTIME_VERSION } from '../src/manifest.mjs'
|
|
13
|
+
import { DEFAULT_CORDIS } from '../src/cli.mjs'
|
|
12
14
|
|
|
13
15
|
const HERE = path.dirname(fileURLToPath(import.meta.url))
|
|
14
16
|
const ROOT = path.resolve(HERE, '..', '..')
|
|
@@ -31,7 +33,9 @@ function main() {
|
|
|
31
33
|
}
|
|
32
34
|
const result = {
|
|
33
35
|
runner: `dsh-plugin-verify@0.1.0 (${process.platform}/${process.arch}, node ${process.version})`,
|
|
34
|
-
|
|
36
|
+
// The known answers are only comparable between runs that share this
|
|
37
|
+
// anchor; rc.3 / cordis 4.1.0 is the current released baseline.
|
|
38
|
+
anchor: { dsh: DEFAULT_RUNTIME_VERSION, cordis: DEFAULT_CORDIS },
|
|
35
39
|
results: {
|
|
36
40
|
good: { status: run(path.join(ROOT, '40-checker/fixtures/good')), artifact: 'fixtures/good' },
|
|
37
41
|
'bad-manifest': { status: run(path.join(ROOT, '40-checker/fixtures/bad-manifest')), artifact: 'fixtures/bad-manifest' },
|