@mergesignal/shared 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/presentation/buildGitHubCheckRunOutput.d.ts +20 -0
- package/dist/presentation/buildGitHubCheckRunOutput.d.ts.map +1 -0
- package/dist/presentation/buildGitHubCheckRunOutput.js +42 -0
- package/dist/presentation/buildGitHubCheckRunOutput.test.d.ts +2 -0
- package/dist/presentation/buildGitHubCheckRunOutput.test.d.ts.map +1 -0
- package/dist/presentation/buildGitHubCheckRunOutput.test.js +188 -0
- package/dist/presentation/index.d.ts +2 -1
- package/dist/presentation/index.d.ts.map +1 -1
- package/dist/presentation/index.js +2 -1
- package/dist/presentation/presenters/presentDashboardCard.d.ts +1 -0
- package/dist/presentation/presenters/presentDashboardCard.d.ts.map +1 -1
- package/dist/presentation/presenters/presentDashboardCard.js +16 -0
- package/dist/scanCardPresentationState.d.ts +8 -2
- package/dist/scanCardPresentationState.d.ts.map +1 -1
- package/dist/scanSurfaceCopy.d.ts +2 -0
- package/dist/scanSurfaceCopy.d.ts.map +1 -1
- package/dist/scanSurfaceCopy.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ScanResult } from "../types.js";
|
|
2
|
+
export type GitHubCheckRunConclusion = "success" | "neutral" | "failure";
|
|
3
|
+
export type GitHubCheckRunOutput = {
|
|
4
|
+
/** Short title shown in the checks bar (≤72 chars). */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Markdown summary shown in the check run detail panel (≤2000 chars). */
|
|
7
|
+
summary: string;
|
|
8
|
+
conclusion: GitHubCheckRunConclusion;
|
|
9
|
+
};
|
|
10
|
+
export declare function resolveWebAppOrigin(): string;
|
|
11
|
+
export type BuildGitHubCheckRunOutputOptions = {
|
|
12
|
+
scanId: string;
|
|
13
|
+
webAppOrigin?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Formats GitHub Check Run output from a persisted ScanResult via Assessment presentation.
|
|
17
|
+
* Presentation-only — callers own Octokit checks.create.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildGitHubCheckRunOutput(result: ScanResult, options: BuildGitHubCheckRunOutputOptions | string): GitHubCheckRunOutput;
|
|
20
|
+
//# sourceMappingURL=buildGitHubCheckRunOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildGitHubCheckRunOutput.d.ts","sourceRoot":"","sources":["../../src/presentation/buildGitHubCheckRunOutput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,oBAAoB,GAAG;IACjC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,wBAAwB,CAAC;CACtC,CAAC;AAKF,wBAAgB,mBAAmB,IAAI,MAAM,CAM5C;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,gCAAgC,GAAG,MAAM,GACjD,oBAAoB,CAkCtB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { buildScanPresentationBundle } from "./orchestration/buildScanPresentationBundle.js";
|
|
2
|
+
import { presentGitHubCheckRun } from "./presenters/presentGitHubCheckRun.js";
|
|
3
|
+
import { renderGitHubCheckRunMarkdown } from "./render/renderGitHubCheckRunMarkdown.js";
|
|
4
|
+
/** Default Fly web app origin when `MERGESIGNAL_WEB_URL` is unset. */
|
|
5
|
+
const DEFAULT_WEB_APP_ORIGIN = "https://mergesignal-web.fly.dev";
|
|
6
|
+
export function resolveWebAppOrigin() {
|
|
7
|
+
const url = typeof process !== "undefined"
|
|
8
|
+
? process.env.MERGESIGNAL_WEB_URL?.trim()
|
|
9
|
+
: undefined;
|
|
10
|
+
return (url || DEFAULT_WEB_APP_ORIGIN).replace(/\/+$/, "");
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Formats GitHub Check Run output from a persisted ScanResult via Assessment presentation.
|
|
14
|
+
* Presentation-only — callers own Octokit checks.create.
|
|
15
|
+
*/
|
|
16
|
+
export function buildGitHubCheckRunOutput(result, options) {
|
|
17
|
+
const scanId = typeof options === "string" ? options : options.scanId;
|
|
18
|
+
const webAppOrigin = typeof options === "string"
|
|
19
|
+
? resolveWebAppOrigin()
|
|
20
|
+
: (options.webAppOrigin ?? resolveWebAppOrigin());
|
|
21
|
+
if (!result.decision) {
|
|
22
|
+
throw new Error("buildGitHubCheckRunOutput requires ScanResult.decision");
|
|
23
|
+
}
|
|
24
|
+
const bundle = buildScanPresentationBundle({
|
|
25
|
+
result,
|
|
26
|
+
pipelineStatus: "done",
|
|
27
|
+
});
|
|
28
|
+
if (!bundle) {
|
|
29
|
+
throw new Error("buildGitHubCheckRunOutput requires ScanResult.assessment for presentation bundle");
|
|
30
|
+
}
|
|
31
|
+
const baseline = result.reportPresentation?.mode === "lightweight_pr_graph_baseline";
|
|
32
|
+
const presentation = presentGitHubCheckRun(bundle, {
|
|
33
|
+
scanId,
|
|
34
|
+
webAppOrigin,
|
|
35
|
+
baseline,
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
title: presentation.title,
|
|
39
|
+
summary: renderGitHubCheckRunMarkdown(presentation),
|
|
40
|
+
conclusion: presentation.conclusion,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildGitHubCheckRunOutput.test.d.ts","sourceRoot":"","sources":["../../src/presentation/buildGitHubCheckRunOutput.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { buildScanPresentationBundle, presentDashboardCard } from "./index.js";
|
|
3
|
+
import { buildGitHubCheckRunOutput } from "./buildGitHubCheckRunOutput.js";
|
|
4
|
+
const safeAssessment = {
|
|
5
|
+
posture: "safe",
|
|
6
|
+
confidence: "high",
|
|
7
|
+
primaryConcern: null,
|
|
8
|
+
concerns: [],
|
|
9
|
+
factors: ["tooling_maintenance"],
|
|
10
|
+
changeClasses: ["tooling_maintenance"],
|
|
11
|
+
presentation: {
|
|
12
|
+
narrativeIntensity: "minimal",
|
|
13
|
+
reachVisibility: "hidden",
|
|
14
|
+
verificationIntensity: "advisory",
|
|
15
|
+
insightEmissionFloor: "none",
|
|
16
|
+
reportMode: "high_signal_pr",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const baselineAssessment = {
|
|
20
|
+
posture: "safe",
|
|
21
|
+
confidence: "medium",
|
|
22
|
+
primaryConcern: "graph_baseline_only",
|
|
23
|
+
concerns: [
|
|
24
|
+
{
|
|
25
|
+
kind: "graph_baseline_only",
|
|
26
|
+
rank: 1,
|
|
27
|
+
evidenceRefs: ["fixture:baseline"],
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
factors: ["graph_baseline_only"],
|
|
31
|
+
changeClasses: ["tooling_maintenance"],
|
|
32
|
+
presentation: {
|
|
33
|
+
narrativeIntensity: "minimal",
|
|
34
|
+
reachVisibility: "hidden",
|
|
35
|
+
verificationIntensity: "none",
|
|
36
|
+
insightEmissionFloor: "none",
|
|
37
|
+
reportMode: "lightweight_pr_graph_baseline",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
const needsReviewAssessment = {
|
|
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: {
|
|
55
|
+
narrativeIntensity: "elevated",
|
|
56
|
+
reachVisibility: "prominent",
|
|
57
|
+
verificationIntensity: "required",
|
|
58
|
+
insightEmissionFloor: "full",
|
|
59
|
+
reportMode: "high_signal_pr",
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
const riskyAssessment = {
|
|
63
|
+
posture: "risky",
|
|
64
|
+
confidence: "high",
|
|
65
|
+
primaryConcern: "breaking_or_major",
|
|
66
|
+
concerns: [
|
|
67
|
+
{
|
|
68
|
+
kind: "breaking_or_major",
|
|
69
|
+
rank: 1,
|
|
70
|
+
packages: ["react"],
|
|
71
|
+
evidenceRefs: ["fixture:breaking"],
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
factors: ["breaking_or_major"],
|
|
75
|
+
changeClasses: ["breaking_change"],
|
|
76
|
+
presentation: {
|
|
77
|
+
narrativeIntensity: "elevated",
|
|
78
|
+
reachVisibility: "prominent",
|
|
79
|
+
verificationIntensity: "required",
|
|
80
|
+
insightEmissionFloor: "full",
|
|
81
|
+
reportMode: "high_signal_pr",
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
function assertNoLegacyCheckRunMarkers(summary) {
|
|
85
|
+
expect(summary).not.toContain("Risk index");
|
|
86
|
+
expect(summary).not.toContain("Layer scores");
|
|
87
|
+
expect(summary).not.toContain("<details>");
|
|
88
|
+
expect(summary).not.toMatch(/\d+\/100/);
|
|
89
|
+
}
|
|
90
|
+
function minimalScanResult(overrides = {}) {
|
|
91
|
+
return {
|
|
92
|
+
totalScore: 72,
|
|
93
|
+
layerScores: {
|
|
94
|
+
security: 10,
|
|
95
|
+
maintainability: 20,
|
|
96
|
+
ecosystem: 30,
|
|
97
|
+
upgradeImpact: 15,
|
|
98
|
+
},
|
|
99
|
+
findings: [],
|
|
100
|
+
methodologyVersion: "mergesignal-engine/test",
|
|
101
|
+
generatedAt: new Date().toISOString(),
|
|
102
|
+
assessment: safeAssessment,
|
|
103
|
+
decision: {
|
|
104
|
+
recommendation: "safe",
|
|
105
|
+
confidence: "medium",
|
|
106
|
+
reasoning: [],
|
|
107
|
+
},
|
|
108
|
+
...overrides,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
describe("buildGitHubCheckRunOutput", () => {
|
|
112
|
+
it("maps safe posture to success conclusion with scan link", () => {
|
|
113
|
+
const out = buildGitHubCheckRunOutput(minimalScanResult(), {
|
|
114
|
+
scanId: "scan-safe",
|
|
115
|
+
webAppOrigin: "https://app.test",
|
|
116
|
+
});
|
|
117
|
+
expect(out.conclusion).toBe("success");
|
|
118
|
+
expect(out.summary).toContain("/scan/scan-safe");
|
|
119
|
+
expect(out.summary).toContain("Full scan:");
|
|
120
|
+
assertNoLegacyCheckRunMarkers(out.summary);
|
|
121
|
+
});
|
|
122
|
+
it("maps needs_review posture to neutral conclusion", () => {
|
|
123
|
+
const out = buildGitHubCheckRunOutput(minimalScanResult({
|
|
124
|
+
assessment: needsReviewAssessment,
|
|
125
|
+
decision: {
|
|
126
|
+
recommendation: "needs_review",
|
|
127
|
+
confidence: "medium",
|
|
128
|
+
reasoning: ["Runtime usage confirmed"],
|
|
129
|
+
},
|
|
130
|
+
changedPackages: ["fastify"],
|
|
131
|
+
}), { scanId: "scan-review", webAppOrigin: "https://app.test" });
|
|
132
|
+
expect(out.conclusion).toBe("neutral");
|
|
133
|
+
expect(out.summary).toContain("/scan/scan-review");
|
|
134
|
+
assertNoLegacyCheckRunMarkers(out.summary);
|
|
135
|
+
});
|
|
136
|
+
it("maps risky posture to failure conclusion", () => {
|
|
137
|
+
const out = buildGitHubCheckRunOutput(minimalScanResult({
|
|
138
|
+
assessment: riskyAssessment,
|
|
139
|
+
decision: {
|
|
140
|
+
recommendation: "risky",
|
|
141
|
+
confidence: "high",
|
|
142
|
+
reasoning: ["Breaking change"],
|
|
143
|
+
},
|
|
144
|
+
}), { scanId: "scan-risky", webAppOrigin: "https://app.test" });
|
|
145
|
+
expect(out.conclusion).toBe("failure");
|
|
146
|
+
assertNoLegacyCheckRunMarkers(out.summary);
|
|
147
|
+
});
|
|
148
|
+
it("produces success conclusion for lightweight baseline presentation", () => {
|
|
149
|
+
const out = buildGitHubCheckRunOutput(minimalScanResult({
|
|
150
|
+
assessment: baselineAssessment,
|
|
151
|
+
reportPresentation: { mode: "lightweight_pr_graph_baseline" },
|
|
152
|
+
changedPackages: ["@types/minimist"],
|
|
153
|
+
decision: {
|
|
154
|
+
recommendation: "safe",
|
|
155
|
+
confidence: "medium",
|
|
156
|
+
reasoning: [],
|
|
157
|
+
},
|
|
158
|
+
}), { scanId: "scan-lw", webAppOrigin: "https://app.test" });
|
|
159
|
+
expect(out.conclusion).toBe("success");
|
|
160
|
+
expect(out.summary).toContain("/scan/scan-lw");
|
|
161
|
+
assertNoLegacyCheckRunMarkers(out.summary);
|
|
162
|
+
});
|
|
163
|
+
it("throws when assessment is missing", () => {
|
|
164
|
+
expect(() => buildGitHubCheckRunOutput(minimalScanResult({ assessment: undefined }), "scan-no-assessment")).toThrow(/assessment/i);
|
|
165
|
+
});
|
|
166
|
+
it("title matches dashboard card headline from the same bundle", () => {
|
|
167
|
+
const result = minimalScanResult({
|
|
168
|
+
assessment: needsReviewAssessment,
|
|
169
|
+
decision: {
|
|
170
|
+
recommendation: "needs_review",
|
|
171
|
+
confidence: "medium",
|
|
172
|
+
reasoning: ["Runtime usage confirmed"],
|
|
173
|
+
},
|
|
174
|
+
changedPackages: ["fastify"],
|
|
175
|
+
});
|
|
176
|
+
const out = buildGitHubCheckRunOutput(result, {
|
|
177
|
+
scanId: "scan-parity",
|
|
178
|
+
webAppOrigin: "https://app.test",
|
|
179
|
+
});
|
|
180
|
+
const bundle = buildScanPresentationBundle({
|
|
181
|
+
result,
|
|
182
|
+
pipelineStatus: "done",
|
|
183
|
+
});
|
|
184
|
+
expect(bundle).not.toBeNull();
|
|
185
|
+
const card = presentDashboardCard(bundle);
|
|
186
|
+
expect(out.title).toBe(card.headline);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
@@ -14,13 +14,14 @@ export type { DashboardCardLayout } from "./dto/dashboardCardPresentation.js";
|
|
|
14
14
|
export type { DashboardCardPresentation as ScanCardPresentation } from "./dto/dashboardCardPresentation.js";
|
|
15
15
|
export type { ScanDetailsPresentation } from "./dto/scanDetailsPresentation.js";
|
|
16
16
|
export type { GitHubCheckRunPresentation, GitHubPrCommentPresentation, CliScanPresentation, } from "./dto/githubAndCliPresentation.js";
|
|
17
|
-
export { presentDashboardCard, presentPipelineDashboardCard, } from "./presenters/presentDashboardCard.js";
|
|
17
|
+
export { presentDashboardCard, presentPipelineDashboardCard, presentSurfacesIncompleteDashboardCard, } from "./presenters/presentDashboardCard.js";
|
|
18
18
|
export { presentScanDetails } from "./presenters/presentScanDetails.js";
|
|
19
19
|
export type { PresentScanDetailsContext } from "./presenters/presentScanDetails.js";
|
|
20
20
|
export { presentGitHubCheckRun } from "./presenters/presentGitHubCheckRun.js";
|
|
21
21
|
export { presentGitHubPrComment } from "./presenters/presentGitHubPrComment.js";
|
|
22
22
|
export { presentCliScanSummary } from "./presenters/presentCliScanSummary.js";
|
|
23
23
|
export { renderGitHubCheckRunMarkdown } from "./render/renderGitHubCheckRunMarkdown.js";
|
|
24
|
+
export { buildGitHubCheckRunOutput, resolveWebAppOrigin, type GitHubCheckRunConclusion, type GitHubCheckRunOutput, type BuildGitHubCheckRunOutputOptions, } from "./buildGitHubCheckRunOutput.js";
|
|
24
25
|
export { renderGitHubPrCommentMarkdown } from "./render/renderGitHubPrCommentMarkdown.js";
|
|
25
26
|
export { renderCliScanSummaryText } from "./render/renderCliScanSummaryText.js";
|
|
26
27
|
export { buildNarrativeChannels, projectCompactKeyPoints, composeHeadline, composeSubheadline, composeKeyPoints, composeVerificationActions, composeAffectedAreaLabels, composeEvidenceRows, composeSupportingContext, evidenceContextFromProfile, } from "./compose/narrativeCompose.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presentation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,YAAY,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,YAAY,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,YAAY,EAAE,iCAAiC,EAAE,MAAM,iDAAiD,CAAC;AAEzG,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EACV,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,gDAAgD;AAChD,YAAY,EAAE,yBAAyB,IAAI,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC5G,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,oBAAoB,EACpB,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presentation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,YAAY,EAAE,gCAAgC,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,YAAY,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,YAAY,EAAE,iCAAiC,EAAE,MAAM,iDAAiD,CAAC;AAEzG,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EACV,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,gDAAgD;AAChD,YAAY,EAAE,yBAAyB,IAAI,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC5G,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,sCAAsC,GACvC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,GACtC,MAAM,gCAAgC,CAAC;AACxC,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,12 +1,13 @@
|
|
|
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 { presentDashboardCard, presentPipelineDashboardCard, } from "./presenters/presentDashboardCard.js";
|
|
4
|
+
export { presentDashboardCard, presentPipelineDashboardCard, presentSurfacesIncompleteDashboardCard, } from "./presenters/presentDashboardCard.js";
|
|
5
5
|
export { presentScanDetails } from "./presenters/presentScanDetails.js";
|
|
6
6
|
export { presentGitHubCheckRun } from "./presenters/presentGitHubCheckRun.js";
|
|
7
7
|
export { presentGitHubPrComment } from "./presenters/presentGitHubPrComment.js";
|
|
8
8
|
export { presentCliScanSummary } from "./presenters/presentCliScanSummary.js";
|
|
9
9
|
export { renderGitHubCheckRunMarkdown } from "./render/renderGitHubCheckRunMarkdown.js";
|
|
10
|
+
export { buildGitHubCheckRunOutput, resolveWebAppOrigin, } from "./buildGitHubCheckRunOutput.js";
|
|
10
11
|
export { renderGitHubPrCommentMarkdown } from "./render/renderGitHubPrCommentMarkdown.js";
|
|
11
12
|
export { renderCliScanSummaryText } from "./render/renderCliScanSummaryText.js";
|
|
12
13
|
export { buildNarrativeChannels, projectCompactKeyPoints, composeHeadline, composeSubheadline, composeKeyPoints, composeVerificationActions, composeAffectedAreaLabels, composeEvidenceRows, composeSupportingContext, evidenceContextFromProfile, } from "./compose/narrativeCompose.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DashboardCardPresentation } from "../dto/dashboardCardPresentation.js";
|
|
2
2
|
import type { ScanPresentationBundle } from "../orchestration/scanPresentationBundle.js";
|
|
3
3
|
export declare function presentDashboardCard(bundle: ScanPresentationBundle): DashboardCardPresentation;
|
|
4
|
+
export declare function presentSurfacesIncompleteDashboardCard(): DashboardCardPresentation;
|
|
4
5
|
export declare function presentPipelineDashboardCard(pipelineStatus: "queued" | "running" | "failed"): DashboardCardPresentation;
|
|
5
6
|
//# sourceMappingURL=presentDashboardCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentDashboardCard.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentDashboardCard.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAoEzF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,sBAAsB,GAC7B,yBAAyB,CA8C3B;AAED,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAC9C,yBAAyB,CAqB3B"}
|
|
1
|
+
{"version":3,"file":"presentDashboardCard.d.ts","sourceRoot":"","sources":["../../../src/presentation/presenters/presentDashboardCard.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAoEzF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,sBAAsB,GAC7B,yBAAyB,CA8C3B;AAED,wBAAgB,sCAAsC,IAAI,yBAAyB,CAelF;AAED,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAC9C,yBAAyB,CAqB3B"}
|
|
@@ -96,6 +96,22 @@ export function presentDashboardCard(bundle) {
|
|
|
96
96
|
};
|
|
97
97
|
return normalizeDashboardCard(card);
|
|
98
98
|
}
|
|
99
|
+
export function presentSurfacesIncompleteDashboardCard() {
|
|
100
|
+
const headline = scanSurfaceCopy.pipeline.surfacesNotSynchronized;
|
|
101
|
+
return normalizeDashboardCard({
|
|
102
|
+
pipeline: {
|
|
103
|
+
status: "failed",
|
|
104
|
+
headline,
|
|
105
|
+
subheadline: scanSurfaceCopy.pipeline.surfacesNotSynchronizedDetail,
|
|
106
|
+
},
|
|
107
|
+
headline,
|
|
108
|
+
insights: [],
|
|
109
|
+
verification: [],
|
|
110
|
+
layout: "standard",
|
|
111
|
+
detailActionLabel: scanSurfaceCopy.presentation.actionLabelReview,
|
|
112
|
+
sortKey: { postureRank: -1, riskIndex: -1 },
|
|
113
|
+
});
|
|
114
|
+
}
|
|
99
115
|
export function presentPipelineDashboardCard(pipelineStatus) {
|
|
100
116
|
const isRunning = pipelineStatus === "queued" || pipelineStatus === "running";
|
|
101
117
|
const headline = isRunning
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard PR card lifecycle — distinct from pipeline status.
|
|
3
|
+
*
|
|
4
|
+
* Pipeline / infrastructure: `scanning`, `analysis_failed`, `surfaces_incomplete`
|
|
5
|
+
* Product / assessment: `ready`, `stale`
|
|
6
|
+
* Absence: `not_scanned`
|
|
7
|
+
*/
|
|
8
|
+
export type ScanCardPresentationState = "not_scanned" | "scanning" | "analysis_failed" | "surfaces_incomplete" | "ready" | "stale";
|
|
3
9
|
export declare function staleScanSubline(): string;
|
|
4
10
|
//# sourceMappingURL=scanCardPresentationState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanCardPresentationState.d.ts","sourceRoot":"","sources":["../src/scanCardPresentationState.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"scanCardPresentationState.d.ts","sourceRoot":"","sources":["../src/scanCardPresentationState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GACjC,aAAa,GACb,UAAU,GACV,iBAAiB,GACjB,qBAAqB,GACrB,OAAO,GACP,OAAO,CAAC;AAIZ,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
|
|
@@ -8,6 +8,8 @@ export declare const scanSurfaceCopy: {
|
|
|
8
8
|
readonly scanIncomplete: "Waiting for scan results";
|
|
9
9
|
readonly scanUnavailable: "Scan data unavailable";
|
|
10
10
|
readonly analysisIncomplete: "Analysis could not be completed";
|
|
11
|
+
readonly surfacesNotSynchronized: "Analysis complete - GitHub check not synchronized";
|
|
12
|
+
readonly surfacesNotSynchronizedDetail: "Scan results are saved; the GitHub Check Run will appear after publishing completes.";
|
|
11
13
|
readonly outputNotVerified: "These results could not be verified";
|
|
12
14
|
};
|
|
13
15
|
readonly actions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanSurfaceCopy.d.ts","sourceRoot":"","sources":["../src/scanSurfaceCopy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"scanSurfaceCopy.d.ts","sourceRoot":"","sources":["../src/scanSurfaceCopy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;QAoBxB,8EAA8E;;QAG9E,6DAA6D;;;;QAO7D,qDAAqD;;;;;QASrD,mEAAmE;;;;QAOnE,yFAAyF;;QAGzF,mFAAmF;;QAGnF,4EAA4E;;QAE5E,8FAA8F;;QAE9F,+DAA+D;;;QAI/D,6EAA6E;;;;;QAK7E,2CAA2C;;;QAK3C,2EAA2E;;QAE3E,4EAA4E;;;QAI5E,sEAAsE;;;IAGxE,2EAA2E;;;;;;;;;;;;;;QAiBzE,oEAAoE;;;IAGtE,wEAAwE;;;;;;QAOtE,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkCzC,yDAAyD;;YAGzD,mDAAmD;;YAGnD,8BAA8B;;YAE9B,oDAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4CtD,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsI/C,uFAAuF;;;;;;;;;;;;;;;;;;;;;;;;IAwBvF,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuClF,sEAAsE;;;;;CAO9D,CAAC;AAEX,iEAAiE;AACjE,wBAAgB,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAa5D"}
|
package/dist/scanSurfaceCopy.js
CHANGED
|
@@ -8,6 +8,8 @@ export const scanSurfaceCopy = {
|
|
|
8
8
|
scanIncomplete: "Waiting for scan results",
|
|
9
9
|
scanUnavailable: "Scan data unavailable",
|
|
10
10
|
analysisIncomplete: "Analysis could not be completed",
|
|
11
|
+
surfacesNotSynchronized: "Analysis complete - GitHub check not synchronized",
|
|
12
|
+
surfacesNotSynchronizedDetail: "Scan results are saved; the GitHub Check Run will appear after publishing completes.",
|
|
11
13
|
outputNotVerified: "These results could not be verified",
|
|
12
14
|
},
|
|
13
15
|
actions: {
|