@luolingp/request-doctor 0.12.3 → 0.12.4

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
 
3
3
  **产品名称**:request-doctor(请求急救员)
4
4
  **产品标识**:request-doctor
5
- **版本**:0.12.3
5
+ **版本**:0.12.4
6
6
 
7
7
  ---
8
8
 
@@ -1,7 +1,7 @@
1
1
  # 软件设计说明
2
2
 
3
3
  **产品名称**:request-doctor(请求急救员)
4
- **版本**:0.12.3
4
+ **版本**:0.12.4
5
5
  **编制依据**:GB/T 8567-2006《计算机软件文档编制规范》6.2
6
6
 
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  # 软件测试报告
2
2
 
3
3
  **产品名称**:request-doctor(请求急救员)
4
- **版本**:0.12.3
4
+ **版本**:0.12.4
5
5
  **编制依据**:GB/T 8567-2006《计算机软件文档编制规范》6.6;GB/T 8566-2007 验证与确认过程
6
6
 
7
7
  ---
@@ -62,8 +62,8 @@
62
62
  | `test/client-half.test.mjs` | 5 | 客户端半:模块身份、注入声明、apply 注册、组件能渲染 |
63
63
  | `test/diagnostics.test.mjs` | 3 | 快照可选写入:不配置不写盘、突发合并、坏路径不致命 |
64
64
  | `test/restart-notice.test.mjs` | 3 |
65
- | `test/verdict-report.test.mjs` | 13 | why 与 list:判定、理由、环境、自动扫描、扫描中不误报 | 缺导出判为需要重启;其它失败不误判;多次累积不覆盖 |
66
- | **合计** | **174** | **全部通过** |
65
+ | `test/verdict-report.test.mjs` | 15 | why 与 list:判定、理由、环境、自动扫描、扫描中不误报 | 缺导出判为需要重启;其它失败不误判;多次累积不覆盖 |
66
+ | **合计** | **176** | **全部通过** |
67
67
 
68
68
  执行结果:
69
69
 
@@ -213,4 +213,4 @@
213
213
 
214
214
  ### 7.2 分文件执行结果
215
215
 
216
- 31 个测试文件逐个单独执行,每个都有用例且全部通过,不存在因导入失败而静默跳过的文件。用例数分布:compat.test.mjs 17、plugin.test.mjs 15、compat-env.test.mjs 14、classify.test.mjs 13,其余按职能分散,合计 174。
216
+ 31 个测试文件逐个单独执行,每个都有用例且全部通过,不存在因导入失败而静默跳过的文件。用例数分布:compat.test.mjs 17、plugin.test.mjs 15、compat-env.test.mjs 14、classify.test.mjs 13,其余按职能分散,合计 176。
@@ -1,7 +1,7 @@
1
1
  # 软件安装部署说明
2
2
 
3
3
  **产品名称**:request-doctor(请求急救员)
4
- **版本**:0.12.3
4
+ **版本**:0.12.4
5
5
  **编制依据**:GB/T 8567-2006《计算机软件文档编制规范》6.7
6
6
 
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  # 软件用户手册
2
2
 
3
3
  **产品名称**:request-doctor(请求急救员)
4
- **版本**:0.12.3
4
+ **版本**:0.12.4
5
5
  **编制依据**:GB/T 8567-2006《计算机软件文档编制规范》6.5
6
6
 
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  # 软件质量度量报告
2
2
 
3
3
  **产品名称**:request-doctor(请求急救员)
4
- **版本**:0.12.3
4
+ **版本**:0.12.4
5
5
  **度量标准**:GB/T 45717-2025《信息技术 软件测量 软件质量测量 自动化的源代码质量测度》
6
6
  **度量工具**:`tools/quality-measure.mjs`(本仓库自带,可复现)
7
7
 
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "standard": "GB/T 45717-2025 信息技术 软件测量 软件质量测量 自动化的源代码质量测度",
3
- "generatedAt": "2026-10-29T15:23:43.097Z",
3
+ "generatedAt": "2026-10-29T15:30:57.373Z",
4
4
  "scope": {
5
5
  "files": 31,
6
- "totalLines": 5103,
7
- "sourceLines": 3706,
8
- "commentLines": 930
6
+ "totalLines": 5113,
7
+ "sourceLines": 3712,
8
+ "commentLines": 932
9
9
  },
10
10
  "measures": {
11
- "commentDensity": 25.09,
12
- "duplicationPercent": 4.91,
13
- "functionCount": 385,
11
+ "commentDensity": 25.11,
12
+ "duplicationPercent": 4.96,
13
+ "functionCount": 386,
14
14
  "maxComplexity": 10,
15
15
  "maxFunctionLines": 59,
16
16
  "maxFileLines": 500,
@@ -18,12 +18,22 @@ import { ensureAudited } from './scan-bridge.js';
18
18
  // @param {string} name - 插件包名。
19
19
  // @param {object} deps - 组合根传进来的依赖,只需要 diagnostics。
20
20
  // @returns {{kind: string, text: string}} 命令结果。
21
- export function explainVerdict(name, deps) {
21
+ export async function explainVerdict(name, deps) {
22
22
  if (name === '') return { kind: 'error', text: 'usage: /doctor why <包名>' };
23
- const audited = auditedOf(deps);
24
- const hit = audited.find((item) => item.name === name);
25
- if (hit === undefined) return { kind: 'error', text: missingText(name, audited) };
26
- return { kind: 'success', text: linesText(reportLines(hit)) };
23
+ const found = find(name, deps);
24
+ if (found !== undefined) return { kind: 'success', text: linesText(reportLines(found)) };
25
+
26
+ // 和 list 一样:没有扫描结果就先扫一轮,正在扫就告诉用户等一下。
27
+ const state = await ensureAudited(deps.versionRepair);
28
+ if (state.busy === true) return { kind: 'success', text: BUSY_TEXT };
29
+ const again = find(name, deps);
30
+ if (again !== undefined) return { kind: 'success', text: linesText(reportLines(again)) };
31
+ return { kind: 'error', text: missingText(name, auditedOf(deps)) };
32
+ }
33
+
34
+ // 在最近一轮审计里按包名找一条。
35
+ function find(name, deps) {
36
+ return auditedOf(deps).find((item) => item.name === name);
27
37
  }
28
38
 
29
39
  // 一条一条拼出结论:判定、理由、缺的符号、环境,最后给一句能照做的建议。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luolingp/request-doctor",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "description": "自动修复客户端引起的请求失败,并让版本不匹配的 DSH 插件能装上、能跑起来。",
5
5
  "keywords": [
6
6
  "dsh-plugin",