quality-intelligence-engine 2.2.4 → 2.2.6
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.
|
@@ -22,8 +22,20 @@ function groupFailures(results) {
|
|
|
22
22
|
dominantCount = count;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
/* ===============================
|
|
26
|
+
🔒 FALLBACK ENFORCEMENT (CRITICAL)
|
|
27
|
+
=============================== */
|
|
28
|
+
if (results.length === 0) {
|
|
29
|
+
groupedCounts["UNCLASSIFIED_FAILURE"] = 1;
|
|
30
|
+
dominantCategory = "UNCLASSIFIED_FAILURE";
|
|
31
|
+
dominantCount = 1;
|
|
32
|
+
}
|
|
33
|
+
const total = Math.max(1, results.length || dominantCount);
|
|
26
34
|
let confidence = dominantCount / total;
|
|
35
|
+
// Ensure non-zero confidence for real failures
|
|
36
|
+
if (dominantCategory === "UNCLASSIFIED_FAILURE" && confidence <= 0) {
|
|
37
|
+
confidence = 0.25;
|
|
38
|
+
}
|
|
27
39
|
// 🔻 FLAKY PENALTY (KEY LOGIC)
|
|
28
40
|
if (flakyCount > 0) {
|
|
29
41
|
const penalty = Math.min(0.3, flakyCount / total);
|
package/package.json
CHANGED
|
@@ -27,18 +27,39 @@ export function groupFailures(
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
let dominantCategory = "UNKNOWN";
|
|
31
|
+
let dominantCount = 0;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
for (const [category, count] of Object.entries(groupedCounts)) {
|
|
34
34
|
if (count > dominantCount) {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
dominantCategory = category;
|
|
36
|
+
dominantCount = count;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ===============================
|
|
41
|
+
🔒 FALLBACK ENFORCEMENT (CRITICAL)
|
|
42
|
+
=============================== */
|
|
43
|
+
if (results.length === 0) {
|
|
44
|
+
groupedCounts["UNCLASSIFIED_FAILURE"] = 1;
|
|
45
|
+
dominantCategory = "UNCLASSIFIED_FAILURE";
|
|
46
|
+
dominantCount = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const total = Math.max(1, results.length || dominantCount);
|
|
50
|
+
let confidence = dominantCount / total;
|
|
51
|
+
|
|
52
|
+
// Ensure non-zero confidence for real failures
|
|
53
|
+
if (dominantCategory === "UNCLASSIFIED_FAILURE" && confidence <= 0) {
|
|
54
|
+
confidence = 0.25;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
39
62
|
|
|
40
|
-
const total = results.length || 1;
|
|
41
|
-
let confidence = dominantCount / total;
|
|
42
63
|
|
|
43
64
|
// 🔻 FLAKY PENALTY (KEY LOGIC)
|
|
44
65
|
if (flakyCount > 0) {
|