agentic-qe 3.8.4 → 3.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/cli/bundle.js +694 -694
- package/dist/cli/commands/hooks-handlers/command-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/command-hooks.js +253 -0
- package/dist/cli/commands/hooks-handlers/editing-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/editing-hooks.js +161 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +57 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +263 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +52 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +223 -0
- package/dist/cli/commands/hooks-handlers/routing-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/routing-hooks.js +107 -0
- package/dist/cli/commands/hooks-handlers/session-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/session-hooks.js +171 -0
- package/dist/cli/commands/hooks-handlers/stats-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/stats-hooks.js +248 -0
- package/dist/cli/commands/hooks-handlers/task-hooks.d.ts +12 -0
- package/dist/cli/commands/hooks-handlers/task-hooks.js +152 -0
- package/dist/cli/commands/hooks.d.ts +3 -23
- package/dist/cli/commands/hooks.js +16 -1459
- package/dist/domains/base-domain-coordinator.d.ts +0 -15
- package/dist/domains/base-domain-coordinator.js +7 -5
- package/dist/domains/chaos-resilience/coordinator.d.ts +0 -4
- package/dist/domains/chaos-resilience/coordinator.js +24 -22
- package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +0 -4
- package/dist/domains/chaos-resilience/services/chaos-engineer.js +47 -45
- package/dist/domains/chaos-resilience/services/performance-profiler.d.ts +0 -4
- package/dist/domains/chaos-resilience/services/performance-profiler.js +10 -8
- package/dist/domains/code-intelligence/coordinator-consensus.d.ts +0 -3
- package/dist/domains/code-intelligence/coordinator-consensus.js +8 -6
- package/dist/domains/code-intelligence/coordinator-gnn.d.ts +0 -3
- package/dist/domains/code-intelligence/coordinator-gnn.js +8 -6
- package/dist/domains/code-intelligence/coordinator-hypergraph.d.ts +0 -3
- package/dist/domains/code-intelligence/coordinator-hypergraph.js +13 -11
- package/dist/domains/code-intelligence/coordinator.d.ts +0 -3
- package/dist/domains/code-intelligence/coordinator.js +21 -19
- package/dist/domains/code-intelligence/services/c4-model/index.d.ts +0 -3
- package/dist/domains/code-intelligence/services/c4-model/index.js +5 -3
- package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +0 -6
- package/dist/domains/code-intelligence/services/knowledge-graph.js +4 -2
- package/dist/domains/code-intelligence/services/product-factors-bridge.d.ts +0 -5
- package/dist/domains/code-intelligence/services/product-factors-bridge.js +9 -7
- package/dist/domains/contract-testing/coordinator.d.ts +0 -6
- package/dist/domains/contract-testing/coordinator.js +25 -23
- package/dist/domains/contract-testing/services/contract-validator.d.ts +0 -4
- package/dist/domains/contract-testing/services/contract-validator.js +4 -2
- package/dist/domains/contract-testing/services/schema-validator.js +1 -1
- package/dist/domains/coverage-analysis/coordinator.js +13 -11
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +4 -2
- package/dist/domains/coverage-analysis/services/gap-detector.js +3 -1
- package/dist/domains/coverage-analysis/services/hnsw-index.d.ts +0 -15
- package/dist/domains/coverage-analysis/services/hnsw-index.js +3 -1
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts +0 -26
- package/dist/domains/coverage-analysis/services/sublinear-analyzer.js +3 -1
- package/dist/domains/defect-intelligence/coordinator.d.ts +1 -10
- package/dist/domains/defect-intelligence/coordinator.js +5 -3
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts +0 -6
- package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +3 -1
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +0 -6
- package/dist/domains/defect-intelligence/services/defect-predictor.js +5 -3
- package/dist/domains/defect-intelligence/services/pattern-learner.d.ts +0 -4
- package/dist/domains/defect-intelligence/services/pattern-learner.js +3 -1
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts +0 -6
- package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +3 -1
- package/dist/domains/enterprise-integration/coordinator.js +6 -4
- package/dist/domains/learning-optimization/coordinator-consensus.d.ts +0 -3
- package/dist/domains/learning-optimization/coordinator-consensus.js +8 -6
- package/dist/domains/learning-optimization/coordinator.d.ts +0 -3
- package/dist/domains/learning-optimization/coordinator.js +15 -13
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +0 -4
- package/dist/domains/learning-optimization/services/learning-coordinator.js +4 -2
- package/dist/domains/quality-assessment/coordinator-claim-verifier.d.ts +0 -3
- package/dist/domains/quality-assessment/coordinator-claim-verifier.js +6 -4
- package/dist/domains/quality-assessment/coordinator-gate-evaluation.d.ts +0 -4
- package/dist/domains/quality-assessment/coordinator-gate-evaluation.js +9 -7
- package/dist/domains/quality-assessment/coordinator-rl-integration.d.ts +0 -3
- package/dist/domains/quality-assessment/coordinator-rl-integration.js +10 -8
- package/dist/domains/quality-assessment/coordinator.d.ts +0 -15
- package/dist/domains/quality-assessment/coordinator.js +14 -12
- package/dist/domains/quality-assessment/services/deployment-advisor.d.ts +0 -10
- package/dist/domains/quality-assessment/services/deployment-advisor.js +4 -2
- package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +0 -6
- package/dist/domains/quality-assessment/services/quality-analyzer.js +4 -2
- package/dist/domains/requirements-validation/coordinator.d.ts +0 -3
- package/dist/domains/requirements-validation/coordinator.js +15 -13
- package/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.d.ts +0 -5
- package/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.js +15 -13
- package/dist/domains/requirements-validation/services/product-factors-assessment/product-factors-service.d.ts +0 -6
- package/dist/domains/requirements-validation/services/product-factors-assessment/product-factors-service.js +9 -7
- package/dist/domains/requirements-validation/services/requirements-validator.d.ts +0 -6
- package/dist/domains/requirements-validation/services/requirements-validator.js +4 -2
- package/dist/domains/security-compliance/coordinator.js +24 -22
- package/dist/domains/security-compliance/services/scanners/dast-scanner.d.ts +0 -21
- package/dist/domains/security-compliance/services/scanners/dast-scanner.js +4 -2
- package/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts +0 -4
- package/dist/domains/security-compliance/services/scanners/sast-scanner.js +3 -1
- package/dist/domains/security-compliance/services/security-auditor-dast.d.ts +0 -4
- package/dist/domains/security-compliance/services/security-auditor-dast.js +3 -1
- package/dist/domains/security-compliance/services/security-auditor-sast.d.ts +0 -3
- package/dist/domains/security-compliance/services/security-auditor-sast.js +3 -1
- package/dist/domains/security-compliance/services/security-auditor-secrets.d.ts +0 -3
- package/dist/domains/security-compliance/services/security-auditor-secrets.js +3 -1
- package/dist/domains/security-compliance/services/security-auditor.js +11 -9
- package/dist/domains/test-execution/coordinator.js +11 -9
- package/dist/domains/test-execution/services/auth-state-manager.d.ts +0 -3
- package/dist/domains/test-execution/services/auth-state-manager.js +4 -2
- package/dist/domains/test-execution/services/e2e/e2e-coordinator.d.ts +0 -14
- package/dist/domains/test-execution/services/e2e/e2e-coordinator.js +3 -1
- package/dist/domains/test-execution/services/flaky-detector.js +4 -2
- package/dist/domains/test-execution/services/retry-handler.js +3 -1
- package/dist/domains/test-execution/services/test-executor.js +3 -1
- package/dist/domains/test-generation/coordinator.d.ts +0 -17
- package/dist/domains/test-generation/coordinator.js +33 -31
- package/dist/domains/test-generation/pattern-injection/edge-case-injector.d.ts +0 -5
- package/dist/domains/test-generation/pattern-injection/edge-case-injector.js +3 -1
- package/dist/domains/test-generation/services/code-transform-integration.d.ts +0 -7
- package/dist/domains/test-generation/services/code-transform-integration.js +3 -1
- package/dist/domains/test-generation/services/coherence-gate-service.d.ts +0 -3
- package/dist/domains/test-generation/services/coherence-gate-service.js +3 -1
- package/dist/domains/test-generation/services/test-generator.d.ts +0 -8
- package/dist/domains/test-generation/services/test-generator.js +5 -3
- package/dist/domains/visual-accessibility/coordinator.d.ts +0 -3
- package/dist/domains/visual-accessibility/coordinator.js +14 -12
- package/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +0 -3
- package/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +52 -50
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +0 -4
- package/dist/domains/visual-accessibility/services/accessibility-tester.js +8 -6
- package/dist/domains/visual-accessibility/services/axe-core-integration.d.ts +0 -3
- package/dist/domains/visual-accessibility/services/axe-core-integration.js +20 -18
- package/dist/domains/visual-accessibility/services/browser-security-scanner.d.ts +0 -4
- package/dist/domains/visual-accessibility/services/browser-security-scanner.js +6 -4
- package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts +0 -30
- package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +5 -3
- package/dist/domains/visual-accessibility/services/viewport-capture.d.ts +0 -27
- package/dist/domains/visual-accessibility/services/viewport-capture.js +6 -4
- package/dist/domains/visual-accessibility/services/visual-regression.d.ts +0 -26
- package/dist/domains/visual-accessibility/services/visual-regression.js +4 -2
- package/dist/domains/visual-accessibility/services/visual-tester.d.ts +0 -4
- package/dist/domains/visual-accessibility/services/visual-tester.js +4 -2
- package/dist/governance/deterministic-gateway-integration.js +1 -1
- package/dist/mcp/bundle.js +335 -335
- package/dist/mcp/security/validators/command-validator.d.ts +1 -40
- package/dist/mcp/security/validators/command-validator.js +2 -122
- package/dist/mcp/security/validators/crypto-validator.d.ts +1 -39
- package/dist/mcp/security/validators/crypto-validator.js +2 -71
- package/dist/mcp/security/validators/input-sanitizer.d.ts +1 -55
- package/dist/mcp/security/validators/input-sanitizer.js +2 -156
- package/dist/mcp/security/validators/interfaces.d.ts +1 -163
- package/dist/mcp/security/validators/interfaces.js +2 -5
- package/dist/mcp/security/validators/path-traversal-validator.d.ts +1 -49
- package/dist/mcp/security/validators/path-traversal-validator.js +2 -241
- package/dist/mcp/security/validators/regex-safety-validator.d.ts +1 -49
- package/dist/mcp/security/validators/regex-safety-validator.js +2 -182
- package/dist/mcp/security/validators/validation-orchestrator.d.ts +1 -65
- package/dist/mcp/security/validators/validation-orchestrator.js +2 -145
- package/dist/shared/io/file-reader.js +1 -1
- package/dist/shared/security/command-validator.d.ts +44 -0
- package/dist/shared/security/command-validator.js +126 -0
- package/dist/shared/security/crypto-validator.d.ts +43 -0
- package/dist/shared/security/crypto-validator.js +75 -0
- package/dist/shared/security/index.d.ts +7 -0
- package/dist/shared/security/index.js +15 -0
- package/dist/shared/security/input-sanitizer.d.ts +59 -0
- package/dist/shared/security/input-sanitizer.js +160 -0
- package/dist/shared/security/path-traversal-validator.d.ts +53 -0
- package/dist/shared/security/path-traversal-validator.js +245 -0
- package/dist/shared/security/regex-safety-validator.d.ts +53 -0
- package/dist/shared/security/regex-safety-validator.js +186 -0
- package/dist/shared/security/validation-orchestrator.d.ts +69 -0
- package/dist/shared/security/validation-orchestrator.js +149 -0
- package/dist/shared/security/validators-interfaces.d.ts +167 -0
- package/dist/shared/security/validators-interfaces.js +9 -0
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Contains: Actor-Critic RL, SONA pattern learning, Flash Attention initialization and methods
|
|
6
6
|
*/
|
|
7
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
7
8
|
import { toErrorMessage } from '../../shared/error-utils.js';
|
|
8
9
|
import { ActorCriticAlgorithm } from '../../integrations/rl-suite/algorithms/actor-critic';
|
|
9
10
|
import { createPersistentSONAEngine } from '../../integrations/ruvector/sona-persistence.js';
|
|
@@ -11,6 +12,7 @@ import { createQEFlashAttention, } from '../../integrations/ruvector/wrappers';
|
|
|
11
12
|
/**
|
|
12
13
|
* Initialize Actor-Critic RL for quality gate threshold tuning
|
|
13
14
|
*/
|
|
15
|
+
const logger = LoggerFactory.create('quality-assessment/rl-integration');
|
|
14
16
|
export async function initializeActorCritic() {
|
|
15
17
|
try {
|
|
16
18
|
const actorCritic = new ActorCriticAlgorithm({
|
|
@@ -44,12 +46,12 @@ export async function initializeQESONA() {
|
|
|
44
46
|
minConfidence: 0.5,
|
|
45
47
|
maxPatterns: 5000,
|
|
46
48
|
});
|
|
47
|
-
|
|
49
|
+
logger.info('PersistentSONAEngine initialized successfully');
|
|
48
50
|
return qesona;
|
|
49
51
|
}
|
|
50
52
|
catch (error) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
logger.error('Failed to initialize PersistentSONAEngine:', error instanceof Error ? error : undefined);
|
|
54
|
+
logger.warn('Continuing without SONA pattern persistence');
|
|
53
55
|
return undefined;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -103,7 +105,7 @@ export async function tuneThresholdsWithRL(actorCritic, metrics) {
|
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
catch (error) {
|
|
106
|
-
|
|
108
|
+
logger.error('RL threshold tuning failed:', error instanceof Error ? error : undefined);
|
|
107
109
|
return null;
|
|
108
110
|
}
|
|
109
111
|
}
|
|
@@ -168,7 +170,7 @@ export async function trainActorCritic(actorCritic, request, result) {
|
|
|
168
170
|
await actorCritic.train(experience);
|
|
169
171
|
}
|
|
170
172
|
catch (error) {
|
|
171
|
-
|
|
173
|
+
logger.error('Actor-Critic training failed:', error instanceof Error ? error : undefined);
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
/**
|
|
@@ -203,7 +205,7 @@ export async function storeQualityPattern(qesona, request, result, domainName) {
|
|
|
203
205
|
});
|
|
204
206
|
}
|
|
205
207
|
catch (error) {
|
|
206
|
-
|
|
208
|
+
logger.error('Failed to store quality pattern in SONA:', error instanceof Error ? error : undefined);
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
211
|
/**
|
|
@@ -236,7 +238,7 @@ export async function storeQualityAnalysisPattern(qesona, request, report, domai
|
|
|
236
238
|
});
|
|
237
239
|
}
|
|
238
240
|
catch (error) {
|
|
239
|
-
|
|
241
|
+
logger.error('Failed to store quality analysis pattern in SONA:', error instanceof Error ? error : undefined);
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
244
|
/**
|
|
@@ -276,7 +278,7 @@ export async function enhanceWithSimilarityPatterns(report, flashAttention, qeso
|
|
|
276
278
|
};
|
|
277
279
|
}
|
|
278
280
|
catch (error) {
|
|
279
|
-
|
|
281
|
+
logger.error('Failed to enhance with similarity patterns:', error instanceof Error ? error : undefined);
|
|
280
282
|
return null;
|
|
281
283
|
}
|
|
282
284
|
}
|
|
@@ -63,21 +63,6 @@ export interface CoordinatorConfig extends BaseDomainCoordinatorConfig {
|
|
|
63
63
|
borderlineMargin: number;
|
|
64
64
|
}
|
|
65
65
|
type QualityWorkflowType = 'gate-evaluation' | 'quality-analysis' | 'deployment-advice' | 'complexity-analysis';
|
|
66
|
-
/**
|
|
67
|
-
* Quality Assessment Coordinator
|
|
68
|
-
* Orchestrates quality assessment workflows and coordinates with agents
|
|
69
|
-
*
|
|
70
|
-
* Integrations (per ADR-040):
|
|
71
|
-
* - ActorCritic RL: Quality gate threshold tuning
|
|
72
|
-
* - QESONA: Quality pattern learning
|
|
73
|
-
* - QEFlashAttention: Similarity computations for quality reports
|
|
74
|
-
*
|
|
75
|
-
* V3 Integrations (ADR-047, CONSENSUS-MIXIN-001):
|
|
76
|
-
* - MinCutAwareDomainMixin: Topology-aware routing and health monitoring
|
|
77
|
-
* - ConsensusEnabledMixin: Multi-model consensus for high-stakes quality decisions
|
|
78
|
-
*
|
|
79
|
-
* CQ-002: Extends BaseDomainCoordinator
|
|
80
|
-
*/
|
|
81
66
|
export declare class QualityAssessmentCoordinator extends BaseDomainCoordinator<CoordinatorConfig, QualityWorkflowType> implements IQualityAssessmentCoordinator {
|
|
82
67
|
private readonly memory;
|
|
83
68
|
private readonly agentCoordinator;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* CQ-002: Extends BaseDomainCoordinator for lifecycle deduplication
|
|
15
15
|
*/
|
|
16
|
+
import { LoggerFactory } from '../../logging/index.js';
|
|
16
17
|
import { v4 as uuidv4 } from 'uuid';
|
|
17
18
|
import { ok, err } from '../../shared/types';
|
|
18
19
|
import { toError, toErrorMessage } from '../../shared/error-utils.js';
|
|
@@ -65,6 +66,7 @@ const DEFAULT_CONFIG = {
|
|
|
65
66
|
*
|
|
66
67
|
* CQ-002: Extends BaseDomainCoordinator
|
|
67
68
|
*/
|
|
69
|
+
const logger = LoggerFactory.create('quality-assessment');
|
|
68
70
|
export class QualityAssessmentCoordinator extends BaseDomainCoordinator {
|
|
69
71
|
memory;
|
|
70
72
|
agentCoordinator;
|
|
@@ -178,14 +180,14 @@ export class QualityAssessmentCoordinator extends BaseDomainCoordinator {
|
|
|
178
180
|
this.startWorkflow(workflowId, 'gate-evaluation');
|
|
179
181
|
// Self-healing: Check if operations should be paused due to critical topology
|
|
180
182
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
181
|
-
|
|
183
|
+
logger.warn('Quality gate evaluation paused: topology is in critical state');
|
|
182
184
|
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
183
185
|
return err(new Error('Quality gate evaluation paused: topology is in critical state'));
|
|
184
186
|
}
|
|
185
187
|
// V3 Integration: Check topology health before proceeding (ADR-047)
|
|
186
188
|
// Apply stricter thresholds when topology is degraded
|
|
187
189
|
if (!this.isTopologyHealthy()) {
|
|
188
|
-
|
|
190
|
+
logger.warn('Topology degraded - applying stricter thresholds for quality gate');
|
|
189
191
|
// Continue evaluation but with heightened caution - quality gates are critical
|
|
190
192
|
}
|
|
191
193
|
// Spawn quality gate agent if available
|
|
@@ -285,14 +287,14 @@ export class QualityAssessmentCoordinator extends BaseDomainCoordinator {
|
|
|
285
287
|
this.startWorkflow(workflowId, 'quality-analysis');
|
|
286
288
|
// Self-healing: Check if operations should be paused due to critical topology
|
|
287
289
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
288
|
-
|
|
290
|
+
logger.warn('Quality analysis paused: topology is in critical state');
|
|
289
291
|
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
290
292
|
return err(new Error('Quality analysis paused: topology is in critical state'));
|
|
291
293
|
}
|
|
292
294
|
// V3 Integration: Check topology health and adjust behavior (ADR-047)
|
|
293
295
|
const topologyHealthy = this.isTopologyHealthy();
|
|
294
296
|
if (!topologyHealthy) {
|
|
295
|
-
|
|
297
|
+
logger.warn('Topology degraded during quality analysis');
|
|
296
298
|
// Could adjust analysis depth or timeouts in degraded state
|
|
297
299
|
// For now, we proceed but could be extended to reduce analysis scope
|
|
298
300
|
}
|
|
@@ -348,13 +350,13 @@ export class QualityAssessmentCoordinator extends BaseDomainCoordinator {
|
|
|
348
350
|
this.startWorkflow(workflowId, 'deployment-advice');
|
|
349
351
|
// Self-healing: Check if operations should be paused due to critical topology
|
|
350
352
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
351
|
-
|
|
353
|
+
logger.warn('Deployment advice paused: topology is in critical state');
|
|
352
354
|
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
353
355
|
return err(new Error('Deployment advice paused: topology is in critical state'));
|
|
354
356
|
}
|
|
355
357
|
// V3 Integration: Check topology health (ADR-047)
|
|
356
358
|
if (!this.isTopologyHealthy()) {
|
|
357
|
-
|
|
359
|
+
logger.warn('Topology degraded during deployment advice generation');
|
|
358
360
|
}
|
|
359
361
|
// Spawn deployment advisor agent
|
|
360
362
|
const agentResult = await this.spawnDeploymentAdvisorAgent(workflowId, request);
|
|
@@ -414,13 +416,13 @@ export class QualityAssessmentCoordinator extends BaseDomainCoordinator {
|
|
|
414
416
|
this.startWorkflow(workflowId, 'complexity-analysis');
|
|
415
417
|
// Self-healing: Check if operations should be paused due to critical topology
|
|
416
418
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
417
|
-
|
|
419
|
+
logger.warn('Complexity analysis paused: topology is in critical state');
|
|
418
420
|
this.failWorkflow(workflowId, 'Topology is in critical state');
|
|
419
421
|
return err(new Error('Complexity analysis paused: topology is in critical state'));
|
|
420
422
|
}
|
|
421
423
|
// V3 Integration: Check topology health (ADR-047)
|
|
422
424
|
if (!this.isTopologyHealthy()) {
|
|
423
|
-
|
|
425
|
+
logger.warn('Topology degraded during complexity analysis');
|
|
424
426
|
}
|
|
425
427
|
// Spawn complexity analyzer agent
|
|
426
428
|
const agentResult = await this.spawnComplexityAnalyzerAgent(workflowId, request);
|
|
@@ -652,7 +654,7 @@ export class QualityAssessmentCoordinator extends BaseDomainCoordinator {
|
|
|
652
654
|
if (relevantInsights.length === 0) {
|
|
653
655
|
return;
|
|
654
656
|
}
|
|
655
|
-
|
|
657
|
+
logger.info(`[${this.domain}] Received ${relevantInsights.length} relevant dream insights from cycle ${cycleId}`);
|
|
656
658
|
// Apply high-confidence actionable insights
|
|
657
659
|
for (const insight of relevantInsights) {
|
|
658
660
|
if (insight.confidenceScore > 0.7 && insight.actionable) {
|
|
@@ -677,7 +679,7 @@ export class QualityAssessmentCoordinator extends BaseDomainCoordinator {
|
|
|
677
679
|
* @param cycleId - The dream cycle ID for tracking
|
|
678
680
|
*/
|
|
679
681
|
async applyDreamInsight(insight, cycleId) {
|
|
680
|
-
|
|
682
|
+
logger.info(`[${this.domain}] Applying dream insight: ${insight.description.slice(0, 100)}...`);
|
|
681
683
|
// Store as a learned pattern via SONA if available
|
|
682
684
|
if (this.qesona) {
|
|
683
685
|
try {
|
|
@@ -708,10 +710,10 @@ export class QualityAssessmentCoordinator extends BaseDomainCoordinator {
|
|
|
708
710
|
suggestedAction: insight.suggestedAction,
|
|
709
711
|
dreamDerived: true,
|
|
710
712
|
});
|
|
711
|
-
|
|
713
|
+
logger.info(`[${this.domain}] Created SONA pattern from dream insight ${insight.id}`);
|
|
712
714
|
}
|
|
713
715
|
catch (error) {
|
|
714
|
-
|
|
716
|
+
logger.error(`[${this.domain}] Failed to store dream insight pattern`, error instanceof Error ? error : undefined);
|
|
715
717
|
}
|
|
716
718
|
}
|
|
717
719
|
// Store insight in memory for downstream usage
|
|
@@ -61,16 +61,6 @@ interface DecisionThresholds {
|
|
|
61
61
|
warning: number;
|
|
62
62
|
blocked: number;
|
|
63
63
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Deployment Advisor Service Implementation
|
|
66
|
-
* Uses ML-based risk scoring to provide deployment recommendations
|
|
67
|
-
*
|
|
68
|
-
* ADR-051: Added LLM integration for AI-powered deployment advice including:
|
|
69
|
-
* - Go/no-go recommendations with reasoning
|
|
70
|
-
* - Risk mitigation strategies
|
|
71
|
-
* - Rollback plan suggestions
|
|
72
|
-
* - Post-deployment monitoring recommendations
|
|
73
|
-
*/
|
|
74
64
|
export declare class DeploymentAdvisorService implements IDeploymentAdvisorService {
|
|
75
65
|
private config;
|
|
76
66
|
private readonly memory;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* ADR-051: Added LLM integration for AI-powered deployment advice
|
|
6
6
|
*/
|
|
7
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
7
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
9
|
import { ok, err } from '../../../shared/types';
|
|
9
10
|
import { toError } from '../../../shared/error-utils.js';
|
|
@@ -38,6 +39,7 @@ const DEFAULT_CONFIG = {
|
|
|
38
39
|
* - Rollback plan suggestions
|
|
39
40
|
* - Post-deployment monitoring recommendations
|
|
40
41
|
*/
|
|
42
|
+
const logger = LoggerFactory.create('quality-assessment/deployment-advisor');
|
|
41
43
|
export class DeploymentAdvisorService {
|
|
42
44
|
config;
|
|
43
45
|
memory;
|
|
@@ -143,12 +145,12 @@ Provide deployment advice specific to these metrics.`,
|
|
|
143
145
|
}
|
|
144
146
|
catch {
|
|
145
147
|
// JSON parse failed - return empty enhancement
|
|
146
|
-
|
|
148
|
+
logger.warn('Failed to parse LLM response JSON');
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
152
|
catch (error) {
|
|
151
|
-
|
|
153
|
+
logger.warn('LLM advice generation failed:');
|
|
152
154
|
}
|
|
153
155
|
return {};
|
|
154
156
|
}
|
|
@@ -50,12 +50,6 @@ export interface QualityAnalyzerDependencies {
|
|
|
50
50
|
/** ADR-051: Optional LLM router for AI-enhanced quality insights */
|
|
51
51
|
llmRouter?: HybridRouter;
|
|
52
52
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Quality Analyzer Service Implementation
|
|
55
|
-
* Analyzes code quality metrics and provides actionable insights
|
|
56
|
-
*
|
|
57
|
-
* ADR-051: Added LLM enhancement for AI-powered quality insights
|
|
58
|
-
*/
|
|
59
53
|
export declare class QualityAnalyzerService implements IQualityAnalyzerService {
|
|
60
54
|
private readonly config;
|
|
61
55
|
private readonly metricsAnalyzer;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Agentic QE v3 - Quality Analyzer Service
|
|
3
3
|
* Comprehensive quality metrics analysis with trends and recommendations
|
|
4
4
|
*/
|
|
5
|
+
import { LoggerFactory } from '../../../logging/index.js';
|
|
5
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
7
|
import { ok, err } from '../../../shared/types';
|
|
7
8
|
import { getCodeMetricsAnalyzer } from '../../../shared/metrics';
|
|
@@ -35,6 +36,7 @@ const RATING_THRESHOLDS = {
|
|
|
35
36
|
*
|
|
36
37
|
* ADR-051: Added LLM enhancement for AI-powered quality insights
|
|
37
38
|
*/
|
|
39
|
+
const logger = LoggerFactory.create('quality-assessment/quality-analyzer');
|
|
38
40
|
export class QualityAnalyzerService {
|
|
39
41
|
config;
|
|
40
42
|
metricsAnalyzer;
|
|
@@ -136,7 +138,7 @@ Focus on:
|
|
|
136
138
|
return null;
|
|
137
139
|
}
|
|
138
140
|
catch (error) {
|
|
139
|
-
|
|
141
|
+
logger.warn('LLM insights generation failed:');
|
|
140
142
|
return null;
|
|
141
143
|
}
|
|
142
144
|
}
|
|
@@ -198,7 +200,7 @@ Focus on:
|
|
|
198
200
|
return null;
|
|
199
201
|
}
|
|
200
202
|
catch (error) {
|
|
201
|
-
|
|
203
|
+
logger.warn('Failed to parse LLM insights response:');
|
|
202
204
|
return null;
|
|
203
205
|
}
|
|
204
206
|
}
|
|
@@ -37,9 +37,6 @@ export interface WorkflowStatus {
|
|
|
37
37
|
error?: string;
|
|
38
38
|
}
|
|
39
39
|
type RequirementsWorkflowType = 'analyze' | 'generate-artifacts' | 'validate-sprint';
|
|
40
|
-
/**
|
|
41
|
-
* CQ-002: Extends BaseDomainCoordinator
|
|
42
|
-
*/
|
|
43
40
|
export declare class RequirementsValidationCoordinator extends BaseDomainCoordinator<CoordinatorConfig, RequirementsWorkflowType> implements IRequirementsValidationCoordinator {
|
|
44
41
|
private readonly memory;
|
|
45
42
|
private readonly agentCoordinator;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* - QESONA: Learns and adapts requirement patterns for improved validation
|
|
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 { toError } from '../../shared/error-utils.js';
|
|
12
13
|
import { createEvent } from '../../shared/events/domain-events.js';
|
|
@@ -90,6 +91,7 @@ class InMemoryRequirementRepository {
|
|
|
90
91
|
/**
|
|
91
92
|
* CQ-002: Extends BaseDomainCoordinator
|
|
92
93
|
*/
|
|
94
|
+
const logger = LoggerFactory.create('requirements-validation');
|
|
93
95
|
export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
94
96
|
memory;
|
|
95
97
|
agentCoordinator;
|
|
@@ -158,10 +160,10 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
158
160
|
maxPatterns: 5000,
|
|
159
161
|
minConfidence: 0.6,
|
|
160
162
|
});
|
|
161
|
-
|
|
163
|
+
logger.info('PersistentSONAEngine initialized for pattern learning');
|
|
162
164
|
}
|
|
163
165
|
catch (error) {
|
|
164
|
-
|
|
166
|
+
logger.error('Failed to initialize PersistentSONAEngine', error instanceof Error ? error : undefined);
|
|
165
167
|
// Continue without SONA - it's optional
|
|
166
168
|
this.sonaEngine = undefined;
|
|
167
169
|
}
|
|
@@ -169,7 +171,7 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
169
171
|
this.rlInitialized = true;
|
|
170
172
|
}
|
|
171
173
|
catch (error) {
|
|
172
|
-
|
|
174
|
+
logger.error('Failed to initialize RL integrations', error instanceof Error ? error : undefined);
|
|
173
175
|
throw error;
|
|
174
176
|
}
|
|
175
177
|
}
|
|
@@ -186,7 +188,7 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
186
188
|
this.sonaEngine = undefined;
|
|
187
189
|
}
|
|
188
190
|
catch (error) {
|
|
189
|
-
|
|
191
|
+
logger.error('Error closing SONA engine', error instanceof Error ? error : undefined);
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
}
|
|
@@ -208,7 +210,7 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
208
210
|
this.startWorkflow(workflowId, 'analyze');
|
|
209
211
|
// V3: Check topology health before proceeding (ADR-047)
|
|
210
212
|
if (this.config.enableMinCutAwareness && !this.isTopologyHealthy()) {
|
|
211
|
-
|
|
213
|
+
logger.warn('Topology degraded, using conservative strategy');
|
|
212
214
|
}
|
|
213
215
|
// V3: Pause operations if topology is critical and configured to pause
|
|
214
216
|
if (this.minCutMixin.shouldPauseOperations()) {
|
|
@@ -223,7 +225,7 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
223
225
|
if (this.config.enableSONA && this.sonaEngine) {
|
|
224
226
|
const pattern = await this.adaptRequirementPattern(requirement);
|
|
225
227
|
if (pattern.success && pattern.pattern) {
|
|
226
|
-
|
|
228
|
+
logger.info(`[SONA] Adapted pattern with ${pattern.similarity.toFixed(3)} similarity`);
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
231
|
// Spawn analysis agent
|
|
@@ -313,7 +315,7 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
313
315
|
const prediction = await this.optimizeScenarioGeneration(requirement);
|
|
314
316
|
if (prediction.success && prediction.value) {
|
|
315
317
|
optimizedScenarioCount = this.extractScenarioCount(prediction.value);
|
|
316
|
-
|
|
318
|
+
logger.info(`[PPO] Optimized scenario count to ${optimizedScenarioCount}`);
|
|
317
319
|
}
|
|
318
320
|
}
|
|
319
321
|
// Generate BDD scenarios with optimized count
|
|
@@ -508,7 +510,7 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
508
510
|
return scored.map((s) => s.scenario);
|
|
509
511
|
}
|
|
510
512
|
catch (error) {
|
|
511
|
-
|
|
513
|
+
logger.error('Failed to optimize scenario ordering', error instanceof Error ? error : undefined);
|
|
512
514
|
return scenarios;
|
|
513
515
|
}
|
|
514
516
|
}
|
|
@@ -539,10 +541,10 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
539
541
|
done: true,
|
|
540
542
|
};
|
|
541
543
|
await this.ppoAlgorithm.train(experience);
|
|
542
|
-
|
|
544
|
+
logger.info(`[PPO] Trained with reward: ${reward.toFixed(3)}`);
|
|
543
545
|
}
|
|
544
546
|
catch (error) {
|
|
545
|
-
|
|
547
|
+
logger.error('Failed to train PPO', error instanceof Error ? error : undefined);
|
|
546
548
|
}
|
|
547
549
|
}
|
|
548
550
|
/**
|
|
@@ -615,7 +617,7 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
615
617
|
};
|
|
616
618
|
}
|
|
617
619
|
catch (error) {
|
|
618
|
-
|
|
620
|
+
logger.error('Failed to adapt requirement pattern', error instanceof Error ? error : undefined);
|
|
619
621
|
return { success: false, pattern: null, similarity: 0 };
|
|
620
622
|
}
|
|
621
623
|
}
|
|
@@ -646,10 +648,10 @@ export class RequirementsValidationCoordinator extends BaseDomainCoordinator {
|
|
|
646
648
|
validationErrorCount: analysis.validationErrors.length,
|
|
647
649
|
ambiguityScore: analysis.ambiguityReport.overallScore,
|
|
648
650
|
});
|
|
649
|
-
|
|
651
|
+
logger.info(`[SONA] Stored pattern ${pattern.id} for requirement ${requirement.id}`);
|
|
650
652
|
}
|
|
651
653
|
catch (error) {
|
|
652
|
-
|
|
654
|
+
logger.error('Failed to store requirement pattern', error instanceof Error ? error : undefined);
|
|
653
655
|
}
|
|
654
656
|
}
|
|
655
657
|
// ============================================================================
|
|
@@ -28,11 +28,6 @@ export interface CodebaseAnalyzerConfig {
|
|
|
28
28
|
/** Exclude patterns */
|
|
29
29
|
excludePatterns?: string[];
|
|
30
30
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Codebase Analyzer
|
|
33
|
-
*
|
|
34
|
-
* Provides automated codebase analysis for SFDIPOT assessment.
|
|
35
|
-
*/
|
|
36
31
|
export declare class CodebaseAnalyzer {
|
|
37
32
|
private config;
|
|
38
33
|
constructor(config: CodebaseAnalyzerConfig);
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import * as path from 'path';
|
|
14
14
|
import * as fs from 'fs/promises';
|
|
15
|
+
import { LoggerFactory } from '../../../../../logging/index.js';
|
|
15
16
|
import { HTSMCategory, Priority, AutomationFitness, generateTestId, } from '../types/index.js';
|
|
16
17
|
import { safeJsonParse } from '@shared/safe-json.js';
|
|
17
18
|
const DEFAULT_CONFIG = {
|
|
@@ -75,6 +76,7 @@ const EXTERNAL_SYSTEM_PATTERNS = {
|
|
|
75
76
|
*
|
|
76
77
|
* Provides automated codebase analysis for SFDIPOT assessment.
|
|
77
78
|
*/
|
|
79
|
+
const logger = LoggerFactory.create('requirements-validation/codebase-analyzer');
|
|
78
80
|
export class CodebaseAnalyzer {
|
|
79
81
|
config;
|
|
80
82
|
constructor(config) {
|
|
@@ -101,13 +103,13 @@ export class CodebaseAnalyzer {
|
|
|
101
103
|
try {
|
|
102
104
|
// Phase 1: Detect external systems from package.json
|
|
103
105
|
if (this.config.detectExternalSystems) {
|
|
104
|
-
|
|
106
|
+
logger.info('Phase 1: Detecting external systems...');
|
|
105
107
|
result.externalSystems = await this.detectExternalSystems();
|
|
106
108
|
result.metadata.externalSystemsDetected = result.externalSystems.length;
|
|
107
109
|
}
|
|
108
110
|
// Phase 2: Analyze component boundaries
|
|
109
111
|
if (this.config.analyzeComponents) {
|
|
110
|
-
|
|
112
|
+
logger.info('Phase 2: Analyzing components...');
|
|
111
113
|
const componentResult = await this.analyzeComponents();
|
|
112
114
|
result.components = componentResult.components;
|
|
113
115
|
result.relationships = componentResult.relationships;
|
|
@@ -115,19 +117,19 @@ export class CodebaseAnalyzer {
|
|
|
115
117
|
}
|
|
116
118
|
// Phase 3: Analyze module coupling
|
|
117
119
|
if (this.config.analyzeCoupling && result.components.length > 0) {
|
|
118
|
-
|
|
120
|
+
logger.info('Phase 3: Analyzing coupling...');
|
|
119
121
|
result.couplingAnalysis = this.analyzeCoupling(result.components, result.relationships);
|
|
120
122
|
}
|
|
121
123
|
// Generate C4 diagrams
|
|
122
124
|
if (this.config.generateC4Diagrams) {
|
|
123
|
-
|
|
125
|
+
logger.info('Generating C4 diagrams...');
|
|
124
126
|
result.c4Diagrams = await this.generateC4Diagrams(result);
|
|
125
127
|
}
|
|
126
128
|
result.metadata.analysisTimeMs = Date.now() - startTime;
|
|
127
|
-
|
|
129
|
+
logger.info(`Analysis complete in ${result.metadata.analysisTimeMs}ms`);
|
|
128
130
|
}
|
|
129
131
|
catch (error) {
|
|
130
|
-
|
|
132
|
+
logger.error('Analysis failed', error instanceof Error ? error : undefined);
|
|
131
133
|
result.metadata.analysisTimeMs = Date.now() - startTime;
|
|
132
134
|
}
|
|
133
135
|
return result;
|
|
@@ -147,7 +149,7 @@ export class CodebaseAnalyzer {
|
|
|
147
149
|
await fs.access(packageJsonPath);
|
|
148
150
|
}
|
|
149
151
|
catch {
|
|
150
|
-
|
|
152
|
+
logger.info('No package.json found, skipping external system detection');
|
|
151
153
|
return systems;
|
|
152
154
|
}
|
|
153
155
|
const content = await fs.readFile(packageJsonPath, 'utf-8');
|
|
@@ -171,7 +173,7 @@ export class CodebaseAnalyzer {
|
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
catch (error) {
|
|
174
|
-
|
|
176
|
+
logger.error('External system detection failed', error instanceof Error ? error : undefined);
|
|
175
177
|
}
|
|
176
178
|
return systems;
|
|
177
179
|
}
|
|
@@ -193,7 +195,7 @@ export class CodebaseAnalyzer {
|
|
|
193
195
|
analyzeDir = srcDir;
|
|
194
196
|
}
|
|
195
197
|
catch {
|
|
196
|
-
|
|
198
|
+
logger.info('No src directory, analyzing root');
|
|
197
199
|
}
|
|
198
200
|
// Get top-level directories as components
|
|
199
201
|
const entries = await fs.readdir(analyzeDir, { withFileTypes: true });
|
|
@@ -232,7 +234,7 @@ export class CodebaseAnalyzer {
|
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
236
|
catch (error) {
|
|
235
|
-
|
|
237
|
+
logger.error('Component analysis failed', error instanceof Error ? error : undefined);
|
|
236
238
|
}
|
|
237
239
|
return { components, relationships };
|
|
238
240
|
}
|
|
@@ -262,7 +264,7 @@ export class CodebaseAnalyzer {
|
|
|
262
264
|
}
|
|
263
265
|
catch (error) {
|
|
264
266
|
// Non-critical: permission errors when scanning directories
|
|
265
|
-
|
|
267
|
+
logger.debug(`Directory scan error: ${error instanceof Error ? error.message : error}`);
|
|
266
268
|
}
|
|
267
269
|
};
|
|
268
270
|
await scan(dir, 0);
|
|
@@ -388,7 +390,7 @@ export class CodebaseAnalyzer {
|
|
|
388
390
|
}
|
|
389
391
|
}
|
|
390
392
|
catch (error) {
|
|
391
|
-
|
|
393
|
+
logger.error('Coupling analysis failed', error instanceof Error ? error : undefined);
|
|
392
394
|
}
|
|
393
395
|
return couplingInfo;
|
|
394
396
|
}
|
|
@@ -427,7 +429,7 @@ export class CodebaseAnalyzer {
|
|
|
427
429
|
}
|
|
428
430
|
}
|
|
429
431
|
catch (error) {
|
|
430
|
-
|
|
432
|
+
logger.error('C4 diagram generation failed', error instanceof Error ? error : undefined);
|
|
431
433
|
}
|
|
432
434
|
return diagrams;
|
|
433
435
|
}
|
|
@@ -25,12 +25,6 @@ export interface ProductFactorsServiceConfig {
|
|
|
25
25
|
/** Output directory for generated reports */
|
|
26
26
|
outputDir?: string;
|
|
27
27
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Product Factors Assessment Service
|
|
30
|
-
*
|
|
31
|
-
* Implements SFDIPOT-based test idea generation without requiring BaseAgent.
|
|
32
|
-
* This is a stateless service suitable for v3's domain-driven architecture.
|
|
33
|
-
*/
|
|
34
28
|
export declare class ProductFactorsService {
|
|
35
29
|
private readonly config;
|
|
36
30
|
private readonly userStoryParser;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* This is a standalone service that can be used directly or through the
|
|
8
8
|
* requirements-validation domain coordinator.
|
|
9
9
|
*/
|
|
10
|
+
import { LoggerFactory } from '../../../../logging/index.js';
|
|
10
11
|
import { HTSMCategory, Priority, AutomationFitness, SFDIPOT_SUBCATEGORIES, generateTestId, } from './types/index.js';
|
|
11
12
|
import { UserStoryParser, DocumentParser, ArchitectureParser } from './parsers/index.js';
|
|
12
13
|
import { SFDIPOTAnalyzer } from './analyzers/index.js';
|
|
@@ -21,6 +22,7 @@ import { domainPatternRegistry } from './patterns/index.js';
|
|
|
21
22
|
* Implements SFDIPOT-based test idea generation without requiring BaseAgent.
|
|
22
23
|
* This is a stateless service suitable for v3's domain-driven architecture.
|
|
23
24
|
*/
|
|
25
|
+
const logger = LoggerFactory.create('requirements-validation/product-factors');
|
|
24
26
|
export class ProductFactorsService {
|
|
25
27
|
config;
|
|
26
28
|
// Modular components
|
|
@@ -66,7 +68,7 @@ export class ProductFactorsService {
|
|
|
66
68
|
* Main entry point - Generate full Product Factors assessment
|
|
67
69
|
*/
|
|
68
70
|
async assess(input) {
|
|
69
|
-
|
|
71
|
+
logger.info('Starting Product Factors assessment...');
|
|
70
72
|
// Step 1: Parse input documents
|
|
71
73
|
const parsedInput = await this.parseInput(input);
|
|
72
74
|
// Step 2: Detect project context
|
|
@@ -75,7 +77,7 @@ export class ProductFactorsService {
|
|
|
75
77
|
let requirementsQualityScore;
|
|
76
78
|
let requirementsQualityData;
|
|
77
79
|
if (this.config.enableBrutalHonesty && parsedInput.rawContent.length > 100) {
|
|
78
|
-
|
|
80
|
+
logger.info('Running Bach mode BS detection on requirements...');
|
|
79
81
|
const reqAnalysis = this.sfdipotAnalyzer
|
|
80
82
|
.getBrutalHonestyAnalyzer()
|
|
81
83
|
.analyzeRequirements(parsedInput.rawContent, context.detectedDomains);
|
|
@@ -85,10 +87,10 @@ export class ProductFactorsService {
|
|
|
85
87
|
const domainInfo = context.detectedDomains
|
|
86
88
|
.map((d) => `${d.displayName} (${(d.confidence * 100).toFixed(0)}%)`)
|
|
87
89
|
.join(', ');
|
|
88
|
-
|
|
90
|
+
logger.info(`Detected domains: ${domainInfo}`);
|
|
89
91
|
}
|
|
90
92
|
if (reqAnalysis.findings.length > 0) {
|
|
91
|
-
|
|
93
|
+
logger.info(`Requirements quality: ${reqAnalysis.score}/100 - ${reqAnalysis.verdict}`);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
// Step 3: Analyze using SFDIPOT framework
|
|
@@ -97,7 +99,7 @@ export class ProductFactorsService {
|
|
|
97
99
|
let codeIntelligenceResult;
|
|
98
100
|
let c4Diagrams;
|
|
99
101
|
if (input.codebaseRootDir && input.enableCodeIntelligence !== false) {
|
|
100
|
-
|
|
102
|
+
logger.info(`Running code intelligence analysis on ${input.codebaseRootDir}...`);
|
|
101
103
|
try {
|
|
102
104
|
const codebaseAnalyzer = new CodebaseAnalyzer({
|
|
103
105
|
rootDir: input.codebaseRootDir,
|
|
@@ -122,7 +124,7 @@ export class ProductFactorsService {
|
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
126
|
catch (error) {
|
|
125
|
-
|
|
127
|
+
logger.warn('Code intelligence analysis failed');
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
// Step 4: Generate clarifying questions for gaps
|
|
@@ -160,7 +162,7 @@ export class ProductFactorsService {
|
|
|
160
162
|
codeIntelligence: codeIntelligenceResult,
|
|
161
163
|
c4Diagrams,
|
|
162
164
|
};
|
|
163
|
-
|
|
165
|
+
logger.info(`Assessment complete: ${testIdeas.length} test ideas, ${allQuestions.length} questions`);
|
|
164
166
|
return result;
|
|
165
167
|
}
|
|
166
168
|
/**
|