@mergesignal/shared 0.4.3 → 0.5.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/actionsStepSummary.d.ts +1 -22
- package/dist/actionsStepSummary.d.ts.map +1 -1
- package/dist/actionsStepSummary.js +19 -716
- package/dist/actionsStepSummary.test.js +34 -329
- package/dist/assessmentLabels.d.ts +6 -0
- package/dist/assessmentLabels.d.ts.map +1 -0
- package/dist/assessmentLabels.js +33 -0
- package/dist/assessmentProjection.d.ts +12 -0
- package/dist/assessmentProjection.d.ts.map +1 -0
- package/dist/assessmentProjection.js +100 -0
- package/dist/assessmentSchema.d.ts +155 -0
- package/dist/assessmentSchema.d.ts.map +1 -0
- package/dist/assessmentSchema.js +110 -0
- package/dist/cardObservationCatalog.d.ts +2 -0
- package/dist/cardObservationCatalog.d.ts.map +1 -1
- package/dist/cardObservationCatalog.js +47 -1
- package/dist/engineWireRegression.test.js +22 -2
- package/dist/fixtures/assessmentFixtures.d.ts +13 -0
- package/dist/fixtures/assessmentFixtures.d.ts.map +1 -0
- package/dist/fixtures/assessmentFixtures.js +164 -0
- package/dist/formatCardExposureDisplay.d.ts +0 -4
- package/dist/formatCardExposureDisplay.d.ts.map +1 -1
- package/dist/formatCardExposureDisplay.js +0 -15
- package/dist/formatInsight.d.ts +3 -2
- package/dist/formatInsight.d.ts.map +1 -1
- package/dist/formatInsight.js +26 -1
- package/dist/index.d.ts +7 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -11
- package/dist/narrativeParity.test.js +4 -34
- package/dist/presentGitHubPrComment.d.ts +1 -3
- package/dist/presentGitHubPrComment.d.ts.map +1 -1
- package/dist/presentGitHubPrComment.js +0 -17
- package/dist/presentation/compose/narrativeChannels.d.ts.map +1 -1
- package/dist/presentation/compose/narrativeChannels.js +13 -43
- package/dist/presentation/compose/narrativeCompose.d.ts.map +1 -1
- package/dist/presentation/compose/narrativeCompose.js +2 -5
- package/dist/presentation/dto/assessmentPresentationFields.d.ts +13 -0
- package/dist/presentation/dto/assessmentPresentationFields.d.ts.map +1 -0
- package/dist/presentation/dto/assessmentPresentationFields.js +1 -0
- package/dist/presentation/dto/dashboardCardPresentation.d.ts +2 -1
- package/dist/presentation/dto/dashboardCardPresentation.d.ts.map +1 -1
- package/dist/presentation/dto/githubAndCliPresentation.d.ts +4 -3
- package/dist/presentation/dto/githubAndCliPresentation.d.ts.map +1 -1
- package/dist/presentation/dto/scanDetailsPresentation.d.ts +2 -1
- package/dist/presentation/dto/scanDetailsPresentation.d.ts.map +1 -1
- package/dist/presentation/fixtures/dashboardCardGolden.test.js +21 -14
- package/dist/presentation/fixtures/presentationPersonaFixtures.d.ts.map +1 -1
- package/dist/presentation/fixtures/presentationPersonaFixtures.js +31 -24
- package/dist/presentation/fixtures/scanResultFixtures.d.ts.map +1 -1
- package/dist/presentation/fixtures/scanResultFixtures.js +14 -3
- package/dist/presentation/index.d.ts +0 -1
- package/dist/presentation/index.d.ts.map +1 -1
- package/dist/presentation/index.js +0 -1
- package/dist/presentation/orchestration/buildScanCardPresentation.d.ts.map +1 -1
- package/dist/presentation/orchestration/buildScanCardPresentation.js +8 -3
- package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts +1 -1
- package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts.map +1 -1
- package/dist/presentation/orchestration/buildScanPresentationBundle.js +12 -10
- package/dist/presentation/orchestration/scanPresentationBundle.d.ts +8 -3
- package/dist/presentation/orchestration/scanPresentationBundle.d.ts.map +1 -1
- package/dist/presentation/presentationPersonas.test.js +6 -6
- package/dist/presentation/presenters/presentCliScanSummary.d.ts.map +1 -1
- package/dist/presentation/presenters/presentCliScanSummary.js +2 -0
- package/dist/presentation/presenters/presentDashboardCard.d.ts.map +1 -1
- package/dist/presentation/presenters/presentDashboardCard.js +2 -0
- package/dist/presentation/presenters/presentGitHubCheckRun.d.ts.map +1 -1
- package/dist/presentation/presenters/presentGitHubCheckRun.js +2 -0
- package/dist/presentation/presenters/presentGitHubPrComment.d.ts.map +1 -1
- package/dist/presentation/presenters/presentGitHubPrComment.js +15 -21
- package/dist/presentation/presenters/presentScanDetails.d.ts.map +1 -1
- package/dist/presentation/presenters/presentScanDetails.js +52 -129
- package/dist/presentation/profile/buildProfileFromAssessment.d.ts +5 -0
- package/dist/presentation/profile/buildProfileFromAssessment.d.ts.map +1 -0
- package/dist/presentation/profile/buildProfileFromAssessment.js +58 -0
- package/dist/presentation/projectAssessmentFields.d.ts +4 -0
- package/dist/presentation/projectAssessmentFields.d.ts.map +1 -0
- package/dist/presentation/projectAssessmentFields.js +13 -0
- package/dist/presentation/surfaceParity.test.d.ts +2 -0
- package/dist/presentation/surfaceParity.test.d.ts.map +1 -0
- package/dist/presentation/surfaceParity.test.js +74 -0
- package/dist/productMessaging.d.ts +4 -4
- package/dist/productMessaging.d.ts.map +1 -1
- package/dist/productMessaging.js +4 -4
- package/dist/productMessaging.test.js +2 -2
- package/dist/repoIntelligenceSchema.d.ts +2 -2
- package/dist/resolvePipelineStatus.d.ts +15 -0
- package/dist/resolvePipelineStatus.d.ts.map +1 -0
- package/dist/resolvePipelineStatus.js +37 -0
- package/dist/scanCardPresentationState.d.ts +4 -0
- package/dist/scanCardPresentationState.d.ts.map +1 -0
- package/dist/scanCardPresentationState.js +4 -0
- package/dist/{scanDetailViewModel.d.ts → scanDetailViewModelTypes.d.ts} +60 -32
- package/dist/scanDetailViewModelTypes.d.ts.map +1 -0
- package/dist/scanDetailViewModelTypes.js +4 -0
- package/dist/scanResultSchema.d.ts +75 -2
- package/dist/scanResultSchema.d.ts.map +1 -1
- package/dist/scanResultSchema.js +4 -2
- package/dist/scanResultSchema.test.js +16 -0
- package/dist/trustedScanGuards.test.js +7 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/collectNarrativeWhyBullets.d.ts +0 -12
- package/dist/collectNarrativeWhyBullets.d.ts.map +0 -1
- package/dist/collectNarrativeWhyBullets.js +0 -104
- package/dist/deriveCardDisplaySummary.d.ts +0 -16
- package/dist/deriveCardDisplaySummary.d.ts.map +0 -1
- package/dist/deriveCardDisplaySummary.js +0 -56
- package/dist/deriveCardDisplaySummary.test.d.ts +0 -2
- package/dist/deriveCardDisplaySummary.test.d.ts.map +0 -1
- package/dist/deriveCardDisplaySummary.test.js +0 -89
- package/dist/deriveCardOperationalObservations.d.ts +0 -19
- package/dist/deriveCardOperationalObservations.d.ts.map +0 -1
- package/dist/deriveCardOperationalObservations.js +0 -180
- package/dist/deriveCardOperationalObservations.test.d.ts +0 -2
- package/dist/deriveCardOperationalObservations.test.d.ts.map +0 -1
- package/dist/deriveCardOperationalObservations.test.js +0 -268
- package/dist/deriveRiskScoreSummary.d.ts +0 -33
- package/dist/deriveRiskScoreSummary.d.ts.map +0 -1
- package/dist/deriveRiskScoreSummary.js +0 -90
- package/dist/deriveRiskScoreSummary.test.d.ts +0 -2
- package/dist/deriveRiskScoreSummary.test.d.ts.map +0 -1
- package/dist/deriveRiskScoreSummary.test.js +0 -47
- package/dist/deriveScanDetailRecommendations.d.ts +0 -63
- package/dist/deriveScanDetailRecommendations.d.ts.map +0 -1
- package/dist/deriveScanDetailRecommendations.js +0 -725
- package/dist/deriveScanDetailRecommendations.test.d.ts +0 -2
- package/dist/deriveScanDetailRecommendations.test.d.ts.map +0 -1
- package/dist/deriveScanDetailRecommendations.test.js +0 -181
- package/dist/deriveScanSummaryText.d.ts +0 -7
- package/dist/deriveScanSummaryText.d.ts.map +0 -1
- package/dist/deriveScanSummaryText.js +0 -24
- package/dist/deriveScanSummaryText.test.d.ts +0 -2
- package/dist/deriveScanSummaryText.test.d.ts.map +0 -1
- package/dist/deriveScanSummaryText.test.js +0 -77
- package/dist/formatCardEvidenceCounts.d.ts +0 -7
- package/dist/formatCardEvidenceCounts.d.ts.map +0 -1
- package/dist/formatCardEvidenceCounts.js +0 -19
- package/dist/prCheckRunPresentation.d.ts +0 -68
- package/dist/prCheckRunPresentation.d.ts.map +0 -1
- package/dist/prCheckRunPresentation.js +0 -319
- package/dist/prCheckRunPresentation.test.d.ts +0 -2
- package/dist/prCheckRunPresentation.test.d.ts.map +0 -1
- package/dist/prCheckRunPresentation.test.js +0 -278
- package/dist/presentation/intent/derivePresentationInterpretation.d.ts +0 -4
- package/dist/presentation/intent/derivePresentationInterpretation.d.ts.map +0 -1
- package/dist/presentation/intent/derivePresentationInterpretation.js +0 -202
- package/dist/presentation/intent/formatPresentationCopy.d.ts +0 -8
- package/dist/presentation/intent/formatPresentationCopy.d.ts.map +0 -1
- package/dist/presentation/intent/formatPresentationCopy.js +0 -140
- package/dist/presentation/intent/presentationIntent.test.d.ts +0 -2
- package/dist/presentation/intent/presentationIntent.test.d.ts.map +0 -1
- package/dist/presentation/intent/presentationIntent.test.js +0 -29
- package/dist/presentation/intent/verificationFocusLabels.d.ts +0 -2
- package/dist/presentation/intent/verificationFocusLabels.d.ts.map +0 -1
- package/dist/presentation/intent/verificationFocusLabels.js +0 -45
- package/dist/presentation/profile/derivePresentationProfile.d.ts +0 -12
- package/dist/presentation/profile/derivePresentationProfile.d.ts.map +0 -1
- package/dist/presentation/profile/derivePresentationProfile.js +0 -85
- package/dist/scanCardSummary.d.ts +0 -58
- package/dist/scanCardSummary.d.ts.map +0 -1
- package/dist/scanCardSummary.js +0 -146
- package/dist/scanCardSummary.test.d.ts +0 -2
- package/dist/scanCardSummary.test.d.ts.map +0 -1
- package/dist/scanCardSummary.test.js +0 -234
- package/dist/scanDetailViewModel.d.ts.map +0 -1
- package/dist/scanDetailViewModel.js +0 -636
- package/dist/scanDetailViewModel.test.d.ts +0 -2
- package/dist/scanDetailViewModel.test.d.ts.map +0 -1
- package/dist/scanDetailViewModel.test.js +0 -530
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assessmentFastifyRuntime, assessmentLimitedContext, assessmentTypescriptPatch, } from "../../fixtures/assessmentFixtures.js";
|
|
1
2
|
import { fixtureRepoIntelligenceFastify, fixtureRepoIntelligenceTypescript, } from "../../fixtures/repoIntelligenceFixtures.js";
|
|
2
3
|
import { analysisPreparationWithValidRepoIntel } from "../../fixtures/repoIntelligenceTestHelpers.js";
|
|
3
4
|
export const scanResultFastifyRuntime = {
|
|
@@ -13,10 +14,14 @@ export const scanResultFastifyRuntime = {
|
|
|
13
14
|
changedPackages: ["fastify"],
|
|
14
15
|
analysisPreparation: analysisPreparationWithValidRepoIntel(),
|
|
15
16
|
repoIntelligence: fixtureRepoIntelligenceFastify,
|
|
17
|
+
assessment: assessmentFastifyRuntime,
|
|
16
18
|
decision: {
|
|
17
19
|
recommendation: "needs_review",
|
|
18
20
|
confidence: "medium",
|
|
19
|
-
reasoning: [
|
|
21
|
+
reasoning: [
|
|
22
|
+
"Changed package has confirmed usage on runtime application paths in this repository.",
|
|
23
|
+
"HTTP framework infrastructure",
|
|
24
|
+
],
|
|
20
25
|
},
|
|
21
26
|
insights: [
|
|
22
27
|
{
|
|
@@ -43,10 +48,13 @@ export const scanResultTypescriptPatch = {
|
|
|
43
48
|
changedPackages: ["typescript"],
|
|
44
49
|
analysisPreparation: analysisPreparationWithValidRepoIntel(),
|
|
45
50
|
repoIntelligence: fixtureRepoIntelligenceTypescript,
|
|
51
|
+
assessment: assessmentTypescriptPatch,
|
|
46
52
|
decision: {
|
|
47
53
|
recommendation: "safe",
|
|
48
54
|
confidence: "high",
|
|
49
|
-
reasoning: [
|
|
55
|
+
reasoning: [
|
|
56
|
+
"No dedicated dependency review required beyond normal engineering process.",
|
|
57
|
+
],
|
|
50
58
|
},
|
|
51
59
|
graphInsights: {
|
|
52
60
|
maxDepth: 4,
|
|
@@ -67,6 +75,7 @@ export const scanResultLimitedContext = {
|
|
|
67
75
|
generatedAt: "2026-01-01T00:00:00.000Z",
|
|
68
76
|
changedPackages: ["lodash"],
|
|
69
77
|
repoIntelligence: { invalid: true },
|
|
78
|
+
assessment: assessmentLimitedContext,
|
|
70
79
|
graphInsights: {
|
|
71
80
|
maxDepth: 5,
|
|
72
81
|
nodes: 200,
|
|
@@ -78,6 +87,8 @@ export const scanResultLimitedContext = {
|
|
|
78
87
|
decision: {
|
|
79
88
|
recommendation: "needs_review",
|
|
80
89
|
confidence: "low",
|
|
81
|
-
reasoning: [
|
|
90
|
+
reasoning: [
|
|
91
|
+
"Collection evidence is partial; confidence is reduced but review posture is preserved when runtime signals exist.",
|
|
92
|
+
],
|
|
82
93
|
},
|
|
83
94
|
};
|
|
@@ -7,7 +7,6 @@ export { buildScanDetailsPresentation } from "./orchestration/buildScanDetailsPr
|
|
|
7
7
|
export type { BuildScanDetailsPresentationInput } from "./orchestration/buildScanDetailsPresentation.js";
|
|
8
8
|
export type { PresentationProfile } from "./profile/presentationProfile.js";
|
|
9
9
|
export type { PresentationIntent, PresentationInterpretation, } from "./intent/presentationIntent.js";
|
|
10
|
-
export { derivePresentationInterpretation } from "./intent/derivePresentationInterpretation.js";
|
|
11
10
|
export type { PipelineStatus, PresentationStatus, PresentationDensity, PresentationConfidence, PresentationPriority, PresentationEvidenceContext, PresentationEvidenceRow, } from "./dto/types.js";
|
|
12
11
|
export type { DashboardCardPresentation } from "./dto/dashboardCardPresentation.js";
|
|
13
12
|
export type { DashboardCardLayout } from "./dto/dashboardCardPresentation.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,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,
|
|
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,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,gDAAgD;AAChD,YAAY,EAAE,yBAAyB,IAAI,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC5G,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,sCAAsC,CAAC;AAC9C,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,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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";
|
|
5
4
|
export { presentDashboardCard, presentPipelineDashboardCard, } from "./presenters/presentDashboardCard.js";
|
|
6
5
|
export { presentScanDetails } from "./presenters/presentScanDetails.js";
|
|
7
6
|
export { presentGitHubCheckRun } from "./presenters/presentGitHubCheckRun.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildScanCardPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/orchestration/buildScanCardPresentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildScanCardPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/orchestration/buildScanCardPresentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAUjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,cAAc,EAAE,cAAc,CAAC;IAC/B,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AA+BF,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,8BAA8B,GACpC,yBAAyB,CA2B3B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { assessmentLimitedContext } from "../../fixtures/assessmentFixtures.js";
|
|
2
|
+
import { mergePostureFromDecision, } from "../../riskVocabulary.js";
|
|
2
3
|
import { buildScanPresentationBundle } from "./buildScanPresentationBundle.js";
|
|
3
4
|
import { presentDashboardCard, presentPipelineDashboardCard, } from "../presenters/presentDashboardCard.js";
|
|
4
5
|
function minimalResultFromDenormalized(decision, totalScore) {
|
|
@@ -6,6 +7,7 @@ function minimalResultFromDenormalized(decision, totalScore) {
|
|
|
6
7
|
if (!posture && (totalScore == null || !Number.isFinite(totalScore))) {
|
|
7
8
|
return null;
|
|
8
9
|
}
|
|
10
|
+
const resolvedPosture = posture;
|
|
9
11
|
return {
|
|
10
12
|
totalScore: totalScore ?? 0,
|
|
11
13
|
layerScores: {
|
|
@@ -16,8 +18,11 @@ function minimalResultFromDenormalized(decision, totalScore) {
|
|
|
16
18
|
},
|
|
17
19
|
findings: [],
|
|
18
20
|
generatedAt: new Date().toISOString(),
|
|
19
|
-
decision:
|
|
20
|
-
? { recommendation:
|
|
21
|
+
decision: resolvedPosture
|
|
22
|
+
? { recommendation: resolvedPosture, confidence: "medium", reasoning: [] }
|
|
23
|
+
: undefined,
|
|
24
|
+
assessment: resolvedPosture
|
|
25
|
+
? { ...assessmentLimitedContext, posture: resolvedPosture }
|
|
21
26
|
: undefined,
|
|
22
27
|
};
|
|
23
28
|
}
|
|
@@ -9,7 +9,7 @@ export type BuildScanPresentationBundleInput = {
|
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Mandatory orchestration entrypoint for completed-scan presentation.
|
|
12
|
-
*
|
|
12
|
+
* Assessment is the sole authority; profile is a thin projection.
|
|
13
13
|
*/
|
|
14
14
|
export declare function buildScanPresentationBundle(input: BuildScanPresentationBundleInput): ScanPresentationBundle | null;
|
|
15
15
|
//# sourceMappingURL=buildScanPresentationBundle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildScanPresentationBundle.d.ts","sourceRoot":"","sources":["../../../src/presentation/orchestration/buildScanPresentationBundle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildScanPresentationBundle.d.ts","sourceRoot":"","sources":["../../../src/presentation/orchestration/buildScanPresentationBundle.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE,UAAU,CAAC;IACnB,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,GACtC,sBAAsB,GAAG,IAAI,CAsB/B"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
+
import { parseAssessmentOrThrow, toPublicPresentation, } from "../../assessmentSchema.js";
|
|
1
2
|
import { deriveScanNarrative } from "../../deriveScanNarrative.js";
|
|
2
|
-
import {
|
|
3
|
+
import { buildProfileFromAssessment } from "../profile/buildProfileFromAssessment.js";
|
|
3
4
|
/**
|
|
4
5
|
* Mandatory orchestration entrypoint for completed-scan presentation.
|
|
5
|
-
*
|
|
6
|
+
* Assessment is the sole authority; profile is a thin projection.
|
|
6
7
|
*/
|
|
7
8
|
export function buildScanPresentationBundle(input) {
|
|
8
9
|
if (input.pipelineStatus !== "done" || !input.result)
|
|
9
10
|
return null;
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
pipelineStatus: input.pipelineStatus,
|
|
13
|
-
decision: input.decision,
|
|
14
|
-
totalScore: input.totalScore ?? input.result.totalScore,
|
|
15
|
-
});
|
|
16
|
-
if (!profile)
|
|
11
|
+
const assessment = input.result.assessment;
|
|
12
|
+
if (!assessment)
|
|
17
13
|
return null;
|
|
14
|
+
parseAssessmentOrThrow(assessment);
|
|
15
|
+
const presentation = toPublicPresentation(assessment.presentation);
|
|
16
|
+
const profile = buildProfileFromAssessment(assessment, presentation, input.result);
|
|
17
|
+
const facts = deriveScanNarrative(input.result);
|
|
18
18
|
return {
|
|
19
|
-
|
|
19
|
+
assessment,
|
|
20
|
+
presentation,
|
|
20
21
|
profile,
|
|
22
|
+
facts,
|
|
21
23
|
result: input.result,
|
|
22
24
|
};
|
|
23
25
|
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
+
import type { Assessment, AssessmentPresentationPublic } from "../../assessmentSchema.js";
|
|
1
2
|
import type { ScanNarrativeFacts } from "../../scanNarrativeFacts.js";
|
|
2
3
|
import type { ScanResult } from "../../types.js";
|
|
3
4
|
import type { PresentationProfile } from "../profile/presentationProfile.js";
|
|
4
5
|
export type ScanPresentationBundle = {
|
|
5
|
-
|
|
6
|
+
assessment: Assessment;
|
|
7
|
+
presentation: AssessmentPresentationPublic;
|
|
6
8
|
profile: PresentationProfile;
|
|
9
|
+
/**
|
|
10
|
+
* Evidence layout only — not an authority for posture, concern, or intensity.
|
|
11
|
+
* @deprecated Prefer assessment + repoIntelligence on result for new code.
|
|
12
|
+
*/
|
|
13
|
+
facts: ScanNarrativeFacts;
|
|
7
14
|
/**
|
|
8
15
|
* Projection-only reference to the raw scan payload.
|
|
9
16
|
* Presenters may read fields for formatting but must NOT re-derive interpretation.
|
|
10
17
|
*/
|
|
11
18
|
result: ScanResult;
|
|
12
|
-
/** Extension point for future shared derived artifacts */
|
|
13
|
-
shared?: Record<string, unknown>;
|
|
14
19
|
};
|
|
15
20
|
//# sourceMappingURL=scanPresentationBundle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanPresentationBundle.d.ts","sourceRoot":"","sources":["../../../src/presentation/orchestration/scanPresentationBundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,MAAM,MAAM,sBAAsB,GAAG;IACnC,
|
|
1
|
+
{"version":3,"file":"scanPresentationBundle.d.ts","sourceRoot":"","sources":["../../../src/presentation/orchestration/scanPresentationBundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,4BAA4B,EAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,4BAA4B,CAAC;IAC3C,OAAO,EAAE,mBAAmB,CAAC;IAC7B;;;OAGG;IACH,KAAK,EAAE,kBAAkB,CAAC;IAC1B;;;OAGG;IACH,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC"}
|
|
@@ -25,9 +25,9 @@ const personas = [
|
|
|
25
25
|
intent: "tooling_upgrade",
|
|
26
26
|
status: "safe",
|
|
27
27
|
density: "minimal",
|
|
28
|
-
headlineMatch: /
|
|
28
|
+
headlineMatch: /patch upgrade/i,
|
|
29
29
|
headlineMustNot: /needs review/i,
|
|
30
|
-
verificationIncludes: ["
|
|
30
|
+
verificationIncludes: ["ci", "lint"],
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
name: "prettier",
|
|
@@ -35,7 +35,7 @@ const personas = [
|
|
|
35
35
|
intent: "tooling_upgrade",
|
|
36
36
|
status: "safe",
|
|
37
37
|
density: "minimal",
|
|
38
|
-
headlineMatch: /
|
|
38
|
+
headlineMatch: /patch upgrade/i,
|
|
39
39
|
headlineMustNot: /needs review/i,
|
|
40
40
|
verificationIncludes: ["format"],
|
|
41
41
|
},
|
|
@@ -45,9 +45,9 @@ const personas = [
|
|
|
45
45
|
intent: "tooling_upgrade",
|
|
46
46
|
status: "safe",
|
|
47
47
|
density: "minimal",
|
|
48
|
-
headlineMatch: /
|
|
48
|
+
headlineMatch: /patch upgrade|dependency upgrade/i,
|
|
49
49
|
headlineMustNot: /needs review/i,
|
|
50
|
-
verificationIncludes: ["test
|
|
50
|
+
verificationIncludes: ["test"],
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
name: "fastify runtime",
|
|
@@ -65,7 +65,7 @@ const personas = [
|
|
|
65
65
|
status: "needs_review",
|
|
66
66
|
density: "rich",
|
|
67
67
|
headlineMatch: /runtime upgrade affects/i,
|
|
68
|
-
verificationIncludes: ["
|
|
68
|
+
verificationIncludes: ["auth_flow"],
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: "bullmq runtime",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentCliScanSummary.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentCliScanSummary.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"presentCliScanSummary.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentCliScanSummary.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAGzF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,mBAAmB,CA8BrB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildNarrativeChannels, composeHeadline, composeSubheadline, composeSupportingContext, composeVerificationActions, evidenceContextFromProfile, projectCompactKeyPoints, } from "../compose/narrativeCompose.js";
|
|
2
|
+
import { projectAssessmentFields } from "../projectAssessmentFields.js";
|
|
2
3
|
export function presentCliScanSummary(bundle, ctx = {}) {
|
|
3
4
|
const { facts, profile, result } = bundle;
|
|
4
5
|
const layers = result.layerScores;
|
|
@@ -6,6 +7,7 @@ export function presentCliScanSummary(bundle, ctx = {}) {
|
|
|
6
7
|
? `security=${layers.security} maintainability=${layers.maintainability} ecosystem=${layers.ecosystem} upgradeImpact=${layers.upgradeImpact}`
|
|
7
8
|
: "";
|
|
8
9
|
return {
|
|
10
|
+
...projectAssessmentFields(bundle),
|
|
9
11
|
header: {
|
|
10
12
|
repoLabel: ctx.repoLabel ?? "scan",
|
|
11
13
|
methodology: result.methodologyVersion ?? undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentDashboardCard.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentDashboardCard.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"presentDashboardCard.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentDashboardCard.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAoEzF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,sBAAsB,GAC7B,yBAAyB,CA8C3B;AAED,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAC9C,yBAAyB,CAqB3B"}
|
|
@@ -2,6 +2,7 @@ import { MERGE_POSTURE_LABEL, MERGE_POSTURE_SORT_ORDER, } from "../../riskVocabu
|
|
|
2
2
|
import { normalizeGeneratedText, normalizeGeneratedTextNullable, } from "../../normalizeGeneratedText.js";
|
|
3
3
|
import { scanSurfaceCopy } from "../../scanSurfaceCopy.js";
|
|
4
4
|
import { buildNarrativeChannels } from "../compose/narrativeChannels.js";
|
|
5
|
+
import { projectAssessmentFields } from "../projectAssessmentFields.js";
|
|
5
6
|
const INSIGHTS_CAP = 3;
|
|
6
7
|
const SCOPE_AREAS_CAP = 2;
|
|
7
8
|
const EVIDENCE_CAP = 2;
|
|
@@ -72,6 +73,7 @@ export function presentDashboardCard(bundle) {
|
|
|
72
73
|
.slice(0, VERIFICATION_CAP)
|
|
73
74
|
.map(formatVerificationLine);
|
|
74
75
|
const card = {
|
|
76
|
+
...projectAssessmentFields(bundle),
|
|
75
77
|
verdict: {
|
|
76
78
|
posture,
|
|
77
79
|
postureLabel: MERGE_POSTURE_LABEL[posture],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentGitHubCheckRun.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentGitHubCheckRun.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"presentGitHubCheckRun.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentGitHubCheckRun.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAGzF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAChE,0BAA0B,CAmC5B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildNarrativeChannels, composeHeadline, composeSubheadline, composeVerificationActions, evidenceContextFromProfile, projectCompactKeyPoints, } from "../compose/narrativeCompose.js";
|
|
2
|
+
import { projectAssessmentFields } from "../projectAssessmentFields.js";
|
|
2
3
|
export function presentGitHubCheckRun(bundle, ctx) {
|
|
3
4
|
const { profile } = bundle;
|
|
4
5
|
const headline = composeHeadline(bundle);
|
|
@@ -19,6 +20,7 @@ export function presentGitHubCheckRun(bundle, ctx) {
|
|
|
19
20
|
}
|
|
20
21
|
sections.push({ id: "footer", bullets: [`Full scan: ${detailsUrl}`] });
|
|
21
22
|
return {
|
|
23
|
+
...projectAssessmentFields(bundle),
|
|
22
24
|
status: profile.status,
|
|
23
25
|
density: profile.density,
|
|
24
26
|
confidence: profile.confidence,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentGitHubPrComment.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentGitHubPrComment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presentGitHubPrComment.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentGitHubPrComment.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAGzF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,2BAA2B,CA8B7B"}
|
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
import { MERGE_POSTURE_LABEL } from "../../riskVocabulary.js";
|
|
2
|
-
import {
|
|
3
|
-
import { formatChangedPackagesShort
|
|
2
|
+
import { buildNarrativeChannels, evidenceContextFromProfile, } from "../compose/narrativeCompose.js";
|
|
3
|
+
import { formatChangedPackagesShort } from "../../narrativePresentation.js";
|
|
4
|
+
import { projectAssessmentFields } from "../projectAssessmentFields.js";
|
|
4
5
|
export function presentGitHubPrComment(bundle) {
|
|
5
6
|
const { facts, profile } = bundle;
|
|
7
|
+
const channels = buildNarrativeChannels(bundle);
|
|
8
|
+
const assessmentFields = projectAssessmentFields(bundle);
|
|
6
9
|
const introLines = [];
|
|
7
10
|
const changed = formatChangedPackagesShort(facts, 3);
|
|
8
11
|
if (changed)
|
|
9
12
|
introLines.push(`Changed: ${changed}`);
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const verify =
|
|
13
|
+
for (const line of assessmentFields.reasoning.slice(0, 2)) {
|
|
14
|
+
introLines.push(line);
|
|
15
|
+
}
|
|
16
|
+
const verify = channels.verification[0];
|
|
14
17
|
if (verify)
|
|
15
18
|
introLines.push(`Verify: ${verify}`);
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const where = g.context?.trim() ||
|
|
22
|
-
facts.packageUsage
|
|
23
|
-
.flatMap((u) => u.paths.slice(0, 1))
|
|
24
|
-
.filter(Boolean)[0] ||
|
|
25
|
-
"See scan detail for affected paths.";
|
|
26
|
-
const action = g.remediation?.trim() ||
|
|
27
|
-
composeVerificationActions(bundle, 1)[0] ||
|
|
28
|
-
"Review before merge.";
|
|
29
|
-
return { message: g.message, where, action };
|
|
30
|
-
});
|
|
19
|
+
const guidanceBlocks = channels.verification.slice(0, 3).map((action) => ({
|
|
20
|
+
message: assessmentFields.reasoning[0] ?? action,
|
|
21
|
+
where: changed ?? "See scan detail for affected paths.",
|
|
22
|
+
action,
|
|
23
|
+
}));
|
|
31
24
|
return {
|
|
25
|
+
...assessmentFields,
|
|
32
26
|
status: profile.status,
|
|
33
27
|
density: profile.density,
|
|
34
28
|
confidence: profile.confidence,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentScanDetails.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentScanDetails.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presentScanDetails.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentScanDetails.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAGzF,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAmDF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE,yBAAyB,GAC7B,uBAAuB,CAwEzB"}
|
|
@@ -1,88 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MERGE_CONCERN_LABELS } from "../../assessmentLabels.js";
|
|
2
2
|
import { MERGE_POSTURE_LABEL } from "../../riskVocabulary.js";
|
|
3
|
-
import {
|
|
4
|
-
import { buildNarrativeChannels, composeHeadline, composeSubheadline, composeSupportingContext, composeVerificationActions, evidenceContextFromProfile, projectCompactKeyPoints, } from "../compose/narrativeCompose.js";
|
|
3
|
+
import { buildNarrativeChannels, composeSubheadline, composeSupportingContext, evidenceContextFromProfile, projectCompactKeyPoints, } from "../compose/narrativeCompose.js";
|
|
5
4
|
import { normalizeGeneratedText, normalizeGeneratedTextNullable, } from "../../normalizeGeneratedText.js";
|
|
6
5
|
import { scanSurfaceCopy } from "../../scanSurfaceCopy.js";
|
|
7
|
-
|
|
8
|
-
const oi = vm.operationalImpact;
|
|
9
|
-
if (oi.status === "hidden") {
|
|
10
|
-
return { status: "hidden", items: [] };
|
|
11
|
-
}
|
|
12
|
-
if (oi.status === "rich") {
|
|
13
|
-
return {
|
|
14
|
-
status: "rich",
|
|
15
|
-
items: oi.items.map((item) => ({
|
|
16
|
-
message: item.message,
|
|
17
|
-
where: item.where,
|
|
18
|
-
verify: item.verify,
|
|
19
|
-
affectedFiles: item.affectedFiles,
|
|
20
|
-
})),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
status: "compact",
|
|
25
|
-
items: oi.items,
|
|
26
|
-
fallbackMessage: oi.fallbackMessage,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function mapRecommendations(vm) {
|
|
30
|
-
const items = vm.recommendedActions.items.map((item) => ({
|
|
31
|
-
rank: item.rank,
|
|
32
|
-
title: item.title,
|
|
33
|
-
priority: item.priority === "high" ||
|
|
34
|
-
item.priority === "medium" ||
|
|
35
|
-
item.priority === "low"
|
|
36
|
-
? item.priority
|
|
37
|
-
: "medium",
|
|
38
|
-
rationale: item.detail?.why,
|
|
39
|
-
}));
|
|
40
|
-
return { items };
|
|
41
|
-
}
|
|
42
|
-
function mapEvidence(bundle, vm) {
|
|
43
|
-
const defaultCollapsed = bundle.profile.priority === "pr_intelligence" &&
|
|
44
|
-
bundle.profile.density === "rich";
|
|
45
|
-
const ev = vm.evidence;
|
|
46
|
-
if (!ev) {
|
|
47
|
-
return {
|
|
48
|
-
defaultCollapsed,
|
|
49
|
-
attentionAreas: [],
|
|
50
|
-
findings: [],
|
|
51
|
-
findingsOverflowCount: 0,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
defaultCollapsed,
|
|
56
|
-
attentionAreas: ev.attentionAreas.map((area) => ({
|
|
57
|
-
problemLabel: area.problemLabel,
|
|
58
|
-
problemDescription: area.problemDescription,
|
|
59
|
-
packages: area.packages.map((p) => ({
|
|
60
|
-
name: p.name,
|
|
61
|
-
version: p.version,
|
|
62
|
-
direct: p.direct,
|
|
63
|
-
severity: p.severity,
|
|
64
|
-
evidence: p.evidence,
|
|
65
|
-
})),
|
|
66
|
-
overflowCount: area.overflowCount,
|
|
67
|
-
})),
|
|
68
|
-
findings: ev.findings.map((f) => ({
|
|
69
|
-
id: f.id,
|
|
70
|
-
severity: f.severity,
|
|
71
|
-
title: f.title,
|
|
72
|
-
description: f.description,
|
|
73
|
-
packageName: f.packageName,
|
|
74
|
-
recommendation: f.recommendation,
|
|
75
|
-
source: f.source,
|
|
76
|
-
})),
|
|
77
|
-
findingsOverflowCount: ev.findingsOverflowCount,
|
|
78
|
-
topology: ev.topology
|
|
79
|
-
? {
|
|
80
|
-
summaryLine: ev.topology.summaryLine,
|
|
81
|
-
deepest: ev.topology.deepest,
|
|
82
|
-
}
|
|
83
|
-
: undefined,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
6
|
+
import { projectAssessmentFields } from "../projectAssessmentFields.js";
|
|
86
7
|
function mapUsage(bundle) {
|
|
87
8
|
const { facts } = bundle;
|
|
88
9
|
if (facts.packageUsage.length === 0 && facts.frameworks.length === 0) {
|
|
@@ -101,20 +22,31 @@ function mapUsage(bundle) {
|
|
|
101
22
|
frameworks: facts.frameworks,
|
|
102
23
|
};
|
|
103
24
|
}
|
|
25
|
+
function mapEvidence(bundle) {
|
|
26
|
+
const defaultCollapsed = bundle.profile.priority === "pr_intelligence" &&
|
|
27
|
+
bundle.profile.density === "rich";
|
|
28
|
+
const findings = (bundle.result.findings ?? []).slice(0, 8).map((f) => ({
|
|
29
|
+
id: f.id,
|
|
30
|
+
severity: f.severity,
|
|
31
|
+
title: f.title,
|
|
32
|
+
description: f.description,
|
|
33
|
+
packageName: f.packageName,
|
|
34
|
+
recommendation: f.recommendation,
|
|
35
|
+
source: "dependency",
|
|
36
|
+
}));
|
|
37
|
+
return {
|
|
38
|
+
defaultCollapsed,
|
|
39
|
+
attentionAreas: [],
|
|
40
|
+
findings,
|
|
41
|
+
findingsOverflowCount: Math.max(0, (bundle.result.findings?.length ?? 0) - findings.length),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
104
44
|
export function presentScanDetails(bundle, ctx) {
|
|
105
|
-
const { facts, profile, result } = bundle;
|
|
106
|
-
const
|
|
107
|
-
scanId: ctx.scanId,
|
|
108
|
-
status: "done",
|
|
109
|
-
methodologyVersion: ctx.methodologyVersion,
|
|
110
|
-
prNumber: ctx.prNumber,
|
|
111
|
-
repoContext: { status: "hidden" },
|
|
112
|
-
});
|
|
113
|
-
const headline = composeHeadline(bundle);
|
|
114
|
-
const subheadline = composeSubheadline(bundle);
|
|
45
|
+
const { assessment, facts, profile, result } = bundle;
|
|
46
|
+
const assessmentFields = projectAssessmentFields(bundle);
|
|
115
47
|
const channels = buildNarrativeChannels(bundle);
|
|
116
48
|
const keyPoints = projectCompactKeyPoints(channels, 6);
|
|
117
|
-
const
|
|
49
|
+
const subheadline = composeSubheadline(bundle);
|
|
118
50
|
const supportingLines = composeSupportingContext(bundle);
|
|
119
51
|
const supportingContext = supportingLines
|
|
120
52
|
? {
|
|
@@ -122,28 +54,39 @@ export function presentScanDetails(bundle, ctx) {
|
|
|
122
54
|
lines: supportingLines,
|
|
123
55
|
}
|
|
124
56
|
: undefined;
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
:
|
|
57
|
+
const postureLabel = MERGE_POSTURE_LABEL[profile.status];
|
|
58
|
+
const verdictLine = assessmentFields.reasoning[0] ??
|
|
59
|
+
(assessment.primaryConcern
|
|
60
|
+
? MERGE_CONCERN_LABELS[assessment.primaryConcern]
|
|
61
|
+
: postureLabel);
|
|
62
|
+
const verificationActions = channels.verification.map((title, index) => ({
|
|
63
|
+
title: normalizeGeneratedText(title),
|
|
64
|
+
detail: assessmentFields.reasoning[index + 1],
|
|
65
|
+
}));
|
|
66
|
+
const recommendations = verificationActions.map((action, index) => ({
|
|
67
|
+
rank: index + 1,
|
|
68
|
+
title: action.title,
|
|
69
|
+
priority: profile.status === "risky"
|
|
70
|
+
? "high"
|
|
71
|
+
: profile.status === "needs_review"
|
|
72
|
+
? "medium"
|
|
73
|
+
: "low",
|
|
74
|
+
rationale: action.detail,
|
|
75
|
+
}));
|
|
132
76
|
return {
|
|
77
|
+
...assessmentFields,
|
|
133
78
|
evidenceContext: evidenceContextFromProfile(bundle),
|
|
134
79
|
status: profile.status,
|
|
135
80
|
density: profile.density,
|
|
136
81
|
confidence: profile.confidence,
|
|
137
82
|
presentationIntent: profile.interpretation.intent,
|
|
138
83
|
hero: {
|
|
139
|
-
headline: normalizeGeneratedText(headline),
|
|
84
|
+
headline: normalizeGeneratedText(channels.headline),
|
|
140
85
|
subheadline: normalizeGeneratedTextNullable(subheadline) ?? undefined,
|
|
141
86
|
verdictLine: normalizeGeneratedText(verdictLine),
|
|
142
|
-
scopeChip: channels.reachLabel
|
|
143
|
-
deriveDetailReachChip(result.totalScore) ??
|
|
144
|
-
undefined,
|
|
87
|
+
scopeChip: channels.reachLabel,
|
|
145
88
|
postureLabel,
|
|
146
|
-
riskIndex:
|
|
89
|
+
riskIndex: result.totalScore,
|
|
147
90
|
},
|
|
148
91
|
narrative: {
|
|
149
92
|
keyPoints: keyPoints.map((k) => normalizeGeneratedText(k)),
|
|
@@ -151,30 +94,10 @@ export function presentScanDetails(bundle, ctx) {
|
|
|
151
94
|
primaryPackage: facts.changedPackages.primary ?? undefined,
|
|
152
95
|
},
|
|
153
96
|
usage: mapUsage(bundle),
|
|
154
|
-
verification: {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
signalSummary: vm.signalSummary
|
|
160
|
-
? {
|
|
161
|
-
riskIndex: vm.signalSummary.score,
|
|
162
|
-
band: vm.signalSummary.overallBand === "moderate"
|
|
163
|
-
? "medium"
|
|
164
|
-
: vm.signalSummary.overallBand === "high"
|
|
165
|
-
? "high"
|
|
166
|
-
: "low",
|
|
167
|
-
layers: vm.signalSummary.layers.map((l) => ({
|
|
168
|
-
layer: l.layer,
|
|
169
|
-
score: l.score,
|
|
170
|
-
band: l.concernLabel,
|
|
171
|
-
label: l.label,
|
|
172
|
-
})),
|
|
173
|
-
}
|
|
174
|
-
: undefined,
|
|
175
|
-
operationalImpact: mapOperationalImpact(vm),
|
|
176
|
-
recommendations: mapRecommendations(vm),
|
|
177
|
-
evidence: mapEvidence(bundle, vm),
|
|
97
|
+
verification: { actions: verificationActions },
|
|
98
|
+
operationalImpact: { status: "hidden", items: [] },
|
|
99
|
+
recommendations: { items: recommendations },
|
|
100
|
+
evidence: mapEvidence(bundle),
|
|
178
101
|
supportingContext,
|
|
179
102
|
metadata: {
|
|
180
103
|
scanId: ctx.scanId,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Assessment, AssessmentPresentationPublic } from "../../assessmentSchema.js";
|
|
2
|
+
import type { ScanResult } from "../../types.js";
|
|
3
|
+
import type { PresentationProfile } from "./presentationProfile.js";
|
|
4
|
+
export declare function buildProfileFromAssessment(assessment: Assessment, presentation: AssessmentPresentationPublic, result: ScanResult): PresentationProfile;
|
|
5
|
+
//# sourceMappingURL=buildProfileFromAssessment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildProfileFromAssessment.d.ts","sourceRoot":"","sources":["../../../src/presentation/profile/buildProfileFromAssessment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,4BAA4B,EAC7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAwCpE,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,4BAA4B,EAC1C,MAAM,EAAE,UAAU,GACjB,mBAAmB,CAuBrB"}
|