@mergesignal/shared 0.11.0 → 0.12.1
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/assessmentProjection.d.ts.map +1 -1
- package/dist/assessmentProjection.js +11 -4
- package/dist/deriveScanNarrative.d.ts.map +1 -1
- package/dist/deriveScanNarrative.js +4 -0
- package/dist/fixtures/assessmentScopeFixtures.d.ts +5 -2
- package/dist/fixtures/assessmentScopeFixtures.d.ts.map +1 -1
- package/dist/fixtures/assessmentScopeFixtures.js +3 -1
- package/dist/formatInsight.d.ts +3 -3
- package/dist/formatInsight.d.ts.map +1 -1
- package/dist/formatInsight.js +0 -9
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/prRiskBand.d.ts +7 -0
- package/dist/prRiskBand.d.ts.map +1 -1
- package/dist/prRiskBand.js +12 -0
- package/dist/prRiskBand.test.js +12 -1
- package/dist/presentation/abi3Expression.test.d.ts +13 -0
- package/dist/presentation/abi3Expression.test.d.ts.map +1 -0
- package/dist/presentation/abi3Expression.test.js +392 -0
- package/dist/presentation/cliParity.test.d.ts +2 -0
- package/dist/presentation/cliParity.test.d.ts.map +1 -0
- package/dist/presentation/cliParity.test.js +49 -0
- package/dist/presentation/compose/narrativeCompose.d.ts +0 -4
- package/dist/presentation/compose/narrativeCompose.d.ts.map +1 -1
- package/dist/presentation/compose/narrativeCompose.js +0 -20
- package/dist/presentation/dto/assessmentPresentationFields.d.ts +4 -0
- package/dist/presentation/dto/assessmentPresentationFields.d.ts.map +1 -1
- package/dist/presentation/index.d.ts +1 -1
- package/dist/presentation/index.d.ts.map +1 -1
- package/dist/presentation/index.js +1 -1
- package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts +1 -0
- package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts.map +1 -1
- package/dist/presentation/orchestration/buildScanPresentationBundle.js +1 -0
- package/dist/presentation/presenters/presentCliScanSummary.d.ts.map +1 -1
- package/dist/presentation/presenters/presentCliScanSummary.js +9 -7
- package/dist/presentation/presenters/presentGitHubCheckRun.d.ts.map +1 -1
- package/dist/presentation/presenters/presentGitHubCheckRun.js +20 -15
- package/dist/presentation/presenters/presentGitHubPrComment.d.ts.map +1 -1
- package/dist/presentation/presenters/presentGitHubPrComment.js +11 -7
- package/dist/presentation/presenters/presentScanDetails.d.ts.map +1 -1
- package/dist/presentation/presenters/presentScanDetails.js +8 -11
- package/dist/presentation/projectAssessmentFields.d.ts.map +1 -1
- package/dist/presentation/projectAssessmentFields.js +6 -0
- package/dist/presentation/surfaceParity.test.js +8 -0
- package/dist/scanResultSchema.d.ts +7 -0
- package/dist/scanResultSchema.d.ts.map +1 -1
- package/dist/scanResultSchema.test.js +2 -0
- package/package.json +1 -1
- package/dist/scanDetailViewModelTypes.d.ts +0 -159
- package/dist/scanDetailViewModelTypes.d.ts.map +0 -1
- package/dist/scanDetailViewModelTypes.js +0 -4
- package/dist/truncateCardSummary.d.ts +0 -5
- package/dist/truncateCardSummary.d.ts.map +0 -1
- package/dist/truncateCardSummary.js +0 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assessmentProjection.d.ts","sourceRoot":"","sources":["../src/assessmentProjection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,UAAU,EACV,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAOhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AAmDlE,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,qBAAqB,GAC/B,mBAAmB,CAIrB;AAED,wBAAgB,+BAA+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AM,EAAE,CAS7E;AAED,wBAAgB,uCAAuC,CACrD,YAAY,EAAE,4BAA4B,EAC1C,MAAM,EAAE,UAAU,GACjB;IAAE,OAAO,EAAE,mBAAmB,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAWnD;AAED,8FAA8F;AAC9F,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,CAErE;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,eAAe,GAC1B,MAAM,GAAG,SAAS,CAWpB;AAED,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,kBAAkB,GACzB,MAAM,CAiDR;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,CAMlE;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,UAAU,GACjB,MAAM,EAAE,CAaV;AAED,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,4BAA4B,EAC1C,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,GACV,MAAM,EAAE,CAWV;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,gBAAgB,GAAG,IAAI,GAAG,MAAM,EAAE,CAI3E"}
|
|
@@ -126,10 +126,12 @@ export function formatAssessmentHeadline(assessment, status) {
|
|
|
126
126
|
return applyPostureVocabularyGuardHeadline(copy.defaultUpgradeHeadline.replace("{package}", primaryPkg), status, primaryPkg);
|
|
127
127
|
}
|
|
128
128
|
export function projectReasoningLines(result) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
// ABI 3: assessment.reasoning is the authoritative source for repository-specific prose
|
|
130
|
+
const fromAssessment = result.assessment?.reasoning?.filter(Boolean) ?? [];
|
|
131
|
+
if (fromAssessment.length > 0)
|
|
132
|
+
return fromAssessment;
|
|
133
|
+
// Fallback for pre-ABI-3 scan results still in the database
|
|
134
|
+
return result.decision?.reasoning?.filter(Boolean) ?? [];
|
|
133
135
|
}
|
|
134
136
|
export function projectInsightLines(assessment, result) {
|
|
135
137
|
const reasoning = projectReasoningLines(result);
|
|
@@ -149,6 +151,11 @@ export function projectInsightLines(assessment, result) {
|
|
|
149
151
|
export function projectVerificationActions(assessment, presentation, result, max) {
|
|
150
152
|
if (presentation.verificationIntensity === "none")
|
|
151
153
|
return [];
|
|
154
|
+
// ABI 3: use actionable prose guidance when present
|
|
155
|
+
const guidance = assessment.verificationScope?.guidance;
|
|
156
|
+
if (guidance && guidance.length > 0)
|
|
157
|
+
return guidance.slice(0, max);
|
|
158
|
+
// Fallback: focus tokens from legacy scope or repoIntelligence
|
|
152
159
|
const { focus } = collectVerificationFocusForPresentation(presentation, result);
|
|
153
160
|
return focus.slice(0, max);
|
|
154
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deriveScanNarrative.d.ts","sourceRoot":"","sources":["../src/deriveScanNarrative.ts"],"names":[],"mappings":"AAYA,OAAO,EAgBL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAMV,UAAU,EACX,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"deriveScanNarrative.d.ts","sourceRoot":"","sources":["../src/deriveScanNarrative.ts"],"names":[],"mappings":"AAYA,OAAO,EAgBL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAMV,UAAU,EACX,MAAM,YAAY,CAAC;AAwiBpB;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GACpC,kBAAkB,CAsIpB"}
|
|
@@ -304,6 +304,10 @@ function guidanceFromRecommendation(rec) {
|
|
|
304
304
|
remediation: rec.impact,
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Legacy insight/finding/recommendation synthesis for narrative availability tiers.
|
|
309
|
+
* Not presentation authority — shared surfaces use assessment expression fields instead.
|
|
310
|
+
*/
|
|
307
311
|
function collectReviewerGuidance(result) {
|
|
308
312
|
const guidance = [];
|
|
309
313
|
const insights = Array.isArray(result.insights) ? result.insights : [];
|
|
@@ -10,8 +10,11 @@ export declare function emptyArtifactGrounded(): ArtifactGroundedVerificationSco
|
|
|
10
10
|
export declare function artifactGroundedScopeFor(packages: string[], focus?: string[], artifactPaths?: string[]): ArtifactGroundedVerificationScope;
|
|
11
11
|
export declare function emptyVerificationScope(): VerificationScope;
|
|
12
12
|
export declare function verificationScopeFor(packages: string[], focus?: string[], artifactGrounded?: ArtifactGroundedVerificationScope): VerificationScope;
|
|
13
|
-
/** Attach focal/scope fields required by assessmentSchema ABI
|
|
14
|
-
export declare function withAssessmentScope(assessment: Omit<Assessment, "reviewFocalPoint" | "reachScope" | "verificationScope"
|
|
13
|
+
/** Attach focal/scope fields required by assessmentSchema ABI 3. */
|
|
14
|
+
export declare function withAssessmentScope(assessment: Omit<Assessment, "reviewFocalPoint" | "reachScope" | "verificationScope" | "reasoning" | "confidenceRationale"> & {
|
|
15
|
+
reasoning?: string[];
|
|
16
|
+
confidenceRationale?: string;
|
|
17
|
+
}, scope: {
|
|
15
18
|
reviewFocalPoint: ReviewFocalPoint;
|
|
16
19
|
reachScope?: ReachScope;
|
|
17
20
|
verificationScope?: VerificationScope;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assessmentScopeFixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/assessmentScopeFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,CAAC,EAAE;IACL,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC,GACA,gBAAgB,CAoBlB;AAED,wBAAgB,eAAe,IAAI,UAAU,CAE5C;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAAE,EAClB,SAAS,GAAE,UAAU,CAAC,WAAW,CAAc,GAC9C,UAAU,CAEZ;AAED,wBAAgB,qBAAqB,IAAI,iCAAiC,CAEzE;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,GAAE,MAAM,EAAO,EACpB,aAAa,GAAE,MAAM,EAAO,GAC3B,iCAAiC,CAEnC;AAED,wBAAgB,sBAAsB,IAAI,iBAAiB,CAM1D;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,GAAE,MAAM,EAAO,EACpB,gBAAgB,GAAE,iCAA2D,GAC5E,iBAAiB,CAEnB;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,IAAI,CACd,UAAU,
|
|
1
|
+
{"version":3,"file":"assessmentScopeFixtures.d.ts","sourceRoot":"","sources":["../../src/fixtures/assessmentScopeFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iCAAiC,EACjC,UAAU,EACV,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,CAAC,EAAE;IACL,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC,GACA,gBAAgB,CAoBlB;AAED,wBAAgB,eAAe,IAAI,UAAU,CAE5C;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAAE,EAClB,SAAS,GAAE,UAAU,CAAC,WAAW,CAAc,GAC9C,UAAU,CAEZ;AAED,wBAAgB,qBAAqB,IAAI,iCAAiC,CAEzE;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,GAAE,MAAM,EAAO,EACpB,aAAa,GAAE,MAAM,EAAO,GAC3B,iCAAiC,CAEnC;AAED,wBAAgB,sBAAsB,IAAI,iBAAiB,CAM1D;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,GAAE,MAAM,EAAO,EACpB,gBAAgB,GAAE,iCAA2D,GAC5E,iBAAiB,CAEnB;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,IAAI,CACd,UAAU,EACR,kBAAkB,GAClB,YAAY,GACZ,mBAAmB,GACnB,WAAW,GACX,qBAAqB,CACxB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAAE,EAC1D,KAAK,EAAE;IACL,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC,GACA,UAAU,CASZ"}
|
|
@@ -41,9 +41,11 @@ export function emptyVerificationScope() {
|
|
|
41
41
|
export function verificationScopeFor(packages, focus = [], artifactGrounded = emptyArtifactGrounded()) {
|
|
42
42
|
return { packages, focus, artifactGrounded };
|
|
43
43
|
}
|
|
44
|
-
/** Attach focal/scope fields required by assessmentSchema ABI
|
|
44
|
+
/** Attach focal/scope fields required by assessmentSchema ABI 3. */
|
|
45
45
|
export function withAssessmentScope(assessment, scope) {
|
|
46
46
|
return {
|
|
47
|
+
reasoning: [],
|
|
48
|
+
confidenceRationale: "",
|
|
47
49
|
...assessment,
|
|
48
50
|
reviewFocalPoint: scope.reviewFocalPoint,
|
|
49
51
|
reachScope: scope.reachScope ?? emptyReachScope(),
|
package/dist/formatInsight.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { PRInsight, PRDecision
|
|
2
|
-
|
|
1
|
+
import type { PRInsight, PRDecision } from "./types.js";
|
|
2
|
+
type FormattedInsight = {
|
|
3
3
|
message: string;
|
|
4
4
|
where: string;
|
|
5
5
|
action: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function decisionTitle(recommendation: PRDecisionRecommendation): string;
|
|
8
7
|
export declare function formatInsight(insight: PRInsight): FormattedInsight;
|
|
9
8
|
/** Legacy markdown renderer for raw PR insights (format-only; no bundle inference). */
|
|
10
9
|
export declare function renderInsightsAsMarkdown(insights: PRInsight[], decision: PRDecision): string;
|
|
10
|
+
export {};
|
|
11
11
|
//# sourceMappingURL=formatInsight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatInsight.d.ts","sourceRoot":"","sources":["../src/formatInsight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"formatInsight.d.ts","sourceRoot":"","sources":["../src/formatInsight.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxD,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgBF,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"}
|
package/dist/formatInsight.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { MERGE_POSTURE_LABEL } from "./riskVocabulary.js";
|
|
2
|
-
const DECISION_TITLES = {
|
|
3
|
-
safe: "No significant dependency risks detected",
|
|
4
|
-
needs_review: "Elevated dependency merge risk",
|
|
5
|
-
risky: "Merge blocked - critical dependency risk",
|
|
6
|
-
};
|
|
7
|
-
// Title rendered once per PR comment, not per insight
|
|
8
|
-
export function decisionTitle(recommendation) {
|
|
9
|
-
return DECISION_TITLES[recommendation];
|
|
10
|
-
}
|
|
11
2
|
/**
|
|
12
3
|
* Normalizes typographic punctuation to ASCII equivalents so that LLM output
|
|
13
4
|
* renders consistently across PR comments, the web UI, and CLI output.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
2
|
export * from "./assessmentLabels.js";
|
|
3
3
|
export * from "./assessmentProjection.js";
|
|
4
|
-
export * from "./formatInsight.js";
|
|
5
4
|
export * from "./riskVocabulary.js";
|
|
6
5
|
export * from "./selectTopAffectedAreas.js";
|
|
7
6
|
export * from "./cardSummaryCopy.js";
|
|
8
|
-
export * from "./truncateCardSummary.js";
|
|
9
7
|
export * from "./formatCardAreaLabels.js";
|
|
10
8
|
export * from "./prRiskBand.js";
|
|
11
9
|
export * from "./prRiskWire.js";
|
|
@@ -20,7 +18,6 @@ export * from "./extractRepositoryContextFacts.js";
|
|
|
20
18
|
export * from "./narrativePresentation.js";
|
|
21
19
|
export * from "./normalizeGeneratedText.js";
|
|
22
20
|
export { presentGitHubPrCommentMarkdownFromResult } from "./presentGitHubPrComment.js";
|
|
23
|
-
export * from "./scanDetailViewModelTypes.js";
|
|
24
21
|
export * from "./scanCardPresentationState.js";
|
|
25
22
|
export * from "./scanResultSchema.js";
|
|
26
23
|
export * from "./scanSurfaceCopy.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,wCAAwC,EAAE,MAAM,6BAA6B,CAAC;AACvF,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,cAAc,EACd,yBAAyB,GAC1B,MAAM,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
2
|
export * from "./assessmentLabels.js";
|
|
3
3
|
export * from "./assessmentProjection.js";
|
|
4
|
-
export * from "./formatInsight.js";
|
|
5
4
|
export * from "./riskVocabulary.js";
|
|
6
5
|
export * from "./selectTopAffectedAreas.js";
|
|
7
6
|
export * from "./cardSummaryCopy.js";
|
|
8
|
-
export * from "./truncateCardSummary.js";
|
|
9
7
|
export * from "./formatCardAreaLabels.js";
|
|
10
8
|
export * from "./prRiskBand.js";
|
|
11
9
|
export * from "./prRiskWire.js";
|
|
@@ -20,7 +18,6 @@ export * from "./extractRepositoryContextFacts.js";
|
|
|
20
18
|
export * from "./narrativePresentation.js";
|
|
21
19
|
export * from "./normalizeGeneratedText.js";
|
|
22
20
|
export { presentGitHubPrCommentMarkdownFromResult } from "./presentGitHubPrComment.js";
|
|
23
|
-
export * from "./scanDetailViewModelTypes.js";
|
|
24
21
|
export * from "./scanCardPresentationState.js";
|
|
25
22
|
export * from "./scanResultSchema.js";
|
|
26
23
|
export * from "./scanSurfaceCopy.js";
|
package/dist/prRiskBand.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ScanNarrativeFacts } from "./scanNarrativeFacts.js";
|
|
1
2
|
/**
|
|
2
3
|
* Canonical PR Risk band contract — sole authority for PR Risk band derivation.
|
|
3
4
|
* Independent from legacy exposure presentation and merge verdict (`assessment.posture`).
|
|
@@ -18,6 +19,12 @@ export declare function scoreToBandLabel(score: number | null | undefined): stri
|
|
|
18
19
|
export declare function prRiskBandLabel(band: PrRiskBand): string;
|
|
19
20
|
/** Fragment for composite aria labels on PR surfaces. */
|
|
20
21
|
export declare function prRiskBandAriaFragment(score: number | null | undefined): string | null;
|
|
22
|
+
export type PrRiskSummary = {
|
|
23
|
+
prRiskScore: number;
|
|
24
|
+
prRiskBandLabel: string;
|
|
25
|
+
};
|
|
26
|
+
/** Format PR Risk score + band from narrative facts (not assessment projection). */
|
|
27
|
+
export declare function formatPrRiskSummary(facts: Pick<ScanNarrativeFacts, "riskSignals" | "riskIndex">): PrRiskSummary | undefined;
|
|
21
28
|
/** Project 5-band PR Risk to 3-bucket scan-detail gauge band. */
|
|
22
29
|
export declare function prRiskBandToGaugeBand(band: PrRiskBand): PrRiskGaugeBand;
|
|
23
30
|
//# sourceMappingURL=prRiskBand.d.ts.map
|
package/dist/prRiskBand.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prRiskBand.d.ts","sourceRoot":"","sources":["../src/prRiskBand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,gBAAgB,EAAG,GAAY,CAAC;AAE7C,iEAAiE;AACjE,eAAO,MAAM,uBAAuB,gCAAiC,CAAC;AAEtE,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAU7E,oDAAoD;AACpD,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAMhD,CAAC;AAUF,mEAAmE;AACnE,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC;AAO1D,wDAAwD;AACxD,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,UAAU,GAAG,IAAI,CAKnB;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI,CAGf;AAED,yCAAyC;AACzC,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAExD;AAED,yDAAyD;AACzD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,IAAI,CAIf;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAIvE"}
|
|
1
|
+
{"version":3,"file":"prRiskBand.d.ts","sourceRoot":"","sources":["../src/prRisk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,18 @@ export function prRiskBandAriaFragment(score) {
|
|
|
56
56
|
return null;
|
|
57
57
|
return `PR Risk: ${label}`;
|
|
58
58
|
}
|
|
59
|
+
/** Format PR Risk score + band from narrative facts (not assessment projection). */
|
|
60
|
+
export function formatPrRiskSummary(facts) {
|
|
61
|
+
const prRiskScore = facts.riskSignals?.riskIndex;
|
|
62
|
+
if (prRiskScore == null || !Number.isFinite(prRiskScore))
|
|
63
|
+
return undefined;
|
|
64
|
+
const prRiskBandLabelText = facts.riskSignals?.band != null
|
|
65
|
+
? prRiskBandLabel(facts.riskSignals.band)
|
|
66
|
+
: scoreToBandLabel(prRiskScore);
|
|
67
|
+
if (!prRiskBandLabelText)
|
|
68
|
+
return undefined;
|
|
69
|
+
return { prRiskScore, prRiskBandLabel: prRiskBandLabelText };
|
|
70
|
+
}
|
|
59
71
|
/** Project 5-band PR Risk to 3-bucket scan-detail gauge band. */
|
|
60
72
|
export function prRiskBandToGaugeBand(band) {
|
|
61
73
|
if (band === "critical" || band === "high")
|
package/dist/prRiskBand.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { PR_RISK_BAND_ABI, PR_RISK_BAND_THRESHOLDS, prRiskBandAriaFragment, prRiskBandLabel, prRiskBandToGaugeBand, scoreToBand, scoreToBandLabel, } from "./prRiskBand.js";
|
|
2
|
+
import { PR_RISK_BAND_ABI, PR_RISK_BAND_THRESHOLDS, formatPrRiskSummary, prRiskBandAriaFragment, prRiskBandLabel, prRiskBandToGaugeBand, scoreToBand, scoreToBandLabel, } from "./prRiskBand.js";
|
|
3
3
|
describe("PR_RISK_BAND_ABI", () => {
|
|
4
4
|
it("is stable v1", () => {
|
|
5
5
|
expect(PR_RISK_BAND_ABI).toBe("1");
|
|
@@ -46,6 +46,17 @@ describe("prRiskBandAriaFragment", () => {
|
|
|
46
46
|
expect(prRiskBandAriaFragment(55)).toBe("PR Risk: Medium");
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
|
+
describe("formatPrRiskSummary", () => {
|
|
50
|
+
it("returns score and band label from riskSignals", () => {
|
|
51
|
+
expect(formatPrRiskSummary({
|
|
52
|
+
riskSignals: { riskIndex: 55, band: "medium", layers: [] },
|
|
53
|
+
riskIndex: 55,
|
|
54
|
+
})).toEqual({ prRiskScore: 55, prRiskBandLabel: "Medium" });
|
|
55
|
+
});
|
|
56
|
+
it("returns undefined when risk index is missing", () => {
|
|
57
|
+
expect(formatPrRiskSummary({ riskSignals: null, riskIndex: null })).toBeUndefined();
|
|
58
|
+
});
|
|
59
|
+
});
|
|
49
60
|
describe("prRiskBandToGaugeBand", () => {
|
|
50
61
|
it("projects to three gauge buckets", () => {
|
|
51
62
|
expect(prRiskBandToGaugeBand("very_low")).toBe("low");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wave 2.D — ABI 3 expression validation.
|
|
3
|
+
*
|
|
4
|
+
* Validates that:
|
|
5
|
+
* 1. projectReasoningLines reads from assessment.reasoning (ABI 3) when present
|
|
6
|
+
* 2. projectVerificationActions returns assessment.verificationScope.guidance when present
|
|
7
|
+
* 3. PR comment includes reviewFocalPoint.electionSummary when present
|
|
8
|
+
* 4. Check run "Why" section uses assessment.reasoning lines directly
|
|
9
|
+
* 5. No prohibited vocabulary appears in rendered surfaces
|
|
10
|
+
* 6. assessment.reasoning takes priority over decision.reasoning
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=abi3Expression.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abi3Expression.test.d.ts","sourceRoot":"","sources":["../../src/presentation/abi3Expression.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|