@moonquake2004/dsh-doctor 0.3.1 → 0.3.3
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/README.md +1 -0
- package/README.zh.md +1 -0
- package/dsh-doctor.mjs +35 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ With `--envelope` (doctor-contract mode): `0` = all pass · `1` = any WARN · `2
|
|
|
47
47
|
| P4 | `file:` dependencies intact | [#1197](https://github.com/deepseek-ai/deepseek-harness/discussions/1197) |
|
|
48
48
|
| P5 | no top-level `@deepseek-ai/*` duplication (dual module instances) | [#1486](https://github.com/deepseek-ai/deepseek-harness/discussions/1486), [#1697](https://github.com/deepseek-ai/deepseek-harness/discussions/1697) |
|
|
49
49
|
| P7 | `cordis.patch.yml` structural lint (`~ insert:` null-literal typo, tab indentation, missing colon → UI won't boot) | [#1724](https://github.com/deepseek-ai/deepseek-harness/discussions/1724) |
|
|
50
|
+
| P12 | profile-installed bundle version vs running CLI (warn on divergence; the web "Doctor" panel / `/dsh-doctor/run` API runs the bundle) | [#1719](https://github.com/deepseek-ai/deepseek-harness/discussions/1719) v1.1 `installed_bundle` |
|
|
50
51
|
|
|
51
52
|
### session
|
|
52
53
|
| ID | Checks | Discussion |
|
package/README.zh.md
CHANGED
|
@@ -42,6 +42,7 @@ node dsh-doctor.mjs --no-catalog # 不拉远程目录(只用内置副
|
|
|
42
42
|
| P4 | `file:` 依赖完整 | [#1197](https://github.com/deepseek-ai/deepseek-harness/discussions/1197) |
|
|
43
43
|
| P5 | 顶层无 `@deepseek-ai/*` 重复(双模块实例) | [#1486](https://github.com/deepseek-ai/deepseek-harness/discussions/1486), [#1697](https://github.com/deepseek-ai/deepseek-harness/discussions/1697) |
|
|
44
44
|
| P7 | `cordis.patch.yml` 结构 lint(`~ insert:` null 字面量、tab 缩进、缺冒号、顶层映射+序列混排 → UI 打不开) | [#1724](https://github.com/deepseek-ai/deepseek-harness/discussions/1724) |
|
|
45
|
+
| P12 | profile 内 bundle 版本 vs 运行 CLI(分歧 warn;web「诊断」面板 / `/dsh-doctor/run` API 跑的是 bundle) | [#1719](https://github.com/deepseek-ai/deepseek-harness/discussions/1719) v1.1 `installed_bundle` |
|
|
45
46
|
|
|
46
47
|
### session
|
|
47
48
|
| ID | 检查 | 对应讨论 |
|
package/dsh-doctor.mjs
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* P9 ctx.settings 未声明 inject: ['settings'](#1904⑤:先于 settings 就绪激活 → namespace not registered)
|
|
15
15
|
* P10 inject 引用客户端专属服务(#1947:@deepseek-ai/dsh-client-* 服务端永不提供 → Fiber 永久 PENDING → web boot 失败)
|
|
16
16
|
* P11 已装 bundle 的 main 入口产物缺失(#1965:市场装未构建源码树 → ERR_MODULE_NOT_FOUND → boot 崩)
|
|
17
|
+
* P12 profile 内 bundle 版本 vs 运行 CLI 版本(#1719 v1.1 `installed_bundle` 候选:web 面板/API 跑的是 profile 里装的 bundle,可与独立 CLI 版本不一致)
|
|
17
18
|
* [session]
|
|
18
19
|
* S1 孤儿 tool_call(#1363:assistant tool_calls 无对应 tool 结果 → INVALID_REQUEST)
|
|
19
20
|
* S2 未闭合 turn(#466/#1265:turn/start 无 turn/end → 会话永久"运行中")
|
|
@@ -530,6 +531,38 @@ function checkProfile(name) {
|
|
|
530
531
|
}
|
|
531
532
|
if (entryIssues.length) report('profile', 'P11', false, `已装 bundle 的 main 入口缺失(#1965:市场装源码不跑构建 → ERR_MODULE_NOT_FOUND → dsh web boot 崩溃): ${entryIssues.join('; ')}`, '在插件目录跑构建(pnpm install && pnpm run build 产出 main 指向的文件),或改用打包好的 npm 包安装;monorepo 插件需装子包(dsh-market #18 同族)');
|
|
532
533
|
else report('profile', 'P11', true, '已装 bundle 的 main 入口产物均在', undefined);
|
|
534
|
+
|
|
535
|
+
// P12:profile 内 bundle 版本 vs 运行 CLI 版本(#1719 v1.1 `installed_bundle` 候选)
|
|
536
|
+
// web 设置「诊断」面板与 /dsh-doctor/run API 跑的是 profile 里装的 bundle;独立 CLI(checkout/npx)是另一个副本——
|
|
537
|
+
// Layer-B 自更新只比 npm latest vs 运行模块,profile 内 bundle 落后/超前都不报警(dsh-win32/bundle 同坑,sjh9714 先发现的)。
|
|
538
|
+
// 语义(#1719 合稿,sjh9714 四态分析):pass/warn 两态 + detail 注明条件——
|
|
539
|
+
// manifest 未声明 = pass(CLI 独立运行);manifest 声明但 node_modules 缺失 = warn(manifest 撒谎,运行时从不加载);
|
|
540
|
+
// 已装且版本一致 = pass;已装但版本分歧 = warn(detail 含 age-gate 提示,升级可能被 pnpm-workspace.yaml 的
|
|
541
|
+
// minimumReleaseAgeExclude 年龄门暂缓一天,指令不再静默无效——sjh9714 实测)。
|
|
542
|
+
try {
|
|
543
|
+
const selfName = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).name ?? '@moonquake2004/dsh-doctor';
|
|
544
|
+
const listed = Object.keys(deps).some((k) => k === selfName || k === 'dsh-doctor');
|
|
545
|
+
// 安装形态两种都找:npm scoped 名(@moonquake2004/dsh-doctor)与 file: 依赖的裸名(dsh-doctor)
|
|
546
|
+
let bundlePkg = null;
|
|
547
|
+
for (const cand of [selfName, 'dsh-doctor']) {
|
|
548
|
+
const p = join(dir, 'node_modules', cand, 'package.json');
|
|
549
|
+
if (existsSync(p)) { bundlePkg = p; break; }
|
|
550
|
+
}
|
|
551
|
+
if (!listed && !bundlePkg) {
|
|
552
|
+
report('profile', 'P12-bundle-version', true, 'profile 未声明也未安装 dsh-doctor bundle,跳过版本对比(CLI 独立运行)', undefined);
|
|
553
|
+
} else if (listed && !bundlePkg) {
|
|
554
|
+
report('profile', 'P12-bundle-version', false, `profile 的 package.json 声明了 ${selfName} 依赖,但 node_modules 里没有对应包(manifest 与运行时不一致,web 面板/API 实际加载不到)`, `dsh plugin --profile ${name} install ${selfName}(或先移除该依赖再重装)`);
|
|
555
|
+
} else {
|
|
556
|
+
const bundleVersion = JSON.parse(readFileSync(bundlePkg, 'utf8')).version;
|
|
557
|
+
const cliVersion = localVersion();
|
|
558
|
+
const same = bundleVersion === cliVersion;
|
|
559
|
+
report('profile', 'P12-bundle-version', same,
|
|
560
|
+
same ? `profile 内 bundle 版本 ${bundleVersion} 与运行 CLI ${cliVersion} 一致` : `profile 内 bundle 版本 ${bundleVersion} ≠ 运行 CLI ${cliVersion}(web 面板/API 跑的是 bundle,两边行为可能不一致;若刚发布过新版本,升级可能被 pnpm-workspace.yaml 的 minimumReleaseAgeExclude 年龄门暂缓,可次日重试)`,
|
|
561
|
+
same ? undefined : `同步安装版本:dsh plugin --profile ${name} update ${selfName}(或让 CLI 与 bundle 走同一安装方式)`);
|
|
562
|
+
}
|
|
563
|
+
} catch (e) {
|
|
564
|
+
report('profile', 'P12-bundle-version', false, `bundle 版本对比异常: ${e.message.slice(0, 60)}`, undefined);
|
|
565
|
+
}
|
|
533
566
|
}
|
|
534
567
|
|
|
535
568
|
/* ================= session ================= */
|
|
@@ -762,9 +795,10 @@ function scanAllSessions() {
|
|
|
762
795
|
const REMOTE_CATALOG_URL = 'https://raw.githubusercontent.com/moonquake2004/dsh-doctor/main/plugin/checks.json';
|
|
763
796
|
const CATALOG_TTL_MS = 6 * 60 * 60 * 1000; // 6h:新检查最长 6h 内自动生效
|
|
764
797
|
const catalogSeverity = new Map(); // catalog 检查 id → severity('error' | 'warn')
|
|
765
|
-
// v1 词汇表 r5 对齐(#1719):E1-pnpm 缺失=warn(corepack 可恢复)、E3-node 越界=warn(EBADENGINE
|
|
798
|
+
// v1 词汇表 r5 对齐(#1719):E1-pnpm 缺失=warn(corepack 可恢复)、E3-node 越界=warn(EBADENGINE 语义)、P12 bundle 版本分歧=warn(v1.1 `installed_bundle` 候选)——均不翻退出码
|
|
766
799
|
catalogSeverity.set('E1-pnpm', 'warn');
|
|
767
800
|
catalogSeverity.set('E3-node', 'warn');
|
|
801
|
+
catalogSeverity.set('P12-bundle-version', 'warn');
|
|
768
802
|
|
|
769
803
|
function bundledCatalog() {
|
|
770
804
|
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.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Offline diagnostic for DeepSeek Harness — 25 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": [
|