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
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* - CQ-002: Extends BaseDomainCoordinator for lifecycle deduplication
|
|
9
9
|
*/
|
|
10
10
|
import { v4 as uuidv4 } from 'uuid';
|
|
11
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
11
12
|
import { err, ok } from '../../shared/types';
|
|
12
13
|
import { toError } from '../../shared/error-utils.js';
|
|
13
14
|
import { DefectIntelligenceEvents, createEvent, } from '../../shared/events/domain-events';
|
|
@@ -41,6 +42,7 @@ const DEFAULT_CONFIG = {
|
|
|
41
42
|
* - Multi-model consensus for high-confidence predictions (MM-001)
|
|
42
43
|
* - CQ-002: Extends BaseDomainCoordinator
|
|
43
44
|
*/
|
|
45
|
+
const logger = LoggerFactory.create('defect-intelligence');
|
|
44
46
|
export class DefectIntelligenceCoordinator extends BaseDomainCoordinator {
|
|
45
47
|
memory;
|
|
46
48
|
agentCoordinator;
|
|
@@ -126,7 +128,7 @@ export class DefectIntelligenceCoordinator extends BaseDomainCoordinator {
|
|
|
126
128
|
this.startWorkflow(workflowId, 'predict');
|
|
127
129
|
// V3: Check topology health before proceeding
|
|
128
130
|
if (this.config.enableMinCutAwareness && this.minCutMixin.shouldPauseOperations()) {
|
|
129
|
-
|
|
131
|
+
logger.warn('Topology is critical, proceeding with caution');
|
|
130
132
|
}
|
|
131
133
|
// Check if we can spawn agents
|
|
132
134
|
if (!this.agentCoordinator.canSpawn()) {
|
|
@@ -233,7 +235,7 @@ export class DefectIntelligenceCoordinator extends BaseDomainCoordinator {
|
|
|
233
235
|
}
|
|
234
236
|
catch (error) {
|
|
235
237
|
// On consensus error, include original prediction
|
|
236
|
-
|
|
238
|
+
logger.warn(`Consensus verification failed for ${prediction.file}`);
|
|
237
239
|
verifiedPredictions.push(prediction);
|
|
238
240
|
}
|
|
239
241
|
}
|
|
@@ -327,7 +329,7 @@ export class DefectIntelligenceCoordinator extends BaseDomainCoordinator {
|
|
|
327
329
|
}
|
|
328
330
|
}
|
|
329
331
|
catch (error) {
|
|
330
|
-
|
|
332
|
+
logger.warn('Consensus verification failed for root cause');
|
|
331
333
|
}
|
|
332
334
|
}
|
|
333
335
|
return analysis;
|
|
@@ -102,12 +102,6 @@ export interface ICausalRootCauseAnalyzerService {
|
|
|
102
102
|
/** Reset all learned patterns */
|
|
103
103
|
reset(): void;
|
|
104
104
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Causal Root Cause Analyzer Service
|
|
107
|
-
*
|
|
108
|
-
* Uses STDP-based causal discovery to learn relationships between events
|
|
109
|
-
* and provide intelligent root cause analysis.
|
|
110
|
-
*/
|
|
111
105
|
export declare class CausalRootCauseAnalyzerService implements ICausalRootCauseAnalyzerService {
|
|
112
106
|
private readonly memory;
|
|
113
107
|
private readonly engine;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* to provide automated, learning-based root cause analysis.
|
|
7
7
|
*/
|
|
8
8
|
import { randomUUID } from 'crypto';
|
|
9
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
9
10
|
import { ok, err } from '../../../shared/types';
|
|
10
11
|
import { toError } from '../../../shared/error-utils.js';
|
|
11
12
|
import { CausalDiscoveryEngine, } from '../../../causal-discovery';
|
|
@@ -32,6 +33,7 @@ export const DEFAULT_CAUSAL_ANALYZER_CONFIG = {
|
|
|
32
33
|
* Uses STDP-based causal discovery to learn relationships between events
|
|
33
34
|
* and provide intelligent root cause analysis.
|
|
34
35
|
*/
|
|
36
|
+
const logger = LoggerFactory.create('defect-intelligence/causal-root-cause-analyzer');
|
|
35
37
|
export class CausalRootCauseAnalyzerService {
|
|
36
38
|
memory;
|
|
37
39
|
engine;
|
|
@@ -51,7 +53,7 @@ export class CausalRootCauseAnalyzerService {
|
|
|
51
53
|
if (this.config.autoPersist) {
|
|
52
54
|
const now = Date.now();
|
|
53
55
|
if (now - this.lastPersist > this.config.persistIntervalMs) {
|
|
54
|
-
this.persist().catch(
|
|
56
|
+
this.persist().catch((e) => logger.error('Persist failed', e instanceof Error ? e : undefined));
|
|
55
57
|
this.lastPersist = now;
|
|
56
58
|
}
|
|
57
59
|
}
|
|
@@ -70,12 +70,6 @@ export interface DefectPredictorDependencies {
|
|
|
70
70
|
/** ADR-051: Optional LLM router for AI-enhanced defect prediction */
|
|
71
71
|
llmRouter?: HybridRouter;
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Defect Prediction Service Implementation
|
|
75
|
-
* Uses ML-based heuristics to predict defect probability in code files
|
|
76
|
-
*
|
|
77
|
-
* ADR-051: Added LLM enhancement for AI-powered defect risk analysis
|
|
78
|
-
*/
|
|
79
73
|
export declare class DefectPredictorService implements IDefectPredictorService {
|
|
80
74
|
private readonly config;
|
|
81
75
|
private readonly memory;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* ADR-051: LLM enhancement for AI-powered defect risk analysis
|
|
7
7
|
*/
|
|
8
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
9
10
|
import { ok, err } from '../../../shared/types';
|
|
10
11
|
import { GitAnalyzer } from '../../../shared/git';
|
|
11
12
|
import { FileReader } from '../../../shared/io';
|
|
@@ -48,6 +49,7 @@ const DEFAULT_FEATURES = [
|
|
|
48
49
|
*
|
|
49
50
|
* ADR-051: Added LLM enhancement for AI-powered defect risk analysis
|
|
50
51
|
*/
|
|
52
|
+
const logger = LoggerFactory.create('defect-intelligence/defect-predictor');
|
|
51
53
|
export class DefectPredictorService {
|
|
52
54
|
config;
|
|
53
55
|
memory;
|
|
@@ -165,7 +167,7 @@ Be specific and actionable. Focus on concrete issues, not generic advice.`,
|
|
|
165
167
|
return null;
|
|
166
168
|
}
|
|
167
169
|
catch (error) {
|
|
168
|
-
|
|
170
|
+
logger.warn('LLM analysis failed, using heuristics only');
|
|
169
171
|
return null;
|
|
170
172
|
}
|
|
171
173
|
}
|
|
@@ -501,7 +503,7 @@ Be specific and actionable. Focus on concrete issues, not generic advice.`,
|
|
|
501
503
|
}
|
|
502
504
|
catch (error) {
|
|
503
505
|
// Non-critical: AST parse errors, using heuristics fallback
|
|
504
|
-
|
|
506
|
+
logger.debug(`AST parse failed: ${error instanceof Error ? error.message : error}`);
|
|
505
507
|
}
|
|
506
508
|
}
|
|
507
509
|
}
|
|
@@ -775,7 +777,7 @@ Be specific and actionable. Focus on concrete issues, not generic advice.`,
|
|
|
775
777
|
}
|
|
776
778
|
catch (error) {
|
|
777
779
|
// Log but don't fail - return empty array
|
|
778
|
-
|
|
780
|
+
logger.error(`Failed to analyze dependencies for ${file}`, error instanceof Error ? error : undefined);
|
|
779
781
|
}
|
|
780
782
|
return dependencies;
|
|
781
783
|
}
|
|
@@ -51,10 +51,6 @@ export interface PatternLearnerConfig {
|
|
|
51
51
|
/** Custom Flash Attention configuration */
|
|
52
52
|
flashAttentionConfig?: Partial<QEFlashAttentionConfig>;
|
|
53
53
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Pattern Learner Service Implementation
|
|
56
|
-
* Learns and recognizes defect patterns using ML and heuristics
|
|
57
|
-
*/
|
|
58
54
|
export declare class PatternLearnerService implements IPatternLearnerService {
|
|
59
55
|
private readonly memory;
|
|
60
56
|
private readonly config;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Uses NomicEmbedder for semantic embeddings
|
|
5
5
|
*/
|
|
6
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
7
8
|
import { ok, err } from '../../../shared/types';
|
|
8
9
|
import { NomicEmbedder, EMBEDDING_CONFIG } from '../../../shared/embeddings';
|
|
9
10
|
import { toError } from '../../../shared/error-utils.js';
|
|
@@ -57,6 +58,7 @@ const KNOWN_PATTERNS = {
|
|
|
57
58
|
* Pattern Learner Service Implementation
|
|
58
59
|
* Learns and recognizes defect patterns using ML and heuristics
|
|
59
60
|
*/
|
|
61
|
+
const logger = LoggerFactory.create('defect-intelligence/pattern-learner');
|
|
60
62
|
export class PatternLearnerService {
|
|
61
63
|
memory;
|
|
62
64
|
config;
|
|
@@ -84,7 +86,7 @@ export class PatternLearnerService {
|
|
|
84
86
|
const { createQEFlashAttention } = await import('../../../integrations/ruvector/wrappers.js');
|
|
85
87
|
this.flashAttention = await createQEFlashAttention('defect-matching', this.config.flashAttentionConfig);
|
|
86
88
|
this.flashAttentionAvailable = true;
|
|
87
|
-
|
|
89
|
+
logger.info('Flash Attention initialized for defect matching');
|
|
88
90
|
}
|
|
89
91
|
/**
|
|
90
92
|
* Ensure Flash Attention is initialized before use.
|
|
@@ -42,12 +42,6 @@ export interface RootCauseAnalyzerDependencies {
|
|
|
42
42
|
/** ADR-051: Optional LLM router for AI-enhanced root cause analysis */
|
|
43
43
|
llmRouter?: HybridRouter;
|
|
44
44
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Root Cause Analyzer Service Implementation
|
|
47
|
-
* Uses symptom analysis and heuristics to identify root causes
|
|
48
|
-
*
|
|
49
|
-
* ADR-051: Added LLM enhancement for AI-powered root cause analysis
|
|
50
|
-
*/
|
|
51
45
|
export declare class RootCauseAnalyzerService implements IRootCauseAnalyzerService {
|
|
52
46
|
private readonly config;
|
|
53
47
|
private readonly memory;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* ADR-051: LLM-enhanced root cause analysis for deeper insights
|
|
6
6
|
*/
|
|
7
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
7
8
|
import { ok, err } from '../../../shared/types';
|
|
8
9
|
import { toError } from '../../../shared/error-utils.js';
|
|
9
10
|
import { safeJsonParse } from '../../../shared/safe-json.js';
|
|
@@ -148,6 +149,7 @@ const ROOT_CAUSE_CATEGORIES = {
|
|
|
148
149
|
*
|
|
149
150
|
* ADR-051: Added LLM enhancement for AI-powered root cause analysis
|
|
150
151
|
*/
|
|
152
|
+
const logger = LoggerFactory.create('defect-intelligence/root-cause-analyzer');
|
|
151
153
|
export class RootCauseAnalyzerService {
|
|
152
154
|
config;
|
|
153
155
|
memory;
|
|
@@ -248,7 +250,7 @@ Return your analysis as JSON with this structure:
|
|
|
248
250
|
return null;
|
|
249
251
|
}
|
|
250
252
|
catch (error) {
|
|
251
|
-
|
|
253
|
+
logger.warn('LLM analysis failed, falling back to heuristics');
|
|
252
254
|
return null;
|
|
253
255
|
}
|
|
254
256
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* CQ-002: Extends BaseDomainCoordinator for lifecycle deduplication
|
|
8
8
|
*/
|
|
9
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
10
11
|
import { ok, err } from '../../shared/types/index.js';
|
|
11
12
|
import { createEvent } from '../../shared/events/domain-events.js';
|
|
12
13
|
import { createDomainFinding, } from '../../coordination/consensus/domain-findings.js';
|
|
@@ -41,6 +42,7 @@ const DEFAULT_CONFIG = {
|
|
|
41
42
|
// ============================================================================
|
|
42
43
|
// Enterprise Integration Coordinator
|
|
43
44
|
// ============================================================================
|
|
45
|
+
const logger = LoggerFactory.create('enterprise-integration');
|
|
44
46
|
export class EnterpriseIntegrationCoordinator extends BaseDomainCoordinator {
|
|
45
47
|
memory;
|
|
46
48
|
agentCoordinator;
|
|
@@ -65,7 +67,7 @@ export class EnterpriseIntegrationCoordinator extends BaseDomainCoordinator {
|
|
|
65
67
|
// ==========================================================================
|
|
66
68
|
async onInitialize() {
|
|
67
69
|
this.subscribeToEvents();
|
|
68
|
-
|
|
70
|
+
logger.info('Enterprise Integration Coordinator initialized');
|
|
69
71
|
}
|
|
70
72
|
async onDispose() {
|
|
71
73
|
// No domain-specific cleanup needed
|
|
@@ -529,10 +531,10 @@ export class EnterpriseIntegrationCoordinator extends BaseDomainCoordinator {
|
|
|
529
531
|
if (this.consensusMixin.requiresConsensus(domainFinding)) {
|
|
530
532
|
const result = await this.consensusMixin.verifyFinding(domainFinding);
|
|
531
533
|
if (result.success && result.value.verdict === 'verified') {
|
|
532
|
-
|
|
534
|
+
logger.info(`Finding verified by consensus: ${finding.type}`);
|
|
533
535
|
return true;
|
|
534
536
|
}
|
|
535
|
-
|
|
537
|
+
logger.warn(`Finding NOT verified: ${finding.type}`);
|
|
536
538
|
return false;
|
|
537
539
|
}
|
|
538
540
|
return true;
|
|
@@ -556,7 +558,7 @@ export class EnterpriseIntegrationCoordinator extends BaseDomainCoordinator {
|
|
|
556
558
|
// Track middleware-related fault injection for correlation
|
|
557
559
|
const payload = event.payload;
|
|
558
560
|
if (payload?.targetService?.includes('middleware') || payload?.targetService?.includes('esb')) {
|
|
559
|
-
|
|
561
|
+
logger.info(`Middleware fault injection detected: ${payload.targetService}`);
|
|
560
562
|
}
|
|
561
563
|
}
|
|
562
564
|
}
|
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { DomainName } from '../../shared/types/index.js';
|
|
9
9
|
import type { ConsensusEnabledMixin } from '../../coordination/mixins/consensus-enabled-domain';
|
|
10
|
-
/**
|
|
11
|
-
* Verify a pattern recommendation using multi-model consensus
|
|
12
|
-
*/
|
|
13
10
|
export declare function verifyPatternRecommendation(pattern: {
|
|
14
11
|
id: string;
|
|
15
12
|
name: string;
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
* Contains: consensus verification for pattern recommendations, optimization suggestions,
|
|
6
6
|
* cross-domain insights
|
|
7
7
|
*/
|
|
8
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
8
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import { createDomainFinding, } from '../../coordination/consensus/domain-findings.js';
|
|
10
11
|
/**
|
|
11
12
|
* Verify a pattern recommendation using multi-model consensus
|
|
12
13
|
*/
|
|
14
|
+
const logger = LoggerFactory.create('learning-optimization/consensus');
|
|
13
15
|
export async function verifyPatternRecommendation(pattern, confidence, consensusMixin, domainName) {
|
|
14
16
|
const finding = createDomainFinding({
|
|
15
17
|
id: uuidv4(),
|
|
@@ -23,10 +25,10 @@ export async function verifyPatternRecommendation(pattern, confidence, consensus
|
|
|
23
25
|
if (consensusMixin.requiresConsensus(finding)) {
|
|
24
26
|
const result = await consensusMixin.verifyFinding(finding);
|
|
25
27
|
if (result.success && result.value.verdict === 'verified') {
|
|
26
|
-
|
|
28
|
+
logger.info(`Pattern recommendation '${pattern.name}' verified by consensus`);
|
|
27
29
|
return true;
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
logger.warn(`Pattern recommendation '${pattern.name}' NOT verified: ${result.success ? result.value.verdict : result.error.message}`);
|
|
30
32
|
return false;
|
|
31
33
|
}
|
|
32
34
|
return true;
|
|
@@ -47,10 +49,10 @@ export async function verifyOptimizationSuggestion(suggestion, confidence, conse
|
|
|
47
49
|
if (consensusMixin.requiresConsensus(finding)) {
|
|
48
50
|
const result = await consensusMixin.verifyFinding(finding);
|
|
49
51
|
if (result.success && result.value.verdict === 'verified') {
|
|
50
|
-
|
|
52
|
+
logger.info(`Optimization suggestion for '${suggestion.metric}' verified by consensus`);
|
|
51
53
|
return true;
|
|
52
54
|
}
|
|
53
|
-
|
|
55
|
+
logger.warn(`Optimization suggestion for '${suggestion.metric}' NOT verified`);
|
|
54
56
|
return false;
|
|
55
57
|
}
|
|
56
58
|
return true;
|
|
@@ -71,10 +73,10 @@ export async function verifyCrossDomainInsight(insight, confidence, consensusMix
|
|
|
71
73
|
if (consensusMixin.requiresConsensus(finding)) {
|
|
72
74
|
const result = await consensusMixin.verifyFinding(finding);
|
|
73
75
|
if (result.success && result.value.verdict === 'verified') {
|
|
74
|
-
|
|
76
|
+
logger.info(`Cross-domain insight verified by consensus for ${insight.targetDomains.length} target domains`);
|
|
75
77
|
return true;
|
|
76
78
|
}
|
|
77
|
-
|
|
79
|
+
logger.warn(`Cross-domain insight NOT verified: ${result.success ? result.value.verdict : result.error.message}`);
|
|
78
80
|
return false;
|
|
79
81
|
}
|
|
80
82
|
return true;
|
|
@@ -51,9 +51,6 @@ export interface LearningCoordinatorConfig extends BaseDomainCoordinatorConfig {
|
|
|
51
51
|
* Orchestrates cross-domain learning and optimization workflows
|
|
52
52
|
*/
|
|
53
53
|
type LearningWorkflowType = 'learning-cycle' | 'optimization' | 'transfer' | 'export' | 'import';
|
|
54
|
-
/**
|
|
55
|
-
* CQ-002: Extends BaseDomainCoordinator
|
|
56
|
-
*/
|
|
57
54
|
export declare class LearningOptimizationCoordinator extends BaseDomainCoordinator<LearningCoordinatorConfig, LearningWorkflowType> implements ILearningOptimizationCoordinator {
|
|
58
55
|
private readonly memory;
|
|
59
56
|
private readonly agentCoordinator;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Learning & Optimization Coordinator
|
|
3
3
|
* Orchestrates learning workflows across all QE domains
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
5
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
7
|
import { toError } from '../../shared/error-utils.js';
|
|
7
8
|
import { ok, err, ALL_DOMAINS, } from '../../shared/types/index.js';
|
|
@@ -42,6 +43,7 @@ const DEFAULT_CONFIG = {
|
|
|
42
43
|
/**
|
|
43
44
|
* CQ-002: Extends BaseDomainCoordinator
|
|
44
45
|
*/
|
|
46
|
+
const logger = LoggerFactory.create('learning-optimization');
|
|
45
47
|
export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
46
48
|
memory;
|
|
47
49
|
agentCoordinator;
|
|
@@ -91,12 +93,12 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
91
93
|
maxPatterns: 10000,
|
|
92
94
|
minConfidence: 0.5,
|
|
93
95
|
});
|
|
94
|
-
|
|
96
|
+
logger.info('PersistentSONAEngine initialized for pattern learning');
|
|
95
97
|
}
|
|
96
98
|
catch (error) {
|
|
97
99
|
// SONA is an enhancement, not a hard requirement — degrade gracefully (#359)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
logger.error('Failed to initialize PersistentSONAEngine:', error instanceof Error ? error : undefined);
|
|
101
|
+
logger.warn('Continuing without SONA pattern persistence');
|
|
100
102
|
this.sona = null;
|
|
101
103
|
}
|
|
102
104
|
// Initialize DreamScheduler if enabled
|
|
@@ -118,10 +120,10 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
118
120
|
});
|
|
119
121
|
await this.dreamScheduler.initialize();
|
|
120
122
|
this.dreamScheduler.start();
|
|
121
|
-
|
|
123
|
+
logger.info('DreamScheduler initialized and started');
|
|
122
124
|
}
|
|
123
125
|
catch (error) {
|
|
124
|
-
|
|
126
|
+
logger.warn('Failed to initialize DreamScheduler:');
|
|
125
127
|
// DreamScheduler is optional - continue without it
|
|
126
128
|
}
|
|
127
129
|
}
|
|
@@ -141,10 +143,10 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
141
143
|
if (this.dreamScheduler) {
|
|
142
144
|
try {
|
|
143
145
|
await this.dreamScheduler.dispose();
|
|
144
|
-
|
|
146
|
+
logger.info('DreamScheduler disposed');
|
|
145
147
|
}
|
|
146
148
|
catch (error) {
|
|
147
|
-
|
|
149
|
+
logger.error('Error disposing DreamScheduler:', error instanceof Error ? error : undefined);
|
|
148
150
|
}
|
|
149
151
|
this.dreamScheduler = null;
|
|
150
152
|
}
|
|
@@ -154,7 +156,7 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
154
156
|
await this.sona.close();
|
|
155
157
|
}
|
|
156
158
|
catch (error) {
|
|
157
|
-
|
|
159
|
+
logger.error('Error closing SONA engine:', error instanceof Error ? error : undefined);
|
|
158
160
|
}
|
|
159
161
|
}
|
|
160
162
|
}
|
|
@@ -176,7 +178,7 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
176
178
|
this.startWorkflow(workflowId, 'learning-cycle');
|
|
177
179
|
// ADR-047: Check topology health before expensive operations
|
|
178
180
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
179
|
-
|
|
181
|
+
logger.warn(`Topology degraded, using conservative strategy for learning cycle`);
|
|
180
182
|
// Continue with reduced scope when topology is unhealthy
|
|
181
183
|
}
|
|
182
184
|
// ADR-047: Check if operations should be paused due to critical topology
|
|
@@ -267,7 +269,7 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
267
269
|
this.startWorkflow(workflowId, 'optimization');
|
|
268
270
|
// ADR-047: Check topology health before expensive operations
|
|
269
271
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
270
|
-
|
|
272
|
+
logger.warn(`Topology degraded, using conservative optimization strategy`);
|
|
271
273
|
}
|
|
272
274
|
// ADR-047: Check if operations should be paused due to critical topology
|
|
273
275
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
@@ -334,7 +336,7 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
334
336
|
this.startWorkflow(workflowId, 'transfer');
|
|
335
337
|
// ADR-047: Check topology health before cross-domain operations
|
|
336
338
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
337
|
-
|
|
339
|
+
logger.warn(`Topology degraded, limiting cross-domain transfer scope`);
|
|
338
340
|
}
|
|
339
341
|
// ADR-047: Check if operations should be paused due to critical topology
|
|
340
342
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
@@ -1065,7 +1067,7 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
1065
1067
|
createdAt: new Date(experience.startedAt),
|
|
1066
1068
|
}, targetDomain);
|
|
1067
1069
|
}
|
|
1068
|
-
|
|
1070
|
+
logger.info(`[LearningOptimizationCoordinator] Experience ${experience.id} transferred to ${relatedDomains.length} related domains`);
|
|
1069
1071
|
}
|
|
1070
1072
|
// Record experience for dream scheduler to trigger insight generation
|
|
1071
1073
|
if (this.dreamScheduler) {
|
|
@@ -1139,7 +1141,7 @@ export class LearningOptimizationCoordinator extends BaseDomainCoordinator {
|
|
|
1139
1141
|
};
|
|
1140
1142
|
const event = createEvent(LearningOptimizationEvents.DreamCycleCompleted, 'learning-optimization', payload);
|
|
1141
1143
|
await this.eventBus.publish(event);
|
|
1142
|
-
|
|
1144
|
+
logger.info(`[LearningOptimizationCoordinator] Published dream cycle completion: ${insights.length} insights for ${conceptsProcessed} concepts`);
|
|
1143
1145
|
}
|
|
1144
1146
|
// ============================================================================
|
|
1145
1147
|
// Agent Management
|
|
@@ -31,10 +31,6 @@ export interface LearningCoordinatorDependencies {
|
|
|
31
31
|
memory: MemoryBackend;
|
|
32
32
|
llmRouter?: HybridRouter;
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Learning Coordinator Service
|
|
36
|
-
* Implements pattern learning and experience mining capabilities
|
|
37
|
-
*/
|
|
38
34
|
export declare class LearningCoordinatorService implements IPatternLearningService, IExperienceMiningService {
|
|
39
35
|
private readonly config;
|
|
40
36
|
private readonly memory;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Learning Coordinator Service
|
|
3
3
|
* Orchestrates learning across all QE domains
|
|
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';
|
|
@@ -20,6 +21,7 @@ const DEFAULT_CONFIG = {
|
|
|
20
21
|
* Learning Coordinator Service
|
|
21
22
|
* Implements pattern learning and experience mining capabilities
|
|
22
23
|
*/
|
|
24
|
+
const logger = LoggerFactory.create('learning-optimization/learning-coordinator');
|
|
23
25
|
export class LearningCoordinatorService {
|
|
24
26
|
config;
|
|
25
27
|
memory;
|
|
@@ -47,7 +49,7 @@ export class LearningCoordinatorService {
|
|
|
47
49
|
*/
|
|
48
50
|
async initializeFlashAttention(customConfig) {
|
|
49
51
|
this.flashAttention = await createQEFlashAttention('pattern-adaptation', customConfig);
|
|
50
|
-
|
|
52
|
+
logger.info('FlashAttention initialized for pattern adaptation');
|
|
51
53
|
return this.flashAttention;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
@@ -186,7 +188,7 @@ Provide:
|
|
|
186
188
|
return response.content;
|
|
187
189
|
}
|
|
188
190
|
catch (error) {
|
|
189
|
-
|
|
191
|
+
logger.warn('LLM synthesis failed:');
|
|
190
192
|
return null;
|
|
191
193
|
}
|
|
192
194
|
}
|
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ClaimVerifierService, type QEReport } from '../../agents/claim-verifier/index.js';
|
|
8
8
|
import type { GateResult, QualityReport } from './interfaces';
|
|
9
|
-
/**
|
|
10
|
-
* Initialize ClaimVerifier for report verification
|
|
11
|
-
*/
|
|
12
9
|
export declare function initializeClaimVerifier(claimVerifierRootDir?: string): Promise<ClaimVerifierService>;
|
|
13
10
|
/**
|
|
14
11
|
* Verify a quality report's claims before returning
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Contains: ClaimVerifier initialization, report/gate result verification
|
|
6
6
|
*/
|
|
7
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
7
8
|
import { toErrorMessage } from '../../shared/error-utils.js';
|
|
8
9
|
import { createClaimVerifierService, } from '../../agents/claim-verifier/index.js';
|
|
9
10
|
/**
|
|
10
11
|
* Initialize ClaimVerifier for report verification
|
|
11
12
|
*/
|
|
13
|
+
const logger = LoggerFactory.create('quality-assessment/claim-verifier');
|
|
12
14
|
export async function initializeClaimVerifier(claimVerifierRootDir) {
|
|
13
15
|
try {
|
|
14
16
|
const rootDir = claimVerifierRootDir || process.cwd();
|
|
@@ -36,7 +38,7 @@ export async function verifyQualityReportClaims(report, claimVerifier) {
|
|
|
36
38
|
}
|
|
37
39
|
const verification = await claimVerifier.verifyReport(qeReport);
|
|
38
40
|
if (!verification.success) {
|
|
39
|
-
|
|
41
|
+
logger.warn('Claim verification failed:');
|
|
40
42
|
return report;
|
|
41
43
|
}
|
|
42
44
|
return {
|
|
@@ -49,7 +51,7 @@ export async function verifyQualityReportClaims(report, claimVerifier) {
|
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
catch (error) {
|
|
52
|
-
|
|
54
|
+
logger.error('Failed to verify report claims:', error instanceof Error ? error : undefined);
|
|
53
55
|
return report;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -64,7 +66,7 @@ export async function verifyGateResultClaims(result, claimVerifier) {
|
|
|
64
66
|
}
|
|
65
67
|
const verification = await claimVerifier.verifyReport(qeReport);
|
|
66
68
|
if (!verification.success) {
|
|
67
|
-
|
|
69
|
+
logger.warn('Gate claim verification failed:');
|
|
68
70
|
return result;
|
|
69
71
|
}
|
|
70
72
|
return {
|
|
@@ -77,7 +79,7 @@ export async function verifyGateResultClaims(result, claimVerifier) {
|
|
|
77
79
|
};
|
|
78
80
|
}
|
|
79
81
|
catch (error) {
|
|
80
|
-
|
|
82
|
+
logger.error('Failed to verify gate claims:', error instanceof Error ? error : undefined);
|
|
81
83
|
return result;
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { GateEvaluationRequest, GateResult, DeploymentRequest, DeploymentAdvice, QualityMetrics, GateThresholds } from './interfaces';
|
|
8
8
|
import type { ConsensusEnabledMixin } from '../../coordination/mixins/consensus-enabled-domain';
|
|
9
|
-
/**
|
|
10
|
-
* Check if a gate result is a borderline case.
|
|
11
|
-
* A borderline case is when any metric is within the configured margin of its threshold.
|
|
12
|
-
*/
|
|
13
9
|
export declare function isBorderlineGateResult(metrics: QualityMetrics, thresholds: GateThresholds, _result: GateResult, borderlineMargin: number): boolean;
|
|
14
10
|
/**
|
|
15
11
|
* Verify a gate verdict with multi-model consensus.
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Contains: borderline detection, consensus verification for gates and deployments
|
|
6
6
|
*/
|
|
7
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
7
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
9
|
import { createDomainFinding, } from '../../coordination/consensus/domain-findings';
|
|
9
10
|
/**
|
|
10
11
|
* Check if a gate result is a borderline case.
|
|
11
12
|
* A borderline case is when any metric is within the configured margin of its threshold.
|
|
12
13
|
*/
|
|
14
|
+
const logger = LoggerFactory.create('quality-assessment/gate-evaluation');
|
|
13
15
|
export function isBorderlineGateResult(metrics, thresholds, _result, borderlineMargin) {
|
|
14
16
|
const margin = borderlineMargin;
|
|
15
17
|
const metricsToCheck = [
|
|
@@ -33,7 +35,7 @@ export function isBorderlineGateResult(metrics, thresholds, _result, borderlineM
|
|
|
33
35
|
continue;
|
|
34
36
|
const relativeDistance = Math.abs(metricValue - threshold) / threshold;
|
|
35
37
|
if (relativeDistance < margin) {
|
|
36
|
-
|
|
38
|
+
logger.info(`Borderline detected: ${metricKey}=${metricValue} (threshold=${threshold}, distance=${(relativeDistance * 100).toFixed(1)}%)`);
|
|
37
39
|
return true;
|
|
38
40
|
}
|
|
39
41
|
}
|
|
@@ -62,11 +64,11 @@ export async function verifyGateVerdictWithConsensus(request, initialResult, con
|
|
|
62
64
|
try {
|
|
63
65
|
const consensusResult = await consensusMixin.verifyFinding(finding);
|
|
64
66
|
if (!consensusResult.success) {
|
|
65
|
-
|
|
67
|
+
logger.warn('Consensus verification failed:');
|
|
66
68
|
return null;
|
|
67
69
|
}
|
|
68
70
|
const consensus = consensusResult.value;
|
|
69
|
-
|
|
71
|
+
logger.info(`[quality-assessment] Consensus for gate '${request.gateName}': ` +
|
|
70
72
|
`verdict=${consensus.verdict}, confidence=${(consensus.confidence * 100).toFixed(1)}%`);
|
|
71
73
|
return {
|
|
72
74
|
...initialResult,
|
|
@@ -76,7 +78,7 @@ export async function verifyGateVerdictWithConsensus(request, initialResult, con
|
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
80
|
catch (error) {
|
|
79
|
-
|
|
81
|
+
logger.error('Consensus verification error:', error instanceof Error ? error : undefined);
|
|
80
82
|
return null;
|
|
81
83
|
}
|
|
82
84
|
}
|
|
@@ -114,11 +116,11 @@ export async function verifyDeploymentAdviceWithConsensus(request, initialAdvice
|
|
|
114
116
|
try {
|
|
115
117
|
const consensusResult = await consensusMixin.verifyFinding(finding);
|
|
116
118
|
if (!consensusResult.success) {
|
|
117
|
-
|
|
119
|
+
logger.warn('Consensus verification for deployment failed:');
|
|
118
120
|
return null;
|
|
119
121
|
}
|
|
120
122
|
const consensus = consensusResult.value;
|
|
121
|
-
|
|
123
|
+
logger.info(`[quality-assessment] Consensus for deployment '${request.releaseCandidate}': ` +
|
|
122
124
|
`verdict=${consensus.verdict}, confidence=${(consensus.confidence * 100).toFixed(1)}%`);
|
|
123
125
|
return {
|
|
124
126
|
...initialAdvice,
|
|
@@ -128,7 +130,7 @@ export async function verifyDeploymentAdviceWithConsensus(request, initialAdvice
|
|
|
128
130
|
};
|
|
129
131
|
}
|
|
130
132
|
catch (error) {
|
|
131
|
-
|
|
133
|
+
logger.error('Consensus verification error:', error instanceof Error ? error : undefined);
|
|
132
134
|
return null;
|
|
133
135
|
}
|
|
134
136
|
}
|
|
@@ -45,9 +45,6 @@ export interface QualityGateThresholds {
|
|
|
45
45
|
max: number;
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Initialize Actor-Critic RL for quality gate threshold tuning
|
|
50
|
-
*/
|
|
51
48
|
export declare function initializeActorCritic(): Promise<ActorCriticAlgorithm>;
|
|
52
49
|
/**
|
|
53
50
|
* Initialize PersistentSONAEngine for quality pattern learning
|