dsh-standards 1.6.11 → 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.
@@ -665,11 +665,11 @@ export function apply(ctx: Context) {
665
665
 
666
666
  | 子项 | 检查 | 结果 |
667
667
  |---|---|---|
668
- | C-11.1 | `dsh.capabilities` 是字符串数组,每个 ID 在 §8.1 闭集内 | 非法 ID → FAIL;字段缺失 → WARN |
668
+ | C-11.1 | `dsh.capabilities` 是字符串数组,每个 ID 在 §8.1 判定闭集或保留表内 | 非法 ID → FAIL;保留 ID → 接受(不 FAIL),C-11.5 记 NA;字段缺失 → WARN |
669
669
  | C-11.2 | **字段存在时**,高信号触发必须申报(映射见下表) | 字段存在且漏报 → FAIL;字段缺失 → 不评估,C-11 整体 WARN(过渡期) |
670
670
  | C-11.3 | bundle patch 不得启用 `@deepseek-ai/dsh-plugin-manager/tools` | 启用 → FAIL |
671
671
  | C-11.4 | 源码/配置中 `danger-full-access` 的 AST 字符串字面量;注释、等值比较、文档字符串不算(见下) | 真实授权/命令上下文或未知上下文 → WARN |
672
- | C-11.5 | 声明了但静态未观测到对应触发 | WARN(**不等于未使用/过度声明**:`node:fs` 的读/写调用已作为观测证据;动态调用仍不在触发面内)。**NA(not-run)**:无源码、该能力无静态观测面(`credentials:provider`)、或**扫描截断**(`coverage=partial`,reason 记 `source scan truncated …`)——截断是覆盖缺口,不是过度声明 |
672
+ | C-11.5 | 声明了但静态未观测到对应触发 | WARN(**不等于未使用/过度声明**:`node:fs` 的读/写调用已作为观测证据;动态调用仍不在触发面内)。**NA(not-run)**:无源码、该能力无静态观测面(`credentials:provider`)、**保留 ID**(本版不判定)、或**扫描截断**(`coverage=partial`,reason 记 `source scan truncated …`)——截断是覆盖缺口,不是过度声明 |
673
673
 
674
674
  **C-11.2 触发映射**:
675
675
 
@@ -1353,7 +1353,7 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
1353
1353
  | 53 | `REPO/AGENTS.md:133,136,140` | 注册即 effect/waterfall/缝三层 | 已核验 |
1354
1354
  | 54 | `REPO/docs/capability-seams.md:733,741,743,748` | shell/fs/subagents/jobs 缝 | 已核验 |
1355
1355
  | 55 | `REPO/packages/core/agent-loop/README.md:164` | KV cache 前缀 | 已核验 |
1356
- | 56 | `REPO/docs/tool-catalog.md:9` | schema 不可静态知 | 已核验 |
1356
+ | 56 | `REPO/docs/tool-catalog.md:8` | schema 不可静态知 | 已核验 |
1357
1357
  | 57 | `REPO/packages/boot/app-boot/src/config-schema/projector.ts:124-134` | volatile containment | 已核验 |
1358
1358
  | 58 | `REPO/packages/core/agent-loop/src/index.ts:292,296` | inject/volatile 模范 | 已核验 |
1359
1359
  | 59 | `10-输入/生态调研报告.md:36-59,91,171,264` | 生态实例/数字 | 输入(未重抓) |
@@ -1363,7 +1363,7 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
1363
1363
 
1364
1364
  ## 八、附录 B · 字段与词汇
1365
1365
 
1366
- ### 8.1 `dsh.capabilities` 最小闭集(15 项)
1366
+ ### 8.1 `dsh.capabilities` 最小闭集(15 项判定 + 16 项保留)
1367
1367
 
1368
1368
  | ID | 触发信号(静态可判) | 说明 |
1369
1369
  |---|---|---|
@@ -1383,7 +1383,26 @@ E 路的 MVP 13 项(L0-1/2/3 + L1-1/3/4/5 + L2-1/2/4 + L3-1/3/5)只覆盖 C-
1383
1383
  | `remote:expose` | `@Remote`/`@RemoteScope` | 对外 Remote 方法 |
1384
1384
  | `plugin:install` | `ctx.pluginManager.installBundle/removeBundle` | 自安装/卸载插件 |
1385
1385
 
1386
- 保留(T4 可扩展,本版不参与判定):`mcp:client`、`browser`、`webhook:rule`、`theme:ui`、`client:ui`。
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 面 | 保留(原有) |
1387
1406
 
1388
1407
  ### 8.2 `dsh.labels` 最小闭集(5 项)
1389
1408
 
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * land-runtime-artifacts.mjs — turn uploaded GitHub Actions artifacts from the
4
+ * rc3 runtime runs into committed evidence, without rewriting history.
5
+ *
6
+ * The 2026-11-14 rc3 runs uploaded their per-row artifacts to GitHub Actions
7
+ * (`entry18-runtime` run and `web-runtime` run). Artifacts expire; the repo's
8
+ * committed evidence is the durable copy. This script downloads the artifacts
9
+ * and writes them into a NEW asOf directory (e.g.
10
+ * `40-checker/results/entry/18/fullbase-rc3-20261114/`), never into the
11
+ * historical `fullbase/` / `webruntime/` directories.
12
+ *
13
+ * It only lands raw evidence; the REPORT.md / RUNTIME.md / SUPPORTED.md prose
14
+ * stays a human edit (the numbers must match the landed files).
15
+ *
16
+ * Credentials: imports DSH_KEY (default the deepseek-community-hub _key.mjs),
17
+ * whose side effect sets GH_TOKEN. Tokens are never printed.
18
+ *
19
+ * Usage:
20
+ * node 40-checker/scripts/land-runtime-artifacts.mjs \
21
+ * --kind entry18 --run 43560480242 --out 40-checker/results/entry/18/fullbase-rc3-20261114
22
+ * node 40-checker/scripts/land-runtime-artifacts.mjs \
23
+ * --kind web-runtime --run 43560484422 --out 40-checker/results/webruntime-rc3-20261114
24
+ *
25
+ * Options: --repo (default PerryLink/dsh-standards), --dry-run, --keep (comma list
26
+ * of extra artifact files to keep for web rows).
27
+ */
28
+ import fs from 'node:fs'
29
+ import path from 'node:path'
30
+ import zlib from 'node:zlib'
31
+
32
+ const KEY = process.env.DSH_KEY || '/mnt/d/Projects/dsh/deepseek-community-hub/00-live/_key.mjs'
33
+ if (fs.existsSync(KEY)) await import(KEY)
34
+
35
+ const API = 'https://api.github.com'
36
+ const WEB_ROW_FILES = ['client-export.json', 'installed-package.json', 'probe.json', 'shot.png', 'summary.md']
37
+
38
+ function usage(message) {
39
+ if (message) console.error(`error: ${message}`)
40
+ console.error('usage: land-runtime-artifacts.mjs --kind entry18|web-runtime --run <id> --out <dir> [--repo owner/name] [--dry-run]')
41
+ process.exit(2)
42
+ }
43
+
44
+ function parseArgs(argv) {
45
+ const options = { repo: 'PerryLink/dsh-standards', kind: '', run: '', out: '', dryRun: false }
46
+ for (let index = 0; index < argv.length; index += 1) {
47
+ const arg = argv[index]
48
+ if (arg === '--kind') options.kind = argv[++index]
49
+ else if (arg === '--run') options.run = argv[++index]
50
+ else if (arg === '--out') options.out = argv[++index]
51
+ else if (arg === '--repo') options.repo = argv[++index]
52
+ else if (arg === '--dry-run') options.dryRun = true
53
+ else if (arg === '--help' || arg === '-h') usage()
54
+ else usage(`unknown argument: ${arg}`)
55
+ }
56
+ if (!['entry18', 'web-runtime'].includes(options.kind)) usage('--kind must be entry18 or web-runtime')
57
+ if (!/^\d+$/.test(options.run)) usage('--run must be a workflow run id')
58
+ if (!options.out) usage('--out is required')
59
+ if (!process.env.GH_TOKEN) usage('GH_TOKEN is not set (check DSH_KEY)')
60
+ return options
61
+ }
62
+
63
+ async function github(pathname) {
64
+ const response = await fetch(API + pathname, {
65
+ headers: {
66
+ Authorization: `Bearer ${process.env.GH_TOKEN}`,
67
+ Accept: 'application/vnd.github+json',
68
+ 'User-Agent': 'dsh-standards-land-artifacts',
69
+ },
70
+ })
71
+ if (!response.ok) throw new Error(`GitHub ${pathname} → ${response.status}: ${(await response.text()).slice(0, 200)}`)
72
+ return response
73
+ }
74
+
75
+ /** Minimal ZIP reader (deflate/store) — enough for Actions artifact zips. */
76
+ export function unzip(buffer) {
77
+ const eocdSignature = 0x06054b50
78
+ let eocd = -1
79
+ for (let index = buffer.length - 22; index >= Math.max(0, buffer.length - 66000); index -= 1) {
80
+ if (buffer.readUInt32LE(index) === eocdSignature) { eocd = index; break }
81
+ }
82
+ if (eocd < 0) throw new Error('not a zip: EOCD not found')
83
+ const count = buffer.readUInt16LE(eocd + 10)
84
+ let offset = buffer.readUInt32LE(eocd + 16)
85
+ const files = new Map()
86
+ for (let entry = 0; entry < count; entry += 1) {
87
+ if (buffer.readUInt32LE(offset) !== 0x02014b50) throw new Error('bad central directory header')
88
+ const method = buffer.readUInt16LE(offset + 10)
89
+ const compressedSize = buffer.readUInt32LE(offset + 20)
90
+ const nameLength = buffer.readUInt16LE(offset + 28)
91
+ const extraLength = buffer.readUInt16LE(offset + 30)
92
+ const commentLength = buffer.readUInt16LE(offset + 32)
93
+ const localOffset = buffer.readUInt32LE(offset + 42)
94
+ const name = buffer.subarray(offset + 46, offset + 46 + nameLength).toString('utf8')
95
+ if (buffer.readUInt32LE(localOffset) !== 0x04034b50) throw new Error('bad local file header')
96
+ const localNameLength = buffer.readUInt16LE(localOffset + 26)
97
+ const localExtraLength = buffer.readUInt16LE(localOffset + 28)
98
+ const dataStart = localOffset + 30 + localNameLength + localExtraLength
99
+ const compressed = buffer.subarray(dataStart, dataStart + compressedSize)
100
+ const data = method === 0 ? Buffer.from(compressed) : zlib.inflateRawSync(compressed)
101
+ files.set(name, data)
102
+ offset += 46 + nameLength + extraLength + commentLength
103
+ }
104
+ return files
105
+ }
106
+
107
+ function rowIdFromArtifact(name, kind) {
108
+ if (kind === 'entry18') {
109
+ const prefix = 'entry18-fullbase-'
110
+ if (!name.startsWith(prefix) || name === 'entry18-fullbase-summary') return null
111
+ return name.slice(prefix.length)
112
+ }
113
+ const prefix = 'web-runtime-'
114
+ if (!name.startsWith(prefix)) return null
115
+ return name.slice(prefix.length)
116
+ }
117
+
118
+ export async function land({ repo, kind, run, out, dryRun = false }) {
119
+ const root = path.resolve(out)
120
+ const artifacts = []
121
+ for (let page = 1; ; page += 1) {
122
+ const response = await github(`/repos/${repo}/actions/runs/${run}/artifacts?per_page=100&page=${page}`)
123
+ const payload = await response.json()
124
+ artifacts.push(...(payload.artifacts || []))
125
+ if (!payload.artifacts || payload.artifacts.length < 100) break
126
+ }
127
+ const landed = []
128
+ const skipped = []
129
+ for (const artifact of artifacts.sort((a, b) => a.name.localeCompare(b.name))) {
130
+ const id = rowIdFromArtifact(artifact.name, kind)
131
+ if (id === null) { skipped.push(artifact.name); continue }
132
+ const response = await github(`/repos/${repo}/actions/artifacts/${artifact.id}/zip`)
133
+ const files = unzip(Buffer.from(await response.arrayBuffer()))
134
+ if (kind === 'entry18') {
135
+ const jsonName = `${id}.json`
136
+ const row = files.get(jsonName)
137
+ if (!row) throw new Error(`${artifact.name}: missing ${jsonName}`)
138
+ const target = path.join(root, jsonName)
139
+ if (!dryRun) { fs.mkdirSync(root, { recursive: true }); fs.writeFileSync(target, row) }
140
+ landed.push({ artifact: artifact.name, file: path.relative(process.cwd(), target), bytes: row.length })
141
+ } else {
142
+ const targetDir = path.join(root, id)
143
+ if (!dryRun) fs.mkdirSync(targetDir, { recursive: true })
144
+ const kept = []
145
+ for (const name of WEB_ROW_FILES) {
146
+ const data = files.get(name)
147
+ if (!data) continue
148
+ if (!dryRun) fs.writeFileSync(path.join(targetDir, name), data)
149
+ kept.push(name)
150
+ }
151
+ // Rows that are not client-bearing (shell-only / gate-rejected) carry only
152
+ // probe.json + summary.md in the historical layout; keep the subset.
153
+ const required = ['probe.json', 'summary.md']
154
+ const missing = required.filter(name => !kept.includes(name))
155
+ if (missing.length > 0) throw new Error(`${artifact.name}: missing required files (${missing.join(',')})`)
156
+ landed.push({ artifact: artifact.name, dir: path.relative(process.cwd(), targetDir), files: kept })
157
+ }
158
+ }
159
+ // entry18 also carries the aggregate summary artifact.
160
+ if (kind === 'entry18') {
161
+ const summaryArtifact = artifacts.find(artifact => artifact.name === 'entry18-fullbase-summary')
162
+ if (!summaryArtifact) throw new Error('summary artifact not found')
163
+ const response = await github(`/repos/${repo}/actions/artifacts/${summaryArtifact.id}/zip`)
164
+ const files = unzip(Buffer.from(await response.arrayBuffer()))
165
+ const summary = files.get('summary.json')
166
+ if (!summary) throw new Error('summary.json not found inside the summary artifact')
167
+ const target = path.join(root, 'summary.json')
168
+ if (!dryRun) { fs.mkdirSync(root, { recursive: true }); fs.writeFileSync(target, summary) }
169
+ landed.push({ artifact: summaryArtifact.name, file: path.relative(process.cwd(), target), bytes: summary.length })
170
+ }
171
+ return { repo, run, kind, out: root, landed, skipped }
172
+ }
173
+
174
+ function main() {
175
+ const options = parseArgs(process.argv.slice(2))
176
+ land({ repo: options.repo, kind: options.kind, run: options.run, out: options.out, dryRun: options.dryRun })
177
+ .then(result => {
178
+ console.log(JSON.stringify(result, null, 2))
179
+ if (options.dryRun) console.log('\n(dry run: nothing written)')
180
+ })
181
+ .catch(error => { console.error(error.stack || error.message); process.exit(1) })
182
+ }
183
+
184
+ if (process.argv[1] && path.resolve(process.argv[1]) === new URL(import.meta.url).pathname) main()
@@ -0,0 +1,206 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * repo-anchor-check.mjs — verify `REPO/<path>:<line(s)>` evidence anchors in the
4
+ * standard documents against a real host checkout at a pinned commit.
5
+ *
6
+ * The standard cites upstream source by `REPO/packages/.../file.ts:123` (or a
7
+ * line list such as `:32-41`, `:109,150`). When the host moves those lines can
8
+ * drift even though the file still exists, so a prose anchor is only as good as
9
+ * the commit it was re-taken at. This script is the mechanical half of P1-8
10
+ * (2026-11-14 rc3 audit): it proves every anchor still resolves at the pinned
11
+ * commit and reports the ones that no longer point at a real line.
12
+ *
13
+ * What it proves:
14
+ * - the referenced file exists at the pinned commit;
15
+ * - every referenced line number is within the file;
16
+ * - the referenced line is not blank (a blank line is almost never intended).
17
+ *
18
+ * What it does NOT prove: that the line still contains the *same* symbol named
19
+ * around the anchor. That is a semantic re-take; the script prints the current
20
+ * line text so a reviewer can eyeball it (and `--context` gives N lines).
21
+ *
22
+ * Exit codes: 0 all anchors resolve; 1 at least one drift; 2 usage/host error.
23
+ *
24
+ * Usage:
25
+ * DSH_HOST=/path/to/deepseek-harness node 40-checker/scripts/repo-anchor-check.mjs
26
+ * node 40-checker/scripts/repo-anchor-check.mjs --host /path --commit 38a6a5c9 --json
27
+ * node 40-checker/scripts/repo-anchor-check.mjs --files 31-DS-C条款.md,60-权限与标注规范.md
28
+ */
29
+ import { execFileSync } from 'node:child_process'
30
+ import fs from 'node:fs'
31
+ import path from 'node:path'
32
+ import { fileURLToPath } from 'node:url'
33
+
34
+ const HERE = path.dirname(fileURLToPath(import.meta.url))
35
+ const ROOT = path.resolve(HERE, '..', '..')
36
+ const DEFAULT_COMMIT = '38a6a5c965aa99ab525161efb7cc5cf1fe62fced'
37
+ const DEFAULT_FILES = [
38
+ '31-DS-C条款.md',
39
+ '32-DS-R条款.md',
40
+ '33-DS-G条款.md',
41
+ '35-三层开发建议与验收清单.md',
42
+ '60-权限与标注规范.md',
43
+ '93-开发建议-入门.md',
44
+ ]
45
+ // REPO/path/to/file.ext:1 | :10-12 | :10,12 | :10-12,20
46
+ const REF = /REPO\/([A-Za-z0-9_.][A-Za-z0-9_./-]*):([0-9][0-9,\-]*)/g
47
+
48
+ function parseArgs(argv) {
49
+ const options = {
50
+ host: process.env.DSH_HOST || '',
51
+ commit: process.env.DSH_COMMIT || DEFAULT_COMMIT,
52
+ files: DEFAULT_FILES,
53
+ json: false,
54
+ context: 0,
55
+ }
56
+ for (let index = 0; index < argv.length; index += 1) {
57
+ const arg = argv[index]
58
+ if (arg === '--host') options.host = argv[++index]
59
+ else if (arg.startsWith('--host=')) options.host = arg.slice('--host='.length)
60
+ else if (arg === '--commit') options.commit = argv[++index]
61
+ else if (arg.startsWith('--commit=')) options.commit = arg.slice('--commit='.length)
62
+ else if (arg === '--files') options.files = argv[++index].split(',').map(item => item.trim()).filter(Boolean)
63
+ else if (arg === '--json') options.json = true
64
+ else if (arg === '--context') options.context = Number(argv[++index])
65
+ else if (arg === '--help' || arg === '-h') {
66
+ console.log('usage: repo-anchor-check.mjs --host <dsh-checkout> [--commit <sha>] [--files a.md,b.md] [--json] [--context N]')
67
+ process.exit(0)
68
+ } else {
69
+ console.error(`unknown argument: ${arg}`)
70
+ process.exit(2)
71
+ }
72
+ }
73
+ if (!options.host) {
74
+ console.error('error: --host <dsh-checkout> or DSH_HOST is required (the host checkout is read-only)')
75
+ process.exit(2)
76
+ }
77
+ if (!/^[0-9a-f]{7,40}$/i.test(options.commit)) {
78
+ console.error(`error: bad commit: ${options.commit}`)
79
+ process.exit(2)
80
+ }
81
+ return options
82
+ }
83
+
84
+ function gitShow(host, commit, relative) {
85
+ try {
86
+ return execFileSync('git', ['-C', host, 'show', `${commit}:${relative}`], {
87
+ encoding: 'utf8',
88
+ maxBuffer: 64 * 1024 * 1024,
89
+ stdio: ['ignore', 'pipe', 'pipe'],
90
+ })
91
+ } catch (error) {
92
+ return null
93
+ }
94
+ }
95
+
96
+ function lineNumbers(spec) {
97
+ const numbers = []
98
+ for (const part of spec.split(',')) {
99
+ if (!part) continue
100
+ const range = part.match(/^(\d+)-(\d+)$/)
101
+ if (range) {
102
+ const start = Number(range[1])
103
+ const end = Number(range[2])
104
+ for (let line = start; line <= end; line += 1) numbers.push(line)
105
+ } else {
106
+ numbers.push(Number(part))
107
+ }
108
+ }
109
+ return numbers
110
+ }
111
+
112
+ export function scanAnchors({ host, commit, files, root = ROOT }) {
113
+ const cache = new Map()
114
+ const docs = []
115
+ for (const file of files) {
116
+ const absolute = path.isAbsolute(file) ? file : path.join(root, file)
117
+ if (!fs.existsSync(absolute)) {
118
+ docs.push({ file, missing: true, anchors: 0, drifts: [] })
119
+ continue
120
+ }
121
+ const text = fs.readFileSync(absolute, 'utf8')
122
+ const anchors = []
123
+ for (const match of text.matchAll(REF)) {
124
+ const relative = match[1]
125
+ const spec = match[2]
126
+ const line = text.slice(0, match.index).split('\n').length
127
+ const numbers = lineNumbers(spec)
128
+ let content = cache.get(relative)
129
+ if (content === undefined) {
130
+ content = gitShow(host, commit, relative)
131
+ cache.set(relative, content)
132
+ }
133
+ const entry = {
134
+ doc: file,
135
+ docLine: line,
136
+ target: relative,
137
+ spec,
138
+ numbers,
139
+ sourceLine: text.split('\n')[line - 1].trim(),
140
+ }
141
+ if (content === null) {
142
+ entry.reason = 'file not found at the pinned commit'
143
+ } else {
144
+ const lines = content.split('\n')
145
+ entry.lineCount = lines.length
146
+ const outOfRange = numbers.filter(number => number < 1 || number > lines.length)
147
+ const blank = numbers.filter(number => {
148
+ const value = lines[number - 1]
149
+ return number >= 1 && number <= lines.length && value !== undefined && value.trim() === ''
150
+ })
151
+ // A range anchor legitimately spans blank lines; only a single-line
152
+ // anchor pointing at a blank line is suspicious (likely an off-by-one).
153
+ if (outOfRange.length > 0) entry.reason = `line(s) out of range (file has ${lines.length} lines): ${outOfRange.join(',')}`
154
+ else if (numbers.length === 1 && blank.length > 0) entry.warning = `single-line anchor points at a blank line: ${blank.join(',')}`
155
+ else {
156
+ entry.current = numbers.map(number => ({ line: number, text: lines[number - 1].trim() }))
157
+ }
158
+ }
159
+ anchors.push(entry)
160
+ }
161
+ docs.push({
162
+ file,
163
+ anchors: anchors.length,
164
+ drifts: anchors.filter(anchor => anchor.reason),
165
+ warnings: anchors.filter(anchor => !anchor.reason && anchor.warning),
166
+ entries: anchors,
167
+ })
168
+ }
169
+ const total = docs.reduce((sum, doc) => sum + doc.anchors, 0)
170
+ const drifts = docs.reduce((sum, doc) => sum + doc.drifts.length, 0)
171
+ const warnings = docs.reduce((sum, doc) => sum + (doc.warnings || []).length, 0)
172
+ return { commit, host, docs, total, drifts, warnings }
173
+ }
174
+
175
+ function main() {
176
+ const options = parseArgs(process.argv.slice(2))
177
+ try {
178
+ execFileSync('git', ['-C', options.host, 'rev-parse', '--git-dir'], { stdio: 'ignore' })
179
+ } catch {
180
+ console.error(`error: ${options.host} is not a git checkout`)
181
+ process.exit(2)
182
+ }
183
+ const report = scanAnchors(options)
184
+ if (options.json) {
185
+ console.log(JSON.stringify(report, null, 2))
186
+ } else {
187
+ console.log(`REPO anchors at ${report.commit.slice(0, 12)} (host: ${report.host})`)
188
+ for (const doc of report.docs) {
189
+ if (doc.missing) {
190
+ console.log(` MISSING DOC ${doc.file}`)
191
+ continue
192
+ }
193
+ console.log(` ${doc.drifts.length > 0 ? '!!' : 'OK'} ${doc.file}: ${doc.anchors} anchors, ${doc.drifts.length} drift, ${(doc.warnings || []).length} warning`)
194
+ for (const drift of doc.drifts) {
195
+ console.log(` - line ${drift.docLine}: ${drift.target}:${drift.spec} → ${drift.reason}`)
196
+ }
197
+ for (const warning of doc.warnings || []) {
198
+ console.log(` ~ line ${warning.docLine}: ${warning.target}:${warning.spec} → ${warning.warning}`)
199
+ }
200
+ }
201
+ console.log(`total: ${report.total} anchors, ${report.drifts} drift, ${report.warnings} warning`)
202
+ }
203
+ process.exit(report.drifts > 0 ? 1 : 0)
204
+ }
205
+
206
+ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) main()
@@ -13,6 +13,27 @@ export const CAPABILITIES = new Set([
13
13
  'sessions:read', 'system-prompt:write', 'tools:register', 'remote:expose', 'plugin:install',
14
14
  ])
