@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 { MERGE_POSTURE_LABEL } from "./riskVocabulary.js";
1
2
  const DECISION_TITLES = {
2
3
  safe: "No significant dependency risks detected",
3
4
  needs_review: "Elevated dependency merge risk",
@@ -41,4 +42,28 @@ function renderInsightAsMarkdown(f) {
41
42
  f.action,
42
43
  ].join("\n");
43
44
  }
44
- export { renderInsightsAsMarkdown } from "./presentGitHubPrComment.js";
45
+ function renderInsightBlock(f) {
46
+ return [
47
+ f.message,
48
+ "",
49
+ "**Where it shows up**",
50
+ "",
51
+ f.where,
52
+ "",
53
+ "**What to do**",
54
+ "",
55
+ f.action,
56
+ ].join("\n");
57
+ }
58
+ /** Legacy markdown renderer for raw PR insights (format-only; no bundle inference). */
59
+ export function renderInsightsAsMarkdown(insights, decision) {
60
+ const title = MERGE_POSTURE_LABEL[decision.recommendation];
61
+ const lines = [`**${title}**`, "", "---", ""];
62
+ for (const insight of insights) {
63
+ lines.push(renderInsightBlock(formatInsight(insight)), "", "---", "");
64
+ }
65
+ for (const reason of decision.reasoning) {
66
+ lines.push(reason);
67
+ }
68
+ return lines.join("\n");
69
+ }
package/dist/index.d.ts CHANGED
@@ -1,16 +1,15 @@
1
1
  export * from "./types.js";
2
+ export * from "./assessmentSchema.js";
3
+ export * from "./assessmentLabels.js";
4
+ export * from "./assessmentProjection.js";
2
5
  export * from "./formatInsight.js";
3
6
  export * from "./riskVocabulary.js";
4
7
  export * from "./selectTopAffectedAreas.js";
5
- export * from "./deriveScanSummaryText.js";
6
8
  export * from "./cardSummaryCopy.js";
7
9
  export * from "./truncateCardSummary.js";
8
10
  export * from "./formatCardAreaLabels.js";
9
- export * from "./formatCardEvidenceCounts.js";
10
11
  export * from "./formatCardExposureDisplay.js";
11
12
  export * from "./cardObservationCatalog.js";
12
- export * from "./deriveCardOperationalObservations.js";
13
- export * from "./deriveCardDisplaySummary.js";
14
13
  export * from "./scanNarrativeFacts.js";
15
14
  export * from "./repoIntelligenceSchema.js";
16
15
  export * from "./repoIntelligenceMappers.js";
@@ -20,17 +19,14 @@ export * from "./deriveScanNarrative.js";
20
19
  export * from "./extractRepositoryContextFacts.js";
21
20
  export * from "./narrativePresentation.js";
22
21
  export * from "./normalizeGeneratedText.js";
23
- export * from "./collectNarrativeWhyBullets.js";
24
- export { presentGitHubPrCommentMarkdownFromResult, renderInsightsAsMarkdown, } from "./presentGitHubPrComment.js";
25
- export * from "./scanCardSummary.js";
26
- export * from "./deriveScanDetailRecommendations.js";
27
- export * from "./deriveRiskScoreSummary.js";
28
- export * from "./scanDetailViewModel.js";
22
+ export { presentGitHubPrCommentMarkdownFromResult } from "./presentGitHubPrComment.js";
23
+ export * from "./scanDetailViewModelTypes.js";
24
+ export * from "./scanCardPresentationState.js";
29
25
  export * from "./scanResultSchema.js";
30
26
  export * from "./scanSurfaceCopy.js";
27
+ export * from "./resolvePipelineStatus.js";
31
28
  export * from "./trustedScanGuards.js";
32
29
  export * from "./actionsStepSummary.js";
33
- export * from "./prCheckRunPresentation.js";
34
30
  export * from "./productMessaging.js";
35
31
  export * from "./presentation/index.js";
36
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0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AAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,wCAAwC,EAAE,MAAM,6BAA6B,CAAC;AACvF,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -1,16 +1,15 @@
1
1
  export * from "./types.js";
