@lsctech/polaris 0.5.10 → 0.5.11
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.
|
@@ -16,7 +16,7 @@ function pickString(...candidates) {
|
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
}
|
|
19
|
-
const FINDING_LOCATION_KEYS = ["file", "filePath", "path"];
|
|
19
|
+
const FINDING_LOCATION_KEYS = ["file", "filePath", "path", "fileName"];
|
|
20
20
|
const FINDING_CONTENT_KEYS = [
|
|
21
21
|
"message",
|
|
22
22
|
"title",
|
|
@@ -26,6 +26,7 @@ const FINDING_CONTENT_KEYS = [
|
|
|
26
26
|
"suggestion",
|
|
27
27
|
"suggestedAction",
|
|
28
28
|
"fix",
|
|
29
|
+
"codegenInstructions",
|
|
29
30
|
];
|
|
30
31
|
const FINDING_BOOKKEEPING_KEYS = [
|
|
31
32
|
"severity",
|
|
@@ -250,6 +251,7 @@ function parseReport(output, format, parser) {
|
|
|
250
251
|
let progressLineCount = 0;
|
|
251
252
|
let unusableLineCount = 0;
|
|
252
253
|
let parsedLineCount = 0;
|
|
254
|
+
let sawExplicitSkip = false;
|
|
253
255
|
for (const line of lines) {
|
|
254
256
|
try {
|
|
255
257
|
const parsed = JSON.parse(line);
|
|
@@ -258,6 +260,9 @@ function parseReport(output, format, parser) {
|
|
|
258
260
|
continue;
|
|
259
261
|
}
|
|
260
262
|
const record = parsed;
|
|
263
|
+
if (record.type === "complete" && record.status === "review_skipped") {
|
|
264
|
+
sawExplicitSkip = true;
|
|
265
|
+
}
|
|
261
266
|
if (isProgressRecord(record)) {
|
|
262
267
|
progressLineCount++;
|
|
263
268
|
continue;
|
|
@@ -276,6 +281,9 @@ function parseReport(output, format, parser) {
|
|
|
276
281
|
if (lineFindings.length > 0) {
|
|
277
282
|
return { findings: lineFindings };
|
|
278
283
|
}
|
|
284
|
+
if (sawExplicitSkip) {
|
|
285
|
+
return { findings: [] };
|
|
286
|
+
}
|
|
279
287
|
if (progressLineCount > 0 || unusableLineCount > 0) {
|
|
280
288
|
throw makeUnusableOutputError(`CodeRabbit output contained only progress/status/heartbeat and bookkeeping records (${progressLineCount + unusableLineCount} lines)`);
|
|
281
289
|
}
|
|
@@ -288,9 +296,9 @@ function normalizeFinding(raw, index) {
|
|
|
288
296
|
const severityLabel = pickString(raw.severity, raw.level) ?? "info";
|
|
289
297
|
const severity = (0, severity_js_1.normalizeSeverity)(severityLabel);
|
|
290
298
|
const title = pickString(raw.title, raw.summary, raw.rule, raw.type, raw.category) ?? `Finding #${index + 1}`;
|
|
291
|
-
const message = pickString(raw.message, raw.description, raw.body);
|
|
292
|
-
const filePath = pickString(raw.file, raw.filePath, raw.path);
|
|
293
|
-
const suggestedAction = pickString(raw.suggestion, raw.suggestedAction, raw.fix);
|
|
299
|
+
const message = pickString(raw.message, raw.description, raw.body, raw.codegenInstructions);
|
|
300
|
+
const filePath = pickString(raw.file, raw.filePath, raw.path, raw.fileName);
|
|
301
|
+
const suggestedAction = pickString(raw.suggestion, raw.suggestedAction, raw.fix, ...(Array.isArray(raw.suggestions) ? raw.suggestions : []));
|
|
294
302
|
const providerFindingId = pickString(raw.providerFindingId, raw.id, raw.findingId);
|
|
295
303
|
const confidence = coerceNumber(raw.confidence);
|
|
296
304
|
const attribution = {
|
|
@@ -298,7 +306,10 @@ function normalizeFinding(raw, index) {
|
|
|
298
306
|
reason: "provider-uncertain",
|
|
299
307
|
filePath,
|
|
300
308
|
};
|
|
301
|
-
const fixAvailable = raw.fixAvailable === true ||
|
|
309
|
+
const fixAvailable = raw.fixAvailable === true ||
|
|
310
|
+
raw.autofixEligible === true ||
|
|
311
|
+
Boolean(raw.fix) ||
|
|
312
|
+
Boolean(raw.codegenInstructions);
|
|
302
313
|
return {
|
|
303
314
|
findingId: `coderabbit-${index + 1}-${Date.now()}`,
|
|
304
315
|
...(providerFindingId ? { providerFindingId } : {}),
|