@mergesignal/shared 0.4.1 → 0.4.3

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 (96) hide show
  1. package/dist/deriveScanNarrative.d.ts.map +1 -1
  2. package/dist/deriveScanNarrative.js +41 -8
  3. package/dist/deriveScanNarrative.test.js +4 -0
  4. package/dist/engineWireRegression.test.js +2 -2
  5. package/dist/fixtures/repoIntelligenceFixtures.d.ts.map +1 -1
  6. package/dist/fixtures/repoIntelligenceFixtures.js +8 -1
  7. package/dist/narrativeParity.test.js +3 -4
  8. package/dist/presentation/compose/narrativeChannels.d.ts +17 -0
  9. package/dist/presentation/compose/narrativeChannels.d.ts.map +1 -0
  10. package/dist/presentation/compose/narrativeChannels.js +75 -0
  11. package/dist/presentation/compose/narrativeChannels.test.d.ts +2 -0
  12. package/dist/presentation/compose/narrativeChannels.test.d.ts.map +1 -0
  13. package/dist/presentation/compose/narrativeChannels.test.js +42 -0
  14. package/dist/presentation/compose/narrativeCompose.d.ts +1 -0
  15. package/dist/presentation/compose/narrativeCompose.d.ts.map +1 -1
  16. package/dist/presentation/compose/narrativeCompose.js +17 -102
  17. package/dist/presentation/dto/dashboardCardPresentation.d.ts +29 -0
  18. package/dist/presentation/dto/dashboardCardPresentation.d.ts.map +1 -0
  19. package/dist/presentation/dto/scanDetailsPresentation.d.ts +2 -0
  20. package/dist/presentation/dto/scanDetailsPresentation.d.ts.map +1 -1
  21. package/dist/presentation/dto/types.d.ts +0 -9
  22. package/dist/presentation/dto/types.d.ts.map +1 -1
  23. package/dist/presentation/dto/types.js +1 -22
  24. package/dist/presentation/fixtures/dashboardCardGolden.test.d.ts +2 -0
  25. package/dist/presentation/fixtures/dashboardCardGolden.test.d.ts.map +1 -0
  26. package/dist/presentation/fixtures/dashboardCardGolden.test.js +31 -0
  27. package/dist/presentation/fixtures/presentationPersonaFixtures.d.ts +11 -0
  28. package/dist/presentation/fixtures/presentationPersonaFixtures.d.ts.map +1 -0
  29. package/dist/presentation/fixtures/presentationPersonaFixtures.js +197 -0
  30. package/dist/presentation/index.d.ts +8 -5
  31. package/dist/presentation/index.d.ts.map +1 -1
  32. package/dist/presentation/index.js +3 -3
  33. package/dist/presentation/intent/applyPostureVocabularyGuard.d.ts +5 -0
  34. package/dist/presentation/intent/applyPostureVocabularyGuard.d.ts.map +1 -0
  35. package/dist/presentation/intent/applyPostureVocabularyGuard.js +44 -0
  36. package/dist/presentation/intent/derivePresentationInterpretation.d.ts +4 -0
  37. package/dist/presentation/intent/derivePresentationInterpretation.d.ts.map +1 -0
  38. package/dist/presentation/intent/derivePresentationInterpretation.js +202 -0
  39. package/dist/presentation/intent/formatPresentationCopy.d.ts +8 -0
  40. package/dist/presentation/intent/formatPresentationCopy.d.ts.map +1 -0
  41. package/dist/presentation/intent/formatPresentationCopy.js +140 -0
  42. package/dist/presentation/intent/packageDisplayName.d.ts +4 -0
  43. package/dist/presentation/intent/packageDisplayName.d.ts.map +1 -0
  44. package/dist/presentation/intent/packageDisplayName.js +17 -0
  45. package/dist/presentation/intent/postureVocabularyGuard.test.d.ts +2 -0
  46. package/dist/presentation/intent/postureVocabularyGuard.test.d.ts.map +1 -0
  47. package/dist/presentation/intent/postureVocabularyGuard.test.js +23 -0
  48. package/dist/presentation/intent/presentationIntent.d.ts +14 -0
  49. package/dist/presentation/intent/presentationIntent.d.ts.map +1 -0
  50. package/dist/presentation/intent/presentationIntent.js +1 -0
  51. package/dist/presentation/intent/presentationIntent.test.d.ts +2 -0
  52. package/dist/presentation/intent/presentationIntent.test.d.ts.map +1 -0
  53. package/dist/presentation/intent/presentationIntent.test.js +29 -0
  54. package/dist/presentation/intent/verificationFocusLabels.d.ts +2 -0
  55. package/dist/presentation/intent/verificationFocusLabels.d.ts.map +1 -0
  56. package/dist/presentation/intent/verificationFocusLabels.js +45 -0
  57. package/dist/presentation/orchestration/buildScanCardPresentation.d.ts +2 -2
  58. package/dist/presentation/orchestration/buildScanCardPresentation.d.ts.map +1 -1
  59. package/dist/presentation/orchestration/buildScanCardPresentation.js +5 -6
  60. package/dist/presentation/presentation.test.js +18 -17
  61. package/dist/presentation/presentationPersonas.test.d.ts +2 -0
  62. package/dist/presentation/presentationPersonas.test.d.ts.map +1 -0
  63. package/dist/presentation/presentationPersonas.test.js +167 -0
  64. package/dist/presentation/presenters/presentCliScanSummary.d.ts.map +1 -1
  65. package/dist/presentation/presenters/presentCliScanSummary.js +2 -2
  66. package/dist/presentation/presenters/presentDashboardCard.d.ts +5 -0
  67. package/dist/presentation/presenters/presentDashboardCard.d.ts.map +1 -0
  68. package/dist/presentation/presenters/presentDashboardCard.js +117 -0
  69. package/dist/presentation/presenters/presentGitHubCheckRun.d.ts.map +1 -1
  70. package/dist/presentation/presenters/presentGitHubCheckRun.js +2 -2
  71. package/dist/presentation/presenters/presentScanDetails.d.ts.map +1 -1
  72. package/dist/presentation/presenters/presentScanDetails.js +13 -4
  73. package/dist/presentation/profile/derivePresentationProfile.d.ts.map +1 -1
  74. package/dist/presentation/profile/derivePresentationProfile.js +18 -27
  75. package/dist/presentation/profile/presentationProfile.d.ts +2 -0
  76. package/dist/presentation/profile/presentationProfile.d.ts.map +1 -1
  77. package/dist/repoIntelligenceSchema.d.ts +1 -1
  78. package/dist/scanCardSummary.d.ts +3 -4
  79. package/dist/scanCardSummary.d.ts.map +1 -1
  80. package/dist/scanCardSummary.test.js +16 -16
  81. package/dist/scanNarrativeFacts.d.ts +31 -7
  82. package/dist/scanNarrativeFacts.d.ts.map +1 -1
  83. package/dist/scanNarrativeFacts.js +1 -0
  84. package/dist/scanSurfaceCopy.d.ts +8 -0
  85. package/dist/scanSurfaceCopy.d.ts.map +1 -1
  86. package/dist/scanSurfaceCopy.js +8 -0
  87. package/package.json +1 -1
  88. package/dist/presentation/dto/scanCardPresentation.d.ts +0 -25
  89. package/dist/presentation/dto/scanCardPresentation.d.ts.map +0 -1
  90. package/dist/presentation/presenters/presentPipelineScanCard.d.ts +0 -3
  91. package/dist/presentation/presenters/presentPipelineScanCard.d.ts.map +0 -1
  92. package/dist/presentation/presenters/presentPipelineScanCard.js +0 -23
  93. package/dist/presentation/presenters/presentScanCard.d.ts +0 -7
  94. package/dist/presentation/presenters/presentScanCard.d.ts.map +0 -1
  95. package/dist/presentation/presenters/presentScanCard.js +0 -43
  96. /package/dist/presentation/dto/{scanCardPresentation.js → dashboardCardPresentation.js} +0 -0
