agentic-qe 1.3.2 → 1.3.4
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 +20 -0
- package/.claude/agents/qe-chaos-engineer.md +20 -0
- package/.claude/agents/qe-coverage-analyzer.md +21 -0
- package/.claude/agents/qe-deployment-readiness.md +20 -0
- package/.claude/agents/qe-flaky-test-hunter.md +20 -0
- package/.claude/agents/qe-fleet-commander.md +20 -0
- package/.claude/agents/qe-performance-tester.md +21 -0
- package/.claude/agents/qe-production-intelligence.md +20 -0
- package/.claude/agents/qe-quality-analyzer.md +20 -0
- package/.claude/agents/qe-quality-gate.md +20 -0
- package/.claude/agents/qe-regression-risk-analyzer.md +20 -0
- package/.claude/agents/qe-requirements-validator.md +20 -0
- package/.claude/agents/qe-security-scanner.md +21 -0
- package/.claude/agents/qe-test-data-architect.md +19 -0
- package/.claude/agents/qe-test-executor.md +20 -0
- package/.claude/agents/qe-test-generator.md +22 -0
- package/.claude/agents/qe-visual-tester.md +22 -0
- package/CHANGELOG.md +114 -0
- package/README.md +322 -991
- package/README.md.backup-20251026 +1366 -0
- package/bin/aqe-mcp +65 -0
- package/dist/agents/BaseAgent.js +1 -1
- package/dist/agents/BaseAgent.js.map +1 -1
- package/dist/agents/CoverageAnalyzerAgent.js +16 -16
- package/dist/agents/CoverageAnalyzerAgent.js.map +1 -1
- package/dist/agents/FlakyTestHunterAgent.js +1 -1
- package/dist/agents/FlakyTestHunterAgent.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +71 -37
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/core/memory/EnhancedAgentDBService.d.ts +127 -0
- package/dist/core/memory/EnhancedAgentDBService.d.ts.map +1 -0
- package/dist/core/memory/EnhancedAgentDBService.js +298 -0
- package/dist/core/memory/EnhancedAgentDBService.js.map +1 -0
- package/dist/core/neural/NeuralTrainer.js +2 -2
- package/dist/core/neural/NeuralTrainer.js.map +1 -1
- package/dist/learning/FixRecommendationEngine.d.ts +68 -0
- package/dist/learning/FixRecommendationEngine.d.ts.map +1 -0
- package/dist/learning/FixRecommendationEngine.js +500 -0
- package/dist/learning/FixRecommendationEngine.js.map +1 -0
- package/dist/learning/FlakyTestDetector.d.ts +19 -0
- package/dist/learning/FlakyTestDetector.d.ts.map +1 -1
- package/dist/learning/FlakyTestDetector.js +121 -2
- package/dist/learning/FlakyTestDetector.js.map +1 -1
- package/dist/learning/index.d.ts +2 -0
- package/dist/learning/index.d.ts.map +1 -1
- package/dist/learning/index.js +5 -0
- package/dist/learning/index.js.map +1 -1
- package/dist/learning/types.d.ts +11 -0
- package/dist/learning/types.d.ts.map +1 -1
- package/dist/reasoning/PatternQualityScorer.d.ts +134 -0
- package/dist/reasoning/PatternQualityScorer.d.ts.map +1 -0
- package/dist/reasoning/PatternQualityScorer.js +340 -0
- package/dist/reasoning/PatternQualityScorer.js.map +1 -0
- package/dist/reasoning/QEReasoningBank.d.ts +51 -4
- package/dist/reasoning/QEReasoningBank.d.ts.map +1 -1
- package/dist/reasoning/QEReasoningBank.js +173 -11
- package/dist/reasoning/QEReasoningBank.js.map +1 -1
- package/dist/reasoning/VectorSimilarity.d.ts +131 -0
- package/dist/reasoning/VectorSimilarity.d.ts.map +1 -0
- package/dist/reasoning/VectorSimilarity.js +250 -0
- package/dist/reasoning/VectorSimilarity.js.map +1 -0
- package/dist/reasoning/index.d.ts +8 -1
- package/dist/reasoning/index.d.ts.map +1 -1
- package/dist/reasoning/index.js +13 -2
- package/dist/reasoning/index.js.map +1 -1
- package/dist/streaming/BaseStreamHandler.d.ts +89 -0
- package/dist/streaming/BaseStreamHandler.d.ts.map +1 -0
- package/dist/streaming/BaseStreamHandler.js +168 -0
- package/dist/streaming/BaseStreamHandler.js.map +1 -0
- package/dist/streaming/TestGenerateStreamHandler.d.ts +103 -0
- package/dist/streaming/TestGenerateStreamHandler.d.ts.map +1 -0
- package/dist/streaming/TestGenerateStreamHandler.js +321 -0
- package/dist/streaming/TestGenerateStreamHandler.js.map +1 -0
- package/dist/streaming/index.d.ts +16 -0
- package/dist/streaming/index.d.ts.map +1 -0
- package/dist/streaming/index.js +39 -0
- package/dist/streaming/index.js.map +1 -0
- package/dist/utils/Database.d.ts.map +1 -1
- package/dist/utils/Database.js +15 -1
- package/dist/utils/Database.js.map +1 -1
- package/dist/utils/__mocks__/Logger.d.ts +26 -0
- package/dist/utils/__mocks__/Logger.d.ts.map +1 -0
- package/dist/utils/__mocks__/Logger.js +42 -0
- package/dist/utils/__mocks__/Logger.js.map +1 -0
- package/package.json +19 -6
- package/dist/agents/mixins/NeuralCapableMixin.d.ts +0 -130
- package/dist/agents/mixins/NeuralCapableMixin.d.ts.map +0 -1
- package/dist/agents/mixins/NeuralCapableMixin.js +0 -358
- package/dist/agents/mixins/NeuralCapableMixin.js.map +0 -1
- package/dist/agents/mixins/QUICCapableMixin.d.ts +0 -34
- package/dist/agents/mixins/QUICCapableMixin.d.ts.map +0 -1
- package/dist/agents/mixins/QUICCapableMixin.js +0 -346
- package/dist/agents/mixins/QUICCapableMixin.js.map +0 -1
- package/dist/core/security/CertificateValidator.d.ts +0 -130
- package/dist/core/security/CertificateValidator.d.ts.map +0 -1
- package/dist/core/security/CertificateValidator.js +0 -376
- package/dist/core/security/CertificateValidator.js.map +0 -1
- package/dist/core/transport/QUICTransport.d.ts +0 -62
- package/dist/core/transport/QUICTransport.d.ts.map +0 -1
- package/dist/core/transport/QUICTransport.js +0 -381
- package/dist/core/transport/QUICTransport.js.map +0 -1
- package/dist/core/transport/SecureQUICTransport.d.ts +0 -71
- package/dist/core/transport/SecureQUICTransport.d.ts.map +0 -1
- package/dist/core/transport/SecureQUICTransport.js +0 -253
- package/dist/core/transport/SecureQUICTransport.js.map +0 -1
- package/dist/learning/AdvancedFeatureExtractor.d.ts +0 -123
- package/dist/learning/AdvancedFeatureExtractor.d.ts.map +0 -1
- package/dist/learning/AdvancedFeatureExtractor.js +0 -423
- package/dist/learning/AdvancedFeatureExtractor.js.map +0 -1
- package/dist/learning/NeuralPatternMatcher.d.ts +0 -184
- package/dist/learning/NeuralPatternMatcher.d.ts.map +0 -1
- package/dist/learning/NeuralPatternMatcher.js +0 -702
- package/dist/learning/NeuralPatternMatcher.js.map +0 -1
- package/dist/learning/NeuralTrainer.d.ts +0 -209
- package/dist/learning/NeuralTrainer.d.ts.map +0 -1
- package/dist/learning/NeuralTrainer.js +0 -478
- package/dist/learning/NeuralTrainer.js.map +0 -1
- package/dist/transport/QUICTransport.d.ts +0 -340
- package/dist/transport/QUICTransport.d.ts.map +0 -1
- package/dist/transport/QUICTransport.js +0 -814
- package/dist/transport/QUICTransport.js.map +0 -1
- package/dist/transport/UDPTransport.d.ts +0 -348
- package/dist/transport/UDPTransport.d.ts.map +0 -1
- package/dist/transport/UDPTransport.js +0 -820
- package/dist/transport/UDPTransport.js.map +0 -1
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Advanced Feature Extractor for Neural Pattern Matching
|
|
4
|
-
*
|
|
5
|
-
* Extracts 25+ advanced features from test results including:
|
|
6
|
-
* - Statistical features (skewness, kurtosis, trend slope)
|
|
7
|
-
* - Pattern features (flip-flop, gradual degradation, environment sensitivity)
|
|
8
|
-
* - Temporal features (seasonality, autocorrelation, clustering)
|
|
9
|
-
* - Quality features (outlier frequency, stability metrics)
|
|
10
|
-
*
|
|
11
|
-
* Target: Improve model accuracy from 65% to 85%+
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.AdvancedFeatureExtractor = void 0;
|
|
15
|
-
class AdvancedFeatureExtractor {
|
|
16
|
-
/**
|
|
17
|
-
* Extract all 33 features from test results
|
|
18
|
-
*/
|
|
19
|
-
static extractFeatures(results) {
|
|
20
|
-
if (results.length === 0) {
|
|
21
|
-
return this.getZeroFeatures();
|
|
22
|
-
}
|
|
23
|
-
// Extract basic features
|
|
24
|
-
const durations = results.map(r => r.duration);
|
|
25
|
-
const passRate = results.filter(r => r.passed).length / results.length;
|
|
26
|
-
const meanDuration = this.calculateMean(durations);
|
|
27
|
-
const variance = this.calculateVariance(durations);
|
|
28
|
-
const stdDev = Math.sqrt(variance);
|
|
29
|
-
// Build feature vector
|
|
30
|
-
return {
|
|
31
|
-
// Basic features (12)
|
|
32
|
-
passRate,
|
|
33
|
-
failureRate: 1 - passRate,
|
|
34
|
-
meanDuration,
|
|
35
|
-
variance,
|
|
36
|
-
stdDev,
|
|
37
|
-
coefficientOfVariation: meanDuration > 0 ? stdDev / meanDuration : 0,
|
|
38
|
-
minDuration: Math.min(...durations),
|
|
39
|
-
maxDuration: Math.max(...durations),
|
|
40
|
-
durationRange: Math.max(...durations) - Math.min(...durations),
|
|
41
|
-
retryRate: this.calculateRetryRate(results),
|
|
42
|
-
sampleSize: results.length,
|
|
43
|
-
dataQuality: this.calculateDataQuality(results),
|
|
44
|
-
// Advanced statistical features (6)
|
|
45
|
-
skewness: this.calculateSkewness(durations, meanDuration, stdDev),
|
|
46
|
-
kurtosis: this.calculateKurtosis(durations, meanDuration, stdDev),
|
|
47
|
-
trendSlope: this.calculateTrendSlope(results),
|
|
48
|
-
seasonality: this.detectSeasonality(durations),
|
|
49
|
-
autocorrelation: this.calculateAutocorrelation(durations),
|
|
50
|
-
outlierFrequency: this.detectOutlierFrequency(durations),
|
|
51
|
-
// Advanced pattern features (7)
|
|
52
|
-
flipFlopScore: this.detectFlipFlopPattern(results),
|
|
53
|
-
gradualDegradationScore: this.detectGradualDegradation(results),
|
|
54
|
-
environmentSensitivityScore: this.detectEnvironmentSensitivity(results),
|
|
55
|
-
resourceContentionScore: this.detectResourceContention(results),
|
|
56
|
-
timingDependencyScore: this.detectTimingDependency(results),
|
|
57
|
-
dataDependencyScore: this.detectDataDependency(results),
|
|
58
|
-
concurrencyIssuesScore: this.detectConcurrencyIssues(results),
|
|
59
|
-
// Additional quality metrics (2)
|
|
60
|
-
temporalClustering: this.detectTemporalClustering(results),
|
|
61
|
-
environmentVariability: this.detectEnvironmentVariability(results)
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Convert features to normalized array for neural network input
|
|
66
|
-
*/
|
|
67
|
-
static featuresToArray(features) {
|
|
68
|
-
return [
|
|
69
|
-
// Normalize each feature to [0, 1] range
|
|
70
|
-
features.passRate,
|
|
71
|
-
features.failureRate,
|
|
72
|
-
Math.min(features.meanDuration / 1000, 1), // Cap at 1000ms
|
|
73
|
-
Math.min(features.variance / 10000, 1), // Cap at 10000
|
|
74
|
-
Math.min(features.stdDev / 100, 1),
|
|
75
|
-
Math.min(features.coefficientOfVariation, 1),
|
|
76
|
-
Math.min(features.minDuration / 1000, 1),
|
|
77
|
-
Math.min(features.maxDuration / 1000, 1),
|
|
78
|
-
Math.min(features.durationRange / 1000, 1),
|
|
79
|
-
features.retryRate,
|
|
80
|
-
Math.min(features.sampleSize / 100, 1), // Normalize to 100 samples
|
|
81
|
-
features.dataQuality,
|
|
82
|
-
this.normalizeScore(features.skewness),
|
|
83
|
-
this.normalizeScore(features.kurtosis),
|
|
84
|
-
this.normalizeScore(features.trendSlope),
|
|
85
|
-
features.seasonality,
|
|
86
|
-
this.normalizeScore(features.autocorrelation),
|
|
87
|
-
features.outlierFrequency,
|
|
88
|
-
features.flipFlopScore,
|
|
89
|
-
features.gradualDegradationScore,
|
|
90
|
-
features.environmentSensitivityScore,
|
|
91
|
-
features.resourceContentionScore,
|
|
92
|
-
features.timingDependencyScore,
|
|
93
|
-
features.dataDependencyScore,
|
|
94
|
-
features.concurrencyIssuesScore,
|
|
95
|
-
features.temporalClustering,
|
|
96
|
-
features.environmentVariability
|
|
97
|
-
];
|
|
98
|
-
}
|
|
99
|
-
// ============================================================================
|
|
100
|
-
// Advanced Statistical Features
|
|
101
|
-
// ============================================================================
|
|
102
|
-
/**
|
|
103
|
-
* Calculate skewness (asymmetry of distribution)
|
|
104
|
-
*/
|
|
105
|
-
static calculateSkewness(values, mean, stdDev) {
|
|
106
|
-
if (values.length < 3 || stdDev === 0)
|
|
107
|
-
return 0;
|
|
108
|
-
const n = values.length;
|
|
109
|
-
const sum = values.reduce((acc, v) => acc + Math.pow((v - mean) / stdDev, 3), 0);
|
|
110
|
-
return (n / ((n - 1) * (n - 2))) * sum;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Calculate kurtosis (tailedness of distribution)
|
|
114
|
-
*/
|
|
115
|
-
static calculateKurtosis(values, mean, stdDev) {
|
|
116
|
-
if (values.length < 4 || stdDev === 0)
|
|
117
|
-
return 0;
|
|
118
|
-
const n = values.length;
|
|
119
|
-
const sum = values.reduce((acc, v) => acc + Math.pow((v - mean) / stdDev, 4), 0);
|
|
120
|
-
const kurtosis = ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sum;
|
|
121
|
-
const correction = (3 * Math.pow(n - 1, 2)) / ((n - 2) * (n - 3));
|
|
122
|
-
return kurtosis - correction;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Calculate trend slope (improving or degrading over time)
|
|
126
|
-
*/
|
|
127
|
-
static calculateTrendSlope(results) {
|
|
128
|
-
if (results.length < 3)
|
|
129
|
-
return 0;
|
|
130
|
-
const sorted = [...results].sort((a, b) => a.timestamp - b.timestamp);
|
|
131
|
-
const halfPoint = Math.floor(sorted.length / 2);
|
|
132
|
-
const firstHalfPassRate = sorted.slice(0, halfPoint).filter(r => r.passed).length / halfPoint;
|
|
133
|
-
const secondHalfPassRate = sorted.slice(halfPoint).filter(r => r.passed).length / (sorted.length - halfPoint);
|
|
134
|
-
return secondHalfPassRate - firstHalfPassRate;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Detect seasonality (periodic patterns)
|
|
138
|
-
*/
|
|
139
|
-
static detectSeasonality(values) {
|
|
140
|
-
if (values.length < 10)
|
|
141
|
-
return 0;
|
|
142
|
-
// Check for periodicity using autocorrelation at different lags
|
|
143
|
-
const maxLag = Math.min(10, Math.floor(values.length / 3));
|
|
144
|
-
let maxAutocorr = 0;
|
|
145
|
-
for (let lag = 2; lag <= maxLag; lag++) {
|
|
146
|
-
const autocorr = Math.abs(this.calculateAutocorrelationAtLag(values, lag));
|
|
147
|
-
maxAutocorr = Math.max(maxAutocorr, autocorr);
|
|
148
|
-
}
|
|
149
|
-
return maxAutocorr;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Calculate autocorrelation (dependency between consecutive values)
|
|
153
|
-
*/
|
|
154
|
-
static calculateAutocorrelation(values) {
|
|
155
|
-
return this.calculateAutocorrelationAtLag(values, 1);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Calculate autocorrelation at specific lag
|
|
159
|
-
*/
|
|
160
|
-
static calculateAutocorrelationAtLag(values, lag) {
|
|
161
|
-
if (values.length <= lag)
|
|
162
|
-
return 0;
|
|
163
|
-
const mean = this.calculateMean(values);
|
|
164
|
-
const n = values.length;
|
|
165
|
-
let numerator = 0;
|
|
166
|
-
let denominator = 0;
|
|
167
|
-
for (let i = 0; i < n - lag; i++) {
|
|
168
|
-
numerator += (values[i] - mean) * (values[i + lag] - mean);
|
|
169
|
-
}
|
|
170
|
-
for (let i = 0; i < n; i++) {
|
|
171
|
-
denominator += Math.pow(values[i] - mean, 2);
|
|
172
|
-
}
|
|
173
|
-
return denominator === 0 ? 0 : numerator / denominator;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Detect outlier frequency
|
|
177
|
-
*/
|
|
178
|
-
static detectOutlierFrequency(values) {
|
|
179
|
-
if (values.length < 4)
|
|
180
|
-
return 0;
|
|
181
|
-
const sorted = [...values].sort((a, b) => a - b);
|
|
182
|
-
const q1 = sorted[Math.floor(values.length * 0.25)];
|
|
183
|
-
const q3 = sorted[Math.floor(values.length * 0.75)];
|
|
184
|
-
const iqr = q3 - q1;
|
|
185
|
-
const lowerBound = q1 - 1.5 * iqr;
|
|
186
|
-
const upperBound = q3 + 1.5 * iqr;
|
|
187
|
-
const outliers = values.filter(v => v < lowerBound || v > upperBound);
|
|
188
|
-
return outliers.length / values.length;
|
|
189
|
-
}
|
|
190
|
-
// ============================================================================
|
|
191
|
-
// Advanced Pattern Features
|
|
192
|
-
// ============================================================================
|
|
193
|
-
/**
|
|
194
|
-
* Detect flip-flop pattern (alternating pass/fail)
|
|
195
|
-
*/
|
|
196
|
-
static detectFlipFlopPattern(results) {
|
|
197
|
-
if (results.length < 4)
|
|
198
|
-
return 0;
|
|
199
|
-
const sorted = [...results].sort((a, b) => a.timestamp - b.timestamp);
|
|
200
|
-
let alternations = 0;
|
|
201
|
-
for (let i = 1; i < sorted.length; i++) {
|
|
202
|
-
if (sorted[i].passed !== sorted[i - 1].passed) {
|
|
203
|
-
alternations++;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
// High alternation rate indicates flip-flop
|
|
207
|
-
const alternationRate = alternations / (sorted.length - 1);
|
|
208
|
-
return alternationRate;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Detect gradual degradation (decreasing pass rate over time)
|
|
212
|
-
*/
|
|
213
|
-
static detectGradualDegradation(results) {
|
|
214
|
-
if (results.length < 6)
|
|
215
|
-
return 0;
|
|
216
|
-
const sorted = [...results].sort((a, b) => a.timestamp - b.timestamp);
|
|
217
|
-
const thirdSize = Math.floor(sorted.length / 3);
|
|
218
|
-
const firstThirdPassRate = sorted.slice(0, thirdSize).filter(r => r.passed).length / thirdSize;
|
|
219
|
-
const middleThirdPassRate = sorted.slice(thirdSize, 2 * thirdSize).filter(r => r.passed).length / thirdSize;
|
|
220
|
-
const lastThirdPassRate = sorted.slice(2 * thirdSize).filter(r => r.passed).length / (sorted.length - 2 * thirdSize);
|
|
221
|
-
// Check if pass rate consistently decreases
|
|
222
|
-
const degrades = firstThirdPassRate > middleThirdPassRate && middleThirdPassRate > lastThirdPassRate;
|
|
223
|
-
const degradation = firstThirdPassRate - lastThirdPassRate;
|
|
224
|
-
return degrades && degradation > 0.1 ? degradation : 0;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Detect environment sensitivity
|
|
228
|
-
*/
|
|
229
|
-
static detectEnvironmentSensitivity(results) {
|
|
230
|
-
const withEnv = results.filter(r => r.environment?.platform);
|
|
231
|
-
if (withEnv.length < 3)
|
|
232
|
-
return 0;
|
|
233
|
-
// Group by environment and calculate pass rate variance
|
|
234
|
-
const envGroups = new Map();
|
|
235
|
-
for (const result of withEnv) {
|
|
236
|
-
const env = result.environment?.platform || 'unknown';
|
|
237
|
-
if (!envGroups.has(env)) {
|
|
238
|
-
envGroups.set(env, []);
|
|
239
|
-
}
|
|
240
|
-
envGroups.get(env).push(result);
|
|
241
|
-
}
|
|
242
|
-
if (envGroups.size < 2)
|
|
243
|
-
return 0;
|
|
244
|
-
// Calculate pass rate for each environment
|
|
245
|
-
const passRates = Array.from(envGroups.values()).map(group => {
|
|
246
|
-
return group.filter(r => r.passed).length / group.length;
|
|
247
|
-
});
|
|
248
|
-
// High variance in pass rates across environments indicates sensitivity
|
|
249
|
-
return this.calculateVarianceFromArray(passRates);
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Detect resource contention
|
|
253
|
-
*/
|
|
254
|
-
static detectResourceContention(results) {
|
|
255
|
-
if (results.length < 3)
|
|
256
|
-
return 0;
|
|
257
|
-
// Tests with very high durations (timeouts) may indicate contention
|
|
258
|
-
const durations = results.map(r => r.duration);
|
|
259
|
-
const mean = this.calculateMean(durations);
|
|
260
|
-
const stdDev = Math.sqrt(this.calculateVariance(durations));
|
|
261
|
-
const highDurationCount = durations.filter(d => d > mean + 2 * stdDev).length;
|
|
262
|
-
const highDurationRate = highDurationCount / durations.length;
|
|
263
|
-
// Correlation with failures
|
|
264
|
-
const highDurationFailures = results.filter(r => r.duration > mean + 2 * stdDev && !r.passed).length;
|
|
265
|
-
const correlationScore = highDurationCount > 0 ? highDurationFailures / highDurationCount : 0;
|
|
266
|
-
return Math.min(highDurationRate * correlationScore * 2, 1);
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Detect timing dependency
|
|
270
|
-
*/
|
|
271
|
-
static detectTimingDependency(results) {
|
|
272
|
-
if (results.length < 5)
|
|
273
|
-
return 0;
|
|
274
|
-
// Check if very fast tests tend to fail (race conditions)
|
|
275
|
-
const durations = results.map(r => r.duration);
|
|
276
|
-
const mean = this.calculateMean(durations);
|
|
277
|
-
const fastThreshold = mean * 0.5;
|
|
278
|
-
const fastTests = results.filter(r => r.duration < fastThreshold);
|
|
279
|
-
if (fastTests.length < 2)
|
|
280
|
-
return 0;
|
|
281
|
-
const fastFailureRate = fastTests.filter(r => !r.passed).length / fastTests.length;
|
|
282
|
-
const overallFailureRate = results.filter(r => !r.passed).length / results.length;
|
|
283
|
-
// High failure rate in fast tests indicates timing dependency
|
|
284
|
-
return fastFailureRate > overallFailureRate + 0.1 ? fastFailureRate - overallFailureRate : 0;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Detect data dependency
|
|
288
|
-
*/
|
|
289
|
-
static detectDataDependency(results) {
|
|
290
|
-
if (results.length < 7)
|
|
291
|
-
return 0;
|
|
292
|
-
// Look for periodic failures (same interval)
|
|
293
|
-
const sorted = [...results].sort((a, b) => a.timestamp - b.timestamp);
|
|
294
|
-
const failures = sorted.map((r, i) => r.passed ? 0 : i).filter(i => i > 0);
|
|
295
|
-
if (failures.length < 3)
|
|
296
|
-
return 0;
|
|
297
|
-
// Calculate intervals between failures
|
|
298
|
-
const intervals = [];
|
|
299
|
-
for (let i = 1; i < failures.length; i++) {
|
|
300
|
-
intervals.push(failures[i] - failures[i - 1]);
|
|
301
|
-
}
|
|
302
|
-
// Check if intervals are similar (periodic)
|
|
303
|
-
const intervalVariance = this.calculateVarianceFromArray(intervals);
|
|
304
|
-
const intervalMean = this.calculateMean(intervals);
|
|
305
|
-
const cv = intervalMean > 0 ? Math.sqrt(intervalVariance) / intervalMean : 0;
|
|
306
|
-
// Low coefficient of variation indicates periodic pattern
|
|
307
|
-
return cv < 0.3 ? 1 - cv : 0;
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Detect concurrency issues
|
|
311
|
-
*/
|
|
312
|
-
static detectConcurrencyIssues(results) {
|
|
313
|
-
if (results.length < 5)
|
|
314
|
-
return 0;
|
|
315
|
-
// Look for clustered failures (deadlocks, race conditions occur in bursts)
|
|
316
|
-
const sorted = [...results].sort((a, b) => a.timestamp - b.timestamp);
|
|
317
|
-
const windowSize = Math.max(3, Math.floor(results.length * 0.1));
|
|
318
|
-
let maxClusterFailureRate = 0;
|
|
319
|
-
for (let i = 0; i <= sorted.length - windowSize; i++) {
|
|
320
|
-
const window = sorted.slice(i, i + windowSize);
|
|
321
|
-
const windowFailureRate = window.filter(r => !r.passed).length / windowSize;
|
|
322
|
-
maxClusterFailureRate = Math.max(maxClusterFailureRate, windowFailureRate);
|
|
323
|
-
}
|
|
324
|
-
const overallFailureRate = results.filter(r => !r.passed).length / results.length;
|
|
325
|
-
// High failure rate in clusters indicates concurrency issues
|
|
326
|
-
return maxClusterFailureRate > overallFailureRate + 0.3 ? maxClusterFailureRate - overallFailureRate : 0;
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Detect temporal clustering
|
|
330
|
-
*/
|
|
331
|
-
static detectTemporalClustering(results) {
|
|
332
|
-
if (results.length < 5)
|
|
333
|
-
return 0;
|
|
334
|
-
const sorted = [...results].sort((a, b) => a.timestamp - b.timestamp);
|
|
335
|
-
const failures = sorted.filter(r => !r.passed);
|
|
336
|
-
if (failures.length < 2)
|
|
337
|
-
return 0;
|
|
338
|
-
// Calculate time gaps between failures
|
|
339
|
-
const gaps = [];
|
|
340
|
-
for (let i = 1; i < failures.length; i++) {
|
|
341
|
-
gaps.push(failures[i].timestamp - failures[i - 1].timestamp);
|
|
342
|
-
}
|
|
343
|
-
// High variance in gaps indicates clustering
|
|
344
|
-
const gapVariance = this.calculateVarianceFromArray(gaps);
|
|
345
|
-
const gapMean = this.calculateMean(gaps);
|
|
346
|
-
return gapMean > 0 ? Math.min(Math.sqrt(gapVariance) / gapMean, 1) : 0;
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Detect environment variability
|
|
350
|
-
*/
|
|
351
|
-
static detectEnvironmentVariability(results) {
|
|
352
|
-
const withEnv = results.filter(r => r.environment);
|
|
353
|
-
if (withEnv.length < 3)
|
|
354
|
-
return 0;
|
|
355
|
-
// Count unique environment configurations
|
|
356
|
-
const envConfigs = new Set(withEnv.map(r => JSON.stringify(r.environment)));
|
|
357
|
-
return Math.min(envConfigs.size / withEnv.length, 1);
|
|
358
|
-
}
|
|
359
|
-
// ============================================================================
|
|
360
|
-
// Helper Methods
|
|
361
|
-
// ============================================================================
|
|
362
|
-
static calculateMean(values) {
|
|
363
|
-
if (values.length === 0)
|
|
364
|
-
return 0;
|
|
365
|
-
return values.reduce((a, b) => a + b, 0) / values.length;
|
|
366
|
-
}
|
|
367
|
-
static calculateVariance(values) {
|
|
368
|
-
if (values.length < 2)
|
|
369
|
-
return 0;
|
|
370
|
-
const mean = this.calculateMean(values);
|
|
371
|
-
return values.reduce((acc, v) => acc + Math.pow(v - mean, 2), 0) / values.length;
|
|
372
|
-
}
|
|
373
|
-
static calculateVarianceFromArray(values) {
|
|
374
|
-
return this.calculateVariance(values);
|
|
375
|
-
}
|
|
376
|
-
static calculateRetryRate(results) {
|
|
377
|
-
const withRetries = results.filter(r => (r.retryCount || 0) > 0).length;
|
|
378
|
-
return results.length > 0 ? withRetries / results.length : 0;
|
|
379
|
-
}
|
|
380
|
-
static calculateDataQuality(results) {
|
|
381
|
-
// Quality based on sample size and completeness
|
|
382
|
-
const sizeScore = Math.min(results.length / 50, 1);
|
|
383
|
-
const completenessScore = results.filter(r => r.duration > 0 && r.timestamp > 0).length / results.length;
|
|
384
|
-
return (sizeScore + completenessScore) / 2;
|
|
385
|
-
}
|
|
386
|
-
static normalizeScore(value) {
|
|
387
|
-
// Normalize unbounded scores to [0, 1] range using tanh
|
|
388
|
-
return (Math.tanh(value) + 1) / 2;
|
|
389
|
-
}
|
|
390
|
-
static getZeroFeatures() {
|
|
391
|
-
return {
|
|
392
|
-
passRate: 0,
|
|
393
|
-
failureRate: 0,
|
|
394
|
-
meanDuration: 0,
|
|
395
|
-
variance: 0,
|
|
396
|
-
stdDev: 0,
|
|
397
|
-
coefficientOfVariation: 0,
|
|
398
|
-
minDuration: 0,
|
|
399
|
-
maxDuration: 0,
|
|
400
|
-
durationRange: 0,
|
|
401
|
-
retryRate: 0,
|
|
402
|
-
sampleSize: 0,
|
|
403
|
-
dataQuality: 0,
|
|
404
|
-
skewness: 0,
|
|
405
|
-
kurtosis: 0,
|
|
406
|
-
trendSlope: 0,
|
|
407
|
-
seasonality: 0,
|
|
408
|
-
autocorrelation: 0,
|
|
409
|
-
outlierFrequency: 0,
|
|
410
|
-
flipFlopScore: 0,
|
|
411
|
-
gradualDegradationScore: 0,
|
|
412
|
-
environmentSensitivityScore: 0,
|
|
413
|
-
resourceContentionScore: 0,
|
|
414
|
-
timingDependencyScore: 0,
|
|
415
|
-
dataDependencyScore: 0,
|
|
416
|
-
concurrencyIssuesScore: 0,
|
|
417
|
-
temporalClustering: 0,
|
|
418
|
-
environmentVariability: 0
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
exports.AdvancedFeatureExtractor = AdvancedFeatureExtractor;
|
|
423
|
-
//# sourceMappingURL=AdvancedFeatureExtractor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AdvancedFeatureExtractor.js","sourceRoot":"","sources":["../../src/learning/AdvancedFeatureExtractor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAyCH,MAAa,wBAAwB;IACnC;;OAEG;IACI,MAAM,CAAC,eAAe,CAAC,OAAqB;QACjD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAA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C1B,2BAA2B,EAAE,CAAC;YAC9B,uBAAuB,EAAE,CAAC;YAC1B,qBAAqB,EAAE,CAAC;YACxB,mBAAmB,EAAE,CAAC;YACtB,sBAAsB,EAAE,CAAC;YACzB,kBAAkB,EAAE,CAAC;YACrB,sBAAsB,EAAE,CAAC;SAC1B,CAAC;IACJ,CAAC;CACF;AA3dD,4DA2dC"}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Neural Pattern Matcher for QE Test Generation
|
|
3
|
-
*
|
|
4
|
-
* Implements a neural network-based pattern recognition system for:
|
|
5
|
-
* - Learning from historical test patterns
|
|
6
|
-
* - Predicting optimal test cases for new code
|
|
7
|
-
* - Identifying test coverage gaps
|
|
8
|
-
* - Suggesting test improvements
|
|
9
|
-
*
|
|
10
|
-
* Target accuracy: 85%+
|
|
11
|
-
*
|
|
12
|
-
* @module NeuralPatternMatcher
|
|
13
|
-
*/
|
|
14
|
-
import { EventEmitter } from 'events';
|
|
15
|
-
import type { SwarmMemoryManager } from '../swarm/SwarmMemoryManager';
|
|
16
|
-
import type { QEReasoningBank } from './QEReasoningBank';
|
|
17
|
-
/**
|
|
18
|
-
* Model backend types
|
|
19
|
-
*/
|
|
20
|
-
export declare enum ModelBackend {
|
|
21
|
-
/** TensorFlow.js (browser/Node.js) */
|
|
22
|
-
TENSORFLOW_JS = "tensorflow_js",
|
|
23
|
-
/** ONNX Runtime (cross-platform) */
|
|
24
|
-
ONNX = "onnx",
|
|
25
|
-
/** Simple neural network (pure TypeScript) */
|
|
26
|
-
SIMPLE_NN = "simple_nn"
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Neural network architecture configuration
|
|
30
|
-
*/
|
|
31
|
-
export interface NeuralArchitecture {
|
|
32
|
-
/** Input layer size */
|
|
33
|
-
inputSize: number;
|
|
34
|
-
/** Hidden layer sizes */
|
|
35
|
-
hiddenLayers: number[];
|
|
36
|
-
/** Output layer size */
|
|
37
|
-
outputSize: number;
|
|
38
|
-
/** Activation function */
|
|
39
|
-
activation: 'relu' | 'sigmoid' | 'tanh' | 'softmax';
|
|
40
|
-
/** Dropout rate for regularization (0-1) */
|
|
41
|
-
dropout?: number;
|
|
42
|
-
/** Learning rate */
|
|
43
|
-
learningRate: number;
|
|
44
|
-
/** Batch size for training */
|
|
45
|
-
batchSize: number;
|
|
46
|
-
/** Number of epochs */
|
|
47
|
-
epochs: number;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Training data point
|
|
51
|
-
*/
|
|
52
|
-
export interface TrainingDataPoint {
|
|
53
|
-
/** Feature vector (encoded test pattern) */
|
|
54
|
-
features: number[];
|
|
55
|
-
/** Target labels (test outcomes) */
|
|
56
|
-
labels: number[];
|
|
57
|
-
/** Metadata for tracking */
|
|
58
|
-
metadata: {
|
|
59
|
-
testId: string;
|
|
60
|
-
codePattern: string;
|
|
61
|
-
timestamp: number;
|
|
62
|
-
success: boolean;
|
|
63
|
-
coverage: number;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Pattern prediction result
|
|
68
|
-
*/
|
|
69
|
-
export interface PatternPrediction {
|
|
70
|
-
/** Predicted test pattern */
|
|
71
|
-
pattern: {
|
|
72
|
-
type: string;
|
|
73
|
-
confidence: number;
|
|
74
|
-
testCases: string[];
|
|
75
|
-
expectedCoverage: number;
|
|
76
|
-
};
|
|
77
|
-
/** Alternative predictions */
|
|
78
|
-
alternatives: Array<{
|
|
79
|
-
type: string;
|
|
80
|
-
confidence: number;
|
|
81
|
-
testCases: string[];
|
|
82
|
-
}>;
|
|
83
|
-
/** Model metadata */
|
|
84
|
-
modelInfo: {
|
|
85
|
-
backend: ModelBackend;
|
|
86
|
-
version: string;
|
|
87
|
-
accuracy: number;
|
|
88
|
-
lastTrained: number;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Model evaluation metrics
|
|
93
|
-
*/
|
|
94
|
-
export interface ModelMetrics {
|
|
95
|
-
/** Overall accuracy (0-1) */
|
|
96
|
-
accuracy: number;
|
|
97
|
-
/** Precision (true positives / (true positives + false positives)) */
|
|
98
|
-
precision: number;
|
|
99
|
-
/** Recall (true positives / (true positives + false negatives)) */
|
|
100
|
-
recall: number;
|
|
101
|
-
/** F1 score (harmonic mean of precision and recall) */
|
|
102
|
-
f1Score: number;
|
|
103
|
-
/** Confusion matrix */
|
|
104
|
-
confusionMatrix: number[][];
|
|
105
|
-
/** Training loss */
|
|
106
|
-
trainingLoss: number;
|
|
107
|
-
/** Validation loss */
|
|
108
|
-
validationLoss: number;
|
|
109
|
-
/** Training time (ms) */
|
|
110
|
-
trainingTime: number;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Neural Pattern Matcher
|
|
114
|
-
*
|
|
115
|
-
* Main class for neural-network-based pattern recognition in QE
|
|
116
|
-
*/
|
|
117
|
-
export declare class NeuralPatternMatcher extends EventEmitter {
|
|
118
|
-
private backend;
|
|
119
|
-
private architecture;
|
|
120
|
-
private model;
|
|
121
|
-
private memoryManager;
|
|
122
|
-
private reasoningBank?;
|
|
123
|
-
private encoding;
|
|
124
|
-
private modelVersion;
|
|
125
|
-
private lastTrained;
|
|
126
|
-
private metrics;
|
|
127
|
-
private modelPath;
|
|
128
|
-
constructor(backend: ModelBackend, architecture: NeuralArchitecture, memoryManager: SwarmMemoryManager, reasoningBank?: QEReasoningBank, modelPath?: string);
|
|
129
|
-
/**
|
|
130
|
-
* Initialize pattern encoding configuration
|
|
131
|
-
*/
|
|
132
|
-
private initializeEncoding;
|
|
133
|
-
/**
|
|
134
|
-
* Encode pattern into feature vector
|
|
135
|
-
*/
|
|
136
|
-
encodePattern(pattern: any): number[];
|
|
137
|
-
/**
|
|
138
|
-
* Initialize model based on backend
|
|
139
|
-
*/
|
|
140
|
-
initializeModel(): Promise<void>;
|
|
141
|
-
/**
|
|
142
|
-
* Load historical training data from SwarmMemoryManager
|
|
143
|
-
*/
|
|
144
|
-
loadTrainingData(): Promise<TrainingDataPoint[]>;
|
|
145
|
-
/**
|
|
146
|
-
* Train model with historical data
|
|
147
|
-
*/
|
|
148
|
-
train(data?: TrainingDataPoint[], validationSplit?: number): Promise<ModelMetrics>;
|
|
149
|
-
/**
|
|
150
|
-
* Predict test patterns for new code
|
|
151
|
-
*/
|
|
152
|
-
predict(codePattern: any): Promise<PatternPrediction>;
|
|
153
|
-
/**
|
|
154
|
-
* Generate test suggestions based on prediction
|
|
155
|
-
*/
|
|
156
|
-
private generateTestSuggestions;
|
|
157
|
-
/**
|
|
158
|
-
* Incremental training with new data
|
|
159
|
-
*/
|
|
160
|
-
incrementalTrain(newData: TrainingDataPoint[]): Promise<ModelMetrics>;
|
|
161
|
-
/**
|
|
162
|
-
* Save model to disk
|
|
163
|
-
*/
|
|
164
|
-
saveModel(): Promise<void>;
|
|
165
|
-
/**
|
|
166
|
-
* Load model from disk
|
|
167
|
-
*/
|
|
168
|
-
loadModel(version?: string): Promise<void>;
|
|
169
|
-
/**
|
|
170
|
-
* Evaluate model on test dataset
|
|
171
|
-
*/
|
|
172
|
-
evaluate(testData: TrainingDataPoint[]): Promise<ModelMetrics>;
|
|
173
|
-
/**
|
|
174
|
-
* Get model information
|
|
175
|
-
*/
|
|
176
|
-
getModelInfo(): {
|
|
177
|
-
backend: ModelBackend;
|
|
178
|
-
version: string;
|
|
179
|
-
architecture: NeuralArchitecture;
|
|
180
|
-
metrics: ModelMetrics | null;
|
|
181
|
-
lastTrained: number;
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=NeuralPatternMatcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NeuralPatternMatcher.d.ts","sourceRoot":"","sources":["../../src/learning/NeuralPatternMatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,kB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