dsh-triage 0.3.4 → 0.3.6
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 +13 -13
- package/client.js +11 -2
- package/dist/audit-data.d.ts +1 -0
- package/dist/audit-data.d.ts.map +1 -1
- package/dist/audit-data.js +11 -2
- package/dist/audit-data.js.map +1 -1
- package/dist/cli.js +228 -9
- package/dist/cli.js.map +1 -1
- package/dist/host-audit-route.d.ts +25 -0
- package/dist/host-audit-route.d.ts.map +1 -1
- package/dist/host-audit-route.js +47 -9
- package/dist/host-audit-route.js.map +1 -1
- package/dist/host-summary-route.d.ts.map +1 -1
- package/dist/host-summary-route.js +2 -7
- package/dist/host-summary-route.js.map +1 -1
- package/dist/host-upgrade-route.d.ts.map +1 -1
- package/dist/host-upgrade-route.js +2 -7
- package/dist/host-upgrade-route.js.map +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +4 -0
- package/dist/host.js.map +1 -1
- package/dist/load.d.ts +18 -0
- package/dist/load.d.ts.map +1 -1
- package/dist/load.js +61 -8
- package/dist/load.js.map +1 -1
- package/dist/rescue.d.ts +156 -0
- package/dist/rescue.d.ts.map +1 -0
- package/dist/rescue.js +271 -0
- package/dist/rescue.js.map +1 -0
- package/dist/summary.d.ts +13 -0
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js +17 -1
- package/dist/summary.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# dsh-triage · 本地插件兼容分诊台
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**DeepSeek Harness (DSH) 插件本地诊断与升级预检工具**
|
|
4
4
|
*The diagnostic & pre-flight judgment layer for DeepSeek Harness (DSH) plugins.*
|
|
5
5
|
|
|
6
6
|
[](https://www.npmjs.com/package/dsh-triage)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
-
DSH
|
|
9
|
+
DSH 负责插件的下载与安装,但装好后会不会被准入规则拦截、升级后哪些插件会失效,原生日志往往不会直接给出归因。
|
|
10
10
|
|
|
11
|
-
`dsh-triage`
|
|
11
|
+
`dsh-triage` 是本地诊断与升级预检工具,用于定位插件静默失效的具体原因,并在升级前推演对当前插件组合的兼容性影响。
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -18,19 +18,19 @@ DSH 原生管理插件的下载与安装,但无法在安装前推演该插件
|
|
|
18
18
|
# 全局安装 CLI
|
|
19
19
|
npm install -g dsh-triage
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# 升级前预检:升到目标版本,当前已装插件哪些会被拦截
|
|
22
22
|
dsh-triage upgrade --to next --card
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# 一键体检:一屏查看当前环境状态与问题摘要
|
|
25
25
|
dsh-triage status
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# 逐行归因:定位插件被拦截或无法加载的具体准入原因
|
|
28
28
|
dsh-triage why
|
|
29
29
|
|
|
30
30
|
# 安装前预检:评估候选插件是否满足当前环境准入
|
|
31
31
|
dsh-triage check dsh-cost-meter
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# 查看台账:列出已装插件、声明槽位与服务映射
|
|
34
34
|
dsh-triage audit
|
|
35
35
|
|
|
36
36
|
# 启动本地可视化诊断面板
|
|
@@ -45,7 +45,7 @@ dsh-triage serve
|
|
|
45
45
|
dsh plugin --profile web add dsh-triage
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
装入当前 Profile 后,即可在 DSH **“设置页 → 兼容性分析”**
|
|
48
|
+
装入当前 Profile 后,即可在 DSH **“设置页 → 兼容性分析”** 查看可视化体检结论、问题列表与复制修复命令,或作为 Agent 工具(`compat_verdict`)供 AI 助手自检。
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
|
|
@@ -68,17 +68,17 @@ dsh plugin --profile web add dsh-triage
|
|
|
68
68
|
| `--strict` | 当存在非 `go` 结论时以退出码 1 退出 |
|
|
69
69
|
| `--profile <name>` | 指定分析的 Profile 名称(默认为 `web`) |
|
|
70
70
|
| `--dsh-home <path>` | 覆盖默认的 `$DSH_HOME` 路径 |
|
|
71
|
-
| `--to <version
|
|
71
|
+
| `--to <version|next>` | `upgrade` 命令中指定推演的目标版本 |
|
|
72
72
|
| `--card` | 输出 Markdown 格式的升级摘要卡片 |
|
|
73
73
|
| `--execute` | `probe` 命令中实际拉起隔离沙盒进程执行实测 |
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
77
|
-
##
|
|
77
|
+
## 工具边界 / Boundaries
|
|
78
78
|
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
79
|
+
- **不提供安全背书**:本工具聚焦于本地兼容性与准入规则推演,不替代恶意代码或供应链安全审计;
|
|
80
|
+
- **不修改用户 Profile**:不安装到你的 profile、不卸载现有插件;除独立的临时测试沙盒外,绝不修改 `~/.dsh` 配置;
|
|
81
|
+
- **无证据不猜**:信息不足时如实标为 `unknown`,每条结论均附带明确的证据类型。
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
package/client.js
CHANGED
|
@@ -40,6 +40,15 @@ window.__ModuleLoader__.load({
|
|
|
40
40
|
const SUMMARY_URL = '/compat-triage/summary'
|
|
41
41
|
/** T-818: the on-demand four-bucket answer, selected by a query on the route that works. */
|
|
42
42
|
const UPGRADE_URL = '/compat-triage/summary?upgrade=1'
|
|
43
|
+
/**
|
|
44
|
+
* M10: DSH Desktop forwards this tab's fetches through `forwardWebRequest()`, which deletes
|
|
45
|
+
* `origin` and `sec-fetch-site` before the request reaches the Host — so the route's same-origin
|
|
46
|
+
* guard saw "no evidence" and answered 403 to the one caller it exists for. This label is how a
|
|
47
|
+
* stripped request says which page it came from. It is not authentication (a cross-site page
|
|
48
|
+
* cannot send it without a CORS preflight, and the route never answers OPTIONS).
|
|
49
|
+
*/
|
|
50
|
+
const CLIENT_MARKER_HEADER = 'x-dsh-triage-client'
|
|
51
|
+
const CLIENT_MARKER_VALUE = 'settings-tab'
|
|
43
52
|
/** How many issues a settings tab may show before it stops being a settings tab. */
|
|
44
53
|
const ISSUES_SHOWN = 3
|
|
45
54
|
/** T-818: the four buckets and the count field each one reads. */
|
|
@@ -703,7 +712,7 @@ window.__ModuleLoader__.load({
|
|
|
703
712
|
try {
|
|
704
713
|
response = await fetch(SUMMARY_URL, {
|
|
705
714
|
credentials: 'include',
|
|
706
|
-
headers: { accept: 'application/json' },
|
|
715
|
+
headers: { accept: 'application/json', [CLIENT_MARKER_HEADER]: CLIENT_MARKER_VALUE },
|
|
707
716
|
})
|
|
708
717
|
} catch (error) {
|
|
709
718
|
// A dead route is a fact to report, not an exception to render: `load` never throws.
|
|
@@ -755,7 +764,7 @@ window.__ModuleLoader__.load({
|
|
|
755
764
|
try {
|
|
756
765
|
response = await fetch(UPGRADE_URL, {
|
|
757
766
|
credentials: 'include',
|
|
758
|
-
headers: { accept: 'application/json' },
|
|
767
|
+
headers: { accept: 'application/json', [CLIENT_MARKER_HEADER]: CLIENT_MARKER_VALUE },
|
|
759
768
|
})
|
|
760
769
|
} catch (error) {
|
|
761
770
|
return publishUpgrade({ ok: false, kind: 'thrown', upgrade: null, detail: String((error && error.message) || error) })
|
package/dist/audit-data.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export declare function redactedVerdicts(verdicts: readonly Verdict[], options:
|
|
|
94
94
|
export declare function auditJsonPayload(data: AuditData, options: {
|
|
95
95
|
noRedact: boolean;
|
|
96
96
|
roots: readonly string[];
|
|
97
|
+
updateOrder?: readonly unknown[];
|
|
97
98
|
}): Record<string, unknown>;
|
|
98
99
|
/** `audit`'s exit code: findings in collisions, duplicate copies, or any non-go verdict. */
|
|
99
100
|
export declare function auditExitOutcome(data: AuditData): 'ok' | 'findings';
|
package/dist/audit-data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-data.d.ts","sourceRoot":"","sources":["../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SAAS,GACjB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,CAqE7E;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAEnE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAAG,cAAc,CAGzH;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,OAAO,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACvD,SAAS,OAAO,EAAE,CAGpB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,GACzF,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqFzB;AAED,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,UAAU,CAOnE"}
|
package/dist/audit-data.js
CHANGED
|
@@ -31,7 +31,8 @@ export async function loadAuditData(input) {
|
|
|
31
31
|
const collisions = findEntryIdCollisions(claims);
|
|
32
32
|
const artifacts = await discoverLocalArtifacts({ root: input.env.profileDir });
|
|
33
33
|
const duplicates = await findDuplicateCopies(input.env);
|
|
34
|
-
|
|
34
|
+
// T-866: only copies that can collide are findings; the rest stay in `duplicates` as counts.
|
|
35
|
+
const duplicateFindings = duplicates.filter((duplicate) => duplicate.kind === 'different-versions' && duplicate.surface !== false);
|
|
35
36
|
// Resolving rows here is what lets `audit` answer "who put this copy here" for
|
|
36
37
|
// every row, not only for the denied ones (R8 adversary finding F11).
|
|
37
38
|
const rows = await resolveRows(input.env, rowTargetsOf(claims));
|
|
@@ -110,7 +111,7 @@ export function redactedVerdicts(verdicts, options) {
|
|
|
110
111
|
export function auditJsonPayload(data, options) {
|
|
111
112
|
const redaction = { noRedact: options.noRedact, roots: options.roots };
|
|
112
113
|
const { snapshot, diff } = data;
|
|
113
|
-
|
|
114
|
+
const payload = {
|
|
114
115
|
schema_version: 1,
|
|
115
116
|
command: 'audit',
|
|
116
117
|
env: redactedEnv(data.env, redaction),
|
|
@@ -125,6 +126,9 @@ export function auditJsonPayload(data, options) {
|
|
|
125
126
|
duplicates: data.duplicates.map((duplicate) => ({
|
|
126
127
|
name: duplicate.name,
|
|
127
128
|
kind: duplicate.kind,
|
|
129
|
+
// T-866: `surface: false` means "counted, not a finding" — said out loud so the JSON cannot
|
|
130
|
+
// be read as "13 problems" when 13 libraries merely exist twice.
|
|
131
|
+
surface: duplicate.surface !== false,
|
|
128
132
|
copies: duplicate.copies.map((copy) => ({ scope: copy.scope, path: copy.path, version: copy.version })),
|
|
129
133
|
})),
|
|
130
134
|
preset_declarations: data.presetDeclarations.map((declaration) => ({
|
|
@@ -184,6 +188,11 @@ export function auditJsonPayload(data, options) {
|
|
|
184
188
|
},
|
|
185
189
|
errors: [...data.errors],
|
|
186
190
|
};
|
|
191
|
+
// T-861: only present when the caller explicitly asked the registry (`audit --registry`), so the
|
|
192
|
+
// default payload stays byte-identical (M9-C5 / N6).
|
|
193
|
+
if (options.updateOrder !== undefined)
|
|
194
|
+
payload['update_order'] = options.updateOrder;
|
|
195
|
+
return payload;
|
|
187
196
|
}
|
|
188
197
|
/** `audit`'s exit code: findings in collisions, duplicate copies, or any non-go verdict. */
|
|
189
198
|
export function auditExitOutcome(data) {
|
package/dist/audit-data.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-data.js","sourceRoot":"","sources":["../src/audit-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EACb,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,GAOzB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAsB,MAAM,qBAAqB,CAAA;AAChF,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AA2C7E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAqB;IACvD,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACnE,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;IACjD,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;IACzE,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,UAAU,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAChD,MAAM,SAAS,GAAG,MAAM,sBAAsB,CA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G;AACH,SAAS,yBAAyB,CAChC,WAAwD,EACxD,MAAgB;IAEhB,MAAM,GAAG,GAAwB,EAAE,CAAA;IACnC,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACpC,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;gBAAE,SAAQ;YAC3D,MAAM,MAAM,GAAG,UAAU,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAA;YACtD,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACxC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;gBACvE,SAAQ;YACV,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,GAAG,yBAAyB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;QAC9D,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -16,7 +16,7 @@ import { createHash } from 'node:crypto';
|
|
|
16
16
|
import { homedir, tmpdir } from 'node:os';
|
|
17
17
|
import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
18
18
|
import process from 'node:process';
|
|
19
|
-
import { catalogFor, compareInventory, DIST_TAG_PACKAGE, distTagTargetOf, evaluateAdmission, extractEntryClaims, extractPresetDeclarations, findEntryIdCollisions, findPresetDivergence, format, groupClaimsBySource, hasNewDenials, judgeUpgradeImpact, judgeVersionDrift, loadEnv, parseInventorySnapshot, parsePatchYaml, redactEnv, redactPath, redactVerdict, registryFactFor, renderUpgradeImpact, renderUpgradeCard, renderVerdict, resolveDistTagTarget, rowTargets, upgradeTargetProblem, verdictFromAdmission, verdictsFromCollisions, verdictsFromDuplicateCopies, verdictsFromInventory, verdictsFromRowAdmission, } from '@dsh-triage/core';
|
|
19
|
+
import { catalogFor, compareInventory, DIST_TAG_PACKAGE, distTagTargetOf, evaluateAdmission, extractEntryClaims, extractPresetDeclarations, findEntryIdCollisions, findPresetDivergence, format, groupClaimsBySource, hasNewDenials, judgeUpgradeImpact, judgeUpdateOrder, judgeVersionDrift, loadEnv, parseInventorySnapshot, parsePatchYaml, redactEnv, redactPath, redactVerdict, registryFactFor, renderUpgradeImpact, renderUpgradeCard, renderVerdict, resolveDistTagTarget, rowTargets, upgradeTargetProblem, verdictFromAdmission, verdictsFromCollisions, verdictsFromDuplicateCopies, verdictsFromInventory, verdictsFromRowAdmission, } from '@dsh-triage/core';
|
|
20
20
|
import { buildProbePlan, executeProbe, findFreePort, judgeProbe, probeVerdict } from '@dsh-triage/probe';
|
|
21
21
|
import { discoverLocalArtifacts, fetchPackument } from '@dsh-triage/signals';
|
|
22
22
|
import { auditExitOutcome, auditJsonPayload, auditRedactRoots, loadAuditData, redactedEnv, redactedVerdicts, } from './audit-data.js';
|
|
@@ -29,9 +29,10 @@ import { outcomeStatus, purgeOutcomes, renderPurge, renderStatus } from './outco
|
|
|
29
29
|
import { recordOutcomes } from './outcomes/store.js';
|
|
30
30
|
import { candidatePackageName, normalizeCandidateSpec, probeScratchRoot, realDshHomeOf, realProbeDeps, sandboxBundles, } from './probe-run.js';
|
|
31
31
|
import { applyExemptionFixes, planFixes, readProfileDependencies, runtimeSupportsExemptions, undoFix } from './fix.js';
|
|
32
|
+
import { applyRescue, classifyBundles, readProfileBundles, undoRescue } from './rescue.js';
|
|
32
33
|
import { allowedHosts } from './host-allow.js';
|
|
33
34
|
import { startPanel } from './serve.js';
|
|
34
|
-
import { buildProfileSummary, formatProfileSummary } from './summary.js';
|
|
35
|
+
import { buildProfileSummary, formatProfileSummary, runtimeLabel } from './summary.js';
|
|
35
36
|
const EXIT_OK = 0;
|
|
36
37
|
const EXIT_FINDINGS = 1;
|
|
37
38
|
const EXIT_USAGE = 2;
|
|
@@ -58,11 +59,12 @@ Usage
|
|
|
58
59
|
dsh-triage upgrade --to <version> which rows/bundles the target dsh would deny, and how to fix
|
|
59
60
|
dsh-triage upgrade --to next|latest same judgement, with the target resolved from npm dist-tags
|
|
60
61
|
dsh-triage fix what can be repaired automatically; --apply writes, --undo reverts
|
|
62
|
+
dsh-triage rescue which third-party bundles a rescue would trim (plan only, read-only)
|
|
61
63
|
Flags
|
|
62
64
|
--json machine-readable output
|
|
63
65
|
--all include findings that are not blocking (audit: print the full ledger)
|
|
64
|
-
--apply (fix) actually write the plan;
|
|
65
|
-
--undo <journal> (fix) restore the files an earlier --apply changed
|
|
66
|
+
--apply (fix) actually write the plan; (rescue) take the listed bundles out
|
|
67
|
+
--undo <journal> (fix, rescue) restore the files an earlier --apply changed
|
|
66
68
|
--strict exit 1 when a conclusion is not "go"
|
|
67
69
|
--profile <name> profile name (default: web)
|
|
68
70
|
--dsh-home <path> override $DSH_HOME (default: ~/.dsh)
|
|
@@ -93,7 +95,7 @@ Flags
|
|
|
93
95
|
--purge (outcomes) delete every record this tool stored, then the directory
|
|
94
96
|
--status (outcomes) how many records exist (default when no verb is given)
|
|
95
97
|
--to <version> (upgrade) target dsh: exact semver (e.g. 0.3.0), or next / latest (resolved from npm)
|
|
96
|
-
--registry (upgrade) annotate with published builds that declare the target (
|
|
98
|
+
--registry (upgrade) annotate with published builds that declare the target; (audit) add publish-order evidence per installed package
|
|
97
99
|
--card (upgrade) paste-ready markdown for the release discussion (four buckets + boundary)
|
|
98
100
|
--help this text
|
|
99
101
|
|
|
@@ -116,11 +118,12 @@ const HELP_ZH = `dsh-triage · 本地插件兼容分诊台 — DeepSeek Harness
|
|
|
116
118
|
dsh-triage upgrade --to <目标版本> 预检目标 DSH 版本会拦截当前哪些插件,并输出修复建议
|
|
117
119
|
dsh-triage upgrade --to next|latest 预检升级至 npm 远端 next/latest 版本的兼容影响
|
|
118
120
|
dsh-triage fix 自动修复计划;--apply 实际写入,--undo 依日志撤销
|
|
121
|
+
dsh-triage rescue 救援计划:哪些第三方 bundle 可以先裁掉(只读,不写盘)
|
|
119
122
|
参数 (Flags)
|
|
120
123
|
--json 输出机器可读的 JSON 数据
|
|
121
124
|
--all 包含非阻断性条目(audit 命令下打印全量台账)
|
|
122
|
-
--apply (fix)
|
|
123
|
-
--undo <日志文件> (fix)
|
|
125
|
+
--apply (fix) 真正执行修复写入;(rescue) 把列出的 bundle 从配置中移除
|
|
126
|
+
--undo <日志文件> (fix, rescue) 依据此前执行生成的日志文件回滚改动
|
|
124
127
|
--strict 当存在非 "go" 结论时以退出码 1 退出
|
|
125
128
|
--profile <名称> 指定分析的 Profile 名称(默认:web)
|
|
126
129
|
--dsh-home <路径> 覆盖 $DSH_HOME 路径(默认:~/.dsh)
|
|
@@ -128,6 +131,7 @@ const HELP_ZH = `dsh-triage · 本地插件兼容分诊台 — DeepSeek Harness
|
|
|
128
131
|
--no-redact 在 --json 输出中保留原始绝对路径(默认脱敏为 ~)
|
|
129
132
|
--stamp <iso时间戳> 指定固定时间戳以获得确定性输出
|
|
130
133
|
--to <版本> (upgrade) 目标 DSH 版本:精确 semver(如 0.2.1-rc.5)或 next / latest
|
|
134
|
+
--registry (upgrade) 标注哪些已发布构建声明了目标版本;(audit) 为每个已装包补「发布顺序」证据
|
|
131
135
|
--card (upgrade) 输出格式化 Markdown 升级卡片
|
|
132
136
|
--execute (probe) 在独立隔离临时 DSH_HOME 中真正拉起沙盒执行实测
|
|
133
137
|
--port <端口> (serve) 本地面板绑定的端口(默认自动选取空闲端口)
|
|
@@ -152,6 +156,8 @@ async function run(argv) {
|
|
|
152
156
|
return commandStatus(flags);
|
|
153
157
|
case 'fix':
|
|
154
158
|
return commandFix(flags);
|
|
159
|
+
case 'rescue':
|
|
160
|
+
return commandRescue(flags);
|
|
155
161
|
case 'env':
|
|
156
162
|
return commandEnv(flags);
|
|
157
163
|
case 'why':
|
|
@@ -406,7 +412,7 @@ async function commandWhy(flags) {
|
|
|
406
412
|
});
|
|
407
413
|
return exitFor(flags, findings);
|
|
408
414
|
}
|
|
409
|
-
process.stdout.write(`scanned ${composition.layers.length} bundles · ${claims.length} loader rows · ${rows.length} import targets · dsh ${env
|
|
415
|
+
process.stdout.write(`scanned ${composition.layers.length} bundles · ${claims.length} loader rows · ${rows.length} import targets · dsh ${runtimeLabel(env)} · profile ${env.profile}\n`);
|
|
410
416
|
for (const error of bannerErrors)
|
|
411
417
|
process.stdout.write(`warn ${error}\n`);
|
|
412
418
|
if (findings.length === 0) {
|
|
@@ -1032,6 +1038,139 @@ async function commandStatus(flags) {
|
|
|
1032
1038
|
* Prints a plan by default and writes NOTHING. `--apply` writes only the items the plan marked
|
|
1033
1039
|
* `ready`, backs the file up first, and records a journal so `--undo` can put it back.
|
|
1034
1040
|
*/
|
|
1041
|
+
/**
|
|
1042
|
+
* `rescue` (M8): read-only plan by default, `--apply` takes the listed bundles out of
|
|
1043
|
+
* `dsh.profile.bundles`, `--undo <journal>` puts the manifest back byte for byte.
|
|
1044
|
+
*
|
|
1045
|
+
* Three things this command is careful about:
|
|
1046
|
+
* - **the plan writes nothing** — not even a backup, not even a formatted copy (C4);
|
|
1047
|
+
* - **it does not promise a boot** — the boundary sentence is part of the output, both locales (C5);
|
|
1048
|
+
* - **it never touches `dependencies`** — the whole point of trimming bundles is that undo stays
|
|
1049
|
+
* an array edit instead of a reinstall (spec §3 rule 3).
|
|
1050
|
+
*/
|
|
1051
|
+
async function commandRescue(flags) {
|
|
1052
|
+
if (flags.undo !== null) {
|
|
1053
|
+
try {
|
|
1054
|
+
const { restored } = undoRescue(flags.undo);
|
|
1055
|
+
if (flags.json) {
|
|
1056
|
+
writeJson({ schema_version: 1, command: 'rescue', undo: flags.undo, restored });
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
process.stdout.write(flags.locale === 'zh'
|
|
1060
|
+
? `已逐字节还原 ${restored.length} 个文件:\n`
|
|
1061
|
+
: `restored ${restored.length} file(s) byte for byte:\n`);
|
|
1062
|
+
for (const file of restored)
|
|
1063
|
+
process.stdout.write(` ${file}\n`);
|
|
1064
|
+
}
|
|
1065
|
+
return EXIT_OK;
|
|
1066
|
+
}
|
|
1067
|
+
catch (error) {
|
|
1068
|
+
process.stderr.write(`${flags.locale === 'zh' ? '无法撤销' : 'cannot undo'}: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
1069
|
+
return EXIT_UNAVAILABLE;
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
const env = await requireEnv(flags);
|
|
1073
|
+
if (env === null)
|
|
1074
|
+
return EXIT_UNAVAILABLE;
|
|
1075
|
+
const reading = readProfileBundles(env.profileDir);
|
|
1076
|
+
if (!reading.ok) {
|
|
1077
|
+
process.stderr.write(`${reading.reason}\n`);
|
|
1078
|
+
process.stderr.write('hint: pass --dsh-home <path> or --profile <name>\n');
|
|
1079
|
+
return EXIT_UNAVAILABLE;
|
|
1080
|
+
}
|
|
1081
|
+
const plan = classifyBundles({
|
|
1082
|
+
profile: env.profile,
|
|
1083
|
+
declared: reading.declared,
|
|
1084
|
+
installed: env.installed,
|
|
1085
|
+
manifestSha256: reading.manifestSha256,
|
|
1086
|
+
field: reading.field,
|
|
1087
|
+
});
|
|
1088
|
+
let run = { journal: '', backupDir: null, changes: [], removed: [], dryRun: true };
|
|
1089
|
+
if (flags.apply && plan.removable.length > 0) {
|
|
1090
|
+
try {
|
|
1091
|
+
run = applyRescue({
|
|
1092
|
+
plan,
|
|
1093
|
+
profileDir: env.profileDir,
|
|
1094
|
+
stamp: stampOf(flags),
|
|
1095
|
+
dryRun: false,
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
catch (error) {
|
|
1099
|
+
process.stderr.write(`${flags.locale === 'zh' ? '无法应用' : 'cannot apply'}: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
1100
|
+
return EXIT_UNAVAILABLE;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
if (flags.json) {
|
|
1104
|
+
// The plan carries no absolute paths by construction; the run does (journal/backup), so JSON
|
|
1105
|
+
// output keeps the same contract as every other command: redact unless --no-redact.
|
|
1106
|
+
const payload = {
|
|
1107
|
+
schema_version: 1,
|
|
1108
|
+
command: 'rescue',
|
|
1109
|
+
plan,
|
|
1110
|
+
run: flags.noRedact ? run : { ...run, journal: '', backupDir: null },
|
|
1111
|
+
};
|
|
1112
|
+
writeJson(payload);
|
|
1113
|
+
}
|
|
1114
|
+
else {
|
|
1115
|
+
const zh = flags.locale === 'zh';
|
|
1116
|
+
process.stdout.write(zh
|
|
1117
|
+
? `rescue 计划 · profile ${plan.profile} · manifest ${plan.manifestSha256.slice(0, 12)}…\n`
|
|
1118
|
+
: `rescue plan · profile ${plan.profile} · manifest ${plan.manifestSha256.slice(0, 12)}…\n`);
|
|
1119
|
+
if (plan.empty) {
|
|
1120
|
+
process.stdout.write(zh
|
|
1121
|
+
? plan.field === 'absent'
|
|
1122
|
+
? '这个 profile 的 package.json 里没有 dsh.profile.bundles 字段——通常是 --dsh-home / --profile 指错了,而不是"没有问题"。\n'
|
|
1123
|
+
: 'dsh.profile.bundles 是空数组——这个 profile 没声明任何 bundle。\n'
|
|
1124
|
+
: plan.field === 'absent'
|
|
1125
|
+
? 'this profile\'s package.json has no dsh.profile.bundles field — usually --dsh-home / --profile points somewhere else, not "nothing is wrong".\n'
|
|
1126
|
+
: 'dsh.profile.bundles is empty — this profile declares no bundles.\n');
|
|
1127
|
+
}
|
|
1128
|
+
else {
|
|
1129
|
+
process.stdout.write(zh
|
|
1130
|
+
? `可裁 ${plan.removable.length} / ${plan.bundles.length} 个 bundle(第三方 ${plan.thirdParty} · 宣布了但没装 ${plan.unresolved})\n`
|
|
1131
|
+
: `${plan.removable.length} of ${plan.bundles.length} bundle(s) trimmable (${plan.thirdParty} third-party · ${plan.unresolved} listed-but-not-installed)\n`);
|
|
1132
|
+
for (const entry of plan.bundles) {
|
|
1133
|
+
const mark = entry.removable ? '✓' : '·';
|
|
1134
|
+
const version = entry.version === null ? '?' : entry.version;
|
|
1135
|
+
const spec = entry.spec === null ? '—' : entry.spec;
|
|
1136
|
+
process.stdout.write(` ${mark} ${entry.name}@${version} [${entry.origin}] · ${spec}\n`);
|
|
1137
|
+
process.stdout.write(` ${entry.detail}\n`);
|
|
1138
|
+
if (entry.removable) {
|
|
1139
|
+
process.stdout.write(zh
|
|
1140
|
+
? ` 撤回方式:放回 dsh.profile.bundles 第 ${entry.restore.at + 1} 位\n`
|
|
1141
|
+
: ` undo: put "${entry.restore.entry}" back at position ${entry.restore.at + 1}\n`);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
if (plan.removable.length === 0) {
|
|
1145
|
+
process.stdout.write(zh ? '没有可裁的条目:全部是官方 bundle。\n' : 'nothing to trim: every bundle is official.\n');
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
process.stdout.write(zh
|
|
1149
|
+
? '\n边界:本计划只从声明层读 dsh.profile.bundles,不证明启动成功;启动验证请用 `dsh-triage probe --execute`。\n'
|
|
1150
|
+
: '\nboundary: this plan is read off dsh.profile.bundles only — it does not prove the host boots; verify with `dsh-triage probe --execute`.\n');
|
|
1151
|
+
if (run.dryRun) {
|
|
1152
|
+
process.stdout.write(plan.removable.length > 0
|
|
1153
|
+
? zh
|
|
1154
|
+
? '\n当前仅输出计划,未修改任何文件。如需执行:dsh-triage rescue --apply\n'
|
|
1155
|
+
: '\nplan only — nothing was written. To apply: dsh-triage rescue --apply\n'
|
|
1156
|
+
: zh
|
|
1157
|
+
? '\n未修改任何文件:没有可裁的条目。\n'
|
|
1158
|
+
: '\nnothing was written: nothing to trim.\n');
|
|
1159
|
+
}
|
|
1160
|
+
else {
|
|
1161
|
+
process.stdout.write(zh
|
|
1162
|
+
? `\n已从 dsh.profile.bundles 移除 ${run.removed.length} 个条目:${run.removed.join('、')}\n`
|
|
1163
|
+
: `\nremoved ${run.removed.length} entry/entries from dsh.profile.bundles: ${run.removed.join(', ')}\n`);
|
|
1164
|
+
process.stdout.write(zh ? `备份:${run.backupDir}\n` : `backup: ${run.backupDir}\n`);
|
|
1165
|
+
process.stdout.write(zh
|
|
1166
|
+
? `撤销(逐字节还原):dsh-triage rescue --undo ${run.journal}\n`
|
|
1167
|
+
: `undo (byte for byte): dsh-triage rescue --undo ${run.journal}\n`);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
if (!run.dryRun)
|
|
1171
|
+
return EXIT_OK;
|
|
1172
|
+
return plan.removable.length > 0 ? EXIT_FINDINGS : EXIT_OK;
|
|
1173
|
+
}
|
|
1035
1174
|
async function commandFix(flags) {
|
|
1036
1175
|
if (flags.undo !== null) {
|
|
1037
1176
|
try {
|
|
@@ -1120,6 +1259,79 @@ async function commandFix(flags) {
|
|
|
1120
1259
|
return EXIT_OK;
|
|
1121
1260
|
return run.dryRun ? EXIT_FINDINGS : plan.applicable === run.changes.length ? EXIT_OK : EXIT_FINDINGS;
|
|
1122
1261
|
}
|
|
1262
|
+
function updateOrderRow(name, version, order) {
|
|
1263
|
+
return {
|
|
1264
|
+
name,
|
|
1265
|
+
version,
|
|
1266
|
+
verdict: order.verdict,
|
|
1267
|
+
installed_published_at: order.installedPublishedAt,
|
|
1268
|
+
candidate: order.candidate === null
|
|
1269
|
+
? null
|
|
1270
|
+
: { version: order.candidate.version, published_at: order.candidate.publishedAt, days_older: order.candidate.daysOlder },
|
|
1271
|
+
latest_lags: order.latestLags,
|
|
1272
|
+
detail: order.detail,
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
* T-861: publish-order evidence for every installed package, read only when the caller asked.
|
|
1277
|
+
*
|
|
1278
|
+
* WHY OPT-IN: `audit` is offline by contract. Adding registry reads to the default path would make
|
|
1279
|
+
* every existing automation depend on npm being reachable, and would break the "audit --json is the
|
|
1280
|
+
* same bytes as before" guarantee the panel and the tests rely on. `--registry` says it out loud.
|
|
1281
|
+
*/
|
|
1282
|
+
async function collectUpdateOrders(env, at) {
|
|
1283
|
+
const targets = env.installed.filter((pkg) => pkg.version !== null);
|
|
1284
|
+
const rows = [];
|
|
1285
|
+
const concurrency = 4;
|
|
1286
|
+
for (let index = 0; index < targets.length; index += concurrency) {
|
|
1287
|
+
const slice = targets.slice(index, index + concurrency);
|
|
1288
|
+
const answers = await Promise.all(slice.map(async (pkg) => {
|
|
1289
|
+
const version = pkg.version;
|
|
1290
|
+
const packument = await fetchPackument(pkg.name, { at });
|
|
1291
|
+
if (!packument.ok) {
|
|
1292
|
+
const order = {
|
|
1293
|
+
verdict: 'unmeasured',
|
|
1294
|
+
installed: version,
|
|
1295
|
+
installedPublishedAt: null,
|
|
1296
|
+
candidate: null,
|
|
1297
|
+
latestLags: false,
|
|
1298
|
+
detail: `the registry could not be read for this package (${packument.error.code})`,
|
|
1299
|
+
};
|
|
1300
|
+
return updateOrderRow(pkg.name, version, order);
|
|
1301
|
+
}
|
|
1302
|
+
const value = packument.value;
|
|
1303
|
+
return updateOrderRow(pkg.name, version, judgeUpdateOrder({
|
|
1304
|
+
latest: value.distTags['latest'] ?? null,
|
|
1305
|
+
next: value.distTags['next'] ?? null,
|
|
1306
|
+
versions: [...value.versions.keys()],
|
|
1307
|
+
publishedAt: value.publishedAt,
|
|
1308
|
+
}, version));
|
|
1309
|
+
}));
|
|
1310
|
+
rows.push(...answers);
|
|
1311
|
+
}
|
|
1312
|
+
return rows;
|
|
1313
|
+
}
|
|
1314
|
+
function renderUpdateOrder(rows, locale) {
|
|
1315
|
+
const zh = locale === 'zh';
|
|
1316
|
+
const lines = [zh ? '\nupdate order(只读 registry)' : '\nupdate order (registry read)'];
|
|
1317
|
+
for (const row of rows) {
|
|
1318
|
+
const candidate = row.candidate === null ? '' : ` → ${row.candidate.version}`;
|
|
1319
|
+
const when = row.candidate === null
|
|
1320
|
+
? ''
|
|
1321
|
+
: row.candidate.days_older > 0
|
|
1322
|
+
? zh
|
|
1323
|
+
? `(早 ${String(row.candidate.days_older)} 天发布)`
|
|
1324
|
+
: ` (published ${String(row.candidate.days_older)} day(s) earlier)`
|
|
1325
|
+
: zh
|
|
1326
|
+
? `(晚 ${String(Math.abs(row.candidate.days_older))} 天发布)`
|
|
1327
|
+
: ` (published ${String(Math.abs(row.candidate.days_older))} day(s) later)`;
|
|
1328
|
+
lines.push(` ${row.verdict.padEnd(11)} ${row.name}@${row.version}${candidate}${when}`);
|
|
1329
|
+
}
|
|
1330
|
+
lines.push(zh
|
|
1331
|
+
? ' 边界:这条只说明发布顺序,不改上面任何结论;也不证明哪个构建能跑。'
|
|
1332
|
+
: ' boundary: publish order only — it changes none of the conclusions above and proves no build runs.');
|
|
1333
|
+
return lines.join('\n');
|
|
1334
|
+
}
|
|
1123
1335
|
async function commandAudit(flags) {
|
|
1124
1336
|
const env = await requireEnv(flags);
|
|
1125
1337
|
if (env === null)
|
|
@@ -1141,14 +1353,21 @@ async function commandAudit(flags) {
|
|
|
1141
1353
|
const data = loaded.data;
|
|
1142
1354
|
const { grouped, collisions, artifacts, duplicates, duplicateFindings, snapshot, diff, rowVerdicts, inventoryVerdicts, declared } = data;
|
|
1143
1355
|
const rowConclusion = new Map(rowVerdicts.map((verdict) => [verdict.subject.name, verdict.conclusion]));
|
|
1356
|
+
const updateOrder = flags.registry ? await collectUpdateOrders(env, stampOf(flags)) : undefined;
|
|
1144
1357
|
if (flags.json) {
|
|
1145
|
-
writeJson(auditJsonPayload(data, {
|
|
1358
|
+
writeJson(auditJsonPayload(data, {
|
|
1359
|
+
noRedact: flags.noRedact,
|
|
1360
|
+
roots: auditRedactRoots(dshHome),
|
|
1361
|
+
...(updateOrder === undefined ? {} : { updateOrder }),
|
|
1362
|
+
}));
|
|
1146
1363
|
return auditExitOutcome(data) === 'ok' ? EXIT_OK : EXIT_FINDINGS;
|
|
1147
1364
|
}
|
|
1148
1365
|
// R49: the human answer first. The ledger below is the evidence, and it is one flag away
|
|
1149
1366
|
// (`--all`) instead of being the only thing between the user and their answer.
|
|
1150
1367
|
const summary = buildProfileSummary(data, { locale: flags.locale });
|
|
1151
1368
|
process.stdout.write(formatProfileSummary(summary, { locale: flags.locale, env }));
|
|
1369
|
+
if (updateOrder !== undefined)
|
|
1370
|
+
process.stdout.write(`${renderUpdateOrder(updateOrder, flags.locale)}\n`);
|
|
1152
1371
|
if (!flags.all) {
|
|
1153
1372
|
process.stdout.write(flags.locale === 'zh'
|
|
1154
1373
|
? '\n(使用 --all 可查看完整台账;`audit --json` 输出所有字段)\n'
|