agentic-qe 1.9.3 → 2.0.0
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/agents/qe-api-contract-validator.md +95 -1336
- package/.claude/agents/qe-chaos-engineer.md +152 -1211
- package/.claude/agents/qe-code-complexity.md +144 -707
- package/.claude/agents/qe-coverage-analyzer.md +147 -743
- package/.claude/agents/qe-deployment-readiness.md +143 -1496
- package/.claude/agents/qe-flaky-test-hunter.md +132 -1529
- package/.claude/agents/qe-fleet-commander.md +12 -12
- package/.claude/agents/qe-performance-tester.md +150 -886
- package/.claude/agents/qe-production-intelligence.md +155 -1396
- package/.claude/agents/qe-quality-analyzer.md +6 -6
- package/.claude/agents/qe-quality-gate.md +151 -648
- package/.claude/agents/qe-regression-risk-analyzer.md +132 -1150
- package/.claude/agents/qe-requirements-validator.md +149 -932
- package/.claude/agents/qe-security-scanner.md +157 -797
- package/.claude/agents/qe-test-data-architect.md +96 -1365
- package/.claude/agents/qe-test-executor.md +8 -8
- package/.claude/agents/qe-test-generator.md +145 -1540
- package/.claude/agents/qe-visual-tester.md +153 -1257
- package/.claude/agents/qx-partner.md +235 -0
- package/.claude/agents/subagents/qe-code-reviewer.md +40 -136
- package/.claude/agents/subagents/qe-coverage-gap-analyzer.md +40 -480
- package/.claude/agents/subagents/qe-data-generator.md +41 -125
- package/.claude/agents/subagents/qe-flaky-investigator.md +55 -411
- package/.claude/agents/subagents/qe-integration-tester.md +53 -141
- package/.claude/agents/subagents/qe-performance-validator.md +54 -130
- package/.claude/agents/subagents/qe-security-auditor.md +56 -114
- package/.claude/agents/subagents/qe-test-data-architect-sub.md +57 -548
- package/.claude/agents/subagents/qe-test-implementer.md +58 -551
- package/.claude/agents/subagents/qe-test-refactorer.md +65 -722
- package/.claude/agents/subagents/qe-test-writer.md +63 -726
- package/.claude/skills/skills-manifest.json +632 -0
- package/.claude/skills/testability-scoring/README.md +71 -0
- package/.claude/skills/testability-scoring/SKILL.md +611 -0
- package/.claude/skills/testability-scoring/resources/templates/config.template.js +84 -0
- package/.claude/skills/testability-scoring/resources/templates/testability-scoring.spec.template.js +532 -0
- package/.claude/skills/testability-scoring/scripts/generate-html-report.js +1007 -0
- package/.claude/skills/testability-scoring/scripts/run-assessment.sh +70 -0
- package/CHANGELOG.md +116 -0
- package/README.md +59 -7
- package/config/.env.otel.example +25 -0
- package/config/OTEL-QUICK-REFERENCE.md +137 -0
- package/config/README-OTEL.md +222 -0
- package/config/alerting-rules.yml +518 -0
- package/config/docker-compose.otel.yml +187 -0
- package/config/grafana/dashboards/agentic-qe-overview.json +286 -0
- package/config/grafana/provisioning/dashboards/dashboards.yml +19 -0
- package/config/grafana/provisioning/datasources/datasources.yml +53 -0
- package/config/otel-collector-config.yaml.example +145 -0
- package/config/prometheus.yml.example +106 -0
- package/dist/agents/QXPartnerAgent.d.ts +139 -0
- package/dist/agents/QXPartnerAgent.d.ts.map +1 -0
- package/dist/agents/QXPartnerAgent.js +769 -0
- package/dist/agents/QXPartnerAgent.js.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +82 -2
- package/dist/agents/index.js.map +1 -1
- package/dist/alerting/AlertManager.d.ts +120 -0
- package/dist/alerting/AlertManager.d.ts.map +1 -0
- package/dist/alerting/AlertManager.js +345 -0
- package/dist/alerting/AlertManager.js.map +1 -0
- package/dist/alerting/FeedbackRouter.d.ts +98 -0
- package/dist/alerting/FeedbackRouter.d.ts.map +1 -0
- package/dist/alerting/FeedbackRouter.js +331 -0
- package/dist/alerting/FeedbackRouter.js.map +1 -0
- package/dist/alerting/StrategyApplicator.d.ts +120 -0
- package/dist/alerting/StrategyApplicator.d.ts.map +1 -0
- package/dist/alerting/StrategyApplicator.js +299 -0
- package/dist/alerting/StrategyApplicator.js.map +1 -0
- package/dist/alerting/index.d.ts +68 -0
- package/dist/alerting/index.d.ts.map +1 -0
- package/dist/alerting/index.js +112 -0
- package/dist/alerting/index.js.map +1 -0
- package/dist/alerting/types.d.ts +118 -0
- package/dist/alerting/types.d.ts.map +1 -0
- package/dist/alerting/types.js +11 -0
- package/dist/alerting/types.js.map +1 -0
- package/dist/cli/commands/debug/agent.d.ts.map +1 -1
- package/dist/cli/commands/debug/agent.js +19 -6
- package/dist/cli/commands/debug/agent.js.map +1 -1
- package/dist/cli/commands/debug/health-check.js +20 -7
- package/dist/cli/commands/debug/health-check.js.map +1 -1
- package/dist/cli/commands/init-claude-md-template.d.ts +1 -0
- package/dist/cli/commands/init-claude-md-template.d.ts.map +1 -1
- package/dist/cli/commands/init-claude-md-template.js +4 -3
- package/dist/cli/commands/init-claude-md-template.js.map +1 -1
- package/dist/cli/commands/workflow/cancel.d.ts.map +1 -1
- package/dist/cli/commands/workflow/cancel.js +4 -3
- package/dist/cli/commands/workflow/cancel.js.map +1 -1
- package/dist/cli/commands/workflow/list.d.ts.map +1 -1
- package/dist/cli/commands/workflow/list.js +4 -3
- package/dist/cli/commands/workflow/list.js.map +1 -1
- package/dist/cli/commands/workflow/pause.d.ts.map +1 -1
- package/dist/cli/commands/workflow/pause.js +4 -3
- package/dist/cli/commands/workflow/pause.js.map +1 -1
- package/dist/cli/init/claude-config.d.ts.map +1 -1
- package/dist/cli/init/claude-config.js +13 -13
- package/dist/cli/init/claude-config.js.map +1 -1
- package/dist/cli/init/claude-md.d.ts.map +1 -1
- package/dist/cli/init/claude-md.js +44 -2
- package/dist/cli/init/claude-md.js.map +1 -1
- package/dist/cli/init/database-init.js +1 -1
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +13 -6
- package/dist/cli/init/index.js.map +1 -1
- package/dist/cli/init/skills.d.ts.map +1 -1
- package/dist/cli/init/skills.js +2 -1
- package/dist/cli/init/skills.js.map +1 -1
- package/dist/core/memory/AgentDBIntegration.d.ts +24 -6
- package/dist/core/memory/AgentDBIntegration.d.ts.map +1 -1
- package/dist/core/memory/AgentDBIntegration.js +66 -10
- package/dist/core/memory/AgentDBIntegration.js.map +1 -1
- package/dist/core/memory/IPatternStore.d.ts +209 -0
- package/dist/core/memory/IPatternStore.d.ts.map +1 -0
- package/dist/core/memory/IPatternStore.js +15 -0
- package/dist/core/memory/IPatternStore.js.map +1 -0
- package/dist/core/memory/MigrationTools.d.ts +192 -0
- package/dist/core/memory/MigrationTools.d.ts.map +1 -0
- package/dist/core/memory/MigrationTools.js +615 -0
- package/dist/core/memory/MigrationTools.js.map +1 -0
- package/dist/core/memory/NeuralEnhancement.d.ts +154 -0
- package/dist/core/memory/NeuralEnhancement.d.ts.map +1 -0
- package/dist/core/memory/NeuralEnhancement.js +598 -0
- package/dist/core/memory/NeuralEnhancement.js.map +1 -0
- package/dist/core/memory/PatternStoreFactory.d.ts +143 -0
- package/dist/core/memory/PatternStoreFactory.d.ts.map +1 -0
- package/dist/core/memory/PatternStoreFactory.js +370 -0
- package/dist/core/memory/PatternStoreFactory.js.map +1 -0
- package/dist/core/memory/RealAgentDBAdapter.d.ts +1 -0
- package/dist/core/memory/RealAgentDBAdapter.d.ts.map +1 -1
- package/dist/core/memory/RealAgentDBAdapter.js +28 -20
- package/dist/core/memory/RealAgentDBAdapter.js.map +1 -1
- package/dist/core/memory/RuVectorPatternStore.d.ts +198 -0
- package/dist/core/memory/RuVectorPatternStore.d.ts.map +1 -0
- package/dist/core/memory/RuVectorPatternStore.js +605 -0
- package/dist/core/memory/RuVectorPatternStore.js.map +1 -0
- package/dist/core/memory/SelfHealingMonitor.d.ts +186 -0
- package/dist/core/memory/SelfHealingMonitor.d.ts.map +1 -0
- package/dist/core/memory/SelfHealingMonitor.js +451 -0
- package/dist/core/memory/SelfHealingMonitor.js.map +1 -0
- package/dist/core/memory/SwarmMemoryManager.d.ts +62 -0
- package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
- package/dist/core/memory/SwarmMemoryManager.js +97 -0
- package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
- package/dist/core/memory/UnifiedMemoryCoordinator.d.ts +341 -0
- package/dist/core/memory/UnifiedMemoryCoordinator.d.ts.map +1 -0
- package/dist/core/memory/UnifiedMemoryCoordinator.js +986 -0
- package/dist/core/memory/UnifiedMemoryCoordinator.js.map +1 -0
- package/dist/core/memory/index.d.ts +16 -0
- package/dist/core/memory/index.d.ts.map +1 -1
- package/dist/core/memory/index.js +58 -1
- package/dist/core/memory/index.js.map +1 -1
- package/dist/core/optimization/SwarmOptimizer.d.ts +185 -0
- package/dist/core/optimization/SwarmOptimizer.d.ts.map +1 -0
- package/dist/core/optimization/SwarmOptimizer.js +631 -0
- package/dist/core/optimization/SwarmOptimizer.js.map +1 -0
- package/dist/core/optimization/index.d.ts +9 -0
- package/dist/core/optimization/index.d.ts.map +1 -0
- package/dist/core/optimization/index.js +25 -0
- package/dist/core/optimization/index.js.map +1 -0
- package/dist/core/optimization/types.d.ts +53 -0
- package/dist/core/optimization/types.d.ts.map +1 -0
- package/dist/core/optimization/types.js +6 -0
- package/dist/core/optimization/types.js.map +1 -0
- package/dist/core/orchestration/PriorityQueue.d.ts +54 -0
- package/dist/core/orchestration/PriorityQueue.d.ts.map +1 -0
- package/dist/core/orchestration/PriorityQueue.js +122 -0
- package/dist/core/orchestration/PriorityQueue.js.map +1 -0
- package/dist/core/orchestration/WorkflowOrchestrator.d.ts +176 -0
- package/dist/core/orchestration/WorkflowOrchestrator.d.ts.map +1 -0
- package/dist/core/orchestration/WorkflowOrchestrator.js +813 -0
- package/dist/core/orchestration/WorkflowOrchestrator.js.map +1 -0
- package/dist/core/orchestration/index.d.ts +7 -0
- package/dist/core/orchestration/index.d.ts.map +1 -0
- package/dist/core/orchestration/index.js +11 -0
- package/dist/core/orchestration/index.js.map +1 -0
- package/dist/core/orchestration/types.d.ts +96 -0
- package/dist/core/orchestration/types.d.ts.map +1 -0
- package/dist/core/orchestration/types.js +6 -0
- package/dist/core/orchestration/types.js.map +1 -0
- package/dist/core/skills/DynamicSkillLoader.d.ts +96 -0
- package/dist/core/skills/DynamicSkillLoader.d.ts.map +1 -0
- package/dist/core/skills/DynamicSkillLoader.js +353 -0
- package/dist/core/skills/DynamicSkillLoader.js.map +1 -0
- package/dist/core/skills/types.d.ts +118 -0
- package/dist/core/skills/types.d.ts.map +1 -0
- package/dist/core/skills/types.js +7 -0
- package/dist/core/skills/types.js.map +1 -0
- package/dist/core/transport/QUICTransport.d.ts +320 -0
- package/dist/core/transport/QUICTransport.d.ts.map +1 -0
- package/dist/core/transport/QUICTransport.js +711 -0
- package/dist/core/transport/QUICTransport.js.map +1 -0
- package/dist/core/transport/index.d.ts +40 -0
- package/dist/core/transport/index.d.ts.map +1 -0
- package/dist/core/transport/index.js +46 -0
- package/dist/core/transport/index.js.map +1 -0
- package/dist/core/transport/quic-loader.d.ts +123 -0
- package/dist/core/transport/quic-loader.d.ts.map +1 -0
- package/dist/core/transport/quic-loader.js +293 -0
- package/dist/core/transport/quic-loader.js.map +1 -0
- package/dist/core/transport/quic.d.ts +154 -0
- package/dist/core/transport/quic.d.ts.map +1 -0
- package/dist/core/transport/quic.js +214 -0
- package/dist/core/transport/quic.js.map +1 -0
- package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
- package/dist/mcp/services/AgentRegistry.js +4 -1
- package/dist/mcp/services/AgentRegistry.js.map +1 -1
- package/dist/reasoning/RuVectorReasoningAdapter.d.ts +232 -0
- package/dist/reasoning/RuVectorReasoningAdapter.d.ts.map +1 -0
- package/dist/reasoning/RuVectorReasoningAdapter.js +585 -0
- package/dist/reasoning/RuVectorReasoningAdapter.js.map +1 -0
- package/dist/reasoning/index.d.ts +2 -0
- package/dist/reasoning/index.d.ts.map +1 -1
- package/dist/reasoning/index.js +6 -1
- package/dist/reasoning/index.js.map +1 -1
- package/dist/reporting/ResultAggregator.d.ts +107 -0
- package/dist/reporting/ResultAggregator.d.ts.map +1 -0
- package/dist/reporting/ResultAggregator.js +435 -0
- package/dist/reporting/ResultAggregator.js.map +1 -0
- package/dist/reporting/index.d.ts +48 -0
- package/dist/reporting/index.d.ts.map +1 -0
- package/dist/reporting/index.js +154 -0
- package/dist/reporting/index.js.map +1 -0
- package/dist/reporting/reporters/ControlLoopReporter.d.ts +128 -0
- package/dist/reporting/reporters/ControlLoopReporter.d.ts.map +1 -0
- package/dist/reporting/reporters/ControlLoopReporter.js +417 -0
- package/dist/reporting/reporters/ControlLoopReporter.js.map +1 -0
- package/dist/reporting/reporters/HumanReadableReporter.d.ts +140 -0
- package/dist/reporting/reporters/HumanReadableReporter.d.ts.map +1 -0
- package/dist/reporting/reporters/HumanReadableReporter.js +524 -0
- package/dist/reporting/reporters/HumanReadableReporter.js.map +1 -0
- package/dist/reporting/reporters/JSONReporter.d.ts +193 -0
- package/dist/reporting/reporters/JSONReporter.d.ts.map +1 -0
- package/dist/reporting/reporters/JSONReporter.js +324 -0
- package/dist/reporting/reporters/JSONReporter.js.map +1 -0
- package/dist/reporting/reporters/index.d.ts +14 -0
- package/dist/reporting/reporters/index.d.ts.map +1 -0
- package/dist/reporting/reporters/index.js +19 -0
- package/dist/reporting/reporters/index.js.map +1 -0
- package/dist/reporting/types.d.ts +427 -0
- package/dist/reporting/types.d.ts.map +1 -0
- package/dist/reporting/types.js +12 -0
- package/dist/reporting/types.js.map +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/qx.d.ts +397 -0
- package/dist/types/qx.d.ts.map +1 -0
- package/dist/types/qx.js +71 -0
- package/dist/types/qx.js.map +1 -0
- package/dist/visualization/api/RestEndpoints.js +1 -1
- package/dist/visualization/api/RestEndpoints.js.map +1 -1
- package/dist/visualization/api/WebSocketServer.d.ts +44 -0
- package/dist/visualization/api/WebSocketServer.d.ts.map +1 -1
- package/dist/visualization/api/WebSocketServer.js +144 -23
- package/dist/visualization/api/WebSocketServer.js.map +1 -1
- package/dist/visualization/core/DataTransformer.d.ts +10 -0
- package/dist/visualization/core/DataTransformer.d.ts.map +1 -1
- package/dist/visualization/core/DataTransformer.js +60 -5
- package/dist/visualization/core/DataTransformer.js.map +1 -1
- package/dist/visualization/emit-event.d.ts +75 -0
- package/dist/visualization/emit-event.d.ts.map +1 -0
- package/dist/visualization/emit-event.js +213 -0
- package/dist/visualization/emit-event.js.map +1 -0
- package/dist/visualization/index.d.ts +1 -0
- package/dist/visualization/index.d.ts.map +1 -1
- package/dist/visualization/index.js +7 -1
- package/dist/visualization/index.js.map +1 -1
- package/docs/reference/skills.md +63 -1
- package/package.json +12 -4
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QXPartnerAgent - Quality Experience (QX) Analysis Agent
|
|
4
|
+
*
|
|
5
|
+
* QX = Marriage between QA (Quality Advocacy) and UX (User Experience)
|
|
6
|
+
* Goal: Co-create Quality Experience for everyone associated with the product
|
|
7
|
+
*
|
|
8
|
+
* Based on: https://talesoftesting.com/quality-experienceqx-co-creating-quality-experience-for-everyone-associated-with-the-product/
|
|
9
|
+
*
|
|
10
|
+
* Key Capabilities:
|
|
11
|
+
* - Problem understanding and analysis (Rule of Three)
|
|
12
|
+
* - User needs vs Business needs analysis
|
|
13
|
+
* - Oracle problem detection and resolution
|
|
14
|
+
* - Comprehensive impact analysis (visible & invisible)
|
|
15
|
+
* - UX testing heuristics application
|
|
16
|
+
* - Integration with testability scoring
|
|
17
|
+
* - Contextual recommendations generation
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.QXPartnerAgent = void 0;
|
|
21
|
+
const BaseAgent_1 = require("./BaseAgent");
|
|
22
|
+
const types_1 = require("../types");
|
|
23
|
+
const qx_1 = require("../types/qx");
|
|
24
|
+
class ConsoleLogger {
|
|
25
|
+
info(message, ...args) {
|
|
26
|
+
console.log(`[INFO] ${message}`, ...args);
|
|
27
|
+
}
|
|
28
|
+
warn(message, ...args) {
|
|
29
|
+
console.warn(`[WARN] ${message}`, ...args);
|
|
30
|
+
}
|
|
31
|
+
error(message, ...args) {
|
|
32
|
+
console.error(`[ERROR] ${message}`, ...args);
|
|
33
|
+
}
|
|
34
|
+
debug(message, ...args) {
|
|
35
|
+
console.debug(`[DEBUG] ${message}`, ...args);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
class QXPartnerAgent extends BaseAgent_1.BaseAgent {
|
|
39
|
+
constructor(config) {
|
|
40
|
+
const baseConfig = {
|
|
41
|
+
type: types_1.QEAgentType.QX_PARTNER,
|
|
42
|
+
capabilities: QXPartnerAgent.getDefaultCapabilities(),
|
|
43
|
+
context: config.context,
|
|
44
|
+
memoryStore: config.memoryStore,
|
|
45
|
+
eventBus: config.eventBus,
|
|
46
|
+
enableLearning: true // Enable learning for adaptive QX analysis
|
|
47
|
+
};
|
|
48
|
+
super(baseConfig);
|
|
49
|
+
this.logger = new ConsoleLogger();
|
|
50
|
+
this.config = {
|
|
51
|
+
analysisMode: config.analysisMode || 'full',
|
|
52
|
+
heuristics: config.heuristics || {
|
|
53
|
+
enabledHeuristics: Object.values(qx_1.QXHeuristic),
|
|
54
|
+
minConfidence: 0.7,
|
|
55
|
+
enableCompetitiveAnalysis: false
|
|
56
|
+
},
|
|
57
|
+
integrateTestability: config.integrateTestability ?? true,
|
|
58
|
+
testabilityScoringPath: config.testabilityScoringPath || '.claude/skills/testability-scoring',
|
|
59
|
+
detectOracleProblems: config.detectOracleProblems ?? true,
|
|
60
|
+
minOracleSeverity: config.minOracleSeverity || 'medium',
|
|
61
|
+
collaboration: config.collaboration || {
|
|
62
|
+
coordinateWithUX: true,
|
|
63
|
+
coordinateWithQA: true,
|
|
64
|
+
shareWithQualityAnalyzer: true
|
|
65
|
+
},
|
|
66
|
+
outputFormat: config.outputFormat || 'json',
|
|
67
|
+
thresholds: config.thresholds || {
|
|
68
|
+
minQXScore: 70,
|
|
69
|
+
minProblemClarity: 60,
|
|
70
|
+
minUserNeedsAlignment: 70,
|
|
71
|
+
minBusinessAlignment: 70
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get default capabilities for QX Partner Agent
|
|
77
|
+
*/
|
|
78
|
+
static getDefaultCapabilities() {
|
|
79
|
+
return [
|
|
80
|
+
{
|
|
81
|
+
name: 'qx-analysis',
|
|
82
|
+
version: '1.0.0',
|
|
83
|
+
description: 'Comprehensive QX (Quality Experience) analysis combining QA and UX perspectives'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'oracle-problem-detection',
|
|
87
|
+
version: '1.0.0',
|
|
88
|
+
description: 'Detect and resolve oracle problems when quality criteria are unclear'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'ux-heuristics',
|
|
92
|
+
version: '1.0.0',
|
|
93
|
+
description: 'Apply UX testing heuristics for comprehensive analysis'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'impact-analysis',
|
|
97
|
+
version: '1.0.0',
|
|
98
|
+
description: 'Analyze visible and invisible impacts of design changes'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'balance-finder',
|
|
102
|
+
version: '1.0.0',
|
|
103
|
+
description: 'Find balance between user experience and business needs'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'testability-integration',
|
|
107
|
+
version: '1.0.0',
|
|
108
|
+
description: 'Integrate with testability scoring for combined insights'
|
|
109
|
+
}
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Initialize QX analysis components
|
|
114
|
+
*/
|
|
115
|
+
async initializeComponents() {
|
|
116
|
+
try {
|
|
117
|
+
this.logger.info(`QXPartnerAgent ${this.agentId.id} initializing components`);
|
|
118
|
+
// Initialize heuristics engine
|
|
119
|
+
this.heuristicsEngine = new QXHeuristicsEngine(this.config.heuristics);
|
|
120
|
+
this.logger.info('QX Heuristics Engine initialized');
|
|
121
|
+
// Initialize oracle problem detector
|
|
122
|
+
if (this.config.detectOracleProblems) {
|
|
123
|
+
this.oracleDetector = new OracleDetector(this.config.minOracleSeverity || 'medium');
|
|
124
|
+
this.logger.info('Oracle Problem Detector initialized');
|
|
125
|
+
}
|
|
126
|
+
// Initialize impact analyzer
|
|
127
|
+
this.impactAnalyzer = new ImpactAnalyzer();
|
|
128
|
+
this.logger.info('Impact Analyzer initialized');
|
|
129
|
+
// Validate testability scoring integration
|
|
130
|
+
if (this.config.integrateTestability) {
|
|
131
|
+
await this.validateTestabilityScoringAvailability();
|
|
132
|
+
}
|
|
133
|
+
// Setup collaboration channels
|
|
134
|
+
if (this.config.collaboration) {
|
|
135
|
+
await this.setupCollaborationChannels();
|
|
136
|
+
}
|
|
137
|
+
this.logger.info(`QXPartnerAgent ${this.agentId.id} components initialized successfully`);
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
this.logger.error(`Failed to initialize QXPartnerAgent components:`, error);
|
|
141
|
+
throw new Error(`Component initialization failed: ${error.message}`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Load QX knowledge and historical patterns
|
|
146
|
+
*/
|
|
147
|
+
async loadKnowledge() {
|
|
148
|
+
try {
|
|
149
|
+
this.logger.info('Loading QX knowledge base');
|
|
150
|
+
// Load historical QX analyses
|
|
151
|
+
const historicalQX = await this.retrieveSharedMemory(types_1.QEAgentType.QX_PARTNER, 'historical-qx-analyses');
|
|
152
|
+
if (historicalQX) {
|
|
153
|
+
this.logger.info('Loaded historical QX analyses');
|
|
154
|
+
await this.storeMemory('qx-history', historicalQX);
|
|
155
|
+
}
|
|
156
|
+
// Load oracle problem patterns
|
|
157
|
+
const oraclePatterns = await this.retrieveMemory('oracle-patterns');
|
|
158
|
+
if (oraclePatterns) {
|
|
159
|
+
this.logger.info('Loaded oracle problem patterns');
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
await this.initializeDefaultOraclePatterns();
|
|
163
|
+
}
|
|
164
|
+
// Load UX heuristics knowledge
|
|
165
|
+
const heuristicsKnowledge = await this.retrieveMemory('heuristics-knowledge');
|
|
166
|
+
if (heuristicsKnowledge) {
|
|
167
|
+
this.logger.info('Loaded UX heuristics knowledge');
|
|
168
|
+
}
|
|
169
|
+
// Load collaboration insights from other agents
|
|
170
|
+
if (this.config.collaboration?.coordinateWithUX) {
|
|
171
|
+
const uxInsights = await this.retrieveSharedMemory(types_1.QEAgentType.VISUAL_TESTER, 'ux-insights');
|
|
172
|
+
if (uxInsights) {
|
|
173
|
+
this.logger.info('Loaded UX agent insights');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (this.config.collaboration?.coordinateWithQA) {
|
|
177
|
+
const qaInsights = await this.retrieveSharedMemory(types_1.QEAgentType.QUALITY_ANALYZER, 'qa-insights');
|
|
178
|
+
if (qaInsights) {
|
|
179
|
+
this.logger.info('Loaded QA agent insights');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
this.logger.info('QX knowledge loaded successfully');
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
this.logger.warn(`Failed to load some QX knowledge:`, error);
|
|
186
|
+
// Continue with default knowledge
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Clean up QX analysis resources
|
|
191
|
+
*/
|
|
192
|
+
async cleanup() {
|
|
193
|
+
try {
|
|
194
|
+
this.logger.info(`QXPartnerAgent ${this.agentId.id} cleaning up resources`);
|
|
195
|
+
// Save current QX analysis state
|
|
196
|
+
await this.saveQXState();
|
|
197
|
+
// Store learned patterns
|
|
198
|
+
await this.saveOraclePatterns();
|
|
199
|
+
await this.saveHeuristicsInsights();
|
|
200
|
+
// Share insights with collaborating agents
|
|
201
|
+
if (this.config.collaboration) {
|
|
202
|
+
await this.shareCollaborationInsights();
|
|
203
|
+
}
|
|
204
|
+
this.logger.info(`QXPartnerAgent ${this.agentId.id} cleanup completed`);
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
this.logger.error(`Error during QXPartnerAgent cleanup:`, error);
|
|
208
|
+
throw new Error(`Cleanup failed: ${error.message}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Perform QX analysis task
|
|
213
|
+
*/
|
|
214
|
+
async performTask(task) {
|
|
215
|
+
const params = task.payload;
|
|
216
|
+
const taskType = params.type;
|
|
217
|
+
this.logger.info(`Performing QX task: ${taskType} for target: ${params.target}`);
|
|
218
|
+
switch (taskType) {
|
|
219
|
+
case qx_1.QXTaskType.FULL_ANALYSIS:
|
|
220
|
+
return await this.performFullQXAnalysis(params);
|
|
221
|
+
case qx_1.QXTaskType.ORACLE_DETECTION:
|
|
222
|
+
return await this.detectOracleProblems(params);
|
|
223
|
+
case qx_1.QXTaskType.BALANCE_ANALYSIS:
|
|
224
|
+
return await this.analyzeUserBusinessBalance(params);
|
|
225
|
+
case qx_1.QXTaskType.IMPACT_ANALYSIS:
|
|
226
|
+
return await this.performImpactAnalysis(params);
|
|
227
|
+
case qx_1.QXTaskType.APPLY_HEURISTIC:
|
|
228
|
+
return await this.applySpecificHeuristic(params);
|
|
229
|
+
case qx_1.QXTaskType.GENERATE_RECOMMENDATIONS:
|
|
230
|
+
return await this.generateQXRecommendations(params);
|
|
231
|
+
case qx_1.QXTaskType.INTEGRATE_TESTABILITY:
|
|
232
|
+
return await this.integrateTestabilityScoring(params);
|
|
233
|
+
default:
|
|
234
|
+
throw new Error(`Unsupported QX task type: ${taskType}`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// ============================================================================
|
|
238
|
+
// QX Analysis Methods
|
|
239
|
+
// ============================================================================
|
|
240
|
+
/**
|
|
241
|
+
* Perform comprehensive QX analysis
|
|
242
|
+
*/
|
|
243
|
+
async performFullQXAnalysis(params) {
|
|
244
|
+
const startTime = Date.now();
|
|
245
|
+
const target = params.target;
|
|
246
|
+
this.logger.info(`Starting full QX analysis for: ${target}`);
|
|
247
|
+
// 1. Collect context
|
|
248
|
+
const context = await this.collectQXContext(target, params.params?.context);
|
|
249
|
+
// 2. Analyze problem
|
|
250
|
+
const problemAnalysis = await this.analyzeProblem(context);
|
|
251
|
+
// 3. Analyze user needs
|
|
252
|
+
const userNeeds = await this.analyzeUserNeeds(context, problemAnalysis);
|
|
253
|
+
// 4. Analyze business needs
|
|
254
|
+
const businessNeeds = await this.analyzeBusinessNeeds(context, problemAnalysis);
|
|
255
|
+
// 5. Detect oracle problems
|
|
256
|
+
const oracleProblems = this.config.detectOracleProblems
|
|
257
|
+
? await this.detectOracleProblemsFromContext(context, userNeeds, businessNeeds)
|
|
258
|
+
: [];
|
|
259
|
+
// 6. Perform impact analysis
|
|
260
|
+
const impactAnalysis = await this.analyzeImpact(context, problemAnalysis);
|
|
261
|
+
// 7. Apply heuristics
|
|
262
|
+
const heuristics = await this.applyAllHeuristics(context, problemAnalysis, userNeeds, businessNeeds);
|
|
263
|
+
// 8. Integrate testability (if enabled)
|
|
264
|
+
const testabilityIntegration = this.config.integrateTestability
|
|
265
|
+
? await this.integrateTestabilityScoring(params)
|
|
266
|
+
: undefined;
|
|
267
|
+
// 9. Generate recommendations
|
|
268
|
+
const recommendations = await this.generateRecommendations(problemAnalysis, userNeeds, businessNeeds, oracleProblems, impactAnalysis, heuristics, testabilityIntegration);
|
|
269
|
+
// 10. Calculate overall score
|
|
270
|
+
const overallScore = this.calculateOverallQXScore(problemAnalysis, userNeeds, businessNeeds, impactAnalysis, heuristics);
|
|
271
|
+
const grade = this.scoreToGrade(overallScore);
|
|
272
|
+
const analysis = {
|
|
273
|
+
overallScore,
|
|
274
|
+
grade,
|
|
275
|
+
timestamp: new Date(),
|
|
276
|
+
target,
|
|
277
|
+
problemAnalysis,
|
|
278
|
+
userNeeds,
|
|
279
|
+
businessNeeds,
|
|
280
|
+
oracleProblems,
|
|
281
|
+
impactAnalysis,
|
|
282
|
+
heuristics,
|
|
283
|
+
recommendations,
|
|
284
|
+
testabilityIntegration,
|
|
285
|
+
context
|
|
286
|
+
};
|
|
287
|
+
// Store analysis in memory
|
|
288
|
+
await this.storeMemory(`qx-analysis:${target}`, analysis);
|
|
289
|
+
const duration = Date.now() - startTime;
|
|
290
|
+
this.logger.info(`QX analysis completed in ${duration}ms. Score: ${overallScore}/100 (${grade})`);
|
|
291
|
+
return analysis;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Collect QX context from target
|
|
295
|
+
*/
|
|
296
|
+
async collectQXContext(target, additionalContext) {
|
|
297
|
+
this.logger.debug(`Collecting QX context for: ${target}`);
|
|
298
|
+
// In a real implementation, this would use Playwright or similar to analyze the target
|
|
299
|
+
// For now, we'll create a structure that can be filled by external tools
|
|
300
|
+
const context = {
|
|
301
|
+
url: target,
|
|
302
|
+
custom: additionalContext || {}
|
|
303
|
+
};
|
|
304
|
+
// Store context for later retrieval
|
|
305
|
+
await this.storeMemory(`qx-context:${target}`, context);
|
|
306
|
+
return context;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Analyze problem using Rule of Three and complexity assessment
|
|
310
|
+
*/
|
|
311
|
+
async analyzeProblem(_context) {
|
|
312
|
+
this.logger.debug('Analyzing problem');
|
|
313
|
+
// In real implementation, this would use NLP and pattern matching
|
|
314
|
+
// For now, return a structure that can be populated by external analysis
|
|
315
|
+
const analysis = {
|
|
316
|
+
problemStatement: 'Problem analysis pending',
|
|
317
|
+
complexity: 'moderate',
|
|
318
|
+
breakdown: [],
|
|
319
|
+
potentialFailures: [],
|
|
320
|
+
clarityScore: 50
|
|
321
|
+
};
|
|
322
|
+
return analysis;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Analyze user needs
|
|
326
|
+
*/
|
|
327
|
+
async analyzeUserNeeds(_context, _problemAnalysis) {
|
|
328
|
+
this.logger.debug('Analyzing user needs');
|
|
329
|
+
const analysis = {
|
|
330
|
+
needs: [],
|
|
331
|
+
suitability: 'adequate',
|
|
332
|
+
challenges: [],
|
|
333
|
+
alignmentScore: 70
|
|
334
|
+
};
|
|
335
|
+
return analysis;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Analyze business needs
|
|
339
|
+
*/
|
|
340
|
+
async analyzeBusinessNeeds(_context, _problemAnalysis) {
|
|
341
|
+
this.logger.debug('Analyzing business needs');
|
|
342
|
+
const analysis = {
|
|
343
|
+
primaryGoal: 'balanced',
|
|
344
|
+
kpisAffected: [],
|
|
345
|
+
crossTeamImpact: [],
|
|
346
|
+
compromisesUX: false,
|
|
347
|
+
impactsKPIs: false,
|
|
348
|
+
alignmentScore: 70
|
|
349
|
+
};
|
|
350
|
+
return analysis;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Detect oracle problems from analysis context
|
|
354
|
+
*/
|
|
355
|
+
async detectOracleProblemsFromContext(context, userNeeds, businessNeeds) {
|
|
356
|
+
if (!this.oracleDetector) {
|
|
357
|
+
return [];
|
|
358
|
+
}
|
|
359
|
+
return this.oracleDetector.detect(context, userNeeds, businessNeeds);
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Perform impact analysis
|
|
363
|
+
*/
|
|
364
|
+
async analyzeImpact(context, problemAnalysis) {
|
|
365
|
+
if (!this.impactAnalyzer) {
|
|
366
|
+
throw new Error('Impact analyzer not initialized');
|
|
367
|
+
}
|
|
368
|
+
return this.impactAnalyzer.analyze(context, problemAnalysis);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Apply all enabled heuristics
|
|
372
|
+
*/
|
|
373
|
+
async applyAllHeuristics(context, problemAnalysis, userNeeds, businessNeeds) {
|
|
374
|
+
if (!this.heuristicsEngine) {
|
|
375
|
+
throw new Error('Heuristics engine not initialized');
|
|
376
|
+
}
|
|
377
|
+
return this.heuristicsEngine.applyAll(context, problemAnalysis, userNeeds, businessNeeds);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Generate QX recommendations
|
|
381
|
+
*/
|
|
382
|
+
async generateRecommendations(problemAnalysis, userNeeds, businessNeeds, oracleProblems, impactAnalysis, heuristics, _testabilityIntegration) {
|
|
383
|
+
const recommendations = [];
|
|
384
|
+
// Generate recommendations from problem analysis
|
|
385
|
+
if (problemAnalysis.clarityScore < (this.config.thresholds?.minProblemClarity || 60)) {
|
|
386
|
+
recommendations.push({
|
|
387
|
+
principle: 'Problem Clarity',
|
|
388
|
+
recommendation: 'Improve problem statement clarity and breakdown',
|
|
389
|
+
severity: 'high',
|
|
390
|
+
impact: 100 - problemAnalysis.clarityScore,
|
|
391
|
+
effort: 'medium',
|
|
392
|
+
priority: 1,
|
|
393
|
+
category: 'qx'
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
// Generate recommendations from user needs
|
|
397
|
+
if (userNeeds.alignmentScore < (this.config.thresholds?.minUserNeedsAlignment || 70)) {
|
|
398
|
+
recommendations.push({
|
|
399
|
+
principle: 'User Needs Alignment',
|
|
400
|
+
recommendation: 'Better align solution with user needs',
|
|
401
|
+
severity: 'high',
|
|
402
|
+
impact: 100 - userNeeds.alignmentScore,
|
|
403
|
+
effort: 'high',
|
|
404
|
+
priority: 2,
|
|
405
|
+
category: 'ux'
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
// Generate recommendations from business needs
|
|
409
|
+
if (businessNeeds.alignmentScore < (this.config.thresholds?.minBusinessAlignment || 70)) {
|
|
410
|
+
recommendations.push({
|
|
411
|
+
principle: 'Business Alignment',
|
|
412
|
+
recommendation: 'Improve alignment with business objectives',
|
|
413
|
+
severity: 'medium',
|
|
414
|
+
impact: 100 - businessNeeds.alignmentScore,
|
|
415
|
+
effort: 'medium',
|
|
416
|
+
priority: 3,
|
|
417
|
+
category: 'qx'
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
// Generate recommendations from oracle problems
|
|
421
|
+
for (const problem of oracleProblems) {
|
|
422
|
+
if (problem.severity === 'high' || problem.severity === 'critical') {
|
|
423
|
+
recommendations.push({
|
|
424
|
+
principle: 'Oracle Problem',
|
|
425
|
+
recommendation: `Resolve: ${problem.description}`,
|
|
426
|
+
severity: problem.severity,
|
|
427
|
+
impact: 80,
|
|
428
|
+
effort: 'high',
|
|
429
|
+
priority: problem.severity === 'critical' ? 1 : 2,
|
|
430
|
+
category: 'qa'
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
// Generate recommendations from heuristics
|
|
435
|
+
for (const heuristic of heuristics) {
|
|
436
|
+
for (const issue of heuristic.issues) {
|
|
437
|
+
if (issue.severity === 'high' || issue.severity === 'critical') {
|
|
438
|
+
recommendations.push({
|
|
439
|
+
principle: heuristic.name,
|
|
440
|
+
recommendation: issue.description,
|
|
441
|
+
severity: issue.severity,
|
|
442
|
+
impact: 100 - heuristic.score,
|
|
443
|
+
effort: 'medium',
|
|
444
|
+
priority: 4,
|
|
445
|
+
category: 'design'
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
// Sort by priority and impact
|
|
451
|
+
recommendations.sort((a, b) => {
|
|
452
|
+
if (a.priority !== b.priority)
|
|
453
|
+
return a.priority - b.priority;
|
|
454
|
+
return b.impact - a.impact;
|
|
455
|
+
});
|
|
456
|
+
return recommendations;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Calculate overall QX score
|
|
460
|
+
*/
|
|
461
|
+
calculateOverallQXScore(problemAnalysis, userNeeds, businessNeeds, impactAnalysis, heuristics) {
|
|
462
|
+
// Weighted average of all components
|
|
463
|
+
const weights = {
|
|
464
|
+
problem: 0.20,
|
|
465
|
+
userNeeds: 0.25,
|
|
466
|
+
businessNeeds: 0.20,
|
|
467
|
+
impact: 0.15,
|
|
468
|
+
heuristics: 0.20
|
|
469
|
+
};
|
|
470
|
+
const heuristicsAvg = heuristics.length > 0
|
|
471
|
+
? heuristics.reduce((sum, h) => sum + h.score, 0) / heuristics.length
|
|
472
|
+
: 70;
|
|
473
|
+
const impactScore = Math.max(0, 100 - impactAnalysis.overallImpactScore);
|
|
474
|
+
const score = problemAnalysis.clarityScore * weights.problem +
|
|
475
|
+
userNeeds.alignmentScore * weights.userNeeds +
|
|
476
|
+
businessNeeds.alignmentScore * weights.businessNeeds +
|
|
477
|
+
impactScore * weights.impact +
|
|
478
|
+
heuristicsAvg * weights.heuristics;
|
|
479
|
+
return Math.round(score);
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Convert score to grade
|
|
483
|
+
*/
|
|
484
|
+
scoreToGrade(score) {
|
|
485
|
+
if (score >= 90)
|
|
486
|
+
return 'A';
|
|
487
|
+
if (score >= 80)
|
|
488
|
+
return 'B';
|
|
489
|
+
if (score >= 70)
|
|
490
|
+
return 'C';
|
|
491
|
+
if (score >= 60)
|
|
492
|
+
return 'D';
|
|
493
|
+
return 'F';
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Detect oracle problems (separate task)
|
|
497
|
+
*/
|
|
498
|
+
async detectOracleProblems(params) {
|
|
499
|
+
const context = await this.collectQXContext(params.target, params.params?.context);
|
|
500
|
+
const problemAnalysis = await this.analyzeProblem(context);
|
|
501
|
+
const userNeeds = await this.analyzeUserNeeds(context, problemAnalysis);
|
|
502
|
+
const businessNeeds = await this.analyzeBusinessNeeds(context, problemAnalysis);
|
|
503
|
+
return this.detectOracleProblemsFromContext(context, userNeeds, businessNeeds);
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Analyze user vs business balance
|
|
507
|
+
*/
|
|
508
|
+
async analyzeUserBusinessBalance(params) {
|
|
509
|
+
const context = await this.collectQXContext(params.target, params.params?.context);
|
|
510
|
+
const problemAnalysis = await this.analyzeProblem(context);
|
|
511
|
+
const userNeeds = await this.analyzeUserNeeds(context, problemAnalysis);
|
|
512
|
+
const businessNeeds = await this.analyzeBusinessNeeds(context, problemAnalysis);
|
|
513
|
+
return {
|
|
514
|
+
userNeeds,
|
|
515
|
+
businessNeeds,
|
|
516
|
+
balance: {
|
|
517
|
+
favorsUser: userNeeds.alignmentScore > businessNeeds.alignmentScore,
|
|
518
|
+
favorsBusiness: businessNeeds.alignmentScore > userNeeds.alignmentScore,
|
|
519
|
+
isBalanced: Math.abs(userNeeds.alignmentScore - businessNeeds.alignmentScore) < 10,
|
|
520
|
+
recommendation: this.getBalanceRecommendation(userNeeds, businessNeeds)
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
getBalanceRecommendation(userNeeds, businessNeeds) {
|
|
525
|
+
const diff = userNeeds.alignmentScore - businessNeeds.alignmentScore;
|
|
526
|
+
if (Math.abs(diff) < 10) {
|
|
527
|
+
return 'Good balance between user and business needs';
|
|
528
|
+
}
|
|
529
|
+
else if (diff > 0) {
|
|
530
|
+
return 'Consider business objectives more to achieve better balance';
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
return 'Consider user needs more to achieve better balance';
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Perform impact analysis (separate task)
|
|
538
|
+
*/
|
|
539
|
+
async performImpactAnalysis(params) {
|
|
540
|
+
const context = await this.collectQXContext(params.target, params.params?.context);
|
|
541
|
+
const problemAnalysis = await this.analyzeProblem(context);
|
|
542
|
+
return this.analyzeImpact(context, problemAnalysis);
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Apply specific heuristic
|
|
546
|
+
*/
|
|
547
|
+
async applySpecificHeuristic(params) {
|
|
548
|
+
if (!params.params?.heuristic) {
|
|
549
|
+
throw new Error('Heuristic parameter is required');
|
|
550
|
+
}
|
|
551
|
+
const context = await this.collectQXContext(params.target, params.params?.context);
|
|
552
|
+
const problemAnalysis = await this.analyzeProblem(context);
|
|
553
|
+
const userNeeds = await this.analyzeUserNeeds(context, problemAnalysis);
|
|
554
|
+
const businessNeeds = await this.analyzeBusinessNeeds(context, problemAnalysis);
|
|
555
|
+
if (!this.heuristicsEngine) {
|
|
556
|
+
throw new Error('Heuristics engine not initialized');
|
|
557
|
+
}
|
|
558
|
+
return this.heuristicsEngine.apply(params.params.heuristic, context, problemAnalysis, userNeeds, businessNeeds);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Generate QX recommendations (separate task)
|
|
562
|
+
*/
|
|
563
|
+
async generateQXRecommendations(params) {
|
|
564
|
+
const analysis = await this.performFullQXAnalysis(params);
|
|
565
|
+
return analysis.recommendations;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Integrate with testability scoring
|
|
569
|
+
*/
|
|
570
|
+
async integrateTestabilityScoring(_params) {
|
|
571
|
+
if (!this.config.integrateTestability) {
|
|
572
|
+
return undefined;
|
|
573
|
+
}
|
|
574
|
+
this.logger.debug('Integrating with testability scoring');
|
|
575
|
+
// In real implementation, this would invoke the testability-scoring skill
|
|
576
|
+
// For now, return a placeholder structure
|
|
577
|
+
const integration = {
|
|
578
|
+
qxRelation: [
|
|
579
|
+
'Testability affects QX through observability and controllability',
|
|
580
|
+
'High testability scores typically correlate with better QX scores'
|
|
581
|
+
],
|
|
582
|
+
combinedInsights: [
|
|
583
|
+
'Consider testability principles in QX analysis',
|
|
584
|
+
'Low observability impacts both testing and user experience'
|
|
585
|
+
]
|
|
586
|
+
};
|
|
587
|
+
return integration;
|
|
588
|
+
}
|
|
589
|
+
// ============================================================================
|
|
590
|
+
// Helper Methods
|
|
591
|
+
// ============================================================================
|
|
592
|
+
async validateTestabilityScoringAvailability() {
|
|
593
|
+
this.logger.debug('Validating testability scoring availability');
|
|
594
|
+
// In real implementation, check if the skill exists and is accessible
|
|
595
|
+
}
|
|
596
|
+
async setupCollaborationChannels() {
|
|
597
|
+
this.logger.debug('Setting up collaboration channels');
|
|
598
|
+
if (this.config.collaboration?.coordinateWithUX) {
|
|
599
|
+
this.logger.info('Collaboration with UX agents enabled');
|
|
600
|
+
}
|
|
601
|
+
if (this.config.collaboration?.coordinateWithQA) {
|
|
602
|
+
this.logger.info('Collaboration with QA agents enabled');
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
async initializeDefaultOraclePatterns() {
|
|
606
|
+
const defaultPatterns = {
|
|
607
|
+
patterns: [
|
|
608
|
+
'Revenue vs User Experience conflict',
|
|
609
|
+
'Technical constraints vs User expectations',
|
|
610
|
+
'Business deadlines vs Quality requirements'
|
|
611
|
+
]
|
|
612
|
+
};
|
|
613
|
+
await this.storeMemory('oracle-patterns', defaultPatterns);
|
|
614
|
+
}
|
|
615
|
+
async saveQXState() {
|
|
616
|
+
// Save current state for future reference
|
|
617
|
+
const state = {
|
|
618
|
+
lastAnalysis: new Date(),
|
|
619
|
+
analysisCount: this.performanceMetrics.tasksCompleted
|
|
620
|
+
};
|
|
621
|
+
await this.storeMemory('qx-state', state);
|
|
622
|
+
}
|
|
623
|
+
async saveOraclePatterns() {
|
|
624
|
+
// Save learned oracle patterns
|
|
625
|
+
const patterns = await this.retrieveMemory('oracle-patterns');
|
|
626
|
+
if (patterns) {
|
|
627
|
+
await this.storeSharedMemory(types_1.QEAgentType.QX_PARTNER, 'oracle-patterns', patterns);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
async saveHeuristicsInsights() {
|
|
631
|
+
// Save heuristics insights for other agents
|
|
632
|
+
const insights = await this.retrieveMemory('heuristics-knowledge');
|
|
633
|
+
if (insights) {
|
|
634
|
+
await this.storeSharedMemory(types_1.QEAgentType.QX_PARTNER, 'heuristics-insights', insights);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
async shareCollaborationInsights() {
|
|
638
|
+
if (this.config.collaboration?.shareWithQualityAnalyzer) {
|
|
639
|
+
const qxInsights = await this.retrieveMemory('qx-state');
|
|
640
|
+
if (qxInsights) {
|
|
641
|
+
await this.storeSharedMemory(types_1.QEAgentType.QUALITY_ANALYZER, 'qx-insights', qxInsights);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
async onPreInitialization() {
|
|
646
|
+
this.logger.info(`QXPartnerAgent initializing in ${this.config.analysisMode} mode`);
|
|
647
|
+
}
|
|
648
|
+
async onPostInitialization() {
|
|
649
|
+
this.logger.info(`QXPartnerAgent ready for QX analysis`);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
exports.QXPartnerAgent = QXPartnerAgent;
|
|
653
|
+
// ============================================================================
|
|
654
|
+
// Helper Classes
|
|
655
|
+
// ============================================================================
|
|
656
|
+
/**
|
|
657
|
+
* QX Heuristics Engine
|
|
658
|
+
*/
|
|
659
|
+
class QXHeuristicsEngine {
|
|
660
|
+
constructor(config) {
|
|
661
|
+
this.config = config;
|
|
662
|
+
}
|
|
663
|
+
async applyAll(_context, _problemAnalysis, _userNeeds, _businessNeeds) {
|
|
664
|
+
const results = [];
|
|
665
|
+
for (const heuristic of this.config.enabledHeuristics) {
|
|
666
|
+
const result = await this.apply(heuristic, _context, _problemAnalysis, _userNeeds, _businessNeeds);
|
|
667
|
+
results.push(result);
|
|
668
|
+
}
|
|
669
|
+
return results;
|
|
670
|
+
}
|
|
671
|
+
async apply(heuristic, _context, _problemAnalysis, _userNeeds, _businessNeeds) {
|
|
672
|
+
// Simplified heuristic application
|
|
673
|
+
// In real implementation, each heuristic would have specific logic
|
|
674
|
+
return {
|
|
675
|
+
name: heuristic,
|
|
676
|
+
category: this.getHeuristicCategory(heuristic),
|
|
677
|
+
applied: true,
|
|
678
|
+
score: 75, // Placeholder
|
|
679
|
+
findings: [],
|
|
680
|
+
issues: [],
|
|
681
|
+
recommendations: []
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
getHeuristicCategory(heuristic) {
|
|
685
|
+
if (heuristic.includes('problem'))
|
|
686
|
+
return 'problem';
|
|
687
|
+
if (heuristic.includes('user'))
|
|
688
|
+
return 'user-needs';
|
|
689
|
+
if (heuristic.includes('business'))
|
|
690
|
+
return 'business-needs';
|
|
691
|
+
if (heuristic.includes('oracle') || heuristic.includes('balance'))
|
|
692
|
+
return 'balance';
|
|
693
|
+
if (heuristic.includes('impact'))
|
|
694
|
+
return 'impact';
|
|
695
|
+
if (heuristic.includes('competitive') || heuristic.includes('inspiration'))
|
|
696
|
+
return 'creativity';
|
|
697
|
+
return 'design';
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Oracle Problem Detector
|
|
702
|
+
*/
|
|
703
|
+
class OracleDetector {
|
|
704
|
+
constructor(minSeverity) {
|
|
705
|
+
this.minSeverity = minSeverity;
|
|
706
|
+
}
|
|
707
|
+
detect(context, userNeeds, businessNeeds) {
|
|
708
|
+
const problems = [];
|
|
709
|
+
// Check for user vs business conflicts
|
|
710
|
+
if (Math.abs(userNeeds.alignmentScore - businessNeeds.alignmentScore) > 20) {
|
|
711
|
+
problems.push({
|
|
712
|
+
type: 'user-vs-business',
|
|
713
|
+
description: 'Significant gap between user needs and business objectives',
|
|
714
|
+
severity: 'high',
|
|
715
|
+
stakeholders: ['Users', 'Business'],
|
|
716
|
+
resolutionApproach: [
|
|
717
|
+
'Gather supporting data from both perspectives',
|
|
718
|
+
'Facilitate discussion between stakeholders',
|
|
719
|
+
'Find compromise solutions that address both needs'
|
|
720
|
+
]
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
// Check for missing information
|
|
724
|
+
if (userNeeds.challenges.length > 0 || businessNeeds.compromisesUX) {
|
|
725
|
+
problems.push({
|
|
726
|
+
type: 'unclear-criteria',
|
|
727
|
+
description: 'Quality criteria unclear due to conflicting information',
|
|
728
|
+
severity: 'medium',
|
|
729
|
+
missingInfo: userNeeds.challenges,
|
|
730
|
+
resolutionApproach: [
|
|
731
|
+
'Collect missing information from stakeholders',
|
|
732
|
+
'Define clear acceptance criteria'
|
|
733
|
+
]
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
return problems.filter(p => this.meetsMinimumSeverity(p.severity));
|
|
737
|
+
}
|
|
738
|
+
meetsMinimumSeverity(severity) {
|
|
739
|
+
const severityLevels = ['low', 'medium', 'high', 'critical'];
|
|
740
|
+
const minIndex = severityLevels.indexOf(this.minSeverity);
|
|
741
|
+
const currentIndex = severityLevels.indexOf(severity);
|
|
742
|
+
return currentIndex >= minIndex;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Impact Analyzer
|
|
747
|
+
*/
|
|
748
|
+
class ImpactAnalyzer {
|
|
749
|
+
async analyze(_context, _problemAnalysis) {
|
|
750
|
+
// Simplified impact analysis
|
|
751
|
+
// In real implementation, this would perform deep analysis
|
|
752
|
+
return {
|
|
753
|
+
visible: {
|
|
754
|
+
guiFlow: {
|
|
755
|
+
forEndUser: [],
|
|
756
|
+
forInternalUser: []
|
|
757
|
+
},
|
|
758
|
+
userFeelings: []
|
|
759
|
+
},
|
|
760
|
+
invisible: {
|
|
761
|
+
performance: [],
|
|
762
|
+
security: []
|
|
763
|
+
},
|
|
764
|
+
immutableRequirements: [],
|
|
765
|
+
overallImpactScore: 30 // Lower is better
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
//# sourceMappingURL=QXPartnerAgent.js.map
|