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
|
@@ -54,12 +54,6 @@ export interface LLMRequirementsAnalysis {
|
|
|
54
54
|
/** Whether analysis was enhanced by LLM */
|
|
55
55
|
llmEnhanced: boolean;
|
|
56
56
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Requirements Validation Service Implementation
|
|
59
|
-
* Validates requirement quality, detects ambiguity, and analyzes dependencies
|
|
60
|
-
*
|
|
61
|
-
* ADR-051: Added LLM-powered requirements analysis for enhanced validation
|
|
62
|
-
*/
|
|
63
57
|
export declare class RequirementsValidatorService implements IRequirementsValidationService {
|
|
64
58
|
private readonly config;
|
|
65
59
|
private readonly memory;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* ADR-051: Added LLM-powered requirements analysis for enhanced validation
|
|
6
6
|
*/
|
|
7
7
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
8
9
|
import { ok, err } from '../../../shared/types/index.js';
|
|
9
10
|
import { toError } from '../../../shared/error-utils.js';
|
|
10
11
|
import { safeJsonParse } from '../../../shared/safe-json.js';
|
|
@@ -53,6 +54,7 @@ const AMBIGUOUS_TERMS = {
|
|
|
53
54
|
*
|
|
54
55
|
* ADR-051: Added LLM-powered requirements analysis for enhanced validation
|
|
55
56
|
*/
|
|
57
|
+
const logger = LoggerFactory.create('requirements-validation/requirements-validator');
|
|
56
58
|
export class RequirementsValidatorService {
|
|
57
59
|
config;
|
|
58
60
|
memory;
|
|
@@ -155,13 +157,13 @@ Be specific and actionable in your suggestions.`,
|
|
|
155
157
|
}
|
|
156
158
|
catch {
|
|
157
159
|
// JSON parse failed - use basic analysis
|
|
158
|
-
|
|
160
|
+
logger.warn('LLM response parsing failed');
|
|
159
161
|
}
|
|
160
162
|
}
|
|
161
163
|
return ok(this.getBasicAnalysis(requirements));
|
|
162
164
|
}
|
|
163
165
|
catch (error) {
|
|
164
|
-
|
|
166
|
+
logger.warn('LLM analysis failed');
|
|
165
167
|
return ok(this.getBasicAnalysis(requirements));
|
|
166
168
|
}
|
|
167
169
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* - DQN Algorithm: Optimizes security test prioritization
|
|
7
7
|
* - QEFlashAttention: Fast vulnerability similarity matching
|
|
8
8
|
*/
|
|
9
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
9
10
|
import { v4 as uuidv4 } from 'uuid';
|
|
10
11
|
import { toError } from '../../shared/error-utils.js';
|
|
11
12
|
import { ok, err, } from '../../shared/types/index.js';
|
|
@@ -47,6 +48,7 @@ const DEFAULT_CONFIG = {
|
|
|
47
48
|
// ============================================================================
|
|
48
49
|
// Security & Compliance Coordinator Implementation
|
|
49
50
|
// ============================================================================
|
|
51
|
+
const logger = LoggerFactory.create('security-compliance');
|
|
50
52
|
export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
51
53
|
memory;
|
|
52
54
|
agentCoordinator;
|
|
@@ -135,16 +137,16 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
135
137
|
...this.config.consensusEngineConfig,
|
|
136
138
|
},
|
|
137
139
|
});
|
|
138
|
-
|
|
140
|
+
logger.info(`Multi-Model Consensus initialized with ${providers.length} providers`);
|
|
139
141
|
}
|
|
140
142
|
else {
|
|
141
|
-
|
|
143
|
+
logger.warn('No model providers available for consensus verification');
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
this.rlInitialized = true;
|
|
145
147
|
}
|
|
146
148
|
catch (error) {
|
|
147
|
-
|
|
149
|
+
logger.error('Failed to initialize RL integrations:', error instanceof Error ? error : undefined);
|
|
148
150
|
throw error;
|
|
149
151
|
}
|
|
150
152
|
}
|
|
@@ -175,18 +177,18 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
175
177
|
);
|
|
176
178
|
// For security audits, we're the scan itself, so we just log the governance check
|
|
177
179
|
if (!validation.allowed && this.securityGovernanceMixin.isStrictMode()) {
|
|
178
|
-
|
|
180
|
+
logger.info(`Security audit for auth code registered with governance`);
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
183
|
// Self-healing: Check if operations should be paused due to critical topology
|
|
182
184
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
183
|
-
|
|
185
|
+
logger.warn(`Security audit paused: topology is in critical state`);
|
|
184
186
|
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
185
187
|
return err(new Error('Security audit paused: topology is in critical state'));
|
|
186
188
|
}
|
|
187
189
|
// Self-healing: Log warning and potentially reduce scope when topology is degraded
|
|
188
190
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
189
|
-
|
|
191
|
+
logger.warn(`Topology degraded, using conservative audit strategy`);
|
|
190
192
|
// Could reduce parallel operations, prioritize critical checks, etc.
|
|
191
193
|
}
|
|
192
194
|
// Check agent availability
|
|
@@ -246,13 +248,13 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
246
248
|
this.startWorkflow(workflowId, 'scan');
|
|
247
249
|
// Self-healing: Check if operations should be paused due to critical topology
|
|
248
250
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
249
|
-
|
|
251
|
+
logger.warn(`Security scan paused: topology is in critical state`);
|
|
250
252
|
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
251
253
|
return err(new Error('Security scan paused: topology is in critical state'));
|
|
252
254
|
}
|
|
253
255
|
// Self-healing: Log warning when topology is degraded
|
|
254
256
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
255
|
-
|
|
257
|
+
logger.warn(`Topology degraded, proceeding with conservative scan strategy`);
|
|
256
258
|
}
|
|
257
259
|
// Run scan based on type
|
|
258
260
|
let result;
|
|
@@ -289,13 +291,13 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
289
291
|
this.startWorkflow(workflowId, 'compliance');
|
|
290
292
|
// Self-healing: Check if operations should be paused due to critical topology
|
|
291
293
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
292
|
-
|
|
294
|
+
logger.warn(`Compliance validation paused: topology is in critical state`);
|
|
293
295
|
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
294
296
|
return err(new Error('Compliance validation paused: topology is in critical state'));
|
|
295
297
|
}
|
|
296
298
|
// Self-healing: Log warning when topology is degraded
|
|
297
299
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
298
|
-
|
|
300
|
+
logger.warn(`Topology degraded, proceeding with compliance validation`);
|
|
299
301
|
}
|
|
300
302
|
// Get standard by ID and validate
|
|
301
303
|
const standards = await this.complianceValidator.getAvailableStandards();
|
|
@@ -331,13 +333,13 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
331
333
|
this.startWorkflow(workflowId, 'posture');
|
|
332
334
|
// Self-healing: Check if operations should be paused due to critical topology
|
|
333
335
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
334
|
-
|
|
336
|
+
logger.warn(`Security posture assessment paused: topology is in critical state`);
|
|
335
337
|
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
336
338
|
return err(new Error('Security posture assessment paused: topology is in critical state'));
|
|
337
339
|
}
|
|
338
340
|
// Self-healing: Log warning when topology is degraded
|
|
339
341
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
340
|
-
|
|
342
|
+
logger.warn(`Topology degraded, proceeding with security posture assessment`);
|
|
341
343
|
}
|
|
342
344
|
const result = await this.securityAuditor.getSecurityPosture();
|
|
343
345
|
if (result.success) {
|
|
@@ -409,7 +411,7 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
409
411
|
return scored.map((s) => s.test);
|
|
410
412
|
}
|
|
411
413
|
catch (error) {
|
|
412
|
-
|
|
414
|
+
logger.error('Failed to prioritize security tests:', error instanceof Error ? error : undefined);
|
|
413
415
|
return tests;
|
|
414
416
|
}
|
|
415
417
|
}
|
|
@@ -441,10 +443,10 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
441
443
|
timestamp: new Date(),
|
|
442
444
|
};
|
|
443
445
|
await this.dqnAlgorithm.train(experience);
|
|
444
|
-
|
|
446
|
+
logger.info(`Trained security audit with reward: ${reward.toFixed(3)}`);
|
|
445
447
|
}
|
|
446
448
|
catch (error) {
|
|
447
|
-
|
|
449
|
+
logger.error('Failed to train DQN:', error instanceof Error ? error : undefined);
|
|
448
450
|
}
|
|
449
451
|
}
|
|
450
452
|
/**
|
|
@@ -530,12 +532,12 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
530
532
|
const outputSlice = Array.from(attentionResult.slice(i * dim, (i + 1) * dim));
|
|
531
533
|
const selfSimilarity = embeddings[i].reduce((sum, val, idx) => sum + val * outputSlice[idx], 0);
|
|
532
534
|
if (selfSimilarity > 0.7) {
|
|
533
|
-
|
|
535
|
+
logger.info(`High self-attention for vulnerability ${vulnerabilities[i].id}`);
|
|
534
536
|
}
|
|
535
537
|
}
|
|
536
538
|
}
|
|
537
539
|
catch (error) {
|
|
538
|
-
|
|
540
|
+
logger.error('Failed to enhance vulnerability analysis:', error instanceof Error ? error : undefined);
|
|
539
541
|
}
|
|
540
542
|
}
|
|
541
543
|
/**
|
|
@@ -692,28 +694,28 @@ export class SecurityComplianceCoordinator extends BaseDomainCoordinator {
|
|
|
692
694
|
const result = await this.consensusMixin.verifyFinding(domainFinding);
|
|
693
695
|
if (result.success && result.value.verdict === 'verified') {
|
|
694
696
|
// Finding confirmed by multiple models
|
|
695
|
-
|
|
697
|
+
logger.info(`Consensus VERIFIED: ${vuln.title} (confidence: ${(result.value.confidence * 100).toFixed(1)}%)`);
|
|
696
698
|
verified.push(vuln);
|
|
697
699
|
}
|
|
698
700
|
else if (result.success && result.value.verdict === 'disputed') {
|
|
699
701
|
// Disputed findings still included but logged
|
|
700
|
-
|
|
702
|
+
logger.info(`Consensus DISPUTED: ${vuln.title} - including with lower confidence`);
|
|
701
703
|
verified.push(vuln);
|
|
702
704
|
}
|
|
703
705
|
else {
|
|
704
706
|
// Rejected by consensus - likely false positive
|
|
705
|
-
|
|
707
|
+
logger.info(`Consensus REJECTED: ${vuln.title} - likely false positive`);
|
|
706
708
|
}
|
|
707
709
|
}
|
|
708
710
|
catch (error) {
|
|
709
711
|
// On consensus error, include the finding but log warning
|
|
710
|
-
|
|
712
|
+
logger.warn(`Consensus error verifying ${vuln.title}, including by default:`);
|
|
711
713
|
verified.push(vuln);
|
|
712
714
|
}
|
|
713
715
|
}
|
|
714
716
|
const rejectedCount = highSeverity.length - verified.filter(v => v.severity === 'critical' || v.severity === 'high').length;
|
|
715
717
|
if (rejectedCount > 0) {
|
|
716
|
-
|
|
718
|
+
logger.info(`Consensus filtered out ${rejectedCount} likely false positive(s)`);
|
|
717
719
|
}
|
|
718
720
|
return verified;
|
|
719
721
|
}
|
|
@@ -4,27 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Result } from '@shared/types/index.js';
|
|
6
6
|
import type { SecurityScannerConfig, DASTResult, DASTOptions, AuthCredentials, MemoryBackend, ScanStatus } from './scanner-types.js';
|
|
7
|
-
/**
|
|
8
|
-
* DAST Scanner - Dynamic Application Security Testing
|
|
9
|
-
* Scans running applications for security vulnerabilities
|
|
10
|
-
*
|
|
11
|
-
* **Capabilities:**
|
|
12
|
-
* - Security header analysis (HSTS, CSP, X-Frame-Options, etc.)
|
|
13
|
-
* - Cookie security (Secure, HttpOnly, SameSite flags)
|
|
14
|
-
* - CORS misconfiguration detection
|
|
15
|
-
* - Sensitive file exposure (/.git, /.env, etc.)
|
|
16
|
-
* - Link crawling with same-origin scope
|
|
17
|
-
* - XSS reflection testing (GET parameters)
|
|
18
|
-
* - SQL injection error-based detection (GET parameters)
|
|
19
|
-
* - Form security analysis (CSRF tokens, autocomplete, action URLs)
|
|
20
|
-
*
|
|
21
|
-
* **Limitations:**
|
|
22
|
-
* - Injection testing: GET parameters only (POST form submission not implemented)
|
|
23
|
-
* - Crawling: Same-origin only, max 10 links per page, single depth
|
|
24
|
-
* - Auth flows: Header-based only, no login form automation
|
|
25
|
-
* - No JavaScript execution (static response analysis only)
|
|
26
|
-
* - No session management testing beyond cookie attributes
|
|
27
|
-
*/
|
|
28
7
|
export declare class DASTScanner {
|
|
29
8
|
private readonly config;
|
|
30
9
|
private readonly memory;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - DAST (Dynamic Application Security Testing) Scanner
|
|
3
3
|
* Performs dynamic analysis of running applications to detect security vulnerabilities
|
|
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/index.js';
|
|
7
8
|
import { toError } from '@shared/error-utils.js';
|
|
@@ -30,6 +31,7 @@ import { analyzeSecurityHeaders, analyzeCookieSecurity, analyzeServerHeaders, sc
|
|
|
30
31
|
* - No JavaScript execution (static response analysis only)
|
|
31
32
|
* - No session management testing beyond cookie attributes
|
|
32
33
|
*/
|
|
34
|
+
const logger = LoggerFactory.create('security-compliance/dast-scanner');
|
|
33
35
|
export class DASTScanner {
|
|
34
36
|
config;
|
|
35
37
|
memory;
|
|
@@ -186,7 +188,7 @@ export class DASTScanner {
|
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
190
|
catch (error) {
|
|
189
|
-
|
|
191
|
+
logger.error('DAST scan error:', error instanceof Error ? error : undefined);
|
|
190
192
|
}
|
|
191
193
|
return { vulnerabilities, crawledUrls };
|
|
192
194
|
}
|
|
@@ -247,7 +249,7 @@ export class DASTScanner {
|
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
251
|
catch (error) {
|
|
250
|
-
|
|
252
|
+
logger.error('Authenticated DAST scan error:', error instanceof Error ? error : undefined);
|
|
251
253
|
}
|
|
252
254
|
return { vulnerabilities, crawledUrls };
|
|
253
255
|
}
|
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
import { Result } from '@shared/types/index.js';
|
|
6
6
|
import type { FilePath } from '@shared/value-objects/index.js';
|
|
7
7
|
import type { SecurityScannerConfig, Vulnerability, RemediationAdvice, SASTResult, RuleSet, FalsePositiveCheck, MemoryBackend, HybridRouter, ScanStatus } from './scanner-types.js';
|
|
8
|
-
/**
|
|
9
|
-
* SAST Scanner - Static Application Security Testing
|
|
10
|
-
* Scans source code files for security vulnerabilities using pattern matching
|
|
11
|
-
*/
|
|
12
8
|
export declare class SASTScanner {
|
|
13
9
|
private readonly config;
|
|
14
10
|
private readonly memory;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - SAST (Static Application Security Testing) Scanner
|
|
3
3
|
* Performs static code analysis to detect security vulnerabilities
|
|
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/index.js';
|
|
7
8
|
import { ALL_SECURITY_PATTERNS, BUILT_IN_RULE_SETS } from './security-patterns.js';
|
|
@@ -15,6 +16,7 @@ import { isSemgrepAvailable, runSemgrepWithRules, convertSemgrepFindings, } from
|
|
|
15
16
|
* SAST Scanner - Static Application Security Testing
|
|
16
17
|
* Scans source code files for security vulnerabilities using pattern matching
|
|
17
18
|
*/
|
|
19
|
+
const logger = LoggerFactory.create('security-compliance/sast-scanner');
|
|
18
20
|
export class SASTScanner {
|
|
19
21
|
config;
|
|
20
22
|
memory;
|
|
@@ -557,7 +559,7 @@ Provide detailed remediation advice specific to this code.`,
|
|
|
557
559
|
}
|
|
558
560
|
}
|
|
559
561
|
catch (error) {
|
|
560
|
-
|
|
562
|
+
logger.warn('LLM analysis failed:');
|
|
561
563
|
}
|
|
562
564
|
return this.getDefaultRemediation(vuln);
|
|
563
565
|
}
|
|
@@ -3,9 +3,5 @@
|
|
|
3
3
|
* Extracted from security-auditor.ts - Dynamic Application Security Testing
|
|
4
4
|
*/
|
|
5
5
|
import type { DASTResult } from '../interfaces.js';
|
|
6
|
-
/**
|
|
7
|
-
* Perform DAST scan using HTTP requests to test for vulnerabilities
|
|
8
|
-
* Tests for common web vulnerabilities: XSS, SQL injection, security headers, etc.
|
|
9
|
-
*/
|
|
10
6
|
export declare function performDASTScan(targetUrl: string): Promise<DASTResult>;
|
|
11
7
|
//# sourceMappingURL=security-auditor-dast.d.ts.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Security Auditor DAST Scanner
|
|
3
3
|
* Extracted from security-auditor.ts - Dynamic Application Security Testing
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
5
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
7
|
import { toErrorMessage } from '../../../shared/error-utils.js';
|
|
7
8
|
// ============================================================================
|
|
@@ -11,6 +12,7 @@ import { toErrorMessage } from '../../../shared/error-utils.js';
|
|
|
11
12
|
* Perform DAST scan using HTTP requests to test for vulnerabilities
|
|
12
13
|
* Tests for common web vulnerabilities: XSS, SQL injection, security headers, etc.
|
|
13
14
|
*/
|
|
15
|
+
const logger = LoggerFactory.create('security-compliance/security-auditor-dast');
|
|
14
16
|
export async function performDASTScan(targetUrl) {
|
|
15
17
|
const scanId = uuidv4();
|
|
16
18
|
const startTime = Date.now();
|
|
@@ -241,7 +243,7 @@ export async function performDASTScan(targetUrl) {
|
|
|
241
243
|
}
|
|
242
244
|
}
|
|
243
245
|
catch (error) {
|
|
244
|
-
|
|
246
|
+
logger.error('DAST scan failed:', error instanceof Error ? error : undefined);
|
|
245
247
|
}
|
|
246
248
|
const scanDurationMs = Date.now() - startTime;
|
|
247
249
|
// Calculate summary
|
|
@@ -14,9 +14,6 @@ interface SASTVulnerabilityPattern {
|
|
|
14
14
|
fixExample?: string;
|
|
15
15
|
cweId: string;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Get the default SAST vulnerability patterns for JS/TS analysis
|
|
19
|
-
*/
|
|
20
17
|
export declare function getSASTVulnerabilityPatterns(): SASTVulnerabilityPattern[];
|
|
21
18
|
/**
|
|
22
19
|
* Perform SAST scan using AST-based analysis for JavaScript/TypeScript
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
* Agentic QE v3 - Security Auditor SAST Scanner
|
|
3
3
|
* Extracted from security-auditor.ts - Static Application Security Testing
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
5
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
7
|
import * as fs from 'fs/promises';
|
|
7
8
|
import * as path from 'path';
|
|
8
9
|
/**
|
|
9
10
|
* Get the default SAST vulnerability patterns for JS/TS analysis
|
|
10
11
|
*/
|
|
12
|
+
const logger = LoggerFactory.create('security-compliance/security-auditor-sast');
|
|
11
13
|
export function getSASTVulnerabilityPatterns() {
|
|
12
14
|
return [
|
|
13
15
|
// SQL Injection patterns
|
|
@@ -233,7 +235,7 @@ export async function performSASTScan(findSourceFiles, shouldExclude) {
|
|
|
233
235
|
}
|
|
234
236
|
}
|
|
235
237
|
catch (error) {
|
|
236
|
-
|
|
238
|
+
logger.error('SAST scan failed:', error instanceof Error ? error : undefined);
|
|
237
239
|
}
|
|
238
240
|
const scanDurationMs = Date.now() - startTime;
|
|
239
241
|
// Calculate summary
|
|
@@ -10,9 +10,6 @@ interface SecretPattern {
|
|
|
10
10
|
regex: RegExp;
|
|
11
11
|
entropyThreshold?: number;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Get the comprehensive set of secret detection patterns
|
|
15
|
-
*/
|
|
16
13
|
export declare function getSecretPatterns(): SecretPattern[];
|
|
17
14
|
/**
|
|
18
15
|
* Calculate Shannon entropy of a string
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Agentic QE v3 - Security Auditor Secret Scanner
|
|
3
3
|
* Extracted from security-auditor.ts - Secret/credential detection
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
5
6
|
import * as fs from 'fs/promises';
|
|
6
7
|
/**
|
|
7
8
|
* Get the comprehensive set of secret detection patterns
|
|
8
9
|
*/
|
|
10
|
+
const logger = LoggerFactory.create('security-compliance/security-auditor-secrets');
|
|
9
11
|
export function getSecretPatterns() {
|
|
10
12
|
return [
|
|
11
13
|
// AWS Keys
|
|
@@ -229,7 +231,7 @@ export async function scanFileForSecrets(file) {
|
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
233
|
catch (error) {
|
|
232
|
-
|
|
234
|
+
logger.error(`Failed to scan file for secrets: ${file.value}`, error instanceof Error ? error : undefined);
|
|
233
235
|
}
|
|
234
236
|
return secrets;
|
|
235
237
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* - security-auditor-secrets.ts: Secret/credential detection
|
|
10
10
|
* - security-auditor-reports.ts: Risk calculation, posture, recommendations
|
|
11
11
|
*/
|
|
12
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
12
13
|
import { v4 as uuidv4 } from 'uuid';
|
|
13
14
|
import * as fs from 'fs/promises';
|
|
14
15
|
import * as path from 'path';
|
|
@@ -25,6 +26,7 @@ import { calculateOverallRisk, generateRecommendations, countBySeverity, countOp
|
|
|
25
26
|
// ============================================================================
|
|
26
27
|
// Security Auditor Service Implementation
|
|
27
28
|
// ============================================================================
|
|
29
|
+
const logger = LoggerFactory.create('security-compliance/security-auditor');
|
|
28
30
|
export class SecurityAuditorService {
|
|
29
31
|
memory;
|
|
30
32
|
config;
|
|
@@ -269,7 +271,7 @@ export class SecurityAuditorService {
|
|
|
269
271
|
}
|
|
270
272
|
}
|
|
271
273
|
catch (error) {
|
|
272
|
-
|
|
274
|
+
logger.error(`Failed to parse dependencies from ${manifest}:`, error instanceof Error ? error : undefined);
|
|
273
275
|
}
|
|
274
276
|
return dependencies;
|
|
275
277
|
}
|
|
@@ -293,7 +295,7 @@ export class SecurityAuditorService {
|
|
|
293
295
|
}
|
|
294
296
|
}
|
|
295
297
|
catch (error) {
|
|
296
|
-
|
|
298
|
+
logger.error(`Failed to check vulnerabilities for ${dep.name}@${dep.version}:`, error instanceof Error ? error : undefined);
|
|
297
299
|
}
|
|
298
300
|
return vulnerabilities;
|
|
299
301
|
}
|
|
@@ -425,7 +427,7 @@ export class SecurityAuditorService {
|
|
|
425
427
|
}
|
|
426
428
|
}
|
|
427
429
|
catch (error) {
|
|
428
|
-
|
|
430
|
+
logger.error(`Failed to get latest version for ${name}:`, error instanceof Error ? error : undefined);
|
|
429
431
|
}
|
|
430
432
|
return 'unknown';
|
|
431
433
|
}
|
|
@@ -439,7 +441,7 @@ export class SecurityAuditorService {
|
|
|
439
441
|
}
|
|
440
442
|
}
|
|
441
443
|
catch (error) {
|
|
442
|
-
|
|
444
|
+
logger.error(`Failed to check deprecation for ${name}:`, error instanceof Error ? error : undefined);
|
|
443
445
|
}
|
|
444
446
|
return false;
|
|
445
447
|
}
|
|
@@ -511,7 +513,7 @@ export class SecurityAuditorService {
|
|
|
511
513
|
return { vulnerabilities, outdatedPackages, summary: { ...baseSummary, scanDurationMs } };
|
|
512
514
|
}
|
|
513
515
|
catch (error) {
|
|
514
|
-
|
|
516
|
+
logger.error('Dependency scan failed:', error instanceof Error ? error : undefined);
|
|
515
517
|
return {
|
|
516
518
|
vulnerabilities: [],
|
|
517
519
|
outdatedPackages: [],
|
|
@@ -538,7 +540,7 @@ export class SecurityAuditorService {
|
|
|
538
540
|
}
|
|
539
541
|
}
|
|
540
542
|
catch (error) {
|
|
541
|
-
|
|
543
|
+
logger.error('Secret scan failed:', error instanceof Error ? error : undefined);
|
|
542
544
|
}
|
|
543
545
|
return { secretsFound, filesScanned };
|
|
544
546
|
}
|
|
@@ -563,7 +565,7 @@ export class SecurityAuditorService {
|
|
|
563
565
|
}
|
|
564
566
|
}
|
|
565
567
|
catch (error) {
|
|
566
|
-
|
|
568
|
+
logger.debug('Directory read error:');
|
|
567
569
|
}
|
|
568
570
|
return files;
|
|
569
571
|
}
|
|
@@ -597,7 +599,7 @@ export class SecurityAuditorService {
|
|
|
597
599
|
return Math.max(0, oldCount - newCount);
|
|
598
600
|
}
|
|
599
601
|
catch (error) {
|
|
600
|
-
|
|
602
|
+
logger.error('Failed to count resolved vulnerabilities:', error instanceof Error ? error : undefined);
|
|
601
603
|
return 0;
|
|
602
604
|
}
|
|
603
605
|
}
|
|
@@ -639,7 +641,7 @@ export class SecurityAuditorService {
|
|
|
639
641
|
return Math.round(sum / resolutionTimes.length);
|
|
640
642
|
}
|
|
641
643
|
catch (error) {
|
|
642
|
-
|
|
644
|
+
logger.error('Failed to calculate average resolution time:', error instanceof Error ? error : undefined);
|
|
643
645
|
return 72;
|
|
644
646
|
}
|
|
645
647
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Test Execution Coordinator
|
|
3
3
|
* Orchestrates test execution workflow and publishes domain events
|
|
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 { TestExecutionEvents, createEvent, } from '../../shared/events';
|
|
@@ -34,6 +35,7 @@ const DEFAULT_COORDINATOR_CONFIG = {
|
|
|
34
35
|
// ============================================================================
|
|
35
36
|
// Test Execution Coordinator
|
|
36
37
|
// ============================================================================
|
|
38
|
+
const logger = LoggerFactory.create('test-execution');
|
|
37
39
|
export class TestExecutionCoordinator extends BaseDomainCoordinator {
|
|
38
40
|
executor;
|
|
39
41
|
flakyDetector;
|
|
@@ -273,7 +275,7 @@ export class TestExecutionCoordinator extends BaseDomainCoordinator {
|
|
|
273
275
|
try {
|
|
274
276
|
// ADR-047: Check topology health before expensive parallel operations
|
|
275
277
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
276
|
-
|
|
278
|
+
logger.warn(`Topology degraded, reducing parallel workers`);
|
|
277
279
|
// Reduce workers when topology is unhealthy
|
|
278
280
|
request = { ...request, workers: Math.max(1, Math.floor(request.workers / 2)) };
|
|
279
281
|
}
|
|
@@ -385,7 +387,7 @@ export class TestExecutionCoordinator extends BaseDomainCoordinator {
|
|
|
385
387
|
}, Math.min(0.9, flaky.failureRate + 0.3) // Confidence based on failure rate
|
|
386
388
|
);
|
|
387
389
|
if (!isVerified) {
|
|
388
|
-
|
|
390
|
+
logger.info(`Flaky test '${flaky.testId}' not verified, skipping publication`);
|
|
389
391
|
continue; // Skip unverified flaky detections
|
|
390
392
|
}
|
|
391
393
|
}
|
|
@@ -442,7 +444,7 @@ export class TestExecutionCoordinator extends BaseDomainCoordinator {
|
|
|
442
444
|
}, 0.7 + (testsToRetry.length / 100) // Higher confidence for larger batches
|
|
443
445
|
);
|
|
444
446
|
if (!isStrategyVerified) {
|
|
445
|
-
|
|
447
|
+
logger.warn(`Retry strategy not verified, proceeding with reduced retries`);
|
|
446
448
|
request = { ...request, maxRetries: Math.max(1, Math.floor(request.maxRetries / 2)) };
|
|
447
449
|
}
|
|
448
450
|
}
|
|
@@ -776,10 +778,10 @@ export class TestExecutionCoordinator extends BaseDomainCoordinator {
|
|
|
776
778
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
777
779
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
778
780
|
if (result.success && result.value.verdict === 'verified') {
|
|
779
|
-
|
|
781
|
+
logger.info(`Flaky test '${test.testId}' classification verified by consensus`);
|
|
780
782
|
return true;
|
|
781
783
|
}
|
|
782
|
-
|
|
784
|
+
logger.warn(`Flaky test '${test.testId}' classification NOT verified: ${result.success ? result.value.verdict : result.error.message}`);
|
|
783
785
|
return false;
|
|
784
786
|
}
|
|
785
787
|
return true; // No consensus needed
|
|
@@ -805,10 +807,10 @@ export class TestExecutionCoordinator extends BaseDomainCoordinator {
|
|
|
805
807
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
806
808
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
807
809
|
if (result.success && result.value.verdict === 'verified') {
|
|
808
|
-
|
|
810
|
+
logger.info(`Retry strategy verified by consensus`);
|
|
809
811
|
return true;
|
|
810
812
|
}
|
|
811
|
-
|
|
813
|
+
logger.warn(`Retry strategy NOT verified: ${result.success ? result.value.verdict : result.error.message}`);
|
|
812
814
|
return false;
|
|
813
815
|
}
|
|
814
816
|
return true; // No consensus needed
|
|
@@ -834,10 +836,10 @@ export class TestExecutionCoordinator extends BaseDomainCoordinator {
|
|
|
834
836
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
835
837
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
836
838
|
if (result.success && result.value.verdict === 'verified') {
|
|
837
|
-
|
|
839
|
+
logger.info(`Failure analysis for '${analysis.testId}' verified by consensus`);
|
|
838
840
|
return true;
|
|
839
841
|
}
|
|
840
|
-
|
|
842
|
+
logger.warn(`Failure analysis NOT verified: ${result.success ? result.value.verdict : result.error.message}`);
|
|
841
843
|
return false;
|
|
842
844
|
}
|
|
843
845
|
return true; // No consensus needed
|
|
@@ -47,9 +47,6 @@ export interface AuthStateManagerConfig {
|
|
|
47
47
|
/** Whether to auto-cleanup expired states (default: true) */
|
|
48
48
|
autoCleanup?: boolean;
|
|
49
49
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Auth state manager errors
|
|
52
|
-
*/
|
|
53
50
|
export declare class AuthStateError extends Error {
|
|
54
51
|
readonly code: string;
|
|
55
52
|
readonly cause?: Error | undefined;
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
* Uses agent-browser state save/load to persist cookies, localStorage,
|
|
6
6
|
* sessionStorage, and other browser state to skip login flows in tests.
|
|
7
7
|
*/
|
|
8
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
8
9
|
import { mkdir, access, readdir, stat, unlink } from 'fs/promises';
|
|
9
10
|
import { join, dirname } from 'path';
|
|
10
11
|
import { safeJsonParse } from '../../../shared/safe-json.js';
|
|
11
12
|
/**
|
|
12
13
|
* Auth state manager errors
|
|
13
14
|
*/
|
|
15
|
+
const logger = LoggerFactory.create('test-execution/auth-state-manager');
|
|
14
16
|
export class AuthStateError extends Error {
|
|
15
17
|
code;
|
|
16
18
|
cause;
|
|
@@ -228,7 +230,7 @@ export class AuthStateManager {
|
|
|
228
230
|
}
|
|
229
231
|
catch (error) {
|
|
230
232
|
// Non-critical: file may not exist
|
|
231
|
-
|
|
233
|
+
logger.debug('State file removal skipped:');
|
|
232
234
|
}
|
|
233
235
|
// Remove metadata file
|
|
234
236
|
try {
|
|
@@ -236,7 +238,7 @@ export class AuthStateManager {
|
|
|
236
238
|
}
|
|
237
239
|
catch (error) {
|
|
238
240
|
// Non-critical: file may not exist
|
|
239
|
-
|
|
241
|
+
logger.debug('Metadata file removal skipped:');
|
|
240
242
|
}
|
|
241
243
|
// Clear cache
|
|
242
244
|
this.metadataCache.delete(name);
|