agentic-qe 3.8.4 → 3.8.5
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/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/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
|
@@ -11,20 +11,6 @@ import type { VibiumClient } from '@integrations/vibium';
|
|
|
11
11
|
import type { IBrowserClient } from '@integrations/browser';
|
|
12
12
|
import type { E2ETestCase, E2ETestResult, E2ETestSuite, E2ETestSuiteResult } from '../../types';
|
|
13
13
|
import type { E2ERunnerConfig, IE2ETestRunnerService, ExecutionStrategy } from './types';
|
|
14
|
-
/**
|
|
15
|
-
* E2E Test Runner Service
|
|
16
|
-
*
|
|
17
|
-
* Executes E2E test cases using browser automation clients.
|
|
18
|
-
* Supports both the Vibium browser automation client and the agent-browser CLI tool.
|
|
19
|
-
* Provides step-by-step execution with retry logic, timeout handling,
|
|
20
|
-
* and comprehensive result aggregation.
|
|
21
|
-
*
|
|
22
|
-
* Agent-browser provides enhanced E2E testing capabilities:
|
|
23
|
-
* - Snapshot-based element refs (@e1, @e2) for reliable element selection
|
|
24
|
-
* - Session management for state persistence
|
|
25
|
-
* - Network interception and API mocking
|
|
26
|
-
* - Device emulation for responsive testing
|
|
27
|
-
*/
|
|
28
14
|
export declare class E2ETestRunnerService implements IE2ETestRunnerService {
|
|
29
15
|
private readonly client;
|
|
30
16
|
private readonly config;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module test-execution/services/e2e/e2e-coordinator
|
|
9
9
|
*/
|
|
10
|
+
import { LoggerFactory } from '../../../../logging/index.js';
|
|
10
11
|
import { getBrowserClientForUseCase, } from '@integrations/browser';
|
|
11
12
|
import { DEFAULT_E2E_RUNNER_CONFIG } from './types';
|
|
12
13
|
import { createBrowserOrchestrator } from './browser-orchestrator';
|
|
@@ -31,6 +32,7 @@ import { toErrorMessage } from '@shared/error-utils.js';
|
|
|
31
32
|
* - Network interception and API mocking
|
|
32
33
|
* - Device emulation for responsive testing
|
|
33
34
|
*/
|
|
35
|
+
const logger = LoggerFactory.create('test-execution/e2e-coordinator');
|
|
34
36
|
export class E2ETestRunnerService {
|
|
35
37
|
client;
|
|
36
38
|
config;
|
|
@@ -244,7 +246,7 @@ export class E2ETestRunnerService {
|
|
|
244
246
|
*/
|
|
245
247
|
log(message) {
|
|
246
248
|
if (this.config.verbose) {
|
|
247
|
-
|
|
249
|
+
logger.info(`${message}`);
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
252
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Flaky Test Detector Service
|
|
3
3
|
* Identifies and analyzes flaky tests from execution history
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
5
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
7
|
import { spawn } from 'child_process';
|
|
7
8
|
import * as path from 'path';
|
|
@@ -23,6 +24,7 @@ const DEFAULT_FLAKY_CONFIG = {
|
|
|
23
24
|
// ============================================================================
|
|
24
25
|
// Flaky Detector Service
|
|
25
26
|
// ============================================================================
|
|
27
|
+
const logger = LoggerFactory.create('test-execution/flaky-detector');
|
|
26
28
|
export class FlakyDetectorService {
|
|
27
29
|
memory;
|
|
28
30
|
testHistory = new Map();
|
|
@@ -345,7 +347,7 @@ export class FlakyDetectorService {
|
|
|
345
347
|
}
|
|
346
348
|
catch (error) {
|
|
347
349
|
// Non-critical: not valid JSON, try other formats
|
|
348
|
-
|
|
350
|
+
logger.debug('Vitest JSON parse failed:');
|
|
349
351
|
}
|
|
350
352
|
// Try to parse Jest JSON output
|
|
351
353
|
try {
|
|
@@ -359,7 +361,7 @@ export class FlakyDetectorService {
|
|
|
359
361
|
}
|
|
360
362
|
catch (error) {
|
|
361
363
|
// Non-critical: not Jest format
|
|
362
|
-
|
|
364
|
+
logger.debug('Jest JSON parse failed:');
|
|
363
365
|
}
|
|
364
366
|
// Try to parse TAP format
|
|
365
367
|
if (stdout.includes('TAP version') || stdout.match(/^(ok|not ok)\s+\d+/m)) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Retry Handler Service
|
|
3
3
|
* Implements intelligent retry logic for failed tests
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
5
6
|
import { spawn } from 'node:child_process';
|
|
6
7
|
import { existsSync, readFileSync } from 'node:fs';
|
|
7
8
|
import { ok, err } from '../../../shared/types';
|
|
@@ -21,6 +22,7 @@ const DEFAULT_RETRY_CONFIG = {
|
|
|
21
22
|
// ============================================================================
|
|
22
23
|
// Retry Handler Service
|
|
23
24
|
// ============================================================================
|
|
25
|
+
const logger = LoggerFactory.create('test-execution/retry-handler');
|
|
24
26
|
export class RetryHandlerService {
|
|
25
27
|
memory;
|
|
26
28
|
retryHistory = new Map();
|
|
@@ -323,7 +325,7 @@ export class RetryHandlerService {
|
|
|
323
325
|
}
|
|
324
326
|
catch (error) {
|
|
325
327
|
// Non-critical: package.json read errors during test runner detection
|
|
326
|
-
|
|
328
|
+
logger.debug('package.json read failed:');
|
|
327
329
|
}
|
|
328
330
|
return null;
|
|
329
331
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Test Executor Service
|
|
3
3
|
* Implements ITestExecutionService for running test suites
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
5
6
|
import { spawn } from 'node:child_process';
|
|
6
7
|
import { existsSync } from 'node:fs';
|
|
7
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
@@ -22,6 +23,7 @@ const DEFAULT_CONFIG = {
|
|
|
22
23
|
// ============================================================================
|
|
23
24
|
// Test Executor Service
|
|
24
25
|
// ============================================================================
|
|
26
|
+
const logger = LoggerFactory.create('test-execution/test-executor');
|
|
25
27
|
export class TestExecutorService {
|
|
26
28
|
runResults = new Map();
|
|
27
29
|
runStats = new Map();
|
|
@@ -264,7 +266,7 @@ Provide:
|
|
|
264
266
|
return response.content;
|
|
265
267
|
}
|
|
266
268
|
catch (error) {
|
|
267
|
-
|
|
269
|
+
logger.warn('LLM analysis failed:');
|
|
268
270
|
return null;
|
|
269
271
|
}
|
|
270
272
|
}
|
|
@@ -62,23 +62,6 @@ export interface CoordinatorConfig extends BaseDomainCoordinatorConfig {
|
|
|
62
62
|
consensusConfig?: Partial<ConsensusEnabledConfig>;
|
|
63
63
|
}
|
|
64
64
|
type TestGenWorkflowType = 'generate' | 'tdd' | 'property' | 'data' | 'learn';
|
|
65
|
-
/**
|
|
66
|
-
* Test Generation Coordinator
|
|
67
|
-
* Orchestrates test generation workflows and coordinates with agents
|
|
68
|
-
*
|
|
69
|
-
* Enhanced with @ruvector integration per ADR-040:
|
|
70
|
-
* - QESONA for pattern learning (test generation patterns)
|
|
71
|
-
* - QEFlashAttention for test similarity detection
|
|
72
|
-
* - DecisionTransformer for test case selection
|
|
73
|
-
*
|
|
74
|
-
* Enhanced with MinCut topology awareness per ADR-047:
|
|
75
|
-
* - Topology-based routing decisions
|
|
76
|
-
* - Health monitoring for test generation workflows
|
|
77
|
-
*
|
|
78
|
-
* Enhanced with Multi-Model Consensus per MM-001:
|
|
79
|
-
* - Consensus verification for high-stakes test design decisions
|
|
80
|
-
* - Verifies test patterns, mock strategies, and edge cases
|
|
81
|
-
*/
|
|
82
65
|
export declare class TestGenerationCoordinator extends BaseDomainCoordinator<CoordinatorConfig, TestGenWorkflowType> implements ITestGenerationCoordinator {
|
|
83
66
|
private readonly memory;
|
|
84
67
|
private readonly agentCoordinator;
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* - QEFlashAttention for test similarity detection
|
|
8
8
|
* - DecisionTransformer for test case selection
|
|
9
9
|
*/
|
|
10
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
10
11
|
import { v4 as uuidv4 } from 'uuid';
|
|
11
12
|
import { err, } from '../../shared/types';
|
|
12
|
-
import { toError
|
|
13
|
+
import { toError } from '../../shared/error-utils.js';
|
|
13
14
|
import { TestGenerationEvents, LearningOptimizationEvents, createEvent, } from '../../shared/events/domain-events';
|
|
14
15
|
import { createTestGeneratorService, } from './services/test-generator';
|
|
15
16
|
import { PatternMatcherService, } from './services/pattern-matcher';
|
|
@@ -67,6 +68,7 @@ const DEFAULT_CONFIG = {
|
|
|
67
68
|
* - Consensus verification for high-stakes test design decisions
|
|
68
69
|
* - Verifies test patterns, mock strategies, and edge cases
|
|
69
70
|
*/
|
|
71
|
+
const logger = LoggerFactory.create('test-generation');
|
|
70
72
|
export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
71
73
|
memory;
|
|
72
74
|
agentCoordinator;
|
|
@@ -124,12 +126,12 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
124
126
|
patternClusters: 50,
|
|
125
127
|
minConfidence: 0.5,
|
|
126
128
|
});
|
|
127
|
-
|
|
129
|
+
logger.info('PersistentSONAEngine initialized for test-generation domain');
|
|
128
130
|
}
|
|
129
131
|
catch (error) {
|
|
130
132
|
// Log and continue - SONA is enhancement, not critical
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
logger.error('Failed to initialize PersistentSONAEngine:', error instanceof Error ? error : undefined);
|
|
134
|
+
logger.warn('Continuing without SONA pattern persistence');
|
|
133
135
|
this.qesona = null;
|
|
134
136
|
}
|
|
135
137
|
}
|
|
@@ -137,11 +139,11 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
137
139
|
if (this.config.enableFlashAttention) {
|
|
138
140
|
try {
|
|
139
141
|
this.flashAttention = await createQEFlashAttention(this.config.flashAttentionWorkload, { dim: 384, strategy: 'flash', blockSize: 64 });
|
|
140
|
-
|
|
142
|
+
logger.info('QEFlashAttention initialized for test-similarity');
|
|
141
143
|
}
|
|
142
144
|
catch (error) {
|
|
143
145
|
// Graceful degradation: native module may not be available on all platforms
|
|
144
|
-
|
|
146
|
+
logger.warn('QEFlashAttention unavailable (optional native module), continuing without it');
|
|
145
147
|
this.flashAttention = null;
|
|
146
148
|
}
|
|
147
149
|
}
|
|
@@ -153,11 +155,11 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
153
155
|
embeddingDim: 384,
|
|
154
156
|
});
|
|
155
157
|
// Note: DecisionTransformer will auto-initialize on first predict() call
|
|
156
|
-
|
|
158
|
+
logger.info('DecisionTransformer created for test case selection');
|
|
157
159
|
}
|
|
158
160
|
catch (error) {
|
|
159
161
|
// Graceful degradation: native module may not be available on all platforms
|
|
160
|
-
|
|
162
|
+
logger.warn('DecisionTransformer unavailable (optional native module), continuing without it');
|
|
161
163
|
this.decisionTransformer = null;
|
|
162
164
|
}
|
|
163
165
|
}
|
|
@@ -216,7 +218,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
216
218
|
this.startWorkflow(workflowId, 'generate');
|
|
217
219
|
// ADR-047: Check topology health before expensive operations
|
|
218
220
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
219
|
-
|
|
221
|
+
logger.warn('Topology degraded, using conservative strategy');
|
|
220
222
|
// Continue with reduced parallelism when topology is unhealthy
|
|
221
223
|
}
|
|
222
224
|
// ADR-047: Check if operations should be paused due to critical topology
|
|
@@ -239,13 +241,13 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
239
241
|
hookPatternIds.push(...hookResult.data.patterns);
|
|
240
242
|
}
|
|
241
243
|
if (hookResult.guidance) {
|
|
242
|
-
|
|
244
|
+
logger.info(`Hook guidance: ${hookResult.guidance.join('; ')}`);
|
|
243
245
|
}
|
|
244
246
|
}
|
|
245
247
|
}
|
|
246
248
|
catch (e) {
|
|
247
249
|
// Hook failures are non-critical
|
|
248
|
-
|
|
250
|
+
logger.debug('PreTestGeneration hook failed:');
|
|
249
251
|
}
|
|
250
252
|
}
|
|
251
253
|
// Check if we can spawn agents
|
|
@@ -265,7 +267,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
265
267
|
const sonaPatterns = await this.adaptTestGenerationPatterns(request);
|
|
266
268
|
if (sonaPatterns.length > 0) {
|
|
267
269
|
adaptedPatterns = sonaPatterns;
|
|
268
|
-
|
|
270
|
+
logger.info(`Adapted ${sonaPatterns.length} patterns using QESONA`);
|
|
269
271
|
}
|
|
270
272
|
}
|
|
271
273
|
// Find matching patterns if pattern learning is enabled
|
|
@@ -290,13 +292,13 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
290
292
|
if (this.config.enableFlashAttention && this.flashAttention) {
|
|
291
293
|
const similarTests = await this.findSimilarTests(result.value.tests);
|
|
292
294
|
if (similarTests.length > 0) {
|
|
293
|
-
|
|
295
|
+
logger.info(`Found ${similarTests.length} similar tests using Flash Attention`);
|
|
294
296
|
}
|
|
295
297
|
}
|
|
296
298
|
// Use DecisionTransformer to prioritize generated tests
|
|
297
299
|
if (this.config.enableDecisionTransformer && this.decisionTransformer) {
|
|
298
300
|
const prioritizedTests = await this.prioritizeTestCases(result.value.tests, request);
|
|
299
|
-
|
|
301
|
+
logger.info(`Prioritized ${prioritizedTests.length} tests using DecisionTransformer`);
|
|
300
302
|
}
|
|
301
303
|
// Publish events
|
|
302
304
|
if (this.config.publishEvents) {
|
|
@@ -585,7 +587,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
585
587
|
if (relevantInsights.length === 0) {
|
|
586
588
|
return;
|
|
587
589
|
}
|
|
588
|
-
|
|
590
|
+
logger.info(`[${this.domainName}] Received ${relevantInsights.length} relevant dream insights from cycle ${cycleId}`);
|
|
589
591
|
// Apply high-confidence actionable insights
|
|
590
592
|
for (const insight of relevantInsights) {
|
|
591
593
|
if (insight.confidenceScore > 0.7 && insight.actionable) {
|
|
@@ -610,7 +612,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
610
612
|
* @param cycleId - The dream cycle ID for tracking
|
|
611
613
|
*/
|
|
612
614
|
async applyDreamInsight(insight, cycleId) {
|
|
613
|
-
|
|
615
|
+
logger.info(`[${this.domainName}] Applying dream insight: ${insight.description.slice(0, 100)}...`);
|
|
614
616
|
// Store as a learned pattern via SONA if available
|
|
615
617
|
if (this.qesona) {
|
|
616
618
|
try {
|
|
@@ -640,10 +642,10 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
640
642
|
description: insight.description,
|
|
641
643
|
suggestedAction: insight.suggestedAction,
|
|
642
644
|
});
|
|
643
|
-
|
|
645
|
+
logger.info(`[${this.domainName}] Created SONA pattern ${pattern.id} from dream insight`);
|
|
644
646
|
}
|
|
645
647
|
catch (error) {
|
|
646
|
-
|
|
648
|
+
logger.error(`[${this.domainName}] Failed to store dream insight pattern`, error instanceof Error ? error : undefined);
|
|
647
649
|
}
|
|
648
650
|
}
|
|
649
651
|
// Store insight in memory for downstream usage
|
|
@@ -778,14 +780,14 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
778
780
|
// Adapt pattern using QESONA
|
|
779
781
|
const adaptationResult = await this.qesona.adaptPattern(state, this.config.sonaPatternType, 'test-generation');
|
|
780
782
|
if (adaptationResult.success && adaptationResult.pattern) {
|
|
781
|
-
|
|
783
|
+
logger.info(`QESONA adapted pattern with ${adaptationResult.similarity.toFixed(3)} similarity in ${adaptationResult.adaptationTimeMs.toFixed(2)}ms`);
|
|
782
784
|
// Return pattern IDs from SONA adaptation
|
|
783
785
|
return [adaptationResult.pattern.id];
|
|
784
786
|
}
|
|
785
787
|
return [];
|
|
786
788
|
}
|
|
787
789
|
catch (error) {
|
|
788
|
-
|
|
790
|
+
logger.error('QESONA pattern adaptation failed:', error instanceof Error ? error : undefined);
|
|
789
791
|
return [];
|
|
790
792
|
}
|
|
791
793
|
}
|
|
@@ -827,10 +829,10 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
827
829
|
framework: request.framework,
|
|
828
830
|
testType: request.testType,
|
|
829
831
|
});
|
|
830
|
-
|
|
832
|
+
logger.info(`Stored test generation pattern ${pattern.id} in QESONA`);
|
|
831
833
|
}
|
|
832
834
|
catch (error) {
|
|
833
|
-
|
|
835
|
+
logger.error('Failed to store pattern in QESONA:', error instanceof Error ? error : undefined);
|
|
834
836
|
}
|
|
835
837
|
}
|
|
836
838
|
/**
|
|
@@ -874,7 +876,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
874
876
|
return results;
|
|
875
877
|
}
|
|
876
878
|
catch (error) {
|
|
877
|
-
|
|
879
|
+
logger.error('Flash Attention similarity detection failed:', error instanceof Error ? error : undefined);
|
|
878
880
|
return [];
|
|
879
881
|
}
|
|
880
882
|
}
|
|
@@ -904,7 +906,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
904
906
|
};
|
|
905
907
|
// Get prediction from Decision Transformer
|
|
906
908
|
const prediction = await this.decisionTransformer.predict(state);
|
|
907
|
-
|
|
909
|
+
logger.info(`DecisionTransformer prediction: ${prediction.reasoning}`);
|
|
908
910
|
// Prioritize tests based on prediction confidence
|
|
909
911
|
// High confidence = prioritize tests based on action type
|
|
910
912
|
if (prediction.confidence > 0.7) {
|
|
@@ -914,7 +916,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
914
916
|
return tests;
|
|
915
917
|
}
|
|
916
918
|
catch (error) {
|
|
917
|
-
|
|
919
|
+
logger.error('DecisionTransformer prioritization failed:', error instanceof Error ? error : undefined);
|
|
918
920
|
return tests;
|
|
919
921
|
}
|
|
920
922
|
}
|
|
@@ -1009,10 +1011,10 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
1009
1011
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
1010
1012
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
1011
1013
|
if (result.success && result.value.verdict === 'verified') {
|
|
1012
|
-
|
|
1014
|
+
logger.info(`Test pattern '${pattern.name}' verified by consensus`);
|
|
1013
1015
|
return true;
|
|
1014
1016
|
}
|
|
1015
|
-
|
|
1017
|
+
logger.warn(`Test pattern '${pattern.name}' NOT verified: ${result.success ? result.value.verdict : result.error.message}`);
|
|
1016
1018
|
return false;
|
|
1017
1019
|
}
|
|
1018
1020
|
return true; // No consensus needed
|
|
@@ -1038,10 +1040,10 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
1038
1040
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
1039
1041
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
1040
1042
|
if (result.success && result.value.verdict === 'verified') {
|
|
1041
|
-
|
|
1043
|
+
logger.info(`Mock strategy for '${strategy.target}' verified by consensus`);
|
|
1042
1044
|
return true;
|
|
1043
1045
|
}
|
|
1044
|
-
|
|
1046
|
+
logger.warn(`Mock strategy for '${strategy.target}' NOT verified`);
|
|
1045
1047
|
return false;
|
|
1046
1048
|
}
|
|
1047
1049
|
return true; // No consensus needed
|
|
@@ -1067,10 +1069,10 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
1067
1069
|
if (this.consensusMixin.requiresConsensus(finding)) {
|
|
1068
1070
|
const result = await this.consensusMixin.verifyFinding(finding);
|
|
1069
1071
|
if (result.success && result.value.verdict === 'verified') {
|
|
1070
|
-
|
|
1072
|
+
logger.info(`Edge case '${edgeCase.description.slice(0, 50)}...' verified by consensus`);
|
|
1071
1073
|
return true;
|
|
1072
1074
|
}
|
|
1073
|
-
|
|
1075
|
+
logger.warn(`Edge case NOT verified: ${result.success ? result.value.verdict : result.error.message}`);
|
|
1074
1076
|
return false;
|
|
1075
1077
|
}
|
|
1076
1078
|
return true; // No consensus needed
|
|
@@ -27,11 +27,6 @@ export interface InjectionContext {
|
|
|
27
27
|
/** Total patterns considered before filtering */
|
|
28
28
|
totalConsidered: number;
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Extract searchable keywords from source code.
|
|
32
|
-
* Pulls function names, class names, import identifiers, and
|
|
33
|
-
* common code patterns for pattern matching.
|
|
34
|
-
*/
|
|
35
30
|
export declare function extractKeywords(sourceCode: string): string[];
|
|
36
31
|
export declare class EdgeCaseInjector {
|
|
37
32
|
private readonly memory;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* This creates a continuously improving test generation system where
|
|
10
10
|
* patterns discovered in past testing inform future test generation.
|
|
11
11
|
*/
|
|
12
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
12
13
|
import { generateRemediationHints } from '../../../learning/opd-remediation.js';
|
|
13
14
|
export const DEFAULT_INJECTION_CONFIG = {
|
|
14
15
|
topN: 3,
|
|
@@ -23,6 +24,7 @@ export const DEFAULT_INJECTION_CONFIG = {
|
|
|
23
24
|
* Pulls function names, class names, import identifiers, and
|
|
24
25
|
* common code patterns for pattern matching.
|
|
25
26
|
*/
|
|
27
|
+
const logger = LoggerFactory.create('test-generation/edge-case-injector');
|
|
26
28
|
export function extractKeywords(sourceCode) {
|
|
27
29
|
const keywords = new Set();
|
|
28
30
|
// Common tokens to exclude
|
|
@@ -124,7 +126,7 @@ export class EdgeCaseInjector {
|
|
|
124
126
|
}
|
|
125
127
|
catch (error) {
|
|
126
128
|
// Non-blocking: injection failure should never break test generation
|
|
127
|
-
|
|
129
|
+
logger.warn('Failed to get injection context:');
|
|
128
130
|
return emptyResult;
|
|
129
131
|
}
|
|
130
132
|
}
|
|
@@ -35,13 +35,6 @@ export interface CodeTransformConfig {
|
|
|
35
35
|
* Default configuration - conservative settings for test generation
|
|
36
36
|
*/
|
|
37
37
|
export declare const DEFAULT_TRANSFORM_CONFIG: CodeTransformConfig;
|
|
38
|
-
/**
|
|
39
|
-
* Check if code has patterns eligible for a specific transform
|
|
40
|
-
*
|
|
41
|
-
* @param code - Source code to check
|
|
42
|
-
* @param type - Transform type to check eligibility for
|
|
43
|
-
* @returns True if code contains patterns suitable for this transform
|
|
44
|
-
*/
|
|
45
38
|
export declare function isEligibleForTransform(code: string, type: TransformType): boolean;
|
|
46
39
|
/**
|
|
47
40
|
* Detect all transforms that could be applied to code
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module domains/test-generation/services/code-transform-integration
|
|
19
19
|
*/
|
|
20
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
20
21
|
import { toErrorMessage } from '../../../shared/error-utils.js';
|
|
21
22
|
/**
|
|
22
23
|
* Default configuration - conservative settings for test generation
|
|
@@ -48,6 +49,7 @@ const TRANSFORM_PATTERNS = {
|
|
|
48
49
|
* @param type - Transform type to check eligibility for
|
|
49
50
|
* @returns True if code contains patterns suitable for this transform
|
|
50
51
|
*/
|
|
52
|
+
const logger = LoggerFactory.create('test-generation/code-transform');
|
|
51
53
|
export function isEligibleForTransform(code, type) {
|
|
52
54
|
const patterns = TRANSFORM_PATTERNS[type];
|
|
53
55
|
if (!patterns)
|
|
@@ -155,7 +157,7 @@ export class CodeTransformService {
|
|
|
155
157
|
const durationMs = Date.now() - startTime;
|
|
156
158
|
this.metrics.totalTimeMs += durationMs;
|
|
157
159
|
if (this.config.logMetrics) {
|
|
158
|
-
|
|
160
|
+
logger.info(`Applied ${appliedTransforms.length} transforms in ${durationMs}ms`);
|
|
159
161
|
}
|
|
160
162
|
return {
|
|
161
163
|
transformed: appliedTransforms.length > 0,
|
|
@@ -114,9 +114,6 @@ export interface TestGenerationCoherenceGateConfig {
|
|
|
114
114
|
* Default configuration
|
|
115
115
|
*/
|
|
116
116
|
export declare const DEFAULT_COHERENCE_GATE_CONFIG: TestGenerationCoherenceGateConfig;
|
|
117
|
-
/**
|
|
118
|
-
* Error thrown when requirements have unresolvable contradictions
|
|
119
|
-
*/
|
|
120
117
|
export declare class CoherenceError extends Error {
|
|
121
118
|
readonly contradictions: RequirementContradiction[];
|
|
122
119
|
readonly lane: ComputeLane;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module domains/test-generation/coherence-gate
|
|
9
9
|
*/
|
|
10
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
10
11
|
import { ok, err } from '../../../shared/types/index.js';
|
|
11
12
|
/**
|
|
12
13
|
* Default configuration
|
|
@@ -21,6 +22,7 @@ export const DEFAULT_COHERENCE_GATE_CONFIG = {
|
|
|
21
22
|
/**
|
|
22
23
|
* Error thrown when requirements have unresolvable contradictions
|
|
23
24
|
*/
|
|
25
|
+
const logger = LoggerFactory.create('test-generation/coherence-gate');
|
|
24
26
|
export class CoherenceError extends Error {
|
|
25
27
|
contradictions;
|
|
26
28
|
lane;
|
|
@@ -123,7 +125,7 @@ export class TestGenerationCoherenceGate {
|
|
|
123
125
|
return this.transformCoherenceResult(coherenceResult, requirements, Date.now() - startTime);
|
|
124
126
|
}
|
|
125
127
|
catch (error) {
|
|
126
|
-
|
|
128
|
+
logger.error('Coherence check failed:', error instanceof Error ? error : undefined);
|
|
127
129
|
// Return fallback result - don't block on errors
|
|
128
130
|
return {
|
|
129
131
|
isCoherent: true,
|
|
@@ -57,14 +57,6 @@ export interface TestGeneratorDependencies {
|
|
|
57
57
|
/** ADR-051: Optional LLM router for AI-enhanced test generation */
|
|
58
58
|
llmRouter?: HybridRouter;
|
|
59
59
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Test Generation Service Implementation
|
|
62
|
-
* Uses Strategy Pattern generators for framework-specific test generation
|
|
63
|
-
* Delegates TDD, property testing, and test data to specialized services
|
|
64
|
-
*
|
|
65
|
-
* ADR-XXX: Refactored to use Dependency Injection for better testability and flexibility
|
|
66
|
-
* ADR-051: Added LLM enhancement for AI-powered test suggestions
|
|
67
|
-
*/
|
|
68
60
|
export declare class TestGeneratorService implements ITestGenerationService {
|
|
69
61
|
private readonly config;
|
|
70
62
|
private readonly memory;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Uses TypeScript AST parser for code analysis
|
|
7
7
|
* Delegates to specialized services for TDD, property tests, and test data
|
|
8
8
|
*/
|
|
9
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
9
10
|
import { v4 as uuidv4 } from 'uuid';
|
|
10
11
|
import * as fs from 'fs';
|
|
11
12
|
import * as path from 'path';
|
|
@@ -45,6 +46,7 @@ const DEFAULT_CONFIG = {
|
|
|
45
46
|
* ADR-XXX: Refactored to use Dependency Injection for better testability and flexibility
|
|
46
47
|
* ADR-051: Added LLM enhancement for AI-powered test suggestions
|
|
47
48
|
*/
|
|
49
|
+
const logger = LoggerFactory.create('test-generation/test-generator');
|
|
48
50
|
export class TestGeneratorService {
|
|
49
51
|
config;
|
|
50
52
|
memory;
|
|
@@ -110,7 +112,7 @@ export class TestGeneratorService {
|
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
catch (injectionError) {
|
|
113
|
-
|
|
115
|
+
logger.warn('Edge case injection failed, continuing without it');
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
// Append KG context if available
|
|
@@ -171,7 +173,7 @@ Return ONLY the enhanced test code, no explanations.`,
|
|
|
171
173
|
return testCode;
|
|
172
174
|
}
|
|
173
175
|
catch (error) {
|
|
174
|
-
|
|
176
|
+
logger.warn('LLM enhancement failed, using original:');
|
|
175
177
|
return testCode;
|
|
176
178
|
}
|
|
177
179
|
}
|
|
@@ -247,7 +249,7 @@ Return a JSON array of test suggestions, each with: { "name": "test name", "desc
|
|
|
247
249
|
return [];
|
|
248
250
|
}
|
|
249
251
|
catch (error) {
|
|
250
|
-
|
|
252
|
+
logger.warn('LLM suggestion generation failed:');
|
|
251
253
|
return [];
|
|
252
254
|
}
|
|
253
255
|
}
|
|
@@ -51,9 +51,6 @@ export interface IVisualAccessibilityCoordinatorExtended extends IVisualAccessib
|
|
|
51
51
|
* Orchestrates visual regression, accessibility, and responsive testing workflows
|
|
52
52
|
*/
|
|
53
53
|
type VisualAccessibilityWorkflowType = 'visual' | 'accessibility' | 'responsive' | 'combined';
|
|
54
|
-
/**
|
|
55
|
-
* CQ-002: Extends BaseDomainCoordinator
|
|
56
|
-
*/
|
|
57
54
|
export declare class VisualAccessibilityCoordinator extends BaseDomainCoordinator<CoordinatorConfig, VisualAccessibilityWorkflowType> implements IVisualAccessibilityCoordinatorExtended {
|
|
58
55
|
private readonly memory;
|
|
59
56
|
private readonly agentCoordinator;
|