@@ -0,0 +1,11 @@
1
+ import type { ScanResult } from "../../types.js";
2
+ import { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch } from "./scanResultFixtures.js";
3
+ export declare const scanResultEslint: ScanResult;
4
+ export declare const scanResultPrettier: ScanResult;
5
+ export declare const scanResultVitest: ScanResult;
6
+ export declare const scanResultNextAuth: ScanResult;
7
+ export declare const scanResultBullmq: ScanResult;
8
+ export declare const scanResultUnknownSafe: ScanResult;
9
+ export declare const scanResultMixedTypescriptFastify: ScanResult;
10
+ export { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch, };
11
+ //# sourceMappingURL=presentationPersonaFixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentationPersonaFixtures.d.ts","sourceRoot":"","sources":["../../../src/presentation/fixtures/presentationPersonaFixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AA8JjC,eAAO,MAAM,gBAAgB,EAAE,UAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,UAG/B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,UAG7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,UAS/B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,UAS7B,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,UAGlC,CAAC;AAEH,eAAO,MAAM,gCAAgC,EAAE,UAS7C,CAAC;AAEH,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,GAC1B,CAAC"}
@@ -0,0 +1,197 @@
1
+ import { fixtureRepoIntelligenceFastify, fixtureRepoIntelligenceTypescript, } from "../../fixtures/repoIntelligenceFixtures.js";
2
+ import { analysisPreparationWithValidRepoIntel } from "../../fixtures/repoIntelligenceTestHelpers.js";
3
+ import { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch, } from "./scanResultFixtures.js";
4
+ const basePrep = analysisPreparationWithValidRepoIntel();
5
+ const fixtureRepoIntelligenceEslint = {
6
+ packages: {
7
+ eslint: {
8
+ runtimeSurface: "build",
9
+ reachability: "build_only",
10
+ runtimeImpact: "none",
11
+ expectedImpact: "development_only",
12
+ evidenceStrength: "medium",
13
+ suppressRuntimeNarrative: true,
14
+ dependencyClass: "lint",
15
+ packageRole: "linter",
16
+ verificationFocus: ["ci", "lint"],
17
+ usage: { packageName: "eslint", files: [".eslintrc.cjs"], paths: [] },
18
+ },
19
+ },
20
+ blastRadius: { level: "narrow", changedPackageCount: 1 },
21
+ applicationAreas: [],
22
+ };
23
+ const fixtureRepoIntelligencePrettier = {
24
+ packages: {
25
+ prettier: {
26
+ runtimeSurface: "build",
27
+ reachability: "build_only",
28
+ runtimeImpact: "none",
29
+ expectedImpact: "development_only",
30
+ evidenceStrength: "medium",
31
+ suppressRuntimeNarrative: true,
32
+ dependencyClass: "format",
33
+ packageRole: "formatter",
34
+ verificationFocus: ["ci", "format"],
35
+ usage: { packageName: "prettier", files: [".prettierrc"], paths: [] },
36
+ },
37
+ },
38
+ blastRadius: { level: "narrow", changedPackageCount: 1 },
39
+ applicationAreas: [],
40
+ };
41
+ const fixtureRepoIntelligenceVitest = {
42
+ packages: {
43
+ vitest: {
44
+ runtimeSurface: "test",
45
+ reachability: "test_only",
46
+ runtimeImpact: "none",
47
+ expectedImpact: "test_time",
48
+ evidenceStrength: "medium",
49
+ suppressRuntimeNarrative: true,
50
+ dependencyClass: "test",
51
+ packageRole: "test_runner",
52
+ verificationFocus: ["ci", "test_suite"],
53
+ usage: { packageName: "vitest", files: ["vitest.config.ts"], paths: [] },
54
+ },
55
+ },
56
+ blastRadius: { level: "narrow", changedPackageCount: 1 },
57
+ applicationAreas: [],
58
+ };
59
+ const fixtureRepoIntelligenceNextAuth = {
60
+ packages: {
61
+ "next-auth": {
62
+ runtimeSurface: "runtime",
63
+ reachability: "on_runtime_paths",
64
+ runtimeImpact: "confirmed",
65
+ expectedImpact: "runtime",
66
+ evidenceStrength: "high",
67
+ suppressRuntimeNarrative: false,
68
+ dependencyClass: "runtime",
69
+ packageRole: "auth",
70
+ verificationFocus: ["auth_flow", "session", "routes"],
71
+ usage: {
72
+ packageName: "next-auth",
73
+ files: ["apps/web/src/auth.ts"],
74
+ paths: ["apps/web/src/auth.ts"],
75
+ areas: ["Auth"],
76
+ },
77
+ },
78
+ },
79
+ blastRadius: { level: "moderate", changedPackageCount: 1 },
80
+ applicationAreas: [{ id: "auth", label: "authentication flows" }],
81
+ };
82
+ const fixtureRepoIntelligenceBullmq = {
83
+ packages: {
84
+ bullmq: {
85
+ runtimeSurface: "runtime",
86
+ reachability: "on_runtime_paths",
87
+ runtimeImpact: "confirmed",
88
+ expectedImpact: "runtime",
89
+ evidenceStrength: "high",
90
+ suppressRuntimeNarrative: false,
91
+ dependencyClass: "runtime",
92
+ packageRole: "queue",
93
+ verificationFocus: ["workers", "queue", "serialization"],
94
+ usage: {
95
+ packageName: "bullmq",
96
+ files: ["apps/worker/src/queue.ts"],
97
+ paths: ["apps/worker/src/queue.ts"],
98
+ areas: ["Workers"],
99
+ },
100
+ },
101
+ },
102
+ blastRadius: { level: "moderate", changedPackageCount: 1 },
103
+ applicationAreas: [{ id: "workers", label: "background job processing" }],
104
+ };
105
+ const fixtureRepoIntelligenceUnknown = {
106
+ packages: {
107
+ "opaque-pkg": {
108
+ runtimeSurface: "unknown",
109
+ reachability: "unknown",
110
+ runtimeImpact: "unknown",
111
+ expectedImpact: "unknown",
112
+ evidenceStrength: "low",
113
+ suppressRuntimeNarrative: false,
114
+ dependencyClass: "unknown",
115
+ packageRole: "unknown",
116
+ verificationFocus: [],
117
+ usage: { packageName: "opaque-pkg", files: [], paths: [] },
118
+ },
119
+ },
120
+ blastRadius: { level: "narrow", changedPackageCount: 1 },
121
+ applicationAreas: [],
122
+ };
123
+ const fixtureRepoIntelligenceMixedToolingRuntime = {
124
+ packages: {
125
+ typescript: fixtureRepoIntelligenceTypescript.packages.typescript,
126
+ fastify: fixtureRepoIntelligenceFastify.packages.fastify,
127
+ },
128
+ blastRadius: fixtureRepoIntelligenceFastify.blastRadius,
129
+ applicationAreas: fixtureRepoIntelligenceFastify.applicationAreas,
130
+ };
131
+ function scanBase(over = {}) {
132
+ return {
133
+ totalScore: 18,
134
+ layerScores: {
135
+ security: 5,
136
+ maintainability: 8,
137
+ ecosystem: 10,
138
+ upgradeImpact: 5,
139
+ },
140
+ findings: [],
141
+ generatedAt: "2026-01-01T00:00:00.000Z",
142
+ decision: {
143
+ recommendation: "safe",
144
+ confidence: "high",
145
+ reasoning: [],
146
+ },
147
+ analysisPreparation: basePrep,
148
+ ...over,
149
+ };
150
+ }
151
+ export const scanResultEslint = scanBase({
152
+ changedPackages: ["eslint"],
153
+ repoIntelligence: fixtureRepoIntelligenceEslint,
154
+ });
155
+ export const scanResultPrettier = scanBase({
156
+ changedPackages: ["prettier"],
157
+ repoIntelligence: fixtureRepoIntelligencePrettier,
158
+ });
159
+ export const scanResultVitest = scanBase({
160
+ changedPackages: ["vitest"],
161
+ repoIntelligence: fixtureRepoIntelligenceVitest,
162
+ });
163
+ export const scanResultNextAuth = scanBase({
164
+ totalScore: 52,
165
+ changedPackages: ["next-auth"],
166
+ repoIntelligence: fixtureRepoIntelligenceNextAuth,
167
+ decision: {
168
+ recommendation: "needs_review",
169
+ confidence: "medium",
170
+ reasoning: [],
171
+ },
172
+ });
173
+ export const scanResultBullmq = scanBase({
174
+ totalScore: 48,
175
+ changedPackages: ["bullmq"],
176
+ repoIntelligence: fixtureRepoIntelligenceBullmq,
177
+ decision: {
178
+ recommendation: "needs_review",
179
+ confidence: "medium",
180
+ reasoning: [],
181
+ },
182
+ });
183
+ export const scanResultUnknownSafe = scanBase({
184
+ changedPackages: ["opaque-pkg"],
185
+ repoIntelligence: fixtureRepoIntelligenceUnknown,
186
+ });
187
+ export const scanResultMixedTypescriptFastify = scanBase({
188
+ totalScore: 55,
189
+ changedPackages: ["typescript", "fastify"],
190
+ repoIntelligence: fixtureRepoIntelligenceMixedToolingRuntime,
191
+ decision: {
192
+ recommendation: "needs_review",
193
+ confidence: "medium",
194
+ reasoning: [],
195
+ },
196
+ });
197
+ export { scanResultFastifyRuntime, scanResultLimitedContext, scanResultTypescriptPatch, };
@@ -6,13 +6,16 @@ export type { BuildScanCardPresentationInput } from "./orchestration/buildScanCa
6
6
  export { buildScanDetailsPresentation } from "./orchestration/buildScanDetailsPresentation.js";
