agentic-qe 3.8.4 → 3.8.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.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/cli/bundle.js +694 -694
- package/dist/cli/commands/hooks-handlers/command-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/command-hooks.js +253 -0
- package/dist/cli/commands/hooks-handlers/editing-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/editing-hooks.js +161 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +57 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +263 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +52 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +223 -0
- package/dist/cli/commands/hooks-handlers/routing-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/routing-hooks.js +107 -0
- package/dist/cli/commands/hooks-handlers/session-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/session-hooks.js +171 -0
- package/dist/cli/commands/hooks-handlers/stats-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/stats-hooks.js +248 -0
- package/dist/cli/commands/hooks-handlers/task-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/task-hooks.js +152 -0
- package/dist/cli/commands/hooks.d.ts +3 -23
- package/dist/cli/commands/hooks.js +16 -1459
- package/dist/coordination/mincut/phase-executor.d.ts +27 -0
- package/dist/coordination/mincut/phase-executor.js +70 -0
- package/dist/coordination/mincut/time-crystal-analysis.d.ts +35 -0
- package/dist/coordination/mincut/time-crystal-analysis.js +237 -0
- package/dist/coordination/mincut/time-crystal-persistence.d.ts +35 -0
- package/dist/coordination/mincut/time-crystal-persistence.js +81 -0
- package/dist/coordination/mincut/time-crystal-scheduling.d.ts +34 -0
- package/dist/coordination/mincut/time-crystal-scheduling.js +213 -0
- package/dist/coordination/mincut/time-crystal-types.d.ts +278 -0
- package/dist/coordination/mincut/time-crystal-types.js +67 -0
- package/dist/coordination/mincut/time-crystal.d.ts +8 -438
- package/dist/coordination/mincut/time-crystal.js +87 -905
- package/dist/domains/base-domain-coordinator.d.ts +0 -15
- package/dist/domains/base-domain-coordinator.js +7 -5
- package/dist/domains/chaos-resilience/coordinator.d.ts +0 -4
- package/dist/domains/chaos-resilience/coordinator.js +24 -22
- package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +0 -4
- package/dist/domains/chaos-resilience/services/chaos-engineer.js +47 -45
- package/dist/domains/chaos-resilience/services/performance-profiler.d.ts +0 -4
- package/dist/domains/chaos-resilience/services/performance-profiler.js +10 -8
- package/dist/domains/code-intelligence/coordinator-consensus.d.ts +0 -3
- package/dist/domains/code-intelligence/coordinator-consensus.js +8 -6
- package/dist/domains/code-intelligence/coordinator-gnn.d.ts +0 -3
- package/dist/domains/code-intelligence/coordinator-gnn.js +8 -6
- package/dist/domains/code-intelligence/coordinator-hypergraph.d.ts +0 -3
- package/dist/domains/code-intelligence/coordinator-hypergraph.js +13 -11
- package/dist/domains/code-intelligence/coordinator.d.ts +0 -3
- package/dist/domains/code-intelligence/coordinator.js +21 -19
- package/dist/domains/code-intelligence/services/c4-model/index.d.ts +0 -3
- package/dist/domains/code-intelligence/services/c4-model/index.js +5 -3
- package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +0 -6
- package/dist/domains/code-intelligence/services/knowledge-graph.js +4 -2
- package/dist/domains/code-intelligence/services/product-factors-bridge.d.ts +0 -5
- package/dist/domains/code-intelligence/services/product-factors-bridge.js +9 -7
- package/dist/domains/contract-testing/coordinator.d.ts +0 -6
- package/dist/domains/contract-testing/coordinator.js +25 -23
- package/dist/domains/contract-testing/services/contract-validator.d.ts +0 -4
- package/dist/domains/contract-testing/services/contract-validator.js +4 -2
- package/dist/domains/contract-testing/services/schema-validator.js +1 -1
- package/dist/domains/coverage-analysis/coordinator.js +13 -11
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +4 -2
- package/dist/domains/coverage-analysis/services/gap-detector.js +3 -1
- package/dist/domains/coverage-analysis/services/hnsw-index.d.ts +0 -15
- package/dist/domains/coverage-analysis/services/hnsw-index.js +3 -1
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts +0 -26
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.js +3 -1
- package/dist/domains/defect-intelligence/coordinator.d.ts +1 -10
- package/dist/domains/defect-intelligence/coordinator.js +5 -3
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts +0 -6
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +3 -1
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +0 -6
- package/dist/domains/defect-intelligence/services/defect-predictor.js +5 -3
- package/dist/domains/defect-intelligence/services/pattern-learner.d.ts +0 -4
- package/dist/domains/defect-intelligence/services/pattern-learner.js +3 -1
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts +0 -6
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +3 -1
- package/dist/domains/enterprise-integration/coordinator.js +6 -4
- package/dist/domains/learning-optimization/coordinator-consensus.d.ts +0 -3
- package/dist/domains/learning-optimization/coordinator-consensus.js +8 -6
- package/dist/domains/learning-optimization/coordinator.d.ts +0 -3
- package/dist/domains/learning-optimization/coordinator.js +15 -13
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +0 -4
- package/dist/domains/learning-optimization/services/learning-coordinator.js +4 -2
- package/dist/domains/quality-assessment/coordinator-claim-verifier.d.ts +0 -3
- package/dist/domains/quality-assessment/coordinator-claim-verifier.js +6 -4
- package/dist/domains/quality-assessment/coordinator-gate-evaluation.d.ts +0 -4
- package/dist/domains/quality-assessment/coordinator-gate-evaluation.js +9 -7
- package/dist/domains/quality-assessment/coordinator-rl-integration.d.ts +0 -3
- package/dist/domains/quality-assessment/coordinator-rl-integration.js +10 -8
- package/dist/domains/quality-assessment/coordinator.d.ts +0 -15
- package/dist/domains/quality-assessment/coordinator.js +14 -12
- package/dist/domains/quality-assessment/services/deployment-advisor.d.ts +0 -10
- package/dist/domains/quality-assessment/services/deployment-advisor.js +4 -2
- package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +0 -6
- package/dist/domains/quality-assessment/services/quality-analyzer.js +4 -2
- package/dist/domains/requirements-validation/coordinator.d.ts +0 -3
- package/dist/domains/requirements-validation/coordinator.js +15 -13
- package/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.d.ts +0 -5
- package/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.js +15 -13
- package/dist/domains/requirements-validation/services/product-factors-assessment/product-factors-service.d.ts +0 -6
- package/dist/domains/requirements-validation/services/product-factors-assessment/product-factors-service.js +9 -7
- package/dist/domains/requirements-validation/services/requirements-validator.d.ts +0 -6
- package/dist/domains/requirements-validation/services/requirements-validator.js +4 -2
- package/dist/domains/security-compliance/coordinator.js +24 -22
- package/dist/domains/security-compliance/services/scanners/dast-scanner.d.ts +0 -21
- package/dist/domains/security-compliance/services/scanners/dast-scanner.js +4 -2
- package/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts +0 -4
- package/dist/domains/security-compliance/services/scanners/sast-scanner.js +3 -1
- package/dist/domains/security-compliance/services/security-auditor-dast.d.ts +0 -4
- package/dist/domains/security-compliance/services/security-auditor-dast.js +3 -1
- package/dist/domains/security-compliance/services/security-auditor-sast.d.ts +0 -3
- package/dist/domains/security-compliance/services/security-auditor-sast.js +3 -1
- package/dist/domains/security-compliance/services/security-auditor-secrets.d.ts +0 -3
- package/dist/domains/security-compliance/services/security-auditor-secrets.js +3 -1
- package/dist/domains/security-compliance/services/security-auditor.js +11 -9
- package/dist/domains/test-execution/coordinator.js +11 -9
- package/dist/domains/test-execution/services/auth-state-manager.d.ts +0 -3
- package/dist/domains/test-execution/services/auth-state-manager.js +4 -2
- package/dist/domains/test-execution/services/e2e/e2e-coordinator.d.ts +0 -14
- package/dist/domains/test-execution/services/e2e/e2e-coordinator.js +3 -1
- package/dist/domains/test-execution/services/flaky-detector.js +4 -2
- package/dist/domains/test-execution/services/retry-handler.js +3 -1
- package/dist/domains/test-execution/services/test-executor.js +3 -1
- package/dist/domains/test-generation/coordinator.d.ts +0 -17
- package/dist/domains/test-generation/coordinator.js +33 -31
- package/dist/domains/test-generation/pattern-injection/edge-case-injector.d.ts +0 -5
- package/dist/domains/test-generation/pattern-injection/edge-case-injector.js +3 -1
- package/dist/domains/test-generation/services/code-transform-integration.d.ts +0 -7
- package/dist/domains/test-generation/services/code-transform-integration.js +3 -1
- package/dist/domains/test-generation/services/coherence-gate-service.d.ts +0 -3
- package/dist/domains/test-generation/services/coherence-gate-service.js +3 -1
- package/dist/domains/test-generation/services/test-generator.d.ts +0 -8
- package/dist/domains/test-generation/services/test-generator.js +5 -3
- package/dist/domains/visual-accessibility/coordinator.d.ts +0 -3
- package/dist/domains/visual-accessibility/coordinator.js +14 -12
- package/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +0 -3
- package/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +52 -50
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +0 -4
- package/dist/domains/visual-accessibility/services/accessibility-tester.js +8 -6
- package/dist/domains/visual-accessibility/services/axe-core-integration.d.ts +0 -3
- package/dist/domains/visual-accessibility/services/axe-core-integration.js +20 -18
- package/dist/domains/visual-accessibility/services/browser-security-scanner.d.ts +0 -4
- package/dist/domains/visual-accessibility/services/browser-security-scanner.js +6 -4
- package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts +0 -30
- package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +5 -3
- package/dist/domains/visual-accessibility/services/viewport-capture.d.ts +0 -27
- package/dist/domains/visual-accessibility/services/viewport-capture.js +6 -4
- package/dist/domains/visual-accessibility/services/visual-regression.d.ts +0 -26
- package/dist/domains/visual-accessibility/services/visual-regression.js +4 -2
- package/dist/domains/visual-accessibility/services/visual-tester.d.ts +0 -4
- package/dist/domains/visual-accessibility/services/visual-tester.js +4 -2
- package/dist/governance/deterministic-gateway-integration.js +1 -1
- package/dist/learning/agent-routing.d.ts +53 -0
- package/dist/learning/agent-routing.js +142 -0
- package/dist/learning/embedding-utils.d.ts +34 -0
- package/dist/learning/embedding-utils.js +95 -0
- package/dist/learning/pattern-promotion.d.ts +63 -0
- package/dist/learning/pattern-promotion.js +187 -0
- package/dist/learning/pretrained-patterns.d.ts +14 -0
- package/dist/learning/pretrained-patterns.js +726 -0
- package/dist/learning/qe-reasoning-bank-types.d.ts +174 -0
- package/dist/learning/qe-reasoning-bank-types.js +24 -0
- package/dist/learning/qe-reasoning-bank.d.ts +9 -192
- package/dist/learning/qe-reasoning-bank.js +48 -1093
- package/dist/mcp/bundle.js +335 -335
- package/dist/mcp/security/validators/command-validator.d.ts +1 -40
- package/dist/mcp/security/validators/command-validator.js +2 -122
- package/dist/mcp/security/validators/crypto-validator.d.ts +1 -39
- package/dist/mcp/security/validators/crypto-validator.js +2 -71
- package/dist/mcp/security/validators/input-sanitizer.d.ts +1 -55
- package/dist/mcp/security/validators/input-sanitizer.js +2 -156
- package/dist/mcp/security/validators/interfaces.d.ts +1 -163
- package/dist/mcp/security/validators/interfaces.js +2 -5
- package/dist/mcp/security/validators/path-traversal-validator.d.ts +1 -49
- package/dist/mcp/security/validators/path-traversal-validator.js +2 -241
- package/dist/mcp/security/validators/regex-safety-validator.d.ts +1 -49
- package/dist/mcp/security/validators/regex-safety-validator.js +2 -182
- package/dist/mcp/security/validators/validation-orchestrator.d.ts +1 -65
- package/dist/mcp/security/validators/validation-orchestrator.js +2 -145
- package/dist/shared/io/file-reader.js +1 -1
- package/dist/shared/security/command-validator.d.ts +44 -0
- package/dist/shared/security/command-validator.js +126 -0
- package/dist/shared/security/crypto-validator.d.ts +43 -0
- package/dist/shared/security/crypto-validator.js +75 -0
- package/dist/shared/security/index.d.ts +7 -0
- package/dist/shared/security/index.js +15 -0
- package/dist/shared/security/input-sanitizer.d.ts +59 -0
- package/dist/shared/security/input-sanitizer.js +160 -0
- package/dist/shared/security/path-traversal-validator.d.ts +53 -0
- package/dist/shared/security/path-traversal-validator.js +245 -0
- package/dist/shared/security/regex-safety-validator.d.ts +53 -0
- package/dist/shared/security/regex-safety-validator.js +186 -0
- package/dist/shared/security/validation-orchestrator.d.ts +69 -0
- package/dist/shared/security/validation-orchestrator.js +149 -0
- package/dist/shared/security/validators-interfaces.d.ts +167 -0
- package/dist/shared/security/validators-interfaces.js +9 -0
- package/package.json +1 -1
|
@@ -52,21 +52,6 @@ export interface BaseDomainCoordinatorConfig {
|
|
|
52
52
|
consensusStrategy: 'majority' | 'weighted' | 'unanimous';
|
|
53
53
|
consensusMinModels: number;
|
|
54
54
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Abstract base class for all domain coordinators.
|
|
57
|
-
*
|
|
58
|
-
* Provides concrete implementations for:
|
|
59
|
-
* - MinCut topology awareness (setMinCutBridge, isTopologyHealthy, etc.)
|
|
60
|
-
* - Consensus lifecycle (initializeConsensus, disposeConsensus, etc.)
|
|
61
|
-
* - Governance mixin access
|
|
62
|
-
* - Workflow management (start, complete, fail, progress tracking)
|
|
63
|
-
* - Initialization guard pattern
|
|
64
|
-
*
|
|
65
|
-
* Subclasses implement:
|
|
66
|
-
* - onInitialize(): domain-specific setup (RL integrations, services, etc.)
|
|
67
|
-
* - onDispose(): domain-specific teardown
|
|
68
|
-
* - subscribeToEvents(): domain-specific event subscriptions
|
|
69
|
-
*/
|
|
70
55
|
export declare abstract class BaseDomainCoordinator<TConfig extends BaseDomainCoordinatorConfig = BaseDomainCoordinatorConfig, TWorkflowType extends string = string> {
|
|
71
56
|
protected readonly eventBus: EventBus;
|
|
72
57
|
protected readonly domainName: DomainName;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* - onDispose(): domain-specific cleanup
|
|
17
17
|
* - subscribeToEvents(): domain-specific event subscriptions
|
|
18
18
|
*/
|
|
19
|
+
import { LoggerFactory } from '../logging/index.js';
|
|
19
20
|
// MinCut mixin (ADR-047)
|
|
20
21
|
import { createMinCutAwareMixin, } from '../coordination/mixins/mincut-aware-domain.js';
|
|
21
22
|
// Consensus mixin (MM-001)
|
|
@@ -40,6 +41,7 @@ import { createGovernanceAwareMixin, } from '../coordination/mixins/governance-a
|
|
|
40
41
|
* - onDispose(): domain-specific teardown
|
|
41
42
|
* - subscribeToEvents(): domain-specific event subscriptions
|
|
42
43
|
*/
|
|
44
|
+
const baseLogger = LoggerFactory.create('base-domain-coordinator');
|
|
43
45
|
export class BaseDomainCoordinator {
|
|
44
46
|
eventBus;
|
|
45
47
|
domainName;
|
|
@@ -92,11 +94,11 @@ export class BaseDomainCoordinator {
|
|
|
92
94
|
if (this.config.enableConsensus) {
|
|
93
95
|
try {
|
|
94
96
|
await this.consensusMixin.initializeConsensus();
|
|
95
|
-
|
|
97
|
+
baseLogger.info(`[${this.domainName}] Consensus engine initialized`);
|
|
96
98
|
}
|
|
97
99
|
catch (error) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
baseLogger.error(`[${this.domainName}] Failed to initialize consensus engine`, error instanceof Error ? error : undefined);
|
|
101
|
+
baseLogger.warn(`[${this.domainName}] Continuing without consensus verification`);
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
this.initialized = true;
|
|
@@ -111,7 +113,7 @@ export class BaseDomainCoordinator {
|
|
|
111
113
|
await this.consensusMixin.disposeConsensus();
|
|
112
114
|
}
|
|
113
115
|
catch (error) {
|
|
114
|
-
|
|
116
|
+
baseLogger.error(`[${this.domainName}] Error disposing consensus engine`, error instanceof Error ? error : undefined);
|
|
115
117
|
}
|
|
116
118
|
// Dispose MinCut mixin (ADR-047)
|
|
117
119
|
this.minCutMixin.dispose();
|
|
@@ -125,7 +127,7 @@ export class BaseDomainCoordinator {
|
|
|
125
127
|
// ==========================================================================
|
|
126
128
|
setMinCutBridge(bridge) {
|
|
127
129
|
this.minCutMixin.setMinCutBridge(bridge);
|
|
128
|
-
|
|
130
|
+
baseLogger.info(`[${this.domainName}] MinCut bridge connected`);
|
|
129
131
|
}
|
|
130
132
|
isTopologyHealthy() {
|
|
131
133
|
return this.minCutMixin.isTopologyHealthy();
|
|
@@ -42,10 +42,6 @@ export interface CoordinatorConfig extends BaseDomainCoordinatorConfig {
|
|
|
42
42
|
consensusConfig?: Partial<ConsensusEnabledConfig>;
|
|
43
43
|
}
|
|
44
44
|
type ChaosWorkflowType = 'chaos-suite' | 'load-suite' | 'assessment' | 'experiment-generation';
|
|
45
|
-
/**
|
|
46
|
-
* Chaos Resilience Coordinator
|
|
47
|
-
* Orchestrates chaos engineering workflows and coordinates with agents
|
|
48
|
-
*/
|
|
49
45
|
export declare class ChaosResilienceCoordinator extends BaseDomainCoordinator<CoordinatorConfig, ChaosWorkflowType> implements IChaosResilienceCoordinatorExtended {
|
|
50
46
|
private readonly memory;
|
|
51
47
|
private readonly agentCoordinator;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Chaos & Resilience Coordinator
|
|
3
3
|
* Orchestrates chaos engineering and resilience testing workflows
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
5
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
7
|
import { ok, err } from '../../shared/types';
|
|
7
8
|
import { toError, toErrorMessage } from '../../shared/error-utils.js';
|
|
@@ -37,6 +38,7 @@ const DEFAULT_CONFIG = {
|
|
|
37
38
|
* Chaos Resilience Coordinator
|
|
38
39
|
* Orchestrates chaos engineering workflows and coordinates with agents
|
|
39
40
|
*/
|
|
41
|
+
const logger = LoggerFactory.create('chaos-resilience');
|
|
40
42
|
export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
41
43
|
memory;
|
|
42
44
|
agentCoordinator;
|
|
@@ -81,10 +83,10 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
81
83
|
hiddenLayers: [64, 64],
|
|
82
84
|
});
|
|
83
85
|
// First call to predict will initialize the algorithm
|
|
84
|
-
|
|
86
|
+
logger.info('PolicyGradient algorithm created successfully');
|
|
85
87
|
}
|
|
86
88
|
catch (error) {
|
|
87
|
-
|
|
89
|
+
logger.error('Failed to create PolicyGradient:', error instanceof Error ? error : undefined);
|
|
88
90
|
throw new Error(`PolicyGradient creation failed: ${toErrorMessage(error)}`);
|
|
89
91
|
}
|
|
90
92
|
}
|
|
@@ -98,12 +100,12 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
98
100
|
maxPatterns: 5000,
|
|
99
101
|
minConfidence: 0.6,
|
|
100
102
|
});
|
|
101
|
-
|
|
103
|
+
logger.info('PersistentSONAEngine initialized successfully');
|
|
102
104
|
}
|
|
103
105
|
catch (error) {
|
|
104
106
|
// Log and continue - SONA is enhancement, not critical
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
logger.error('Failed to initialize PersistentSONAEngine:', error instanceof Error ? error : undefined);
|
|
108
|
+
logger.warn('Continuing without SONA pattern persistence');
|
|
107
109
|
this.qesona = undefined;
|
|
108
110
|
}
|
|
109
111
|
}
|
|
@@ -140,7 +142,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
140
142
|
this.startWorkflow(workflowId, 'chaos-suite');
|
|
141
143
|
// ADR-047: Check topology health before running chaos experiments
|
|
142
144
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
143
|
-
|
|
145
|
+
logger.warn(`Topology degraded, using conservative chaos strategy`);
|
|
144
146
|
// Continue with reduced blast radius when topology is unhealthy
|
|
145
147
|
}
|
|
146
148
|
// ADR-047: Check if operations should be paused due to critical topology
|
|
@@ -220,7 +222,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
220
222
|
this.startWorkflow(workflowId, 'load-suite');
|
|
221
223
|
// ADR-047: Check topology health before running load tests
|
|
222
224
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
223
|
-
|
|
225
|
+
logger.warn(`Topology degraded, using conservative load test parameters`);
|
|
224
226
|
}
|
|
225
227
|
// ADR-047: Check if operations should be paused due to critical topology
|
|
226
228
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
@@ -289,7 +291,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
289
291
|
this.startWorkflow(workflowId, 'assessment');
|
|
290
292
|
// ADR-047: Check topology health before assessment
|
|
291
293
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
292
|
-
|
|
294
|
+
logger.warn(`Topology degraded, assessment may be limited`);
|
|
293
295
|
}
|
|
294
296
|
// ADR-047: Check if operations should be paused due to critical topology
|
|
295
297
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
@@ -438,7 +440,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
438
440
|
this.startWorkflow(workflowId, 'chaos-suite');
|
|
439
441
|
// ADR-047: Check topology health before running strategic chaos
|
|
440
442
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
441
|
-
|
|
443
|
+
logger.warn(`Topology degraded, adjusting strategic chaos parameters`);
|
|
442
444
|
// Continue but may need to reduce experiment scope
|
|
443
445
|
}
|
|
444
446
|
// ADR-047: Check if operations should be paused due to critical topology
|
|
@@ -455,7 +457,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
455
457
|
return err(strategyResult.error);
|
|
456
458
|
}
|
|
457
459
|
const selectedExperiments = strategyResult.value.selectedExperiments;
|
|
458
|
-
|
|
460
|
+
logger.info(`[chaos-resilience] Using ${strategyResult.value.strategy} strategy with ${selectedExperiments.length} experiments (confidence: ${strategyResult.value.confidence.toFixed(2)})`);
|
|
459
461
|
if (selectedExperiments.length === 0) {
|
|
460
462
|
this.completeWorkflow(workflowId);
|
|
461
463
|
return ok({
|
|
@@ -970,7 +972,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
970
972
|
nextState: state,
|
|
971
973
|
done: true,
|
|
972
974
|
});
|
|
973
|
-
|
|
975
|
+
logger.info(`[chaos-resilience] PolicyGradient selected ${strategy} strategy for ${services.length} services (confidence: ${prediction.confidence.toFixed(2)})`);
|
|
974
976
|
return ok({
|
|
975
977
|
strategy,
|
|
976
978
|
selectedExperiments,
|
|
@@ -979,7 +981,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
979
981
|
});
|
|
980
982
|
}
|
|
981
983
|
catch (error) {
|
|
982
|
-
|
|
984
|
+
logger.error('PolicyGradient strategy selection failed:', error instanceof Error ? error : undefined);
|
|
983
985
|
// Return default strategy on error (graceful degradation)
|
|
984
986
|
return ok({
|
|
985
987
|
strategy: 'fallback',
|
|
@@ -1072,10 +1074,10 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
1072
1074
|
faultType: experiment.faults[0]?.type,
|
|
1073
1075
|
hypothesisValidated: result.hypothesisValidated,
|
|
1074
1076
|
});
|
|
1075
|
-
|
|
1077
|
+
logger.info(`Stored resilience pattern for ${experiment.id} (validated: ${result.hypothesisValidated}, quality: ${quality.toFixed(2)})`);
|
|
1076
1078
|
}
|
|
1077
1079
|
catch (error) {
|
|
1078
|
-
|
|
1080
|
+
logger.error('Failed to store resilience pattern:', error instanceof Error ? error : undefined);
|
|
1079
1081
|
}
|
|
1080
1082
|
}
|
|
1081
1083
|
/**
|
|
@@ -1109,7 +1111,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
1109
1111
|
if (adaptation.success && adaptation.pattern) {
|
|
1110
1112
|
const shouldRunChaos = adaptation.pattern.outcome.success;
|
|
1111
1113
|
const recommendedFaults = this.getRecommendedFaults(adaptation.pattern.action.type);
|
|
1112
|
-
|
|
1114
|
+
logger.info(`[chaos-resilience] QESONA adapted strategy for ${service.name}: shouldRun=${shouldRunChaos}, faults=${recommendedFaults.join(',')}, confidence=${adaptation.similarity.toFixed(2)}`);
|
|
1113
1115
|
return {
|
|
1114
1116
|
shouldRunChaos,
|
|
1115
1117
|
recommendedFaults,
|
|
@@ -1123,7 +1125,7 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
1123
1125
|
};
|
|
1124
1126
|
}
|
|
1125
1127
|
catch (error) {
|
|
1126
|
-
|
|
1128
|
+
logger.error('QESONA strategy adaptation failed:', error instanceof Error ? error : undefined);
|
|
1127
1129
|
return {
|
|
1128
1130
|
shouldRunChaos: context.environment !== 'production',
|
|
1129
1131
|
recommendedFaults: ['latency', 'error'],
|
|
@@ -1218,10 +1220,10 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
1218
1220
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
1219
1221
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
1220
1222
|
if (result.success && result.value.verdict === 'verified') {
|
|
1221
|
-
|
|
1223
|
+
logger.info(`Chaos experiment '${experiment.name}' verified safe by consensus`);
|
|
1222
1224
|
return true;
|
|
1223
1225
|
}
|
|
1224
|
-
|
|
1226
|
+
logger.warn(`Chaos experiment '${experiment.name}' NOT verified safe: ${result.success ? result.value.verdict : result.error.message}`);
|
|
1225
1227
|
return false;
|
|
1226
1228
|
}
|
|
1227
1229
|
return true; // No consensus needed
|
|
@@ -1247,10 +1249,10 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
1247
1249
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
1248
1250
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
1249
1251
|
if (result.success && result.value.verdict === 'verified') {
|
|
1250
|
-
|
|
1252
|
+
logger.info(`Resilience assessment for '${assessment.service}' verified by consensus`);
|
|
1251
1253
|
return true;
|
|
1252
1254
|
}
|
|
1253
|
-
|
|
1255
|
+
logger.warn(`Resilience assessment for '${assessment.service}' NOT verified`);
|
|
1254
1256
|
return false;
|
|
1255
1257
|
}
|
|
1256
1258
|
return true; // No consensus needed
|
|
@@ -1276,10 +1278,10 @@ export class ChaosResilienceCoordinator extends BaseDomainCoordinator {
|
|
|
1276
1278
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
1277
1279
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
1278
1280
|
if (result.success && result.value.verdict === 'verified') {
|
|
1279
|
-
|
|
1281
|
+
logger.info(`Failure injection '${injection.faultType}' on '${injection.target}' verified safe by consensus`);
|
|
1280
1282
|
return true;
|
|
1281
1283
|
}
|
|
1282
|
-
|
|
1284
|
+
logger.warn(`Failure injection '${injection.faultType}' NOT verified safe: ${result.success ? result.value.verdict : result.error.message}`);
|
|
1283
1285
|
return false;
|
|
1284
1286
|
}
|
|
1285
1287
|
return true; // No consensus needed
|
|
@@ -29,10 +29,6 @@ export interface ChaosEngineerDependencies {
|
|
|
29
29
|
memory: MemoryBackend;
|
|
30
30
|
llmRouter?: HybridRouter;
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Chaos Engineering Service Implementation
|
|
34
|
-
* Manages chaos experiments, fault injection, and steady state verification
|
|
35
|
-
*/
|
|
36
32
|
export declare class ChaosEngineerService implements IChaosEngineeringService {
|
|
37
33
|
private readonly config;
|
|
38
34
|
private readonly activeExperiments;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* Agentic QE v3 - Chaos Engineering Service
|
|
3
3
|
* Implements IChaosEngineeringService for fault injection and experiment execution
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
5
6
|
import { ok, err } from '../../../shared/types';
|
|
6
7
|
import { HttpClient } from '../../../shared/http';
|
|
7
8
|
import { getSystemMetricsCollector, } from '../../../shared/metrics';
|
|
8
9
|
import * as net from 'net';
|
|
9
10
|
import { execFile } from 'child_process';
|
|
10
|
-
import { validateCommand } from '../../../
|
|
11
|
+
import { validateCommand } from '../../../shared/security/command-validator.js';
|
|
11
12
|
import { toErrorMessage, toError } from '../../../shared/error-utils.js';
|
|
12
13
|
import { safeJsonParse } from '../../../shared/safe-json.js';
|
|
13
14
|
import { secureRandom } from '../../../shared/utils/crypto-random.js';
|
|
@@ -25,6 +26,7 @@ const DEFAULT_CONFIG = {
|
|
|
25
26
|
* Chaos Engineering Service Implementation
|
|
26
27
|
* Manages chaos experiments, fault injection, and steady state verification
|
|
27
28
|
*/
|
|
29
|
+
const logger = LoggerFactory.create('chaos-resilience/chaos-engineer');
|
|
28
30
|
export class ChaosEngineerService {
|
|
29
31
|
config;
|
|
30
32
|
activeExperiments = new Map();
|
|
@@ -54,7 +56,7 @@ export class ChaosEngineerService {
|
|
|
54
56
|
// ADR-051: Get LLM analysis of experiment hypothesis if available
|
|
55
57
|
const llmAnalysis = await this.analyzeExperimentWithLLM(experiment);
|
|
56
58
|
if (llmAnalysis) {
|
|
57
|
-
|
|
59
|
+
logger.info(`LLM Analysis:\n${llmAnalysis}`);
|
|
58
60
|
}
|
|
59
61
|
// Store experiment
|
|
60
62
|
await this.memory.set(`chaos:experiments:${experiment.id}`, experiment, { namespace: 'chaos-resilience', persist: true });
|
|
@@ -322,7 +324,7 @@ Provide:
|
|
|
322
324
|
return response.content;
|
|
323
325
|
}
|
|
324
326
|
catch (error) {
|
|
325
|
-
|
|
327
|
+
logger.warn('LLM analysis failed:');
|
|
326
328
|
return null;
|
|
327
329
|
}
|
|
328
330
|
}
|
|
@@ -434,7 +436,7 @@ Provide:
|
|
|
434
436
|
circuitBreaker: false,
|
|
435
437
|
});
|
|
436
438
|
if (!result.success) {
|
|
437
|
-
|
|
439
|
+
logger.info(`HTTP probe failed: ${probe.name} -> ${result.error.message}`);
|
|
438
440
|
return false;
|
|
439
441
|
}
|
|
440
442
|
const response = result.value;
|
|
@@ -442,7 +444,7 @@ Provide:
|
|
|
442
444
|
if (probe.expectedStatus !== undefined) {
|
|
443
445
|
const passed = response.status === probe.expectedStatus;
|
|
444
446
|
if (!passed) {
|
|
445
|
-
|
|
447
|
+
logger.info(`HTTP probe ${probe.name}: expected status ${probe.expectedStatus}, got ${response.status}`);
|
|
446
448
|
}
|
|
447
449
|
return passed;
|
|
448
450
|
}
|
|
@@ -450,7 +452,7 @@ Provide:
|
|
|
450
452
|
return response.ok;
|
|
451
453
|
}
|
|
452
454
|
catch (error) {
|
|
453
|
-
|
|
455
|
+
logger.info(`HTTP probe error: ${probe.name} -> ${toErrorMessage(error)}`);
|
|
454
456
|
return false;
|
|
455
457
|
}
|
|
456
458
|
}
|
|
@@ -461,7 +463,7 @@ Provide:
|
|
|
461
463
|
const [host, portStr] = probe.target.split(':');
|
|
462
464
|
const port = parseInt(portStr, 10);
|
|
463
465
|
if (!host || isNaN(port)) {
|
|
464
|
-
|
|
466
|
+
logger.info(`TCP probe invalid target: ${probe.target} (expected host:port)`);
|
|
465
467
|
resolve(false);
|
|
466
468
|
return;
|
|
467
469
|
}
|
|
@@ -469,7 +471,7 @@ Provide:
|
|
|
469
471
|
const socket = new net.Socket();
|
|
470
472
|
const timer = setTimeout(() => {
|
|
471
473
|
socket.destroy();
|
|
472
|
-
|
|
474
|
+
logger.info(`TCP probe timeout: ${probe.name} -> ${probe.target}`);
|
|
473
475
|
resolve(false);
|
|
474
476
|
}, timeout);
|
|
475
477
|
socket.connect(port, host, () => {
|
|
@@ -480,12 +482,12 @@ Provide:
|
|
|
480
482
|
socket.on('error', (err) => {
|
|
481
483
|
clearTimeout(timer);
|
|
482
484
|
socket.destroy();
|
|
483
|
-
|
|
485
|
+
logger.info(`TCP probe error: ${probe.name} -> ${err.message}`);
|
|
484
486
|
resolve(false);
|
|
485
487
|
});
|
|
486
488
|
}
|
|
487
489
|
catch (error) {
|
|
488
|
-
|
|
490
|
+
logger.info(`TCP probe exception: ${probe.name} -> ${toErrorMessage(error)}`);
|
|
489
491
|
resolve(false);
|
|
490
492
|
}
|
|
491
493
|
});
|
|
@@ -511,8 +513,8 @@ Provide:
|
|
|
511
513
|
// Validate command against whitelist to prevent injection (CWE-78)
|
|
512
514
|
const validation = validateCommand(probe.target, ChaosEngineerService.ALLOWED_PROBE_COMMANDS);
|
|
513
515
|
if (!validation.valid) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
+
logger.info(`Command probe ${probe.name} blocked: ${validation.error}`);
|
|
517
|
+
logger.info(`Blocked patterns: ${validation.blockedPatterns?.join(', ') || 'none'}`);
|
|
516
518
|
resolve(false);
|
|
517
519
|
return;
|
|
518
520
|
}
|
|
@@ -524,7 +526,7 @@ Provide:
|
|
|
524
526
|
// Use execFile instead of exec to avoid shell interpretation
|
|
525
527
|
execFile(executable, args, { timeout }, (error, stdout, _stderr) => {
|
|
526
528
|
if (error) {
|
|
527
|
-
|
|
529
|
+
logger.info(`Command probe failed: ${probe.name} -> ${error.message}`);
|
|
528
530
|
resolve(false);
|
|
529
531
|
return;
|
|
530
532
|
}
|
|
@@ -532,7 +534,7 @@ Provide:
|
|
|
532
534
|
if (probe.expectedOutput !== undefined) {
|
|
533
535
|
const passed = stdout.trim().includes(probe.expectedOutput);
|
|
534
536
|
if (!passed) {
|
|
535
|
-
|
|
537
|
+
logger.info(`Command probe ${probe.name}: output did not contain expected value`);
|
|
536
538
|
}
|
|
537
539
|
resolve(passed);
|
|
538
540
|
return;
|
|
@@ -551,12 +553,12 @@ Provide:
|
|
|
551
553
|
circuitBreaker: false,
|
|
552
554
|
});
|
|
553
555
|
if (!result.success) {
|
|
554
|
-
|
|
556
|
+
logger.info(`Metric probe failed: ${probe.name} -> ${result.error.message}`);
|
|
555
557
|
return false;
|
|
556
558
|
}
|
|
557
559
|
const response = result.value;
|
|
558
560
|
if (!response.ok) {
|
|
559
|
-
|
|
561
|
+
logger.info(`Metric probe HTTP error: ${probe.name} -> ${response.status}`);
|
|
560
562
|
return false;
|
|
561
563
|
}
|
|
562
564
|
// Parse response body for metric value
|
|
@@ -571,7 +573,7 @@ Provide:
|
|
|
571
573
|
metricValue = parseFloat(text);
|
|
572
574
|
}
|
|
573
575
|
if (isNaN(metricValue)) {
|
|
574
|
-
|
|
576
|
+
logger.info(`Metric probe ${probe.name}: could not parse metric value from response`);
|
|
575
577
|
return false;
|
|
576
578
|
}
|
|
577
579
|
// Check threshold if specified
|
|
@@ -589,7 +591,7 @@ Provide:
|
|
|
589
591
|
return true;
|
|
590
592
|
}
|
|
591
593
|
catch (error) {
|
|
592
|
-
|
|
594
|
+
logger.info(`Metric probe error: ${probe.name} -> ${toErrorMessage(error)}`);
|
|
593
595
|
return false;
|
|
594
596
|
}
|
|
595
597
|
}
|
|
@@ -616,27 +618,27 @@ Provide:
|
|
|
616
618
|
// Latency injection is typically done at proxy/network level
|
|
617
619
|
// For simulation, we store the config and check during probe execution
|
|
618
620
|
const latencyMs = fault.parameters.latencyMs ?? 100;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
+
logger.info(`Latency injection configured: ${latencyMs}ms for ${fault.target.selector}`);
|
|
622
|
+
logger.info(`Note: Actual latency injection requires network proxy (e.g., Toxiproxy, tc)`);
|
|
621
623
|
return ok(1);
|
|
622
624
|
}
|
|
623
625
|
async injectError(fault) {
|
|
624
626
|
// Error injection typically requires proxy/service mesh
|
|
625
627
|
const errorCode = fault.parameters.errorCode ?? 500;
|
|
626
|
-
|
|
627
|
-
|
|
628
|
+
logger.info(`Error injection configured: ${errorCode} for ${fault.target.selector}`);
|
|
629
|
+
logger.info(`Note: Actual error injection requires service mesh (e.g., Istio, Linkerd)`);
|
|
628
630
|
return ok(1);
|
|
629
631
|
}
|
|
630
632
|
async injectTimeout(fault) {
|
|
631
633
|
// Timeout injection via proxy configuration
|
|
632
|
-
|
|
633
|
-
|
|
634
|
+
logger.info(`Timeout injection configured for ${fault.target.selector}`);
|
|
635
|
+
logger.info(`Note: Actual timeout injection requires network proxy configuration`);
|
|
634
636
|
return ok(1);
|
|
635
637
|
}
|
|
636
638
|
async injectPacketLoss(fault) {
|
|
637
639
|
const lossPercent = fault.parameters.packetLossPercent ?? 10;
|
|
638
|
-
|
|
639
|
-
|
|
640
|
+
logger.info(`Packet loss configured: ${lossPercent}% for ${fault.target.selector}`);
|
|
641
|
+
logger.info(`Note: Actual packet loss requires tc/iptables (Linux) or similar`);
|
|
640
642
|
return ok(1);
|
|
641
643
|
}
|
|
642
644
|
async injectCpuStress(fault) {
|
|
@@ -644,7 +646,7 @@ Provide:
|
|
|
644
646
|
const cpuPercent = fault.parameters.cpuPercent ?? 80;
|
|
645
647
|
const cores = fault.parameters.cores ?? 1;
|
|
646
648
|
const duration = fault.duration;
|
|
647
|
-
|
|
649
|
+
logger.info(`Injecting CPU stress: ${cpuPercent}% on ${cores} core(s) for ${duration}ms`);
|
|
648
650
|
// Create CPU-intensive work
|
|
649
651
|
const startTime = Date.now();
|
|
650
652
|
const workInterval = setInterval(() => {
|
|
@@ -669,7 +671,7 @@ Provide:
|
|
|
669
671
|
// Real memory stress implementation by allocating buffers
|
|
670
672
|
const memoryBytes = fault.parameters.memoryBytes ?? 1024 * 1024 * 100; // 100MB default
|
|
671
673
|
const memoryMB = Math.round(memoryBytes / (1024 * 1024));
|
|
672
|
-
|
|
674
|
+
logger.info(`Injecting memory stress: ${memoryMB}MB allocation`);
|
|
673
675
|
try {
|
|
674
676
|
// Allocate memory in chunks to avoid single large allocation issues
|
|
675
677
|
const chunkSize = 1024 * 1024; // 1MB chunks
|
|
@@ -683,7 +685,7 @@ Provide:
|
|
|
683
685
|
}
|
|
684
686
|
// Store reference to prevent garbage collection
|
|
685
687
|
this.stressWorkers.set(fault.id, allocatedMemory);
|
|
686
|
-
|
|
688
|
+
logger.info(`Memory stress active: ${allocatedMemory.length} chunks allocated`);
|
|
687
689
|
return ok(1);
|
|
688
690
|
}
|
|
689
691
|
catch (error) {
|
|
@@ -692,36 +694,36 @@ Provide:
|
|
|
692
694
|
}
|
|
693
695
|
async injectDiskStress(fault) {
|
|
694
696
|
// Disk stress would require file system operations
|
|
695
|
-
|
|
696
|
-
|
|
697
|
+
logger.info(`Disk stress configured for ${fault.target.selector}`);
|
|
698
|
+
logger.info(`Note: Actual disk stress requires file system write permissions`);
|
|
697
699
|
return ok(1);
|
|
698
700
|
}
|
|
699
701
|
async injectNetworkPartition(fault) {
|
|
700
702
|
// Network partition typically requires iptables or similar
|
|
701
|
-
|
|
702
|
-
|
|
703
|
+
logger.info(`Network partition configured for ${fault.target.selector}`);
|
|
704
|
+
logger.info(`Note: Actual network partition requires iptables/firewall rules`);
|
|
703
705
|
return ok(1);
|
|
704
706
|
}
|
|
705
707
|
async injectDnsFailure(fault) {
|
|
706
708
|
// DNS failure injection via /etc/hosts or DNS server configuration
|
|
707
|
-
|
|
708
|
-
|
|
709
|
+
logger.info(`DNS failure configured for ${fault.target.selector}`);
|
|
710
|
+
logger.info(`Note: Actual DNS failure requires DNS server or /etc/hosts modification`);
|
|
709
711
|
return ok(1);
|
|
710
712
|
}
|
|
711
713
|
async injectProcessKill(fault) {
|
|
712
714
|
// Process kill via system commands
|
|
713
715
|
const processPattern = fault.target.selector;
|
|
714
|
-
|
|
715
|
-
|
|
716
|
+
logger.info(`Process kill configured for pattern: ${processPattern}`);
|
|
717
|
+
logger.info(`Note: Actual process kill requires appropriate permissions`);
|
|
716
718
|
// In dry-run mode or without permissions, just log
|
|
717
719
|
if (this.config.enableDryRun) {
|
|
718
|
-
|
|
720
|
+
logger.info(`Would kill processes matching: ${processPattern}`);
|
|
719
721
|
return ok(0);
|
|
720
722
|
}
|
|
721
723
|
return ok(1);
|
|
722
724
|
}
|
|
723
725
|
async performFaultRemoval(fault) {
|
|
724
|
-
|
|
726
|
+
logger.info(`Removing fault: ${fault.id} (${fault.type})`);
|
|
725
727
|
// Clean up any active stress workers
|
|
726
728
|
const worker = this.stressWorkers.get(fault.id);
|
|
727
729
|
if (worker) {
|
|
@@ -830,12 +832,12 @@ Provide:
|
|
|
830
832
|
async rollbackExperiment(experiment) {
|
|
831
833
|
// Execute rollback steps in order
|
|
832
834
|
for (const step of experiment.rollbackPlan.steps.sort((a, b) => a.order - b.order)) {
|
|
833
|
-
|
|
835
|
+
logger.info(`Executing rollback step ${step.order}: ${step.action}`);
|
|
834
836
|
try {
|
|
835
837
|
await this.executeRollbackAction(step.action, step.target, step.timeout);
|
|
836
838
|
}
|
|
837
839
|
catch (error) {
|
|
838
|
-
|
|
840
|
+
logger.error(`Rollback step ${step.order} failed: ${toErrorMessage(error)}`);
|
|
839
841
|
// Continue with other rollback steps even if one fails
|
|
840
842
|
}
|
|
841
843
|
}
|
|
@@ -912,20 +914,20 @@ Provide:
|
|
|
912
914
|
if (actionLower.includes('remove') || actionLower.includes('clear')) {
|
|
913
915
|
// Clear any remaining state
|
|
914
916
|
if (target) {
|
|
915
|
-
|
|
917
|
+
logger.info(`Clearing state for target: ${target}`);
|
|
916
918
|
}
|
|
917
919
|
}
|
|
918
920
|
else if (actionLower.includes('restart')) {
|
|
919
921
|
// Restart service (log only - actual restart would require orchestration)
|
|
920
|
-
|
|
922
|
+
logger.info(`Restart requested for: ${target || 'service'}`);
|
|
921
923
|
}
|
|
922
924
|
else if (actionLower.includes('restore')) {
|
|
923
925
|
// Restore to previous state
|
|
924
|
-
|
|
926
|
+
logger.info(`Restore requested for: ${target || 'system'}`);
|
|
925
927
|
}
|
|
926
928
|
else {
|
|
927
929
|
// Log-only for description actions
|
|
928
|
-
|
|
930
|
+
logger.info(`Rollback action logged: ${action}`);
|
|
929
931
|
}
|
|
930
932
|
// Brief pause between actions
|
|
931
933
|
await this.sleep(100);
|
|
@@ -20,10 +20,6 @@ export interface PerformanceProfilerConfig {
|
|
|
20
20
|
*/
|
|
21
21
|
simulateRandomFailures: boolean;
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Performance Profiler Service Implementation
|
|
25
|
-
* Tests system resilience, recovery, failover, circuit breakers, and rate limiting
|
|
26
|
-
*/
|
|
27
23
|
export declare class PerformanceProfilerService implements IResilienceTestingService {
|
|
28
24
|
private readonly memory;
|
|
29
25
|
private readonly config;
|