vibecodingmachine-core 2026.2.26-1739 → 2026.3.9-850

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.
Files changed (192) hide show
  1. package/package.json +1 -1
  2. package/src/agents/AgentCheckDiscoveryService.js +180 -0
  3. package/src/agents/AgentCheckService.js +18 -261
  4. package/src/agents/AgentCheckStatisticsService.js +195 -0
  5. package/src/agents/EnvironmentConfigurationManager.js +31 -380
  6. package/src/agents/InstallationType.js +19 -6
  7. package/src/agents/SimpleAgentCheckService.js +472 -0
  8. package/src/agents/config-managers/ConfigUtils.js +72 -0
  9. package/src/agents/config-managers/DefaultConfig.js +58 -0
  10. package/src/agents/config-managers/EnvVarLoader.js +66 -0
  11. package/src/agents/config-managers/FileConfigLoader.js +124 -0
  12. package/src/agents/config-managers/TypeConverters.js +61 -0
  13. package/src/agents/config-managers/VariableMappings.js +92 -0
  14. package/src/agents/discovery/AgentDiscoveryService-refactored.js +272 -0
  15. package/src/agents/discovery/AgentDiscoveryService.js +29 -403
  16. package/src/agents/discovery/agent-validator.js +262 -0
  17. package/src/agents/discovery/discovery-results.js +176 -0
  18. package/src/agents/discovery/discovery-scanner.js +268 -0
  19. package/src/agents/discovery/discovery-utils.js +161 -0
  20. package/src/agents/discovery/executable-analyzer.js +290 -0
  21. package/src/agents/discovery/history-manager.js +310 -0
  22. package/src/agents/verification/ResultAnalyzer-refactored.js +341 -0
  23. package/src/agents/verification/ResultAnalyzer.js +30 -431
  24. package/src/agents/verification/analysis-utils.js +310 -0
  25. package/src/agents/verification/batch-analyzer.js +440 -0
  26. package/src/agents/verification/pattern-recognizer.js +369 -0
  27. package/src/agents/verification/report-generator.js +320 -0
  28. package/src/agents/verification/test-analyzer.js +290 -0
  29. package/src/agents/windows/InstallerFactory.js +4 -0
  30. package/src/agents/windows/VSCodeExtensionInstaller.js +404 -0
  31. package/src/analysis/analysis-engine.js +314 -0
  32. package/src/analysis/ast-analyzer.js +342 -0
  33. package/src/analysis/boundary-detector-refactored.js +378 -0
  34. package/src/analysis/boundary-detector.js +200 -603
  35. package/src/analysis/boundary-scanner.js +609 -0
  36. package/src/analysis/boundary-types.js +118 -0
  37. package/src/analysis/boundary-utils.js +293 -0
  38. package/src/analysis/deadline-priority-calculator.js +18 -0
  39. package/src/analysis/detection-methods.js +347 -0
  40. package/src/analysis/importance-priority-calculator.js +18 -0
  41. package/src/analysis/priority/factor-calculators.js +204 -0
  42. package/src/analysis/priority/factor-helpers.js +71 -0
  43. package/src/analysis/priority/priority-constants.js +73 -0
  44. package/src/analysis/priority/priority-factor-calculators.js +301 -0
  45. package/src/analysis/priority/reasons-generator.js +44 -0
  46. package/src/analysis/priority-calculator.js +15 -580
  47. package/src/analysis/strategy-generator.js +16 -66
  48. package/src/analysis/type-priority-calculator.js +18 -0
  49. package/src/analysis/urgency-priority-calculator.js +18 -0
  50. package/src/auto-mode/AutoModeBusinessLogic.js +2 -40
  51. package/src/commands/disable-requirement.js +60 -0
  52. package/src/commands/disable-spec.js +60 -0
  53. package/src/commands/enable-requirement.js +60 -0
  54. package/src/commands/enable-spec.js +60 -0
  55. package/src/commands/registry.js +1 -6
  56. package/src/commands/requirements.js +8 -2
  57. package/src/ide-integration/applescript-manager.cjs +9 -24
  58. package/src/ide-integration/cdp-handlers/chat-reader.js +44 -0
  59. package/src/ide-integration/cdp-handlers/connection-handler.js +88 -0
  60. package/src/ide-integration/cdp-handlers/continuation-handler.js +314 -0
  61. package/src/ide-integration/cdp-handlers/message-submitter.js +75 -0
  62. package/src/ide-integration/cdp-handlers/text-sender.js +138 -0
  63. package/src/ide-integration/cdp-manager.js +28 -573
  64. package/src/ide-integration/claude-code-cli-manager.cjs +48 -12
  65. package/src/ide-integration/ide-openers/claude-opener.js +171 -0
  66. package/src/ide-integration/ide-openers/cursor-opener.js +53 -0
  67. package/src/ide-integration/ide-openers/other-ides-opener.js +230 -0
  68. package/src/ide-integration/ide-openers/vscode-opener.js +147 -0
  69. package/src/ide-integration/macos-ide-manager.js +20 -582
  70. package/src/ide-integration/macos-quota-checker.js +164 -0
  71. package/src/ide-integration/macos-text-sender.js +19 -38
  72. package/src/ide-integration/provider-manager.cjs +52 -7
  73. package/src/index.cjs +6 -0
  74. package/src/index.js +10 -0
  75. package/src/llm/direct-llm-manager.cjs +501 -0
  76. package/src/localization/translations/en-part1.js +363 -0
  77. package/src/localization/translations/en-part2.js +320 -0
  78. package/src/localization/translations/en.js +4 -687
  79. package/src/localization/translations/es-part1.js +363 -0
  80. package/src/localization/translations/es-part2.js +320 -0
  81. package/src/localization/translations/es.js +4 -688
  82. package/src/models/file-analysis-collection.js +139 -0
  83. package/src/models/file-analysis-metrics.js +50 -0
  84. package/src/models/file-analysis.js +15 -262
  85. package/src/models/plan-manager.js +410 -0
  86. package/src/models/refactoring-models.js +380 -0
  87. package/src/models/refactoring-plan-refactored.js +81 -0
  88. package/src/models/refactoring-plan.js +2 -663
  89. package/src/monitoring/alert-system.js +4 -45
  90. package/src/monitoring/continuous-scan-notifications.js +37 -191
  91. package/src/monitoring/notification-handlers/base-handler.js +58 -0
  92. package/src/monitoring/notification-handlers/error-handler.js +36 -0
  93. package/src/monitoring/notification-handlers/index.js +21 -0
  94. package/src/monitoring/notification-handlers/new-violation-handler.js +91 -0
  95. package/src/monitoring/notification-handlers/progress-handler.js +48 -0
  96. package/src/monitoring/notification-handlers/resolved-violation-handler.js +54 -0
  97. package/src/monitoring/notification-handlers/threshold-handler.js +36 -0
  98. package/src/provider-registry.js +8 -0
  99. package/src/refactoring/boundary/boundary-detector-refactored.js +58 -0
  100. package/src/refactoring/boundary/boundary-detector.js +26 -596
  101. package/src/refactoring/boundary/detectors/boundary-analyzers.js +281 -0
  102. package/src/refactoring/boundary/detectors/boundary-core.js +167 -0
  103. package/src/refactoring/boundary/detectors/class-detector.js +247 -0
  104. package/src/refactoring/boundary/detectors/config-detector.js +270 -0
  105. package/src/refactoring/boundary/detectors/constant-detector.js +269 -0
  106. package/src/refactoring/boundary/detectors/function-detector.js +248 -0
  107. package/src/refactoring/boundary/detectors/module-detector.js +249 -0
  108. package/src/refactoring/boundary/detectors/object-detector.js +247 -0
  109. package/src/refactoring/boundary/detectors/type-detectors.js +338 -0
  110. package/src/refactoring/boundary/detectors/utility-detector.js +270 -0
  111. package/src/refactoring/circular-dependency-resolver-original.js +16 -76
  112. package/src/refactoring/code-mover-refactored.js +309 -0
  113. package/src/refactoring/code-mover.js +48 -355
  114. package/src/refactoring/execution-status.js +18 -0
  115. package/src/refactoring/execution-strategies.js +172 -0
  116. package/src/refactoring/file-splitter-core.js +568 -0
  117. package/src/refactoring/file-splitter-types.js +136 -0
  118. package/src/refactoring/file-splitter.js +2 -682
  119. package/src/refactoring/functionality-validator.js +11 -51
  120. package/src/refactoring/import-manager-refactored.js +385 -0
  121. package/src/refactoring/import-manager.js +112 -487
  122. package/src/refactoring/import-models.js +189 -0
  123. package/src/refactoring/import-parser.js +306 -0
  124. package/src/refactoring/move-executor.js +431 -0
  125. package/src/refactoring/move-utils.js +368 -0
  126. package/src/refactoring/operation-executor.js +76 -0
  127. package/src/refactoring/plan-creator.js +36 -0
  128. package/src/refactoring/plan-executor.js +143 -0
  129. package/src/refactoring/plan-validator.js +68 -0
  130. package/src/refactoring/refactoring-executor-result.js +70 -0
  131. package/src/refactoring/refactoring-executor.js +34 -569
  132. package/src/refactoring/refactoring-operation.js +94 -0
  133. package/src/refactoring/refactoring-plan.js +69 -0
  134. package/src/refactoring/refactoring-rollback.js +22 -527
  135. package/src/refactoring/rollback-handlers/RollbackExecutor.js +107 -0
  136. package/src/refactoring/rollback-handlers/RollbackManager.js +265 -0
  137. package/src/refactoring/rollback-handlers/RollbackOperation.js +105 -0
  138. package/src/refactoring/rollback-handlers/RollbackResult.js +109 -0
  139. package/src/refactoring/rollback-handlers/RollbackStatistics.js +77 -0
  140. package/src/refactoring/test-validator.js +32 -448
  141. package/src/refactoring/validation/baseline-runner.js +71 -0
  142. package/src/refactoring/validation/report-generator.js +136 -0
  143. package/src/refactoring/validation/result-comparator.js +92 -0
  144. package/src/refactoring/validation/test-suite.js +59 -0
  145. package/src/refactoring/validation/test-validation-result.js +83 -0
  146. package/src/refactoring/validation/validation-runner.js +95 -0
  147. package/src/refactoring/validation/validation-status.js +18 -0
  148. package/src/rui/commands/AgentCommandParser.js +60 -369
  149. package/src/rui/commands/AgentResponseFormatter.js +7 -47
  150. package/src/rui/commands/parsers/CommandMapper.js +148 -0
  151. package/src/rui/commands/parsers/CommandValidator.js +228 -0
  152. package/src/rui/commands/parsers/ComponentExtractor.js +100 -0
  153. package/src/rui/commands/parsers/TokenParser.js +69 -0
  154. package/src/rui/commands/parsers/tokenizer.js +153 -0
  155. package/src/utils/current-requirement-operations.js +50 -1
  156. package/src/utils/report-generator.js +18 -514
  157. package/src/utils/report-generators/analysis-generator.js +115 -0
  158. package/src/utils/report-generators/base-generator.js +141 -0
  159. package/src/utils/report-generators/compliance-generator.js +41 -0
  160. package/src/utils/report-generators/format-handlers.js +185 -0
  161. package/src/utils/report-generators/refactoring-generator.js +46 -0
  162. package/src/utils/report-generators/validation-generator.js +63 -0
  163. package/src/utils/requirement-enable-disable.js +265 -0
  164. package/src/utils/requirement-helpers/requirement-file-ops.js +69 -1
  165. package/src/utils/requirement-helpers/requirement-mover.js +88 -1
  166. package/src/utils/requirement-helpers.js +5 -2
  167. package/src/utils/smoke-test-cli.js +45 -8
  168. package/src/utils/specification-enable-disable.js +122 -0
  169. package/src/utils/specification-helpers.js +30 -4
  170. package/src/utils/specification-migration.js +5 -5
  171. package/src/utils/test-comparator.js +118 -0
  172. package/src/utils/test-config.js +54 -0
  173. package/src/utils/test-executor.js +133 -0
  174. package/src/utils/test-parser.js +215 -0
  175. package/src/utils/test-runner-baseline.js +63 -0
  176. package/src/utils/test-runner-core.js +98 -0
  177. package/src/utils/test-runner-report.js +39 -0
  178. package/src/utils/test-runner-validation.js +71 -0
  179. package/src/utils/test-runner.js +11 -535
  180. package/src/validation/comparison-analyzer.js +333 -0
  181. package/src/validation/compliance-reporter-new.js +282 -0
  182. package/src/validation/compliance-reporter-refactored.js +344 -0
  183. package/src/validation/compliance-reporter.js +278 -591
  184. package/src/validation/compliance-utils.js +278 -0
  185. package/src/validation/html-generator.js +446 -0
  186. package/src/validation/metrics/category-calculator.js +137 -0
  187. package/src/validation/metrics/metrics-helpers.js +155 -0
  188. package/src/validation/metrics/overview-calculator.js +85 -0
  189. package/src/validation/metrics/overview-metrics.js +41 -0
  190. package/src/validation/metrics/quality-calculator.js +166 -0
  191. package/src/validation/metrics/size-calculator.js +69 -0
  192. package/src/validation/metrics-calculator.js +27 -551