7
7
  export type { BuildScanDetailsPresentationInput } from "./orchestration/buildScanDetailsPresentation.js";
8
8
  export type { PresentationProfile } from "./profile/presentationProfile.js";
9
+ export type { PresentationIntent, PresentationInterpretation, } from "./intent/presentationIntent.js";
10
+ export { derivePresentationInterpretation } from "./intent/derivePresentationInterpretation.js";
9
11
  export type { PipelineStatus, PresentationStatus, PresentationDensity, PresentationConfidence, PresentationPriority, PresentationEvidenceContext, PresentationEvidenceRow, } from "./dto/types.js";
10
- export type { ScanCardPresentation } from "./dto/scanCardPresentation.js";
12
+ export type { DashboardCardPresentation } from "./dto/dashboardCardPresentation.js";
13
+ export type { DashboardCardLayout } from "./dto/dashboardCardPresentation.js";
14
+ /** @deprecated Use DashboardCardPresentation */
15
+ export type { DashboardCardPresentation as ScanCardPresentation } from "./dto/dashboardCardPresentation.js";
11
16
  export type { ScanDetailsPresentation } from "./dto/scanDetailsPresentation.js";
12
17
  export type { GitHubCheckRunPresentation, GitHubPrCommentPresentation, CliScanPresentation, } from "./dto/githubAndCliPresentation.js";