2
+ export * from "./assessmentSchema.js";
3
+ export * from "./assessmentLabels.js";
4
+ export * from "./assessmentProjection.js";
2
5
  export * from "./formatInsight.js";
3
6
  export * from "./riskVocabulary.js";
4
7
  export * from "./selectTopAffectedAreas.js";
5
- export * from "./deriveScanSummaryText.js";
6
8
  export * from "./cardSummaryCopy.js";
7
9
  export * from "./truncateCardSummary.js";
8
10
  export * from "./formatCardAreaLabels.js";
9
- export * from "./formatCardEvidenceCounts.js";
10
11
  export * from "./formatCardExposureDisplay.js";
11
12
  export * from "./cardObservationCatalog.js";
12
- export * from "./deriveCardOperationalObservations.js";
13
- export * from "./deriveCardDisplaySummary.js";
14
13
  export * from "./scanNarrativeFacts.js";
15
14
  export * from "./repoIntelligenceSchema.js";
16
15
  export * from "./repoIntelligenceMappers.js";
@@ -20,16 +19,13 @@ export * from "./deriveScanNarrative.js";
20
19
  export * from "./extractRepositoryContextFacts.js";
21
20
  export * from "./narrativePresentation.js";
22
21
  export * from "./normalizeGeneratedText.js";
23
- export * from "./collectNarrativeWhyBullets.js";
24
- export { presentGitHubPrCommentMarkdownFromResult, renderInsightsAsMarkdown, } from "./presentGitHubPrComment.js";
25
- export * from "./scanCardSummary.js";
26
- export * from "./deriveScanDetailRecommendations.js";
27
- export * from "./deriveRiskScoreSummary.js";
28
- export * from "./scanDetailViewModel.js";
22
+ export { presentGitHubPrCommentMarkdownFromResult } from "./presentGitHubPrComment.js";
23
+ export * from "./scanDetailViewModelTypes.js";
24
+ export * from "./scanCardPresentationState.js";
29
25
  export * from "./scanResultSchema.js";
30
26
  export * from "./scanSurfaceCopy.js";
27
+ export * from "./resolvePipelineStatus.js";
31
28
  export * from "./trustedScanGuards.js";
32
29
  export * from "./actionsStepSummary.js";
33
- export * from "./prCheckRunPresentation.js";
34
30
  export * from "./productMessaging.js";
35
31
  export * from "./presentation/index.js";
@@ -5,44 +5,13 @@ import { presentScanDetails } from "./presentation/presenters/presentScanDetails
5
5
  import { presentGitHubPrComment } from "./presentation/presenters/presentGitHubPrComment.js";
6
6
  import { renderGitHubCheckRunMarkdown } from "./presentation/render/renderGitHubCheckRunMarkdown.js";
7
7
  import { presentGitHubCheckRun } from "./presentation/presenters/presentGitHubCheckRun.js";
8
- import { fixtureRepoIntelligenceFastify } from "./fixtures/repoIntelligenceFixtures.js";
9
- import { analysisPreparationWithValidRepoIntel } from "./fixtures/repoIntelligenceTestHelpers.js";
8
+ import { scanResultFastifyRuntime } from "./presentation/fixtures/scanResultFixtures.js";
10
9
  const ORIGIN = "https://app.example.com";
11
10
  const SCAN_ID = "22222222-2222-4222-8222-222222222222";
