@mergesignal/shared 0.4.2 → 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 (193) 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 +24 -4
  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 +6 -37
  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 +17 -0
  35. package/dist/presentation/compose/narrativeChannels.d.ts.map +1 -0
  36. package/dist/presentation/compose/narrativeChannels.js +45 -0
  37. package/dist/presentation/compose/narrativeChannels.test.d.ts +2 -0
  38. package/dist/presentation/compose/narrativeChannels.test.d.ts.map +1 -0
  39. package/dist/presentation/compose/narrativeChannels.test.js +42 -0
  40. package/dist/presentation/compose/narrativeCompose.d.ts +1 -0
  41. package/dist/presentation/compose/narrativeCompose.d.ts.map +1 -1
  42. package/dist/presentation/compose/narrativeCompose.js +5 -7
  43. package/dist/presentation/dto/assessmentPresentationFields.d.ts +13 -0
  44. package/dist/presentation/dto/assessmentPresentationFields.d.ts.map +1 -0
  45. package/dist/presentation/dto/dashboardCardPresentation.d.ts +30 -0
  46. package/dist/presentation/dto/dashboardCardPresentation.d.ts.map +1 -0
  47. package/dist/presentation/dto/dashboardCardPresentation.js +1 -0
  48. package/dist/presentation/dto/githubAndCliPresentation.d.ts +4 -3
  49. package/dist/presentation/dto/githubAndCliPresentation.d.ts.map +1 -1
  50. package/dist/presentation/dto/scanDetailsPresentation.d.ts +2 -1
  51. package/dist/presentation/dto/scanDetailsPresentation.d.ts.map +1 -1
  52. package/dist/presentation/dto/types.d.ts +0 -9
  53. package/dist/presentation/dto/types.d.ts.map +1 -1
  54. package/dist/presentation/dto/types.js +1 -22
  55. package/dist/presentation/fixtures/dashboardCardGolden.test.d.ts +2 -0
  56. package/dist/presentation/fixtures/dashboardCardGolden.test.d.ts.map +1 -0
  57. package/dist/presentation/fixtures/dashboardCardGolden.test.js +38 -0
  58. package/dist/presentation/fixtures/presentationPersonaFixtures.d.ts.map +1 -1
  59. package/dist/presentation/fixtures/presentationPersonaFixtures.js +31 -24
  60. package/dist/presentation/fixtures/scanResultFixtures.d.ts.map +1 -1
  61. package/dist/presentation/fixtures/scanResultFixtures.js +14 -3
  62. package/dist/presentation/index.d.ts +6 -6
  63. package/dist/presentation/index.d.ts.map +1 -1
  64. package/dist/presentation/index.js +2 -4
  65. package/dist/presentation/orchestration/buildScanCardPresentation.d.ts +2 -2
  66. package/dist/presentation/orchestration/buildScanCardPresentation.d.ts.map +1 -1
  67. package/dist/presentation/orchestration/buildScanCardPresentation.js +13 -9
  68. package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts +1 -1
  69. package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts.map +1 -1
  70. package/dist/presentation/orchestration/buildScanPresentationBundle.js +12 -10
  71. package/dist/presentation/orchestration/scanPresentationBundle.d.ts +8 -3
  72. package/dist/presentation/orchestration/scanPresentationBundle.d.ts.map +1 -1
  73. package/dist/presentation/presentation.test.js +16 -18
  74. package/dist/presentation/presentationPersonas.test.js +20 -19
  75. package/dist/presentation/presenters/presentCliScanSummary.d.ts.map +1 -1
  76. package/dist/presentation/presenters/presentCliScanSummary.js +4 -2
  77. package/dist/presentation/presenters/presentDashboardCard.d.ts +5 -0
  78. package/dist/presentation/presenters/presentDashboardCard.d.ts.map +1 -0
  79. package/dist/presentation/presenters/presentDashboardCard.js +119 -0
  80. package/dist/presentation/presenters/presentGitHubCheckRun.d.ts.map +1 -1
  81. package/dist/presentation/presenters/presentGitHubCheckRun.js +4 -2
  82. package/dist/presentation/presenters/presentGitHubPrComment.d.ts.map +1 -1
  83. package/dist/presentation/presenters/presentGitHubPrComment.js +15 -21
  84. package/dist/presentation/presenters/presentScanDetails.d.ts.map +1 -1
  85. package/dist/presentation/presenters/presentScanDetails.js +53 -127
  86. package/dist/presentation/profile/buildProfileFromAssessment.d.ts +5 -0
  87. package/dist/presentation/profile/buildProfileFromAssessment.d.ts.map +1 -0
  88. package/dist/presentation/profile/buildProfileFromAssessment.js +58 -0
  89. package/dist/presentation/projectAssessmentFields.d.ts +4 -0
  90. package/dist/presentation/projectAssessmentFields.d.ts.map +1 -0
  91. package/dist/presentation/projectAssessmentFields.js +13 -0
  92. package/dist/presentation/surfaceParity.test.d.ts +2 -0
  93. package/dist/presentation/surfaceParity.test.d.ts.map +1 -0
  94. package/dist/presentation/surfaceParity.test.js +74 -0
  95. package/dist/productMessaging.d.ts +4 -4
  96. package/dist/productMessaging.d.ts.map +1 -1
  97. package/dist/productMessaging.js +4 -4
  98. package/dist/productMessaging.test.js +2 -2
  99. package/dist/repoIntelligenceSchema.d.ts +2 -2
  100. package/dist/resolvePipelineStatus.d.ts +15 -0
  101. package/dist/resolvePipelineStatus.d.ts.map +1 -0
  102. package/dist/resolvePipelineStatus.js +37 -0
  103. package/dist/scanCardPresentationState.d.ts +4 -0
  104. package/dist/scanCardPresentationState.d.ts.map +1 -0
  105. package/dist/scanCardPresentationState.js +4 -0
  106. package/dist/{scanDetailViewModel.d.ts → scanDetailViewModelTypes.d.ts} +60 -32
  107. package/dist/scanDetailViewModelTypes.d.ts.map +1 -0
  108. package/dist/scanDetailViewModelTypes.js +4 -0
  109. package/dist/scanResultSchema.d.ts +75 -2
  110. package/dist/scanResultSchema.d.ts.map +1 -1
  111. package/dist/scanResultSchema.js +4 -2
  112. package/dist/scanResultSchema.test.js +16 -0
  113. package/dist/trustedScanGuards.test.js +7 -0
  114. package/dist/types.d.ts +3 -0
  115. package/dist/types.d.ts.map +1 -1
  116. package/package.json +1 -1
  117. package/dist/collectNarrativeWhyBullets.d.ts +0 -12
  118. package/dist/collectNarrativeWhyBullets.d.ts.map +0 -1
  119. package/dist/collectNarrativeWhyBullets.js +0 -104
  120. package/dist/deriveCardDisplaySummary.d.ts +0 -16
  121. package/dist/deriveCardDisplaySummary.d.ts.map +0 -1
  122. package/dist/deriveCardDisplaySummary.js +0 -56
  123. package/dist/deriveCardDisplaySummary.test.d.ts +0 -2
  124. package/dist/deriveCardDisplaySummary.test.d.ts.map +0 -1
  125. package/dist/deriveCardDisplaySummary.test.js +0 -89
  126. package/dist/deriveCardOperationalObservations.d.ts +0 -19
  127. package/dist/deriveCardOperationalObservations.d.ts.map +0 -1
  128. package/dist/deriveCardOperationalObservations.js +0 -180
  129. package/dist/deriveCardOperationalObservations.test.d.ts +0 -2
  130. package/dist/deriveCardOperationalObservations.test.d.ts.map +0 -1
  131. package/dist/deriveCardOperationalObservations.test.js +0 -268
  132. package/dist/deriveRiskScoreSummary.d.ts +0 -33
  133. package/dist/deriveRiskScoreSummary.d.ts.map +0 -1
  134. package/dist/deriveRiskScoreSummary.js +0 -90
  135. package/dist/deriveRiskScoreSummary.test.d.ts +0 -2
  136. package/dist/deriveRiskScoreSummary.test.d.ts.map +0 -1
  137. package/dist/deriveRiskScoreSummary.test.js +0 -47
  138. package/dist/deriveScanDetailRecommendations.d.ts +0 -63
  139. package/dist/deriveScanDetailRecommendations.d.ts.map +0 -1
  140. package/dist/deriveScanDetailRecommendations.js +0 -725
  141. package/dist/deriveScanDetailRecommendations.test.d.ts +0 -2
  142. package/dist/deriveScanDetailRecommendations.test.d.ts.map +0 -1
  143. package/dist/deriveScanDetailRecommendations.test.js +0 -181
  144. package/dist/deriveScanSummaryText.d.ts +0 -7
  145. package/dist/deriveScanSummaryText.d.ts.map +0 -1
  146. package/dist/deriveScanSummaryText.js +0 -24
  147. package/dist/deriveScanSummaryText.test.d.ts +0 -2
  148. package/dist/deriveScanSummaryText.test.d.ts.map +0 -1
  149. package/dist/deriveScanSummaryText.test.js +0 -77
  150. package/dist/formatCardEvidenceCounts.d.ts +0 -7
  151. package/dist/formatCardEvidenceCounts.d.ts.map +0 -1
  152. package/dist/formatCardEvidenceCounts.js +0 -19
  153. package/dist/prCheckRunPresentation.d.ts +0 -68
  154. package/dist/prCheckRunPresentation.d.ts.map +0 -1
  155. package/dist/prCheckRunPresentation.js +0 -319
  156. package/dist/prCheckRunPresentation.test.d.ts +0 -2
  157. package/dist/prCheckRunPresentation.test.d.ts.map +0 -1
  158. package/dist/prCheckRunPresentation.test.js +0 -278
  159. package/dist/presentation/dto/scanCardPresentation.d.ts +0 -27
  160. package/dist/presentation/dto/scanCardPresentation.d.ts.map +0 -1
  161. package/dist/presentation/intent/derivePresentationInterpretation.d.ts +0 -4
  162. package/dist/presentation/intent/derivePresentationInterpretation.d.ts.map +0 -1
  163. package/dist/presentation/intent/derivePresentationInterpretation.js +0 -202
  164. package/dist/presentation/intent/formatPresentationCopy.d.ts +0 -7
  165. package/dist/presentation/intent/formatPresentationCopy.d.ts.map +0 -1
  166. package/dist/presentation/intent/formatPresentationCopy.js +0 -153
  167. package/dist/presentation/intent/presentationIntent.test.d.ts +0 -2
  168. package/dist/presentation/intent/presentationIntent.test.d.ts.map +0 -1
  169. package/dist/presentation/intent/presentationIntent.test.js +0 -29
  170. package/dist/presentation/intent/verificationFocusLabels.d.ts +0 -2
  171. package/dist/presentation/intent/verificationFocusLabels.d.ts.map +0 -1
  172. package/dist/presentation/intent/verificationFocusLabels.js +0 -45
  173. package/dist/presentation/presenters/presentPipelineScanCard.d.ts +0 -3
  174. package/dist/presentation/presenters/presentPipelineScanCard.d.ts.map +0 -1
  175. package/dist/presentation/presenters/presentPipelineScanCard.js +0 -23
  176. package/dist/presentation/presenters/presentScanCard.d.ts +0 -7
  177. package/dist/presentation/presenters/presentScanCard.d.ts.map +0 -1
  178. package/dist/presentation/presenters/presentScanCard.js +0 -44
  179. package/dist/presentation/profile/derivePresentationProfile.d.ts +0 -12
  180. package/dist/presentation/profile/derivePresentationProfile.d.ts.map +0 -1
  181. package/dist/presentation/profile/derivePresentationProfile.js +0 -85
  182. package/dist/scanCardSummary.d.ts +0 -59
  183. package/dist/scanCardSummary.d.ts.map +0 -1
  184. package/dist/scanCardSummary.js +0 -146
  185. package/dist/scanCardSummary.test.d.ts +0 -2
  186. package/dist/scanCardSummary.test.d.ts.map +0 -1
  187. package/dist/scanCardSummary.test.js +0 -234
  188. package/dist/scanDetailViewModel.d.ts.map +0 -1
  189. package/dist/scanDetailViewModel.js +0 -636
  190. package/dist/scanDetailViewModel.test.d.ts +0 -2
  191. package/dist/scanDetailViewModel.test.d.ts.map +0 -1
  192. package/dist/scanDetailViewModel.test.js +0 -530
  193. /package/dist/presentation/dto/{scanCardPresentation.js → assessmentPresentationFields.js} +0 -0
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Assessment Contract — mirrored from mergesignal-engine/packages/analysis-engine/src/assessment/types.ts
3
+ * Bump {@link ASSESSMENT_ABI} when this schema changes incompatibly.
4
+ */
5
+ import { z } from "zod";
6
+ export declare const ASSESSMENT_ABI: "1";
7
+ export declare const ASSESSMENT_POSTURES: readonly ["safe", "needs_review", "risky"];
8
+ export type AssessmentPosture = (typeof ASSESSMENT_POSTURES)[number];
9
+ export declare const ASSESSMENT_CONFIDENCES: readonly ["low", "medium", "high"];
10
+ export type AssessmentConfidence = (typeof ASSESSMENT_CONFIDENCES)[number];
11
+ export declare const CHANGE_CLASSES: readonly ["tooling_maintenance", "test_infra", "runtime_patch", "runtime_upgrade", "security_advisory", "breaking_change", "ecosystem_unknown", "bulk_mixed", "removal"];
12
+ export type ChangeClass = (typeof CHANGE_CLASSES)[number];
13
+ export declare const MERGE_CONCERN_KINDS: readonly ["confirmed_runtime_usage", "security_finding", "breaking_or_major", "behavioral_change", "ecosystem_risk", "insufficient_evidence", "graph_baseline_only"];
14
+ export type MergeConcernKind = (typeof MERGE_CONCERN_KINDS)[number];
15
+ export declare const NARRATIVE_INTENSITIES: readonly ["minimal", "standard", "elevated"];
16
+ export type NarrativeIntensity = (typeof NARRATIVE_INTENSITIES)[number];
17
+ export declare const REACH_VISIBILITIES: readonly ["hidden", "contextual", "prominent"];
18
+ export type ReachVisibility = (typeof REACH_VISIBILITIES)[number];
19
+ export declare const VERIFICATION_INTENSITIES: readonly ["none", "advisory", "required"];
20
+ export type VerificationIntensity = (typeof VERIFICATION_INTENSITIES)[number];
21
+ export declare const INSIGHT_EMISSION_FLOORS: readonly ["none", "explain_only", "full"];
22
+ export type InsightEmissionFloor = (typeof INSIGHT_EMISSION_FLOORS)[number];
23
+ export declare const ASSESSMENT_REPORT_MODES: readonly ["lightweight_pr_graph_baseline", "high_signal_pr"];
24
+ export type AssessmentReportMode = (typeof ASSESSMENT_REPORT_MODES)[number];
25
+ declare const assessmentConcernSchema: z.ZodObject<{
26
+ kind: z.ZodEnum<{
27
+ confirmed_runtime_usage: "confirmed_runtime_usage";
28
+ security_finding: "security_finding";
29
+ breaking_or_major: "breaking_or_major";
30
+ behavioral_change: "behavioral_change";
31
+ ecosystem_risk: "ecosystem_risk";
32
+ insufficient_evidence: "insufficient_evidence";
33
+ graph_baseline_only: "graph_baseline_only";
34
+ }>;
35
+ rank: z.ZodNumber;
36
+ packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ evidenceRefs: z.ZodArray<z.ZodString>;
38
+ }, z.core.$strip>;
39
+ declare const assessmentPresentationWireSchema: z.ZodObject<{
40
+ narrativeIntensity: z.ZodEnum<{
41
+ minimal: "minimal";
42
+ standard: "standard";
43
+ elevated: "elevated";
44
+ }>;
45
+ reachVisibility: z.ZodEnum<{
46
+ hidden: "hidden";
47
+ contextual: "contextual";
48
+ prominent: "prominent";
49
+ }>;
50
+ verificationIntensity: z.ZodEnum<{
51
+ none: "none";
52
+ advisory: "advisory";
53
+ required: "required";
54
+ }>;
55
+ insightEmissionFloor: z.ZodEnum<{
56
+ none: "none";
57
+ explain_only: "explain_only";
58
+ full: "full";
59
+ }>;
60
+ reportMode: z.ZodEnum<{
61
+ lightweight_pr_graph_baseline: "lightweight_pr_graph_baseline";
62
+ high_signal_pr: "high_signal_pr";
63
+ }>;
64
+ }, z.core.$strip>;
65
+ export declare const assessmentSchema: z.ZodObject<{
66
+ posture: z.ZodEnum<{
67
+ safe: "safe";
68
+ needs_review: "needs_review";
69
+ risky: "risky";
70
+ }>;
71
+ confidence: z.ZodEnum<{
72
+ low: "low";
73
+ medium: "medium";
74
+ high: "high";
75
+ }>;
76
+ primaryConcern: z.ZodNullable<z.ZodEnum<{
77
+ confirmed_runtime_usage: "confirmed_runtime_usage";
78
+ security_finding: "security_finding";
79
+ breaking_or_major: "breaking_or_major";
80
+ behavioral_change: "behavioral_change";
81
+ ecosystem_risk: "ecosystem_risk";
82
+ insufficient_evidence: "insufficient_evidence";
83
+ graph_baseline_only: "graph_baseline_only";
84
+ }>>;
85
+ concerns: z.ZodArray<z.ZodObject<{
86
+ kind: z.ZodEnum<{
87
+ confirmed_runtime_usage: "confirmed_runtime_usage";
88
+ security_finding: "security_finding";
89
+ breaking_or_major: "breaking_or_major";
90
+ behavioral_change: "behavioral_change";
91
+ ecosystem_risk: "ecosystem_risk";
92
+ insufficient_evidence: "insufficient_evidence";
93
+ graph_baseline_only: "graph_baseline_only";
94
+ }>;
95
+ rank: z.ZodNumber;
96
+ packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
97
+ evidenceRefs: z.ZodArray<z.ZodString>;
98
+ }, z.core.$strip>>;
99
+ factors: z.ZodArray<z.ZodString>;
100
+ changeClasses: z.ZodArray<z.ZodEnum<{
101
+ tooling_maintenance: "tooling_maintenance";
102
+ test_infra: "test_infra";
103
+ runtime_patch: "runtime_patch";
104
+ runtime_upgrade: "runtime_upgrade";
105
+ security_advisory: "security_advisory";
106
+ breaking_change: "breaking_change";
107
+ ecosystem_unknown: "ecosystem_unknown";
108
+ bulk_mixed: "bulk_mixed";
109
+ removal: "removal";
110
+ }>>;
111
+ presentation: z.ZodObject<{
112
+ narrativeIntensity: z.ZodEnum<{
113
+ minimal: "minimal";
114
+ standard: "standard";
115
+ elevated: "elevated";
116
+ }>;
117
+ reachVisibility: z.ZodEnum<{
118
+ hidden: "hidden";
119
+ contextual: "contextual";
120
+ prominent: "prominent";
121
+ }>;
122
+ verificationIntensity: z.ZodEnum<{
123
+ none: "none";
124
+ advisory: "advisory";
125
+ required: "required";
126
+ }>;
127
+ insightEmissionFloor: z.ZodEnum<{
128
+ none: "none";
129
+ explain_only: "explain_only";
130
+ full: "full";
131
+ }>;
132
+ reportMode: z.ZodEnum<{
133
+ lightweight_pr_graph_baseline: "lightweight_pr_graph_baseline";
134
+ high_signal_pr: "high_signal_pr";
135
+ }>;
136
+ }, z.core.$strip>;
137
+ }, z.core.$strip>;
138
+ export type AssessmentConcern = z.infer<typeof assessmentConcernSchema>;
139
+ export type AssessmentPresentationWire = z.infer<typeof assessmentPresentationWireSchema>;
140
+ /** Public presentation subset — excludes engine policy fields. */
141
+ export type AssessmentPresentationPublic = Pick<AssessmentPresentationWire, "narrativeIntensity" | "reachVisibility" | "verificationIntensity" | "reportMode">;
142
+ export type Assessment = z.infer<typeof assessmentSchema>;
143
+ export declare function toPublicPresentation(wire: AssessmentPresentationWire): AssessmentPresentationPublic;
144
+ export declare function parseAssessmentOrThrow(data: unknown): Assessment;
145
+ export declare function safeParseAssessment(data: unknown): {
146
+ ok: true;
147
+ value: Assessment;
148
+ } | {
149
+ ok: false;
150
+ issues: string[];
151
+ };
152
+ /** Map engine narrative intensity to presentation density (formatting only). */
153
+ export declare function narrativeIntensityToDensity(intensity: NarrativeIntensity): "minimal" | "standard" | "rich";
154
+ export {};
155
+ //# sourceMappingURL=assessmentSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assessmentSchema.d.ts","sourceRoot":"","sources":["../src/assessmentSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,EAAG,GAAY,CAAC;AAE3C,eAAO,MAAM,mBAAmB,4CAA6C,CAAC;AAC9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,eAAO,MAAM,sBAAsB,oCAAqC,CAAC;AACzE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,eAAO,MAAM,cAAc,0KAUjB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,sKAQtB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,qBAAq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,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,0BAA0B,GAC/B,4BAA4B,CAO9B;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,CAShE;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,GACZ;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAWnE;AAED,gFAAgF;AAChF,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,kBAAkB,GAC5B,SAAS,GAAG,UAAU,GAAG,MAAM,CAIjC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Assessment Contract — mirrored from mergesignal-engine/packages/analysis-engine/src/assessment/types.ts
3
+ * Bump {@link ASSESSMENT_ABI} when this schema changes incompatibly.
4
+ */
5
+ import { z } from "zod";
6
+ export const ASSESSMENT_ABI = "1";
7
+ export const ASSESSMENT_POSTURES = ["safe", "needs_review", "risky"];
8
+ export const ASSESSMENT_CONFIDENCES = ["low", "medium", "high"];
9
+ export const CHANGE_CLASSES = [
10
+ "tooling_maintenance",
11
+ "test_infra",
12
+ "runtime_patch",
13
+ "runtime_upgrade",
14
+ "security_advisory",
15
+ "breaking_change",
16
+ "ecosystem_unknown",
17
+ "bulk_mixed",
18
+ "removal",
19
+ ];
20
+ export const MERGE_CONCERN_KINDS = [
21
+ "confirmed_runtime_usage",
22
+ "security_finding",
23
+ "breaking_or_major",
24
+ "behavioral_change",
25
+ "ecosystem_risk",
26
+ "insufficient_evidence",
27
+ "graph_baseline_only",
28
+ ];
29
+ export const NARRATIVE_INTENSITIES = [
30
+ "minimal",
31
+ "standard",
32
+ "elevated",
33
+ ];
34
+ export const REACH_VISIBILITIES = [
35
+ "hidden",
36
+ "contextual",
37
+ "prominent",
38
+ ];
39
+ export const VERIFICATION_INTENSITIES = [
40
+ "none",
41
+ "advisory",
42
+ "required",
43
+ ];
44
+ export const INSIGHT_EMISSION_FLOORS = [
45
+ "none",
46
+ "explain_only",
47
+ "full",
48
+ ];
49
+ export const ASSESSMENT_REPORT_MODES = [
50
+ "lightweight_pr_graph_baseline",
51
+ "high_signal_pr",
52
+ ];
53
+ const assessmentConcernSchema = z.object({
54
+ kind: z.enum(MERGE_CONCERN_KINDS),
55
+ rank: z.number().int().nonnegative(),
56
+ packages: z.array(z.string()).optional(),
57
+ evidenceRefs: z.array(z.string()),
58
+ });
59
+ const assessmentPresentationWireSchema = z.object({
60
+ narrativeIntensity: z.enum(NARRATIVE_INTENSITIES),
61
+ reachVisibility: z.enum(REACH_VISIBILITIES),
62
+ verificationIntensity: z.enum(VERIFICATION_INTENSITIES),
63
+ insightEmissionFloor: z.enum(INSIGHT_EMISSION_FLOORS),
64
+ reportMode: z.enum(ASSESSMENT_REPORT_MODES),
65
+ });
66
+ export const assessmentSchema = z.object({
67
+ posture: z.enum(ASSESSMENT_POSTURES),
68
+ confidence: z.enum(ASSESSMENT_CONFIDENCES),
69
+ primaryConcern: z.enum(MERGE_CONCERN_KINDS).nullable(),
70
+ concerns: z.array(assessmentConcernSchema),
71
+ factors: z.array(z.string()),
72
+ changeClasses: z.array(z.enum(CHANGE_CLASSES)),
73
+ presentation: assessmentPresentationWireSchema,
74
+ });
75
+ export function toPublicPresentation(wire) {
76
+ return {
77
+ narrativeIntensity: wire.narrativeIntensity,
78
+ reachVisibility: wire.reachVisibility,
79
+ verificationIntensity: wire.verificationIntensity,
80
+ reportMode: wire.reportMode,
81
+ };
82
+ }
83
+ export function parseAssessmentOrThrow(data) {
84
+ const parsed = assessmentSchema.safeParse(data);
85
+ if (!parsed.success) {
86
+ const issues = parsed.error.issues
87
+ .map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`)
88
+ .join("; ");
89
+ throw new Error(`assessment validation: ${issues}`);
90
+ }
91
+ return parsed.data;
92
+ }
93
+ export function safeParseAssessment(data) {
94
+ const parsed = assessmentSchema.safeParse(data);
95
+ if (!parsed.success) {
96
+ return {
97
+ ok: false,
98
+ issues: parsed.error.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`),
99
+ };
100
+ }
101
+ return { ok: true, value: parsed.data };
102
+ }
103
+ /** Map engine narrative intensity to presentation density (formatting only). */
104
+ export function narrativeIntensityToDensity(intensity) {
105
+ if (intensity === "minimal")
106
+ return "minimal";
107
+ if (intensity === "elevated")
108
+ return "rich";
109
+ return "standard";
110
+ }
@@ -9,6 +9,8 @@ import type { DependencyGraphInsights, ExplainReason, Finding, Recommendation, S
9
9
  * If any answer is no → do not add.
10
10
  */
11
11
  export declare const CARD_OBSERVATION_MAX_LENGTH = 48;
12
+ /** Presentation-only rewrite of known engine metric tokens. */
13
+ export declare function humanizeEngineSurfaceText(raw: string): string;
12
14
  export declare const CARD_OBSERVATION_CATALOG: readonly ["Large upgrade blast radius", "High transitive dependency volume", "Broad package surface area", "Duplicate dependency versions detected", "Vulnerable transitive packages detected", "Stale ecosystem dependencies detected", "Transitive dependency hotspots detected", "Deep indirect dependency chains", "Overlapping dependency paths detected"];
13
15
  export type CatalogPhrase = (typeof CARD_OBSERVATION_CATALOG)[number];
14
16
  /** Signal family keys — one catalog phrase per family on a card. */
@@ -1 +1 @@
1
- {"version":3,"file":"cardObservationCatalog.d.ts","sourceRoot":"","sources":["../src/cardObservationCatalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uBAAuB,EACvB,aAAa,EACb,OAAO,EACP,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;;;;;;;GAQG;AAEH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,eAAO,MAAM,wBAAwB,iWAU3B,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAC/B,cAAc,GACd,mBAAmB,GACnB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,wBAAgB,8BAA8B,CAC5C,EAAE,EAAE,MAAM,GACT;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,GAAG,IAAI,CAEnE;AAED,wBAAgB,gCAAgC,CAC9C,EAAE,EAAE,uBAAuB,GAAG,IAAI,GAAG,SAAS,GAC7C,KAAK,CAAC;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAgCnE;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,UAAU,GAChB;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,GAAG,IAAI,CAUnE;AAED,oEAAoE;AACpE,wBAAgB,wBAAwB,IAAI,IAAI,CAe/C"}
@@ -1,4 +1,3 @@
1
- import { humanizeEngineSurfaceText } from "./actionsStepSummary.js";
2
1
  /**
3
2
  * CATALOG_EXPANSION_CHECKLIST (G1):
4
3
  * - Names a specific structural/topological concept (chains, paths, versions,
@@ -9,6 +8,53 @@ import { humanizeEngineSurfaceText } from "./actionsStepSummary.js";
9
8
  * If any answer is no → do not add.
10
9
  */
11
10
  export const CARD_OBSERVATION_MAX_LENGTH = 48;
11
+ /** Presentation-only rewrite of known engine metric tokens. */
12
+ export function humanizeEngineSurfaceText(raw) {
13
+ const input = raw.trim();
14
+ if (!input)
15
+ return input;
16
+ let t = input.replace(/_/g, " ");
17
+ t = t.replace(/^(security|maintainability|ecosystem|upgradeimpact|upgrade\s+impact)[.:]\s*/i, "");
18
+ const subs = [
19
+ [
20
+ /ecosystem\.package\s*surface|ecosystem\s+package\s*surface|package\s+surface\b/gi,
21
+ "broad declared package footprint",
22
+ ],
23
+ [
24
+ /graph\.duplicates?\b|graph\s+duplicates?\b/gi,
25
+ "overlapping dependency paths to the same packages",
26
+ ],
27
+ [
28
+ /graph\.fan\s*in\s*max|graph\s+fan\s+in\s+max/gi,
29
+ "many import paths converge on a few widely shared packages",
30
+ ],
31
+ [
32
+ /graph\.fan\s*in|graph\s+fan\s+in/gi,
33
+ "shared packages see many inbound dependency paths",
34
+ ],
35
+ [
36
+ /graph\.transitive(?:\s+volume)?|graph\s+transitive(?:\s+volume)?/gi,
37
+ "transitive dependency volume",
38
+ ],
39
+ [/graph\.depth|graph\s+depth/gi, "indirect dependency depth"],
40
+ [/graph\.hotspot|graph\s+hotspot/gi, "dependency hotspots"],
41
+ [/graph\.hidden|graph\s+hidden/gi, "hidden transitive paths"],
42
+ [
43
+ /graph\.vulnerable|graph\s+vulnerable/gi,
44
+ "known vulnerable packages on the graph",
45
+ ],
46
+ [/graph\.fan|graph\s+fan/gi, "fan-in"],
47
+ ];
48
+ for (const [re, rep] of subs)
49
+ t = t.replace(re, rep);
50
+ t = t
51
+ .replace(/\bdependency\s+chain\s+depth\b/gi, "indirect dependency depth")
52
+ .replace(/^dependency\s+depth$/gi, "indirect dependency depth");
53
+ t = t.replace(/\s+/g, " ").trim();
54
+ if (!t)
55
+ return input;
56
+ return t.charAt(0).toUpperCase() + t.slice(1);
57
+ }
12
58
  export const CARD_OBSERVATION_CATALOG = [
13
59
  "Large upgrade blast radius",
14
60
  "High transitive dependency volume",
@@ -1,8 +1,10 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import { deriveScanCardSummary } from "./scanCardSummary.js";
3
2
  import { deriveScanNarrative } from "./deriveScanNarrative.js";
4
3
  import { fixtureRepoIntelligenceFastify, fixtureRepoIntelligenceMultiPackage, } from "./fixtures/repoIntelligenceFixtures.js";
4
+ import { assessmentFastifyRuntime } from "./fixtures/assessmentFixtures.js";
5
5
  import { validateRepoIntelligenceWire } from "./repoIntelligenceSchema.js";
6
+ import { buildScanPresentationBundle } from "./presentation/orchestration/buildScanPresentationBundle.js";
7
+ import { presentDashboardCard } from "./presentation/presenters/presentDashboardCard.js";
6
8
  const baseScan = {
7
9
  totalScore: 55,
8
10
  layerScores: {
@@ -30,15 +32,27 @@ describe("engine wire regression (canonical fixtures)", () => {
30
32
  ...baseScan,
31
33
  changedPackages: ["fastify"],
32
34
  repoIntelligence: fixtureRepoIntelligenceFastify,
35
+ assessment: assessmentFastifyRuntime,
36
+ decision: {
37
+ recommendation: "needs_review",
38
+ confidence: "medium",
39
+ reasoning: [
40
+ "Changed package has confirmed usage on runtime application paths in this repository.",
41
+ ],
42
+ },
33
43
  };
34
44
  const facts = deriveScanNarrative(result);
35
45
  expect(facts.availability.tiersPresent.tier1).toBe(true);
36
46
  expect(facts.availability.mode).toBe("pr_intelligence");
37
47
  expect(facts.availability.repoIntelligenceParse).toBe("ok");
38
48
  expect(facts.packageUsage[0]?.packageName).toBe("fastify");
39
- const card = deriveScanCardSummary(result, "done");
40
- expect(card.keyPoints.length).toBeGreaterThan(0);
41
- expect(card.verificationActions.length).toBeGreaterThan(0);
49
+ const bundle = buildScanPresentationBundle({
50
+ result,
51
+ pipelineStatus: "done",
52
+ });
53
+ const card = presentDashboardCard(bundle);
54
+ expect(card.insights.length).toBeGreaterThan(0);
55
+ expect(card.verification.length).toBeGreaterThan(0);
42
56
  });
43
57
  it("multi-package fixture: both packages in packageUsage", () => {
44
58
  validateRepoIntelligenceWire(fixtureRepoIntelligenceMultiPackage);
@@ -46,6 +60,12 @@ describe("engine wire regression (canonical fixtures)", () => {
46
60
  ...baseScan,
47
61
  changedPackages: ["lodash", "axios"],
48
62
  repoIntelligence: fixtureRepoIntelligenceMultiPackage,
63
+ assessment: assessmentFastifyRuntime,
64
+ decision: {
65
+ recommendation: "needs_review",
66
+ confidence: "medium",
67
+ reasoning: [],
68
+ },
49
69
  };
50
70
  const facts = deriveScanNarrative(result);
51
71
  expect(facts.availability.mode).toBe("pr_intelligence");
@@ -0,0 +1,13 @@
1
+ import type { Assessment } from "../assessmentSchema.js";
2
+ export declare const assessmentTypescriptPatch: Assessment;
3
+ export declare const assessmentPrettier: Assessment;
4
+ export declare const assessmentEslint: Assessment;
5
+ export declare const assessmentVitest: Assessment;
6
+ export declare const assessmentFastifyRuntime: Assessment;
7
+ export declare const assessmentBullmq: Assessment;
8
+ export declare const assessmentNextAuth: Assessment;
9
+ export declare const assessmentMixedTypescriptFastify: Assessment;
10
+ export declare const assessmentLimitedContext: Assessment;
11
+ export declare const assessmentStub: Assessment;
12
+ export declare const assessmentUnknownSafe: Assessment;
13
+ //# sourceMappingURL=assessmentFixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assessmentFixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/assessmentFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAkBzD,eAAO,MAAM,yBAAyB,EAAE,UAQvC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,UAGhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,UAE9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,UAQ9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,UAetC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,UAmB9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,UAehC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,UAe9C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,UAoBtC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,UAoB5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,UAcnC,CAAC"}
@@ -0,0 +1,164 @@
1
+ const safeToolingPresentation = {
2
+ narrativeIntensity: "minimal",
3
+ reachVisibility: "hidden",
4
+ verificationIntensity: "advisory",
5
+ insightEmissionFloor: "none",
6
+ reportMode: "high_signal_pr",
7
+ };
8
+ const runtimeReviewPresentation = {
9
+ narrativeIntensity: "elevated",
10
+ reachVisibility: "prominent",
11
+ verificationIntensity: "required",
12
+ insightEmissionFloor: "full",
13
+ reportMode: "high_signal_pr",
14
+ };
15
+ export const assessmentTypescriptPatch = {
16
+ posture: "safe",
17
+ confidence: "high",
18
+ primaryConcern: null,
19
+ concerns: [],
20
+ factors: ["tooling_maintenance"],
21
+ changeClasses: ["tooling_maintenance"],
22
+ presentation: safeToolingPresentation,
23
+ };
24
+ export const assessmentPrettier = {
25
+ ...assessmentTypescriptPatch,
26
+ factors: ["tooling_maintenance"],
27
+ };
28
+ export const assessmentEslint = {
29
+ ...assessmentTypescriptPatch,
30
+ };
31
+ export const assessmentVitest = {
32
+ posture: "safe",
33
+ confidence: "high",
34
+ primaryConcern: null,
35
+ concerns: [],
36
+ factors: ["test_infra_change"],
37
+ changeClasses: ["test_infra"],
38
+ presentation: safeToolingPresentation,
39
+ };
40
+ export const assessmentFastifyRuntime = {
41
+ posture: "needs_review",
42
+ confidence: "medium",
43
+ primaryConcern: "confirmed_runtime_usage",
44
+ concerns: [
45
+ {
46
+ kind: "confirmed_runtime_usage",
47
+ rank: 1,
48
+ packages: ["fastify"],
49
+ evidenceRefs: ["fixture:fastify"],
50
+ },
51
+ ],
52
+ factors: ["confirmed_runtime_usage", "http_framework_infrastructure"],
53
+ changeClasses: ["runtime_upgrade"],
54
+ presentation: runtimeReviewPresentation,
55
+ };
56
+ export const assessmentBullmq = {
57
+ posture: "needs_review",
58
+ confidence: "medium",
59
+ primaryConcern: "confirmed_runtime_usage",
60
+ concerns: [
61
+ {
62
+ kind: "confirmed_runtime_usage",
63
+ rank: 1,
64
+ packages: ["bullmq"],
65
+ evidenceRefs: ["fixture:bullmq"],
66
+ },
67
+ ],
68
+ factors: [
69
+ "confirmed_runtime_usage",
70
+ "queue_infrastructure",
71
+ "verification_required",
72
+ ],
73
+ changeClasses: ["runtime_upgrade"],
74
+ presentation: runtimeReviewPresentation,
75
+ };
76
+ export const assessmentNextAuth = {
77
+ posture: "needs_review",
78
+ confidence: "medium",
79
+ primaryConcern: "confirmed_runtime_usage",
80
+ concerns: [
81
+ {
82
+ kind: "confirmed_runtime_usage",
83
+ rank: 1,
84
+ packages: ["next-auth"],
85
+ evidenceRefs: ["fixture:nextauth"],
86
+ },
87
+ ],
88
+ factors: ["confirmed_runtime_usage", "auth_infrastructure"],
89
+ changeClasses: ["runtime_upgrade"],
90
+ presentation: runtimeReviewPresentation,
91
+ };
92
+ export const assessmentMixedTypescriptFastify = {
93
+ posture: "needs_review",
94
+ confidence: "medium",
95
+ primaryConcern: "confirmed_runtime_usage",
96
+ concerns: [
97
+ {
98
+ kind: "confirmed_runtime_usage",
99
+ rank: 1,
100
+ packages: ["fastify"],
101
+ evidenceRefs: ["fixture:fastify"],
102
+ },
103
+ ],
104
+ factors: ["confirmed_runtime_usage", "http_framework_infrastructure"],
105
+ changeClasses: ["runtime_upgrade", "tooling_maintenance"],
106
+ presentation: runtimeReviewPresentation,
107
+ };
108
+ export const assessmentLimitedContext = {
109
+ posture: "needs_review",
110
+ confidence: "low",
111
+ primaryConcern: "insufficient_evidence",
112
+ concerns: [
113
+ {
114
+ kind: "insufficient_evidence",
115
+ rank: 1,
116
+ evidenceRefs: ["fixture:limited"],
117
+ },
118
+ ],
119
+ factors: ["insufficient_collection_evidence"],
120
+ changeClasses: ["ecosystem_unknown"],
121
+ presentation: {
122
+ narrativeIntensity: "minimal",
123
+ reachVisibility: "hidden",
124
+ verificationIntensity: "none",
125
+ insightEmissionFloor: "none",
126
+ reportMode: "high_signal_pr",
127
+ },
128
+ };
129
+ export const assessmentStub = {
130
+ posture: "needs_review",
131
+ confidence: "low",
132
+ primaryConcern: "insufficient_evidence",
133
+ concerns: [
134
+ {
135
+ kind: "insufficient_evidence",
136
+ rank: 1,
137
+ evidenceRefs: ["stub:engine"],
138
+ },
139
+ ],
140
+ factors: ["insufficient_collection_evidence"],
141
+ changeClasses: ["ecosystem_unknown"],
142
+ presentation: {
143
+ narrativeIntensity: "minimal",
144
+ reachVisibility: "hidden",
145
+ verificationIntensity: "none",
146
+ insightEmissionFloor: "none",
147
+ reportMode: "high_signal_pr",
148
+ },
149
+ };
150
+ export const assessmentUnknownSafe = {
151
+ posture: "safe",
152
+ confidence: "medium",
153
+ primaryConcern: null,
154
+ concerns: [],
155
+ factors: ["ecosystem_unknown_package"],
156
+ changeClasses: ["ecosystem_unknown"],
157
+ presentation: {
158
+ narrativeIntensity: "standard",
159
+ reachVisibility: "contextual",
160
+ verificationIntensity: "advisory",
161
+ insightEmissionFloor: "explain_only",
162
+ reportMode: "high_signal_pr",
163
+ },
164
+ };
@@ -17,8 +17,4 @@ export declare function deriveCardExposureDisplay(score: number | null | undefin
17
17
  export declare function formatCardExposureLine(score: number | null | undefined): string | null;
18
18
  /** Fragment for composite aria labels on PR cards. */
19
19
  export declare function exposureAriaFragment(score: number | null | undefined): string | null;
20
- /** Detail-page reach chip labels (not "exposure" jargon). */
21
- export declare const DETAIL_REACH_CHIP_LABEL: Record<CardExposureCategory, string>;
22
- /** Reach chip for scan detail page — maps score band to reviewer-facing scope label. */
23
- export declare function deriveDetailReachChip(score: number | null | undefined): string | null;
24
20
  //# sourceMappingURL=formatCardExposureDisplay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatCardExposureDisplay.d.ts","sourceRoot":"","sources":["../src/formatCardExposureDisplay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAUF,qEAAqE;AACrE,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAM1D,CAAC;AAkBF,0EAA0E;AAC1E,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,mBAAmB,GAAG,IAAI,CAM5B;AAED,uDAAuD;AACvD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI,CAIf;AAED,sDAAsD;AACtD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI,CAIf;AAED,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAMxE,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI,CAIf"}
1
+ {"version":3,"file":"formatCardExposureDisplay.d.ts","sourceRoot":"","sources":["../src/formatCardExposureDisplay.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAUF,qEAAqE;AACrE,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAM1D,CAAC;AAkBF,0EAA0E;AAC1E,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,mBAAmB,GAAG,IAAI,CAM5B;AAED,uDAAuD;AACvD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI,CAIf;AAED,sDAAsD;AACtD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI,CAIf"}
@@ -54,18 +54,3 @@ export function exposureAriaFragment(score) {
54
54
  return null;
55
55
  return display.label;
56
56
  }
57
- /** Detail-page reach chip labels (not "exposure" jargon). */
58
- export const DETAIL_REACH_CHIP_LABEL = {
59
- minimal: "Focused reach",
60
- limited: "Limited reach",
61
- moderate: "Moderate reach",
62
- elevated: "Wide reach",
63
- broad: "Wide reach",
64
- };
65
- /** Reach chip for scan detail page — maps score band to reviewer-facing scope label. */
66
- export function deriveDetailReachChip(score) {
67
- const display = deriveCardExposureDisplay(score);
68
- if (!display)
69
- return null;
70
- return DETAIL_REACH_CHIP_LABEL[display.category];
71
- }
@@ -1,4 +1,4 @@
1
- import type { PRInsight, PRDecisionRecommendation } from "./types.js";
1
+ import type { PRInsight, PRDecision, PRDecisionRecommendation } from "./types.js";
2
2
  export type FormattedInsight = {
3
3
  message: string;
4
4
  where: string;
@@ -6,5 +6,6 @@ export type FormattedInsight = {
6
6
  };
7
7
  export declare function decisionTitle(recommendation: PRDecisionRecommendation): string;
8
8
  export declare function formatInsight(insight: PRInsight): FormattedInsight;
9
- export { renderInsightsAsMarkdown } from "./presentGitHubPrComment.js";
9
+ /** Legacy markdown renderer for raw PR insights (format-only; no bundle inference). */
10
+ export declare function renderInsightsAsMarkdown(insights: PRInsight[], decision: PRDecision): string;
10
11
  //# sourceMappingURL=formatInsight.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatInsight.d.ts","sourceRoot":"","sources":["../src/formatInsight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAET,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AASF,wBAAgB,aAAa,CAC3B,cAAc,EAAE,wBAAwB,GACvC,MAAM,CAER;AAgBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,GAAG,gBAAgB,CAMlE;AAiBD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"formatInsight.d.ts","sourceRoot":"","sources":["../src/formatInsight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AASF,wBAAgB,aAAa,CAC3B,cAAc,EAAE,wBAAwB,GACvC,MAAM,CAER;AAgBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,GAAG,gBAAgB,CAMlE;AA+BD,uFAAuF;AACvF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,EAAE,EACrB,QAAQ,EAAE,UAAU,GACnB,MAAM,CAUR"}