@dsh-triage/core 0.1.0 → 0.3.0
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/dist/exemption.d.ts +36 -0
- package/dist/exemption.d.ts.map +1 -0
- package/dist/exemption.js +74 -0
- package/dist/exemption.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +50 -0
- package/dist/messages.js.map +1 -1
- package/dist/outcome.d.ts +143 -0
- package/dist/outcome.d.ts.map +1 -0
- package/dist/outcome.js +376 -0
- package/dist/outcome.js.map +1 -0
- package/dist/upgrade-card.d.ts +44 -0
- package/dist/upgrade-card.d.ts.map +1 -0
- package/dist/upgrade-card.js +210 -0
- package/dist/upgrade-card.js.map +1 -0
- package/dist/upgrade-target.d.ts +59 -0
- package/dist/upgrade-target.d.ts.map +1 -0
- package/dist/upgrade-target.js +75 -0
- package/dist/upgrade-target.js.map +1 -0
- package/dist/upgrade.d.ts +202 -0
- package/dist/upgrade.d.ts.map +1 -0
- package/dist/upgrade.js +538 -0
- package/dist/upgrade.js.map +1 -0
- package/dist/verdict.d.ts +6 -0
- package/dist/verdict.d.ts.map +1 -1
- package/dist/verdict.js +33 -0
- package/dist/verdict.js.map +1 -1
- package/package.json +4 -1
package/dist/upgrade.js
ADDED
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upgrade impact: "if I move to dsh `<target>`, which loader rows and bundles get denied?"
|
|
3
|
+
*
|
|
4
|
+
* WHAT THIS MODULE IS ALLOWED TO SAY
|
|
5
|
+
* ----------------------------------
|
|
6
|
+
* One thing per unit: **would the target runtime be admitted by the range this unit
|
|
7
|
+
* declares?** It answers that by calling `evaluateAdmission` — the same function `why`,
|
|
8
|
+
* `check`, `audit` and the panel use — with `env.dsh` replaced by the target. There is no
|
|
9
|
+
* second range implementation here on purpose: admission semantics are locked by
|
|
10
|
+
* `data/gold/admission-cases.json`, and a local copy of "engines first, then peers" would
|
|
11
|
+
* be a second rule set that drifts silently.
|
|
12
|
+
*
|
|
13
|
+
* WHAT IT REFUSES TO SAY
|
|
14
|
+
* ----------------------
|
|
15
|
+
* - "this row will *work*": a declaration being admitted is not a measurement;
|
|
16
|
+
* - anything about feature behaviour, configuration names or data migration;
|
|
17
|
+
* - anything about a plugin that is not installed (no manifest = nothing to judge);
|
|
18
|
+
* - anything about another profile. `impact.profile` names the one that was read
|
|
19
|
+
* (`BS-38`: two profiles, two correct answers).
|
|
20
|
+
*
|
|
21
|
+
* PURITY
|
|
22
|
+
* ------
|
|
23
|
+
* No filesystem access, no network, no clock, no environment reads. Rows and bundles arrive
|
|
24
|
+
* already parsed, the timestamp arrives from the caller. Same input (in any array order) →
|
|
25
|
+
* byte-identical output: the ordering keys below form a total order and never use
|
|
26
|
+
* `localeCompare`, whose result depends on the ICU build of the machine that runs it.
|
|
27
|
+
*/
|
|
28
|
+
import { gt, valid } from 'semver';
|
|
29
|
+
import { evaluateAdmission } from './admission.js';
|
|
30
|
+
import { catalogFor, format } from './messages.js';
|
|
31
|
+
import { verdictFromAdmission, verdictsFromRowAdmission } from './verdict.js';
|
|
32
|
+
/** The four buckets, in terminal order. A unit lands in exactly one of them. */
|
|
33
|
+
export const UPGRADE_BUCKETS = ['would-be-denied', 'cannot-tell', 'improved', 'likely-fine'];
|
|
34
|
+
/**
|
|
35
|
+
* Validate a target before anything is read.
|
|
36
|
+
*
|
|
37
|
+
* Exposed because the CLI must reject `--to ^0.3.0` **before** it touches a profile: a
|
|
38
|
+
* usage error that depends on whether the profile exists would report the wrong thing.
|
|
39
|
+
*/
|
|
40
|
+
export function upgradeTargetProblem(target) {
|
|
41
|
+
const trimmed = target.trim();
|
|
42
|
+
if (trimmed === '')
|
|
43
|
+
return 'target must be an exact semver version; got an empty string';
|
|
44
|
+
if (valid(trimmed) === null) {
|
|
45
|
+
return `target must be an exact semver version (got "${target}"); only the keywords next and latest are resolved from npm, everything else must be exact`;
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Judge the impact of moving to `input.target`.
|
|
51
|
+
*
|
|
52
|
+
* The target is validated first: `semver.satisfies('0.3', '*')` returns `false` without
|
|
53
|
+
* throwing, so an unvalidated target would silently turn every unit into "denied". A bad
|
|
54
|
+
* target is a usage error, not a finding.
|
|
55
|
+
*/
|
|
56
|
+
export function judgeUpgradeImpact(input) {
|
|
57
|
+
const problem = upgradeTargetProblem(input.target);
|
|
58
|
+
if (problem !== null) {
|
|
59
|
+
return { ok: false, code: 'invalid-target', detail: problem, target: input.target };
|
|
60
|
+
}
|
|
61
|
+
const target = input.target.trim();
|
|
62
|
+
const env = input.env;
|
|
63
|
+
const current = env.dsh === null || env.dsh.trim() === '' ? null : env.dsh.trim();
|
|
64
|
+
const targetEnv = { ...env, dsh: target };
|
|
65
|
+
const registryFacts = [...(input.registry ?? [])];
|
|
66
|
+
const units = [
|
|
67
|
+
...input.bundles.map((bundle) => bundleUnit(bundle, env, targetEnv, current, input.generatedAt)),
|
|
68
|
+
...input.rows.map((row) => rowUnit(row, env, targetEnv, current, input.generatedAt)),
|
|
69
|
+
];
|
|
70
|
+
// Attach registry annotations AFTER every bucket decision. This ordering is the whole
|
|
71
|
+
// reason a registry fact cannot move a unit: by the time it is read, `bucket` is frozen.
|
|
72
|
+
const annotated = units.map((unit) => ({ ...unit, suggestions: notesFor(unit, registryFacts) }));
|
|
73
|
+
const ordered = [...annotated].sort(compareUnits);
|
|
74
|
+
return {
|
|
75
|
+
ok: true,
|
|
76
|
+
impact: {
|
|
77
|
+
schema_version: 1,
|
|
78
|
+
profile: env.profile,
|
|
79
|
+
profile_source: input.profileSource ?? 'live',
|
|
80
|
+
current,
|
|
81
|
+
current_valid: current !== null && valid(current) !== null,
|
|
82
|
+
target,
|
|
83
|
+
target_valid: true,
|
|
84
|
+
target_relation: relationOf(current, target),
|
|
85
|
+
buckets: UPGRADE_BUCKETS,
|
|
86
|
+
counts: countOf(ordered),
|
|
87
|
+
units: ordered,
|
|
88
|
+
registry: {
|
|
89
|
+
consulted: registryFacts.length > 0 || (input.registryFailures ?? []).length > 0,
|
|
90
|
+
facts: registryFacts.length,
|
|
91
|
+
failures: [...(input.registryFailures ?? [])].sort((left, right) => compareStrings(left.package, right.package) || compareStrings(left.code, right.code)),
|
|
92
|
+
},
|
|
93
|
+
generated_at: input.generatedAt,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Classify one unit by **target status first, then current status**.
|
|
99
|
+
*
|
|
100
|
+
* Kept in one place so `would-be-denied` cannot mean two different things for a row and a
|
|
101
|
+
* bundle, and so `improved` has exactly one definition (spec §4.1).
|
|
102
|
+
*/
|
|
103
|
+
function classify(input) {
|
|
104
|
+
if (input.manifest === null) {
|
|
105
|
+
// A row with no installed package has a verdict the engine already knows how to write
|
|
106
|
+
// (it names `missing.row-module`); a bundle from a snapshot does not, and says so itself.
|
|
107
|
+
const verdict = input.row === null
|
|
108
|
+
? null
|
|
109
|
+
: (verdictsFromRowAdmission({
|
|
110
|
+
env: input.targetEnv,
|
|
111
|
+
rows: [input.row],
|
|
112
|
+
generatedAt: input.generatedAt,
|
|
113
|
+
})[0] ?? null);
|
|
114
|
+
return {
|
|
115
|
+
bucket: 'cannot-tell',
|
|
116
|
+
cause: 'not-installed',
|
|
117
|
+
verdict,
|
|
118
|
+
missing_evidence: verdict === null ? ['missing.admission'] : verdict.missingEvidence,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const admission = evaluateAdmission(input.manifest, input.targetEnv.dsh ?? '');
|
|
122
|
+
if (admission.status === 'indeterminate') {
|
|
123
|
+
// Unreachable with a validated target; kept so a future caller cannot get `likely-fine`.
|
|
124
|
+
return { bucket: 'cannot-tell', cause: 'runtime-unknown', verdict: null, missing_evidence: ['missing.runtime'] };
|
|
125
|
+
}
|
|
126
|
+
if (admission.status === 'unconstrained') {
|
|
127
|
+
const verdict = verdictAt(input, admission);
|
|
128
|
+
return {
|
|
129
|
+
bucket: 'cannot-tell',
|
|
130
|
+
cause: 'no-declaration',
|
|
131
|
+
verdict,
|
|
132
|
+
missing_evidence: verdict.missingEvidence,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
if (admission.status === 'denied') {
|
|
136
|
+
// A range that can never be satisfied (`""`, `workspace:*`, not-semver) denies on *any*
|
|
137
|
+
// runtime. Reporting it as `target-denied` would blame the upgrade for a defect that is
|
|
138
|
+
// already there; reporting it as `cannot-tell` would hide a definite denial. So it stays
|
|
139
|
+
// in `would-be-denied` with a cause that says why (spec §14 #1).
|
|
140
|
+
const unusable = admission.unmet.length > 0 && admission.unmet.every((requirement) => requirement.failure !== null);
|
|
141
|
+
return {
|
|
142
|
+
bucket: 'would-be-denied',
|
|
143
|
+
cause: unusable ? 'unusable-declaration' : 'target-denied',
|
|
144
|
+
verdict: verdictAt(input, admission),
|
|
145
|
+
missing_evidence: [],
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
// admitted at target: the only branch where `improved` can exist.
|
|
149
|
+
const currentAdmission = currentAdmissionOf(input.manifest, input.current);
|
|
150
|
+
const improved = currentAdmission !== null &&
|
|
151
|
+
currentAdmission.status === 'denied' &&
|
|
152
|
+
currentAdmission.unmet.some((requirement) => requirement.failure === null);
|
|
153
|
+
return {
|
|
154
|
+
bucket: improved ? 'improved' : 'likely-fine',
|
|
155
|
+
cause: improved ? 'denied-now-admitted-then' : 'admitted-at-target',
|
|
156
|
+
verdict: verdictAt(input, admission),
|
|
157
|
+
missing_evidence: [],
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The verdict the same engine would print for this unit at the **target** runtime.
|
|
162
|
+
*
|
|
163
|
+
* Rows go through `verdictsFromRowAdmission` so the row id, the `disable-entry` remediation
|
|
164
|
+
* and the unmet reasons are exactly what `why` prints for a denied row. Admitted rows return
|
|
165
|
+
* no row verdict there (silence is `why`'s "fine"), so they fall back to the plugin-shaped
|
|
166
|
+
* builder. Bundles always use the plugin-shaped builder — a bundle has no row to name.
|
|
167
|
+
*/
|
|
168
|
+
function verdictAt(input, admission) {
|
|
169
|
+
if (input.kind === 'row' && input.row !== null) {
|
|
170
|
+
const [rowVerdict] = verdictsFromRowAdmission({
|
|
171
|
+
env: input.targetEnv,
|
|
172
|
+
rows: [input.row],
|
|
173
|
+
generatedAt: input.generatedAt,
|
|
174
|
+
});
|
|
175
|
+
if (rowVerdict !== undefined)
|
|
176
|
+
return rowVerdict;
|
|
177
|
+
}
|
|
178
|
+
return verdictFromAdmission({
|
|
179
|
+
subject: {
|
|
180
|
+
name: input.name,
|
|
181
|
+
version: input.version,
|
|
182
|
+
kind: input.kind === 'row' ? 'entry' : 'plugin',
|
|
183
|
+
},
|
|
184
|
+
env: input.targetEnv,
|
|
185
|
+
admission,
|
|
186
|
+
generatedAt: input.generatedAt,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function bundleUnit(bundle, env, targetEnv, current, generatedAt) {
|
|
190
|
+
const classification = classify({
|
|
191
|
+
kind: 'bundle',
|
|
192
|
+
name: bundle.name,
|
|
193
|
+
version: bundle.version,
|
|
194
|
+
manifest: bundle.manifest,
|
|
195
|
+
targetEnv,
|
|
196
|
+
current,
|
|
197
|
+
generatedAt,
|
|
198
|
+
row: null,
|
|
199
|
+
});
|
|
200
|
+
return unitOf({
|
|
201
|
+
id: `bundle:${bundle.name}`,
|
|
202
|
+
kind: 'bundle',
|
|
203
|
+
name: bundle.name,
|
|
204
|
+
version: bundle.version,
|
|
205
|
+
rowIds: [],
|
|
206
|
+
source: null,
|
|
207
|
+
classification,
|
|
208
|
+
manifest: bundle.manifest,
|
|
209
|
+
targetEnv,
|
|
210
|
+
current,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
function rowUnit(row, env, targetEnv, current, generatedAt) {
|
|
214
|
+
const classification = classify({
|
|
215
|
+
kind: 'row',
|
|
216
|
+
name: row.module,
|
|
217
|
+
version: row.version,
|
|
218
|
+
manifest: row.manifest,
|
|
219
|
+
targetEnv,
|
|
220
|
+
current,
|
|
221
|
+
generatedAt,
|
|
222
|
+
row,
|
|
223
|
+
});
|
|
224
|
+
return unitOf({
|
|
225
|
+
id: `row:${row.rowId}`,
|
|
226
|
+
kind: 'row',
|
|
227
|
+
name: row.module,
|
|
228
|
+
version: row.version,
|
|
229
|
+
rowIds: [row.rowId],
|
|
230
|
+
source: row.source,
|
|
231
|
+
classification,
|
|
232
|
+
manifest: row.manifest,
|
|
233
|
+
targetEnv,
|
|
234
|
+
current,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function unitOf(input) {
|
|
238
|
+
const target = standingOf(input.manifest, input.targetEnv.dsh);
|
|
239
|
+
const currentStanding = standingOf(input.manifest, input.current);
|
|
240
|
+
const verdict = input.classification.verdict;
|
|
241
|
+
return {
|
|
242
|
+
id: input.id,
|
|
243
|
+
kind: input.kind,
|
|
244
|
+
name: input.name,
|
|
245
|
+
version: input.version,
|
|
246
|
+
row_ids: input.rowIds,
|
|
247
|
+
source: input.source,
|
|
248
|
+
bucket: input.classification.bucket,
|
|
249
|
+
cause: input.classification.cause,
|
|
250
|
+
already_denied_at_current: currentStanding.status === 'denied',
|
|
251
|
+
current: currentStanding,
|
|
252
|
+
target,
|
|
253
|
+
remediation: verdict === null ? [] : verdict.remediation,
|
|
254
|
+
reasons: verdict === null ? [] : verdict.reasons,
|
|
255
|
+
missing_evidence: input.classification.missing_evidence,
|
|
256
|
+
verdict,
|
|
257
|
+
suggestions: [],
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
/* --------------------------------- standings --------------------------------- */
|
|
261
|
+
/**
|
|
262
|
+
* Evaluate one manifest on one runtime **without inventing an answer**.
|
|
263
|
+
*
|
|
264
|
+
* `runtime === null` and an unparsable runtime are both "not evaluated": `satisfies()` would
|
|
265
|
+
* return `false` for a garbage version and we would report a denial that means nothing.
|
|
266
|
+
*/
|
|
267
|
+
function standingOf(manifest, runtime) {
|
|
268
|
+
const name = runtime === null || runtime.trim() === '' ? null : runtime.trim();
|
|
269
|
+
if (manifest === null)
|
|
270
|
+
return { runtime: name, status: 'not-installed', mode: null, unmet: [] };
|
|
271
|
+
if (name === null)
|
|
272
|
+
return { runtime: null, status: null, mode: null, unmet: [] };
|
|
273
|
+
if (valid(name) === null)
|
|
274
|
+
return { runtime: name, status: 'invalid-runtime', mode: null, unmet: [] };
|
|
275
|
+
const admission = evaluateAdmission(manifest, name);
|
|
276
|
+
return { runtime: name, status: admission.status, mode: admission.mode, unmet: admission.unmet };
|
|
277
|
+
}
|
|
278
|
+
function currentAdmissionOf(manifest, current) {
|
|
279
|
+
if (current === null || valid(current) === null)
|
|
280
|
+
return null;
|
|
281
|
+
return evaluateAdmission(manifest, current);
|
|
282
|
+
}
|
|
283
|
+
function relationOf(current, target) {
|
|
284
|
+
if (current === null || valid(current) === null)
|
|
285
|
+
return 'unknown';
|
|
286
|
+
if (current === target)
|
|
287
|
+
return 'same';
|
|
288
|
+
return gt(target, current) ? 'newer' : 'older';
|
|
289
|
+
}
|
|
290
|
+
/* ------------------------------- registry notes ------------------------------- */
|
|
291
|
+
/**
|
|
292
|
+
* Turn one packument's version→manifest map into ONE annotation.
|
|
293
|
+
*
|
|
294
|
+
* Chosen here (in core, next to the range logic) rather than in the CLI, because picking
|
|
295
|
+
* "the newest version whose declaration admits the target" needs semver ordering — a second
|
|
296
|
+
* implementation of that ordering in the CLI would be exactly the kind of drift this file
|
|
297
|
+
* exists to avoid.
|
|
298
|
+
*
|
|
299
|
+
* `admitsTarget: false` is a legitimate answer: it means "I looked, and no published version
|
|
300
|
+
* declares the target". Dropping it would make the search invisible.
|
|
301
|
+
*/
|
|
302
|
+
export function registryFactFor(input) {
|
|
303
|
+
if (upgradeTargetProblem(input.target) !== null)
|
|
304
|
+
return null;
|
|
305
|
+
const target = input.target.trim();
|
|
306
|
+
const candidates = [...input.versions.entries()]
|
|
307
|
+
.filter((entry) => valid(entry[0]) !== null)
|
|
308
|
+
.sort((left, right) => (gt(left[0], right[0]) ? -1 : gt(right[0], left[0]) ? 1 : 0));
|
|
309
|
+
const newest = candidates[0];
|
|
310
|
+
if (newest === undefined)
|
|
311
|
+
return null;
|
|
312
|
+
const admitting = candidates.find(([, manifest]) => evaluateAdmission(manifest, target).status === 'admitted');
|
|
313
|
+
const chosen = admitting ?? newest;
|
|
314
|
+
return {
|
|
315
|
+
package: input.packageName,
|
|
316
|
+
version: chosen[0],
|
|
317
|
+
declaredRange: describeDeclaredRanges(evaluateAdmission(chosen[1], target)),
|
|
318
|
+
admitsTarget: admitting !== undefined,
|
|
319
|
+
publishedAt: input.publishedAt?.[chosen[0]] ?? null,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
/** How the annotation names the declaration: `engines.dsh 0.1.0-rc.6`, `@x/dsh-llm@0.2.1-rc.4`. */
|
|
323
|
+
function describeDeclaredRanges(admission) {
|
|
324
|
+
if (admission.requirements.length === 0)
|
|
325
|
+
return 'no declaration';
|
|
326
|
+
const shown = admission.requirements
|
|
327
|
+
.slice(0, 3)
|
|
328
|
+
.map((requirement) => (requirement.key === 'dsh' ? `engines.dsh ${requirement.range}` : `${requirement.key}@${requirement.range}`));
|
|
329
|
+
const rest = admission.requirements.length - shown.length;
|
|
330
|
+
return rest > 0 ? `${shown.join(' & ')} (+${rest} more)` : shown.join(' & ');
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Attach registry facts as annotations.
|
|
334
|
+
*
|
|
335
|
+
* Only `would-be-denied` / `cannot-tell` units get them: those are the units where "is there
|
|
336
|
+
* a published build that declares the target?" is the next question. A fact with
|
|
337
|
+
* `admitsTarget: false` is still attached — it is evidence that was looked up, and dropping
|
|
338
|
+
* it would hide the search.
|
|
339
|
+
*/
|
|
340
|
+
function notesFor(unit, facts) {
|
|
341
|
+
if (facts.length === 0)
|
|
342
|
+
return [];
|
|
343
|
+
if (unit.bucket !== 'would-be-denied' && unit.bucket !== 'cannot-tell')
|
|
344
|
+
return [];
|
|
345
|
+
return facts
|
|
346
|
+
.filter((fact) => fact.package === unit.name)
|
|
347
|
+
.map((fact) => ({
|
|
348
|
+
annotation_only: true,
|
|
349
|
+
tier: 'measured-registry',
|
|
350
|
+
package: fact.package,
|
|
351
|
+
version: fact.version,
|
|
352
|
+
declared_range: fact.declaredRange,
|
|
353
|
+
admits_target: fact.admitsTarget,
|
|
354
|
+
published_at: fact.publishedAt ?? null,
|
|
355
|
+
note_id: 'upgrade.registry-annotation',
|
|
356
|
+
}))
|
|
357
|
+
.sort((left, right) => compareVersionsDescending(left.version, right.version));
|
|
358
|
+
}
|
|
359
|
+
/* --------------------------------- ordering ---------------------------------- */
|
|
360
|
+
const BUCKET_RANK = {
|
|
361
|
+
'would-be-denied': 0,
|
|
362
|
+
'cannot-tell': 1,
|
|
363
|
+
improved: 2,
|
|
364
|
+
'likely-fine': 3,
|
|
365
|
+
};
|
|
366
|
+
const KIND_RANK = { bundle: 0, row: 1 };
|
|
367
|
+
/**
|
|
368
|
+
* Total order: bucket → kind → name → version → id.
|
|
369
|
+
*
|
|
370
|
+
* `localeCompare` is not used anywhere in this chain: it depends on the ICU build, so the
|
|
371
|
+
* same input could sort differently on two machines and the artifact would stop reproducing.
|
|
372
|
+
*/
|
|
373
|
+
export function compareUnits(left, right) {
|
|
374
|
+
return (BUCKET_RANK[left.bucket] - BUCKET_RANK[right.bucket] ||
|
|
375
|
+
KIND_RANK[left.kind] - KIND_RANK[right.kind] ||
|
|
376
|
+
compareStrings(left.name, right.name) ||
|
|
377
|
+
compareStrings(left.version ?? '', right.version ?? '') ||
|
|
378
|
+
compareStrings(left.id, right.id));
|
|
379
|
+
}
|
|
380
|
+
function compareStrings(left, right) {
|
|
381
|
+
if (left === right)
|
|
382
|
+
return 0;
|
|
383
|
+
return left < right ? -1 : 1;
|
|
384
|
+
}
|
|
385
|
+
function compareVersionsDescending(left, right) {
|
|
386
|
+
const leftValid = valid(left) !== null;
|
|
387
|
+
const rightValid = valid(right) !== null;
|
|
388
|
+
if (leftValid && rightValid)
|
|
389
|
+
return gt(left, right) ? -1 : gt(right, left) ? 1 : 0;
|
|
390
|
+
if (leftValid !== rightValid)
|
|
391
|
+
return leftValid ? -1 : 1;
|
|
392
|
+
return compareStrings(right, left);
|
|
393
|
+
}
|
|
394
|
+
function countOf(units) {
|
|
395
|
+
const count = (bucket) => units.filter((unit) => unit.bucket === bucket).length;
|
|
396
|
+
const bundles = units.filter((unit) => unit.kind === 'bundle').length;
|
|
397
|
+
return {
|
|
398
|
+
bundles,
|
|
399
|
+
rows: units.length - bundles,
|
|
400
|
+
would_be_denied: count('would-be-denied'),
|
|
401
|
+
cannot_tell: count('cannot-tell'),
|
|
402
|
+
improved: count('improved'),
|
|
403
|
+
likely_fine: count('likely-fine'),
|
|
404
|
+
total: units.length,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
/* --------------------------------- rendering --------------------------------- */
|
|
408
|
+
/** Units printed per bucket before the terminal says "… N more, --json". */
|
|
409
|
+
const MAX_RENDERED_UNITS = 20;
|
|
410
|
+
/** Reasons and fixes printed per unit; the full lists live in `--json`. */
|
|
411
|
+
const MAX_DETAIL_PER_UNIT = 2;
|
|
412
|
+
const FIX_PRIORITY = [
|
|
413
|
+
'pin-version',
|
|
414
|
+
'disable-entry',
|
|
415
|
+
'downgrade-dsh',
|
|
416
|
+
'upgrade-dsh',
|
|
417
|
+
'allow-version',
|
|
418
|
+
'probe',
|
|
419
|
+
'report',
|
|
420
|
+
'remove-plugin',
|
|
421
|
+
];
|
|
422
|
+
const BUCKET_LABEL = {
|
|
423
|
+
'would-be-denied': 'upgrade.bucket.would-be-denied',
|
|
424
|
+
'cannot-tell': 'upgrade.bucket.cannot-tell',
|
|
425
|
+
improved: 'upgrade.bucket.improved',
|
|
426
|
+
'likely-fine': 'upgrade.bucket.likely-fine',
|
|
427
|
+
};
|
|
428
|
+
const COUNT_KEY = {
|
|
429
|
+
'would-be-denied': 'would_be_denied',
|
|
430
|
+
'cannot-tell': 'cannot_tell',
|
|
431
|
+
improved: 'improved',
|
|
432
|
+
'likely-fine': 'likely_fine',
|
|
433
|
+
};
|
|
434
|
+
const RELATION_ID = {
|
|
435
|
+
same: 'upgrade.relation.same',
|
|
436
|
+
newer: 'upgrade.relation.newer',
|
|
437
|
+
older: 'upgrade.relation.older',
|
|
438
|
+
unknown: 'upgrade.relation.unknown',
|
|
439
|
+
};
|
|
440
|
+
/** Terminal rendering. Pure: locale in, text out; no colour, no clock, no width probing. */
|
|
441
|
+
export function renderUpgradeImpact(impact, locale) {
|
|
442
|
+
const catalog = catalogFor(locale);
|
|
443
|
+
const text = (id, params) => {
|
|
444
|
+
const template = catalog.messages[id];
|
|
445
|
+
return template === undefined ? `?${id}` : format(template, params);
|
|
446
|
+
};
|
|
447
|
+
const lines = [];
|
|
448
|
+
lines.push(text('upgrade.header', {
|
|
449
|
+
target: impact.target,
|
|
450
|
+
units: impact.counts.total,
|
|
451
|
+
bundles: impact.counts.bundles,
|
|
452
|
+
rows: impact.counts.rows,
|
|
453
|
+
}));
|
|
454
|
+
lines.push(text(RELATION_ID[impact.target_relation], {
|
|
455
|
+
target: impact.target,
|
|
456
|
+
current: impact.current ?? 'unknown',
|
|
457
|
+
}));
|
|
458
|
+
lines.push(text('upgrade.profile-scope', { profile: impact.profile, source: impact.profile_source }));
|
|
459
|
+
lines.push(text('upgrade.admitted-only', { target: impact.target }));
|
|
460
|
+
if (impact.counts.total === 0) {
|
|
461
|
+
lines.push('');
|
|
462
|
+
lines.push(text('upgrade.nothing-sampled', { profile: impact.profile }));
|
|
463
|
+
return `${lines.join('\n')}\n`;
|
|
464
|
+
}
|
|
465
|
+
for (const bucket of impact.buckets) {
|
|
466
|
+
const units = impact.units.filter((unit) => unit.bucket === bucket);
|
|
467
|
+
const count = impact.counts[COUNT_KEY[bucket]];
|
|
468
|
+
lines.push('');
|
|
469
|
+
lines.push(text(BUCKET_LABEL[bucket], { count, target: impact.target }));
|
|
470
|
+
for (const unit of units.slice(0, MAX_RENDERED_UNITS)) {
|
|
471
|
+
lines.push(` ${unit.id}${unit.version === null ? '' : ` ${unit.name}@${unit.version}`}`);
|
|
472
|
+
if (unit.cause === 'unusable-declaration')
|
|
473
|
+
lines.push(` ${text('upgrade.unusable-declaration', { target: impact.target })}`);
|
|
474
|
+
if (unit.already_denied_at_current)
|
|
475
|
+
lines.push(` ${text('upgrade.already-denied', { current: impact.current ?? 'unknown' })}`);
|
|
476
|
+
for (const reason of pickBlockingReasons(unit)) {
|
|
477
|
+
lines.push(` reason ${text(reason.messageId, reason.params)}`);
|
|
478
|
+
}
|
|
479
|
+
for (const reason of pickCurrentBlockingReasons(unit)) {
|
|
480
|
+
lines.push(` now ${text(reason.messageId, reason.params)}`);
|
|
481
|
+
}
|
|
482
|
+
for (const missing of unit.missing_evidence) {
|
|
483
|
+
lines.push(` missing ${text(missing)}`);
|
|
484
|
+
}
|
|
485
|
+
const fixes = orderedFixes(unit.remediation);
|
|
486
|
+
for (const fix of fixes.slice(0, MAX_DETAIL_PER_UNIT)) {
|
|
487
|
+
lines.push(` fix [${fix.kind}] ${fix.messageId === undefined ? fix.note : text(fix.messageId, fix.params)}`);
|
|
488
|
+
}
|
|
489
|
+
if (fixes.length > MAX_DETAIL_PER_UNIT) {
|
|
490
|
+
lines.push(` … ${text('upgrade.more-fixes', { count: fixes.length - MAX_DETAIL_PER_UNIT })}`);
|
|
491
|
+
}
|
|
492
|
+
for (const note of unit.suggestions) {
|
|
493
|
+
lines.push(` ${text('upgrade.registry-annotation', {
|
|
494
|
+
package: note.package,
|
|
495
|
+
version: note.version,
|
|
496
|
+
range: note.declared_range,
|
|
497
|
+
target: impact.target,
|
|
498
|
+
verdict: note.admits_target ? 'admitted' : 'denied',
|
|
499
|
+
})}`);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
if (count > MAX_RENDERED_UNITS) {
|
|
503
|
+
lines.push(` ${text('upgrade.more-units', { count: count - MAX_RENDERED_UNITS })}`);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
for (const failure of impact.registry.failures) {
|
|
507
|
+
lines.push(`registry ${failure.package}: ${failure.code} (${failure.detail})`);
|
|
508
|
+
}
|
|
509
|
+
return `${lines.join('\n')}\n`;
|
|
510
|
+
}
|
|
511
|
+
function pickBlockingReasons(unit) {
|
|
512
|
+
return unit.reasons.filter((reason) => reason.severity === 'block').slice(0, MAX_DETAIL_PER_UNIT);
|
|
513
|
+
}
|
|
514
|
+
/** For `improved`: the denial that exists **today**, which is what makes the unit interesting. */
|
|
515
|
+
function pickCurrentBlockingReasons(unit) {
|
|
516
|
+
if (unit.bucket !== 'improved')
|
|
517
|
+
return [];
|
|
518
|
+
return unit.current.unmet
|
|
519
|
+
.slice(0, MAX_DETAIL_PER_UNIT)
|
|
520
|
+
.map((requirement) => ({
|
|
521
|
+
code: 'upgrade-current-unmet',
|
|
522
|
+
severity: 'info',
|
|
523
|
+
messageId: requirement.key === 'dsh' ? 'admission.unmet.engines' : 'admission.unmet.peer',
|
|
524
|
+
params: { key: requirement.key, range: requirement.range, runtime: unit.current.runtime ?? 'unknown' },
|
|
525
|
+
}));
|
|
526
|
+
}
|
|
527
|
+
function orderedFixes(remediation) {
|
|
528
|
+
const rank = (kind) => {
|
|
529
|
+
const index = FIX_PRIORITY.indexOf(kind);
|
|
530
|
+
return index === -1 ? FIX_PRIORITY.length : index;
|
|
531
|
+
};
|
|
532
|
+
return [...remediation].sort((left, right) => rank(left.kind) - rank(right.kind) || compareStrings(left.note, right.note));
|
|
533
|
+
}
|
|
534
|
+
/** Convenience for callers that only need a yes/no: is anything going to be denied? */
|
|
535
|
+
export function hasNewDenials(impact) {
|
|
536
|
+
return impact.counts.would_be_denied > 0;
|
|
537
|
+
}
|
|
538
|
+
//# sourceMappingURL=upgrade.js.map
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,uBAAuB;QAC7B,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,WAAW,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,sBAAsB;QACzF,MAAM,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE;KACvG,CAAC,CAAC,CAAA;AACP,CAAC;AAED,SAAS,YAAY,CAAC,WAAmC;IACvD,MAAM,IAAI,GAAG,CAAC,IAAyB,EAAU,EAAE;QACjD,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACxC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAA;IACnD,CAAC,CAAA;IACD,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;AAC5H,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,aAAa,CAAC,MAAqB;IACjD,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,CAAA;AAC1C,CAAC"}
|
package/dist/verdict.d.ts
CHANGED
|
@@ -75,6 +75,12 @@ export interface RowAdmissionInput {
|
|
|
75
75
|
readonly env: EnvFingerprint;
|
|
76
76
|
readonly rows: readonly RowDeclaration[];
|
|
77
77
|
readonly generatedAt: string;
|
|
78
|
+
/**
|
|
79
|
+
* The profile's own exemptions (`compatibility.json`). When one covers this exact
|
|
80
|
+
* module@version on this exact runtime, the loader admits the row, so we must not report it as
|
|
81
|
+
* blocked — a tool that disagrees with the running profile is worse than a tool that says nothing.
|
|
82
|
+
*/
|
|
83
|
+
readonly exemptions?: Readonly<Record<string, readonly string[]>>;
|
|
78
84
|
}
|
|
79
85
|
/**
|
|
80
86
|
* Row-level admission attribution.
|
package/dist/verdict.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../src/verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"verdict.d.ts","sourceRoot":"","sources":["../src/verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,KAAK,EACV,UAAU,EAEV,cAAc,EAEd,MAAM,EAEN,OAAO,EACP,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAA;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAA;IACrC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,MAAM,WAAW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MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAA;CAClE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,OAAO,EAAE,CAoOrF;AAaD,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAoBnE;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAW7D;AAED,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CA6BtE;AAyWD,yEAAyE;AACzE,wBAAgB,WAAW,IAAI,SAAS,MAAM,EAAE,CAE/C"}
|
package/dist/verdict.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { gt, minVersion } from 'semver';
|
|
12
12
|
import { evaluateAdmission } from './admission.js';
|
|
13
|
+
import { isExempted } from './exemption.js';
|
|
13
14
|
import { judgeCompatChannel } from './compat-channel.js';
|
|
14
15
|
import { catalogFor, format } from './messages.js';
|
|
15
16
|
import { judgeRangeShape } from './version-drift.js';
|
|
@@ -318,6 +319,38 @@ export function verdictsFromRowAdmission(input) {
|
|
|
318
319
|
.join(', ')} lists it under ${[...new Set(declaredBy.map((origin) => origin.field))].join('/')}; moving it to peerDependencies (or removing the declaring plugin) removes the shadowing copy`,
|
|
319
320
|
},
|
|
320
321
|
];
|
|
322
|
+
if (isExempted(input.exemptions ?? {}, module, first.version, runtime)) {
|
|
323
|
+
// The profile granted this exact pair; the loader will admit the row. Report the row as
|
|
324
|
+
// admitted and keep the risk visible, rather than a `blocked` the runtime disagrees with.
|
|
325
|
+
out.push(finish({
|
|
326
|
+
subject,
|
|
327
|
+
env: input.env,
|
|
328
|
+
conclusion: 'go',
|
|
329
|
+
confidence: { level: 'medium', basis: 'declared' },
|
|
330
|
+
reasons: [
|
|
331
|
+
scopeReason,
|
|
332
|
+
{
|
|
333
|
+
code: 'admission-exempted',
|
|
334
|
+
severity: 'warn',
|
|
335
|
+
messageId: 'admission.exempted',
|
|
336
|
+
params: { module, version: first.version ?? 'unknown', runtime },
|
|
337
|
+
},
|
|
338
|
+
...admission.unmet.map((requirement) => unmetReason(requirement, runtime)),
|
|
339
|
+
],
|
|
340
|
+
evidence: [rowEvidence, runtimeEvidence],
|
|
341
|
+
remediation: [
|
|
342
|
+
{
|
|
343
|
+
kind: 'probe',
|
|
344
|
+
messageId: 'remediation.probe',
|
|
345
|
+
params: { module },
|
|
346
|
+
note: 'the exemption bypasses the declaration only; behaviour is still unproven',
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
missingEvidence: [],
|
|
350
|
+
generatedAt: input.generatedAt,
|
|
351
|
+
}));
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
321
354
|
out.push(finish({
|
|
322
355
|
subject,
|
|
323
356
|
env: input.env,
|