@whyshu/argent-engine 0.8.0-rc.7 → 0.8.0-rc.9

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.
@@ -2,7 +2,7 @@
2
2
  "_doc": "能力包版本锁(迭代3-⑨):由 scripts/capability_pack.py --stamp 生成。内容变了(sha 或 digest 变)而版本没变 ⇒ --stamp 直接拒绝(stamp_check)且 --validate 报错;版本**降**了同样拒绝(--allow-downgrade 才放行,且显著告警);提了版本再盖章。digest = 整包内容摘要,与 --emit-server-manifest#sha256 / --digest-tgz 同口径;批次收口前用只读的 --check-stamp 自检。",
3
3
  "capabilities": {
4
4
  "daily-report": {
5
- "version": "1.1.190",
5
+ "version": "1.1.193",
6
6
  "flows": [
7
7
  "mercadolibre.daily-report"
8
8
  ],
@@ -79,10 +79,10 @@
79
79
  "scripts/check-skill-classification.mjs": "8813287386e28a02",
80
80
  "scripts/config-explain.mjs": "7d17980ab2fb17ca",
81
81
  "core/cli/argent.mjs": "9a8977324c238ca4",
82
- "core/mcp/server.mjs": "cb4d4a1150ee96cc",
82
+ "core/mcp/server.mjs": "c4a6e1dbfecd5a47",
83
83
  "core/mcp/http.mjs": "4388cdb18128844a",
84
- "core/contracts/argent.contracts.json": "a595d4afa0fb2d9f",
85
- "core/contracts/verbs.schema.json": "4cc63e9709caf1bb",
84
+ "core/contracts/argent.contracts.json": "069e4c45dbf76314",
85
+ "core/contracts/verbs.schema.json": "54d726181c11536e",
86
86
  "core/lib/argent-datadir.mjs": "1fdd799c933382c4",
87
87
  "core/lib/audit.mjs": "b57c233b1926e4ce",
88
88
  "core/lib/claim.mjs": "0ab5cfa554446c2c",
@@ -113,13 +113,13 @@
113
113
  "core/lib/notify/webhook.mjs": "33708fec34641c8d",
114
114
  "core/lib/notify/feishu.mjs": "bdd494330f813546",
115
115
  "core/lib/notify/wecom.mjs": "789be0b3e28a151d",
116
- "VERSION": "0a4457c05142e4bf",
116
+ "VERSION": "1598d36aed9b1a07",
117
117
  "scripts/flow_case.py": "03870f8f4f316130",
118
118
  "scripts/ml_schema_check.py": "4e7435d0d9a4d999",
119
119
  "scripts/telemetry.py": "e07468db27995421",
120
120
  "scripts/invoice_ready_audit.py": "f598801d1603d8ea",
121
121
  "scripts/invoice_carrier_notice.py": "8b24766ac6793489",
122
- "scripts/ziniao-auth-probe.sh": "32013b0dabc86b2d",
122
+ "scripts/ziniao-auth-probe.sh": "a3332aa24039d4df",
123
123
  "scripts/install-license.mjs": "6bac5b31647f1e84",
124
124
  "scripts/migrate-providers.mjs": "1effa539f8d23054",
125
125
  "agents/catalog.json": "5356a812f2554dfd",
@@ -145,10 +145,10 @@
145
145
  "verticals/mercadolibre/flows.json": "69c11df91a53f151",
146
146
  "verticals/mercadolibre/config.json": "85e592d700383b9b"
147
147
  },
148
- "digest": "1291b54a266e167aa1ad445023db8d317ead14df3a400b5a51911e1a34087ed4"
148
+ "digest": "12a435822e7e37b745554bc0c2a5f0a98948d843889da1f471e028e75cf3854f"
149
149
  },
150
150
  "full": {
151
- "version": "1.3.199",
151
+ "version": "1.3.202",
152
152
  "flows": [
153
153
  "mercadolibre.full"
154
154
  ],
@@ -225,10 +225,10 @@
225
225
  "scripts/check-skill-classification.mjs": "8813287386e28a02",
226
226
  "scripts/config-explain.mjs": "7d17980ab2fb17ca",
227
227
  "core/cli/argent.mjs": "9a8977324c238ca4",
228
- "core/mcp/server.mjs": "cb4d4a1150ee96cc",
228
+ "core/mcp/server.mjs": "c4a6e1dbfecd5a47",
229
229
  "core/mcp/http.mjs": "4388cdb18128844a",
230
- "core/contracts/argent.contracts.json": "a595d4afa0fb2d9f",
231
- "core/contracts/verbs.schema.json": "4cc63e9709caf1bb",
230
+ "core/contracts/argent.contracts.json": "069e4c45dbf76314",
231
+ "core/contracts/verbs.schema.json": "54d726181c11536e",
232
232
  "core/lib/argent-datadir.mjs": "1fdd799c933382c4",
233
233
  "core/lib/audit.mjs": "b57c233b1926e4ce",
234
234
  "core/lib/claim.mjs": "0ab5cfa554446c2c",
@@ -259,13 +259,13 @@
259
259
  "core/lib/notify/webhook.mjs": "33708fec34641c8d",
260
260
  "core/lib/notify/feishu.mjs": "bdd494330f813546",
261
261
  "core/lib/notify/wecom.mjs": "789be0b3e28a151d",
262
- "VERSION": "0a4457c05142e4bf",
262
+ "VERSION": "1598d36aed9b1a07",
263
263
  "scripts/flow_case.py": "03870f8f4f316130",
264
264
  "scripts/ml_schema_check.py": "4e7435d0d9a4d999",
265
265
  "scripts/telemetry.py": "e07468db27995421",
266
266
  "scripts/invoice_ready_audit.py": "f598801d1603d8ea",
267
267
  "scripts/invoice_carrier_notice.py": "8b24766ac6793489",
268
- "scripts/ziniao-auth-probe.sh": "32013b0dabc86b2d",
268
+ "scripts/ziniao-auth-probe.sh": "a3332aa24039d4df",
269
269
  "scripts/install-license.mjs": "6bac5b31647f1e84",
270
270
  "scripts/migrate-providers.mjs": "1effa539f8d23054",
271
271
  "agents/catalog.json": "5356a812f2554dfd",
@@ -278,7 +278,7 @@
278
278
  "scripts/fulfillment.js": "8de1ea386ebfe628",
279
279
  "scripts/ml_capacity_probe.py": "1000b23070ede4a2",
280
280
  "scripts/ml_hub_status.py": "2211761b1ed5f234",
281
- "scripts/orchestrator.py": "1f1c6eeae0127528",
281
+ "scripts/orchestrator.py": "b959f67e217c38cd",
282
282
  "scripts/poll-fulfillment.sh": "3e9fabd1818e0dc6",
283
283
  "verticals/mercadolibre/prompts/full.failure.md": "55d0847ace5ca8bc",
284
284
  "verticals/mercadolibre/prompts/full.md": "b7c5e96f7fe2c3be",
@@ -301,10 +301,10 @@
301
301
  "verticals/mercadolibre/flows.json": "69c11df91a53f151",
302
302
  "verticals/mercadolibre/config.json": "85e592d700383b9b"
303
303
  },
304
- "digest": "23bb206c15c9dc922b5a7fdc316d9b40c558be7fd82c472dcfed97b7ea416e6c"
304
+ "digest": "afa8b14435423f246057d00c02d296ab7c03d8abdcac36b1d968bea391f9acf6"
305
305
  },
