@mergesignal/shared 0.4.1 → 0.4.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.
- package/dist/deriveScanNarrative.d.ts.map +1 -1
- package/dist/deriveScanNarrative.js +41 -8
- package/dist/deriveScanNarrative.test.js +4 -0
- package/dist/fixtures/repoIntelligenceFixtures.d.ts.map +1 -1
- package/dist/fixtures/repoIntelligenceFixtures.js +8 -1
- package/dist/presentation/compose/narrativeCompose.d.ts.map +1 -1
- package/dist/presentation/compose/narrativeCompose.js +15 -101
- package/dist/presentation/dto/scanCardPresentation.d.ts +2 -0
- package/dist/presentation/dto/scanCardPresentation.d.ts.map +1 -1
- package/dist/presentation/dto/scanDetailsPresentation.d.ts +2 -0
- package/dist/presentation/dto/scanDetailsPresentation.d.ts.map +1 -1
- package/dist/presentation/fixtures/presentationPersonaFixtures.d.ts +11 -0
- package/dist/presentation/fixtures/presentationPersonaFixtures.d.ts.map +1 -0
- package/dist/presentation/fixtures/presentationPersonaFixtures.js +197 -0
- package/dist/presentation/index.d.ts +2 -0
- package/dist/presentation/index.d.ts.map +1 -1
- package/dist/presentation/index.js +1 -0
- package/dist/presentation/intent/applyPostureVocabularyGuard.d.ts +5 -0
- package/dist/presentation/intent/applyPostureVocabularyGuard.d.ts.map +1 -0
- package/dist/presentation/intent/applyPostureVocabularyGuard.js +44 -0
- package/dist/presentation/intent/derivePresentationInterpretation.d.ts +4 -0
- package/dist/presentation/intent/derivePresentationInterpretation.d.ts.map +1 -0
- package/dist/presentation/intent/derivePresentationInterpretation.js +202 -0
- package/dist/presentation/intent/formatPresentationCopy.d.ts +7 -0
- package/dist/presentation/intent/formatPresentationCopy.d.ts.map +1 -0
- package/dist/presentation/intent/formatPresentationCopy.js +153 -0
- package/dist/presentation/intent/packageDisplayName.d.ts +4 -0
- package/dist/presentation/intent/packageDisplayName.d.ts.map +1 -0
- package/dist/presentation/intent/packageDisplayName.js +17 -0
- package/dist/presentation/intent/postureVocabularyGuard.test.d.ts +2 -0
- package/dist/presentation/intent/postureVocabularyGuard.test.d.ts.map +1 -0
- package/dist/presentation/intent/postureVocabularyGuard.test.js +23 -0
- package/dist/presentation/intent/presentationIntent.d.ts +14 -0
- package/dist/presentation/intent/presentationIntent.d.ts.map +1 -0
- package/dist/presentation/intent/presentationIntent.js +1 -0
- package/dist/presentation/intent/presentationIntent.test.d.ts +2 -0
- package/dist/presentation/intent/presentationIntent.test.d.ts.map +1 -0
- package/dist/presentation/intent/presentationIntent.test.js +29 -0
- package/dist/presentation/intent/verificationFocusLabels.d.ts +2 -0
- package/dist/presentation/intent/verificationFocusLabels.d.ts.map +1 -0
- package/dist/presentation/intent/verificationFocusLabels.js +45 -0
- package/dist/presentation/presentation.test.js +3 -0
- package/dist/presentation/presentationPersonas.test.d.ts +2 -0
- package/dist/presentation/presentationPersonas.test.d.ts.map +1 -0
- package/dist/presentation/presentationPersonas.test.js +166 -0
- package/dist/presentation/presenters/presentScanCard.d.ts.map +1 -1
- package/dist/presentation/presenters/presentScanCard.js +1 -0
- package/dist/presentation/presenters/presentScanDetails.d.ts.map +1 -1
- package/dist/presentation/presenters/presentScanDetails.js +7 -1
- package/dist/presentation/profile/derivePresentationProfile.d.ts.map +1 -1
- package/dist/presentation/profile/derivePresentationProfile.js +18 -27
- package/dist/presentation/profile/presentationProfile.d.ts +2 -0
- package/dist/presentation/profile/presentationProfile.d.ts.map +1 -1
- package/dist/repoIntelligenceSchema.d.ts +1 -1
- package/dist/scanNarrativeFacts.d.ts +31 -7
- package/dist/scanNarrativeFacts.d.ts.map +1 -1
- package/dist/scanNarrativeFacts.js +1 -0
- package/dist/scanSurfaceCopy.d.ts +8 -0
- package/dist/scanSurfaceCopy.d.ts.map +1 -1
- package/dist/scanSurfaceCopy.js +8 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deriveScanNarrative.d.ts","sourceRoot":"","sources":["../src/deriveScanNarrative.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"deriveScanNarrative.d.ts","sourceRoot":"","sources":["../src/deriveScanNarrative.ts"],"names":[],"mappings":"AAOA,OAAO,EAeL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAKV,UAAU,EACX,MAAM,YAAY,CAAC;AA+dpB;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GACpC,kBAAkB,CAwGpB"}
|
|
@@ -125,6 +125,41 @@ function mergeGraphHotspots(codeHotspots, graphHotspots) {
|
|
|
125
125
|
}
|
|
126
126
|
return [...byName.values()].slice(0, NARRATIVE_FACT_MAX_HOTSPOTS);
|
|
127
127
|
}
|
|
128
|
+
function projectPackageSemanticsFromWire(pkgIntel) {
|
|
129
|
+
if (!pkgIntel)
|
|
130
|
+
return null;
|
|
131
|
+
return {
|
|
132
|
+
dependencyClass: pkgIntel.dependencyClass ?? null,
|
|
133
|
+
packageRole: pkgIntel.packageRole ?? null,
|
|
134
|
+
runtimeImpact: pkgIntel.runtimeImpact ?? null,
|
|
135
|
+
expectedImpact: pkgIntel.expectedImpact ?? null,
|
|
136
|
+
suppressRuntimeNarrative: pkgIntel.suppressRuntimeNarrative === true,
|
|
137
|
+
evidenceStrength: pkgIntel.evidenceStrength ?? null,
|
|
138
|
+
verificationFocus: pkgIntel.verificationFocus ?? [],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function projectChangedPackageSemantics(ri, changed) {
|
|
142
|
+
return changed.all.map((packageName) => {
|
|
143
|
+
const pkgIntel = ri.packages?.[packageName];
|
|
144
|
+
const usage = pkgIntel?.usage;
|
|
145
|
+
const paths = usage?.paths ?? [];
|
|
146
|
+
const criticalPaths = usage?.criticalPaths ?? [];
|
|
147
|
+
const areas = usage?.areas ?? [];
|
|
148
|
+
const summary = projectPackageSemanticsFromWire(pkgIntel);
|
|
149
|
+
return {
|
|
150
|
+
packageName,
|
|
151
|
+
dependencyClass: summary?.dependencyClass ?? null,
|
|
152
|
+
packageRole: summary?.packageRole ?? null,
|
|
153
|
+
runtimeImpact: summary?.runtimeImpact ?? null,
|
|
154
|
+
expectedImpact: summary?.expectedImpact ?? null,
|
|
155
|
+
suppressRuntimeNarrative: summary?.suppressRuntimeNarrative ?? false,
|
|
156
|
+
evidenceStrength: summary?.evidenceStrength ?? null,
|
|
157
|
+
verificationFocus: summary?.verificationFocus ?? [],
|
|
158
|
+
usagePathCount: paths.length + criticalPaths.length,
|
|
159
|
+
usageAreaCount: areas.length,
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
}
|
|
128
163
|
function extractTier1FromRepoIntelligence(ri, changed) {
|
|
129
164
|
const primary = changed.primary;
|
|
130
165
|
const pkgIntel = primary && ri.packages?.[primary] ? ri.packages[primary] : undefined;
|
|
@@ -155,14 +190,8 @@ function extractTier1FromRepoIntelligence(ri, changed) {
|
|
|
155
190
|
},
|
|
156
191
|
}
|
|
157
192
|
: null;
|
|
158
|
-
const packageSemantics = pkgIntel
|
|
159
|
-
|
|
160
|
-
runtimeImpact: pkgIntel.runtimeImpact ?? null,
|
|
161
|
-
expectedImpact: pkgIntel.expectedImpact ?? null,
|
|
162
|
-
suppressRuntimeNarrative: suppressRuntime,
|
|
163
|
-
verificationFocus: pkgIntel.verificationFocus ?? [],
|
|
164
|
-
}
|
|
165
|
-
: null;
|
|
193
|
+
const packageSemantics = projectPackageSemanticsFromWire(pkgIntel);
|
|
194
|
+
const changedPackageSemantics = projectChangedPackageSemantics(ri, changed);
|
|
166
195
|
const blastFromRi = ri.blastRadius;
|
|
167
196
|
const blastLevel = readBlastLevel(blastFromRi?.level) ??
|
|
168
197
|
(changed.all.length > 0
|
|
@@ -195,6 +224,7 @@ function extractTier1FromRepoIntelligence(ri, changed) {
|
|
|
195
224
|
runtimeSurface,
|
|
196
225
|
reachability,
|
|
197
226
|
packageSemantics,
|
|
227
|
+
changedPackageSemantics,
|
|
198
228
|
blastRadius,
|
|
199
229
|
affectedAreas: affectedAreas.slice(0, NARRATIVE_FACT_MAX_AREAS),
|
|
200
230
|
hotspots: codeHotspots.slice(0, NARRATIVE_FACT_MAX_HOTSPOTS),
|
|
@@ -206,6 +236,7 @@ function hasMeaningfulTier1(tier1) {
|
|
|
206
236
|
tier1.runtimeSurface != null ||
|
|
207
237
|
tier1.reachability != null ||
|
|
208
238
|
tier1.packageSemantics?.expectedImpact != null ||
|
|
239
|
+
tier1.changedPackageSemantics.length > 0 ||
|
|
209
240
|
tier1.blastRadius != null ||
|
|
210
241
|
tier1.affectedAreas.length > 0 ||
|
|
211
242
|
tier1.hotspots.length > 0);
|
|
@@ -287,6 +318,7 @@ function emptyTier1Blocks() {
|
|
|
287
318
|
runtimeSurface: null,
|
|
288
319
|
reachability: null,
|
|
289
320
|
packageSemantics: null,
|
|
321
|
+
changedPackageSemantics: [],
|
|
290
322
|
blastRadius: null,
|
|
291
323
|
affectedAreas: [],
|
|
292
324
|
hotspots: [],
|
|
@@ -386,6 +418,7 @@ export function deriveScanNarrative(result) {
|
|
|
386
418
|
runtimeSurface: tier1Blocks.runtimeSurface,
|
|
387
419
|
reachability: tier1Blocks.reachability,
|
|
388
420
|
packageSemantics: tier1Blocks.packageSemantics,
|
|
421
|
+
changedPackageSemantics: tier1Blocks.changedPackageSemantics,
|
|
389
422
|
blastRadius: tier1Blocks.blastRadius,
|
|
390
423
|
affectedAreas,
|
|
391
424
|
hotspots: tier1Blocks.hotspots,
|
|
@@ -126,6 +126,10 @@ describe("deriveScanNarrative", () => {
|
|
|
126
126
|
expect(facts.packageSemantics?.runtimeImpact).toBe("none");
|
|
127
127
|
expect(facts.packageSemantics?.expectedImpact).toBe("typecheck");
|
|
128
128
|
expect(facts.packageSemantics?.suppressRuntimeNarrative).toBe(true);
|
|
129
|
+
expect(facts.packageSemantics?.dependencyClass).toBe("tooling");
|
|
130
|
+
expect(facts.packageSemantics?.packageRole).toBe("typechecker");
|
|
131
|
+
expect(facts.changedPackageSemantics).toHaveLength(1);
|
|
132
|
+
expect(facts.changedPackageSemantics[0]?.packageName).toBe("typescript");
|
|
129
133
|
expect(facts.blastRadius?.level).toBe("narrow");
|
|
130
134
|
});
|
|
131
135
|
it("extracts packageUsage for all changed packages with blast factors and frameworks", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repoIntelligenceFixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/repoIntelligenceFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,iEAAiE;AACjE,eAAO,MAAM,8BAA8B,EAAE,
|
|
1
|
+
{"version":3,"file":"repoIntelligenceFixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/repoIntelligenceFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,iEAAiE;AACjE,eAAO,MAAM,8BAA8B,EAAE,gBAgD5C,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,iCAAiC,EAAE,gBAqB/C,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,mCAAmC,EAAE,gBAgDjD,CAAC"}
|
|
@@ -10,6 +10,13 @@ export const fixtureRepoIntelligenceFastify = {
|
|
|
10
10
|
suppressRuntimeNarrative: false,
|
|
11
11
|
dependencyClass: "runtime",
|
|
12
12
|
packageRole: "http_framework",
|
|
13
|
+
verificationFocus: [
|
|
14
|
+
"routes",
|
|
15
|
+
"middleware",
|
|
16
|
+
"auth_flow",
|
|
17
|
+
"serialization",
|
|
18
|
+
"error_handling",
|
|
19
|
+
],
|
|
13
20
|
usage: {
|
|
14
21
|
packageName: "fastify",
|
|
15
22
|
files: [
|
|
@@ -29,7 +36,7 @@ export const fixtureRepoIntelligenceFastify = {
|
|
|
29
36
|
changedPackageCount: 1,
|
|
30
37
|
},
|
|
31
38
|
applicationAreas: [
|
|
32
|
-
{ id: "api", label: "API
|
|
39
|
+
{ id: "api", label: "API request handling" },
|
|
33
40
|
{ id: "auth", label: "Auth middleware" },
|
|
34
41
|
],
|
|
35
42
|
hotspots: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrativeCompose.d.ts","sourceRoot":"","sources":["../../../src/presentation/compose/narrativeCompose.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"narrativeCompose.d.ts","sourceRoot":"","sources":["../../../src/presentation/compose/narrativeCompose.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AASzF,wBAAgB,eAAe,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAOtE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,GAAG,SAAS,CAIpB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAQV;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAOV;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAQV;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE,MAAM,GACV,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBzC;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,sBAAsB,GAC7B,MAAM,EAAE,GAAG,SAAS,CAwBtB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,sBAAsB,GAAG;IAC1E,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAKA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { formatCardAreaLabels } from "../../formatCardAreaLabels.js";
|
|
2
|
-
import {
|
|
2
|
+
import { formatChangedPackagesShort, labelBlastRadiusLevel, labelReachabilityKind, labelRuntimeSurface, } from "../../narrativePresentation.js";
|
|
3
3
|
import { scanSurfaceCopy } from "../../scanSurfaceCopy.js";
|
|
4
|
+
import { formatPresentationHeadline, formatPresentationKeyPoints, formatPresentationVerification, } from "../intent/formatPresentationCopy.js";
|
|
4
5
|
function topAreaLabel(bundle) {
|
|
5
6
|
const area = bundle.facts.affectedAreas[0];
|
|
6
7
|
if (!area)
|
|
@@ -10,29 +11,7 @@ function topAreaLabel(bundle) {
|
|
|
10
11
|
}
|
|
11
12
|
export function composeHeadline(bundle) {
|
|
12
13
|
const { facts, profile } = bundle;
|
|
13
|
-
|
|
14
|
-
if (profile.priority === "limited") {
|
|
15
|
-
return scanSurfaceCopy.presentation.limitedContextHeadline;
|
|
16
|
-
}
|
|
17
|
-
if (!primary) {
|
|
18
|
-
return scanSurfaceCopy.presentation.noChangedPackagesHeadline;
|
|
19
|
-
}
|
|
20
|
-
const runtime = facts.runtimeSurface?.kind === "runtime";
|
|
21
|
-
const area = topAreaLabel(bundle);
|
|
22
|
-
if (facts.changedPackages.all.length > 1 && runtime) {
|
|
23
|
-
return scanSurfaceCopy.presentation.multiRuntimeHeadline;
|
|
24
|
-
}
|
|
25
|
-
if (facts.runtimeSurface?.kind === "build" ||
|
|
26
|
-
facts.reachability?.kind === "build_only") {
|
|
27
|
-
return scanSurfaceCopy.presentation.buildOnlyHeadline.replace("{package}", primary);
|
|
28
|
-
}
|
|
29
|
-
if (runtime) {
|
|
30
|
-
const surface = area ?? labelRuntimeSurface(facts) ?? "application code";
|
|
31
|
-
return scanSurfaceCopy.presentation.runtimeHeadline
|
|
32
|
-
.replace("{package}", primary)
|
|
33
|
-
.replace("{surface}", surface);
|
|
34
|
-
}
|
|
35
|
-
return scanSurfaceCopy.presentation.defaultUpgradeHeadline.replace("{package}", primary);
|
|
14
|
+
return formatPresentationHeadline(profile.interpretation, facts, profile.status);
|
|
36
15
|
}
|
|
37
16
|
export function composeSubheadline(bundle) {
|
|
38
17
|
const { profile } = bundle;
|
|
@@ -42,78 +21,11 @@ export function composeSubheadline(bundle) {
|
|
|
42
21
|
}
|
|
43
22
|
export function composeKeyPoints(bundle, max) {
|
|
44
23
|
const { facts, profile } = bundle;
|
|
45
|
-
|
|
46
|
-
if (profile.priority === "limited") {
|
|
47
|
-
points.push(scanSurfaceCopy.presentation.limitedContextKeyPoint);
|
|
48
|
-
if (facts.changedPackages.primary) {
|
|
49
|
-
points.push(scanSurfaceCopy.presentation.changedPackageKeyPoint.replace("{package}", facts.changedPackages.primary));
|
|
50
|
-
}
|
|
51
|
-
return points.slice(0, max);
|
|
52
|
-
}
|
|
53
|
-
const usage = summarizePackageUsage(facts, { maxPaths: 2 });
|
|
54
|
-
if (usage && usage.pathCount > 0) {
|
|
55
|
-
if (usage.pathCount === 1 && usage.pathSamples[0]) {
|
|
56
|
-
points.push(scanSurfaceCopy.presentation.usedInPathsSingle.replace("{path}", usage.pathSamples[0]));
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
points.push(scanSurfaceCopy.presentation.usedInPathsMultiple.replace("{count}", String(usage.pathCount)));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
else if (profile.density === "minimal") {
|
|
63
|
-
points.push(scanSurfaceCopy.presentation.noRuntimePathsKeyPoint);
|
|
64
|
-
}
|
|
65
|
-
const blast = summarizeBlastRadius(facts, 2);
|
|
66
|
-
if (blast.levelLabel) {
|
|
67
|
-
if (blast.levelLabel.toLowerCase().includes("wide")) {
|
|
68
|
-
points.push(scanSurfaceCopy.presentation.blastRadiusWideKeyPoint);
|
|
69
|
-
}
|
|
70
|
-
else if (profile.density === "rich") {
|
|
71
|
-
points.push(scanSurfaceCopy.presentation.blastRadiusLevelKeyPoint.replace("{level}", blast.levelLabel));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (facts.affectedAreas.length === 0 && profile.density === "minimal") {
|
|
75
|
-
points.push(scanSurfaceCopy.presentation.noAffectedAreasKeyPoint);
|
|
76
|
-
}
|
|
77
|
-
else if (facts.affectedAreas.length > 0) {
|
|
78
|
-
const labels = facts.affectedAreas
|
|
79
|
-
.slice(0, 2)
|
|
80
|
-
.map((a) => a.label)
|
|
81
|
-
.join(", ");
|
|
82
|
-
points.push(scanSurfaceCopy.presentation.affectedAreasKeyPoint.replace("{areas}", labels));
|
|
83
|
-
}
|
|
84
|
-
const guidance = selectReviewerGuidance(facts, { scope: "changed", max: 2 });
|
|
85
|
-
for (const g of guidance) {
|
|
86
|
-
const msg = g.message.trim();
|
|
87
|
-
if (msg && !points.includes(msg))
|
|
88
|
-
points.push(msg);
|
|
89
|
-
if (points.length >= max)
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
return points.slice(0, max);
|
|
24
|
+
return formatPresentationKeyPoints(profile.interpretation, facts, profile.status, max);
|
|
93
25
|
}
|
|
94
26
|
export function composeVerificationActions(bundle, max) {
|
|
95
|
-
const {
|
|
96
|
-
|
|
97
|
-
const guidance = selectReviewerGuidance(facts, { scope: "changed", max: 4 });
|
|
98
|
-
for (const g of guidance) {
|
|
99
|
-
const rem = g.remediation?.trim();
|
|
100
|
-
if (rem)
|
|
101
|
-
actions.push(rem);
|
|
102
|
-
}
|
|
103
|
-
const prompt = composeVerificationPrompt(facts);
|
|
104
|
-
if (prompt && !actions.includes(prompt))
|
|
105
|
-
actions.push(prompt);
|
|
106
|
-
if (actions.length === 0) {
|
|
107
|
-
if (profile.density === "minimal" ||
|
|
108
|
-
facts.runtimeSurface?.kind === "build") {
|
|
109
|
-
actions.push(scanSurfaceCopy.presentation.verifyCiTypecheck);
|
|
110
|
-
}
|
|
111
|
-
else if (profile.density === "rich") {
|
|
112
|
-
actions.push(scanSurfaceCopy.presentation.verifyAuthFlow);
|
|
113
|
-
actions.push(scanSurfaceCopy.presentation.verifyErrorResponses);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return actions.slice(0, max);
|
|
27
|
+
const { profile } = bundle;
|
|
28
|
+
return formatPresentationVerification(profile.interpretation, profile.status, max);
|
|
117
29
|
}
|
|
118
30
|
export function composeAffectedAreaLabels(bundle, max) {
|
|
119
31
|
const labels = [];
|
|
@@ -127,14 +39,16 @@ export function composeAffectedAreaLabels(bundle, max) {
|
|
|
127
39
|
return labels;
|
|
128
40
|
}
|
|
129
41
|
export function composeEvidenceRows(bundle, max) {
|
|
130
|
-
const { facts } = bundle;
|
|
42
|
+
const { facts, profile } = bundle;
|
|
131
43
|
const rows = [];
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
44
|
+
if (!profile.interpretation.suppressRuntimeNarrative) {
|
|
45
|
+
const runtime = labelRuntimeSurface(facts);
|
|
46
|
+
if (runtime)
|
|
47
|
+
rows.push({ label: "Runtime", value: runtime });
|
|
48
|
+
const reach = labelReachabilityKind(facts);
|
|
49
|
+
if (reach)
|
|
50
|
+
rows.push({ label: "Reachability", value: reach });
|
|
51
|
+
}
|
|
138
52
|
const blast = labelBlastRadiusLevel(facts);
|
|
139
53
|
if (blast)
|
|
140
54
|
rows.push({ label: "Blast radius", value: blast });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FindingCountSummary, PresentationConfidence, PresentationDensity, PresentationEvidenceContext, PresentationEvidenceRow, PresentationStatus } from "./types.js";
|
|
2
|
+
import type { PresentationIntent } from "../intent/presentationIntent.js";
|
|
2
3
|
export type ScanCardPresentation = {
|
|
3
4
|
pipeline?: {
|
|
4
5
|
status: "queued" | "running" | "failed";
|
|
@@ -21,5 +22,6 @@ export type ScanCardPresentation = {
|
|
|
21
22
|
riskIndex?: number | null;
|
|
22
23
|
findingCounts?: FindingCountSummary | null;
|
|
23
24
|
actionLabel?: string;
|
|
25
|
+
presentationIntent?: PresentationIntent;
|
|
24
26
|
};
|
|
25
27
|
//# sourceMappingURL=scanCardPresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanCardPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/scanCardPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"scanCardPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/scanCardPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;QACxC,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IAEpC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE7B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PresentationConfidence, PresentationDensity, PresentationEvidenceContext, PresentationStatus } from "./types.js";
|
|
2
|
+
import type { PresentationIntent } from "../intent/presentationIntent.js";
|
|
2
3
|
import type { FindingSeverity, ScoreLayer } from "../../types.js";
|
|
3
4
|
export type ScanDetailsPresentation = {
|
|
4
5
|
evidenceContext: PresentationEvidenceContext;
|
|
@@ -107,5 +108,6 @@ export type ScanDetailsPresentation = {
|
|
|
107
108
|
methodologyVersion?: string | null;
|
|
108
109
|
changedPackagesSummary?: string;
|
|
109
110
|
};
|
|
111
|
+
presentationIntent?: PresentationIntent;
|
|
110
112
|
};
|
|
111
113
|
//# sourceMappingURL=scanDetailsPresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanDetailsPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/scanDetailsPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,2BAA2B,CAAC;IAC7C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,sBAAsB,CAAC;IAEnC,IAA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ACpB,OAAO,EAAE,KAAK,CAAC;gBACb,WAAW,EAAE,MAAM,CAAC;gBACpB,KAAK,EAAE,MAAM,CAAC;gBACd,MAAM,EAAE,OAAO,CAAC;gBAChB,GAAG,EAAE,MAAM,EAAE,CAAC;aACf,CAAC,CAAC;SACJ,CAAC;KACH,CAAC;IAEF,iBAAiB,CAAC,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IAEF,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;
|
|
1
|
+
{"version":3,"file":"scanDetailsPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/scanDetailsPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,2BAA2B,CAAC;IAC7C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,sBAAsB,CAAC;IAEnC,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,CAAC;IA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EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IAEF,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;IAEF,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ScanResult } from "../../types.js";
|
|
2
|
+
import { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch } from "./scanResultFixtures.js";
|
|
3
|
+
export declare const scanResultEslint: ScanResult;
|
|
4
|
+
export declare const scanResultPrettier: ScanResult;
|
|
5
|
+
export declare const scanResultVitest: ScanResult;
|
|
6
|
+
export declare const scanResultNextAuth: ScanResult;
|
|
7
|
+
export declare const scanResultBullmq: ScanResult;
|
|
8
|
+
export declare const scanResultUnknownSafe: ScanResult;
|
|
9
|
+
export declare const scanResultMixedTypescriptFastify: ScanResult;
|
|
10
|
+
export { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch, };
|
|
11
|
+
//# sourceMappingURL=presentationPersonaFixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentationPersonaFixtures.d.ts","sourceRoot":"","sources":["../../../src/presentation/fixtures/presentationPersonaFixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AA8JjC,eAAO,MAAM,gBAAgB,EAAE,UAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,UAG/B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,UAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,UAS/B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,UAS7B,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,UAGlC,CAAC;AAEH,eAAO,MAAM,gCAAgC,EAAE,UAS7C,CAAC;AAEH,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,GAC1B,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { fixtureRepoIntelligenceFastify, fixtureRepoIntelligenceTypescript, } from "../../fixtures/repoIntelligenceFixtures.js";
|
|
2
|
+
import { analysisPreparationWithValidRepoIntel } from "../../fixtures/repoIntelligenceTestHelpers.js";
|
|
3
|
+
import { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch, } from "./scanResultFixtures.js";
|
|
4
|
+
const basePrep = analysisPreparationWithValidRepoIntel();
|
|
5
|
+
const fixtureRepoIntelligenceEslint = {
|
|
6
|
+
packages: {
|
|
7
|
+
eslint: {
|
|
8
|
+
runtimeSurface: "build",
|
|
9
|
+
reachability: "build_only",
|
|
10
|
+
runtimeImpact: "none",
|
|
11
|
+
expectedImpact: "development_only",
|
|
12
|
+
evidenceStrength: "medium",
|
|
13
|
+
suppressRuntimeNarrative: true,
|
|
14
|
+
dependencyClass: "lint",
|
|
15
|
+
packageRole: "linter",
|
|
16
|
+
verificationFocus: ["ci", "lint"],
|
|
17
|
+
usage: { packageName: "eslint", files: [".eslintrc.cjs"], paths: [] },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
blastRadius: { level: "narrow", changedPackageCount: 1 },
|
|
21
|
+
applicationAreas: [],
|
|
22
|
+
};
|
|
23
|
+
const fixtureRepoIntelligencePrettier = {
|
|
24
|
+
packages: {
|
|
25
|
+
prettier: {
|
|
26
|
+
runtimeSurface: "build",
|
|
27
|
+
reachability: "build_only",
|
|
28
|
+
runtimeImpact: "none",
|
|
29
|
+
expectedImpact: "development_only",
|
|
30
|
+
evidenceStrength: "medium",
|
|
31
|
+
suppressRuntimeNarrative: true,
|
|
32
|
+
dependencyClass: "format",
|
|
33
|
+
packageRole: "formatter",
|
|
34
|
+
verificationFocus: ["ci", "format"],
|
|
35
|
+
usage: { packageName: "prettier", files: [".prettierrc"], paths: [] },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
blastRadius: { level: "narrow", changedPackageCount: 1 },
|
|
39
|
+
applicationAreas: [],
|
|
40
|
+
};
|
|
41
|
+
const fixtureRepoIntelligenceVitest = {
|
|
42
|
+
packages: {
|
|
43
|
+
vitest: {
|
|
44
|
+
runtimeSurface: "test",
|
|
45
|
+
reachability: "test_only",
|
|
46
|
+
runtimeImpact: "none",
|
|
47
|
+
expectedImpact: "test_time",
|
|
48
|
+
evidenceStrength: "medium",
|
|
49
|
+
suppressRuntimeNarrative: true,
|
|
50
|
+
dependencyClass: "test",
|
|
51
|
+
packageRole: "test_runner",
|
|
52
|
+
verificationFocus: ["ci", "test_suite"],
|
|
53
|
+
usage: { packageName: "vitest", files: ["vitest.config.ts"], paths: [] },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
blastRadius: { level: "narrow", changedPackageCount: 1 },
|
|
57
|
+
applicationAreas: [],
|
|
58
|
+
};
|
|
59
|
+
const fixtureRepoIntelligenceNextAuth = {
|
|
60
|
+
packages: {
|
|
61
|
+
"next-auth": {
|
|
62
|
+
runtimeSurface: "runtime",
|
|
63
|
+
reachability: "on_runtime_paths",
|
|
64
|
+
runtimeImpact: "confirmed",
|
|
65
|
+
expectedImpact: "runtime",
|
|
66
|
+
evidenceStrength: "high",
|
|
67
|
+
suppressRuntimeNarrative: false,
|
|
68
|
+
dependencyClass: "runtime",
|
|
69
|
+
packageRole: "auth",
|
|
70
|
+
verificationFocus: ["auth_flow", "session", "routes"],
|
|
71
|
+
usage: {
|
|
72
|
+
packageName: "next-auth",
|
|
73
|
+
files: ["apps/web/src/auth.ts"],
|
|
74
|
+
paths: ["apps/web/src/auth.ts"],
|
|
75
|
+
areas: ["Auth"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
blastRadius: { level: "moderate", changedPackageCount: 1 },
|
|
80
|
+
applicationAreas: [{ id: "auth", label: "authentication flows" }],
|
|
81
|
+
};
|
|
82
|
+
const fixtureRepoIntelligenceBullmq = {
|
|
83
|
+
packages: {
|
|
84
|
+
bullmq: {
|
|
85
|
+
runtimeSurface: "runtime",
|
|
86
|
+
reachability: "on_runtime_paths",
|
|
87
|
+
runtimeImpact: "confirmed",
|
|
88
|
+
expectedImpact: "runtime",
|
|
89
|
+
evidenceStrength: "high",
|
|
90
|
+
suppressRuntimeNarrative: false,
|
|
91
|
+
dependencyClass: "runtime",
|
|
92
|
+
packageRole: "queue",
|
|
93
|
+
verificationFocus: ["workers", "queue", "serialization"],
|
|
94
|
+
usage: {
|
|
95
|
+
packageName: "bullmq",
|
|
96
|
+
files: ["apps/worker/src/queue.ts"],
|
|
97
|
+
paths: ["apps/worker/src/queue.ts"],
|
|
98
|
+
areas: ["Workers"],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
blastRadius: { level: "moderate", changedPackageCount: 1 },
|
|
103
|
+
applicationAreas: [{ id: "workers", label: "background job processing" }],
|
|
104
|
+
};
|
|
105
|
+
const fixtureRepoIntelligenceUnknown = {
|
|
106
|
+
packages: {
|
|
107
|
+
"opaque-pkg": {
|
|
108
|
+
runtimeSurface: "unknown",
|
|
109
|
+
reachability: "unknown",
|
|
110
|
+
runtimeImpact: "unknown",
|
|
111
|
+
expectedImpact: "unknown",
|
|
112
|
+
evidenceStrength: "low",
|
|
113
|
+
suppressRuntimeNarrative: false,
|
|
114
|
+
dependencyClass: "unknown",
|
|
115
|
+
packageRole: "unknown",
|
|
116
|
+
verificationFocus: [],
|
|
117
|
+
usage: { packageName: "opaque-pkg", files: [], paths: [] },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
blastRadius: { level: "narrow", changedPackageCount: 1 },
|
|
121
|
+
applicationAreas: [],
|
|
122
|
+
};
|
|
123
|
+
const fixtureRepoIntelligenceMixedToolingRuntime = {
|
|
124
|
+
packages: {
|
|
125
|
+
typescript: fixtureRepoIntelligenceTypescript.packages.typescript,
|
|
126
|
+
fastify: fixtureRepoIntelligenceFastify.packages.fastify,
|
|
127
|
+
},
|
|
128
|
+
blastRadius: fixtureRepoIntelligenceFastify.blastRadius,
|
|
129
|
+
applicationAreas: fixtureRepoIntelligenceFastify.applicationAreas,
|
|
130
|
+
};
|
|
131
|
+
function scanBase(over = {}) {
|
|
132
|
+
return {
|
|
133
|
+
totalScore: 18,
|
|
134
|
+
layerScores: {
|
|
135
|
+
security: 5,
|
|
136
|
+
maintainability: 8,
|
|
137
|
+
ecosystem: 10,
|
|
138
|
+
upgradeImpact: 5,
|
|
139
|
+
},
|
|
140
|
+
findings: [],
|
|
141
|
+
generatedAt: "2026-01-01T00:00:00.000Z",
|
|
142
|
+
decision: {
|
|
143
|
+
recommendation: "safe",
|
|
144
|
+
confidence: "high",
|
|
145
|
+
reasoning: [],
|
|
146
|
+
},
|
|
147
|
+
analysisPreparation: basePrep,
|
|
148
|
+
...over,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export const scanResultEslint = scanBase({
|
|
152
|
+
changedPackages: ["eslint"],
|
|
153
|
+
repoIntelligence: fixtureRepoIntelligenceEslint,
|
|
154
|
+
});
|
|
155
|
+
export const scanResultPrettier = scanBase({
|
|
156
|
+
changedPackages: ["prettier"],
|
|
157
|
+
repoIntelligence: fixtureRepoIntelligencePrettier,
|
|
158
|
+
});
|
|
159
|
+
export const scanResultVitest = scanBase({
|
|
160
|
+
changedPackages: ["vitest"],
|
|
161
|
+
repoIntelligence: fixtureRepoIntelligenceVitest,
|
|
162
|
+
});
|
|
163
|
+
export const scanResultNextAuth = scanBase({
|
|
164
|
+
totalScore: 52,
|
|
165
|
+
changedPackages: ["next-auth"],
|
|
166
|
+
repoIntelligence: fixtureRepoIntelligenceNextAuth,
|
|
167
|
+
decision: {
|
|
168
|
+
recommendation: "needs_review",
|
|
169
|
+
confidence: "medium",
|
|
170
|
+
reasoning: [],
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
export const scanResultBullmq = scanBase({
|
|
174
|
+
totalScore: 48,
|
|
175
|
+
changedPackages: ["bullmq"],
|
|
176
|
+
repoIntelligence: fixtureRepoIntelligenceBullmq,
|
|
177
|
+
decision: {
|
|
178
|
+
recommendation: "needs_review",
|
|
179
|
+
confidence: "medium",
|
|
180
|
+
reasoning: [],
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
export const scanResultUnknownSafe = scanBase({
|
|
184
|
+
changedPackages: ["opaque-pkg"],
|
|
185
|
+
repoIntelligence: fixtureRepoIntelligenceUnknown,
|
|
186
|
+
});
|
|
187
|
+
export const scanResultMixedTypescriptFastify = scanBase({
|
|
188
|
+
totalScore: 55,
|
|
189
|
+
changedPackages: ["typescript", "fastify"],
|
|
190
|
+
repoIntelligence: fixtureRepoIntelligenceMixedToolingRuntime,
|
|
191
|
+
decision: {
|
|
192
|
+
recommendation: "needs_review",
|
|
193
|
+
confidence: "medium",
|
|
194
|
+
reasoning: [],
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
export { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch, };
|
|
@@ -6,6 +6,8 @@ export type { BuildScanCardPresentationInput } from "./orchestration/buildScanCa
|
|
|
6
6
|
export { buildScanDetailsPresentation } from "./orchestration/buildScanDetailsPresentation.js";
|
|
7
7
|
export type { BuildScanDetailsPresentationInput } from "./orchestration/buildScanDetailsPresentation.js";
|
|
8
8
|
export type { PresentationProfile } from "./profile/presentationProfile.js";
|
|
9
|
+
export type { PresentationIntent, PresentationInterpretation, } from "./intent/presentationIntent.js";
|
|
10
|
+
export { derivePresentationInterpretation } from "./intent/derivePresentationInterpretation.js";
|
|
9
11
|
export type { PipelineStatus, PresentationStatus, PresentationDensity, PresentationConfidence, PresentationPriority, PresentationEvidenceContext, PresentationEvidenceRow, } from "./dto/types.js";
|
|
10
12
|
export type { ScanCardPresentation } from "./dto/scanCardPresentation.js";
|
|
11
13
|
export type { ScanDetailsPresentation } from "./dto/scanDetailsPresentation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presentation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,YAAY,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,YAAY,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,YAAY,EAAE,iCAAiC,EAAE,MAAM,iDAAiD,CAAC;AAEzG,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,YAAY,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAA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ACtB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,YAAY,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { buildScanPresentationBundle } from "./orchestration/buildScanPresentationBundle.js";
|
|
2
2
|
export { buildScanCardPresentation } from "./orchestration/buildScanCardPresentation.js";
|
|
3
3
|
export { buildScanDetailsPresentation } from "./orchestration/buildScanDetailsPresentation.js";
|
|
4
|
+
export { derivePresentationInterpretation } from "./intent/derivePresentationInterpretation.js";
|
|
4
5
|
export { presentScanCard } from "./presenters/presentScanCard.js";
|
|
5
6
|
export { presentPipelineScanCard } from "./presenters/presentPipelineScanCard.js";
|
|
6
7
|
export { presentScanDetails } from "./presenters/presentScanDetails.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PresentationStatus } from "../dto/types.js";
|
|
2
|
+
export declare function guardHeadlineForPosture(headline: string, status: PresentationStatus, anchorPackage: string | null): string;
|
|
3
|
+
export declare function applyPostureVocabularyGuardHeadline(headline: string, status: PresentationStatus | undefined, anchorPackage: string | null): string;
|
|
4
|
+
export declare function applyPostureVocabularyGuardLines(lines: string[], status: PresentationStatus | undefined): string[];
|
|
5
|
+
//# sourceMappingURL=applyPostureVocabularyGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyPostureVocabularyGuard.d.ts","sourceRoot":"","sources":["../../../src/presentation/intent/applyPostureVocabularyGuard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA2B1D,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,MAAM,CAYR;AASD,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,GAAG,SAAS,EACtC,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,MAAM,CAGR;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,MAAM,EAAE,CAGV"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { scanSurfaceCopy } from "../../scanSurfaceCopy.js";
|
|
2
|
+
import { formatPackageDisplayName } from "./packageDisplayName.js";
|
|
3
|
+
const SAFE_FORBIDDEN = /\b(needs\s+review|critical\s+concern|high\s+risk|significant\s+impact|urgent\s+verification|severe\s+exposure|review\s+before\s+merge|wide\s+blast\s+radius)\b/i;
|
|
4
|
+
const NEEDS_REVIEW_FORBIDDEN = /\b(no\s+action\s+required|no\s+verification\s+required|safe\s+to\s+merge|no\s+concerns)\b/i;
|
|
5
|
+
const RISKY_FORBIDDEN = /\b(no\s+action\s+required|minor\s+findings\s+only|low\s+risk|no\s+concerns)\b/i;
|
|
6
|
+
function violatesPosture(text, status) {
|
|
7
|
+
const t = text.trim();
|
|
8
|
+
if (!t)
|
|
9
|
+
return true;
|
|
10
|
+
switch (status) {
|
|
11
|
+
case "safe":
|
|
12
|
+
return SAFE_FORBIDDEN.test(t);
|
|
13
|
+
case "needs_review":
|
|
14
|
+
return NEEDS_REVIEW_FORBIDDEN.test(t);
|
|
15
|
+
case "risky":
|
|
16
|
+
return RISKY_FORBIDDEN.test(t);
|
|
17
|
+
default:
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function guardHeadlineForPosture(headline, status, anchorPackage) {
|
|
22
|
+
if (!violatesPosture(headline, status))
|
|
23
|
+
return headline;
|
|
24
|
+
const pkg = anchorPackage
|
|
25
|
+
? formatPackageDisplayName(anchorPackage)
|
|
26
|
+
: "Dependency";
|
|
27
|
+
if (status === "safe") {
|
|
28
|
+
return scanSurfaceCopy.presentation.safeNeutralHeadline.replace("{package}", pkg);
|
|
29
|
+
}
|
|
30
|
+
return headline;
|
|
31
|
+
}
|
|
32
|
+
function guardLinesForPosture(lines, status) {
|
|
33
|
+
return lines.filter((line) => !violatesPosture(line, status));
|
|
34
|
+
}
|
|
35
|
+
export function applyPostureVocabularyGuardHeadline(headline, status, anchorPackage) {
|
|
36
|
+
if (!status)
|
|
37
|
+
return headline;
|
|
38
|
+
return guardHeadlineForPosture(headline, status, anchorPackage);
|
|
39
|
+
}
|
|
40
|
+
export function applyPostureVocabularyGuardLines(lines, status) {
|
|
41
|
+
if (!status)
|
|
42
|
+
return lines;
|
|
43
|
+
return guardLinesForPosture(lines, status);
|
|
44
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ScanNarrativeFacts } from "../../scanNarrativeFacts.js";
|
|
2
|
+
import type { PresentationInterpretation } from "./presentationIntent.js";
|
|
3
|
+
export declare function derivePresentationInterpretation(facts: ScanNarrativeFacts): PresentationInterpretation;
|
|
4
|
+
//# sourceMappingURL=derivePresentationInterpretation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivePresentationInterpretation.d.ts","sourceRoot":"","sources":["../../../src/presentation/intent/derivePresentationInterpretation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAEV,0BAA0B,EAC3B,MAAM,yBAAyB,CAAC;AAsJjC,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,kBAAkB,GACxB,0BAA0B,CAkG5B"}
|