12
11
  describe("narrative parity across consumers", () => {
13
12
  it("card, detail, GitHub share primary package and reachability story", () => {
14
- const result = {
15
- totalScore: 55,
16
- layerScores: {
17
- security: 10,
18
- maintainability: 20,
19
- ecosystem: 30,
20
- upgradeImpact: 15,
21
- },
22
- findings: [],
23
- generatedAt: "2026-01-01T00:00:00.000Z",
24
- changedPackages: ["fastify"],
25
- analysisPreparation: analysisPreparationWithValidRepoIntel(),
26
- repoIntelligence: fixtureRepoIntelligenceFastify,
27
- decision: {
28
- recommendation: "needs_review",
29
- confidence: "medium",
30
- reasoning: [],
31
- },
32
- insights: [
33
- {
34
- type: "usage_risk",
35
- priority: "high",
36
- confidence: "confirmed",
37
- scope: "changed",
38
- message: "Review fastify middleware ordering",
39
- context: "apps/api/src/middleware/auth.ts",
40
- remediation: "Run auth smoke tests",
41
- },
42
- ],
43
- };
44
13
  const bundle = buildScanPresentationBundle({
45
- result,
14
+ result: scanResultFastifyRuntime,
46
15
  pipelineStatus: "done",
47
16
  });
48
17
  const card = presentDashboardCard(bundle);
@@ -56,7 +25,8 @@ describe("narrative parity across consumers", () => {
56
25
  }));
57
26
  const prComment = presentGitHubPrComment(bundle);
58
27
  expect(detail.narrative.primaryPackage).toBe("fastify");
59
- expect(card.evidenceChips?.some((e) => e.label === "Reachability")).toBe(true);
28
+ expect(card.reachVisibility).toBe("prominent");
29
+ expect(card.verdict?.scopeLabel).toBeTruthy();
60
30
  const asciiOnly = /^[\x00-\x7F]*$/;
61
31
  expect(asciiOnly.test(checkRun)).toBe(true);
62
32
  expect(checkRun.toLowerCase()).toContain("fastify");
@@ -1,8 +1,6 @@
1
- import type { PRDecision, PRInsight, ScanResult } from "./types.js";
1
+ import type { ScanResult } from "./types.js";
2
2
  /**
3
3
  * PR comment markdown from a completed scan (via presentation bundle).
4
4
  */
5
5
  export declare function presentGitHubPrCommentMarkdownFromResult(result: ScanResult): string;
6
- /** Backward-compatible entry: derives bundle then renders markdown. */
7
- export declare function renderInsightsAsMarkdown(insights: PRInsight[], decision: PRDecision): string;
8
6
  //# sourceMappingURL=presentGitHubPrComment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentGitHubPrComment.d.ts","sourceRoot":"","sources":["../src/presentGitHubPrComment.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpE;;GAEG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,UAAU,GACjB,MAAM,CAWR;AAED,uEAAuE;AACvE,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,EAAE,EACrB,QAAQ,EAAE,UAAU,GACnB,MAAM,CAeR"}
1
+ {"version":3,"file":"presentGitHubPrComment.d.ts","sourceRoot":"","sources":["../src/presentGitHubPrComment.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,UAAU,GACjB,MAAM,CAWR"}
@@ -15,20 +15,3 @@ export function presentGitHubPrCommentMarkdownFromResult(result) {
15
15
  return "";
16
16
  return renderGitHubPrCommentMarkdown(presentGitHubPrCommentFromBundle(bundle));
17
17
  }
18
- /** Backward-compatible entry: derives bundle then renders markdown. */
19
- export function renderInsightsAsMarkdown(insights, decision) {
20
- const result = {
21
- totalScore: 0,
22
- layerScores: {
23
- security: 0,
24
- maintainability: 0,
25
- ecosystem: 0,
26
- upgradeImpact: 0,
27
- },
28
- findings: [],
29
- generatedAt: new Date().toISOString(),
30
- insights,
31
- decision,
32
- };
33
- return presentGitHubPrCommentMarkdownFromResult(result);
34
- }
@@ -1 +1 @@
1
- {"version":3,"file":"narrativeChannels.d.ts","sourceRoot":"","sources":["../../../src/presentation/compose/narrativeChannels.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAM/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAOzF,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAgDF,yFAAyF;AACzF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,iBAAiB,CA8BnB;AAED,mGAAmG;AACnG,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,iBAAiB,EAC3B,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAyBV"}
1
+ {"version":3,"file":"narrativeChannels.d.ts","sourceRoot":"","sources":["../../../src/presentation/compose/narrativeChannels.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAGzF,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAqBF,yFAAyF;AACzF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,iBAAiB,CAmBnB;AAED,mGAAmG;AACnG,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,iBAAiB,EAC3B,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAyBV"}
@@ -1,61 +1,31 @@
1
- import { deriveDetailReachChip } from "../../formatCardExposureDisplay.js";
2
1
  import { scanSurfaceCopy } from "../../scanSurfaceCopy.js";
3
- import { formatPresentationHeadline, formatPresentationInsightLines, formatPresentationVerification, } from "../intent/formatPresentationCopy.js";
4
- import { formatCardAreaLabels } from "../../formatCardAreaLabels.js";
5
- import { labelBlastRadiusLevel, labelReachabilityKind, } from "../../narrativePresentation.js";
2
+ import { applicationAreaLabels, formatAssessmentHeadline, projectInsightLines, projectVerificationActions, reachVisibilityLabel, } from "../../assessmentProjection.js";
3
+ import { safeParseRepoIntelligence } from "../../repoIntelligenceSchema.js";
4
+ import { labelBlastRadiusLevel } from "../../narrativePresentation.js";
6
5
  function composeScopeAreaLabels(bundle, max) {
7
- const labels = [];
8
- for (const area of bundle.facts.affectedAreas) {
9
- const formatted = formatCardAreaLabels([area.label], 1);
10
- if (formatted[0])
11
- labels.push(formatted[0]);
12
- if (labels.length >= max)
13
- break;
14
- }
15
- return labels;
16
- }
17
- function isTautologicalEvidenceRow(row) {
18
- const label = row.label.trim().toLowerCase();
19
- const value = row.value.trim().toLowerCase();
20
- if (label === "runtime" && value === "runtime")
21
- return true;
22
- return false;
6
+ const parsed = safeParseRepoIntelligence(bundle.result.repoIntelligence);
7
+ const labels = parsed.ok ? applicationAreaLabels(parsed.value) : [];
8
+ return labels.slice(0, max);
23
9
  }
24
10
  function composeChannelEvidence(bundle, max) {
25
- const { facts, profile } = bundle;
11
+ const blast = labelBlastRadiusLevel(bundle.facts);
26
12
  const rows = [];
27
- if (!profile.interpretation.suppressRuntimeNarrative) {
28
- const reach = labelReachabilityKind(facts);
29
- if (reach)
30
- rows.push({ label: "Reachability", value: reach });
31
- }
32
- const blast = labelBlastRadiusLevel(facts);
33
13
  if (blast)
34
14
  rows.push({ label: "Blast radius", value: blast });
35
- return rows.filter((row) => !isTautologicalEvidenceRow(row)).slice(0, max);
36
- }
37
- function shouldShowReachLabel(bundle) {
38
- const { profile } = bundle;
39
- if (profile.status === "safe" && profile.density === "minimal") {
40
- return false;
41
- }
42
- return profile.status !== "safe" || profile.density !== "minimal";
15
+ return rows.slice(0, max);
43
16
  }
44
17
  /** Canonical non-redundant narrative channels — single dedupe point for all surfaces. */
45
18
  export function buildNarrativeChannels(bundle) {
46
- const { facts, profile, result } = bundle;
47
- const riskIndex = facts.riskIndex ?? result.totalScore ?? null;
48
- const reachLabel = shouldShowReachLabel(bundle) && riskIndex != null
49
- ? (deriveDetailReachChip(riskIndex) ?? undefined)
50
- : undefined;
19
+ const { assessment, presentation, profile, result } = bundle;
20
+ const reachLabel = reachVisibilityLabel(presentation.reachVisibility);
51
21
  return {
52
- headline: formatPresentationHeadline(profile.interpretation, facts, profile.status),
22
+ headline: formatAssessmentHeadline(assessment, result, profile.status),
53
23
  limitedContextMessage: profile.degradedMessage ?? undefined,
54
24
  reachLabel,
55
- insights: formatPresentationInsightLines(profile.interpretation, facts, profile.status),
25
+ insights: projectInsightLines(assessment, result),
56
26
  scopeAreas: composeScopeAreaLabels(bundle, 4),
57
27
  evidence: composeChannelEvidence(bundle, 4),
58
- verification: formatPresentationVerification(profile.interpretation, profile.status, 6),
28
+ verification: projectVerificationActions(assessment, presentation, result, 6),
59
29
  };
60
30
  }
61
31
  /** Merge distinct channels into one bullet list for single-column surfaces (GitHub check, CLI). */
@@ -1 +1 @@
1
- {"version":3,"file":"narrativeCompose.d.ts","sourceRoot":"","sources":["../../../src/presentation/compose/narrativeCompose.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAMzF,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAShC,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,CAEV;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
+ {"version":3,"file":"narrativeCompose.d.ts","sourceRoot":"","sources":["../../../src/presentation/compose/narrativeCompose.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAMzF,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAShC,wBAAgB,eAAe,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAEtE;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,CAEV;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAEV;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,7 +1,6 @@
1
1
  import { formatCardAreaLabels } from "../../formatCardAreaLabels.js";
2
2
  import { formatChangedPackagesShort, labelBlastRadiusLevel, labelReachabilityKind, labelRuntimeSurface, } from "../../narrativePresentation.js";
3
3
  import { scanSurfaceCopy } from "../../scanSurfaceCopy.js";
4
- import { formatPresentationHeadline, formatPresentationVerification, } from "../intent/formatPresentationCopy.js";
5
4
  import { buildNarrativeChannels, projectCompactKeyPoints, } from "./narrativeChannels.js";
6
5
  export { buildNarrativeChannels, projectCompactKeyPoints, } from "./narrativeChannels.js";
7
6
  function topAreaLabel(bundle) {
@@ -12,8 +11,7 @@ function topAreaLabel(bundle) {
12
11
  return formatted[0] ?? area.label;
13
12
  }
14
13
  export function composeHeadline(bundle) {
15
- const { facts, profile } = bundle;
16
- return formatPresentationHeadline(profile.interpretation, facts, profile.status);
14
+ return buildNarrativeChannels(bundle).headline;
17
15
  }
18
16
  export function composeSubheadline(bundle) {
19
17
  const { profile } = bundle;
@@ -25,8 +23,7 @@ export function composeKeyPoints(bundle, max) {
25
23
  return projectCompactKeyPoints(buildNarrativeChannels(bundle), max);
26
24
  }
27
25
  export function composeVerificationActions(bundle, max) {
28
- const { profile } = bundle;
29
- return formatPresentationVerification(profile.interpretation, profile.status, max);
26
+ return buildNarrativeChannels(bundle).verification.slice(0, max);
30
27
  }
31
28
  export function composeAffectedAreaLabels(bundle, max) {
32
29
  const labels = [];
@@ -0,0 +1,13 @@
1
+ import type { MergeConcernKind } from "../../assessmentSchema.js";
2
+ import type { NarrativeIntensity, ReachVisibility } from "../../assessmentSchema.js";
3
+ /** Assessment-aligned fields projected identically across surfaces. */
4
+ export type AssessmentPresentationFields = {
5
+ posture: "safe" | "needs_review" | "risky";
6
+ primaryConcern: MergeConcernKind | null;
7
+ factors: string[];
8
+ reasoning: string[];
9
+ verificationFocus: string[];
10
+ reachVisibility: ReachVisibility;
11
+ narrativeIntensity: NarrativeIntensity;
12
+ };
13
+ //# sourceMappingURL=assessmentPresentationFields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assessmentPresentationFields.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/assessmentPresentationFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EAEhB,MAAM,2BAA2B,CAAC;AAEnC,uEAAuE;AACvE,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC;IAC3C,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,CAAC"}
@@ -1,6 +1,7 @@
1
+ import type { AssessmentPresentationFields } from "./assessmentPresentationFields.js";
1
2
  import type { PresentationEvidenceRow, PresentationStatus } from "./types.js";
2
3
  export type DashboardCardLayout = "quiet" | "standard" | "expanded";
3
- export type DashboardCardPresentation = {
4
+ export type DashboardCardPresentation = Partial<AssessmentPresentationFields> & {
4
5
  verdict?: {
5
6
  posture: PresentationStatus;
6
7
  postureLabel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dashboardCardPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/dashboardCardPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,kBAA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AC,EAAE;QACR,OAAO,EAAE,kBAAkB,CAAC;QAC5B,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IAEF,QAAQ,EAAE,MAAM,CAAC;IAEjB,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,cAAc,CAAC,EAAE;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAE1C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC"}
@@ -1,5 +1,6 @@
1
+ import type { AssessmentPresentationFields } from "./assessmentPresentationFields.js";
1
2
  import type { PresentationConfidence, PresentationDensity, PresentationEvidenceContext, PresentationStatus } from "./types.js";
2
- export type GitHubCheckRunPresentation = {
3
+ export type GitHubCheckRunPresentation = AssessmentPresentationFields & {
3
4
  status: PresentationStatus;
4
5
  density: PresentationDensity;
5
6
  confidence: PresentationConfidence;
@@ -15,7 +16,7 @@ export type GitHubCheckRunPresentation = {
15
16
  }>;
16
17
  detailsUrl: string;
17
18
  };
18
- export type GitHubPrCommentPresentation = {
19
+ export type GitHubPrCommentPresentation = AssessmentPresentationFields & {
19
20
  status: PresentationStatus;
20
21
  density: PresentationDensity;
21
22
  confidence: PresentationConfidence;
@@ -28,7 +29,7 @@ export type GitHubPrCommentPresentation = {
28
29
  action?: string;
29
30
  }>;
30
31
  };
31
- export type CliScanPresentation = {
32
+ export type CliScanPresentation = AssessmentPresentationFields & {
32
33
  header: {
33
34
  repoLabel: string;
34
35
  methodology?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"githubAndCliPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/githubAndCliPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,sBAAsB,CAAC;IACnC,eAAe,EAAE,2BAA2B,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;QACtE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,sBAAsB,CAAC;IACnC,eAAe,EAAE,2BAA2B,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,KAAK,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;CACJ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzE,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,sBAAsB,CAAC;IACnC,eAAe,EAAE,2BAA2B,CAAC;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE;QACR,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"githubAndCliPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/githubAndCliPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,0BAA0B,GAAG,4BAA4B,GAAG;IACtE,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,sBAAsB,CAAC;IACnC,eAAe,EAAE,2BAA2B,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAC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;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC"}
@@ -1,7 +1,8 @@
1
+ import type { AssessmentPresentationFields } from "./assessmentPresentationFields.js";
1
2
  import type { PresentationConfidence, PresentationDensity, PresentationEvidenceContext, PresentationStatus } from "./types.js";
2
3
  import type { PresentationIntent } from "../intent/presentationIntent.js";
3
4
  import type { FindingSeverity, ScoreLayer } from "../../types.js";
4
- export type ScanDetailsPresentation = {
5
+ export type ScanDetailsPresentation = AssessmentPresentationFields & {
5
6
  evidenceContext: PresentationEvidenceContext;
6
7
  status: PresentationStatus;
7
8
  density: PresentationDensity;
@@ -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,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,C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C,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;IAEF,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC"}
1
+ {"version":3,"file":"scanDetailsPresentation.d.ts","sourceRoot":"","sources":["../../../src/presentation/dto/scanDetailsPresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,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,4BAA4B,GAAG;IACnE,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;IAEF,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,c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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"}
@@ -3,24 +3,31 @@ import { dirname, join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { describe, expect, it } from "vitest";
5
5
  import { buildScanCardPresentation } from "../orchestration/buildScanCardPresentation.js";
6
- import { scanResultFastifyRuntime, scanResultTypescriptPatch, } from "./presentationPersonaFixtures.js";
6
+ import { scanResultBullmq, scanResultEslint, scanResultFastifyRuntime, scanResultLimitedContext, scanResultMixedTypescriptFastify, scanResultNextAuth, scanResultPrettier, scanResultTypescriptPatch, scanResultUnknownSafe, scanResultVitest, } from "./presentationPersonaFixtures.js";
7
7
  const goldenPath = join(dirname(fileURLToPath(import.meta.url)), "dashboardCardGolden.json");
8
8
  const golden = JSON.parse(readFileSync(goldenPath, "utf8"));
9
+ const personaCases = [
10
+ { key: "typescriptPatch", result: scanResultTypescriptPatch },
11
+ { key: "eslint", result: scanResultEslint },
12
+ { key: "prettier", result: scanResultPrettier },
13
+ { key: "vitest", result: scanResultVitest },
14
+ { key: "fastifyRuntime", result: scanResultFastifyRuntime },
15
+ { key: "nextAuth", result: scanResultNextAuth },
16
+ { key: "bullmq", result: scanResultBullmq },
17
+ { key: "limitedContext", result: scanResultLimitedContext },
18
+ { key: "unknownSafe", result: scanResultUnknownSafe },
19
+ { key: "mixedTypescriptFastify", result: scanResultMixedTypescriptFastify },
20
+ ];
9
21
  describe("dashboardCardGolden fixtures", () => {
10
- it("matches live typescript patch card", () => {
11
- const live = buildScanCardPresentation({
12
- result: scanResultTypescriptPatch,
13
- pipelineStatus: "done",
22
+ for (const { key, result } of personaCases) {
23
+ it(`matches live ${key} card`, () => {
24
+ const live = buildScanCardPresentation({
25
+ result,
26
+ pipelineStatus: "done",
27
+ });
28
+ expect(live).toEqual(golden[key]);
14
29
  });
15
- expect(live).toEqual(golden.typescriptPatch);
16
- });
17
- it("matches live fastify runtime card", () => {
18
- const live = buildScanCardPresentation({
19
- result: scanResultFastifyRuntime,
20
- pipelineStatus: "done",
21
- });
22
- expect(live).toEqual(golden.fastifyRuntime);
23
- });
30
+ }
24
31
  it("fastify golden has deduplicated channels", () => {
25
32
  const card = golden.fastifyRuntime;
26
33
  const insightText = card.insights.join(" ");
@@ -1 +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"}
1
+ {"version":3,"file":"presentationPersonaFixtures.d.ts","sourceRoot":"","sources":["../../../src/presentation/fixtures/presentationPersonaFixtures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAkBjD,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AA+KjC,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,UAI/B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,UAa7B,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,UAMnC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,UAO9C,CAAC;AAEF,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,GAC1B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { assessmentBullmq, assessmentEslint, assessmentMixedTypescriptFastify, assessmentNextAuth, assessmentPrettier, assessmentUnknownSafe, assessmentVitest, } from "../../fixtures/assessmentFixtures.js";
1
2
  import { fixtureRepoIntelligenceFastify, fixtureRepoIntelligenceTypescript, } from "../../fixtures/repoIntelligenceFixtures.js";
2
3
  import { analysisPreparationWithValidRepoIntel } from "../../fixtures/repoIntelligenceTestHelpers.js";
3
4
  import { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch, } from "./scanResultFixtures.js";
@@ -128,7 +129,22 @@ const fixtureRepoIntelligenceMixedToolingRuntime = {
128
129
  blastRadius: fixtureRepoIntelligenceFastify.blastRadius,
129
130
  applicationAreas: fixtureRepoIntelligenceFastify.applicationAreas,
130
131
  };
131
- function scanBase(over = {}) {
132
+ function decisionForAssessment(assessment) {
133
+ return {
134
+ recommendation: assessment.posture,
135
+ confidence: assessment.confidence,
136
+ reasoning: assessment.posture === "safe"
137
+ ? [
138
+ "No dedicated dependency review required beyond normal engineering process.",
139
+ ]
140
+ : assessment.primaryConcern === "confirmed_runtime_usage"
141
+ ? [
142
+ "Changed package has confirmed usage on runtime application paths in this repository.",
143
+ ]
144
+ : ["Explicit human review warranted before merge."],
145
+ };
146
+ }
147
+ function scanBase(assessment, over = {}) {
132
148
  return {
133
149
  totalScore: 18,
134
150
  layerScores: {
@@ -139,59 +155,50 @@ function scanBase(over = {}) {
139
155
  },
140
156
  findings: [],
141
157
  generatedAt: "2026-01-01T00:00:00.000Z",
142
- decision: {
143
- recommendation: "safe",
144
- confidence: "high",
145
- reasoning: [],
146
- },
158
+ assessment,
159
+ decision: decisionForAssessment(assessment),
147
160
  analysisPreparation: basePrep,
148
161
  ...over,
149
162
  };
150
163
  }
151
- export const scanResultEslint = scanBase({
164
+ export const scanResultEslint = scanBase(assessmentEslint, {
152
165
  changedPackages: ["eslint"],
153
166
  repoIntelligence: fixtureRepoIntelligenceEslint,
154
167
  });
155
- export const scanResultPrettier = scanBase({
168
+ export const scanResultPrettier = scanBase(assessmentPrettier, {
156
169
  changedPackages: ["prettier"],
157
170
  repoIntelligence: fixtureRepoIntelligencePrettier,
158
171
  });
159
- export const scanResultVitest = scanBase({
172
+ export const scanResultVitest = scanBase(assessmentVitest, {
160
173
  changedPackages: ["vitest"],
161
174
  repoIntelligence: fixtureRepoIntelligenceVitest,
162
175
  });
163
- export const scanResultNextAuth = scanBase({
176
+ export const scanResultNextAuth = scanBase(assessmentNextAuth, {
164
177
  totalScore: 52,
165
178
  changedPackages: ["next-auth"],
166
179
  repoIntelligence: fixtureRepoIntelligenceNextAuth,
167
- decision: {
168
- recommendation: "needs_review",
169
- confidence: "medium",
170
- reasoning: [],
171
- },
172
180
  });
173
- export const scanResultBullmq = scanBase({
181
+ export const scanResultBullmq = scanBase(assessmentBullmq, {
174
182
  totalScore: 48,
175
183
  changedPackages: ["bullmq"],
176
184
  repoIntelligence: fixtureRepoIntelligenceBullmq,
177
185
  decision: {
178
186
  recommendation: "needs_review",
179
187
  confidence: "medium",
180
- reasoning: [],
188
+ reasoning: [
189
+ "Changed package has confirmed usage on runtime application paths in this repository.",
190
+ "Queue infrastructure",
191
+ "Verification focus required",
192
+ ],
181
193
  },
182
194
  });
183
- export const scanResultUnknownSafe = scanBase({
195
+ export const scanResultUnknownSafe = scanBase(assessmentUnknownSafe, {
184
196
  changedPackages: ["opaque-pkg"],
185
197
  repoIntelligence: fixtureRepoIntelligenceUnknown,
186
198
  });
187
- export const scanResultMixedTypescriptFastify = scanBase({
199
+ export const scanResultMixedTypescriptFastify = scanBase(assessmentMixedTypescriptFastify, {
188
200
  totalScore: 55,
189
201
  changedPackages: ["typescript", "fastify"],
190
202
  repoIntelligence: fixtureRepoIntelligenceMixedToolingRuntime,
191
- decision: {
192
- recommendation: "needs_review",
193
- confidence: "medium",
194
- reasoning: [],
195
- },
196
203
  });
197
204
  export { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch, };
@@ -1 +1 @@
1
- {"version":3,"file":"scanResultFixtures.d.ts","sourceRoot":"","sources":["../../../src/presentation/fixtures/scanResultFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,eAAO,MAAM,wBAAwB,EAAE,UA6BtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,UAwBvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,UAyBtC,CAAC"}
1
+ {"version":3,"file":"scanResultFixtures.d.ts","sourceRoot":"","sources":["../../../src/presentation/fixtures/scanResultFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAYjD,eAAO,MAAM,wBAAwB,EAAE,UAiCtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,UA2BvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,UA4BtC,CAAC"}