@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.
Files changed (171) hide show
  1. package/dist/actionsStepSummary.d.ts +1 -22
  2. package/dist/actionsStepSummary.d.ts.map +1 -1
  3. package/dist/actionsStepSummary.js +19 -716
  4. package/dist/actionsStepSummary.test.js +34 -329
  5. package/dist/assessmentLabels.d.ts +6 -0
  6. package/dist/assessmentLabels.d.ts.map +1 -0
  7. package/dist/assessmentLabels.js +33 -0
  8. package/dist/assessmentProjection.d.ts +12 -0
  9. package/dist/assessmentProjection.d.ts.map +1 -0
  10. package/dist/assessmentProjection.js +100 -0
  11. package/dist/assessmentSchema.d.ts +155 -0
  12. package/dist/assessmentSchema.d.ts.map +1 -0
  13. package/dist/assessmentSchema.js +110 -0
  14. package/dist/cardObservationCatalog.d.ts +2 -0
  15. package/dist/cardObservationCatalog.d.ts.map +1 -1
  16. package/dist/cardObservationCatalog.js +47 -1
  17. package/dist/engineWireRegression.test.js +22 -2
  18. package/dist/fixtures/assessmentFixtures.d.ts +13 -0
  19. package/dist/fixtures/assessmentFixtures.d.ts.map +1 -0
  20. package/dist/fixtures/assessmentFixtures.js +164 -0
  21. package/dist/formatCardExposureDisplay.d.ts +0 -4
  22. package/dist/formatCardExposureDisplay.d.ts.map +1 -1
  23. package/dist/formatCardExposureDisplay.js +0 -15
  24. package/dist/formatInsight.d.ts +3 -2
  25. package/dist/formatInsight.d.ts.map +1 -1
  26. package/dist/formatInsight.js +26 -1
  27. package/dist/index.d.ts +7 -11
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +7 -11
  30. package/dist/narrativeParity.test.js +4 -34
  31. package/dist/presentGitHubPrComment.d.ts +1 -3
  32. package/dist/presentGitHubPrComment.d.ts.map +1 -1
  33. package/dist/presentGitHubPrComment.js +0 -17
  34. package/dist/presentation/compose/narrativeChannels.d.ts.map +1 -1
  35. package/dist/presentation/compose/narrativeChannels.js +13 -43
  36. package/dist/presentation/compose/narrativeCompose.d.ts.map +1 -1
  37. package/dist/presentation/compose/narrativeCompose.js +2 -5
  38. package/dist/presentation/dto/assessmentPresentationFields.d.ts +13 -0
  39. package/dist/presentation/dto/assessmentPresentationFields.d.ts.map +1 -0
  40. package/dist/presentation/dto/assessmentPresentationFields.js +1 -0
  41. package/dist/presentation/dto/dashboardCardPresentation.d.ts +2 -1
  42. package/dist/presentation/dto/dashboardCardPresentation.d.ts.map +1 -1
  43. package/dist/presentation/dto/githubAndCliPresentation.d.ts +4 -3
  44. package/dist/presentation/dto/githubAndCliPresentation.d.ts.map +1 -1
  45. package/dist/presentation/dto/scanDetailsPresentation.d.ts +2 -1
  46. package/dist/presentation/dto/scanDetailsPresentation.d.ts.map +1 -1
  47. package/dist/presentation/fixtures/dashboardCardGolden.test.js +21 -14
  48. package/dist/presentation/fixtures/presentationPersonaFixtures.d.ts.map +1 -1
  49. package/dist/presentation/fixtures/presentationPersonaFixtures.js +31 -24
  50. package/dist/presentation/fixtures/scanResultFixtures.d.ts.map +1 -1
  51. package/dist/presentation/fixtures/scanResultFixtures.js +14 -3
  52. package/dist/presentation/index.d.ts +0 -1
  53. package/dist/presentation/index.d.ts.map +1 -1
  54. package/dist/presentation/index.js +0 -1
  55. package/dist/presentation/orchestration/buildScanCardPresentation.d.ts.map +1 -1
  56. package/dist/presentation/orchestration/buildScanCardPresentation.js +8 -3
  57. package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts +1 -1
  58. package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts.map +1 -1
  59. package/dist/presentation/orchestration/buildScanPresentationBundle.js +12 -10
  60. package/dist/presentation/orchestration/scanPresentationBundle.d.ts +8 -3
  61. package/dist/presentation/orchestration/scanPresentationBundle.d.ts.map +1 -1
  62. package/dist/presentation/presentationPersonas.test.js +6 -6
  63. package/dist/presentation/presenters/presentCliScanSummary.d.ts.map +1 -1
  64. package/dist/presentation/presenters/presentCliScanSummary.js +2 -0
  65. package/dist/presentation/presenters/presentDashboardCard.d.ts.map +1 -1
  66. package/dist/presentation/presenters/presentDashboardCard.js +2 -0
  67. package/dist/presentation/presenters/presentGitHubCheckRun.d.ts.map +1 -1
  68. package/dist/presentation/presenters/presentGitHubCheckRun.js +2 -0
  69. package/dist/presentation/presenters/presentGitHubPrComment.d.ts.map +1 -1
  70. package/dist/presentation/presenters/presentGitHubPrComment.js +15 -21
  71. package/dist/presentation/presenters/presentScanDetails.d.ts.map +1 -1
  72. package/dist/presentation/presenters/presentScanDetails.js +52 -129
  73. package/dist/presentation/profile/buildProfileFromAssessment.d.ts +5 -0
  74. package/dist/presentation/profile/buildProfileFromAssessment.d.ts.map +1 -0
  75. package/dist/presentation/profile/buildProfileFromAssessment.js +58 -0
  76. package/dist/presentation/projectAssessmentFields.d.ts +4 -0
  77. package/dist/presentation/projectAssessmentFields.d.ts.map +1 -0
  78. package/dist/presentation/projectAssessmentFields.js +13 -0
  79. package/dist/presentation/surfaceParity.test.d.ts +2 -0
  80. package/dist/presentation/surfaceParity.test.d.ts.map +1 -0
  81. package/dist/presentation/surfaceParity.test.js +74 -0
  82. package/dist/productMessaging.d.ts +4 -4
  83. package/dist/productMessaging.d.ts.map +1 -1
  84. package/dist/productMessaging.js +4 -4
  85. package/dist/productMessaging.test.js +2 -2
  86. package/dist/repoIntelligenceSchema.d.ts +2 -2
  87. package/dist/resolvePipelineStatus.d.ts +15 -0
  88. package/dist/resolvePipelineStatus.d.ts.map +1 -0
  89. package/dist/resolvePipelineStatus.js +37 -0
  90. package/dist/scanCardPresentationState.d.ts +4 -0
  91. package/dist/scanCardPresentationState.d.ts.map +1 -0
  92. package/dist/scanCardPresentationState.js +4 -0
  93. package/dist/{scanDetailViewModel.d.ts → scanDetailViewModelTypes.d.ts} +60 -32
  94. package/dist/scanDetailViewModelTypes.d.ts.map +1 -0
  95. package/dist/scanDetailViewModelTypes.js +4 -0
  96. package/dist/scanResultSchema.d.ts +75 -2
  97. package/dist/scanResultSchema.d.ts.map +1 -1
  98. package/dist/scanResultSchema.js +4 -2
  99. package/dist/scanResultSchema.test.js +16 -0
  100. package/dist/trustedScanGuards.test.js +7 -0
  101. package/dist/types.d.ts +3 -0
  102. package/dist/types.d.ts.map +1 -1
  103. package/package.json +1 -1
  104. package/dist/collectNarrativeWhyBullets.d.ts +0 -12
  105. package/dist/collectNarrativeWhyBullets.d.ts.map +0 -1
  106. package/dist/collectNarrativeWhyBullets.js +0 -104
  107. package/dist/deriveCardDisplaySummary.d.ts +0 -16
  108. package/dist/deriveCardDisplaySummary.d.ts.map +0 -1
  109. package/dist/deriveCardDisplaySummary.js +0 -56
  110. package/dist/deriveCardDisplaySummary.test.d.ts +0 -2
  111. package/dist/deriveCardDisplaySummary.test.d.ts.map +0 -1
  112. package/dist/deriveCardDisplaySummary.test.js +0 -89
  113. package/dist/deriveCardOperationalObservations.d.ts +0 -19
  114. package/dist/deriveCardOperationalObservations.d.ts.map +0 -1
  115. package/dist/deriveCardOperationalObservations.js +0 -180
  116. package/dist/deriveCardOperationalObservations.test.d.ts +0 -2
  117. package/dist/deriveCardOperationalObservations.test.d.ts.map +0 -1
  118. package/dist/deriveCardOperationalObservations.test.js +0 -268
  119. package/dist/deriveRiskScoreSummary.d.ts +0 -33
  120. package/dist/deriveRiskScoreSummary.d.ts.map +0 -1
  121. package/dist/deriveRiskScoreSummary.js +0 -90
  122. package/dist/deriveRiskScoreSummary.test.d.ts +0 -2
  123. package/dist/deriveRiskScoreSummary.test.d.ts.map +0 -1
  124. package/dist/deriveRiskScoreSummary.test.js +0 -47
  125. package/dist/deriveScanDetailRecommendations.d.ts +0 -63
  126. package/dist/deriveScanDetailRecommendations.d.ts.map +0 -1
  127. package/dist/deriveScanDetailRecommendations.js +0 -725
  128. package/dist/deriveScanDetailRecommendations.test.d.ts +0 -2
  129. package/dist/deriveScanDetailRecommendations.test.d.ts.map +0 -1
  130. package/dist/deriveScanDetailRecommendations.test.js +0 -181
  131. package/dist/deriveScanSummaryText.d.ts +0 -7
  132. package/dist/deriveScanSummaryText.d.ts.map +0 -1
  133. package/dist/deriveScanSummaryText.js +0 -24
  134. package/dist/deriveScanSummaryText.test.d.ts +0 -2
  135. package/dist/deriveScanSummaryText.test.d.ts.map +0 -1
  136. package/dist/deriveScanSummaryText.test.js +0 -77
  137. package/dist/formatCardEvidenceCounts.d.ts +0 -7
  138. package/dist/formatCardEvidenceCounts.d.ts.map +0 -1
  139. package/dist/formatCardEvidenceCounts.js +0 -19
  140. package/dist/prCheckRunPresentation.d.ts +0 -68
  141. package/dist/prCheckRunPresentation.d.ts.map +0 -1
  142. package/dist/prCheckRunPresentation.js +0 -319
  143. package/dist/prCheckRunPresentation.test.d.ts +0 -2
  144. package/dist/prCheckRunPresentation.test.d.ts.map +0 -1
  145. package/dist/prCheckRunPresentation.test.js +0 -278
  146. package/dist/presentation/intent/derivePresentationInterpretation.d.ts +0 -4
  147. package/dist/presentation/intent/derivePresentationInterpretation.d.ts.map +0 -1
  148. package/dist/presentation/intent/derivePresentationInterpretation.js +0 -202
  149. package/dist/presentation/intent/formatPresentationCopy.d.ts +0 -8
  150. package/dist/presentation/intent/formatPresentationCopy.d.ts.map +0 -1
  151. package/dist/presentation/intent/formatPresentationCopy.js +0 -140
  152. package/dist/presentation/intent/presentationIntent.test.d.ts +0 -2
  153. package/dist/presentation/intent/presentationIntent.test.d.ts.map +0 -1
  154. package/dist/presentation/intent/presentationIntent.test.js +0 -29
  155. package/dist/presentation/intent/verificationFocusLabels.d.ts +0 -2
  156. package/dist/presentation/intent/verificationFocusLabels.d.ts.map +0 -1
  157. package/dist/presentation/intent/verificationFocusLabels.js +0 -45
  158. package/dist/presentation/profile/derivePresentationProfile.d.ts +0 -12
  159. package/dist/presentation/profile/derivePresentationProfile.d.ts.map +0 -1
  160. package/dist/presentation/profile/derivePresentationProfile.js +0 -85
  161. package/dist/scanCardSummary.d.ts +0 -58
  162. package/dist/scanCardSummary.d.ts.map +0 -1
  163. package/dist/scanCardSummary.js +0 -146
  164. package/dist/scanCardSummary.test.d.ts +0 -2
  165. package/dist/scanCardSummary.test.d.ts.map +0 -1
  166. package/dist/scanCardSummary.test.js +0 -234
  167. package/dist/scanDetailViewModel.d.ts.map +0 -1
  168. package/dist/scanDetailViewModel.js +0 -636
  169. package/dist/scanDetailViewModel.test.d.ts +0 -2
  170. package/dist/scanDetailViewModel.test.d.ts.map +0 -1
  171. 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,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAChG,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