15
15
 
16
+ // Reserved capability IDs (2026-11-14, P1-6): names the current standard version
17
+ // accepts but does not judge. They cover DSH 0.2.2-rc.3 host seams whose static
18
+ // observation surface / FAIL policy is not settled yet. C-11.1 accepts them
19
+ // (declaring one is never an "unknown capability id" FAIL), C-11.2 never maps a
20
+ // trigger to them (the FAIL surface stays exactly the judged set above), and
21
+ // C-11.5 reports not-run instead of an over-declaration WARN.
22
+ //
23
+ // Contract: removing an id is a breaking standard change; promoting one into
24
+ // CAPABILITIES requires a C-11.2 trigger, an observation surface (or a
25
+ // deliberate NO_OBSERVATION_SURFACE entry) and tests.
26
+ export const RESERVED_CAPABILITIES = new Set([
27
+ // pre-existing reserved vocabulary (kept for compatibility).
28
+ 'mcp:client', 'browser', 'webhook:rule', 'theme:ui', 'client:ui',
29
+ // rc3 seams that had no declarable id before this version.
30
+ 'computer:control', 'browser:control', 'mcp:manage', 'mcp:resources',
31
+ 'ssh:connect', 'terminal:control', 'sandbox:override', 'approval:override',
32
+ 'authorization:delegate', 'remote-access:use', 'session-log:egress',
33
+ ])
34
+
35
+ export const KNOWN_CAPABILITIES = new Set([...CAPABILITIES, ...RESERVED_CAPABILITIES])
36
+
16
37
  export const LABELS = new Set([
17
38
  'prompt-modification', 'red-team', 'third-party-model-provider', 'remote-access', 'mirror',
18
39
  ])
