dsh-triage 0.3.0 → 0.3.2

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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * `GET /compat-triage/summary` — the one-screen answer, for the settings tab (R51).
3
+ *
4
+ * WHY A SECOND ROUTE INSTEAD OF A SIBLING KEY ON `/compat-triage/audit`: that route's contract is
5
+ * "this payload is exactly what `dsh-triage audit --json` prints", and the tab's `same-source` check
6
+ * relies on it. Adding a field there would quietly weaken a promise that has real evidence behind it.
7
+ * The summary is a *different projection of the same scan*, so it gets its own path and its own
8
+ * promise: **the numbers here are the numbers the CLI prints**, built by `buildProfileSummary()` —
9
+ * the same function `serve`'s `/api/summary` and `dsh-triage status` call.
10
+ *
11
+ * WHAT THIS ROUTE MAY SAY: `{ env, summary: { zh, en }, ms }`. Two locales because the browser half
12
+ * cannot call our host code and must not translate judgement language itself (铁律 1: the wording of
13
+ * a conclusion is part of the conclusion). Picking which one to show is presentation; producing them
14
+ * is not.
15
+ *
16
+ * WHAT IT REFUSES: identical to the audit route — non-GET verbs, another origin, and browser calls
17
+ * that present no same-origin evidence at all. Sharing `auditRequestVerdict()` is deliberate: two
18
+ * routes that guard themselves slightly differently is how one of them ends up open.
19
+ */
20
+ import type { IncomingMessage, ServerResponse } from 'node:http';
21
+ /** The route path. Fixed and unparameterised, like the audit route. */
22
+ export declare const SUMMARY_ROUTE_PATH = "/compat-triage/summary";
23
+ /** Injected so tests drive the route without a real profile or a real Host. */
24
+ export interface SummaryRouteDeps {
25
+ /**
26
+ * One scan, projected. `{ok:false}` must stay a 409 with the reader's own sentence: "not readable"
27
+ * and "nothing to report" must never look alike (T-406).
28
+ */
29
+ readonly read: () => Promise<{
30
+ ok: true;
31
+ body: unknown;
32
+ } | {
33
+ ok: false;
34
+ message: string;
35
+ }>;
36
+ }
37
+ /** Build the route handler. It owns the response and never throws into the server. */
38
+ export declare function createSummaryRouteHandler(deps: SummaryRouteDeps): (request: IncomingMessage, response: ServerResponse) => Promise<void>;
39
+ //# sourceMappingURL=host-summary-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-summary-route.d.ts","sourceRoot":"","sources":["../src/host-summary-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAGhE,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,2BAA2B,CAAA;AAE1D,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC3F;AAED,sFAAsF;AACtF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,gBAAgB,IAChD,SAAS,eAAe,EAAE,UAAU,cAAc,KAAG,OAAO,CAAC,IAAI,CAAC,CAsBjF"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * `GET /compat-triage/summary` — the one-screen answer, for the settings tab (R51).
3
+ *
4
+ * WHY A SECOND ROUTE INSTEAD OF A SIBLING KEY ON `/compat-triage/audit`: that route's contract is
5
+ * "this payload is exactly what `dsh-triage audit --json` prints", and the tab's `same-source` check
6
+ * relies on it. Adding a field there would quietly weaken a promise that has real evidence behind it.
7
+ * The summary is a *different projection of the same scan*, so it gets its own path and its own
8
+ * promise: **the numbers here are the numbers the CLI prints**, built by `buildProfileSummary()` —
9
+ * the same function `serve`'s `/api/summary` and `dsh-triage status` call.
10
+ *
11
+ * WHAT THIS ROUTE MAY SAY: `{ env, summary: { zh, en }, ms }`. Two locales because the browser half
12
+ * cannot call our host code and must not translate judgement language itself (铁律 1: the wording of
13
+ * a conclusion is part of the conclusion). Picking which one to show is presentation; producing them
14
+ * is not.
15
+ *
16
+ * WHAT IT REFUSES: identical to the audit route — non-GET verbs, another origin, and browser calls
17
+ * that present no same-origin evidence at all. Sharing `auditRequestVerdict()` is deliberate: two
18
+ * routes that guard themselves slightly differently is how one of them ends up open.
19
+ */
20
+ import { auditRequestVerdict, sendJson } from './host-audit-route.js';
21
+ /** The route path. Fixed and unparameterised, like the audit route. */
22
+ export const SUMMARY_ROUTE_PATH = '/compat-triage/summary';
23
+ /** Build the route handler. It owns the response and never throws into the server. */
24
+ export function createSummaryRouteHandler(deps) {
25
+ return async (request, response) => {
26
+ const verdict = auditRequestVerdict({
27
+ method: request.method,
28
+ origin: typeof request.headers.origin === 'string' ? request.headers.origin : undefined,
29
+ secFetchSite: typeof request.headers['sec-fetch-site'] === 'string' ? request.headers['sec-fetch-site'] : undefined,
30
+ host: typeof request.headers.host === 'string' ? request.headers.host : undefined,
31
+ });
32
+ if (!verdict.ok) {
33
+ sendJson(response, verdict.status, { error: verdict.error });
34
+ return;
35
+ }
36
+ try {
37
+ const loaded = await deps.read();
38
+ if (!loaded.ok) {
39
+ sendJson(response, 409, { error: loaded.message });
40
+ return;
41
+ }
42
+ sendJson(response, 200, loaded.body);
43
+ }
44
+ catch (error) {
45
+ sendJson(response, 500, { error: error instanceof Error ? error.message : String(error) });
46
+ }
47
+ };
48
+ }
49
+ //# sourceMappingURL=host-summary-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-summary-route.js","sourceRoot":"","sources":["../src/host-summary-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErE,uEAAuE;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAA;AAW1D,sFAAsF;AACtF,MAAM,UAAU,yBAAyB,CAAC,IAAsB;IAC9D,OAAO,KAAK,EAAE,OAAwB,EAA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M,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAC5F,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * `GET /compat-triage/upgrade?to=next|latest` — the four-bucket impact, on demand (R61 / T-818).
3
+ *
4
+ * WHY ON DEMAND: the summary route answers "is this profile broken" from a local scan. The upgrade
5
+ * route answers "what would the target runtime deny", which needs the npm registry. A settings tab
6
+ * that read the registry every time it opened would be slow, surprising, and impossible to explain.
7
+ * So this route is **only fetched when the person clicks the button**, and it says so in the payload.
8
+ *
9
+ * WHAT IT REUSES: the same `loadAuditData()` scan as `/compat-triage/summary`, the same
10
+ * `judgeUpgradeImpact` as `dsh-triage upgrade --to`, and the same `resolveDistTagTarget` as the CLI.
11
+ * There is no second range rule here (铁律 1: the wording and the numbers are the conclusion).
12
+ *
13
+ * WHAT IT REFUSES: non-GET, another origin, no same-origin evidence, a tag other than the two
14
+ * keywords, a registry that cannot be read (502, not an empty bucket list), a profile that cannot be
15
+ * read (409), and a scan that takes longer than the 20s budget (504). An empty table would read as
16
+ * "nothing will break", which is the one answer this route is not allowed to invent.
17
+ */
18
+ import type { IncomingMessage, ServerResponse } from 'node:http';
19
+ export declare const UPGRADE_ROUTE_PATH = "/compat-triage/upgrade";
20
+ export declare const UPGRADE_TAGS: readonly ["next", "latest"];
21
+ export type UpgradeTag = (typeof UPGRADE_TAGS)[number];
22
+ export interface UpgradeRouteDeps {
23
+ /**
24
+ * Resolve the tag, scan the profile and judge the target. `status` is part of the answer:
25
+ * `409` is "profile unreadable", `502` is "registry unreadable", `504` is "budget exceeded".
26
+ */
27
+ readonly read: (tag: UpgradeTag) => Promise<{
28
+ readonly ok: true;
29
+ readonly body: unknown;
30
+ } | {
31
+ readonly ok: false;
32
+ readonly status: 400 | 409 | 502 | 504;
33
+ readonly message: string;
34
+ }>;
35
+ }
36
+ /** Parse `?to=`; only the two keyword tags are accepted, and the default is `next`. */
37
+ export declare function parseUpgradeTag(url: string | undefined): UpgradeTag | null;
38
+ export declare function createUpgradeRouteHandler(deps: UpgradeRouteDeps): (request: IncomingMessage, response: ServerResponse) => Promise<void>;
39
+ //# sourceMappingURL=host-upgrade-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-upgrade-route.d.ts","sourceRoot":"","sources":["../src/host-upgrade-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAGhE,eAAO,MAAM,kBAAkB,2BAA2B,CAAA;AAC1D,eAAO,MAAM,YAAY,6BAA8B,CAAA;AACvD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,CACb,GAAG,EAAE,UAAU,KACZ,OAAO,CACR;QAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAC7C;QAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAC3F,CAAA;CACF;AAED,uFAAuF;AACvF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAU1E;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,gBAAgB,IAChD,SAAS,eAAe,EAAE,UAAU,cAAc,KAAG,OAAO,CAAC,IAAI,CAAC,CA2BjF"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * `GET /compat-triage/upgrade?to=next|latest` — the four-bucket impact, on demand (R61 / T-818).
3
+ *
4
+ * WHY ON DEMAND: the summary route answers "is this profile broken" from a local scan. The upgrade
5
+ * route answers "what would the target runtime deny", which needs the npm registry. A settings tab
6
+ * that read the registry every time it opened would be slow, surprising, and impossible to explain.
7
+ * So this route is **only fetched when the person clicks the button**, and it says so in the payload.
8
+ *
9
+ * WHAT IT REUSES: the same `loadAuditData()` scan as `/compat-triage/summary`, the same
10
+ * `judgeUpgradeImpact` as `dsh-triage upgrade --to`, and the same `resolveDistTagTarget` as the CLI.
11
+ * There is no second range rule here (铁律 1: the wording and the numbers are the conclusion).
12
+ *
13
+ * WHAT IT REFUSES: non-GET, another origin, no same-origin evidence, a tag other than the two
14
+ * keywords, a registry that cannot be read (502, not an empty bucket list), a profile that cannot be
15
+ * read (409), and a scan that takes longer than the 20s budget (504). An empty table would read as
16
+ * "nothing will break", which is the one answer this route is not allowed to invent.
17
+ */
18
+ import { auditRequestVerdict, sendJson } from './host-audit-route.js';
19
+ export const UPGRADE_ROUTE_PATH = '/compat-triage/upgrade';
20
+ export const UPGRADE_TAGS = ['next', 'latest'];
21
+ /** Parse `?to=`; only the two keyword tags are accepted, and the default is `next`. */
22
+ export function parseUpgradeTag(url) {
23
+ let requested = null;
24
+ try {
25
+ const parsed = new URL(String(url ?? '/'), 'http://127.0.0.1');
26
+ requested = parsed.searchParams.get('to');
27
+ }
28
+ catch {
29
+ return null;
30
+ }
31
+ if (requested === null || requested === '')
32
+ return 'next';
33
+ return UPGRADE_TAGS.includes(requested) ? requested : null;
34
+ }
35
+ export function createUpgradeRouteHandler(deps) {
36
+ return async (request, response) => {
37
+ const verdict = auditRequestVerdict({
38
+ method: request.method,
39
+ origin: typeof request.headers.origin === 'string' ? request.headers.origin : undefined,
40
+ secFetchSite: typeof request.headers['sec-fetch-site'] === 'string' ? request.headers['sec-fetch-site'] : undefined,
41
+ host: typeof request.headers.host === 'string' ? request.headers.host : undefined,
42
+ });
43
+ if (!verdict.ok) {
44
+ sendJson(response, verdict.status, { error: verdict.error });
45
+ return;
46
+ }
47
+ const tag = parseUpgradeTag(request.url);
48
+ if (tag === null) {
49
+ sendJson(response, 400, { error: `--to must be one of ${UPGRADE_TAGS.join(', ')}; got ${String(request.url)}` });
50
+ return;
51
+ }
52
+ try {
53
+ const loaded = await deps.read(tag);
54
+ if (!loaded.ok) {
55
+ sendJson(response, loaded.status, { error: loaded.message });
56
+ return;
57
+ }
58
+ sendJson(response, 200, loaded.body);
59
+ }
60
+ catch (error) {
61
+ sendJson(response, 500, { error: error instanceof Error ? error.message : String(error) });
62
+ }
63
+ };
64
+ }
65
+ //# sourceMappingURL=host-upgrade-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-upgrade-route.js","sourceRoot":"","sources":["../src/host-upgrade-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErE,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAA;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAA;AAgBvD,uFAAuF;AACvF,MAAM,UAAU,eAAe,CAAC,GAAuB;IACrD,IAAI,SAAS,GAAkB,IAAI,CAAA;IACnC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,kBAAkB,CAAC,CAAA;QAC9D,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,EAAE;QAAE,OAAO,MAAM,CAAA;IACzD,OAAO,YAAY,CAAC,QAAQ,CAAC,SAAuB,CAAC,CAAC,CAAC,CAAE,SAAwB,CAAC,CAAC,CAAC,IAAI,CAAA;AAC1F,CAAC;AA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G;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAA;IAClC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;IAClC;;;OAGG;IACH,MAAM,CAAC,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAA;CAClF;AAED,eAAO,MAAM,IAAI,mBAAmB,CAAA;AAEpC;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAmBxH;AAmBD,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,GAAG,aAAa,GAAG,SAAS,CAIzE;AAED,8CAA8C;AAC9C,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS,CAIzE;AAyCD,wBAAgB,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,GAAE,UAAe,GAAG,IAAI,CA+NrE;AAED;;;GAGG;AACH,QAAA,MAAM,MAAM;;;CAAkB,CAAA;AAC9B,eAAe,MAAM,CAAA"}
package/dist/host.js CHANGED
@@ -26,8 +26,12 @@ import { basename, dirname } from 'node:path';
26
26
  import { fileURLToPath } from 'node:url';