+ {"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":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,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;AA2BF,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,8BAA8B,GACpC,yBAAyB,CA2B3B"}
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 { mergePostureFromDecision } from "../../riskVocabulary.js";
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: posture
20
- ? { recommendation: posture, confidence: "medium", reasoning: [] }
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
- * Only place that calls deriveScanNarrative and derivePresentationProfile.
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":"AACA,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,CAiB/B"}
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 { derivePresentationProfile } from "../profile/derivePresentationProfile.js";
3
+ import { buildProfileFromAssessment } from "../profile/buildProfileFromAssessment.js";
3
4
  /**
4
5
  * Mandatory orchestration entrypoint for completed-scan presentation.
5
- * Only place that calls deriveScanNarrative and derivePresentationProfile.
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 facts = deriveScanNarrative(input.result);
11
- const profile = derivePresentationProfile(facts, {
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
- facts,
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
- facts: ScanNarrativeFacts;
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,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,mBAAmB,CAAC;IAC7B;;;OAGG;IACH,MAAM,EAAE,UAAU,CAAC;IACnB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC"}
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: /tooling upgrade/i,
28
+ headlineMatch: /patch upgrade/i,
29
29
  headlineMustNot: /needs review/i,
30
- verificationIncludes: ["CI", "lint"],
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: /tooling upgrade/i,
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: /tooling upgrade/i,
48
+ headlineMatch: /patch upgrade|dependency upgrade/i,
49
49
  headlineMustNot: /needs review/i,
50
- verificationIncludes: ["test suite"],
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: ["auth flow"],
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;AAEzF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,mBAAmB,CA6BrB"}
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;AAmEzF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,sBAAsB,GAC7B,yBAAyB,CA6C3B;AAED,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAC9C,yBAAyB,CAqB3B"}
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;AAEzF,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,CAkC5B"}
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":"AAcA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEzF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,2BAA2B,CAwC7B"}
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 { composeVerificationActions, evidenceContextFromProfile, } from "../compose/narrativeCompose.js";
3
- import { formatChangedPackagesShort, formatUsageSummaryLine, selectReviewerGuidance, } from "../../narrativePresentation.js";
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 usage = formatUsageSummaryLine(facts, 1);
11
- if (usage)
12
- introLines.push(usage);
13
- const verify = composeVerificationActions(bundle, 1)[0];
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 guidance = selectReviewerGuidance(facts, { scope: "changed", max: 3 });
17
- const selected = guidance.length === 0
18
- ? selectReviewerGuidance(facts, { max: 3 })
19
- : guidance;
20
- const guidanceBlocks = selected.map((g) => {
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":"AAqBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEzF,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;AAoHF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE,yBAAyB,GAC7B,uBAAuB,CA6FzB"}
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 { deriveDetailReachChip } from "../../formatCardExposureDisplay.js";
1
+ import { MERGE_CONCERN_LABELS } from "../../assessmentLabels.js";
2
2
  import { MERGE_POSTURE_LABEL } from "../../riskVocabulary.js";
3
- import { deriveVerdictLineFromFacts, presentScanDetailViewModel, } from "../../scanDetailViewModel.js";
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
- function mapOperationalImpact(vm) {
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 vm = presentScanDetailViewModel(facts, result, {
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 verificationTitles = composeVerificationActions(bundle, 6);
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 posture = profile.status;
126
- const postureLabel = MERGE_POSTURE_LABEL[posture];
127
- const toolingIntent = profile.interpretation.intent === "tooling_patch" ||
128
- profile.interpretation.intent === "tooling_upgrade";
129
- const verdictLine = profile.priority === "pr_intelligence" && toolingIntent && keyPoints[0]
130
- ? keyPoints[0]
131
- : deriveVerdictLineFromFacts(facts, result);
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: facts.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
- actions: verificationTitles.map((title) => ({
156
- title: normalizeGeneratedText(title),
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"}