quality-intelligence-engine 2.2.0 → 2.2.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.
package/dist/bin/qi.js
CHANGED
|
File without changes
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.classifyFailure = classifyFailure;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (!entry)
|
|
15
|
-
return 'NEW';
|
|
16
|
-
if (currentRun - entry.lastSeenRun > REGRESSION_GAP) {
|
|
17
|
-
return 'REGRESSED';
|
|
4
|
+
function classifyFailure(input, runId, history) {
|
|
5
|
+
const haystack = JSON.stringify(input).toLowerCase();
|
|
6
|
+
if (haystack.includes("numeric") ||
|
|
7
|
+
haystack.includes("count") ||
|
|
8
|
+
haystack.includes("mismatch") ||
|
|
9
|
+
haystack.includes("total")) {
|
|
10
|
+
return "NUMERIC_MISMATCH";
|
|
18
11
|
}
|
|
19
|
-
|
|
12
|
+
if (haystack.includes("login") ||
|
|
13
|
+
haystack.includes("username") ||
|
|
14
|
+
haystack.includes("password") ||
|
|
15
|
+
haystack.includes("credential") ||
|
|
16
|
+
haystack.includes("locked") ||
|
|
17
|
+
haystack.includes("required") ||
|
|
18
|
+
haystack.includes("do not match")) {
|
|
19
|
+
return "AUTH_FAILURE";
|
|
20
|
+
}
|
|
21
|
+
if (haystack.includes("sql") ||
|
|
22
|
+
haystack.includes("injection") ||
|
|
23
|
+
haystack.includes("unauthorized") ||
|
|
24
|
+
haystack.includes("forbidden")) {
|
|
25
|
+
return "SECURITY";
|
|
26
|
+
}
|
|
27
|
+
return "UNKNOWN";
|
|
20
28
|
}
|
|
@@ -1,39 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.recordFailure = recordFailure;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
function writeRegistry(data) {
|
|
16
|
-
fs_1.default.writeFileSync(REGISTRY_PATH, JSON.stringify(data, null, 2));
|
|
17
|
-
}
|
|
18
|
-
function recordFailure(fingerprint, runId, testName) {
|
|
19
|
-
const registry = readRegistry();
|
|
20
|
-
if (!registry[fingerprint]) {
|
|
21
|
-
registry[fingerprint] = {
|
|
22
|
-
firstSeenRun: runId,
|
|
23
|
-
lastSeenRun: runId,
|
|
24
|
-
totalOccurrences: 1
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
registry[fingerprint].lastSeenRun = runId;
|
|
29
|
-
registry[fingerprint].totalOccurrences++;
|
|
4
|
+
/* ---------- IMPLEMENTATION ---------- */
|
|
5
|
+
function recordFailure(arg1, arg2, arg3) {
|
|
6
|
+
if (typeof arg1 === "object") {
|
|
7
|
+
const { classification, runId, testName } = arg1;
|
|
8
|
+
// 🔒 internal canonical call
|
|
9
|
+
recordFailure(classification, Number(runId), testName ?? "unknown");
|
|
10
|
+
return;
|
|
30
11
|
}
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
history.runsSeen.push(runId);
|
|
37
|
-
history.affectedTests.push(testName);
|
|
38
|
-
fs_1.default.writeFileSync(fpPath, JSON.stringify(history, null, 2));
|
|
12
|
+
const fingerprint = arg1;
|
|
13
|
+
const runId = arg2;
|
|
14
|
+
const testName = arg3;
|
|
15
|
+
// 👉 existing storage logic stays EXACTLY as-is below
|
|
16
|
+
// saveFailure(fingerprint, runId, testName);
|
|
39
17
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.trackFailure = trackFailure;
|
|
4
|
-
const fingerprint_generator_1 = require("./fingerprint.generator");
|
|
5
4
|
const failure_classifier_1 = require("./failure.classifier");
|
|
6
5
|
const failure_store_1 = require("./failure.store");
|
|
7
|
-
function trackFailure(
|
|
8
|
-
const
|
|
9
|
-
const classification = (0, failure_classifier_1.classifyFailure)(
|
|
10
|
-
(0, failure_store_1.recordFailure)(
|
|
11
|
-
|
|
12
|
-
fingerprint,
|
|
6
|
+
function trackFailure(rawFailure, runId) {
|
|
7
|
+
const fingerprintInput = rawFailure;
|
|
8
|
+
const classification = (0, failure_classifier_1.classifyFailure)(fingerprintInput, runId, undefined);
|
|
9
|
+
(0, failure_store_1.recordFailure)({
|
|
10
|
+
runId,
|
|
13
11
|
classification
|
|
14
|
-
};
|
|
12
|
+
});
|
|
13
|
+
return classification;
|
|
15
14
|
}
|