27
27
  import { auditJsonPayload, auditRedactRoots, loadAuditData } from './audit-data.js';
28
28
  import { AUDIT_ROUTE_PATH, createAuditRouteHandler } from './host-audit-route.js';
29
+ import { SUMMARY_ROUTE_PATH, createSummaryRouteHandler } from './host-summary-route.js';
30
+ import { createUpgradeRouteHandler } from './host-upgrade-route.js';
31
+ import { buildProfileSummary } from './summary.js';
29
32
  import { createCompatVerdictTool } from './host-tool.js';
30
- import { loadEnv } from '@dsh-triage/core';
33
+ import { judgeUpgradeImpact, loadEnv, resolveDistTagTarget } from '@dsh-triage/core';
34
+ import { fetchPackument } from '@dsh-triage/signals';
31
35
  export const name = 'compat-verdict';
32
36
  /**
33
37
  * Which profile is this Host running? Taken from the loader's config anchor rather than from an
@@ -126,6 +130,32 @@ export function apply(ctx, config = {}) {
126
130
  return;
127
131
  }
128
132
  if (config.auditRoute !== false) {
133
+ /**
134
+ * ONE scaffold for both routes (R51): the two answers a user wants ("is it broken" and "what do
135
+ * I type") must never come from two different reads of the same profile — that is how a tab and
136
+ * a CLI start disagreeing. Each route runs its own scan because each is its own request; what
137
+ * they share is the reader, the redaction and the timestamp rule.
138
+ */
139
+ const scan = async () => {
140
+ const loaded = await loadEnv({ dshHome: bound.dshHome, profile: bound.profile });
141
+ if (!loaded.ok)
142
+ return { ok: false, message: `${loaded.error.code} — ${loaded.error.detail}` };
143
+ const data = await loadAuditData({
144
+ env: loaded.value,
145
+ dshHome: bound.dshHome,
146
+ // The payload's timestamp describes the read, not a verdict: one read, one stamp.
147
+ stamp: new Date().toISOString(),
148
+ snapshotPath: null,
149
+ noRedact: false,
150
+ });
151
+ if (!data.ok)
152
+ return { ok: false, message: data.message };
153
+ return {
154
+ ok: true,
155
+ data: data.data,
156
+ payload: auditJsonPayload(data.data, { noRedact: false, roots: auditRedactRoots(bound.dshHome) }),
157
+ };
158
+ };
129
159
  mountWhenAvailable(ctx, ['webServer'], `read-only ${AUDIT_ROUTE_PATH}`, (scope) => {
130
160
  const webServer = readWebServer(scope);
131
161
  if (webServer === undefined) {
@@ -134,25 +164,160 @@ export function apply(ctx, config = {}) {
134
164
  }
135
165
  const handler = createAuditRouteHandler({
136
166
  read: async () => {
137
- const loaded = await loadEnv({ dshHome: bound.dshHome, profile: bound.profile });
138
- if (!loaded.ok)
139
- return { ok: false, message: `${loaded.error.code} — ${loaded.error.detail}` };
140
- const data = await loadAuditData({
141
- env: loaded.value,
142
- dshHome: bound.dshHome,
143
- // The payload's timestamp describes the read, not a verdict: one read, one stamp.
144
- stamp: new Date().toISOString(),
145
- snapshotPath: null,
146
- noRedact: false,
167
+ const scanned = await scan();
168
+ if (!scanned.ok)
169
+ return { ok: false, message: scanned.message };
170
+ return { ok: true, payload: scanned.payload };
171
+ },
172
+ });
173
+ const summaryHandler = createSummaryRouteHandler({
174
+ read: async () => {
175
+ const startedAt = Date.now();
176
+ const scanned = await scan();
177
+ if (!scanned.ok)
178
+ return { ok: false, message: scanned.message };
179
+ const env = scanned.payload.env ?? {};
180
+ return {
181
+ ok: true,
182
+ body: {
183
+ env: {
184
+ dsh: typeof env.dsh === 'string' ? env.dsh : null,
185
+ profile: typeof env.profile === 'string' ? env.profile : null,
186
+ platform: typeof env.platform === 'string' ? env.platform : null,
187
+ arch: typeof env.arch === 'string' ? env.arch : null,
188
+ },
189
+ // Two locales from one scan: the browser half must not translate judgement language
190
+ // itself, and it must not pick the words that make a verdict sound better.
191
+ summary: {
192
+ zh: buildProfileSummary(scanned.data, { locale: 'zh' }),
193
+ en: buildProfileSummary(scanned.data, { locale: 'en' }),
194
+ },
195
+ ms: Date.now() - startedAt,
196
+ },
197
+ };
198
+ },
199
+ });
200
+ const COUNT_KEY = {
201
+ 'would-be-denied': 'would_be_denied',
202
+ 'cannot-tell': 'cannot_tell',
203
+ improved: 'improved',
204
+ 'likely-fine': 'likely_fine',
205
+ };
206
+ /**
207
+ * The upgrade answer is ON DEMAND and reuses the same scan as the summary. It asks npm only
208
+ * for the two keyword tags (`next` / `latest`), never for an arbitrary version: a settings tab
209
+ * must not become a general-purpose registry client (T-818).
210
+ */
211
+ const upgradeHandler = createUpgradeRouteHandler({
212
+ read: async (tag) => {
213
+ const startedAt = Date.now();
214
+ const stamp = new Date().toISOString();
215
+ /*
216
+ * HARD CAP (T-818): the tab shows a loading sentence, so a registry read that never settles
217
+ * is a red screen with no conclusion. `fetchPackument` has its own abort timer, but a
218
+ * Host-side fetch can still hang in ways that timer does not see; the route promises an
219
+ * answer within its budget, and this race is how that promise is kept.
220
+ */
221
+ let budgetTimer = null;
222
+ const packument = await Promise.race([
223
+ fetchPackument('@deepseek-ai/dsh', { at: stamp, timeoutMs: 10_000 }),
224
+ new Promise((resolve) => {
225
+ budgetTimer = setTimeout(() => resolve({ ok: false, error: { code: 'network-error', detail: 'registry read exceeded 10s', source: 'timeout' } }), 10_000);
226
+ }),
227
+ ]).finally(() => {
228
+ /*
229
+ * R62: `Promise.race` does not cancel the loser, so before this the Host kept a live 10s
230
+ * timer after every click — a tiny leak that also held the event loop open for 10s. The
231
+ * race is still the budget; the timer just no longer outlives its own answer.
232
+ */
233
+ if (budgetTimer !== null)
234
+ clearTimeout(budgetTimer);
235
+ });
236
+ if (!packument.ok) {
237
+ return { ok: false, status: 502, message: `registry unavailable: ${packument.error.code} — ${packument.error.detail}` };
238
+ }
239
+ const resolved = resolveDistTagTarget({ requested: tag, distTags: packument.value.distTags });
240
+ if (!resolved.ok) {
241
+ return { ok: false, status: 502, message: 'detail' in resolved ? String(resolved.detail) : 'the dist-tag could not be resolved' };
242
+ }
243
+ const scanned = await scan();
244
+ if (!scanned.ok)
245
+ return { ok: false, status: 409, message: scanned.message };
246
+ const judged = judgeUpgradeImpact({
247
+ env: scanned.data.env,
248
+ target: resolved.version,
249
+ bundles: scanned.data.bundles,
250
+ rows: scanned.data.rows,
251
+ generatedAt: stamp,
252
+ profileSource: 'live',
147
253
  });
148
- if (!data.ok)
149
- return { ok: false, message: data.message };
150
- return { ok: true, payload: auditJsonPayload(data.data, { noRedact: false, roots: auditRedactRoots(bound.dshHome) }) };
254
+ if (!judged.ok)
255
+ return { ok: false, status: 400, message: judged.detail };
256
+ const ms = Date.now() - startedAt;
257
+ if (ms > 20_000) {
258
+ return { ok: false, status: 504, message: `the scan took ${ms}ms, over the 20s budget; no bucket list is shown` };
259
+ }
260
+ const impact = judged.impact;
261
+ return {
262
+ ok: true,
263
+ body: {
264
+ target: { tag, version: impact.target, relation: impact.target_relation },
265
+ profile: impact.profile,
266
+ current: impact.current,
267
+ counts: impact.counts,
268
+ buckets: impact.buckets.map((bucket) => {
269
+ const key = COUNT_KEY[bucket];
270
+ return { bucket, count: key === undefined ? 0 : impact.counts[key] };
271
+ }),
272
+ units: impact.units.slice(0, 20).map((unit) => ({
273
+ bucket: unit.bucket,
274
+ kind: unit.kind,
275
+ name: unit.name,
276
+ version: unit.version,
277
+ id: unit.id,
278
+ })),
279
+ more: Math.max(0, impact.units.length - 20),
280
+ registry: impact.registry,
281
+ ms,
282
+ limits: [
283
+ 'declaration layer only: this is not a runtime measurement',
284
+ 'the target is the npm dist-tag at click time, not your machine\'s future',
285
+ 'no profile is modified and no package is installed',
286
+ ],
287
+ },
288
+ };
151
289
  },
152
290
  });
153
- const register = () => webServer.register({ kind: 'exact', path: AUDIT_ROUTE_PATH, handler });
154
- const dispose = typeof scope.effect === 'function' ? scope.effect(register, 'compat-triage: audit route') : register();
155
- announce(ctx, `read-only ${AUDIT_ROUTE_PATH} registered (profile ${bound.profile})`);
291
+ /*
292
+ * ONE EXACT ROUTE, TWO ANSWERS (T-818). A third exact route was registered and logged, but the
293
+ * real Host answered 404 for it while `/compat-triage/summary` worked — the route table serves
294
+ * two, not three, on this build. The upgrade answer is therefore selected by an explicit query
295
+ * on the route that already works; a plain `/compat-triage/summary` keeps its exact contract.
296
+ */
297
+ const combinedSummary = async (request, response) => {
298
+ const wantsUpgrade = typeof request.url === 'string' && /[?&]upgrade=/.test(request.url);
299
+ return wantsUpgrade ? upgradeHandler(request, response) : summaryHandler(request, response);
300
+ };
301
+ const register = () => {
302
+ const disposers = [];
303
+ for (const [label, mount] of [
304
+ ['audit', () => webServer.register({ kind: 'exact', path: AUDIT_ROUTE_PATH, handler })],
305
+ ['summary', () => webServer.register({ kind: 'exact', path: SUMMARY_ROUTE_PATH, handler: combinedSummary })],
306
+ ]) {
307
+ try {
308
+ disposers.push(mount());
309
+ }
310
+ catch (error) {
311
+ announce(ctx, `${label} route failed to register: ${error instanceof Error ? error.message : String(error)}`);
312
+ }
313
+ }
314
+ return () => {
315
+ for (const dispose of disposers)
316
+ dispose();
317
+ };
318
+ };
319
+ const dispose = typeof scope.effect === 'function' ? scope.effect(register, 'compat-triage: audit routes') : register();
320
+ announce(ctx, `read-only ${AUDIT_ROUTE_PATH} + ${SUMMARY_ROUTE_PATH} (with ?upgrade=1) registered (profile ${bound.profile})`);
156
321
  void dispose;
157
322
  });
158
323
  }
package/dist/host.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,EAAE,uBAAuB,EAAkD,MAAM,gBAAgB,CAAA;AACxG,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAkD1C,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAA;AAEpC;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAiC;IACzE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IACtC,IAAI,IAAY,CAAA;IAChB,IAAI,CAAC;QACH,IAAI,GAAG,OAAO,YAAY,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAC1F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;IACD;;;;OAIG;IACH,MAAM,OAAO,GAAG,IAA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,OAAO,GAAG,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,oCAAoC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;YAC9H,QAAQ,CAAC,GAAG,EAAE,2CAA2C,KAAK,CAAC,OAAO,GAAG,CAAC,CAAA;YAC1E,KAAK,OAAO,CAAA;QACd,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;AAC9B,eAAe,MAAM,CAAA"}
package/dist/serve.js CHANGED
@@ -1256,8 +1256,8 @@ function panelCopy(locale) {
1256
1256
  themes: { auto: '自动', light: '浅色', dark: '深色' },
1257
1257
  loading: '正在读取 profile',
1258
1258
  loadingSub: '',
1259
- issues: '问题',
1260
- next: '命令',
1259
+ issues: '待处理问题',
1260
+ next: '后续建议',
1261
1261
  showAll: '显示全部',
1262
1262
  copyReport: '复制全文',
1263
1263
  evidence: '产物',
@@ -1268,19 +1268,19 @@ function panelCopy(locale) {
1268
1268
  conclusion: '结论',
1269
1269
  at: '时间',
1270
1270
  hash: 'sha256',
1271
- empty: '这里没有产物。用 --results <目录> 指向别处,或先跑一次 record_* 脚本。',
1272
- noIssues: '这套组合里没有要处理的行。',
1273
- noFiltered: '这一类里没有要处理的行。',
1274
- noNext: '没有要跑的命令。',
1275
- more: '另有 {n} 条没显示(摘要只列前几条,全量见 dsh-triage audit --json)',
1271
+ empty: '当前目录未发现评测产物。可通过 --results <目录> 指定路径。',
1272
+ noIssues: '未检测到需要处理的兼容性异常。',
1273
+ noFiltered: '当前筛选分类下无匹配的问题条目。',
1274
+ noNext: '暂无建议操作。',
1275
+ more: '另有 {n} 项未在摘要中展开(查看完整明细请使用 dsh-triage audit --json)',
1276
1276
  copy: '复制',
1277
1277
  copied: '已复制',
1278
1278
  copyFailed: '复制失败,请手动选中',
1279
- off: '面板以 --no-audit 启动,不读取当前 profile。去掉该参数就能看到结论。',
1279
+ off: '面板以 --no-audit 参数启动,未读取当前 Profile。移除该参数后即可显示诊断结论。',
1280
1280
  offIssues: '未读取(--no-audit)',
1281
- failed: '读不到当前 profile',
1281
+ failed: '读取当前 Profile 失败',
1282
1282
  unknownValue: '未知',
1283
- unjudged: '其余 {n} 行不声明任何 DSH 区间',
1283
+ unjudged: '另有 {n} 项未声明任何 DSH 依赖区间,未作推演',
1284
1284
  searchPlaceholder: '搜索产物名 / 类型 / 对象',
1285
1285
  allKinds: '全部类型',
1286
1286
  allConclusions: '全部结论',
@@ -1291,24 +1291,24 @@ function panelCopy(locale) {
1291
1291
  copyName: '复制名称',
1292
1292
  copySha: '复制 sha256',
1293
1293
  copyJson: '复制 JSON',
1294
- artifactFailed: '读不到这份产物',
1295
- reportTitle: '结论',
1294
+ artifactFailed: '无法读取该产物数据',
1295
+ reportTitle: '诊断结论',
1296
1296
  kbdHint: '/ 搜索 · r 重新检查 · l 主题 · Esc 关闭',
1297
1297
  viewLabel: '详细程度',
1298
1298
  viewSimple: '简单',
1299
1299
  viewAdvanced: '详细',
1300
1300
  actionFix: '复制修复命令',
1301
1301
  actionFixHint: '粘贴到终端执行',
1302
- actionCopy: '复制这份结果',
1303
- actionCopyHint: '贴到 issue 或聊天里',
1304
- figureBroken: '处会坏',
1305
- figurePending: '处待确认',
1306
- figureOk: '处问题',
1302
+ actionCopy: '复制诊断结果',
1303
+ actionCopyHint: '便于在 Issue 或社区中反馈',
1304
+ figureBroken: '项异常',
1305
+ figurePending: '项待确认',
1306
+ figureOk: '项异常',
1307
1307
  checked: '检查用时 {ms} 毫秒',
1308
- unjudgedSimple: '另外 {n} 个插件没声明支持的版本,判不了',
1309
- conclusions: { go: '正常', passed: '通过', rendered: '渲染正常', blocked: '被拒', failed: '失败', blank: '白屏', risky: '有风险', unknown: '判不了', '∅': '无结论' },
1310
- chips: { rows: '行', judged: '有判定', go: '正常', denied: '被拒', unknown: '判不了', collisions: '冲突' },
1311
- kindLabels: { denied: '被拒', collision: '冲突', duplicate: '重复', unknown: '判不了', unreadable: '读不到' },
1308
+ unjudgedSimple: '另有 {n} 个插件未显式声明依赖区间,未作推演',
1309
+ conclusions: { go: '正常', passed: '通过', rendered: '渲染正常', blocked: '拦截', failed: '失败', blank: '白屏', risky: '有风险', unknown: '未明确', '∅': '无结论' },
1310
+ chips: { rows: '配置项总数', judged: '已分析', go: '正常', denied: '存在异常', unknown: '未明确', collisions: '标识冲突' },
1311
+ kindLabels: { denied: '版本不符', collision: '标识冲突', duplicate: '多版本重复', unknown: '未明确', unreadable: '无法解析' },
1312
1312
  };
1313
1313
  }
1314
1314
  //# sourceMappingURL=serve.js.map