@@ -655,7 +676,8 @@ export function checkCapabilities(manifest, sources, patch, scan = null) {
655
676
  details.push(detail('C-11.1', 'WARN', 'dsh.capabilities is not declared (transitional WARN; host does not read it yet)', ['package.json#dsh.capabilities']))
656
677
  } else if (!caps.error) {
657
678
  for (const id of caps.list) {
658
- if (!CAPABILITIES.has(id)) details.push(detail('C-11.1', 'FAIL', `unknown capability id: ${id}`, ['package.json#dsh.capabilities']))
679
+ // Reserved ids are accepted but not judged (see RESERVED_CAPABILITIES).
680
+ if (!KNOWN_CAPABILITIES.has(id)) details.push(detail('C-11.1', 'FAIL', `unknown capability id: ${id}`, ['package.json#dsh.capabilities']))
659
681
  }
660
682
  }
661
683
 
@@ -686,6 +708,10 @@ export function checkCapabilities(manifest, sources, patch, scan = null) {
686
708
  : 'not-run: no source files were scanned, so no capability can be observed', []))
687
709
  } else {
688
710
  for (const cap of caps.list) {
711
+ if (RESERVED_CAPABILITIES.has(cap)) {
712
+ details.push(detail('C-11.5', 'NA', `not-run: reserved capability ${cap} is accepted but not judged in this standard version (no static observation surface / policy defined)`, []))
713
+ continue
714
+ }
689
715
  if (NO_OBSERVATION_SURFACE.has(cap)) {
690
716
  details.push(detail('C-11.5', 'NA', `not-run: no static observation surface for ${cap} in this checker version`, []))
691
717
  continue
package/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## 1.6.12 — 2026-11-14
2
+
3
+ ### Added
4
+
5
+ - **Reserved capability IDs (P1-6, 2026-11-14 rc3 audit).** `31-DS-C条款.md` §8.1 and `60-权限与标注规范.md` §2.2 now carry a reserved-id table for DSH `0.2.2-rc.3` host seams the standard does not judge yet: `computer:control`, `browser:control`, `mcp:manage`, `mcp:resources`, `ssh:connect`, `terminal:control`, `sandbox:override`, `approval:override`, `authorization:delegate`, `remote-access:use`, `session-log:egress`, alongside the pre-existing `mcp:client`, `browser`, `webhook:rule`, `theme:ui`, `client:ui`. The checker accepts reserved ids in C-11.1 (declaring one is never an "unknown capability id" FAIL) and reports C-11.5 as `NA` (not-run) for them; the C-11.2 FAIL surface is **unchanged** — a reserved id never satisfies a judged trigger (e.g. declaring `computer:control` does not cover a `ctx.shell` trigger). `spec/dsc-clauses.json` C-11.1 wording follows.
6
+ - **`40-checker/scripts/repo-anchor-check.mjs`** — mechanical re-take of every `REPO/<path>:<line>` evidence anchor against a read-only host checkout at a pinned commit: it proves the file exists, every referenced line is in range, and (for single-line anchors) points at a non-blank line, and prints the current line so the semantic match can be reviewed. 2026-11-14 run at `38a6a5c9`: **368 anchors across 31/32/33/35/60/93 → 0 drift, 0 warnings** after fixing three `docs/tool-catalog.md:9` anchors to `:8` (they pointed at a blank line). Evidence summary: `docs/repo-anchors-rc3-2026-11-14.md`.
7
+ - **rc3 runtime evidence landed (P0-4).** `40-checker/results/entry/18/fullbase-rc3-20261114/` (18 raw `dsh-entry18-fullbase/1` rows + `summary.json` + `REPORT.md`) and `40-checker/results/webruntime-rc3-20261114/` (18 row dirs + `REPORT.md`), downloaded from runs `43560480242` / `43560484422` by `40-checker/scripts/land-runtime-artifacts.mjs`. The 2026-10-31 alpha.2 evidence directories are untouched. ENTRY: 10 verified / 7 partial / 1 error (the `YuJunZhiXue/dsh-purge` fixture is not cloneable from CI). Web: 14/15 client-bearing rows `client-module-loaded`, 4/4 web-app rows, 2 host-gate rejects, 1 install failure (same fixture), so the run-level denominator gate is red. `40-checker/results/entry/18/RUNTIME.md`, `SUPPORTED.md` (new `checker 1.6.12` column, evidence anchor A13, A12 marked historical) and the counts paragraph were updated. The rc3 cell is **`partial`**, not `runtime`: the run was produced by the 1.6.11-era tree, attribution relies on the evidence being committed at the v1.6.12 release commit, and web 15/15 coverage was not reached.
8
+
9
+ ### Changed
10
+
11
+ - `SUPPORTED.md`: counts re-derived at 2026-11-14 14:40 (398 legacy static results: `anchor.dsh=0.2.2-alpha.2` 241, no anchor 157; A12's 243/155 kept as the 05:23 snapshot, difference noted) and the matrix gained the `checker 1.6.12` column; §3 not-run conditions and §8 known limits updated to stop claiming rc.3 was never run.
12
+
13
+ ### Fixed
14
+
15
+ - `.github/workflows/publish.yml`: skip an already-published version before `npm publish` and add a `concurrency` group, so a manual publish and a tag-triggered publish cannot race into `E409 Cannot publish over previously staged version` (the 1.6.11 red run). A re-run of a red tag run is now safe.
16
+
17
+ ### Verified
18
+
19
+ - `npm test`: 322 tests, 321 pass, 1 skipped, 0 failed (Node 24).
20
+ - `node 40-checker/scripts/repo-anchor-check.mjs --host /home/yy/deepseek-harness`: 368 anchors, 0 drift, 0 warnings at `38a6a5c9`.
21
+ - `40-checker/scripts/land-runtime-artifacts.mjs` round-trips both GitHub Actions artifact zips into the committed directories; `REPORT.md` numbers match `summary.json` / each `probe.json`.
22
+ - Not verified: web denominator 15/15 — blocked by the private fixture and recorded as such instead of being papered over.
23
+
1
24
  ## 1.6.11 — 2026-11-14
2
25
 
3
26
  ### Changed
package/README.en.md CHANGED
@@ -44,7 +44,7 @@ DSH adoption depth has three levels, each with its own question and evidence voc
44
44
 
45
45
  Three things live here: `40-checker/` (the DS-C conformance checker plus every evidence script), `bin/` (two public entry points, `dsh-standards` and `dsh-levels`), and `spec/` with the canonical clause text in the numbered `31`–`35` documents. The tools only read the target package and never modify what they inspect; the verdict only accepts evidence, so `not-run`, `NA`, and `static` are never written up as PASS.
46
46
 
47
- The old npm reservation `dsh-standards@0.0.3` only held the name; this 1.x line replaces it (currently `1.6.11`), and the two bins are `dsh-standards` and `dsh-levels`.
47
+ The old npm reservation `dsh-standards@0.0.3` only held the name; this 1.x line replaces it (currently `1.6.12`), and the two bins are `dsh-standards` and `dsh-levels`.
48
48
 
49
49
  The anchor is recorded in every report, not in `spec/levels.json` (the checker resolves it at run time: CLI flag, then host probe, then the built-in default): `repo=deepseek-ai/deepseek-harness`, `commit=38a6a5c965aa`, `dsh=0.2.2-rc.3`, `cordis=4.1.0`. Pass a different runtime version explicitly and the report records which ruler you measured with.
50
50
 
package/README.es.md CHANGED
@@ -44,7 +44,7 @@ La profundidad de adopción de DSH tiene tres niveles, cada uno con su pregunta
44
44
 
45
45
  Aquí viven tres cosas: `40-checker/` (el verificador DS-C y todos los scripts de evidencia), `bin/` (dos puntos de entrada públicos, `dsh-standards` y `dsh-levels`) y `spec/` junto con el texto normativo de los documentos numerados `31`–`35`. Las herramientas solo leen el paquete objetivo y nunca modifican lo que inspeccionan; el veredicto solo acepta evidencia, así que `not-run`, `NA` y `static` jamás se escriben como PASS.
46
46
 
47
- La antigua reserva de npm `dsh-standards@0.0.3` solo ocupaba el nombre; esta línea 1.x la sustituye (hoy `1.6.11`) y los dos bins son `dsh-standards` y `dsh-levels`.
47
+ La antigua reserva de npm `dsh-standards@0.0.3` solo ocupaba el nombre; esta línea 1.x la sustituye (hoy `1.6.12`) y los dos bins son `dsh-standards` y `dsh-levels`.
48
48
 
49
49
  El ancla se registra en cada informe, no en `spec/levels.json` (el checker la resuelve en tiempo de ejecución: flag de CLI, luego sondeo del host y por último la constante incorporada): `repo=deepseek-ai/deepseek-harness`, `commit=38a6a5c965aa`, `dsh=0.2.2-rc.3`, `cordis=4.1.0`. Si pasas otra versión de runtime, el informe deja constancia de con qué regla mediste.
50
50
 
package/README.hi.md CHANGED
@@ -44,7 +44,7 @@ DSH अपनाव की गहराई के तीन स्तर है
44
44
 
45
45
  यहाँ तीन चीज़ें हैं: `40-checker/` (DS-C जाँचकर्ता और सभी साक्ष्य-स्क्रिप्ट), `bin/` (दो सार्वजनिक प्रवेश बिंदु, `dsh-standards` और `dsh-levels`), और `spec/` के साथ संख्यांकित `31`–`35` दस्तावेज़ों का मानक पाठ। उपकरण लक्ष्य पैकेज को केवल पढ़ते हैं, उसे बदलते नहीं; निर्णय केवल साक्ष्य स्वीकार करता है, इसलिए `not-run`, `NA` और `static` कभी PASS के रूप में नहीं लिखे जाते।
46
46
 
47
- npm पर पुराना आरक्षण `dsh-standards@0.0.3` केवल नाम रखता था; यह 1.x श्रृंखला उसकी जगह लेती है (अभी `1.6.11`), और दोनों bin `dsh-standards` तथा `dsh-levels` हैं।
47
+ npm पर पुराना आरक्षण `dsh-standards@0.0.3` केवल नाम रखता था; यह 1.x श्रृंखला उसकी जगह लेती है (अभी `1.6.12`), और दोनों bin `dsh-standards` तथा `dsh-levels` हैं।
48
48
 
49
49
  एंकर हर रिपोर्ट में दर्ज होता है, `spec/levels.json` में नहीं (checker इसे रनटाइम पर तय करता है: CLI फ़्लैग, फिर होस्ट जाँच, अंत में अंतर्निहित डिफ़ॉल्ट): `repo=deepseek-ai/deepseek-harness`, `commit=38a6a5c965aa`, `dsh=0.2.2-rc.3`, `cordis=4.1.0`। अलग रनटाइम संस्करण दें तो रिपोर्ट लिख देती है कि आपने किस लकीर से मापा।
50
50
 
package/README.md CHANGED
@@ -50,7 +50,7 @@ DSH 插件的采用深度分三层,每层一个问题、一套证据状态,*
50
50
 
51
51
  仓里就三样东西:`40-checker/`(DS-C 一致性检查器与全部证据脚本)、`bin/`(两个公开入口 `dsh-standards` 与 `dsh-levels`),以及 `spec/` 与 `31`–`35` 号规范正文。工具只读目标包,不改被检对象;结论只认证据,`not-run`、`NA`、`static` 都不会被写成 PASS。
52
52
 
53
- npm 上的旧占位 `dsh-standards@0.0.3` 只是名字预留,这条 1.x 线取代了它(当前 `1.6.11`);两个 bin 分别叫 `dsh-standards` 与 `dsh-levels`。
53
+ npm 上的旧占位 `dsh-standards@0.0.3` 只是名字预留,这条 1.x 线取代了它(当前 `1.6.12`);两个 bin 分别叫 `dsh-standards` 与 `dsh-levels`。
54
54
 
55
55
  锚点不是硬编码的通行证:`repo` / `commit` / `cordis` 记在报告里,`dsh` 由 `--host-version`、`DSH_HOST_VERSION` 或显式 `--allow-host-probe` 解析;都没有时报告写「host 版本未知」,并标 `source=default, suspect=true`。换一次版本就是另一把尺子,旧报告不能直接当新版本的证据。
56
56
 
@@ -386,3 +386,8 @@ docs/ DEVELOPER-JOURNEY 等长期文档与 README 配图
386
386
  - **贡献**:DCO 1.1 + DCT v1,不要求版权转让。
387
387
 
388
388
  <p align="center"><sub>CC BY 4.0(文本)· Apache-2.0(代码)· 社区项目,与 DeepSeek 无关。</sub></p>
389
+
390
+
391
+ ## 相关:HCB 兼容矩阵
392
+
393
+ [HCB(Host Compatibility Baseline)](https://github.com/PerryLink/dsh-compat-baseline) 把插件的 `engines.dsh` 声明映射到最近 10 个 DSH host 版本,输出 `declared-compatible / declared-incompatible / unknown` 矩阵。它与 dsh-standards 的静态检查互补:HCB 回答「声明支持哪些版本」,dsh-standards 回答「代码是否满足规范」。
package/README.pt.md CHANGED
@@ -44,7 +44,7 @@ A profundidade de adoção do DSH tem três níveis, cada um com sua pergunta e
44
44
 
45
45
  Três coisas vivem aqui: `40-checker/` (o verificador DS-C e todos os scripts de evidência), `bin/` (dois pontos de entrada públicos, `dsh-standards` e `dsh-levels`) e `spec/` com o texto normativo nos documentos numerados `31`–`35`. As ferramentas apenas leem o pacote alvo e nunca modificam o que inspecionam; o veredito só aceita evidência, então `not-run`, `NA` e `static` jamais são escritos como PASS.
46
46
 
47
- A antiga reserva de npm `dsh-standards@0.0.3` apenas ocupava o nome; esta linha 1.x a substitui (hoje `1.6.11`) e os dois bins são `dsh-standards` e `dsh-levels`.
47
+ A antiga reserva de npm `dsh-standards@0.0.3` apenas ocupava o nome; esta linha 1.x a substitui (hoje `1.6.12`) e os dois bins são `dsh-standards` e `dsh-levels`.
48
48
 
49
49
  A âncora é registrada em cada relatório, não em `spec/levels.json` (o checker a resolve em tempo de execução: flag de CLI, depois sondagem do host e, por fim, a constante embutida): `repo=deepseek-ai/deepseek-harness`, `commit=38a6a5c965aa`, `dsh=0.2.2-rc.3`, `cordis=4.1.0`. Se você passar outra versão de runtime, o relatório registra com qual régua mediu.
50
50
 
@@ -0,0 +1,58 @@
1
+ # REPO evidence anchors at DSH 0.2.2-rc.3
2
+
3
+ > **asOf 2026-11-14 14:55 +08 (Asia/Shanghai).** This is the evidence summary for
4
+ > the P1-8 item of the 2026-11-14 rc3 audit: the `REPO/<path>:<line>` anchors in
5
+ > the standard documents are only as good as the commit they were re-taken at.
6
+
7
+ ## What was checked
8
+
9
+ `40-checker/scripts/repo-anchor-check.mjs` scans the standard documents for
10
+ `REPO/<path>:<line>` and `<line>-<line>` / `<line>,<line>` anchors and resolves
11
+ each against a read-only host checkout (`/home/yy/deepseek-harness`) at commit
12
+ `38a6a5c965aa99ab525161efb7cc5cf1fe62fced` (`dsh-v0.2.2-rc.3`, 2026-11-13).
13
+
14
+ For every anchor it proves:
15
+
16
+ 1. the referenced file exists at that commit;
17
+ 2. every referenced line number is within the file;
18
+ 3. a single-line anchor does not point at a blank line (a blank line is almost
19
+ always an off-by-one).
20
+
21
+ It does **not** prove that the line still contains the symbol named around the
22
+ anchor — that is a semantic review, and the script prints the current line text
23
+ to make it cheap. Do not read this file as "the prose is semantically correct";
24
+ read it as "no anchor is broken or off the end of its file at rc.3".
25
+
26
+ ## Result
27
+
28
+ ```
29
+ REPO anchors at 38a6a5c965aa (host: /home/yy/deepseek-harness)
30
+ OK 31-DS-C条款.md: 127 anchors, 0 drift, 0 warning
31
+ OK 32-DS-R条款.md: 106 anchors, 0 drift, 0 warning
32
+ OK 33-DS-G条款.md: 125 anchors, 0 drift, 0 warning
33
+ OK 35-三层开发建议与验收清单.md: 0 anchors, 0 drift, 0 warning
34
+ OK 60-权限与标注规范.md: 10 anchors, 0 drift, 0 warning
35
+ OK 93-开发建议-入门.md: 0 anchors, 0 drift, 0 warning
36
+ total: 368 anchors, 0 drift, 0 warning
37
+ ```
38
+
39
+ - The 6 known drifts from the audit (`plugin-manager/src/index.ts` 873→969,
40
+ `tools.ts` 108→109, `package-manifest/src/types.ts`, `cordis-host-runner/
41
+ sandbox.ts` 8→7, `vendor/README.md` 19→15, `install-spec.ts` 94-95→131) had
42
+ already been fixed in 1.6.11; this run proves nothing else is out of range.
43
+ - Three anchors cited `REPO/docs/tool-catalog.md:9`, which is a blank line at
44
+ rc.3 (the sentence "a tool schema is not statically knowable" is on line 8).
45
+ They are corrected to `:8` in `31-DS-C条款.md` (§8.3 table row 56),
46
+ `33-DS-G条款.md` (evidence list + §table row 6) and re-checked clean.
47
+
48
+ ## Reproduce
49
+
50
+ ```bash
51
+ node 40-checker/scripts/repo-anchor-check.mjs --host /home/yy/deepseek-harness
52
+ # JSON: node 40-checker/scripts/repo-anchor-check.mjs --host /home/yy/deepseek-harness --json
53
+ # pin a different commit: --commit <sha>
54
+ ```
55
+
56
+ `--host` must be a git checkout with the pinned commit object; the script only
57
+ reads (`git show`), it never fetches or writes. `DSH_HOST` / `DSH_COMMIT` set the
58
+ same defaults.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-standards",
3
- "version": "1.6.11",
3
+ "version": "1.6.12",
4
4
  "description": "DSH plugin standards and conformance checks: ENTRY/FLOW checks plus BOOST guidance. Non-official; no certification or ranking.",
5
5
  "type": "module",
6
6
  "main": "40-checker/src/index.mjs",
@@ -37,7 +37,8 @@
37
37
  ],
38
38
  "scripts": {
39
39
  "test": "node 40-checker/scripts/run-tests.mjs",
40
- "test:fixtures": "node bin/dsh-standards.mjs 40-checker/fixtures/good --scope entry --entry-claim static --format text"
40
+ "test:fixtures": "node bin/dsh-standards.mjs 40-checker/fixtures/good --scope entry --entry-claim static --format text",
41
+ "verify:repo-anchors": "node 40-checker/scripts/repo-anchor-check.mjs"
41
42
  },
42
43
  "engines": {
43
44
  "node": ">=24.9.0"
@@ -686,7 +686,7 @@
686
686
  {
687
687
  "dsc": "DSC-11",
688
688
  "clause": "C-11.1",
689
- "title": "dsh.capabilities 为闭集内字符串数组",
689
+ "title": "dsh.capabilities 为判定闭集或保留表内字符串数组",
690
690
  "layer": "L0",
691
691
  "mandatory": true,
692
692
  "advisory": false,