13
- export { presentScanCard } from "./presenters/presentScanCard.js";
14
- export type { PresentScanCardContext } from "./presenters/presentScanCard.js";
15
- export { presentPipelineScanCard } from "./presenters/presentPipelineScanCard.js";
18
+ export { presentDashboardCard, presentPipelineDashboardCard, } from "./presenters/presentDashboardCard.js";
16
19
  export { presentScanDetails } from "./presenters/presentScanDetails.js";
17
20
  export type { PresentScanDetailsContext } from "./presenters/presentScanDetails.js";
18
21
  export { presentGitHubCheckRun } from "./presenters/presentGitHubCheckRun.js";
@@ -21,5 +24,5 @@ export { presentCliScanSummary } from "./presenters/presentCliScanSummary.js";
21
24
  export { renderGitHubCheckRunMarkdown } from "./render/renderGitHubCheckRunMarkdown.js";
22
25
  export { renderGitHubPrCommentMarkdown } from "./render/renderGitHubPrCommentMarkdown.js";
23
26
  export { renderCliScanSummaryText } from "./render/renderCliScanSummaryText.js";
24
- export { composeHeadline, composeSubheadline, composeKeyPoints, composeVerificationActions, composeAffectedAreaLabels, composeEvidenceRows, composeSupportingContext, evidenceContextFromProfile, } from "./compose/narrativeCompose.js";
27
+ export { buildNarrativeChannels, projectCompactKeyPoints, composeHeadline, composeSubheadline, composeKeyPoints, composeVerificationActions, composeAffectedAreaLabels, composeEvidenceRows, composeSupportingContext, evidenceContextFromProfile, } from "./compose/narrativeCompose.js";
25
28
  //# sourceMappingURL=index.d.ts.map
