@moonquake2004/dsh-doctor 0.4.17 → 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.
- package/dsh-doctor.mjs +21 -0
- package/package.json +1 -1
package/dsh-doctor.mjs
CHANGED
|
@@ -575,6 +575,26 @@ function checkProfile(name) {
|
|
|
575
575
|
}
|
|
576
576
|
if (bad.length) report('profile', 'P3', false, `用户 patch 中不可解析的 name(#1197/#880): ${bad.join(', ')}`, `dsh plugin --profile ${name} add <包> 或修复 file: 依赖`);
|
|
577
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
|
+
|
|
578
598
|
// P4 file: 依赖悬空(file: 目标可能是相对(file:./plugins/x)或绝对(file:/abs/path))
|
|
579
599
|
const resolveFileSpec = (spec) => {
|
|
580
600
|
const target = spec.slice(5);
|
|
@@ -1618,6 +1638,7 @@ catalogSeverity.set('P14', 'warn');
|
|
|
1618
1638
|
catalogSeverity.set('P15', 'error');
|
|
1619
1639
|
catalogSeverity.set('P16', 'warn');
|
|
1620
1640
|
catalogSeverity.set('P17', 'warn');
|
|
1641
|
+
catalogSeverity.set('P18', 'warn'); // #6667:条件性风险(需游离本地模块才触发),提示但不翻退出码
|
|
1621
1642
|
|
|
1622
1643
|
function bundledCatalog() {
|
|
1623
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.
|
|
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": [
|