agentic-qe 3.3.1 → 3.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/statusline-v3.cjs +96 -27
- package/README.md +6 -3
- package/package.json +1 -1
- package/scripts/sync-claude-flow.cjs +99 -0
- package/v3/CHANGELOG.md +133 -0
- package/v3/README.md +9 -5
- package/v3/dist/cli/bundle.js +60879 -51811
- package/v3/dist/coordination/consensus/domain-findings.d.ts +202 -0
- package/v3/dist/coordination/consensus/domain-findings.d.ts.map +1 -0
- package/v3/dist/coordination/consensus/domain-findings.js +66 -0
- package/v3/dist/coordination/consensus/domain-findings.js.map +1 -0
- package/v3/dist/coordination/consensus/index.d.ts +2 -0
- package/v3/dist/coordination/consensus/index.d.ts.map +1 -1
- package/v3/dist/coordination/consensus/index.js +4 -0
- package/v3/dist/coordination/consensus/index.js.map +1 -1
- package/v3/dist/coordination/index.d.ts +1 -0
- package/v3/dist/coordination/index.d.ts.map +1 -1
- package/v3/dist/coordination/index.js +4 -0
- package/v3/dist/coordination/index.js.map +1 -1
- package/v3/dist/coordination/mixins/consensus-enabled-domain.d.ts +225 -0
- package/v3/dist/coordination/mixins/consensus-enabled-domain.d.ts.map +1 -0
- package/v3/dist/coordination/mixins/consensus-enabled-domain.js +466 -0
- package/v3/dist/coordination/mixins/consensus-enabled-domain.js.map +1 -0
- package/v3/dist/coordination/mixins/index.d.ts +14 -0
- package/v3/dist/coordination/mixins/index.d.ts.map +1 -0
- package/v3/dist/coordination/mixins/index.js +28 -0
- package/v3/dist/coordination/mixins/index.js.map +1 -0
- package/v3/dist/coordination/mixins/mincut-aware-domain.d.ts +227 -0
- package/v3/dist/coordination/mixins/mincut-aware-domain.d.ts.map +1 -0
- package/v3/dist/coordination/mixins/mincut-aware-domain.js +368 -0
- package/v3/dist/coordination/mixins/mincut-aware-domain.js.map +1 -0
- package/v3/dist/coordination/queen-coordinator.d.ts +23 -1
- package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
- package/v3/dist/coordination/queen-coordinator.js +131 -3
- package/v3/dist/coordination/queen-coordinator.js.map +1 -1
- package/v3/dist/coordination/task-executor.d.ts +21 -1
- package/v3/dist/coordination/task-executor.d.ts.map +1 -1
- package/v3/dist/coordination/task-executor.js +222 -5
- package/v3/dist/coordination/task-executor.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/coordinator.d.ts +92 -0
- package/v3/dist/domains/chaos-resilience/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/chaos-resilience/coordinator.js +241 -1
- package/v3/dist/domains/chaos-resilience/coordinator.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/plugin.js +1 -1
- package/v3/dist/domains/chaos-resilience/plugin.js.map +1 -1
- package/v3/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +29 -2
- package/v3/dist/domains/chaos-resilience/services/chaos-engineer.d.ts.map +1 -1
- package/v3/dist/domains/chaos-resilience/services/chaos-engineer.js +62 -3
- package/v3/dist/domains/chaos-resilience/services/chaos-engineer.js.map +1 -1
- package/v3/dist/domains/code-intelligence/coordinator.d.ts +112 -0
- package/v3/dist/domains/code-intelligence/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/coordinator.js +221 -0
- package/v3/dist/domains/code-intelligence/coordinator.js.map +1 -1
- package/v3/dist/domains/code-intelligence/services/knowledge-graph.d.ts +66 -2
- package/v3/dist/domains/code-intelligence/services/knowledge-graph.d.ts.map +1 -1
- package/v3/dist/domains/code-intelligence/services/knowledge-graph.js +253 -3
- package/v3/dist/domains/code-intelligence/services/knowledge-graph.js.map +1 -1
- package/v3/dist/domains/contract-testing/coordinator.d.ts +89 -1
- package/v3/dist/domains/contract-testing/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/contract-testing/coordinator.js +222 -1
- package/v3/dist/domains/contract-testing/coordinator.js.map +1 -1
- package/v3/dist/domains/contract-testing/interfaces.d.ts +29 -1
- package/v3/dist/domains/contract-testing/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/contract-testing/plugin.js +1 -1
- package/v3/dist/domains/contract-testing/plugin.js.map +1 -1
- package/v3/dist/domains/contract-testing/services/contract-validator.d.ts +29 -2
- package/v3/dist/domains/contract-testing/services/contract-validator.d.ts.map +1 -1
- package/v3/dist/domains/contract-testing/services/contract-validator.js +58 -3
- package/v3/dist/domains/contract-testing/services/contract-validator.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/coordinator.d.ts +95 -2
- package/v3/dist/domains/coverage-analysis/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/coordinator.js +274 -6
- package/v3/dist/domains/coverage-analysis/coordinator.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.d.ts +6 -1
- package/v3/dist/domains/coverage-analysis/plugin.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.js +73 -0
- package/v3/dist/domains/coverage-analysis/plugin.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/coverage-analyzer.d.ts +119 -3
- package/v3/dist/domains/coverage-analysis/services/coverage-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/coverage-analyzer.js +267 -5
- package/v3/dist/domains/coverage-analysis/services/coverage-analyzer.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/gap-detector.d.ts +111 -2
- package/v3/dist/domains/coverage-analysis/services/gap-detector.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/gap-detector.js +231 -3
- package/v3/dist/domains/coverage-analysis/services/gap-detector.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/coordinator.d.ts +80 -1
- package/v3/dist/domains/defect-intelligence/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/coordinator.js +262 -7
- package/v3/dist/domains/defect-intelligence/coordinator.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/interfaces.d.ts +17 -0
- package/v3/dist/domains/defect-intelligence/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/defect-predictor.d.ts +91 -2
- package/v3/dist/domains/defect-intelligence/services/defect-predictor.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/defect-predictor.js +274 -7
- package/v3/dist/domains/defect-intelligence/services/defect-predictor.js.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts +79 -2
- package/v3/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/defect-intelligence/services/root-cause-analyzer.js +259 -3
- package/v3/dist/domains/defect-intelligence/services/root-cause-analyzer.js.map +1 -1
- package/v3/dist/domains/domain-interface.d.ts +194 -2
- package/v3/dist/domains/domain-interface.d.ts.map +1 -1
- package/v3/dist/domains/domain-interface.js +239 -0
- package/v3/dist/domains/domain-interface.js.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.d.ts +171 -0
- package/v3/dist/domains/learning-optimization/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.js +401 -1
- package/v3/dist/domains/learning-optimization/coordinator.js.map +1 -1
- package/v3/dist/domains/learning-optimization/index.d.ts +1 -1
- package/v3/dist/domains/learning-optimization/index.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/index.js.map +1 -1
- package/v3/dist/domains/learning-optimization/interfaces.d.ts +18 -0
- package/v3/dist/domains/learning-optimization/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/plugin.js +1 -1
- package/v3/dist/domains/learning-optimization/plugin.js.map +1 -1
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.d.ts +54 -2
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.js +90 -3
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.js.map +1 -1
- package/v3/dist/domains/quality-assessment/coordinator.d.ts +127 -0
- package/v3/dist/domains/quality-assessment/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/coordinator.js +493 -7
- package/v3/dist/domains/quality-assessment/coordinator.js.map +1 -1
- package/v3/dist/domains/quality-assessment/interfaces.d.ts +22 -0
- package/v3/dist/domains/quality-assessment/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/plugin.d.ts +6 -1
- package/v3/dist/domains/quality-assessment/plugin.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/plugin.js +67 -0
- package/v3/dist/domains/quality-assessment/plugin.js.map +1 -1
- package/v3/dist/domains/quality-assessment/services/deployment-advisor.d.ts +61 -2
- package/v3/dist/domains/quality-assessment/services/deployment-advisor.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/services/deployment-advisor.js +213 -5
- package/v3/dist/domains/quality-assessment/services/deployment-advisor.js.map +1 -1
- package/v3/dist/domains/quality-assessment/services/quality-analyzer.d.ts +59 -4
- package/v3/dist/domains/quality-assessment/services/quality-analyzer.d.ts.map +1 -1
- package/v3/dist/domains/quality-assessment/services/quality-analyzer.js +195 -3
- package/v3/dist/domains/quality-assessment/services/quality-analyzer.js.map +1 -1
- package/v3/dist/domains/requirements-validation/coordinator.d.ts +78 -0
- package/v3/dist/domains/requirements-validation/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/coordinator.js +189 -0
- package/v3/dist/domains/requirements-validation/coordinator.js.map +1 -1
- package/v3/dist/domains/requirements-validation/interfaces.d.ts +4 -0
- package/v3/dist/domains/requirements-validation/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/services/requirements-validator.d.ts +106 -2
- package/v3/dist/domains/requirements-validation/services/requirements-validator.d.ts.map +1 -1
- package/v3/dist/domains/requirements-validation/services/requirements-validator.js +263 -3
- package/v3/dist/domains/requirements-validation/services/requirements-validator.js.map +1 -1
- package/v3/dist/domains/security-compliance/coordinator.d.ts +56 -1
- package/v3/dist/domains/security-compliance/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/coordinator.js +241 -17
- package/v3/dist/domains/security-compliance/coordinator.js.map +1 -1
- package/v3/dist/domains/security-compliance/interfaces.d.ts +2 -0
- package/v3/dist/domains/security-compliance/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/security-scanner.d.ts +33 -2
- package/v3/dist/domains/security-compliance/services/security-scanner.d.ts.map +1 -1
- package/v3/dist/domains/security-compliance/services/security-scanner.js +107 -3
- package/v3/dist/domains/security-compliance/services/security-scanner.js.map +1 -1
- package/v3/dist/domains/test-execution/coordinator.d.ts +89 -0
- package/v3/dist/domains/test-execution/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/coordinator.js +259 -2
- package/v3/dist/domains/test-execution/coordinator.js.map +1 -1
- package/v3/dist/domains/test-execution/plugin.d.ts +6 -1
- package/v3/dist/domains/test-execution/plugin.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/plugin.js +77 -0
- package/v3/dist/domains/test-execution/plugin.js.map +1 -1
- package/v3/dist/domains/test-execution/services/test-executor.d.ts +30 -2
- package/v3/dist/domains/test-execution/services/test-executor.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/services/test-executor.js +64 -3
- package/v3/dist/domains/test-execution/services/test-executor.js.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.d.ts +137 -0
- package/v3/dist/domains/test-generation/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/coordinator.js +421 -1
- package/v3/dist/domains/test-generation/coordinator.js.map +1 -1
- package/v3/dist/domains/test-generation/interfaces.d.ts +2 -0
- package/v3/dist/domains/test-generation/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/plugin.d.ts +6 -1
- package/v3/dist/domains/test-generation/plugin.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/plugin.js +84 -0
- package/v3/dist/domains/test-generation/plugin.js.map +1 -1
- package/v3/dist/domains/test-generation/services/test-generator.d.ts +32 -0
- package/v3/dist/domains/test-generation/services/test-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/test-generator.js +158 -3
- package/v3/dist/domains/test-generation/services/test-generator.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/coordinator.d.ts +77 -0
- package/v3/dist/domains/visual-accessibility/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/coordinator.js +210 -2
- package/v3/dist/domains/visual-accessibility/coordinator.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/plugin.js +3 -3
- package/v3/dist/domains/visual-accessibility/plugin.js.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/visual-tester.d.ts +47 -2
- package/v3/dist/domains/visual-accessibility/services/visual-tester.d.ts.map +1 -1
- package/v3/dist/domains/visual-accessibility/services/visual-tester.js +87 -3
- package/v3/dist/domains/visual-accessibility/services/visual-tester.js.map +1 -1
- package/v3/dist/kernel/interfaces.d.ts +54 -1
- package/v3/dist/kernel/interfaces.d.ts.map +1 -1
- package/v3/dist/learning/dream/dream-scheduler.d.ts +302 -0
- package/v3/dist/learning/dream/dream-scheduler.d.ts.map +1 -0
- package/v3/dist/learning/dream/dream-scheduler.js +551 -0
- package/v3/dist/learning/dream/dream-scheduler.js.map +1 -0
- package/v3/dist/learning/dream/index.d.ts +1 -0
- package/v3/dist/learning/dream/index.d.ts.map +1 -1
- package/v3/dist/learning/dream/index.js +4 -0
- package/v3/dist/learning/dream/index.js.map +1 -1
- package/v3/dist/learning/experience-capture-middleware.d.ts +119 -0
- package/v3/dist/learning/experience-capture-middleware.d.ts.map +1 -0
- package/v3/dist/learning/experience-capture-middleware.js +416 -0
- package/v3/dist/learning/experience-capture-middleware.js.map +1 -0
- package/v3/dist/mcp/bundle.js +83142 -70580
- package/v3/dist/mcp/handlers/core-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/core-handlers.js +16 -2
- package/v3/dist/mcp/handlers/core-handlers.js.map +1 -1
- package/v3/dist/mcp/handlers/domain-handlers.d.ts +12 -13
- package/v3/dist/mcp/handlers/domain-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/index.d.ts +1 -1
- package/v3/dist/mcp/handlers/index.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/index.js +2 -2
- package/v3/dist/mcp/handlers/index.js.map +1 -1
- package/v3/dist/mcp/handlers/task-handlers.d.ts +1 -0
- package/v3/dist/mcp/handlers/task-handlers.d.ts.map +1 -1
- package/v3/dist/mcp/handlers/task-handlers.js +46 -12
- package/v3/dist/mcp/handlers/task-handlers.js.map +1 -1
- package/v3/dist/mcp/handlers/wrapped-domain-handlers.d.ts +30 -0
- package/v3/dist/mcp/handlers/wrapped-domain-handlers.d.ts.map +1 -0
- package/v3/dist/mcp/handlers/wrapped-domain-handlers.js +75 -0
- package/v3/dist/mcp/handlers/wrapped-domain-handlers.js.map +1 -0
- package/v3/dist/mcp/services/reasoning-bank-service.d.ts +87 -13
- package/v3/dist/mcp/services/reasoning-bank-service.d.ts.map +1 -1
- package/v3/dist/mcp/services/reasoning-bank-service.js +291 -31
- package/v3/dist/mcp/services/reasoning-bank-service.js.map +1 -1
- package/v3/dist/mcp/tools/chaos-resilience/inject.js +1 -1
- package/v3/dist/mcp/tools/chaos-resilience/inject.js.map +1 -1
- package/v3/dist/mcp/tools/contract-testing/validate.js +1 -1
- package/v3/dist/mcp/tools/contract-testing/validate.js.map +1 -1
- package/v3/dist/mcp/tools/learning-optimization/optimize.js +1 -1
- package/v3/dist/mcp/tools/learning-optimization/optimize.js.map +1 -1
- package/v3/dist/mcp/tools/visual-accessibility/index.js +2 -2
- package/v3/dist/mcp/tools/visual-accessibility/index.js.map +1 -1
- package/v3/dist/routing/qe-agent-registry.d.ts +28 -1
- package/v3/dist/routing/qe-agent-registry.d.ts.map +1 -1
- package/v3/dist/routing/qe-agent-registry.js +116 -1
- package/v3/dist/routing/qe-agent-registry.js.map +1 -1
- package/v3/dist/shared/events/domain-events.d.ts +27 -0
- package/v3/dist/shared/events/domain-events.d.ts.map +1 -1
- package/v3/dist/shared/events/domain-events.js +1 -0
- package/v3/dist/shared/events/domain-events.js.map +1 -1
- package/v3/dist/sync/claude-flow-bridge.d.ts +63 -0
- package/v3/dist/sync/claude-flow-bridge.d.ts.map +1 -0
- package/v3/dist/sync/claude-flow-bridge.js +320 -0
- package/v3/dist/sync/claude-flow-bridge.js.map +1 -0
- package/v3/package.json +1 -1
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
* - ActorCritic RL: Quality gate threshold tuning
|
|
7
7
|
* - QESONA: Quality pattern learning
|
|
8
8
|
* - QEFlashAttention: Similarity computations for quality reports
|
|
9
|
+
*
|
|
10
|
+
* V3 Integrations (ADR-047, CONSENSUS-MIXIN-001):
|
|
11
|
+
* - MinCutAwareDomainMixin: Topology-aware routing and health monitoring
|
|
12
|
+
* - ConsensusEnabledMixin: Multi-model consensus for high-stakes quality decisions
|
|
9
13
|
*/
|
|
10
14
|
import { v4 as uuidv4 } from 'uuid';
|
|
11
15
|
import { ok, err } from '../../shared/types';
|
|
12
|
-
import { QualityAssessmentEvents, createEvent, } from '../../shared/events/domain-events';
|
|
16
|
+
import { QualityAssessmentEvents, LearningOptimizationEvents, createEvent, } from '../../shared/events/domain-events';
|
|
13
17
|
import { QualityGateService, } from './services/quality-gate';
|
|
14
18
|
import { QualityAnalyzerService, } from './services/quality-analyzer';
|
|
15
19
|
import { DeploymentAdvisorService, } from './services/deployment-advisor';
|
|
@@ -19,6 +23,11 @@ import { createPersistentSONAEngine } from '../../integrations/ruvector/sona-per
|
|
|
19
23
|
import { createQEFlashAttention, } from '../../integrations/ruvector/wrappers';
|
|
20
24
|
// V3 Integration: ClaimVerifier for report verification (Phase 4)
|
|
21
25
|
import { createClaimVerifierService, } from '../../agents/claim-verifier/index.js';
|
|
26
|
+
// V3 Integration: MinCut Awareness (ADR-047)
|
|
27
|
+
import { createMinCutAwareMixin, } from '../../coordination/mixins/mincut-aware-domain';
|
|
28
|
+
// V3 Integration: Consensus Verification (CONSENSUS-MIXIN-001)
|
|
29
|
+
import { createConsensusEnabledMixin, } from '../../coordination/mixins/consensus-enabled-domain';
|
|
30
|
+
import { createDomainFinding, } from '../../coordination/consensus/domain-findings';
|
|
22
31
|
const DEFAULT_CONFIG = {
|
|
23
32
|
maxConcurrentWorkflows: 5,
|
|
24
33
|
defaultTimeout: 60000,
|
|
@@ -29,6 +38,14 @@ const DEFAULT_CONFIG = {
|
|
|
29
38
|
enableFlashAttention: true,
|
|
30
39
|
// V3: ClaimVerifier enabled by default
|
|
31
40
|
enableClaimVerification: true,
|
|
41
|
+
// V3: MinCut Awareness enabled by default
|
|
42
|
+
enableMinCutAwareness: true,
|
|
43
|
+
topologyHealthThreshold: 0.5,
|
|
44
|
+
// V3: Consensus enabled by default for quality decisions
|
|
45
|
+
enableConsensus: true,
|
|
46
|
+
consensusThreshold: 0.7,
|
|
47
|
+
consensusMinModels: 2,
|
|
48
|
+
borderlineMargin: 0.05, // 5% margin for borderline detection
|
|
32
49
|
};
|
|
33
50
|
/**
|
|
34
51
|
* Quality Assessment Coordinator
|
|
@@ -38,6 +55,10 @@ const DEFAULT_CONFIG = {
|
|
|
38
55
|
* - ActorCritic RL: Quality gate threshold tuning
|
|
39
56
|
* - QESONA: Quality pattern learning
|
|
40
57
|
* - QEFlashAttention: Similarity computations for quality reports
|
|
58
|
+
*
|
|
59
|
+
* V3 Integrations (ADR-047, CONSENSUS-MIXIN-001):
|
|
60
|
+
* - MinCutAwareDomainMixin: Topology-aware routing and health monitoring
|
|
61
|
+
* - ConsensusEnabledMixin: Multi-model consensus for high-stakes quality decisions
|
|
41
62
|
*/
|
|
42
63
|
export class QualityAssessmentCoordinator {
|
|
43
64
|
eventBus;
|
|
@@ -55,8 +76,14 @@ export class QualityAssessmentCoordinator {
|
|
|
55
76
|
flashAttention;
|
|
56
77
|
// V3 Integration: ClaimVerifier for report verification
|
|
57
78
|
claimVerifier;
|
|
79
|
+
// V3 Integration: MinCut Awareness (ADR-047)
|
|
80
|
+
minCutMixin;
|
|
81
|
+
// V3 Integration: Consensus Verification (CONSENSUS-MIXIN-001)
|
|
82
|
+
consensusMixin;
|
|
58
83
|
// Quality domain name for SONA
|
|
59
84
|
domain = 'quality-assessment';
|
|
85
|
+
// Cache of recent dream insights for quality assessment enhancement
|
|
86
|
+
recentDreamInsights = [];
|
|
60
87
|
constructor(eventBus, memory, agentCoordinator, config = {}) {
|
|
61
88
|
this.eventBus = eventBus;
|
|
62
89
|
this.memory = memory;
|
|
@@ -65,10 +92,36 @@ export class QualityAssessmentCoordinator {
|
|
|
65
92
|
this.qualityGate = new QualityGateService(memory);
|
|
66
93
|
this.qualityAnalyzer = new QualityAnalyzerService(memory);
|
|
67
94
|
this.deploymentAdvisor = new DeploymentAdvisorService(memory);
|
|
95
|
+
// V3 Integration: Initialize MinCut Awareness Mixin (ADR-047)
|
|
96
|
+
this.minCutMixin = createMinCutAwareMixin(this.domain, {
|
|
97
|
+
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
98
|
+
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
99
|
+
pauseOnCriticalTopology: false, // Quality assessment continues even in degraded topology
|
|
100
|
+
monitoredDomains: [], // Monitor all domains
|
|
101
|
+
});
|
|
102
|
+
// V3 Integration: Initialize Consensus Mixin (CONSENSUS-MIXIN-001)
|
|
103
|
+
// Configured for quality-assessment specific finding types
|
|
104
|
+
this.consensusMixin = createConsensusEnabledMixin({
|
|
105
|
+
enableConsensus: this.config.enableConsensus,
|
|
106
|
+
consensusThreshold: this.config.consensusThreshold,
|
|
107
|
+
minModels: this.config.consensusMinModels,
|
|
108
|
+
// Quality-specific finding types that require consensus
|
|
109
|
+
verifyFindingTypes: [
|
|
110
|
+
'gate-verdict', // Pass/fail quality gate decisions
|
|
111
|
+
'tech-debt-classification', // Critical vs acceptable tech debt
|
|
112
|
+
'release-readiness', // Go/no-go deployment decisions
|
|
113
|
+
'risk-scoring', // High-risk deployment detection
|
|
114
|
+
],
|
|
115
|
+
strategy: 'weighted',
|
|
116
|
+
modelTimeout: 60000,
|
|
117
|
+
verifySeverities: ['critical', 'high'],
|
|
118
|
+
enableLogging: false,
|
|
119
|
+
});
|
|
68
120
|
}
|
|
69
121
|
/**
|
|
70
122
|
* Initialize the coordinator
|
|
71
123
|
* Sets up Ruvector integrations: ActorCritic, QESONA, QEFlashAttention
|
|
124
|
+
* V3: Also initializes MinCut awareness and Consensus verification
|
|
72
125
|
*/
|
|
73
126
|
async initialize() {
|
|
74
127
|
if (this.initialized)
|
|
@@ -94,6 +147,10 @@ export class QualityAssessmentCoordinator {
|
|
|
94
147
|
if (this.config.enableClaimVerification) {
|
|
95
148
|
await this.initializeClaimVerifier();
|
|
96
149
|
}
|
|
150
|
+
// V3 Integration: Initialize Consensus Engine (CONSENSUS-MIXIN-001)
|
|
151
|
+
if (this.config.enableConsensus) {
|
|
152
|
+
await this.initializeConsensus();
|
|
153
|
+
}
|
|
97
154
|
this.initialized = true;
|
|
98
155
|
}
|
|
99
156
|
catch (error) {
|
|
@@ -101,8 +158,25 @@ export class QualityAssessmentCoordinator {
|
|
|
101
158
|
throw new Error(errorMsg);
|
|
102
159
|
}
|
|
103
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* V3 Integration: Initialize the consensus engine for multi-model verification
|
|
163
|
+
* @private
|
|
164
|
+
*/
|
|
165
|
+
async initializeConsensus() {
|
|
166
|
+
try {
|
|
167
|
+
// The mixin handles provider registration and engine creation
|
|
168
|
+
await this.consensusMixin.initializeConsensus();
|
|
169
|
+
console.log('[quality-assessment] Consensus engine initialized for quality gate decisions');
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
// Log and continue - consensus is enhancement, not critical
|
|
173
|
+
console.warn('[quality-assessment] Failed to initialize consensus engine:', error);
|
|
174
|
+
console.warn('[quality-assessment] Continuing without multi-model consensus verification');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
104
177
|
/**
|
|
105
178
|
* Dispose and cleanup
|
|
179
|
+
* V3: Also disposes MinCut mixin and Consensus engine
|
|
106
180
|
*/
|
|
107
181
|
async dispose() {
|
|
108
182
|
await this.saveWorkflowState();
|
|
@@ -113,6 +187,10 @@ export class QualityAssessmentCoordinator {
|
|
|
113
187
|
await this.qesona.close();
|
|
114
188
|
this.qesona = undefined;
|
|
115
189
|
}
|
|
190
|
+
// V3 Integration: Dispose MinCut mixin (ADR-047)
|
|
191
|
+
this.minCutMixin.dispose();
|
|
192
|
+
// V3 Integration: Dispose Consensus engine (CONSENSUS-MIXIN-001)
|
|
193
|
+
await this.consensusMixin.disposeConsensus();
|
|
116
194
|
this.workflows.clear();
|
|
117
195
|
this.initialized = false;
|
|
118
196
|
}
|
|
@@ -123,16 +201,90 @@ export class QualityAssessmentCoordinator {
|
|
|
123
201
|
return Array.from(this.workflows.values()).filter((w) => w.status === 'running' || w.status === 'pending');
|
|
124
202
|
}
|
|
125
203
|
// ============================================================================
|
|
204
|
+
// V3 Integration: MinCut Awareness (ADR-047)
|
|
205
|
+
// ============================================================================
|
|
206
|
+
/**
|
|
207
|
+
* Set the MinCut bridge for topology awareness
|
|
208
|
+
* Uses dependency injection pattern for testability
|
|
209
|
+
*
|
|
210
|
+
* @param bridge - The QueenMinCutBridge instance
|
|
211
|
+
*/
|
|
212
|
+
setMinCutBridge(bridge) {
|
|
213
|
+
this.minCutMixin.setMinCutBridge(bridge);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Check if the overall topology is healthy
|
|
217
|
+
* Returns true if status is not 'critical'
|
|
218
|
+
*/
|
|
219
|
+
isTopologyHealthy() {
|
|
220
|
+
return this.minCutMixin.isTopologyHealthy();
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Get domains that are healthy for routing
|
|
224
|
+
* Filters out weak domains from routing candidates
|
|
225
|
+
*/
|
|
226
|
+
getHealthyRoutingDomains() {
|
|
227
|
+
return this.minCutMixin.getHealthyRoutingDomains();
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Check if this domain itself is a weak point in the topology
|
|
231
|
+
*/
|
|
232
|
+
isDomainWeakPoint() {
|
|
233
|
+
return this.minCutMixin.isDomainWeakPoint();
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get weak vertices belonging to this domain
|
|
237
|
+
* Per ADR-047: Identifies agents that are single points of failure
|
|
238
|
+
*/
|
|
239
|
+
getDomainWeakVertices() {
|
|
240
|
+
return this.minCutMixin.getDomainWeakVertices();
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get topology-aware routing for cross-domain coordination
|
|
244
|
+
* Per ADR-047: Routes to healthy domains, avoiding weak points
|
|
245
|
+
*/
|
|
246
|
+
getTopologyBasedRouting(targetDomains) {
|
|
247
|
+
return this.minCutMixin.getTopologyBasedRouting(targetDomains);
|
|
248
|
+
}
|
|
249
|
+
// ============================================================================
|
|
250
|
+
// V3 Integration: Consensus Verification (CONSENSUS-MIXIN-001)
|
|
251
|
+
// ============================================================================
|
|
252
|
+
/**
|
|
253
|
+
* Get consensus statistics
|
|
254
|
+
*/
|
|
255
|
+
getConsensusStats() {
|
|
256
|
+
return this.consensusMixin.getConsensusStats();
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Check if consensus verification is available
|
|
260
|
+
*/
|
|
261
|
+
isConsensusAvailable() {
|
|
262
|
+
return this.consensusMixin.isConsensusAvailable();
|
|
263
|
+
}
|
|
264
|
+
// ============================================================================
|
|
126
265
|
// QualityAssessmentAPI Implementation
|
|
127
266
|
// ============================================================================
|
|
128
267
|
/**
|
|
129
268
|
* Evaluate a quality gate
|
|
130
269
|
* Uses Actor-Critic RL for intelligent threshold tuning when enabled
|
|
270
|
+
* V3: Uses consensus verification for borderline gate decisions
|
|
131
271
|
*/
|
|
132
272
|
async evaluateGate(request) {
|
|
133
273
|
const workflowId = uuidv4();
|
|
134
274
|
try {
|
|
135
275
|
this.startWorkflow(workflowId, 'gate-evaluation');
|
|
276
|
+
// Self-healing: Check if operations should be paused due to critical topology
|
|
277
|
+
if (this.minCutMixin.shouldPauseOperations()) {
|
|
278
|
+
console.warn('[quality-assessment] Quality gate evaluation paused: topology is in critical state');
|
|
279
|
+
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
280
|
+
return err(new Error('Quality gate evaluation paused: topology is in critical state'));
|
|
281
|
+
}
|
|
282
|
+
// V3 Integration: Check topology health before proceeding (ADR-047)
|
|
283
|
+
// Apply stricter thresholds when topology is degraded
|
|
284
|
+
if (!this.isTopologyHealthy()) {
|
|
285
|
+
console.warn('[quality-assessment] Topology degraded - applying stricter thresholds for quality gate');
|
|
286
|
+
// Continue evaluation but with heightened caution - quality gates are critical
|
|
287
|
+
}
|
|
136
288
|
// Spawn quality gate agent if available
|
|
137
289
|
const agentResult = await this.spawnQualityGateAgent(workflowId, request);
|
|
138
290
|
if (agentResult.success) {
|
|
@@ -159,22 +311,31 @@ export class QualityAssessmentCoordinator {
|
|
|
159
311
|
this.failWorkflow(workflowId, 'Evaluation failed');
|
|
160
312
|
return result;
|
|
161
313
|
}
|
|
314
|
+
// V3 Integration: Use consensus for borderline cases (CONSENSUS-MIXIN-001)
|
|
315
|
+
// Borderline cases are pass/fail decisions where metrics are close to thresholds
|
|
316
|
+
let finalResult = result.value;
|
|
317
|
+
if (this.config.enableConsensus && this.isBorderlineGateResult(request.metrics, request.thresholds, result.value)) {
|
|
318
|
+
const consensusResult = await this.verifyGateVerdictWithConsensus(effectiveRequest, result.value);
|
|
319
|
+
if (consensusResult) {
|
|
320
|
+
finalResult = consensusResult;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
162
323
|
// Success path
|
|
163
324
|
this.completeWorkflow(workflowId);
|
|
164
325
|
// Store quality pattern in SONA if enabled
|
|
165
326
|
if (this.config.enableSONAPatternLearning && this.qesona) {
|
|
166
|
-
await this.storeQualityPattern(effectiveRequest,
|
|
327
|
+
await this.storeQualityPattern(effectiveRequest, finalResult);
|
|
167
328
|
}
|
|
168
329
|
// Train Actor-Critic with the result
|
|
169
330
|
if (this.config.enableRLThresholdTuning && this.actorCritic) {
|
|
170
|
-
await this.trainActorCritic(effectiveRequest,
|
|
331
|
+
await this.trainActorCritic(effectiveRequest, finalResult);
|
|
171
332
|
}
|
|
172
333
|
// Publish event
|
|
173
334
|
if (this.config.publishEvents) {
|
|
174
|
-
await this.publishQualityGateEvaluated(
|
|
335
|
+
await this.publishQualityGateEvaluated(finalResult);
|
|
175
336
|
}
|
|
176
337
|
// V3: Verify claims before returning (Phase 4)
|
|
177
|
-
const verifiedResult = await this.verifyGateResultClaims(
|
|
338
|
+
const verifiedResult = await this.verifyGateResultClaims(finalResult);
|
|
178
339
|
return ok(verifiedResult);
|
|
179
340
|
}
|
|
180
341
|
catch (error) {
|
|
@@ -182,14 +343,118 @@ export class QualityAssessmentCoordinator {
|
|
|
182
343
|
return err(error instanceof Error ? error : new Error(String(error)));
|
|
183
344
|
}
|
|
184
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* V3 Integration: Check if a gate result is a borderline case
|
|
348
|
+
* A borderline case is when any metric is within the configured margin of its threshold
|
|
349
|
+
*
|
|
350
|
+
* @param metrics - The quality metrics being evaluated
|
|
351
|
+
* @param thresholds - The threshold configuration
|
|
352
|
+
* @param result - The gate result
|
|
353
|
+
* @returns true if this is a borderline case requiring consensus
|
|
354
|
+
*/
|
|
355
|
+
isBorderlineGateResult(metrics, thresholds, result) {
|
|
356
|
+
const margin = this.config.borderlineMargin;
|
|
357
|
+
// Check each metric against its threshold
|
|
358
|
+
const metricsToCheck = [
|
|
359
|
+
{ metricKey: 'coverage', thresholdKey: 'coverage', isMin: true },
|
|
360
|
+
{ metricKey: 'testsPassing', thresholdKey: 'testsPassing', isMin: true },
|
|
361
|
+
{ metricKey: 'criticalBugs', thresholdKey: 'criticalBugs', isMin: false },
|
|
362
|
+
{ metricKey: 'codeSmells', thresholdKey: 'codeSmells', isMin: false },
|
|
363
|
+
{ metricKey: 'securityVulnerabilities', thresholdKey: 'securityVulnerabilities', isMin: false },
|
|
364
|
+
{ metricKey: 'technicalDebt', thresholdKey: 'technicalDebt', isMin: false },
|
|
365
|
+
{ metricKey: 'duplications', thresholdKey: 'duplications', isMin: false },
|
|
366
|
+
];
|
|
367
|
+
for (const { metricKey, thresholdKey, isMin } of metricsToCheck) {
|
|
368
|
+
const metricValue = metrics[metricKey];
|
|
369
|
+
const thresholdConfig = thresholds[thresholdKey];
|
|
370
|
+
if (thresholdConfig === undefined)
|
|
371
|
+
continue;
|
|
372
|
+
const threshold = isMin
|
|
373
|
+
? thresholdConfig.min
|
|
374
|
+
: thresholdConfig.max;
|
|
375
|
+
if (threshold === undefined || threshold === 0)
|
|
376
|
+
continue;
|
|
377
|
+
// Calculate relative distance from threshold
|
|
378
|
+
const relativeDistance = Math.abs(metricValue - threshold) / threshold;
|
|
379
|
+
// If any metric is within margin of threshold, it's borderline
|
|
380
|
+
if (relativeDistance < margin) {
|
|
381
|
+
console.log(`[quality-assessment] Borderline detected: ${metricKey}=${metricValue} (threshold=${threshold}, distance=${(relativeDistance * 100).toFixed(1)}%)`);
|
|
382
|
+
return true;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* V3 Integration: Verify a gate verdict with multi-model consensus
|
|
389
|
+
*
|
|
390
|
+
* @param request - The gate evaluation request
|
|
391
|
+
* @param initialResult - The initial gate result
|
|
392
|
+
* @returns The potentially modified result with consensus verification, or null if consensus unavailable
|
|
393
|
+
*/
|
|
394
|
+
async verifyGateVerdictWithConsensus(request, initialResult) {
|
|
395
|
+
// Create a domain finding for the gate verdict
|
|
396
|
+
const finding = createDomainFinding({
|
|
397
|
+
id: `gate-verdict-${uuidv4()}`,
|
|
398
|
+
type: 'gate-verdict',
|
|
399
|
+
confidence: initialResult.overallScore / 100,
|
|
400
|
+
description: `Quality gate '${request.gateName}' verdict: ${initialResult.passed ? 'PASSED' : 'FAILED'} (borderline case)`,
|
|
401
|
+
payload: {
|
|
402
|
+
metrics: request.metrics,
|
|
403
|
+
thresholds: request.thresholds,
|
|
404
|
+
initialResult,
|
|
405
|
+
},
|
|
406
|
+
detectedBy: 'quality-assessment-coordinator',
|
|
407
|
+
severity: initialResult.passed ? 'medium' : 'high',
|
|
408
|
+
});
|
|
409
|
+
// Check if this finding requires consensus
|
|
410
|
+
if (!this.consensusMixin.requiresConsensus(finding)) {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
413
|
+
try {
|
|
414
|
+
const consensusResult = await this.consensusMixin.verifyFinding(finding);
|
|
415
|
+
if (!consensusResult.success) {
|
|
416
|
+
console.warn('[quality-assessment] Consensus verification failed:', consensusResult.error);
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
const consensus = consensusResult.value;
|
|
420
|
+
console.log(`[quality-assessment] Consensus for gate '${request.gateName}': ` +
|
|
421
|
+
`verdict=${consensus.verdict}, confidence=${(consensus.confidence * 100).toFixed(1)}%`);
|
|
422
|
+
// Return result with consensus information
|
|
423
|
+
return {
|
|
424
|
+
...initialResult,
|
|
425
|
+
// Add consensus metadata (extends GateResult)
|
|
426
|
+
consensusVerified: true,
|
|
427
|
+
consensusConfidence: consensus.confidence,
|
|
428
|
+
consensusVerdict: consensus.verdict,
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
catch (error) {
|
|
432
|
+
console.error('[quality-assessment] Consensus verification error:', error);
|
|
433
|
+
return null;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
185
436
|
/**
|
|
186
437
|
* Analyze code quality
|
|
187
438
|
* Uses QEFlashAttention for similarity-based recommendations when enabled
|
|
439
|
+
* V3: Includes topology-aware behavior based on MinCut health
|
|
188
440
|
*/
|
|
189
441
|
async analyzeQuality(request) {
|
|
190
442
|
const workflowId = uuidv4();
|
|
191
443
|
try {
|
|
192
444
|
this.startWorkflow(workflowId, 'quality-analysis');
|
|
445
|
+
// Self-healing: Check if operations should be paused due to critical topology
|
|
446
|
+
if (this.minCutMixin.shouldPauseOperations()) {
|
|
447
|
+
console.warn('[quality-assessment] Quality analysis paused: topology is in critical state');
|
|
448
|
+
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
449
|
+
return err(new Error('Quality analysis paused: topology is in critical state'));
|
|
450
|
+
}
|
|
451
|
+
// V3 Integration: Check topology health and adjust behavior (ADR-047)
|
|
452
|
+
const topologyHealthy = this.isTopologyHealthy();
|
|
453
|
+
if (!topologyHealthy) {
|
|
454
|
+
console.warn('[quality-assessment] Topology degraded during quality analysis');
|
|
455
|
+
// Could adjust analysis depth or timeouts in degraded state
|
|
456
|
+
// For now, we proceed but could be extended to reduce analysis scope
|
|
457
|
+
}
|
|
193
458
|
// Spawn quality analyzer agent
|
|
194
459
|
const agentResult = await this.spawnQualityAnalyzerAgent(workflowId, request);
|
|
195
460
|
if (agentResult.success) {
|
|
@@ -234,11 +499,22 @@ export class QualityAssessmentCoordinator {
|
|
|
234
499
|
}
|
|
235
500
|
/**
|
|
236
501
|
* Get deployment recommendation
|
|
502
|
+
* V3: Uses consensus verification for high-risk deployment decisions
|
|
237
503
|
*/
|
|
238
504
|
async getDeploymentAdvice(request) {
|
|
239
505
|
const workflowId = uuidv4();
|
|
240
506
|
try {
|
|
241
507
|
this.startWorkflow(workflowId, 'deployment-advice');
|
|
508
|
+
// Self-healing: Check if operations should be paused due to critical topology
|
|
509
|
+
if (this.minCutMixin.shouldPauseOperations()) {
|
|
510
|
+
console.warn('[quality-assessment] Deployment advice paused: topology is in critical state');
|
|
511
|
+
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
512
|
+
return err(new Error('Deployment advice paused: topology is in critical state'));
|
|
513
|
+
}
|
|
514
|
+
// V3 Integration: Check topology health (ADR-047)
|
|
515
|
+
if (!this.isTopologyHealthy()) {
|
|
516
|
+
console.warn('[quality-assessment] Topology degraded during deployment advice generation');
|
|
517
|
+
}
|
|
242
518
|
// Spawn deployment advisor agent
|
|
243
519
|
const agentResult = await this.spawnDeploymentAdvisorAgent(workflowId, request);
|
|
244
520
|
if (agentResult.success) {
|
|
@@ -254,19 +530,83 @@ export class QualityAssessmentCoordinator {
|
|
|
254
530
|
this.failWorkflow(workflowId, 'Evaluation failed');
|
|
255
531
|
return result;
|
|
256
532
|
}
|
|
533
|
+
// V3 Integration: Use consensus for high-risk deployment decisions (CONSENSUS-MIXIN-001)
|
|
534
|
+
let finalAdvice = result.value;
|
|
535
|
+
if (this.config.enableConsensus && this.isHighRiskDeployment(request, result.value)) {
|
|
536
|
+
const consensusAdvice = await this.verifyDeploymentAdviceWithConsensus(request, result.value);
|
|
537
|
+
if (consensusAdvice) {
|
|
538
|
+
finalAdvice = consensusAdvice;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
257
541
|
// Success path
|
|
258
542
|
this.completeWorkflow(workflowId);
|
|
259
543
|
// Publish deployment decision event
|
|
260
544
|
if (this.config.publishEvents) {
|
|
261
|
-
await this.publishDeploymentDecision(
|
|
545
|
+
await this.publishDeploymentDecision(finalAdvice, request.releaseCandidate);
|
|
262
546
|
}
|
|
263
|
-
return
|
|
547
|
+
return ok(finalAdvice);
|
|
264
548
|
}
|
|
265
549
|
catch (error) {
|
|
266
550
|
this.failWorkflow(workflowId, String(error));
|
|
267
551
|
return err(error instanceof Error ? error : new Error(String(error)));
|
|
268
552
|
}
|
|
269
553
|
}
|
|
554
|
+
/**
|
|
555
|
+
* V3 Integration: Check if a deployment is high-risk
|
|
556
|
+
* High-risk deployments include blocked deployments or low risk tolerance with warnings
|
|
557
|
+
*/
|
|
558
|
+
isHighRiskDeployment(request, advice) {
|
|
559
|
+
// Blocked deployments are always high-risk
|
|
560
|
+
if (advice.decision === 'blocked') {
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
// Warning with low risk tolerance is high-risk
|
|
564
|
+
if (advice.decision === 'warning' && request.riskTolerance === 'low') {
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
567
|
+
// High risk score (>0.7) with any decision is high-risk
|
|
568
|
+
if (advice.riskScore > 0.7) {
|
|
569
|
+
return true;
|
|
570
|
+
}
|
|
571
|
+
return false;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* V3 Integration: Verify deployment advice with multi-model consensus
|
|
575
|
+
*/
|
|
576
|
+
async verifyDeploymentAdviceWithConsensus(request, initialAdvice) {
|
|
577
|
+
const finding = createDomainFinding({
|
|
578
|
+
id: `release-readiness-${uuidv4()}`,
|
|
579
|
+
type: 'release-readiness',
|
|
580
|
+
confidence: initialAdvice.confidence,
|
|
581
|
+
description: `Release readiness for '${request.releaseCandidate}': ${initialAdvice.decision} (risk: ${(initialAdvice.riskScore * 100).toFixed(0)}%)`,
|
|
582
|
+
payload: { request, initialAdvice },
|
|
583
|
+
detectedBy: 'quality-assessment-coordinator',
|
|
584
|
+
severity: initialAdvice.decision === 'blocked' ? 'critical' : 'high',
|
|
585
|
+
});
|
|
586
|
+
if (!this.consensusMixin.requiresConsensus(finding)) {
|
|
587
|
+
return null;
|
|
588
|
+
}
|
|
589
|
+
try {
|
|
590
|
+
const consensusResult = await this.consensusMixin.verifyFinding(finding);
|
|
591
|
+
if (!consensusResult.success) {
|
|
592
|
+
console.warn('[quality-assessment] Consensus verification for deployment failed:', consensusResult.error);
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
const consensus = consensusResult.value;
|
|
596
|
+
console.log(`[quality-assessment] Consensus for deployment '${request.releaseCandidate}': ` +
|
|
597
|
+
`verdict=${consensus.verdict}, confidence=${(consensus.confidence * 100).toFixed(1)}%`);
|
|
598
|
+
return {
|
|
599
|
+
...initialAdvice,
|
|
600
|
+
consensusVerified: true,
|
|
601
|
+
consensusConfidence: consensus.confidence,
|
|
602
|
+
consensusVerdict: consensus.verdict,
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
catch (error) {
|
|
606
|
+
console.error('[quality-assessment] Consensus verification error:', error);
|
|
607
|
+
return null;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
270
610
|
/**
|
|
271
611
|
* Analyze code complexity
|
|
272
612
|
*/
|
|
@@ -274,6 +614,16 @@ export class QualityAssessmentCoordinator {
|
|
|
274
614
|
const workflowId = uuidv4();
|
|
275
615
|
try {
|
|
276
616
|
this.startWorkflow(workflowId, 'complexity-analysis');
|
|
617
|
+
// Self-healing: Check if operations should be paused due to critical topology
|
|
618
|
+
if (this.minCutMixin.shouldPauseOperations()) {
|
|
619
|
+
console.warn('[quality-assessment] Complexity analysis paused: topology is in critical state');
|
|
620
|
+
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
621
|
+
return err(new Error('Complexity analysis paused: topology is in critical state'));
|
|
622
|
+
}
|
|
623
|
+
// V3 Integration: Check topology health (ADR-047)
|
|
624
|
+
if (!this.isTopologyHealthy()) {
|
|
625
|
+
console.warn('[quality-assessment] Topology degraded during complexity analysis');
|
|
626
|
+
}
|
|
277
627
|
// Spawn complexity analyzer agent
|
|
278
628
|
const agentResult = await this.spawnComplexityAnalyzerAgent(workflowId, request);
|
|
279
629
|
if (agentResult.success) {
|
|
@@ -446,6 +796,142 @@ export class QualityAssessmentCoordinator {
|
|
|
446
796
|
this.eventBus.subscribe('coverage-analysis.CoverageReportCreated', this.handleCoverageReportCreated.bind(this));
|
|
447
797
|
// Subscribe to security events
|
|
448
798
|
this.eventBus.subscribe('security-compliance.SecurityAuditCompleted', this.handleSecurityAuditCompleted.bind(this));
|
|
799
|
+
// Subscribe to dream cycle events from learning-optimization domain
|
|
800
|
+
this.subscribeToDreamEvents();
|
|
801
|
+
}
|
|
802
|
+
// ============================================================================
|
|
803
|
+
// Dream Event Handling (ADR-021 Integration)
|
|
804
|
+
// ============================================================================
|
|
805
|
+
/**
|
|
806
|
+
* Subscribe to dream cycle completion events from learning-optimization domain.
|
|
807
|
+
* Dream insights can suggest quality improvements, threshold adjustments, and risk patterns.
|
|
808
|
+
*/
|
|
809
|
+
subscribeToDreamEvents() {
|
|
810
|
+
this.eventBus.subscribe(LearningOptimizationEvents.DreamCycleCompleted, this.handleDreamCycleCompleted.bind(this));
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Handle dream cycle completion event.
|
|
814
|
+
* Filters insights relevant to quality assessment and applies actionable ones.
|
|
815
|
+
*/
|
|
816
|
+
async handleDreamCycleCompleted(event) {
|
|
817
|
+
const { insights, cycleId } = event.payload;
|
|
818
|
+
if (!insights || insights.length === 0) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
// Filter insights relevant to this domain
|
|
822
|
+
const relevantInsights = insights.filter((insight) => {
|
|
823
|
+
// Check if suggested action mentions this domain
|
|
824
|
+
const actionRelevant = insight.suggestedAction?.toLowerCase().includes(this.domain) ||
|
|
825
|
+
insight.suggestedAction?.toLowerCase().includes('quality') ||
|
|
826
|
+
insight.suggestedAction?.toLowerCase().includes('gate') ||
|
|
827
|
+
insight.suggestedAction?.toLowerCase().includes('threshold');
|
|
828
|
+
// Check if source concepts include quality-related terms
|
|
829
|
+
const conceptsRelevant = insight.sourceConcepts.some((c) => c.toLowerCase().includes('quality') ||
|
|
830
|
+
c.toLowerCase().includes(this.domain) ||
|
|
831
|
+
c.toLowerCase().includes('metric') ||
|
|
832
|
+
c.toLowerCase().includes('gate'));
|
|
833
|
+
// Check for quality-assessment related insight types
|
|
834
|
+
const typeRelevant = insight.type === 'optimization' || insight.type === 'pattern_merge';
|
|
835
|
+
return actionRelevant || conceptsRelevant || (typeRelevant && insight.actionable);
|
|
836
|
+
});
|
|
837
|
+
if (relevantInsights.length === 0) {
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
console.log(`[${this.domain}] Received ${relevantInsights.length} relevant dream insights from cycle ${cycleId}`);
|
|
841
|
+
// Apply high-confidence actionable insights
|
|
842
|
+
for (const insight of relevantInsights) {
|
|
843
|
+
if (insight.confidenceScore > 0.7 && insight.actionable) {
|
|
844
|
+
await this.applyDreamInsight(insight, cycleId);
|
|
845
|
+
}
|
|
846
|
+
// Cache all relevant insights for quality enhancement
|
|
847
|
+
this.recentDreamInsights.push({
|
|
848
|
+
...insight,
|
|
849
|
+
receivedAt: new Date(),
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
// Prune old insights (keep last 50)
|
|
853
|
+
if (this.recentDreamInsights.length > 50) {
|
|
854
|
+
this.recentDreamInsights = this.recentDreamInsights.slice(-50);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Apply a dream insight by storing it as a learned pattern via SONA.
|
|
859
|
+
* This allows the insight to influence future quality assessment decisions.
|
|
860
|
+
*
|
|
861
|
+
* @param insight - The dream insight to apply
|
|
862
|
+
* @param cycleId - The dream cycle ID for tracking
|
|
863
|
+
*/
|
|
864
|
+
async applyDreamInsight(insight, cycleId) {
|
|
865
|
+
console.log(`[${this.domain}] Applying dream insight: ${insight.description.slice(0, 100)}...`);
|
|
866
|
+
// Store as a learned pattern via SONA if available
|
|
867
|
+
if (this.qesona) {
|
|
868
|
+
try {
|
|
869
|
+
// Create state representation from insight
|
|
870
|
+
const state = {
|
|
871
|
+
id: `dream-insight-${insight.id}`,
|
|
872
|
+
features: this.encodeInsightAsFeatures(insight),
|
|
873
|
+
metadata: {
|
|
874
|
+
insightType: insight.type,
|
|
875
|
+
cycleId,
|
|
876
|
+
sourceConcepts: insight.sourceConcepts,
|
|
877
|
+
},
|
|
878
|
+
};
|
|
879
|
+
// Create action representing the suggested action
|
|
880
|
+
const action = {
|
|
881
|
+
type: 'dream-insight',
|
|
882
|
+
value: insight.suggestedAction || insight.description,
|
|
883
|
+
};
|
|
884
|
+
// Create pattern in QESONA with dream-derived marker
|
|
885
|
+
this.qesona.createPattern(state, action, {
|
|
886
|
+
reward: insight.confidenceScore,
|
|
887
|
+
success: true,
|
|
888
|
+
quality: insight.noveltyScore,
|
|
889
|
+
}, 'quality-assessment', this.domain, {
|
|
890
|
+
insightId: insight.id,
|
|
891
|
+
cycleId,
|
|
892
|
+
description: insight.description,
|
|
893
|
+
suggestedAction: insight.suggestedAction,
|
|
894
|
+
dreamDerived: true,
|
|
895
|
+
});
|
|
896
|
+
console.log(`[${this.domain}] Created SONA pattern from dream insight ${insight.id}`);
|
|
897
|
+
}
|
|
898
|
+
catch (error) {
|
|
899
|
+
console.error(`[${this.domain}] Failed to store dream insight pattern:`, error);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
// Store insight in memory for downstream usage
|
|
903
|
+
await this.memory.set(`${this.domain}:dream-insight:${insight.id}`, {
|
|
904
|
+
insight,
|
|
905
|
+
cycleId,
|
|
906
|
+
appliedAt: new Date().toISOString(),
|
|
907
|
+
}, { namespace: this.domain, ttl: 86400 * 7 } // 7 days
|
|
908
|
+
);
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Encode a dream insight as feature vector for SONA pattern creation.
|
|
912
|
+
*/
|
|
913
|
+
encodeInsightAsFeatures(insight) {
|
|
914
|
+
const features = [];
|
|
915
|
+
// Encode insight type
|
|
916
|
+
const typeMap = {
|
|
917
|
+
pattern_merge: 0.2,
|
|
918
|
+
novel_association: 0.4,
|
|
919
|
+
optimization: 0.6,
|
|
920
|
+
gap_detection: 0.8,
|
|
921
|
+
};
|
|
922
|
+
features.push(typeMap[insight.type] || 0.5);
|
|
923
|
+
// Encode confidence and novelty
|
|
924
|
+
features.push(insight.confidenceScore);
|
|
925
|
+
features.push(insight.noveltyScore);
|
|
926
|
+
// Encode actionability
|
|
927
|
+
features.push(insight.actionable ? 1.0 : 0.0);
|
|
928
|
+
// Encode source concept count (normalized)
|
|
929
|
+
features.push(Math.min(1, insight.sourceConcepts.length / 10));
|
|
930
|
+
// Pad to consistent size
|
|
931
|
+
while (features.length < 384) {
|
|
932
|
+
features.push(0);
|
|
933
|
+
}
|
|
934
|
+
return features.slice(0, 384);
|
|
449
935
|
}
|
|
450
936
|
async handleTestRunCompleted(event) {
|
|
451
937
|
// Auto-evaluate quality gate after test run if enabled
|