306
306
  "hr": {
307
- "version": "0.1.86",
307
+ "version": "0.1.88",
308
308
  "flows": [],
309
309
  "files": {
310
310
  "presets/argent-hr/agent.cordis.yml": "45917decf6f39f70",
@@ -314,10 +314,10 @@
314
314
  "presets/argent-hr-office/format-version.txt": "6b86b273ff34fce1",
315
315
  "presets/argent-hr-office/preset.yml": "0b4d7304a412722a"
316
316
  },
317
- "digest": "179527a2905f358cdff15f9a8c0f9945f23770e4c504f58a27843c7bf365e76a"
317
+ "digest": "b2ced00a4a168f4812ad84bd1c06cc00c9750b034854b8062a5608bcd9424121"
318
318
  },
319
319
  "invoice": {
320
- "version": "1.2.193",
320
+ "version": "1.2.196",
321
321
  "flows": [
322
322
  "mercadolibre.wenyao-invoice",
323
323
  "mercadolibre.xzh-invoice"
@@ -395,10 +395,10 @@
395
395
  "scripts/check-skill-classification.mjs": "8813287386e28a02",
396
396
  "scripts/config-explain.mjs": "7d17980ab2fb17ca",
397
397
  "core/cli/argent.mjs": "9a8977324c238ca4",
398
- "core/mcp/server.mjs": "cb4d4a1150ee96cc",
398
+ "core/mcp/server.mjs": "c4a6e1dbfecd5a47",
399
399
  "core/mcp/http.mjs": "4388cdb18128844a",
400
- "core/contracts/argent.contracts.json": "a595d4afa0fb2d9f",
401
- "core/contracts/verbs.schema.json": "4cc63e9709caf1bb",
400
+ "core/contracts/argent.contracts.json": "069e4c45dbf76314",
401
+ "core/contracts/verbs.schema.json": "54d726181c11536e",
402
402
  "core/lib/argent-datadir.mjs": "1fdd799c933382c4",
403
403
  "core/lib/audit.mjs": "b57c233b1926e4ce",
404
404
  "core/lib/claim.mjs": "0ab5cfa554446c2c",
@@ -429,13 +429,13 @@
429
429
  "core/lib/notify/webhook.mjs": "33708fec34641c8d",
430
430
  "core/lib/notify/feishu.mjs": "bdd494330f813546",
431
431
  "core/lib/notify/wecom.mjs": "789be0b3e28a151d",
432
- "VERSION": "0a4457c05142e4bf",
432
+ "VERSION": "1598d36aed9b1a07",
433
433
  "scripts/flow_case.py": "03870f8f4f316130",
434
434
  "scripts/ml_schema_check.py": "4e7435d0d9a4d999",
435
435
  "scripts/telemetry.py": "e07468db27995421",
436
436
  "scripts/invoice_ready_audit.py": "f598801d1603d8ea",
437
437
  "scripts/invoice_carrier_notice.py": "8b24766ac6793489",
438
- "scripts/ziniao-auth-probe.sh": "32013b0dabc86b2d",
438
+ "scripts/ziniao-auth-probe.sh": "a3332aa24039d4df",
439
439
  "scripts/install-license.mjs": "6bac5b31647f1e84",
440
440
  "scripts/migrate-providers.mjs": "1effa539f8d23054",
441
441
  "agents/catalog.json": "5356a812f2554dfd",
@@ -476,7 +476,7 @@
476
476
  "verticals/mercadolibre/flows.json": "69c11df91a53f151",
477
477
  "verticals/mercadolibre/config.json": "85e592d700383b9b"
478
478
  },
479
- "digest": "63694270de0c0f602ce0cf70ddae9c6d37d9571fcd670165956a23bc669d9d72"
479
+ "digest": "4690fc1d55a541dc4cd426ec6c5a3104d2d4ead6763072f40a32e889031d0718"
480
480
  }
481
481
  }
482
482
  }
@@ -61,6 +61,7 @@
61
61
  * 接进 CI 的是 `--matrix-only` 那一条(见 `scripts/ci-run.sh#CRITERIA`)。
62
62
  */
63
63
  import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs'
64
+ import { execFileSync } from 'node:child_process'
64
65
  import { dirname, join, relative, resolve, sep } from 'node:path'
65
66
  import { fileURLToPath } from 'node:url'
66
67
 
@@ -441,12 +442,58 @@ for (const rel of readmes) scanReadmeNumbers(join(ROOT, rel), rel, counts)
441
442
  // R4:宿主矩阵结构(**不随 --matrix-only 开关,永远跑** —— 它是结构性判据,任何模式下都该看得见)
442
443
  const matrix = scanHostMatrix(ROOT, HOST_MATRIX_REL)
443
444
 
445
+ // ── R5:文档状态(2026-11-02)—— frontmatter / superseded 指针 / INDEX 总览是否最新 ──
446
+ function scanDocStatus() {
447
+ const dir = join(ROOT, 'docs')
448
+ if (!existsSync(dir)) return
449
+ const walk = (d, base) => {
450
+ const out = []
451
+ for (const e of readdirSync(d)) {
452
+ if (e === 'archive') continue // 归档区不参与状态门禁
453
+ const p = join(d, e)
454
+ if (statSync(p).isDirectory()) out.push(...walk(p, join(base, e)))
455
+ else if (e.endsWith('.md') && e !== 'INDEX.md') out.push(join(base, e))
456
+ }
457
+ return out
458
+ }
459
+ for (const rel of walk(dir, 'docs')) {
460
+ const f = rel.split('/').pop()
461
+ const lines = readFileSync(join(ROOT, rel), 'utf8').split('\n')
462
+ const end = lines.indexOf('---', 1)
463
+ if (lines[0]?.trim() !== '---' || end < 0) {
464
+ push('R5', 'suspect', rel, 1, lines[0] || '', 'frontmatter',
465
+ '缺 frontmatter(status/appliesTo/updated)—— 约定见 docs/INDEX.md §文档状态约定')
466
+ continue
467
+ }
468
+ const fm = {}
469
+ for (const l of lines.slice(1, end)) {
470
+ const m = l.match(/^([A-Za-z]+):\s*(.*)$/)
471
+ if (m) fm[m[1]] = m[2].trim()
472
+ }
473
+ if (!fm.status) push('R5', 'suspect', rel, 1, '', 'status', 'frontmatter 缺 status')
474
+ if (fm.status === 'superseded') {
475
+ if (!fm.supersededBy) push('R5', 'suspect', rel, 1, '', 'supersededBy', 'superseded 文档必须给 supersededBy')
476
+ else if (!existsSync(join(ROOT, fm.supersededBy))) {
477
+ push('R5', 'suspect', rel, 1, fm.supersededBy, 'supersededBy', `supersededBy 指向不存在的文件:${fm.supersededBy}`)
478
+ }
479
+ }
480
+ }
481
+ try {
482
+ execFileSync(process.execPath, [join(ROOT, 'scripts', 'build-doc-index.mjs'), '--check'], { stdio: 'pipe' })
483
+ } catch {
484
+ push('R5', 'suspect', join('docs', 'INDEX.md'), 1, '', 'DOC-STATUS',
485
+ 'INDEX 状态总览过期:运行 node scripts/build-doc-index.mjs')
486
+ }
487
+ }
488
+ scanDocStatus()
489
+
444
490
  const suspects = findings.filter((f) => f.level === 'suspect')
