@scoutflo/alert-correlation 0.3.0 → 0.4.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/README.md
CHANGED
|
@@ -14,7 +14,13 @@ This package consumes core entity, fact, and status primitives where safe. It al
|
|
|
14
14
|
|
|
15
15
|
## Version
|
|
16
16
|
|
|
17
|
-
Current package version: `0.
|
|
17
|
+
Current package version: `0.4.0`.
|
|
18
|
+
|
|
19
|
+
`0.4.0` exact-pins `@scoutflo/correlation-core@0.2.0` and re-exports
|
|
20
|
+
the new core contract framework surface. The matcher-coupled
|
|
21
|
+
`CorrelationCandidate` / `CorrelationEvidence` / `AlertCorrelationDecision`
|
|
22
|
+
legacy shapes are intentionally unchanged until the contract-driven matcher
|
|
23
|
+
work.
|
|
18
24
|
|
|
19
25
|
Gateway and Voyager should consume the exact published version:
|
|
20
26
|
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const ALERT_CORRELATION_PACKAGE = "@scoutflo/alert-correlation";
|
|
2
2
|
export * as correlationCore from '@scoutflo/correlation-core';
|
|
3
|
+
export { confidenceSchema, correlationEvidenceSchema, correlationFactSchema, createCorrelationContractRegistry, CorrelationContractRegistry, } from '@scoutflo/correlation-core';
|
|
4
|
+
export type { Confidence, CorrelationContract, CorrelationFact, CorrelationEvidence as CoreCorrelationEvidence, CorrelationProjector, CorrelationProjectorInput, CorrelationView, EndpointSpec, MatchKey, } from '@scoutflo/correlation-core';
|
|
3
5
|
export * from './contracts/alertRef';
|
|
4
6
|
export * from './contracts/alertEvidence';
|
|
5
7
|
export * from './contracts/facts';
|
package/dist/src/index.js
CHANGED
|
@@ -36,9 +36,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.correlationCore = exports.ALERT_CORRELATION_PACKAGE = void 0;
|
|
39
|
+
exports.CorrelationContractRegistry = exports.createCorrelationContractRegistry = exports.correlationFactSchema = exports.correlationEvidenceSchema = exports.confidenceSchema = exports.correlationCore = exports.ALERT_CORRELATION_PACKAGE = void 0;
|
|
40
40
|
exports.ALERT_CORRELATION_PACKAGE = '@scoutflo/alert-correlation';
|
|
41
41
|
exports.correlationCore = __importStar(require("@scoutflo/correlation-core"));
|
|
42
|
+
var correlation_core_1 = require("@scoutflo/correlation-core");
|
|
43
|
+
Object.defineProperty(exports, "confidenceSchema", { enumerable: true, get: function () { return correlation_core_1.confidenceSchema; } });
|
|
44
|
+
Object.defineProperty(exports, "correlationEvidenceSchema", { enumerable: true, get: function () { return correlation_core_1.correlationEvidenceSchema; } });
|
|
45
|
+
Object.defineProperty(exports, "correlationFactSchema", { enumerable: true, get: function () { return correlation_core_1.correlationFactSchema; } });
|
|
46
|
+
Object.defineProperty(exports, "createCorrelationContractRegistry", { enumerable: true, get: function () { return correlation_core_1.createCorrelationContractRegistry; } });
|
|
47
|
+
Object.defineProperty(exports, "CorrelationContractRegistry", { enumerable: true, get: function () { return correlation_core_1.CorrelationContractRegistry; } });
|
|
42
48
|
__exportStar(require("./contracts/alertRef"), exports);
|
|
43
49
|
__exportStar(require("./contracts/alertEvidence"), exports);
|
|
44
50
|
__exportStar(require("./contracts/facts"), exports);
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAa,QAAA,yBAAyB,GAAG,6BAA6B,CAAC;AAEvE,8EAA8D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAa,QAAA,yBAAyB,GAAG,6BAA6B,CAAC;AAEvE,8EAA8D;AAC9D,+DAMoC;AALlC,oHAAA,gBAAgB,OAAA;AAChB,6HAAA,yBAAyB,OAAA;AACzB,yHAAA,qBAAqB,OAAA;AACrB,qIAAA,iCAAiC,OAAA;AACjC,+HAAA,2BAA2B,OAAA;AAc7B,uDAAqC;AACrC,4DAA0C;AAC1C,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC;AACrC,sDAAoC;AACpC,4DAA0C;AAC1C,qDAAmC;AACnC,gEAA8C;AAC9C,mEAAiD;AACjD,+DAA6C;AAC7C,wEAAsD;AACtD,wDAAsC;AACtC,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,yEAAuD;AACvD,4DAA0C"}
|
|
@@ -47,4 +47,41 @@ const src_1 = require("../src");
|
|
|
47
47
|
strict_1.default.equal(decision.confidence, 10);
|
|
48
48
|
strict_1.default.deepEqual(decision.target, { type: 'service', id: 'svc-checkout' });
|
|
49
49
|
});
|
|
50
|
+
(0, node_test_1.default)('re-exports the new core contract surface without changing matcher-coupled decisions', () => {
|
|
51
|
+
const projector = ({ attributes }) => ({
|
|
52
|
+
contract_key: 'k8s_workload_monitored_by_prometheus_compatible',
|
|
53
|
+
contract_version: 'v1',
|
|
54
|
+
workload_name: attributes.workload_name,
|
|
55
|
+
});
|
|
56
|
+
const contract = {
|
|
57
|
+
contract_key: 'k8s_workload_monitored_by_prometheus_compatible',
|
|
58
|
+
contract_version: 'v1',
|
|
59
|
+
relation: 'MONITORED_BY',
|
|
60
|
+
relation_class: 'associative',
|
|
61
|
+
source_endpoint: { entity_type: 'resource', resource_type: 'kubernetes_deployment' },
|
|
62
|
+
target_endpoint: { entity_type: 'service' },
|
|
63
|
+
project: projector,
|
|
64
|
+
};
|
|
65
|
+
const registry = (0, src_1.createCorrelationContractRegistry)();
|
|
66
|
+
registry.register(contract);
|
|
67
|
+
const fact = src_1.correlationFactSchema.parse({
|
|
68
|
+
key: 'namespace',
|
|
69
|
+
value: 'prod-demo',
|
|
70
|
+
namespace: 'kubernetes',
|
|
71
|
+
provider: 'prometheus',
|
|
72
|
+
sourcePath: 'labels.namespace',
|
|
73
|
+
confidence: 1,
|
|
74
|
+
kind: 'label',
|
|
75
|
+
});
|
|
76
|
+
const evidence = src_1.correlationEvidenceSchema.parse({
|
|
77
|
+
type: 'relationship_attribute',
|
|
78
|
+
ref: 'rel-1',
|
|
79
|
+
provider: 'prometheus',
|
|
80
|
+
observedAt: '2026-06-20T08:30:00.000Z',
|
|
81
|
+
facts: [fact],
|
|
82
|
+
});
|
|
83
|
+
strict_1.default.equal(registry.get(contract.contract_key, contract.contract_version), contract);
|
|
84
|
+
strict_1.default.equal(fact.namespace, 'kubernetes');
|
|
85
|
+
strict_1.default.equal(evidence.provider, 'prometheus');
|
|
86
|
+
});
|
|
50
87
|
//# sourceMappingURL=core-compatibility.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-compatibility.test.js","sourceRoot":"","sources":["../../test/core-compatibility.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,0DAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"core-compatibility.test.js","sourceRoot":"","sources":["../../test/core-compatibility.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,0DAA6B;AAC7B,gCAYgB;AAEhB,IAAA,mBAAI,EAAC,yCAAyC,EAAE,GAAG,EAAE;IACnD,MAAM,IAAI,GAAS;QACjB,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,UAAU;QACjB,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,OAAO;KACd,CAAC;IAEF,MAAM,MAAM,GAAG,qBAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEjE,gBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACpC,gBAAM,C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C,gBAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scoutflo/alert-correlation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Pure alert-to-topology correlation contracts and policies for Scoutflo alert investigation workflows.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"author": "Scoutflo",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@scoutflo/correlation-core": "0.
|
|
22
|
+
"@scoutflo/correlation-core": "0.2.0",
|
|
23
23
|
"zod": "^3.23.8"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|