@healflow/shared 0.1.1 → 0.1.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/README.md +35 -12
- package/dist/config-loader.d.ts +2 -1
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/config-loader.js +15 -0
- package/dist/config-loader.js.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -0
- package/dist/config.js.map +1 -1
- package/dist/domain.d.ts +12 -2
- package/dist/domain.d.ts.map +1 -1
- package/dist/enums.d.ts +77 -2
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +82 -2
- package/dist/enums.js.map +1 -1
- package/dist/healing-matrix/entries.d.ts +3 -0
- package/dist/healing-matrix/entries.d.ts.map +1 -0
- package/dist/healing-matrix/entries.js +52 -0
- package/dist/healing-matrix/entries.js.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/ambiguous-match.d.ts +3 -0
- package/dist/healing-matrix/family-01-locator-selector/ambiguous-match.d.ts.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/ambiguous-match.js +84 -0
- package/dist/healing-matrix/family-01-locator-selector/ambiguous-match.js.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/element-not-found.d.ts +3 -0
- package/dist/healing-matrix/family-01-locator-selector/element-not-found.d.ts.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/element-not-found.js +174 -0
- package/dist/healing-matrix/family-01-locator-selector/element-not-found.js.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/index.d.ts +3 -0
- package/dist/healing-matrix/family-01-locator-selector/index.d.ts.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/index.js +14 -0
- package/dist/healing-matrix/family-01-locator-selector/index.js.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/locator-chain.d.ts +3 -0
- package/dist/healing-matrix/family-01-locator-selector/locator-chain.d.ts.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/locator-chain.js +80 -0
- package/dist/healing-matrix/family-01-locator-selector/locator-chain.js.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/wrong-state.d.ts +3 -0
- package/dist/healing-matrix/family-01-locator-selector/wrong-state.d.ts.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector/wrong-state.js +96 -0
- package/dist/healing-matrix/family-01-locator-selector/wrong-state.js.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector.d.ts +3 -0
- package/dist/healing-matrix/family-01-locator-selector.d.ts.map +1 -0
- package/dist/healing-matrix/family-01-locator-selector.js +413 -0
- package/dist/healing-matrix/family-01-locator-selector.js.map +1 -0
- package/dist/healing-matrix/family-02-timing-sync.d.ts +3 -0
- package/dist/healing-matrix/family-02-timing-sync.d.ts.map +1 -0
- package/dist/healing-matrix/family-02-timing-sync.js +150 -0
- package/dist/healing-matrix/family-02-timing-sync.js.map +1 -0
- package/dist/healing-matrix/family-03-overlay-modal.d.ts +3 -0
- package/dist/healing-matrix/family-03-overlay-modal.d.ts.map +1 -0
- package/dist/healing-matrix/family-03-overlay-modal.js +141 -0
- package/dist/healing-matrix/family-03-overlay-modal.js.map +1 -0
- package/dist/healing-matrix/family-04-navigation-routing.d.ts +3 -0
- package/dist/healing-matrix/family-04-navigation-routing.d.ts.map +1 -0
- package/dist/healing-matrix/family-04-navigation-routing.js +100 -0
- package/dist/healing-matrix/family-04-navigation-routing.js.map +1 -0
- package/dist/healing-matrix/family-05-frame-iframe.d.ts +3 -0
- package/dist/healing-matrix/family-05-frame-iframe.d.ts.map +1 -0
- package/dist/healing-matrix/family-05-frame-iframe.js +103 -0
- package/dist/healing-matrix/family-05-frame-iframe.js.map +1 -0
- package/dist/healing-matrix/family-06-shadow-dom.d.ts +3 -0
- package/dist/healing-matrix/family-06-shadow-dom.d.ts.map +1 -0
- package/dist/healing-matrix/family-06-shadow-dom.js +78 -0
- package/dist/healing-matrix/family-06-shadow-dom.js.map +1 -0
- package/dist/healing-matrix/family-07-auth-session.d.ts +3 -0
- package/dist/healing-matrix/family-07-auth-session.d.ts.map +1 -0
- package/dist/healing-matrix/family-07-auth-session.js +120 -0
- package/dist/healing-matrix/family-07-auth-session.js.map +1 -0
- package/dist/healing-matrix/family-08-network.d.ts +3 -0
- package/dist/healing-matrix/family-08-network.d.ts.map +1 -0
- package/dist/healing-matrix/family-08-network.js +128 -0
- package/dist/healing-matrix/family-08-network.js.map +1 -0
- package/dist/healing-matrix/family-09-api-mocking.d.ts +3 -0
- package/dist/healing-matrix/family-09-api-mocking.d.ts.map +1 -0
- package/dist/healing-matrix/family-09-api-mocking.js +102 -0
- package/dist/healing-matrix/family-09-api-mocking.js.map +1 -0
- package/dist/healing-matrix/family-10-test-data.d.ts +3 -0
- package/dist/healing-matrix/family-10-test-data.d.ts.map +1 -0
- package/dist/healing-matrix/family-10-test-data.js +89 -0
- package/dist/healing-matrix/family-10-test-data.js.map +1 -0
- package/dist/healing-matrix/family-11-environment-config.d.ts +3 -0
- package/dist/healing-matrix/family-11-environment-config.d.ts.map +1 -0
- package/dist/healing-matrix/family-11-environment-config.js +97 -0
- package/dist/healing-matrix/family-11-environment-config.js.map +1 -0
- package/dist/healing-matrix/family-12-browser-infra.d.ts +3 -0
- package/dist/healing-matrix/family-12-browser-infra.d.ts.map +1 -0
- package/dist/healing-matrix/family-12-browser-infra.js +109 -0
- package/dist/healing-matrix/family-12-browser-infra.js.map +1 -0
- package/dist/healing-matrix/family-13-upload-download.d.ts +3 -0
- package/dist/healing-matrix/family-13-upload-download.d.ts.map +1 -0
- package/dist/healing-matrix/family-13-upload-download.js +64 -0
- package/dist/healing-matrix/family-13-upload-download.js.map +1 -0
- package/dist/healing-matrix/family-14-multi-tab.d.ts +3 -0
- package/dist/healing-matrix/family-14-multi-tab.d.ts.map +1 -0
- package/dist/healing-matrix/family-14-multi-tab.js +54 -0
- package/dist/healing-matrix/family-14-multi-tab.js.map +1 -0
- package/dist/healing-matrix/family-15-visual-a11y.d.ts +3 -0
- package/dist/healing-matrix/family-15-visual-a11y.d.ts.map +1 -0
- package/dist/healing-matrix/family-15-visual-a11y.js +81 -0
- package/dist/healing-matrix/family-15-visual-a11y.js.map +1 -0
- package/dist/healing-matrix/family-16-i18n.d.ts +3 -0
- package/dist/healing-matrix/family-16-i18n.d.ts.map +1 -0
- package/dist/healing-matrix/family-16-i18n.js +52 -0
- package/dist/healing-matrix/family-16-i18n.js.map +1 -0
- package/dist/healing-matrix/family-17-mobile-touch.d.ts +3 -0
- package/dist/healing-matrix/family-17-mobile-touch.d.ts.map +1 -0
- package/dist/healing-matrix/family-17-mobile-touch.js +52 -0
- package/dist/healing-matrix/family-17-mobile-touch.js.map +1 -0
- package/dist/healing-matrix/family-18-performance.d.ts +3 -0
- package/dist/healing-matrix/family-18-performance.d.ts.map +1 -0
- package/dist/healing-matrix/family-18-performance.js +54 -0
- package/dist/healing-matrix/family-18-performance.js.map +1 -0
- package/dist/healing-matrix/family-19-third-party.d.ts +3 -0
- package/dist/healing-matrix/family-19-third-party.d.ts.map +1 -0
- package/dist/healing-matrix/family-19-third-party.js +65 -0
- package/dist/healing-matrix/family-19-third-party.js.map +1 -0
- package/dist/healing-matrix/family-20-test-structure.d.ts +3 -0
- package/dist/healing-matrix/family-20-test-structure.d.ts.map +1 -0
- package/dist/healing-matrix/family-20-test-structure.js +78 -0
- package/dist/healing-matrix/family-20-test-structure.js.map +1 -0
- package/dist/healing-matrix/family-21-assertion.d.ts +3 -0
- package/dist/healing-matrix/family-21-assertion.d.ts.map +1 -0
- package/dist/healing-matrix/family-21-assertion.js +88 -0
- package/dist/healing-matrix/family-21-assertion.js.map +1 -0
- package/dist/healing-matrix/family-22-product-defect.d.ts +3 -0
- package/dist/healing-matrix/family-22-product-defect.d.ts.map +1 -0
- package/dist/healing-matrix/family-22-product-defect.js +72 -0
- package/dist/healing-matrix/family-22-product-defect.js.map +1 -0
- package/dist/healing-matrix/family-23-security-compliance.d.ts +3 -0
- package/dist/healing-matrix/family-23-security-compliance.d.ts.map +1 -0
- package/dist/healing-matrix/family-23-security-compliance.js +74 -0
- package/dist/healing-matrix/family-23-security-compliance.js.map +1 -0
- package/dist/healing-matrix/family-summaries.d.ts +3 -0
- package/dist/healing-matrix/family-summaries.d.ts.map +1 -0
- package/dist/healing-matrix/family-summaries.js +224 -0
- package/dist/healing-matrix/family-summaries.js.map +1 -0
- package/dist/healing-matrix/global-hard-stops.d.ts +23 -0
- package/dist/healing-matrix/global-hard-stops.d.ts.map +1 -0
- package/dist/healing-matrix/global-hard-stops.js +19 -0
- package/dist/healing-matrix/global-hard-stops.js.map +1 -0
- package/dist/healing-matrix/helpers.d.ts +6 -0
- package/dist/healing-matrix/helpers.d.ts.map +1 -0
- package/dist/healing-matrix/helpers.js +16 -0
- package/dist/healing-matrix/helpers.js.map +1 -0
- package/dist/healing-matrix/index.d.ts +5 -0
- package/dist/healing-matrix/index.d.ts.map +1 -0
- package/dist/healing-matrix/index.js +14 -0
- package/dist/healing-matrix/index.js.map +1 -0
- package/dist/healing-matrix-types.d.ts +40 -0
- package/dist/healing-matrix-types.d.ts.map +1 -0
- package/dist/healing-matrix-types.js +3 -0
- package/dist/healing-matrix-types.js.map +1 -0
- package/dist/healing-matrix.d.ts +2 -0
- package/dist/healing-matrix.d.ts.map +1 -0
- package/dist/healing-matrix.js +11 -0
- package/dist/healing-matrix.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/matrix-policy.d.ts +30 -0
- package/dist/matrix-policy.d.ts.map +1 -0
- package/dist/matrix-policy.js +168 -0
- package/dist/matrix-policy.js.map +1 -0
- package/dist/policy.d.ts +2 -2
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +19 -2
- package/dist/policy.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { FailureCategory, FailureFamily, HealPath, HealingTechnique, MatrixHealability } from './enums.js';
|
|
2
|
+
/** Single sub-failure row from the healing matrix spec */
|
|
3
|
+
export interface HealingMatrixEntry {
|
|
4
|
+
id: string;
|
|
5
|
+
family: FailureFamily;
|
|
6
|
+
familyNumber: number;
|
|
7
|
+
group: string;
|
|
8
|
+
name: string;
|
|
9
|
+
category: FailureCategory;
|
|
10
|
+
canHeal: MatrixHealability;
|
|
11
|
+
healPath: HealPath | null;
|
|
12
|
+
techniqueStack: HealingTechnique[];
|
|
13
|
+
notHealedReason?: string;
|
|
14
|
+
skippedReason?: string;
|
|
15
|
+
/** Optional regex patterns for sub-failure detection within a category */
|
|
16
|
+
detectionPatterns?: string[];
|
|
17
|
+
}
|
|
18
|
+
/** Summary row for the matrix family overview table */
|
|
19
|
+
export interface HealingMatrixFamilySummary {
|
|
20
|
+
family: FailureFamily;
|
|
21
|
+
familyNumber: number;
|
|
22
|
+
title: string;
|
|
23
|
+
generallyHealable: MatrixHealability;
|
|
24
|
+
primaryTechniques: HealingTechnique[];
|
|
25
|
+
aiTypical: boolean;
|
|
26
|
+
entryCount: number;
|
|
27
|
+
}
|
|
28
|
+
/** Result of matching a failure to a matrix entry */
|
|
29
|
+
export interface MatrixMatchResult {
|
|
30
|
+
entry: HealingMatrixEntry;
|
|
31
|
+
matchedPattern?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Technique attempt audit record */
|
|
34
|
+
export interface TechniqueAttempt {
|
|
35
|
+
technique: HealingTechnique;
|
|
36
|
+
success: boolean;
|
|
37
|
+
reason?: string;
|
|
38
|
+
attemptedAt: string;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=healing-matrix-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healing-matrix-types.d.ts","sourceRoot":"","sources":["../src/healing-matrix-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,uDAAuD;AACvD,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qDAAqD;AACrD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healing-matrix-types.js","sourceRoot":"","sources":["../src/healing-matrix-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healing-matrix.d.ts","sourceRoot":"","sources":["../src/healing-matrix.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,+BAA+B,EAC/B,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMatrixEntriesByCategory = exports.getMatrixEntriesByFamily = exports.getMatrixEntryById = exports.HEALING_MATRIX_FAMILY_SUMMARIES = exports.HEALING_MATRIX_ENTRIES = exports.GLOBAL_HARD_STOPS = void 0;
|
|
4
|
+
var index_js_1 = require("./healing-matrix/index.js");
|
|
5
|
+
Object.defineProperty(exports, "GLOBAL_HARD_STOPS", { enumerable: true, get: function () { return index_js_1.GLOBAL_HARD_STOPS; } });
|
|
6
|
+
Object.defineProperty(exports, "HEALING_MATRIX_ENTRIES", { enumerable: true, get: function () { return index_js_1.HEALING_MATRIX_ENTRIES; } });
|
|
7
|
+
Object.defineProperty(exports, "HEALING_MATRIX_FAMILY_SUMMARIES", { enumerable: true, get: function () { return index_js_1.HEALING_MATRIX_FAMILY_SUMMARIES; } });
|
|
8
|
+
Object.defineProperty(exports, "getMatrixEntryById", { enumerable: true, get: function () { return index_js_1.getMatrixEntryById; } });
|
|
9
|
+
Object.defineProperty(exports, "getMatrixEntriesByFamily", { enumerable: true, get: function () { return index_js_1.getMatrixEntriesByFamily; } });
|
|
10
|
+
Object.defineProperty(exports, "getMatrixEntriesByCategory", { enumerable: true, get: function () { return index_js_1.getMatrixEntriesByCategory; } });
|
|
11
|
+
//# sourceMappingURL=healing-matrix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healing-matrix.js","sourceRoot":"","sources":["../src/healing-matrix.ts"],"names":[],"mappings":";;;AAAA,sDAOmC;AANjC,6GAAA,iBAAiB,OAAA;AACjB,kHAAA,sBAAsB,OAAA;AACtB,2HAAA,+BAA+B,OAAA;AAC/B,8GAAA,kBAAkB,OAAA;AAClB,oHAAA,wBAAwB,OAAA;AACxB,sHAAA,0BAA0B,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export * from './domain.js';
|
|
|
3
3
|
export * from './policy.js';
|
|
4
4
|
export * from './organization-settings.js';
|
|
5
5
|
export * from './healing-rules.js';
|
|
6
|
+
export * from './healing-matrix-types.js';
|
|
7
|
+
export * from './healing-matrix.js';
|
|
8
|
+
export * from './matrix-policy.js';
|
|
6
9
|
export * from './config.js';
|
|
7
10
|
export * from './circuit-breaker.js';
|
|
8
11
|
export * from './events/index.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,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,9 @@ __exportStar(require("./domain.js"), exports);
|
|
|
19
19
|
__exportStar(require("./policy.js"), exports);
|
|
20
20
|
__exportStar(require("./organization-settings.js"), exports);
|
|
21
21
|
__exportStar(require("./healing-rules.js"), exports);
|
|
22
|
+
__exportStar(require("./healing-matrix-types.js"), exports);
|
|
23
|
+
__exportStar(require("./healing-matrix.js"), exports);
|
|
24
|
+
__exportStar(require("./matrix-policy.js"), exports);
|
|
22
25
|
__exportStar(require("./config.js"), exports);
|
|
23
26
|
__exportStar(require("./circuit-breaker.js"), exports);
|
|
24
27
|
__exportStar(require("./events/index.js"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,8CAA4B;AAC5B,6DAA2C;AAC3C,qDAAmC;AACnC,8CAA4B;AAC5B,uDAAqC;AACrC,oDAAkC;AAClC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,8CAA4B;AAC5B,6DAA2C;AAC3C,qDAAmC;AACnC,4DAA0C;AAC1C,sDAAoC;AACpC,qDAAmC;AACnC,8CAA4B;AAC5B,uDAAqC;AACrC,oDAAkC;AAClC,uDAAqC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FailureCategory, HealOutcome, RecommendedAction } from './enums.js';
|
|
2
|
+
import type { ClassificationResult } from './domain.js';
|
|
3
|
+
import { GLOBAL_HARD_STOPS } from './healing-matrix.js';
|
|
4
|
+
import type { HealingMatrixEntry, MatrixMatchResult } from './healing-matrix-types.js';
|
|
5
|
+
export { GLOBAL_HARD_STOPS };
|
|
6
|
+
/** Match failure text to the most specific matrix sub-failure within a category */
|
|
7
|
+
export declare function matchMatrixEntry(haystack: string, category: FailureCategory, subcategory?: string): MatrixMatchResult | null;
|
|
8
|
+
/** Resolve heal outcome from a matrix entry (before org policy) */
|
|
9
|
+
export declare function resolveMatrixOutcome(entry: HealingMatrixEntry): {
|
|
10
|
+
outcome: HealOutcome;
|
|
11
|
+
recommendedAction: RecommendedAction;
|
|
12
|
+
isAutomationFixable: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** Whether runtime healing is allowed for this matrix entry */
|
|
15
|
+
export declare function isRuntimeHealAllowed(entry: HealingMatrixEntry): boolean;
|
|
16
|
+
/** Whether permanent (AST) healing is allowed for this matrix entry */
|
|
17
|
+
export declare function isPermanentHealAllowed(entry: HealingMatrixEntry): boolean;
|
|
18
|
+
/** Enrich classification with matrix metadata */
|
|
19
|
+
export declare function enrichClassificationWithMatrix(classification: ClassificationResult, haystack: string): ClassificationResult;
|
|
20
|
+
/** Matrix entry ids eligible for runtime auto-heal (RUNTIME/BOTH + YES/PARTIAL) */
|
|
21
|
+
export declare function getRuntimeHealableMatrixIds(): string[];
|
|
22
|
+
/** Lookup matrix statistics */
|
|
23
|
+
export declare function getMatrixStats(): {
|
|
24
|
+
totalEntries: number;
|
|
25
|
+
familyCount: number;
|
|
26
|
+
healableCount: number;
|
|
27
|
+
partialCount: number;
|
|
28
|
+
notHealableCount: number;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=matrix-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix-policy.d.ts","sourceRoot":"","sources":["../src/matrix-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,WAAW,EAGX,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,iBAAiB,EAGlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGvF,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,mFAAmF;AACnF,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,eAAe,EACzB,WAAW,CAAC,EAAE,MAAM,GACnB,iBAAiB,GAAG,IAAI,CAiC1B;AAED,mEAAmE;AACnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG;IAC/D,OAAO,EAAE,WAAW,CAAC;IACrB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CA4CA;AAED,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAEvE;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAEzE;AAED,iDAAiD;AACjD,wBAAgB,8BAA8B,CAC5C,cAAc,EAAE,oBAAoB,EACpC,QAAQ,EAAE,MAAM,GACf,oBAAoB,CAoDtB;AAED,mFAAmF;AACnF,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CAMtD;AAED,+BAA+B;AAC/B,wBAAgB,cAAc,IAAI;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAWA"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GLOBAL_HARD_STOPS = void 0;
|
|
4
|
+
exports.matchMatrixEntry = matchMatrixEntry;
|
|
5
|
+
exports.resolveMatrixOutcome = resolveMatrixOutcome;
|
|
6
|
+
exports.isRuntimeHealAllowed = isRuntimeHealAllowed;
|
|
7
|
+
exports.isPermanentHealAllowed = isPermanentHealAllowed;
|
|
8
|
+
exports.enrichClassificationWithMatrix = enrichClassificationWithMatrix;
|
|
9
|
+
exports.getRuntimeHealableMatrixIds = getRuntimeHealableMatrixIds;
|
|
10
|
+
exports.getMatrixStats = getMatrixStats;
|
|
11
|
+
const enums_js_1 = require("./enums.js");
|
|
12
|
+
const healing_matrix_js_1 = require("./healing-matrix.js");
|
|
13
|
+
Object.defineProperty(exports, "GLOBAL_HARD_STOPS", { enumerable: true, get: function () { return healing_matrix_js_1.GLOBAL_HARD_STOPS; } });
|
|
14
|
+
const policy_js_1 = require("./policy.js");
|
|
15
|
+
/** Match failure text to the most specific matrix sub-failure within a category */
|
|
16
|
+
function matchMatrixEntry(haystack, category, subcategory) {
|
|
17
|
+
const candidates = (0, healing_matrix_js_1.getMatrixEntriesByCategory)(category);
|
|
18
|
+
if (candidates.length === 0)
|
|
19
|
+
return null;
|
|
20
|
+
let best = null;
|
|
21
|
+
for (const entry of candidates) {
|
|
22
|
+
if (!entry.detectionPatterns?.length)
|
|
23
|
+
continue;
|
|
24
|
+
for (const pattern of entry.detectionPatterns) {
|
|
25
|
+
try {
|
|
26
|
+
const regex = new RegExp(pattern, 'i');
|
|
27
|
+
if (regex.test(haystack)) {
|
|
28
|
+
const score = pattern.length + (entry.id.includes(subcategory ?? '') ? 10 : 0);
|
|
29
|
+
if (!best || score > best.score) {
|
|
30
|
+
best = { entry, score, pattern };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Skip invalid pattern strings
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (best) {
|
|
40
|
+
return { entry: best.entry, matchedPattern: best.pattern };
|
|
41
|
+
}
|
|
42
|
+
if (subcategory) {
|
|
43
|
+
const bySub = candidates.find((e) => e.id.endsWith(subcategory) || e.id.includes(subcategory));
|
|
44
|
+
if (bySub)
|
|
45
|
+
return { entry: bySub };
|
|
46
|
+
}
|
|
47
|
+
return candidates[0] ? { entry: candidates[0] } : null;
|
|
48
|
+
}
|
|
49
|
+
/** Resolve heal outcome from a matrix entry (before org policy) */
|
|
50
|
+
function resolveMatrixOutcome(entry) {
|
|
51
|
+
switch (entry.canHeal) {
|
|
52
|
+
case enums_js_1.MatrixHealability.NO:
|
|
53
|
+
if (entry.skippedReason) {
|
|
54
|
+
return {
|
|
55
|
+
outcome: enums_js_1.HealOutcome.SKIPPED,
|
|
56
|
+
recommendedAction: enums_js_1.RecommendedAction.NO_ACTION,
|
|
57
|
+
isAutomationFixable: false,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (entry.category === enums_js_1.FailureCategory.PRODUCT_BUG ||
|
|
61
|
+
entry.category === enums_js_1.FailureCategory.ASSERTION) {
|
|
62
|
+
return {
|
|
63
|
+
outcome: enums_js_1.HealOutcome.BLOCKED,
|
|
64
|
+
recommendedAction: enums_js_1.RecommendedAction.INVESTIGATE_PRODUCT,
|
|
65
|
+
isAutomationFixable: false,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (entry.category === enums_js_1.FailureCategory.SECURITY) {
|
|
69
|
+
return {
|
|
70
|
+
outcome: enums_js_1.HealOutcome.SKIPPED,
|
|
71
|
+
recommendedAction: enums_js_1.RecommendedAction.NO_ACTION,
|
|
72
|
+
isAutomationFixable: false,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
outcome: enums_js_1.HealOutcome.DIAGNOSED,
|
|
77
|
+
recommendedAction: enums_js_1.RecommendedAction.MANUAL_FIX,
|
|
78
|
+
isAutomationFixable: false,
|
|
79
|
+
};
|
|
80
|
+
case enums_js_1.MatrixHealability.PARTIAL:
|
|
81
|
+
case enums_js_1.MatrixHealability.YES:
|
|
82
|
+
return {
|
|
83
|
+
outcome: enums_js_1.HealOutcome.HEALED,
|
|
84
|
+
recommendedAction: enums_js_1.RecommendedAction.AUTO_HEAL,
|
|
85
|
+
isAutomationFixable: true,
|
|
86
|
+
};
|
|
87
|
+
default: {
|
|
88
|
+
const _exhaustive = entry.canHeal;
|
|
89
|
+
return _exhaustive;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** Whether runtime healing is allowed for this matrix entry */
|
|
94
|
+
function isRuntimeHealAllowed(entry) {
|
|
95
|
+
return entry.healPath === enums_js_1.HealPath.RUNTIME || entry.healPath === enums_js_1.HealPath.BOTH;
|
|
96
|
+
}
|
|
97
|
+
/** Whether permanent (AST) healing is allowed for this matrix entry */
|
|
98
|
+
function isPermanentHealAllowed(entry) {
|
|
99
|
+
return entry.healPath === enums_js_1.HealPath.PERMANENT || entry.healPath === enums_js_1.HealPath.BOTH;
|
|
100
|
+
}
|
|
101
|
+
/** Enrich classification with matrix metadata */
|
|
102
|
+
function enrichClassificationWithMatrix(classification, haystack) {
|
|
103
|
+
const match = matchMatrixEntry(haystack, classification.category, classification.subcategory);
|
|
104
|
+
if (!match)
|
|
105
|
+
return classification;
|
|
106
|
+
const { entry } = match;
|
|
107
|
+
const matrixOutcome = resolveMatrixOutcome(entry);
|
|
108
|
+
let healOutcome = classification.healOutcome ?? matrixOutcome.outcome;
|
|
109
|
+
let recommendedAction = classification.recommendedAction ?? matrixOutcome.recommendedAction;
|
|
110
|
+
let isAutomationFixable = matrixOutcome.isAutomationFixable && classification.isAutomationFixable;
|
|
111
|
+
if (policy_js_1.DIAGNOSE_ONLY_CATEGORIES.has(classification.category) ||
|
|
112
|
+
policy_js_1.BLOCKED_CATEGORIES.has(classification.category)) {
|
|
113
|
+
const policy = (0, policy_js_1.resolveFailureOutcome)(classification);
|
|
114
|
+
healOutcome = policy.outcome;
|
|
115
|
+
recommendedAction = policy.recommendedAction;
|
|
116
|
+
isAutomationFixable = false;
|
|
117
|
+
}
|
|
118
|
+
else if (entry.canHeal === enums_js_1.MatrixHealability.NO && entry.skippedReason) {
|
|
119
|
+
healOutcome = enums_js_1.HealOutcome.SKIPPED;
|
|
120
|
+
recommendedAction = enums_js_1.RecommendedAction.NO_ACTION;
|
|
121
|
+
isAutomationFixable = false;
|
|
122
|
+
}
|
|
123
|
+
else if (entry.canHeal === enums_js_1.MatrixHealability.NO) {
|
|
124
|
+
healOutcome =
|
|
125
|
+
classification.category === enums_js_1.FailureCategory.SECURITY
|
|
126
|
+
? enums_js_1.HealOutcome.SKIPPED
|
|
127
|
+
: enums_js_1.HealOutcome.DIAGNOSED;
|
|
128
|
+
isAutomationFixable = false;
|
|
129
|
+
}
|
|
130
|
+
const merged = {
|
|
131
|
+
...classification,
|
|
132
|
+
subcategory: entry.id,
|
|
133
|
+
matrixEntryId: entry.id,
|
|
134
|
+
matrixFamily: entry.family,
|
|
135
|
+
techniqueStack: entry.techniqueStack,
|
|
136
|
+
healPath: entry.healPath ?? undefined,
|
|
137
|
+
skipReason: entry.skippedReason,
|
|
138
|
+
notHealedReason: entry.notHealedReason,
|
|
139
|
+
isAutomationFixable,
|
|
140
|
+
healOutcome,
|
|
141
|
+
recommendedAction,
|
|
142
|
+
};
|
|
143
|
+
if (classification.isProductBug) {
|
|
144
|
+
merged.healOutcome = enums_js_1.HealOutcome.BLOCKED;
|
|
145
|
+
merged.recommendedAction = enums_js_1.RecommendedAction.INVESTIGATE_PRODUCT;
|
|
146
|
+
merged.isAutomationFixable = false;
|
|
147
|
+
}
|
|
148
|
+
return merged;
|
|
149
|
+
}
|
|
150
|
+
/** Matrix entry ids eligible for runtime auto-heal (RUNTIME/BOTH + YES/PARTIAL) */
|
|
151
|
+
function getRuntimeHealableMatrixIds() {
|
|
152
|
+
return healing_matrix_js_1.HEALING_MATRIX_ENTRIES.filter((entry) => isRuntimeHealAllowed(entry) &&
|
|
153
|
+
(entry.canHeal === enums_js_1.MatrixHealability.YES || entry.canHeal === enums_js_1.MatrixHealability.PARTIAL)).map((entry) => entry.id);
|
|
154
|
+
}
|
|
155
|
+
/** Lookup matrix statistics */
|
|
156
|
+
function getMatrixStats() {
|
|
157
|
+
const families = new Set(healing_matrix_js_1.HEALING_MATRIX_ENTRIES.map((e) => e.family));
|
|
158
|
+
return {
|
|
159
|
+
totalEntries: healing_matrix_js_1.HEALING_MATRIX_ENTRIES.length,
|
|
160
|
+
familyCount: families.size,
|
|
161
|
+
healableCount: healing_matrix_js_1.HEALING_MATRIX_ENTRIES.filter((e) => e.canHeal === enums_js_1.MatrixHealability.YES).length,
|
|
162
|
+
partialCount: healing_matrix_js_1.HEALING_MATRIX_ENTRIES.filter((e) => e.canHeal === enums_js_1.MatrixHealability.PARTIAL)
|
|
163
|
+
.length,
|
|
164
|
+
notHealableCount: healing_matrix_js_1.HEALING_MATRIX_ENTRIES.filter((e) => e.canHeal === enums_js_1.MatrixHealability.NO)
|
|
165
|
+
.length,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=matrix-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix-policy.js","sourceRoot":"","sources":["../src/matrix-policy.ts"],"names":[],"mappings":";;;AAmBA,4CAqCC;AAGD,oDAgDC;AAGD,oDAEC;AAGD,wDAEC;AAGD,wEAuDC;AAGD,kEAMC;AAGD,wCAiBC;AA5MD,yCAMoB;AAEpB,2DAI6B;AAIpB,kGAPP,qCAAiB,OAOO;AAF1B,2CAAkG;AAIlG,mFAAmF;AACnF,SAAgB,gBAAgB,CAC9B,QAAgB,EAChB,QAAyB,EACzB,WAAoB;IAEpB,MAAM,UAAU,GAAG,IAAA,8CAA0B,EAAC,QAAQ,CAAC,CAAC;IACxD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzC,IAAI,IAAI,GAA0E,IAAI,CAAC;IAEvF,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,MAAM;YAAE,SAAS;QAC/C,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC9C,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OA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AO,KAAK,4BAAiB,CAAC,OAAO,CAAC,CAC3F,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,+BAA+B;AAC/B,SAAgB,cAAc;IAO5B,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,0CAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACtE,OAAO;QACL,YAAY,EAAE,0CAAsB,CAAC,MAAM;QAC3C,WAAW,EAAE,QAAQ,CAAC,IAAI;QAC1B,aAAa,EAAE,0CAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,4BAAiB,CAAC,GAAG,CAAC,CAAC,MAAM;QAC/F,YAAY,EAAE,0CAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,4BAAiB,CAAC,OAAO,CAAC;aACxF,MAAM;QACT,gBAAgB,EAAE,0CAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,4BAAiB,CAAC,EAAE,CAAC;aACvF,MAAM;KACV,CAAC;AACJ,CAAC"}
|
package/dist/policy.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FailureCategory, HealOutcome, RecommendedAction } from './enums.js';
|
|
2
2
|
import type { ClassificationResult } from './domain.js';
|
|
3
|
-
/** Categories safe for automated healing (runtime + AST).
|
|
3
|
+
/** Categories safe for automated healing (runtime + AST). */
|
|
4
4
|
export declare const AUTOMATION_FIXABLE_CATEGORIES: ReadonlySet<FailureCategory>;
|
|
5
5
|
/** Classify only — report diagnostics, never auto-fix */
|
|
6
6
|
export declare const DIAGNOSE_ONLY_CATEGORIES: ReadonlySet<FailureCategory>;
|
|
7
|
-
/** Never auto-fix — product or infrastructure incidents */
|
|
7
|
+
/** Never auto-fix — product, security, or infrastructure incidents */
|
|
8
8
|
export declare const BLOCKED_CATEGORIES: ReadonlySet<FailureCategory>;
|
|
9
9
|
export declare function isCategoryAutomationFixable(category: FailureCategory): boolean;
|
|
10
10
|
export declare function resolveFailureOutcome(classification: Pick<ClassificationResult, 'category' | 'isProductBug' | 'isAutomationFixable' | 'confidence'>): {
|
package/dist/policy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,6DAA6D;AAC7D,eAAO,MAAM,6BAA6B,EAAE,WAAW,CAAC,eAAe,CAarE,CAAC;AAEH,yDAAyD;AACzD,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,eAAe,CAWhE,CAAC;AAEH,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,eAAe,CAK1D,CAAC;AAEH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAE9E;AAED,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,IAAI,CAClB,oBAAoB,EACpB,UAAU,GAAG,cAAc,GAAG,qBAAqB,GAAG,YAAY,CACnE,GACA;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,iBAAiB,EAAE,iBAAiB,CAAA;CAAE,CA2ChE"}
|
package/dist/policy.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.BLOCKED_CATEGORIES = exports.DIAGNOSE_ONLY_CATEGORIES = exports.AUTOMATI
|
|
|
4
4
|
exports.isCategoryAutomationFixable = isCategoryAutomationFixable;
|
|
5
5
|
exports.resolveFailureOutcome = resolveFailureOutcome;
|
|
6
6
|
const enums_js_1 = require("./enums.js");
|
|
7
|
-
/** Categories safe for automated healing (runtime + AST).
|
|
7
|
+
/** Categories safe for automated healing (runtime + AST). */
|
|
8
8
|
exports.AUTOMATION_FIXABLE_CATEGORIES = new Set([
|
|
9
9
|
enums_js_1.FailureCategory.SELECTOR,
|
|
10
10
|
enums_js_1.FailureCategory.TIMING,
|
|
@@ -13,6 +13,11 @@ exports.AUTOMATION_FIXABLE_CATEGORIES = new Set([
|
|
|
13
13
|
enums_js_1.FailureCategory.SHADOW_DOM,
|
|
14
14
|
enums_js_1.FailureCategory.AUTH,
|
|
15
15
|
enums_js_1.FailureCategory.SESSION,
|
|
16
|
+
enums_js_1.FailureCategory.NAVIGATION,
|
|
17
|
+
enums_js_1.FailureCategory.I18N,
|
|
18
|
+
enums_js_1.FailureCategory.MOBILE,
|
|
19
|
+
enums_js_1.FailureCategory.UPLOAD,
|
|
20
|
+
enums_js_1.FailureCategory.MULTI_TAB,
|
|
16
21
|
]);
|
|
17
22
|
/** Classify only — report diagnostics, never auto-fix */
|
|
18
23
|
exports.DIAGNOSE_ONLY_CATEGORIES = new Set([
|
|
@@ -21,10 +26,17 @@ exports.DIAGNOSE_ONLY_CATEGORIES = new Set([
|
|
|
21
26
|
enums_js_1.FailureCategory.NETWORK,
|
|
22
27
|
enums_js_1.FailureCategory.API,
|
|
23
28
|
enums_js_1.FailureCategory.ENVIRONMENT,
|
|
29
|
+
enums_js_1.FailureCategory.PERFORMANCE,
|
|
30
|
+
enums_js_1.FailureCategory.THIRD_PARTY,
|
|
31
|
+
enums_js_1.FailureCategory.TEST_STRUCTURE,
|
|
32
|
+
enums_js_1.FailureCategory.VISUAL,
|
|
33
|
+
enums_js_1.FailureCategory.BROWSER_INFRA,
|
|
24
34
|
]);
|
|
25
|
-
/** Never auto-fix — product or infrastructure incidents */
|
|
35
|
+
/** Never auto-fix — product, security, or infrastructure incidents */
|
|
26
36
|
exports.BLOCKED_CATEGORIES = new Set([
|
|
27
37
|
enums_js_1.FailureCategory.PRODUCT_BUG,
|
|
38
|
+
enums_js_1.FailureCategory.ASSERTION,
|
|
39
|
+
enums_js_1.FailureCategory.SECURITY,
|
|
28
40
|
enums_js_1.FailureCategory.UNKNOWN,
|
|
29
41
|
]);
|
|
30
42
|
function isCategoryAutomationFixable(category) {
|
|
@@ -46,6 +58,11 @@ function resolveFailureOutcome(classification) {
|
|
|
46
58
|
[enums_js_1.FailureCategory.ENVIRONMENT]: enums_js_1.RecommendedAction.CHECK_ENVIRONMENT,
|
|
47
59
|
[enums_js_1.FailureCategory.TEST_DATA]: enums_js_1.RecommendedAction.UPDATE_TEST_DATA,
|
|
48
60
|
[enums_js_1.FailureCategory.CONFIGURATION]: enums_js_1.RecommendedAction.MANUAL_FIX,
|
|
61
|
+
[enums_js_1.FailureCategory.PERFORMANCE]: enums_js_1.RecommendedAction.INVESTIGATE_PRODUCT,
|
|
62
|
+
[enums_js_1.FailureCategory.THIRD_PARTY]: enums_js_1.RecommendedAction.MANUAL_FIX,
|
|
63
|
+
[enums_js_1.FailureCategory.TEST_STRUCTURE]: enums_js_1.RecommendedAction.MANUAL_FIX,
|
|
64
|
+
[enums_js_1.FailureCategory.VISUAL]: enums_js_1.RecommendedAction.MANUAL_FIX,
|
|
65
|
+
[enums_js_1.FailureCategory.BROWSER_INFRA]: enums_js_1.RecommendedAction.CHECK_ENVIRONMENT,
|
|
49
66
|
};
|
|
50
67
|
return {
|
|
51
68
|
outcome: enums_js_1.HealOutcome.DIAGNOSED,
|
package/dist/policy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../src/policy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c,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/F,OAAO;YACL,OAAO,EAAE,sBAAW,CAAC,MAAM;YAC3B,iBAAiB,EACf,cAAc,CAAC,UAAU,IAAI,IAAI;gBAC/B,CAAC,CAAC,4BAAiB,CAAC,SAAS;gBAC7B,CAAC,CAAC,4BAAiB,CAAC,UAAU;SACnC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,sBAAW,CAAC,SAAS;QAC9B,iBAAiB,EAAE,4BAAiB,CAAC,UAAU;KAChD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@healflow/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Shared types, events, and contracts for HealFlow",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"
|
|
34
|
+
"tsx": "^4.19.2",
|
|
35
|
+
"typescript": "^5.7.2",
|
|
36
|
+
"vitest": "^3.2.4"
|
|
35
37
|
},
|
|
36
38
|
"files": [
|
|
37
39
|
"dist"
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
"scripts": {
|
|
43
45
|
"build": "tsc -p tsconfig.json",
|
|
44
46
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
45
|
-
"
|
|
47
|
+
"test": "node --import tsx --test src/healing-matrix.test.ts",
|
|
48
|
+
"lint": "pnpm typecheck"
|
|
46
49
|
}
|
|
47
50
|
}
|