@moonquake2004/dsh-doctor 0.4.16 → 0.4.18

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.
Files changed (2) hide show
  1. package/dsh-doctor.mjs +26 -3
  2. package/package.json +1 -1
package/dsh-doctor.mjs CHANGED
@@ -240,7 +240,9 @@ function resolveProfile(name) {
240
240
  }
241
241
 
242
242
  /* ================= env ================= */
243
- /** v1 词汇表 r5(#1719)node 语义:pass = 满足 ^22.19.0 || >=24.0.0(root package.json engines),其余 warn——无民间 fail 阈值。 */
243
+ /** v1 词汇表 r5(#1719/#2259)node 语义:pass = 满足 ^22.19.0 || >=24.0.0,其余 warn——无民间 fail 阈值。
244
+ * 注(2026-09 更正):该范围来自 v1 词汇表对齐,**不是**从某个 package.json 读来的;
245
+ * 已发布的 `@deepseek-ai/dsh@0.1.5-rc.1` **不含 engines 字段**,此前文案写"root package.json engines"属出处误引。 */
244
246
  function nodeInSupportedRange(v) {
245
247
  const m = /^v?(\d+)\.(\d+)\.(\d+)/.exec(String(v));
246
248
  if (!m) return false;
@@ -264,8 +266,8 @@ function checkEnv() {
264
266
  const version = String(nv.stdout).trim();
265
267
  const supported = nodeInSupportedRange(version);
266
268
  report('env', 'E3-node', supported,
267
- supported ? `node ${version}(满足 ^22.19.0 || >=24.0.0,root package.json engines)` : `node ${version} 不在支持范围(^22.19.0 || >=24.0.0)——会话日志读取等能力受限`,
268
- supported ? undefined : '升级 node 到 ^22.19.0 或 >=24.0.0(root package.json engines,见 #2259)');
269
+ supported ? `node ${version}(满足 v1 词汇表支持范围 ^22.19.0 || >=24.0.0;该版本未发布 engines 字段,#2259)` : `node ${version} 不在支持范围(^22.19.0 || >=24.0.0,v1 词汇表)——会话日志读取等能力受限`,
270
+ supported ? undefined : '升级 node 到 ^22.19.0 或 >=24.0.0(v1 词汇表范围,见 #2259)');
269
271
  }
270
272
 
271
273
  // E12:运行时 zstd 稳定性(#6651 的运行时线索)
@@ -573,6 +575,26 @@ function checkProfile(name) {
573
575
  }
574
576
  if (bad.length) report('profile', 'P3', false, `用户 patch 中不可解析的 name(#1197/#880): ${bad.join(', ')}`, `dsh plugin --profile ${name} add <包> 或修复 file: 依赖`);
575
577
  else report('profile', 'P3', true, '用户 patch insert 均可解析', undefined);
578
+ // P18:profile manifest 的 version(#6667)
579
+ // 锚点:dsh-plugin-package-inventory-deepseek/lib/index.js:34 —— identityFromManifest 会抛
580
+ // `must declare non-empty name and version`;它虽有 allowAnonymous 容忍**缺 name**,但**不容忍缺 version**。
581
+ // 而 harness 自己生成的 profile manifest 恰恰是「有 name、无 version」(本机 web/daily 皆如此)。
582
+ // 触发条件:从 profile 根解析到**游离本地模块**时,最近的 manifest(即 profile 自身)会被当包处理 → 抛错 →
583
+ // DeepSeek 请求以 REQUEST_EXTENSION 失败(#6667 报告的最小复现)。故这里按"条件性风险"报 warn,不报 fail。
584
+ {
585
+ let profManifest = null;
586
+ try { profManifest = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8')); } catch { profManifest = null; }
587
+ if (!profManifest || !(profManifest.dsh && profManifest.dsh.profile)) {
588
+ reportSkip('profile', 'P18', '未找到 profile manifest(无 dsh.profile),跳过 version 检查');
589
+ } else if (typeof profManifest.version === 'string' && profManifest.version.length > 0) {
590
+ report('profile', 'P18', true, `profile manifest 声明了 version(${profManifest.version}),不触发 #6667`);
591
+ } else {
592
+ report('profile', 'P18', false,
593
+ `profile manifest 有 name(${profManifest.name})但**没有 version**——与 #6667 的条件一致:package inventory 在解析**游离本地模块**时会把该 manifest 当包处理并抛 "must declare non-empty name and version"(dsh-plugin-package-inventory-deepseek:34;其 allowAnonymous 只容忍缺 name),表现为 DeepSeek 请求 REQUEST_EXTENSION 失败`,
594
+ '上游修复前可先给 profile manifest 补一行 version(如 "version": "0.0.0")作为绕过;若有游离 .mjs/.js 模块被加载,这是首要排查点');
595
+ }
596
+ }
597
+
576
598
  // P4 file: 依赖悬空(file: 目标可能是相对(file:./plugins/x)或绝对(file:/abs/path))
577
599
  const resolveFileSpec = (spec) => {
578
600
  const target = spec.slice(5);
@@ -1616,6 +1638,7 @@ catalogSeverity.set('P14', 'warn');
1616
1638
  catalogSeverity.set('P15', 'error');
1617
1639
  catalogSeverity.set('P16', 'warn');
1618
1640
  catalogSeverity.set('P17', 'warn');
1641
+ catalogSeverity.set('P18', 'warn'); // #6667:条件性风险(需游离本地模块才触发),提示但不翻退出码
1619
1642
 
1620
1643
  function bundledCatalog() {
1621
1644
  const p = new URL('./checks.json', import.meta.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonquake2004/dsh-doctor",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "description": "Offline diagnostic for DeepSeek Harness — 28 built-in + 5 catalog checks across env/profile/session (Layer A checks-as-data), self-update (Layer B), and a semi-automatic LLM observer (Layer C, --observe); Doctor panel in web UI settings.",
5
5
  "main": "lib/index.js",
6
6
  "files": [