@@ -7,6 +7,25 @@
7
7
 
8
8
  const { AgentStatus } = require('../AgentStatus');
9
9
  const { VerificationType } = require('../VerificationType');
10
+ const { analyzeTestResult } = require('./test-analyzer');
11
+ const {
12
+ determineAgentStatus,
13
+ createSummary,
14
+ identifyIssues,
15
+ generateAgentRecommendations,
16
+ calculateAgentConfidence,
17
+ createBatchSummary,
18
+ generateBatchRecommendations,
19
+ calculateBatchConfidence,
20
+ aggregateTestAnalyses
21
+ } = require('./batch-analyzer');
22
+ const {
23
+ identifyPatterns,
24
+ identifyRiskFactors,
25
+ identifyBatchPatterns,
26
+ calculateRiskScore,
27
+ generatePatternRecommendations
28
+ } = require('./pattern-recognizer');
10
29
 
11
30
  /**
12
31
  * Verification result analyzer class
@@ -28,20 +47,15 @@ class ResultAnalyzer {
28
47
  * @returns {Object} - Analysis result
29
48
  */
30
49
  analyzeTestResult(testResult) {
31
- const analysis = {
32
- testId: testResult.testId,
33
- success: testResult.success,
34
- severity: this.determineSeverity(testResult),
35
- category: this.categorizeResult(testResult),
36
- recommendations: this.generateRecommendations(testResult),
37
- confidence: this.calculateConfidence(testResult)
38
- };
50
+ const analysis = analyzeTestResult(testResult, {
51
+ detailedAnalysis: this.detailedAnalysis
52
+ });
39
53
 
40
54
  // Add detailed analysis if enabled
41
55
  if (this.detailedAnalysis) {
42
- analysis.details = this.analyzeDetails(testResult);
43
- analysis.patterns = this.identifyPatterns(testResult);
44
- analysis.riskFactors = this.identifyRiskFactors(testResult);
56
+ analysis.patterns = identifyPatterns(testResult);
57
+ analysis.riskFactors = identifyRiskFactors(testResult);
58
+ analysis.riskScore = calculateRiskScore(analysis.riskFactors);
45
59
  }
46
60
 
47
61
  return analysis;
@@ -56,426 +70,11 @@ class ResultAnalyzer {
56
70
  const analysis = {
57
71
  agentId: verificationResult.agentId,
58
72
  overallSuccess: verificationResult.success,
59
- status: this.determineAgentStatus(verificationResult),
60
- summary: this.createSummary(verificationResult),
61
- issues: this.identifyIssues(verificationResult),
62
- recommendations: this.generateAgentRecommendations(verificationResult),
63
- confidence: this.calculateAgentConfidence(verificationResult)
64
- };
65
-
66
- // Analyze individual test results
67
- if (verificationResult.results) {
68
- analysis.testAnalyses = verificationResult.results.map(testResult =>
69
- this.analyzeTestResult(testResult)
70
- );
71
-
72
- // Aggregate test analysis
73
- analysis.testSummary = this.aggregateTestAnalyses(analysis.testAnalyses);
74
- }
75
-
76
- return analysis;
77
- }
78
-
79
- /**
80
- * Analyze batch verification results
81
- * @param {Object} batchResult - Batch verification result
82
- * @returns {Object} - Analysis result
83
- */
84
- analyzeBatchResult(batchResult) {
85
- const analysis = {
86
- batchId: batchResult.batchId || batchResult.testId,
87
- overallSuccess: batchResult.success,
88
- summary: this.createBatchSummary(batchResult),
89
- agentAnalyses: [],
90
- patterns: this.identifyBatchPatterns(batchResult),
91
- recommendations: this.generateBatchRecommendations(batchResult),
92
- confidence: this.calculateBatchConfidence(batchResult)
93
- };
94
-
95
- // Analyze individual agent results
96
- if (batchResult.results) {
97
- analysis.agentAnalyses = batchResult.results.map(agentResult =>
98
- this.analyzeAgentResult(agentResult)
99
- );
100
-
101
- // Aggregate agent analyses
102
- analysis.agentSummary = this.aggregateAgentAnalyses(analysis.agentAnalyses);
103
- }
104
-
105
- return analysis;
106
- }
107
-
108
- /**
109
- * Determine result severity
110
- * @param {Object} testResult - Test result
111
- * @returns {string} - Severity level
112
- */
113
- determineSeverity(testResult) {
114
- if (!testResult.success) {
115
- // Determine failure severity
116
- if (testResult.error) {
117
- const error = testResult.error.toLowerCase();
118
-
119
- if (error.includes('timeout') || error.includes('network')) {
120
- return 'medium';
121
- } else if (error.includes('permission') || error.includes('access denied')) {
122
- return 'high';
123
- } else if (error.includes('not found') || error.includes('command not found')) {
124
- return 'high';
125
- } else {
126
- return 'low';
127
- }
128
- }
129
- }
130
-
131
- return 'none';
132
- }
133
-
134
- /**
135
- * Categorize test result
136
- * @param {Object} testResult - Test result
137
- * @returns {string} - Result category
138
- */
139
- categorizeResult(testResult) {
140
- if (!testResult.success) {
141
- if (testResult.error) {
142
- const error = testResult.error.toLowerCase();
143
-
144
- if (error.includes('timeout')) {
145
- return 'timeout';
146
- } else if (error.includes('permission') || error.includes('access')) {
147
- return 'permission';
148
- } else if (error.includes('not found') || error.includes('missing')) {
149
- return 'missing';
150
- } else if (error.includes('network') || error.includes('connection')) {
151
- return 'network';
152
- } else {
153
- return 'unknown';
154
- }
155
- }
156
- }
157
-
158
- return 'success';
159
- }
160
-
161
- /**
162
- * Generate recommendations for test result
163
- * @param {Object} testResult - Test result
164
- * @returns {Array} - Recommendations
165
- */
166
- generateRecommendations(testResult) {
167
- const recommendations = [];
168
-
169
- if (!testResult.success) {
170
- const category = this.categorizeResult(testResult);
171
-
172
- switch (category) {
173
- case 'timeout':
174
- recommendations.push('Increase timeout value for this test');
175
- recommendations.push('Check system performance and resource availability');
176
- break;
177
-
178
- case 'permission':
179
- recommendations.push('Check file/directory permissions');
180
- recommendations.push('Run with appropriate user privileges');
181
- break;
182
-
183
- case 'missing':
184
- recommendations.push('Verify agent installation');
185
- recommendations.push('Check command availability in PATH');
186
- break;
187
-
188
- case 'network':
189
- recommendations.push('Check network connectivity');
190
- recommendations.push('Verify firewall settings');
191
- break;
192
-
193
- default:
194
- recommendations.push('Review test configuration');
195
- recommendations.push('Check system logs for detailed error information');
196
- }
197
- }
198
-
199
- return recommendations;
200
- }
201
-
202
- /**
203
- * Calculate confidence score
204
- * @param {Object} testResult - Test result
205
- * @returns {number} - Confidence score (0-100)
206
- */
207
- calculateConfidence(testResult) {
208
- if (!testResult.success) {
209
- return 0;
210
- }
211
-
212
- let confidence = 80; // Base confidence for successful tests
213
-
214
- // Adjust based on test duration
215
- if (testResult.duration) {
216
- if (testResult.duration < 1000) {
217
- confidence += 10; // Very fast test
218
- } else if (testResult.duration > 30000) {
219
- confidence -= 10; // Very slow test
220
- }
221
- }
222
-
223
- // Adjust based on test type
224
- if (testResult.type === VerificationType.FILE_OPERATION) {
225
- confidence += 5; // File operations are more reliable
226
- }
227
-
228
- return Math.min(100, Math.max(0, confidence));
229
- }
230
-
231
- /**
232
- * Analyze detailed test information
233
- * @param {Object} testResult - Test result
234
- * @returns {Object} - Detailed analysis
235
- */
236
- analyzeDetails(testResult) {
237
- const details = {};
238
-
239
- if (testResult.duration) {
240
- details.performance = {
241
- duration: testResult.duration,
242
- category: this.categorizePerformance(testResult.duration),
243
- acceptable: testResult.duration < 30000
244
- };
245
- }
246
-
247
- if (testResult.type) {
248
- details.testType = {
249
- type: testResult.type,
250
- reliability: this.getTestTypeReliability(testResult.type)
251
- };
252
- }
253
-
254
- if (testResult.error) {
255
- details.error = {
256
- message: testResult.error,
257
- type: this.categorizeResult(testResult),
258
- recoverable: this.isRecoverableError(testResult.error)
259
- };
260
- }
261
-
262
- return details;
263
- }
264
-
265
- /**
266
- * Identify patterns in test result
267
- * @param {Object} testResult - Test result
268
- * @returns {Array} - Identified patterns
269
- */
270
- identifyPatterns(testResult) {
271
- const patterns = [];
272
-
273
- if (testResult.error) {
274
- const error = testResult.error.toLowerCase();
275
-
276
- if (error.includes('timeout')) {
277
- patterns.push('timeout-pattern');
278
- }
279
-
280
- if (error.includes('permission') || error.includes('access')) {
281
- patterns.push('permission-pattern');
282
- }
283
-
284
- if (error.includes('not found')) {
285
- patterns.push('missing-dependency-pattern');
286
- }
287
- }
288
-
289
- if (testResult.duration && testResult.duration > 30000) {
290
- patterns.push('slow-performance-pattern');
291
- }
292
-
293
- return patterns;
294
- }
295
-
296
- /**
297
- * Identify risk factors
298
- * @param {Object} testResult - Test result
299
- * @returns {Array} - Risk factors
300
- */
301
- identifyRiskFactors(testResult) {
302
- const risks = [];
303
-
304
- if (!testResult.success) {
305
- const severity = this.determineSeverity(testResult);
306
-
307
- if (severity === 'high') {
308
- risks.push('critical-failure-risk');
309
- }
310
-
311
- if (this.categorizeResult(testResult) === 'permission') {
312
- risks.push('security-risk');
313
- }
314
-
315
- if (testResult.type === VerificationType.COMMAND_EXECUTION && !testResult.success) {
316
- risks.push('command-execution-risk');
317
- }
318
- }
319
-
320
- return risks;
321
- }
322
-
323
- /**
324
- * Determine agent status based on verification result
325
- * @param {Object} verificationResult - Verification result
326
- * @returns {string} - Agent status
327
- */
328
- determineAgentStatus(verificationResult) {
329
- if (!verificationResult.success) {
330
- return AgentStatus.ERROR;
331
- }
332
-
333
- if (verificationResult.summary) {
334
- if (verificationResult.summary.allPassed) {
335
- return AgentStatus.VERIFIED;
336
- } else if (verificationResult.summary.passed > 0) {
337
- return AgentStatus.INSTALLED; // Partial success
338
- }
339
- }
340
-
341
- return AgentStatus.ERROR;
342
- }
343
-
344
- /**
345
- * Create summary for agent result
346
- * @param {Object} verificationResult - Verification result
347
- * @returns {Object} - Summary
348
- */
349
- createSummary(verificationResult) {
350
- const summary = {
351
- agentId: verificationResult.agentId,
352
- success: verificationResult.success,
353
- duration: verificationResult.duration || 0
354
- };
355
-
356
- if (verificationResult.summary) {
357
- summary.tests = verificationResult.summary;
358
- }
359
-
360
- if (verificationResult.results) {
361
- summary.totalTests = verificationResult.results.length;
362
- summary.passedTests = verificationResult.results.filter(r => r.success).length;
363
- summary.failedTests = summary.totalTests - summary.passedTests;
364
- }
365
-
366
- return summary;
367
- }
368
-
369
- /**
370
- * Identify issues in verification result
371
- * @param {Object} verificationResult - Verification result
372
- * @returns {Array} - Issues
373
- */
374
- identifyIssues(verificationResult) {
375
- const issues = [];
376
-
377
- if (!verificationResult.success) {
378
- if (verificationResult.error) {
379
- issues.push({
380
- type: 'verification-failure',
381
- severity: 'high',
382
- message: verificationResult.error
383
- });
384
- }
385
- }
386
-
387
- if (verificationResult.results) {
388
- verificationResult.results.forEach((testResult, index) => {
389
- if (!testResult.success) {
390
- issues.push({
391
- type: 'test-failure',
392
- severity: this.determineSeverity(testResult),
393
- testId: testResult.testId,
394
- message: testResult.error || 'Test failed'
395
- });
396
- }
397
- });
398
- }
399
-
400
- return issues;
401
- }
402
-
403
- /**
404
- * Generate recommendations for agent
405
- * @param {Object} verificationResult - Verification result
406
- * @returns {Array} - Recommendations
407
- */
408
- generateAgentRecommendations(verificationResult) {
409
- const recommendations = [];
410
-
411
- if (!verificationResult.success) {
412
- recommendations.push('Review agent installation and configuration');
413
-
414
- if (verificationResult.results) {
415
- const failedTests = verificationResult.results.filter(r => !r.success);
416
- const categories = [...new Set(failedTests.map(t => this.categorizeResult(t)))];
417
-
418
- categories.forEach(category => {
419
- switch (category) {
420
- case 'permission':
421
- recommendations.push('Check file and directory permissions');
422
- break;
423
- case 'missing':
424
- recommendations.push('Verify agent dependencies are installed');
425
- break;
426
- case 'timeout':
427
- recommendations.push('Increase timeout values or optimize performance');
428
- break;
429
- }
430
- });
431
- }
432
- }
433
-
434
- return recommendations;
435
- }
436
-
437
- /**
438
- * Calculate confidence for agent result
439
- * @param {Object} verificationResult - Verification result
440
- * @returns {number} - Confidence score
441
- */
442
- calculateAgentConfidence(verificationResult) {
443
- if (!verificationResult.success || !verificationResult.results) {
444
- return 0;
445
- }
446
-
447
- const testConfidences = verificationResult.results.map(testResult =>
448
- this.calculateConfidence(testResult)
449
- );
450
-
451
- return Math.round(testConfidences.reduce((sum, conf) => sum + conf, 0) / testConfidences.length);
452
- }
453
-
454
- /**
455
- * Aggregate test analyses
456
- * @param {Array} testAnalyses - Test analyses
457
- * @returns {Object} - Aggregated summary
458
- */
459
- aggregateTestAnalyses(testAnalyses) {
460
- const summary = {
461
- totalTests: testAnalyses.length,
462
- successfulTests: testAnalyses.filter(t => t.success).length,
463
- severityDistribution: {},
464
- categoryDistribution: {},
465
- averageConfidence: 0
466
- };
467
-
468
- // Calculate distributions
469
- testAnalyses.forEach(analysis => {
470
- const severity = analysis.severity;
471
- const category = analysis.category;
472
-
473
- summary.severityDistribution[severity] = (summary.severityDistribution[severity] || 0) + 1;
474
- summary.categoryDistribution[category] = (summary.categoryDistribution[category] || 0) + 1;
475
- });
476
-
477
- // Calculate average confidence
478
- const confidences = testAnalyses.map(t => t.confidence).filter(c => c > 0);
73
+ status: determineAgentStatus(verificationResult),
74
+ summary: createSummary(verificationResult),
75
+ issues: identifyIssues(verificationResult),
76
+ recommendations: generateAgentRecommendations(verificationResult),
77
+ confidence: calculateAgentConfidence(verificationResult)
479
78
  if (confidences.length > 0) {
480
79
  summary.averageConfidence = Math.round(confidences.reduce((sum, conf) => sum + conf, 0) / confidences.length);
481
80
  }