@@ -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,4BAA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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,8 +1,8 @@
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 { presentScanCard } from "./presenters/presentScanCard.js";
5
- export { presentPipelineScanCard } from "./presenters/presentPipelineScanCard.js";
4
+ export { derivePresentationInterpretation } from "./intent/derivePresentationInterpretation.js";
5
+ export { presentDashboardCard, presentPipelineDashboardCard, } from "./presenters/presentDashboardCard.js";
6
6
  export { presentScanDetails } from "./presenters/presentScanDetails.js";
7
7
  export { presentGitHubCheckRun } from "./presenters/presentGitHubCheckRun.js";
8
8
  export { presentGitHubPrComment } from "./presenters/presentGitHubPrComment.js";
@@ -10,4 +10,4 @@ export { presentCliScanSummary } from "./presenters/presentCliScanSummary.js";
10
10
  export { renderGitHubCheckRunMarkdown } from "./render/renderGitHubCheckRunMarkdown.js";
11
11
  export { renderGitHubPrCommentMarkdown } from "./render/renderGitHubPrCommentMarkdown.js";
12
12
  export { renderCliScanSummaryText } from "./render/renderCliScanSummaryText.js";
13
- export { composeHeadline, composeSubheadline, composeKeyPoints, composeVerificationActions, composeAffectedAreaLabels, composeEvidenceRows, composeSupportingContext, evidenceContextFromProfile, } from "./compose/narrativeCompose.js";
13
+ export { buildNarrativeChannels, projectCompactKeyPoints, composeHeadline, composeSubheadline, composeKeyPoints, composeVerificationActions, composeAffectedAreaLabels, composeEvidenceRows, composeSupportingContext, evidenceContextFromProfile, } from "./compose/narrativeCompose.js";
@@ -0,0 +1,5 @@
1
+ import type { PresentationStatus } from "../dto/types.js";
2
+ export declare function guardHeadlineForPosture(headline: string, status: PresentationStatus, anchorPackage: string | null): string;
3
+ export declare function applyPostureVocabularyGuardHeadline(headline: string, status: PresentationStatus | undefined, anchorPackage: string | null): string;
4
+ export declare function applyPostureVocabularyGuardLines(lines: string[], status: PresentationStatus | undefined): string[];
5
+ //# sourceMappingURL=applyPostureVocabularyGuard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPostureVocabularyGuard.d.ts","sourceRoot":"","sources":["../../../src/presentation/intent/applyPostureVocabularyGuard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA2B1D,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,MAAM,CAYR;AASD,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,GAAG,SAAS,EACtC,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,MAAM,CAGR;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,MAAM,EAAE,CAGV"}
@@ -0,0 +1,44 @@
1
+ import { scanSurfaceCopy } from "../../scanSurfaceCopy.js";
2
+ import { formatPackageDisplayName } from "./packageDisplayName.js";
3
+ const SAFE_FORBIDDEN = /\b(needs\s+review|critical\s+concern|high\s+risk|significant\s+impact|urgent\s+verification|severe\s+exposure|review\s+before\s+merge|wide\s+blast\s+radius)\b/i;
4
+ const NEEDS_REVIEW_FORBIDDEN = /\b(no\s+action\s+required|no\s+verification\s+required|safe\s+to\s+merge|no\s+concerns)\b/i;
5
+ const RISKY_FORBIDDEN = /\b(no\s+action\s+required|minor\s+findings\s+only|low\s+risk|no\s+concerns)\b/i;
6
+ function violatesPosture(text, status) {
7
+ const t = text.trim();
8
+ if (!t)
9
+ return true;
10
+ switch (status) {
11
+ case "safe":
12
+ return SAFE_FORBIDDEN.test(t);
13
+ case "needs_review":
14
+ return NEEDS_REVIEW_FORBIDDEN.test(t);
15
+ case "risky":
16
+ return RISKY_FORBIDDEN.test(t);
17
+ default:
18
+ return false;
19
+ }
20
+ }
21
+ export function guardHeadlineForPosture(headline, status, anchorPackage) {
22
+ if (!violatesPosture(headline, status))
23
+ return headline;
24
+ const pkg = anchorPackage
25
+ ? formatPackageDisplayName(anchorPackage)
26
+ : "Dependency";
27
+ if (status === "safe") {
28
+ return scanSurfaceCopy.presentation.safeNeutralHeadline.replace("{package}", pkg);
29
+ }
30
+ return headline;
31
+ }
32
+ function guardLinesForPosture(lines, status) {
33
+ return lines.filter((line) => !violatesPosture(line, status));
34
+ }
35
+ export function applyPostureVocabularyGuardHeadline(headline, status, anchorPackage) {
36
+ if (!status)
37
+ return headline;
38
+ return guardHeadlineForPosture(headline, status, anchorPackage);
39
+ }
40
+ export function applyPostureVocabularyGuardLines(lines, status) {
41
+ if (!status)
42
+ return lines;
43
+ return guardLinesForPosture(lines, status);
44
+ }
@@ -0,0 +1,4 @@
1
+ import type { ScanNarrativeFacts } from "../../scanNarrativeFacts.js";
2
+ import type { PresentationInterpretation } from "./presentationIntent.js";
3
+ export declare function derivePresentationInterpretation(facts: ScanNarrativeFacts): PresentationInterpretation;
4
+ //# sourceMappingURL=derivePresentationInterpretation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivePresentationInterpretation.d.ts","sourceRoot":"","sources":["../../../src/presentation/intent/derivePresentationInterpretation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAEV,0BAA0B,EAC3B,MAAM,yBAAyB,CAAC;AAsJjC,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,kBAAkB,GACxB,0BAA0B,CAkG5B"}
@@ -0,0 +1,202 @@
1
+ import { formatCardAreaLabels } from "../../formatCardAreaLabels.js";
2
+ import { mergeVerificationFocusLabels } from "./verificationFocusLabels.js";
3
+ const TOOLING_CLASSES = new Set([
4
+ "tooling",
5
+ "test",
6
+ "lint",
7
+ "format",
8
+ "build",
9
+ "ci",
10
+ ]);
11
+ const RUNTIME_IMPACT_RANK = {
12
+ confirmed: 3,
13
+ possible: 2,
14
+ unknown: 1,
15
+ none: 0,
16
+ };
17
+ const EVIDENCE_RANK = {
18
+ high: 3,
19
+ medium: 2,
20
+ low: 1,
21
+ };
22
+ function isRuntimeEligible(row) {
23
+ if (row.suppressRuntimeNarrative)
24
+ return false;
25
+ if (row.runtimeImpact === "confirmed" || row.runtimeImpact === "possible") {
26
+ return true;
27
+ }
28
+ if (row.dependencyClass === "runtime")
29
+ return true;
30
+ if (row.usagePathCount > 0)
31
+ return true;
32
+ return false;
33
+ }
34
+ function isToolingOriented(row) {
35
+ if (row.suppressRuntimeNarrative)
36
+ return true;
37
+ if (row.dependencyClass && TOOLING_CLASSES.has(row.dependencyClass)) {
38
+ return true;
39
+ }
40
+ return false;
41
+ }
42
+ function compareRuntimePackages(a, b, order) {
43
+ const impactA = RUNTIME_IMPACT_RANK[a.runtimeImpact ?? "none"] ?? 0;
44
+ const impactB = RUNTIME_IMPACT_RANK[b.runtimeImpact ?? "none"] ?? 0;
45
+ if (impactB !== impactA)
46
+ return impactB - impactA;
47
+ const evA = EVIDENCE_RANK[a.evidenceStrength ?? "low"] ?? 0;
48
+ const evB = EVIDENCE_RANK[b.evidenceStrength ?? "low"] ?? 0;
49
+ if (evB !== evA)
50
+ return evB - evA;
51
+ return order.indexOf(a.packageName) - order.indexOf(b.packageName);
52
+ }
53
+ function pickAnchorPackage(rows, changedOrder) {
54
+ if (rows.length === 0)
55
+ return null;
56
+ const sorted = [...rows].sort((a, b) => compareRuntimePackages(a, b, changedOrder));
57
+ return sorted[0]?.packageName ?? null;
58
+ }
59
+ function pickToolingAnchor(rows, changedOrder) {
60
+ if (rows.length === 0)
61
+ return null;
62
+ const sorted = [...rows].sort((a, b) => changedOrder.indexOf(a.packageName) - changedOrder.indexOf(b.packageName));
63
+ return sorted[0]?.packageName ?? null;
64
+ }
65
+ function isToolingPatchSet(rows, facts) {
66
+ if (rows.length === 0)
67
+ return false;
68
+ const narrow = !facts.blastRadius || facts.blastRadius.level === "narrow";
69
+ if (!narrow)
70
+ return false;
71
+ return rows.every((row) => row.suppressRuntimeNarrative &&
72
+ (row.expectedImpact === "typecheck" ||
73
+ row.expectedImpact === "build_time"));
74
+ }
75
+ function runtimeSurfaceLabelFromFacts(facts, anchorRow) {
76
+ const area = facts.affectedAreas[0];
77
+ if (area) {
78
+ const formatted = formatCardAreaLabels([area.label], 1);
79
+ return formatted[0] ?? area.label;
80
+ }
81
+ if (anchorRow?.packageRole === "http_framework") {
82
+ return "API request handling";
83
+ }
84
+ if (anchorRow?.packageRole === "auth") {
85
+ return "authentication flows";
86
+ }
87
+ if (anchorRow?.packageRole === "queue") {
88
+ return "background job processing";
89
+ }
90
+ return "application code";
91
+ }
92
+ function collectVerificationLabels(rows) {
93
+ return mergeVerificationFocusLabels(rows.map((r) => r.verificationFocus));
94
+ }
95
+ function showLimitedEvidence(rows) {
96
+ return rows.some((r) => r.evidenceStrength === "low");
97
+ }
98
+ function dominantExpectedImpact(rows) {
99
+ for (const row of rows) {
100
+ if (row.expectedImpact && row.expectedImpact !== "unknown") {
101
+ return row.expectedImpact;
102
+ }
103
+ }
104
+ return null;
105
+ }
106
+ function emptyInterpretation(intent) {
107
+ return {
108
+ intent,
109
+ anchorPackage: null,
110
+ suppressRuntimeNarrative: intent.startsWith("tooling"),
111
+ allowRuntimeNarrative: intent.includes("runtime"),
112
+ showLimitedEvidence: false,
113
+ expectedImpactKey: null,
114
+ verificationLabels: [],
115
+ runtimeSurfaceLabel: null,
116
+ runtimePackages: [],
117
+ };
118
+ }
119
+ export function derivePresentationInterpretation(facts) {
120
+ const changedOrder = facts.changedPackages.all;
121
+ const semantics = facts.changedPackageSemantics.length > 0
122
+ ? facts.changedPackageSemantics
123
+ : facts.packageSemantics && facts.changedPackages.primary
124
+ ? [
125
+ {
126
+ packageName: facts.changedPackages.primary,
127
+ dependencyClass: facts.packageSemantics.dependencyClass,
128
+ packageRole: facts.packageSemantics.packageRole,
129
+ runtimeImpact: facts.packageSemantics.runtimeImpact,
130
+ expectedImpact: facts.packageSemantics.expectedImpact,
131
+ suppressRuntimeNarrative: facts.packageSemantics.suppressRuntimeNarrative,
132
+ evidenceStrength: facts.packageSemantics.evidenceStrength,
133
+ verificationFocus: facts.packageSemantics.verificationFocus,
134
+ usagePathCount: 0,
135
+ usageAreaCount: 0,
136
+ },
137
+ ]
138
+ : [];
139
+ const tier1Ok = facts.availability.tiersPresent.tier1 &&
140
+ facts.availability.repoIntelligenceParse === "ok";
141
+ if (!tier1Ok) {
142
+ return emptyInterpretation("limited_context");
143
+ }
144
+ if (!facts.changedPackages.primary) {
145
+ return emptyInterpretation("no_changed_packages");
146
+ }
147
+ const runtimeEligible = semantics.filter(isRuntimeEligible);
148
+ if (runtimeEligible.length > 0) {
149
+ const anchorPackage = pickAnchorPackage(runtimeEligible, changedOrder);
150
+ const anchorRow = runtimeEligible.find((r) => r.packageName === anchorPackage);
151
+ const runtimeSurfaceLabel = runtimeSurfaceLabelFromFacts(facts, anchorRow);
152
+ const verificationLabels = collectVerificationLabels(runtimeEligible);
153
+ let intent = "runtime_upgrade";
154
+ if (runtimeEligible.length > 1) {
155
+ intent = "multi_runtime_upgrade";
156
+ }
157
+ else if (runtimeEligible.some((r) => r.packageRole === "auth")) {
158
+ intent = "auth_runtime_upgrade";
159
+ }
160
+ else if (runtimeEligible.some((r) => r.packageRole === "queue")) {
161
+ intent = "queue_runtime_upgrade";
162
+ }
163
+ return {
164
+ intent,
165
+ anchorPackage,
166
+ suppressRuntimeNarrative: false,
167
+ allowRuntimeNarrative: true,
168
+ showLimitedEvidence: showLimitedEvidence(runtimeEligible),
169
+ expectedImpactKey: dominantExpectedImpact(runtimeEligible),
170
+ verificationLabels,
171
+ runtimeSurfaceLabel,
172
+ runtimePackages: runtimeEligible.map((r) => r.packageName),
173
+ };
174
+ }
175
+ const toolingOnly = semantics.length > 0 && semantics.every(isToolingOriented);
176
+ if (toolingOnly) {
177
+ const anchorPackage = pickToolingAnchor(semantics, changedOrder);
178
+ const isPatch = isToolingPatchSet(semantics, facts);
179
+ const intent = isPatch
180
+ ? "tooling_patch"
181
+ : "tooling_upgrade";
182
+ const anchorRow = semantics.find((r) => r.packageName === anchorPackage);
183
+ return {
184
+ intent,
185
+ anchorPackage,
186
+ suppressRuntimeNarrative: true,
187
+ allowRuntimeNarrative: false,
188
+ showLimitedEvidence: showLimitedEvidence(semantics),
189
+ expectedImpactKey: anchorRow?.expectedImpact ?? null,
190
+ verificationLabels: collectVerificationLabels(semantics),
191
+ runtimeSurfaceLabel: null,
192
+ runtimePackages: [],
193
+ };
194
+ }
195
+ return {
196
+ ...emptyInterpretation("unknown_upgrade"),
197
+ anchorPackage: facts.changedPackages.primary,
198
+ verificationLabels: collectVerificationLabels(semantics),
199
+ showLimitedEvidence: showLimitedEvidence(semantics),
200
+ expectedImpactKey: dominantExpectedImpact(semantics),
201
+ };
202
+ }
@@ -0,0 +1,8 @@
1
+ import type { ScanNarrativeFacts } from "../../scanNarrativeFacts.js";
2
+ import type { PresentationStatus } from "../dto/types.js";
3
+ import type { PresentationInterpretation } from "./presentationIntent.js";
4
+ export declare function formatPresentationHeadline(interpretation: PresentationInterpretation, facts: ScanNarrativeFacts, status: PresentationStatus | undefined): string;
5
+ /** Atomic insight lines — no embedded areas or blast radius (those live in separate channels). */
6
+ export declare function formatPresentationInsightLines(interpretation: PresentationInterpretation, facts: ScanNarrativeFacts, status: PresentationStatus | undefined): string[];
7
+ export declare function formatPresentationVerification(interpretation: PresentationInterpretation, status: PresentationStatus | undefined, max: number): string[];
8
+ //# sourceMappingURL=formatPresentationCopy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatPresentationCopy.d.ts","sourceRoot":"","sources":["../../../src/presentation/intent/formatPresentationCopy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAM1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAa1E,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,0BAA0B,EAC1C,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,MAAM,CAmDR;AA0BD,kGAAkG;AAClG,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,0BAA0B,EAC1C,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,MAAM,EAAE,CA0CV;AAuBD,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,0BAA0B,EAC1C,MAAM,EAAE,kBAAkB,GAAG,SAAS,EACtC,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAmBV"}