445
491
  const infos = findings.filter((f) => f.level === 'info')
446
492
  const byRule = (lvl, rule) => findings.filter((f) => f.level === lvl && f.rule === rule).length
447
493
  const RULE_TITLE = {
448
494
  R1: 'R1 旧 dsh 版本号当现行', R2: 'R2 README 数字漂移',
449
495
  R3: 'R3 已废弃路径当现行', R4: 'R4 宿主矩阵结构(列数/空标签/状态符号)',
496
+ R5: 'R5 文档状态(frontmatter / superseded 指针 / INDEX 总览)',
450
497
  }
451
498
  const INFO_PRINT_PER_RULE = 12 // 每条规则的信息项逐条打印上限(避免刷屏;全量用 --json)
452
499
 
@@ -483,7 +530,7 @@ if (JSON_OUT) {
483
530
  console.log(` ${matrixSummary()} ← 文档:${HOST_MATRIX_REL}`)
484
531
  console.log('')
485
532
  console.log(`⚠️ 可疑 ${suspects.length} 条`)
486
- for (const rule of ['R1', 'R2', 'R3', 'R4']) {
533
+ for (const rule of ['R1', 'R2', 'R3', 'R4', 'R5']) {
487
534
  const list = suspects.filter((f) => f.rule === rule)
488
535
  if (!list.length) continue
489
536
  console.log(` ── ${RULE_TITLE[rule]}(${list.length} 条)`)
@@ -497,7 +544,7 @@ if (JSON_OUT) {
497
544
  console.log('')
498
545
  console.log(`ℹ️ 信息(历史/沿革语境,不计入可疑)${infos.length} 条`)
499
546
  let infoSkipped = 0
500
- for (const rule of ['R1', 'R2', 'R3', 'R4']) {
547
+ for (const rule of ['R1', 'R2', 'R3', 'R4', 'R5']) {
501
548
  const list = infos.filter((f) => f.rule === rule)
502
549
  if (!list.length) continue
503
550
  console.log(` ── ${RULE_TITLE[rule]}(${list.length} 条)`)
@@ -510,8 +557,8 @@ if (JSON_OUT) {
510
557
  console.log('')
511
558
  console.log(` =============================================`)
512
559
  console.log(` ${matrixSummary()}`)
513
- console.log(` 可疑 ${suspects.length} 条(R1=${byRule('suspect', 'R1')} / R2=${byRule('suspect', 'R2')} / R3=${byRule('suspect', 'R3')} / R4=${byRule('suspect', 'R4')})`
514
- + `|信息 ${infos.length} 条(R1=${byRule('info', 'R1')} / R2=${byRule('info', 'R2')} / R3=${byRule('info', 'R3')} / R4=${byRule('info', 'R4')})`)
560
+ console.log(` 可疑 ${suspects.length} 条(R1=${byRule('suspect', 'R1')} / R2=${byRule('suspect', 'R2')} / R3=${byRule('suspect', 'R3')} / R4=${byRule('suspect', 'R4')} / R5=${byRule('suspect', 'R5')})`
561
+ + `|信息 ${infos.length} 条(R1=${byRule('info', 'R1')} / R2=${byRule('info', 'R2')} / R3=${byRule('info', 'R3')} / R4=${byRule('info', 'R4')} / R5=${byRule('info', 'R5')})`)
515
562
  console.log(` 如何修:现行口径写**现役值**(dsh ${ACTIVE.version || '<现役版本>'}、路径 \`~/.local/node/bin\`、README 数字按实际计数),`
516
563
  + `历史内容**不要删**、只补「历史/升级记录」字样即可让本检查降级为信息;`
517
564
  + `矩阵结构(R4)另有修法:让出问题的行**回到表头的列数**(内容一格都不许丢)。`)
@@ -159,7 +159,7 @@ criterion_cmd() {
159
159
  1.0-criteria) printf '%s' 'node scripts/check-1.0-criteria.mjs --strict' ;;
160
160
  judgment-drift) printf '%s' 'node scripts/check-judgment-drift.mjs' ;;
161
161
  version-consistency) printf '%s' 'node scripts/check-version-consistency.mjs --strict' ;;
162
- contracts) printf '%s' 'node scripts/tests/argent-contracts.test.mjs' ;;
162
+ contracts) printf '%s' 'node scripts/tests/argent-contracts.test.mjs && node scripts/tests/two-artifact-contract.test.mjs' ;;
163
163
  capability-pack) printf '%s' "${PY} scripts/capability_pack.py --validate" ;;
164
164
  pack-closure) printf '%s' 'node scripts/check-pack-closure.mjs --strict' ;;
165
165
  config-catalog) printf '%s' 'node scripts/check-config-catalog.mjs --strict' ;;
@@ -187,7 +187,7 @@ criterion_expect() {
187
187
  1.0-criteria) printf '%s\n' '判据条数:40 条' '结论:✅ 一致' ;;
188
188
  judgment-drift) printf '%s\n' '契约漂移 0 条' ;;
189
189
  version-consistency) printf '%s\n' 'version-consistency: 0 个 error' ;;
190
- contracts) printf '%s\n' 'argent-contracts: [1-9][0-9]* 通过 / 0 失败' ;;
190
+ contracts) printf '%s\n' 'argent-contracts: [1-9][0-9]* 通过 / 0 失败' '契约测试:[1-9][0-9]* 通过 / 0 失败' ;;
191
191
  capability-pack) printf '%s\n' '每个能力包都自洽' ;;
192
192
  pack-closure) printf '%s\n' '缺件 0 个' ;;
193
193
  config-catalog) printf '%s\n' '四道门禁全绿' ;;
@@ -0,0 +1,212 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * doc-status.mjs —— 文档状态体检(**默认 dry-run,只报告,不写任何文件**)
4
+ *
5
+ * 背景(2026-11-02):docs 下 105 篇,零 frontmatter;INDEX 里写死过版本号 ⇒ "新旧误会"。
6
+ * 本脚本按 INDEX 归属 + 文件名 + 已有横幅,给每篇一个**候选 status** 与依据,
7
+ * 供人工审阅后再落 frontmatter(见 docs/INDEX.md §文档状态约定)。
8
+ *
9
+ * 用法:
10
+ * node scripts/doc-status.mjs # 全部 docs/*.md,打印表格
11
+ * node scripts/doc-status.mjs --limit 20 # 只看前 20 行
12
+ * node scripts/doc-status.mjs --json # 机器可读
13
+ * node scripts/doc-status.mjs --dirs # 连 docs/*∕ 子目录一起扫
14
+ *
15
+ * 退出码:恒为 0(只报告)。门禁在 check-docs-drift.mjs(R5 规则族)。
16
+ */
17
+ import { readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'
18
+ import { join, basename, relative } from 'node:path'
19
+
20
+ const ROOT = new URL('..', import.meta.url).pathname
21
+ const DOCS = join(ROOT, 'docs')
22
+ const args = process.argv.slice(2)
23
+ const LIMIT = args.includes('--limit') ? Number(args[args.indexOf('--limit') + 1]) : 0
24
+ const JSON_OUT = args.includes('--json')
25
+ const WITH_DIRS = !args.includes('--top-only') // 默认递归(排除 archive/)
26
+ const APPLY = args.includes('--apply') // 显式开启才写文件(默认 dry-run)
27
+
28
+ const SUPERSEDED_BY = {
29
+ 'docs/分层职责与判断归属.md': 'docs/Argent-宿主适配契约.md', // AGENTS.md:已并入库,只剩指针
30
+ }
31
+
32
+ // 2026-11-02 人工判定(17 篇自动分类判不出来的;改这里再跑 --apply 即可)
33
+ const MANUAL = {
34
+ // 现行:运维/接口/数据口径手册,仍被使用
35
+ 'docs/dsh-api-protocol.md': 'current',
36
+ 'docs/dsh-client-plugin-pitfalls.md': 'current',
37
+ 'docs/full-lip-operational-guide.md': 'current',
38
+ 'docs/ml-dev-failure-sop.md': 'current',
39
+ 'docs/机器接入Skill-分发说明.md': 'current',
40
+ 'docs/美客多日报-数据指标清单.md': 'current',
41
+ 'docs/ml-agent-architecture.md': 'current',
42
+ // 历史:方案/评估/路线记录,仅作证据
43
+ 'docs/agentic-tools-contract-v1.md': 'historical',
44
+ 'docs/Argent-智能体平台-设计.md': 'historical',
45
+ 'docs/Argent-陪跑式交付-实施方案.md': 'historical',
46
+ 'docs/Argent-许可自助签发与续期-实施方案.md': 'historical',
47
+ 'docs/branding-roadmap.md': 'historical',
48
+ 'docs/dsh-排程插件评估与迁移设计.md': 'historical',
49
+ 'docs/invoice-usage.md': 'historical',
50
+ 'docs/策划案-可读性根治与按能力交付与结果计费.md': 'historical',
51
+ 'docs/ml-invoice-automation.md': 'historical',
52
+ 'docs/内部运维-dsh升级与旧版本清场方案(不属 Argent 产品路径).md': 'historical',
53
+ }
54
+
55
+ const VERSION = readFileSync(join(ROOT, 'VERSION'), 'utf8').trim()
56
+ const CURRENT_MAJOR = VERSION.split('.').slice(0, 2).join('.') // 0.8
57
+
58
+ // ── INDEX 解析 ────────────────────────────────────────────────────────
59
+ const indexText = readFileSync(join(DOCS, 'INDEX.md'), 'utf8')
60
+ const sections = {}
61
+ let cur = null
62
+ for (const line of indexText.split('\n')) {
63
+ const h = line.match(/^##\s+(.*)$/)
64
+ if (h) { cur = h[1].trim(); sections[cur] = []; continue }
65
+ if (cur) sections[cur].push(line)
66
+ }
67
+ const currentLines = sections['当前有效(操作/契约以此为准)'] || []
68
+ const historicalLines = sections['历史文档(仅作证据,不作为当前操作依据)'] || []
69
+
70
+ const currentPaths = new Set()
71
+ for (const line of currentLines) {
72
+ if (!line.startsWith('|')) continue
73
+ for (const m of line.matchAll(/`([^`]+)`/g)) {
74
+ // ⚠️ 只在「空格 + / + 空格」处切分(`docs/release.md` / `docs/xxx.md` 这种一格两项),
75
+ // 否则 `skills/*/SKILL.md` 会被切成 `*` ⇒ 前缀匹配命中一切(2026-11-02 实测踩到)。
76
+ for (const p of m[1].split(/\s+\/\s+/)) currentPaths.add(p.replace(/^\.\//, ''))
77
+ }
78
+ }
79
+ const historicalPatterns = []
80
+ for (const line of historicalLines) {
81
+ if (!line.startsWith('- ')) continue
82
+ for (const m of line.matchAll(/`([^`]+)`/g)) {
83
+ for (const p of m[1].split(/\s+[·、]\s+/)) {
84
+ const t = p.trim()
85
+ if (t) historicalPatterns.push(t)
86
+ }
87
+ }
88
+ }
89
+
90
+ function matches(p, token) {
91
+ if (!token || token === '*' || token.endsWith('/*')) return false
92
+ if (token.endsWith('*')) return basename(p).startsWith(token.slice(0, -1))
93
+ if (token.includes('/')) return p === token || p.endsWith('/' + token)
94
+ return basename(p) === token || basename(p) === token + '.md'
95
+ }
96
+
97
+ // ── 文件扫描 ──────────────────────────────────────────────────────────
98
+ function walk(dir) {
99
+ const out = []
100
+ for (const e of readdirSync(dir)) {
101
+ const p = join(dir, e)
102
+ const st = statSync(p)
103
+ if (st.isDirectory()) { if (WITH_DIRS && e !== 'archive') out.push(...walk(p)); continue }
104
+ if (e.endsWith('.md')) out.push(p)
105
+ }
106
+ return out
107
+ }
108
+ const files = walk(DOCS).filter((f) => basename(f) !== 'INDEX.md')
109
+
110
+ function frontmatter(text) {
111
+ const lines = text.split('\n')
112
+ if (lines[0]?.trim() !== '---') return null
113
+ const end = lines.indexOf('---', 1)
114
+ if (end < 0) return null
115
+ const fm = {}
116
+ for (const l of lines.slice(1, end)) {
117
+ const m = l.match(/^([A-Za-z]+):\s*(.*)$/)
118
+ if (m) fm[m[1]] = m[2].trim()
119
+ }
120
+ return fm
121
+ }
122
+
123
+ // 现行引用面:INDEX 的"当前有效"文档正文 + 新会话真正读的入口(AGENTS/WORKSPACE)
124
+ const corpus = [
125
+ ...[...currentPaths]
126
+ .filter((x) => x.startsWith('docs/') && x.endsWith('.md'))
127
+ .map((x) => join(ROOT, x)),
128
+ join(process.env.HOME || '', '.dsh', 'AGENTS.md'),
129
+ join(ROOT, '..', 'WORKSPACE.md'),
130
+ ]
131
+ .map((f) => { try { return readFileSync(f, 'utf8') } catch { return '' } })
132
+ .join('\n')
133
+
134
+
135
+ const rows = []
136
+ for (const f of files) {
137
+ const rel = relative(ROOT, f).split('\\').join('/')
138
+ const text = readFileSync(f, 'utf8')
139
+ const fm = frontmatter(text)
140
+ const head = text.split('\n').slice(0, 6).join('\n')
141
+ const hasBanner = /历史文档|已归档|⛔\s*\*\*本文|superseded/i.test(head)
142
+ const name = basename(f)
143
+ const verMatch = name.match(/-(0\.\d)(?:\.\d)?-/)
144
+ const hasDate = /20\d{2}-\d{2}-\d{2}/.test(name)
145
+ const inCurrent = [...currentPaths].some((p) => matches(rel, p))
146
+ const inHistorical = historicalPatterns.some((p) => matches(rel, p))
147
+
148
+ let status, why, risk = ''
149
+ if (fm?.status) { status = fm.status; why = '已有 frontmatter' }
150
+ else if (inCurrent) { status = 'current'; why = 'INDEX「当前有效」' }
151
+ else if (hasBanner) { status = 'historical'; why = '已有历史横幅' }
152
+ else if (inHistorical) { status = 'historical'; why = 'INDEX「历史文档」' }
153
+ else if (/^release-/.test(name)) { status = 'historical'; why = '发布记录(事件)'; risk = '不取代任何文档' }
154
+ else if (MANUAL[rel]) { status = MANUAL[rel]; why = '人工判定(2026-11-02)' }
155
+ else if (rel.startsWith('docs/ops/')) { status = 'historical'; why = '运维事件记录(证据)' }
156
+ else if (rel.startsWith('docs/releases/')) { status = 'current'; why = '版本索引页' }
157
+ else if (rel.startsWith('docs/samples/')) { status = 'current'; why = '对外样例(脱敏)' }
158
+ else if (SUPERSEDED_BY[rel]) { status = 'superseded'; why = '已并入其他文档(人工确认)' }
159
+ else if (verMatch && verMatch[1] !== CURRENT_MAJOR) { status = 'historical'; why = `旧版本线 ${verMatch[1]}`; risk = '建议人工确认是否 superseded' }
160
+ else if (hasDate) { status = 'historical'; why = '时间型记录'; risk = '建议人工确认' }
161
+ else if (corpus.includes(name)) { status = 'current'; why = '被现行文档引用'; risk = '建议人工确认' }
162
+ else { status = 'needs-review'; why = '未命中任何规则,也无人引用'; risk = '需人工判定' }
163
+
164
+ rows.push({
165
+ file: rel, status, why, risk,
166
+ frontmatter: fm ? 'yes' : 'no',
167
+ hasAppliesTo: Boolean(fm?.appliesTo),
168
+ })
169
+ }
170
+
171
+ // ── apply(仅 --apply)──────────────────────────────────────────────
172
+ if (APPLY) {
173
+ let written = 0
174
+ for (const r of rows) {
175
+ if (r.frontmatter === 'yes') continue
176
+ // ⛔ 不替人做决定:needs-review 不写(留给人工判定,门禁会点名)
177
+ if (r.status === 'needs-review') continue
178
+ const abs = join(ROOT, r.file)
179
+ const text = readFileSync(abs, 'utf8')
180
+ const ver = r.file.match(/-(0\.\d)(?:\.\d)?-/)
181
+ const fm = [
182
+ '---',
183
+ `status: ${r.status === 'needs-review' ? 'draft' : r.status}`,
184
+ `appliesTo: ${ver ? `argent ${ver[1]}.x` : '—'}`,
185
+ ...(r.status === 'superseded' ? [`supersededBy: ${SUPERSEDED_BY[r.file]}`] : []),
186
+ 'updated: 2026-11-02',
187
+ '---',
188
+ '',
189
+ ].join('\n')
190
+ writeFileSync(abs, fm + text)
191
+ written++
192
+ }
193
+ console.log(`已写入 frontmatter:${written} 篇(其余已有,跳过)`)
194
+ }
195
+
196
+ // ── 输出 ──────────────────────────────────────────────────────────────
197
+ const order = { current: 0, 'needs-review': 1, superseded: 2, historical: 3, draft: 4 }
198
+ rows.sort((a, b) => (order[a.status] ?? 9) - (order[b.status] ?? 9) || a.file.localeCompare(b.file))
199
+ const counts = rows.reduce((m, r) => ((m[r.status] = (m[r.status] || 0) + 1), m), {})
200
+
201
+ if (JSON_OUT) {
202
+ console.log(JSON.stringify({ version: VERSION, counts, rows }, null, 2))
203
+ } else {
204
+ console.log(`doc-status —— 文档状态体检(dry-run,不写文件)`)
205
+ console.log(` 当前 VERSION: ${VERSION} 扫描: ${rows.length} 篇 frontmatter 覆盖: ${rows.filter((r) => r.frontmatter === 'yes').length}/${rows.length}`)
206
+ console.log(` 候选分布: ${Object.entries(counts).map(([k, v]) => `${k}=${v}`).join(' ')}`)
207
+ console.log('')
208
+ console.log(['STATUS', 'FILE', 'WHY', 'RISK'].join('\t'))
209
+ const show = LIMIT > 0 ? rows.slice(0, LIMIT) : rows
210
+ for (const r of show) console.log([r.status, r.file, r.why, r.risk].join('\t'))
211
+ if (LIMIT > 0 && rows.length > LIMIT) console.log(`... 还有 ${rows.length - LIMIT} 篇(用 --limit 0 看全部)`)
212
+ }
@@ -157,7 +157,7 @@
157
157
  },
158
158
  "minPlan": "enterprise",
159
159
  "pack": {
160
- "version": "1.2.193",
160
+ "version": "1.2.196",
161
161
  "scripts": [
162
162
  "scripts/wenyao-invoice-writeback.mjs",
163
163
  "scripts/invoice_lip_runner.py",
@@ -260,7 +260,7 @@
260
260
  ],
261
261
  "minPlan": "enterprise",
262
262
  "pack": {
263
- "version": "1.3.199",
263
+ "version": "1.3.202",
264
264
  "scripts": [
265
265
  "scripts/poll-fulfillment.sh",
266
266
  "scripts/orchestrator.py",
@@ -340,7 +340,7 @@
340
340
  "minPlan": "pro",
341
341
  "_minPlanNote": "**2026-10-09(变现分层落地)**:`enterprise` → **`pro`**。判据 = 用户已确认的产品模型「分界线 = **价值更高 / 风险更高 ⇒ 企业版**」:日报是**只读**能力(官方 API 只读查询 + 生成推送,⛔ 不写客户任何系统、⛔ 不动浏览器),与 `full`(箱唛/写操作)、`invoice`(发票/门户写操作)不同档 ⇒ 归 **Pro**。⛔ 只改**档位下限**,⛔ 不改流程行为、⛔ 不改价格口径;`daily-report` 的能力包版本随引擎前进(见 pack.version)。已装机器**不因本改动被卸载/停用**(缩权只影响后续下发,见 entitlements.plans._why 与 docs 策划案 §4.4)。",
342
342
  "pack": {
343
- "version": "1.1.190",
343
+ "version": "1.1.193",
344
344
  "scripts": [
345
345
  "scripts/daily-report.mjs",
346
346
  "scripts/daily-report.sh",
@@ -442,7 +442,7 @@
442
442
  }
443
443
  ]
444
444
  },
445
- "version": "0.1.86",
445
+ "version": "0.1.88",
446
446
  "_note": [
447
447
  "能力包版本(语义化):改了该能力的流程/提示词/脚本/技能 ⇒ 必须提版本并重新打包 |**0.1.40(2026-10-04,角色退役·墓碑)**:包内容变更(`presets/argent-hr-office/agent.cordis.yml` 的 persona 改成退役告知、`preset.yml` 的 name/description 标注「已退役」)—— 角色 `hr-office` 已于 2026-10-04 退役(方案 §3.3.1:gateway.json 条目与 install-dsh.sh 安装期入口已撤),**本能力包保留**(装机内容不变、仍可安装;入口 preset 作为 web 老会话的墓碑保留)⇒ 版本随内容前进。|**0.1.41(2026-10-09,版本随内容前进)**:`0.1.40` **发布之后其字节被原地覆盖过一次**(服务端清单 `sha256` `15cf4f43…` → `058ccead…` 而 `version` 原地不动,见 whyshu-svr `docs/ops/deploy-fe02231-packs-align.md`)⇒ 同一个 URL 下的内容变过 ⇒ \"内容变 ⇒ 版本变\"这条不变式被破坏,客户机无法靠版本号判断自己拿到的是哪一份。本次**只提版本、包内容一字未改**(重盖章后内容摘要与 0.1.40 时逐字相同)⇒ `hr-0.1.41.tgz` 是该内容**首次以某个版本号**对外发布。⛔ 未改共用引擎、未新增运行期文件,故 `pack.engine` 清单不变。|**0.1.42(2026-10-09,配置地基:配置目录 + 通用读取器 —— hr 包内容随之改变)**:本能力**无 flow**,按 `pack.engine` 的分发规矩**不背共用引擎**(`files` 仍只有 `presets/argent-hr-office/**` 三件,`integrity` 逐字节未变)。但**每个包的 tgz 里都带一份注册表投影**(`scripts/flow-requirements.json` 的引擎级段),而本批改了它的 `pack.engine`(新增 `core/lib/config-catalog.mjs` 与 5 个 `configs/*.json`)⇒ **hr 的包字节变了** ⇒ 按「内容变 ⇒ 版本必变(含无 flow 的包)」这条不变式**必须一起提版本**,否则会出现\"同一个版本号 0.1.41 对应两份不同字节\"(这正是 `release-argent.sh --check-dl` 的能力包档当场抓到的形态:`✗ hr: 版本相同(0.1.41)但内容摘要不同 —— 仓库 ad3599c5 vs 线上 09e1fef9`;提版后该条转为 ⚠「发布在途」,不再判红)。⛔ 本轮 hr 的**能力内容一字未改**。|**0.1.44(2026-10-09,预约失败判定链 + 口径统一)**:共用引擎 `scripts/flow_failure.py` 变更(新增 `canonical_reason()` 与 `--case` —— 打印某 case 的**规范失败原因**:优先读台账 `failed.reason`,老台账回落到 `error` 去身份前缀;给角色/运维一个**逐字照抄**的取数口,杜绝\"表备注写 A、账本写 B\")⇒ 所有能力包的注册表投影同批变化。本能力自身:⛔ 本能力内容一字未改;但 `flow_failure.py` 在 `pack.engine` 内,且包内 `scripts/flow-requirements.json` 投影**含 `failureClasses`**(本次新增的两条 needsHuman 判据就在其中)⇒ **包字节变了**,按「内容变 ⇒ 版本必变(含无 flow 的包)」这条不变式必须一起提版本。(⚠️ **盖章说明**:本版内容在同一工作树里经过**多轮收口**(先落实现,再按 vertical-lint 的引擎业务词约束改注册表文案、再收口文案)⇒ 以**最终内容**盖章;版本号从未发布过,不存在\"内容变了版本没动\"的对外窗口。)|**0.1.45(2026-10-09,三处生产实测收口:票不许静默消失 · 失败必写原因+动作 · 发票流程 Rule R)**:共用引擎变更 ⇒ 四个能力包一起提版本并重盖章。① `scripts/flow_triage.py`:判定改为**有效末条事件**(`INFO_EVENTS = phase/wake/policy_apply/policy_new` 回退到最近一条状态性事件;`failed_ack` = 有意不动且**不参与回退**)、`blocked` 从「静默 pass」改为可见的 `needs_human`,并加**循环后对账兜底**(任何未归桶的 case ⇒ `needs_human`,kind=unclassified)——修的是客户机生产实测 P0(某发票票):其尾部是 `blocked → phase` ⇒ 分诊摘要全 0、运营勾了放行也不派发、且**不在「需人工」里**(静默卡死)。② `scripts/flow_failure.py`:新增运营文案**唯一来源** `ops_message()`(`结论:<业务类|系统类|我方缺陷类>|<原因>|动作:…`,≤300 字)与 `release_hint()`(放行位/提示的**唯一实现**:变体与**顶层** pick 都认;`orchestrator._ops_action_hint` 改为委托它);③ **新增** `scripts/invoice_fail_closeout.py`(属**发票能力专属脚本** `capabilities.invoice.pack.scripts`,⛔ 不进共用引擎 —— 它只写发票那一列):失败/成功收口 —— 把**同一串**写进表「发票错误信息」与台账(`detail` 逐字相同、`error` 放规范原因),取不到原因 ⇒ **exit 2 拒绝执行**,代码级异常归「我方缺陷类」且**不回原文**,成功 ⇒ `--clear-error` 清空;④ `scripts/flow_return_to_ops.py`:缺口回填文案改用同一来源(表字段 == 台账 `detail`);④b `scripts/flow_config.py`:归一化的 `guards` 增**标量透传**(`writer`=写手路径、`errorField`=失败原因列 —— 不透出就只能各自把路径/列名写死,那正是「判据第二份」与业务词泄漏进引擎的来源);⑤ 业务线声明(`verticals/<id>/flows.json`):两个发票流程新增 `pick.release` / `pick.releaseReDispatch`(放行位 = **各自的门控列**「发票就绪」;上限 3 / 冷却 30)与 `guards.errorField`。本能力自身:⛔ 内容一字未改(无 flow ⇒ 不背共用引擎);但包内注册表投影含 `failureClasses`/`pack.engine` ⇒ 包字节变了,按「内容变 ⇒ 版本必变(含无 flow 的包)」一起提版本。|**0.1.46(2026-10-09,配置「生效来源」可见化 + 冲突告警,批 1)**:本能力无 flow ⇒ **不背共用引擎**(`files` 仍只有 3 件 preset,逐字节未变);但包内注册表投影含 `pack.engine` ⇒ 包字节变了,按「内容变 ⇒ 版本必变(含无 flow 的包)」一起提版本(同 `0.1.42` 先例)。本能力内容一字未改。共用引擎 `core/lib/config-catalog.mjs` 新增**纯函数** `resolveEffective()`(按规范链算「谁赢了 / 谁被压住」)、密钥脱敏 `redactSecret()` 与读取器 `effectiveOf()/levelsOf()`,并新增只读 CLI `scripts/config-explain.mjs`(`--key/--all/--list/--json`)⇒ 能力包内容变化,按纪律提版本并重盖章。⛔ **零行为变化**:读取器的取值路径(`resolveOne`)与任何 `todayChain` 一个字节都没改,只是「如实展示」;同批回归 `scripts/tests/config-effective.test.mjs`(63 断言)+ 端点 / 页面两条既有回归扩测。|**0.1.47(2026-10-09,同批收口:脱敏闸幂等)**:只读 CLI `scripts/config-explain.mjs` 的\"再脱敏\"兜底闸原先**无条件**执行 ⇒ `❰已设置(长度N)❱` 里的 N 变成**占位串自己的长度**(恒 11,实测),而用户正是拿它比对\"密钥换没换\" ⇒ 已改为**幂等**(含被压住的那级)并补回归;引擎面同一份 CLI 变了 ⇒ 包内容变化,按纪律再提版本并重盖章。本能力自身内容一字未改。|**0.1.49(2026-10-10,A 批:按智能体安装清单 —— 客户从「智能体库」选一个装,只装它的东西)**:① **`pack.engine` 新增两项**:`agents/catalog.json`(L0 货架声明:agent → capability + flows 子集 + 角色 + 插件/技能/集成/凭据槽)与 `scripts/argent-agents.mjs`(声明解析/校验/清单构造;安装器与门禁**共用一份**判据)⇒ 引擎清单与每包内的注册表投影都变了(**无 flow 的 hr 也变**,按「内容变 ⇒ 版本必变(含无 flow 的包)」这条不变式一起提版本);② **共用引擎行为变更**(`install-argent.mjs` / `scripts/lib/preset-install.mjs` / `scripts/argent-upgrade.mjs`):新增 `--agent <id>[,<id>…]` / `--list-agents` / `--internal-roles` / `--capability remove <id>`(写前备份 + 审计);preset **行落盘集合**改为「按清单收窄」(`--agent` ⇒ 恒装 + 本智能体角色 + 已装集;默认 ⇒ 客户可见集 + 已装集;**内部角色默认不落**);升级器按 `<dshHome>/argent/agents.json` **重新施加**同一集合(否则一次升级就把收窄还原);**未给 `--agent` 时 CLI 契约与计划清单输出与改动前逐字一致**(差分回归钉住);③ 本能力自身:**新增活的 HR 角色** `presets/argent-hr/`(招聘支持 / 员工关系 / PPT 与文档产出 / 员工隐私严格保密)+ `pack.presets` 收它 ⇒ 本能力从「只有墓碑」变成「有入口」;设置页入口字段由 `hrOfficeRole`(hr-office) 改为 `hrRole`(argent-hr),旧角色改用 `hrOfficeTombstone` 字段如实报告(⛔ 墓碑不复活、⛔ 不当入口,仍随包落位供老会话 agentPreset 外键解析)。回归:`scripts/tests/agent-catalog.test.mjs`(110 断言,七条判据:只落本智能体 / 子集过滤 / 向后兼容差分 / 未知输入零写入 / remove 备份+审计 / 目录 schema / 内部角色默认不落)。|**0.1.50(2026-10-10,同批二次收口:宿主资产声明 + 门禁)**:同一工作树里第二次收口(先落 `--agent` 实现并盖章,再补 `capabilities.<c>.pack.hostAssets`(**宿主侧资产声明位**:定时器/登录自启/桌面项)与它的门禁 C12,并把 `scripts/argent-agents.mjs` 的清单/回执接上宿主资产)⇒ 引擎面文件内容变了,按「内容变 ⇒ 版本必变」纪律**再提一版**(先例同 1.3.104→1.3.105、`docs/Argent-智能体平台-设计.md` §8.3 第 3 条)。版本号 0.1.49 从未发布过,不存在「内容变了版本没动」的对外窗口。⛔ 本能力的流程/提示词/脚本内容未再改动。|**0.1.51(2026-10-10,同批三次收口:安装器用法文案 · 门禁登记 · 引擎面去业务词)**:同一工作树里第三次收口 —— ① `install-argent.mjs` 的**用法头注释**补上 `--agent` / `--list-agents` / `--internal-roles` / `--capability remove` 四个入口(内容变 ⇒ 引擎 sha 变);② `scripts/tests/is-direct-run.test.mjs` 的**唯一登记处**加入 `scripts/check-agent-catalog.mjs`(新增 CLI 必须登记,否则端到端判据覆盖不到它;测试文件不在包内,本条只为留痕);③ 本文件里本批新加的 `_note` 文案去掉业务词(`vertical-lint` 的 engine-words 档按**基线**只拦新增,⛔ 不抬基线 ⇒ 改写文案而不是改基线)⇒ 引擎面内容再变,按纪律**再提一版**。版本号 0.1.50 从未发布过,不存在「内容变了版本没动」的对外窗口。⛔ 本能力的流程/提示词/脚本内容未再改动。|**0.1.52(2026-10-10,仓容前置探测批 —— 注册表投影变化,hr 必须跟随提版)**:本批改了共用引擎面 `scripts/flow-requirements.json`(新增 `failureClasses.capacityFull`)、`scripts/flow_capacity*`/`ml_capacity_probe.py`、`flow_failure.py` 分类顺序、`configs/advanced.json`(`advanced.appointment.max_day` 默认 5)与编排器接入点 ⇒ **每个包的 tgz 里都带一份注册表投影**(含 `failureClasses`/`pack.engine`)⇒ hr 的包字节随之改变。本能力自身内容一字未改(`files` 仍只有两个 preset 目录)。⚠️ **教训**:本批曾按 `--describe hr`(只列 6 个 preset 文件)判定\"hr 不含 pack.engine ⇒ 内容没变\",漏掉了\"注册表投影在包内\"这一层 ⇒ 被 `release-argent.sh --check-dl` 当场抓成 `✗ hr: 版本相同(0.1.51)但内容摘要不同 ⇒ 同版本覆盖发布的形态`;按不变式提版后该条转为 ⚠「发布在途」。先例:0.1.42 / 0.1.44 / 0.1.46(均为\"改了引擎基表 ⇒ 无 flow 的包也提版本\")。|**0.1.55(2026-10-11,同批:引擎面新增 `scripts/lib/cdp_ports.py`)**:本能力**无 flow ⇒ 不背共用引擎**(`files` 仍只有两个 preset 目录,逐字节未变);但包内注册表投影含 `pack.engine` ⇒ 包字节变了,按「内容变 ⇒ 版本必变(含无 flow 的包)」提版本并重盖章(同 `0.1.42` / `0.1.52` 先例)。本能力内容一字未改。|**0.1.56(2026-10-12,Windows 安装路径三缺陷修复批)**:共用引擎变更(引擎面文件 ⇒ 每个包的注册表投影都变)——① `scripts/lib/preset-install.mjs`:**「已装集」判据改为选择痕迹** `presets.selection.json#kept`(⛔ 不再读 `package.json#dsh.bundle.patch` —— pnpm 对 `file:` 依赖建的是指向货架的链,读到的永远是货架自带的 14 条 ⇒ 收窄被自己的安装步骤抹掉),新增 `installedSelectionIds()` / `materializeBundleDir()`(软链**实体化**后再改写,⛔ 不走链写进仓库)/ `checkPresetSelectionConsistency()`(patch 实体 == presets.json 行 == dsh.bundle.patch == 痕迹);② `install-argent.mjs`:新增**第 7c2 步收尾重施**(第 7 步 `pnpm add file:…` 会把 profile 副本换回货架 14 个 ⇒ 旧实现在 winpc 真机\"声称只落 7/14、装完却是 14\",7 个内部角色永久留下)、版本体检改**两个候选落点**(克隆目录 + 安装器自己那棵树 —— Windows 的 boot 克隆场景,此前永远退回内置列表 ⇒ 现役 `0.1.7-rc.2` 被报\"未验证\")、`profile-doctor` 与升级器子进程**显式传 `DSH_HOME`**(否则 `--dsh-home <临时>` 时改的是真实 `~/.dsh`)、完成提示**按平台**给启动/重启指引(Windows 不再打 bash 的 `DSH_HOME=… dsh web …`);③ `scripts/lib/dsh-versions.mjs`:内置基线补 `0.1.7-rc.2` + 新增 `verifiedListGaps()` **防漂移门禁**;④ `scripts/argent-upgrade.mjs`:同一判据 + 收尾重施。⇒ 按「内容变 ⇒ 版本必变(含无 flow 的包)」四个包一起提版本并重盖章。本能力内容**一字未改**(无 flow ⇒ 不背共用引擎,仍因包内注册表投影而变)。回归:`scripts/tests/preset-landing-selection.test.mjs`(48 断言:全新机器恰 7 个客户可见角色 / 客户机的 7 再跑安装**仍 7**(垫片 pnpm 中途真把它放大过)/ 14 坏态收窄到 7 / 三处集合+痕迹不变量 / 软链不走链改写仓库 / 真 pnpm 的机制证据)、`scripts/tests/dsh-verified-list.test.mjs`(21 断言:lock 里已晋级版本必须全在列表内(构造缺项 ⇒ 红)、`candidate/` 不参与、列表唯一真源、boot 克隆场景真跑一次)。⛔ 本批**未发布**(发布留给交付方)。|**0.1.57(2026-10-12,升级路径角色落盘追修批:已装集唯一来源 + 内部角色不变式)**:本能力**无 flow ⇒ 不背共用引擎**(`files` 仍只有 preset 目录,逐字节未变);但包内注册表投影含 `pack.engine` ⇒ 包字节变了,按「内容变 ⇒ 版本必变(含无 flow 的包)」一起提版本并重盖章(同 `0.1.42` / `0.1.52` 先例)。本能力内容**一字未改**。① `scripts/lib/preset-install.mjs`:「已装集」的**唯一来源**收口到 `resolveInstalledSelection()`(**可信痕迹** `presets.selection.json#kept` → 退回 `agents.json` 里各 agent 的 `roles` 并集 → 两级都没有 ⇒ **空集**=首次安装语义;⛔ **绝不**把 profile 里的 patch 实体 / `presets.json` 行 / `dsh.bundle.patch` 条目当已装集 —— 那三份铺完恒是 14,「客户可见 ∪ 已装 ∪ 本智能体」于是恒等于 14,收窄被自己的安装步骤抹掉),并给「可信」加了**判据**:痕迹含 `visibility: internal` 的角色而本机 `internalRoles ≠ true`(且未给 `--internal-roles`)⇒ 判不可信、**响亮报告**后按「痕迹缺失」处理(现场那份 `kept:14/excluded:[]` 的痕迹正是放大缺陷写出来的);新增**不变式** `checkNoInternalLanding()` —— 落盘集合不得含内部角色(除非 `--internal-roles` 或 `agents.json#internalRoles === true`),违反 ⇒ `applyPresetSelection()` **判红并拒绝写出**(⛔ 不静默剔除、不静默修);新增 `reseedBundleDir()` 与 `applyPresetSelection({reseedFromShelf})`(收尾重施必须**按货架重播再收窄**:副本已被削到 7 时就地再过滤永远只能得 7,`--internal-roles` 装不回来、自检还会拿「期望 14 ≠ 落盘 7」判**假红**);② `scripts/argent-upgrade.mjs`:**升级档与安装档同一条公式**(客户可见集 ∪ 可信已装集 ∪ 本智能体角色),⛔ 不再用 `agentScoped: agents.length>0`(它把客户可见集整个排除掉 ⇒ 现场那台只落 2 个角色);第 7.6 步收尾重施带 `allowInternal` + `reseedFromShelf`,判红即该步 `ok:false`;③ `install-argent.mjs`:第 4 步默认档 / `--agent` 子集 / 第 7c2 步收尾重施 / `--capability remove` 四处统一走可信已装集与授权口径(`--capability remove` 只为「本机已合法装了内部角色」时不误判红);④ **新增只读 CLI** `scripts/check-preset-landing.mjs`(四件套 + 已装集来源 + 两条不变式,任何一台机器可照抄自查,⛔ 不写任何文件)⇒ `pack.engine` 登记项 +1。**现场(winpc 真机,2026-10-12)**:profile 14 个 patch 实体 + 痕迹 `kept:14/excluded:[]` + `agents.json=[hr]` + `internalRoles=false`,重跑官网一条命令(升级路径)修前打的是 `preset 同步(行式): **14** 个角色` + `角色落盘集合收尾:14 个;三处集合 + 痕迹一致`(7 个内部角色一个没摘),修后同一台机器 ⇒ **7**(`excluded` 列出 7 个内部角色)并打印 `选择痕迹不可信 ⇒ 已装集退回 agents.json 角色`。回归:`scripts/tests/preset-landing-upgrade-path.test.mjs`(43 断言:现场复刻升级路径 ⇒ 7 且 **pre-fix 判据重建得 14**(鉴别力)/ `agents.json` 缺失 ⇒ 7 / 可信痕迹 7 不许放大 / `internalRoles:true` ⇒ 14 放行 / **不变式负样本判红且零写入** / 「铺货架 ≠ 选择」/ 现场真形态 `kept:14` ⇒ 7 且响亮报告 / 真 home 零增量)。⛔ 本批**未发布**(发布留给交付方)。|**0.1.59(2026-10-12,P1-A 宿主排程批:四道闸防线 + 日报试点声明)**:本能力的流程/提示词/脚本**一字未改**;共用引擎面变更(`scripts/flow_config.py` 新增 trigger.schedule 解析、`scripts/vertical-lint.mjs` 新增排程声明门禁、`scripts/lib/registry.mjs` 新增只读 flowSchedule())与**包内注册表投影**变化(业务线声明只动了日报;新增的 L1 `scripts/lib/schedule-probe.mjs` 与 L2 `scripts/argent-schedule.mjs` **刻意不进 pack.engine**,理由见 daily-report 的 `_note`)⇒ 按「内容变 ⇒ 版本必变(含无 flow 的包)」一起提版本并重盖章。新增回归 `scripts/tests/schedule-probe.test.mjs` / `scripts/tests/schedule-declaration.test.mjs`。|**0.1.62(2026-10-12,宿主门禁追修批:⛔ 不代装宿主 + npx 形态纳入宿主解析)**:共用引擎变更(引擎面文件 ⇒ 每个包的注册表投影都变,**含无 flow 的 hr**)——① `install-argent.mjs`:**删除** `--install-host` 代装入口(连同旧自动代装函数与宿主离线包的下载/解包/bin 链接逻辑;开关若仍被传入 ⇒ 报「该开关已废弃」+ **非零退出**(1 = 用法错误),⛔ 不静默忽略),被拒文案改为按 dsh **官方**运行方式给指引(首选 `npx @deepseek-ai/dsh@<窗口内版本> web`;备选官方「从源码运行」;四要素:① 你的版本不在支持窗口(列窗口)② 官方方式换成窗口内版本的一行命令 ③ 我们正在适配你的版本(⛔ 不给对外 ETA)④ 未改动你的 dsh);② **新增** `scripts/lib/dsh-host-resolve.mjs`(**进 `pack.engine`**):宿主解析链 = **PATH 上的 `dsh` → `DSH_BIN` → npx 缓存形态**(读 `<npm cache>/_npx/<hash>/node_modules/@deepseek-ai/dsh/package.json` 的 version,纯只读零网络;多候选按「最近使用优先(mtime 最新)+ 同刻路径升序」确定并**打印选了哪个**)⇒ **npx 形态算宿主**(旧口径「npx 不等于已安装宿主」作废),且 npx 形态下插件装配走**同一条 launcher**(`npx --yes @deepseek-ai/dsh@<版本> plugin --profile web add file:…`),⛔ 不许「检测到 npx 却去用 PATH 上的另一个 dsh」;③ `install.sh` / `install.ps1` 口径同步(ps1 仍声明并透传 `-InstallHost`,只为让旧命令行得到**可读**的「已废弃」原因而不是参数绑定错误)。本能力自身流程 / 提示词 / 脚本**一字未改**。回归 `scripts/tests/install-host-gate.test.mjs`(**219 断言**,纯夹具:垫片 dsh/npx + 本地裸库 + 临时 home,⛔ 零外网、⛔ 不碰真 `~/.dsh`;⚠️ `dsh plugin` 会绕过 `DSH_HOME`/`HOME` ⇒ 夹具只断言命令行、绝不真跑)。⛔ 本批**未发布**(发布留给交付方)。",
448
448
  "2026-10-12:仓容前置探测**误报**修复(判据收紧为「严格阻断形态」+ 手动/CLI 跑完落终态台账);注册表投影在每个包内 ⇒ 四包一起提版重盖。",