erosolar-cli 2.1.249 → 2.1.252
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/agents/general.rules.json +10 -133
- package/agents/general.rules.json.bak +278 -0
- package/agents/general.rules.json.bak2 +306 -0
- package/dist/bin/erosolar.js +9 -5
- package/dist/bin/erosolar.js.map +1 -1
- package/dist/capabilities/bidirectionalAuditCapability.d.ts +26 -0
- package/dist/capabilities/bidirectionalAuditCapability.d.ts.map +1 -0
- package/dist/capabilities/bidirectionalAuditCapability.js +44 -0
- package/dist/capabilities/bidirectionalAuditCapability.js.map +1 -0
- package/dist/capabilities/globCapability.d.ts +3 -6
- package/dist/capabilities/globCapability.d.ts.map +1 -1
- package/dist/capabilities/globCapability.js +6 -10
- package/dist/capabilities/globCapability.js.map +1 -1
- package/dist/capabilities/index.d.ts +1 -18
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/index.js +1 -18
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/orchestrationCapability.d.ts +2 -0
- package/dist/capabilities/orchestrationCapability.d.ts.map +1 -1
- package/dist/capabilities/orchestrationCapability.js +980 -2
- package/dist/capabilities/orchestrationCapability.js.map +1 -1
- package/dist/capabilities/searchCapability.d.ts +8 -2
- package/dist/capabilities/searchCapability.d.ts.map +1 -1
- package/dist/capabilities/searchCapability.js +11 -6
- package/dist/capabilities/searchCapability.js.map +1 -1
- package/dist/contracts/tools.schema.json +9 -133
- package/dist/core/aiErrorFixer.d.ts +1 -14
- package/dist/core/aiErrorFixer.d.ts.map +1 -1
- package/dist/core/aiErrorFixer.js +51 -239
- package/dist/core/aiErrorFixer.js.map +1 -1
- package/dist/core/alphaZeroEngine.d.ts +16 -256
- package/dist/core/alphaZeroEngine.d.ts.map +1 -1
- package/dist/core/alphaZeroEngine.js +22 -513
- package/dist/core/alphaZeroEngine.js.map +1 -1
- package/dist/core/completeAttackOrchestrator.d.ts +102 -0
- package/dist/core/completeAttackOrchestrator.d.ts.map +1 -0
- package/dist/core/completeAttackOrchestrator.js +293 -0
- package/dist/core/completeAttackOrchestrator.js.map +1 -0
- package/dist/core/defensiveSecurityToolkit.d.ts +373 -0
- package/dist/core/defensiveSecurityToolkit.d.ts.map +1 -0
- package/dist/core/defensiveSecurityToolkit.js +1304 -0
- package/dist/core/defensiveSecurityToolkit.js.map +1 -0
- package/dist/core/errors/errorTypes.d.ts +30 -57
- package/dist/core/errors/errorTypes.d.ts.map +1 -1
- package/dist/core/errors/errorTypes.js +51 -228
- package/dist/core/errors/errorTypes.js.map +1 -1
- package/dist/core/errors/safetyValidator.d.ts +19 -3
- package/dist/core/errors/safetyValidator.d.ts.map +1 -1
- package/dist/core/errors/safetyValidator.js +33 -71
- package/dist/core/errors/safetyValidator.js.map +1 -1
- package/dist/core/failureRecovery.d.ts +4 -100
- package/dist/core/failureRecovery.d.ts.map +1 -1
- package/dist/core/failureRecovery.js +16 -440
- package/dist/core/failureRecovery.js.map +1 -1
- package/dist/core/intelligentTargetResearcher.d.ts +142 -0
- package/dist/core/intelligentTargetResearcher.d.ts.map +1 -0
- package/dist/core/intelligentTargetResearcher.js +367 -0
- package/dist/core/intelligentTargetResearcher.js.map +1 -0
- package/dist/core/intelligentTestFlows.d.ts +26 -107
- package/dist/core/intelligentTestFlows.d.ts.map +1 -1
- package/dist/core/intelligentTestFlows.js +15 -659
- package/dist/core/intelligentTestFlows.js.map +1 -1
- package/dist/core/learningPersistence.d.ts +45 -132
- package/dist/core/learningPersistence.d.ts.map +1 -1
- package/dist/core/learningPersistence.js +32 -463
- package/dist/core/learningPersistence.js.map +1 -1
- package/dist/core/metricsTracker.d.ts +22 -139
- package/dist/core/metricsTracker.d.ts.map +1 -1
- package/dist/core/metricsTracker.js +51 -241
- package/dist/core/metricsTracker.js.map +1 -1
- package/dist/core/performanceMonitor.d.ts +15 -109
- package/dist/core/performanceMonitor.d.ts.map +1 -1
- package/dist/core/performanceMonitor.js +27 -184
- package/dist/core/performanceMonitor.js.map +1 -1
- package/dist/core/resultVerification.d.ts +6 -100
- package/dist/core/resultVerification.d.ts.map +1 -1
- package/dist/core/resultVerification.js +31 -400
- package/dist/core/resultVerification.js.map +1 -1
- package/dist/core/selfEvolution.d.ts +32 -126
- package/dist/core/selfEvolution.d.ts.map +1 -1
- package/dist/core/selfEvolution.js +24 -967
- package/dist/core/selfEvolution.js.map +1 -1
- package/dist/core/selfImprovement.d.ts +50 -109
- package/dist/core/selfImprovement.d.ts.map +1 -1
- package/dist/core/selfImprovement.js +14 -689
- package/dist/core/selfImprovement.js.map +1 -1
- package/dist/core/sourceCodeManager.d.ts +89 -0
- package/dist/core/sourceCodeManager.d.ts.map +1 -0
- package/dist/core/sourceCodeManager.js +332 -0
- package/dist/core/sourceCodeManager.js.map +1 -0
- package/dist/core/unifiedOrchestrator.d.ts +88 -0
- package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
- package/dist/core/unifiedOrchestrator.js +284 -0
- package/dist/core/unifiedOrchestrator.js.map +1 -0
- package/dist/core/userDefenseOrchestrator.d.ts +202 -0
- package/dist/core/userDefenseOrchestrator.d.ts.map +1 -0
- package/dist/core/userDefenseOrchestrator.js +1006 -0
- package/dist/core/userDefenseOrchestrator.js.map +1 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +36 -26
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +8 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +17 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +14 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +17 -54
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +9 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js +18 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +97 -2
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +1001 -6
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/tools/appleExposureTools.d.ts +108 -0
- package/dist/tools/appleExposureTools.d.ts.map +1 -0
- package/dist/tools/appleExposureTools.js +850 -0
- package/dist/tools/appleExposureTools.js.map +1 -0
- package/dist/tools/bidirectionalAuditTools.d.ts +104 -0
- package/dist/tools/bidirectionalAuditTools.d.ts.map +1 -0
- package/dist/tools/bidirectionalAuditTools.js +1280 -0
- package/dist/tools/bidirectionalAuditTools.js.map +1 -0
- package/dist/tools/defensiveSecurityTools.d.ts +152 -0
- package/dist/tools/defensiveSecurityTools.d.ts.map +1 -0
- package/dist/tools/defensiveSecurityTools.js +576 -0
- package/dist/tools/defensiveSecurityTools.js.map +1 -0
- package/dist/tools/forwardAttackChainTracer.d.ts +73 -0
- package/dist/tools/forwardAttackChainTracer.d.ts.map +1 -0
- package/dist/tools/forwardAttackChainTracer.js +604 -0
- package/dist/tools/forwardAttackChainTracer.js.map +1 -0
- package/dist/tools/localExplore.d.ts +12 -199
- package/dist/tools/localExplore.d.ts.map +1 -1
- package/dist/tools/localExplore.js +18 -1352
- package/dist/tools/localExplore.js.map +1 -1
- package/dist/tools/offensiveTransparencyTools.d.ts +188 -0
- package/dist/tools/offensiveTransparencyTools.d.ts.map +1 -0
- package/dist/tools/offensiveTransparencyTools.js +890 -0
- package/dist/tools/offensiveTransparencyTools.js.map +1 -0
- package/dist/tools/planningTools.d.ts +8 -17
- package/dist/tools/planningTools.d.ts.map +1 -1
- package/dist/tools/planningTools.js +31 -141
- package/dist/tools/planningTools.js.map +1 -1
- package/dist/tools/searchTools.d.ts +9 -0
- package/dist/tools/searchTools.d.ts.map +1 -1
- package/dist/tools/searchTools.js +305 -189
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/skillTools.d.ts +7 -5
- package/dist/tools/skillTools.d.ts.map +1 -1
- package/dist/tools/skillTools.js +13 -155
- package/dist/tools/skillTools.js.map +1 -1
- package/dist/tools/threatIntelligenceTools.d.ts +128 -0
- package/dist/tools/threatIntelligenceTools.d.ts.map +1 -0
- package/dist/tools/threatIntelligenceTools.js +712 -0
- package/dist/tools/threatIntelligenceTools.js.map +1 -0
- package/dist/ui/PromptController.d.ts +4 -0
- package/dist/ui/PromptController.d.ts.map +1 -1
- package/dist/ui/PromptController.js +32 -11
- package/dist/ui/PromptController.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +20 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +235 -28
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/dist/ui/animatedStatus.d.ts +2 -0
- package/dist/ui/animatedStatus.d.ts.map +1 -1
- package/dist/ui/animatedStatus.js +36 -2
- package/dist/ui/animatedStatus.js.map +1 -1
- package/dist/ui/orchestration/StatusOrchestrator.d.ts +10 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -1
- package/dist/ui/orchestration/StatusOrchestrator.js +36 -4
- package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -1
- package/package.json +1 -1
- package/dist/capabilities/advancedTestGenerationCapability.d.ts +0 -17
- package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +0 -1
- package/dist/capabilities/advancedTestGenerationCapability.js +0 -28
- package/dist/capabilities/advancedTestGenerationCapability.js.map +0 -1
- package/dist/capabilities/browserAutomationCapability.d.ts +0 -37
- package/dist/capabilities/browserAutomationCapability.d.ts.map +0 -1
- package/dist/capabilities/browserAutomationCapability.js +0 -49
- package/dist/capabilities/browserAutomationCapability.js.map +0 -1
- package/dist/capabilities/buildCapability.d.ts +0 -24
- package/dist/capabilities/buildCapability.d.ts.map +0 -1
- package/dist/capabilities/buildCapability.js +0 -25
- package/dist/capabilities/buildCapability.js.map +0 -1
- package/dist/capabilities/cloudCapability.d.ts +0 -13
- package/dist/capabilities/cloudCapability.d.ts.map +0 -1
- package/dist/capabilities/cloudCapability.js +0 -38
- package/dist/capabilities/cloudCapability.js.map +0 -1
- package/dist/capabilities/codeAnalysisCapability.d.ts +0 -13
- package/dist/capabilities/codeAnalysisCapability.d.ts.map +0 -1
- package/dist/capabilities/codeAnalysisCapability.js +0 -24
- package/dist/capabilities/codeAnalysisCapability.js.map +0 -1
- package/dist/capabilities/codeQualityCapability.d.ts +0 -13
- package/dist/capabilities/codeQualityCapability.d.ts.map +0 -1
- package/dist/capabilities/codeQualityCapability.js +0 -25
- package/dist/capabilities/codeQualityCapability.js.map +0 -1
- package/dist/capabilities/dependencySecurityCapability.d.ts +0 -13
- package/dist/capabilities/dependencySecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/dependencySecurityCapability.js +0 -24
- package/dist/capabilities/dependencySecurityCapability.js.map +0 -1
- package/dist/capabilities/devCapability.d.ts +0 -13
- package/dist/capabilities/devCapability.d.ts.map +0 -1
- package/dist/capabilities/devCapability.js +0 -24
- package/dist/capabilities/devCapability.js.map +0 -1
- package/dist/capabilities/emailCapability.d.ts +0 -12
- package/dist/capabilities/emailCapability.d.ts.map +0 -1
- package/dist/capabilities/emailCapability.js +0 -22
- package/dist/capabilities/emailCapability.js.map +0 -1
- package/dist/capabilities/enhancedAnalysisCapability.d.ts +0 -13
- package/dist/capabilities/enhancedAnalysisCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedAnalysisCapability.js +0 -20
- package/dist/capabilities/enhancedAnalysisCapability.js.map +0 -1
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +0 -17
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js +0 -28
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +0 -1
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +0 -17
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedDevWorkflowCapability.js +0 -28
- package/dist/capabilities/enhancedDevWorkflowCapability.js.map +0 -1
- package/dist/capabilities/frontendTestingCapability.d.ts +0 -13
- package/dist/capabilities/frontendTestingCapability.d.ts.map +0 -1
- package/dist/capabilities/frontendTestingCapability.js +0 -28
- package/dist/capabilities/frontendTestingCapability.js.map +0 -1
- package/dist/capabilities/interactionCapability.d.ts +0 -12
- package/dist/capabilities/interactionCapability.d.ts.map +0 -1
- package/dist/capabilities/interactionCapability.js +0 -22
- package/dist/capabilities/interactionCapability.js.map +0 -1
- package/dist/capabilities/learnCapability.d.ts +0 -22
- package/dist/capabilities/learnCapability.d.ts.map +0 -1
- package/dist/capabilities/learnCapability.js +0 -37
- package/dist/capabilities/learnCapability.js.map +0 -1
- package/dist/capabilities/notebookCapability.d.ts +0 -17
- package/dist/capabilities/notebookCapability.d.ts.map +0 -1
- package/dist/capabilities/notebookCapability.js +0 -27
- package/dist/capabilities/notebookCapability.js.map +0 -1
- package/dist/capabilities/planningCapability.d.ts +0 -16
- package/dist/capabilities/planningCapability.d.ts.map +0 -1
- package/dist/capabilities/planningCapability.js +0 -26
- package/dist/capabilities/planningCapability.js.map +0 -1
- package/dist/capabilities/refactoringCapability.d.ts +0 -13
- package/dist/capabilities/refactoringCapability.d.ts.map +0 -1
- package/dist/capabilities/refactoringCapability.js +0 -25
- package/dist/capabilities/refactoringCapability.js.map +0 -1
- package/dist/capabilities/repoChecksCapability.d.ts +0 -10
- package/dist/capabilities/repoChecksCapability.d.ts.map +0 -1
- package/dist/capabilities/repoChecksCapability.js +0 -24
- package/dist/capabilities/repoChecksCapability.js.map +0 -1
- package/dist/capabilities/taskManagementCapability.d.ts +0 -12
- package/dist/capabilities/taskManagementCapability.d.ts.map +0 -1
- package/dist/capabilities/taskManagementCapability.js +0 -22
- package/dist/capabilities/taskManagementCapability.js.map +0 -1
- package/dist/capabilities/testingCapability.d.ts +0 -13
- package/dist/capabilities/testingCapability.d.ts.map +0 -1
- package/dist/capabilities/testingCapability.js +0 -25
- package/dist/capabilities/testingCapability.js.map +0 -1
- package/dist/capabilities/validationCapability.d.ts +0 -13
- package/dist/capabilities/validationCapability.d.ts.map +0 -1
- package/dist/capabilities/validationCapability.js +0 -24
- package/dist/capabilities/validationCapability.js.map +0 -1
- package/dist/capabilities/webCapability.d.ts +0 -12
- package/dist/capabilities/webCapability.d.ts.map +0 -1
- package/dist/capabilities/webCapability.js +0 -22
- package/dist/capabilities/webCapability.js.map +0 -1
- package/dist/core/deepBugAnalyzer.d.ts +0 -128
- package/dist/core/deepBugAnalyzer.d.ts.map +0 -1
- package/dist/core/deepBugAnalyzer.js +0 -406
- package/dist/core/deepBugAnalyzer.js.map +0 -1
- package/dist/core/hypothesisEngine.d.ts +0 -113
- package/dist/core/hypothesisEngine.d.ts.map +0 -1
- package/dist/core/hypothesisEngine.js +0 -264
- package/dist/core/hypothesisEngine.js.map +0 -1
- package/dist/core/productTestHarness.d.ts +0 -113
- package/dist/core/productTestHarness.d.ts.map +0 -1
- package/dist/core/productTestHarness.js +0 -351
- package/dist/core/productTestHarness.js.map +0 -1
- package/dist/core/validationRunner.d.ts +0 -106
- package/dist/core/validationRunner.d.ts.map +0 -1
- package/dist/core/validationRunner.js +0 -892
- package/dist/core/validationRunner.js.map +0 -1
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts +0 -14
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/browser/browserAutomationPlugin.js +0 -26
- package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +0 -1
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +0 -3
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js +0 -14
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +0 -1
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts +0 -3
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/cloud/cloudPlugin.js +0 -14
- package/dist/plugins/tools/cloud/cloudPlugin.js.map +0 -1
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +0 -3
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -14
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +0 -1
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +0 -3
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +0 -14
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +0 -1
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +0 -3
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/dependency/dependencyPlugin.js +0 -12
- package/dist/plugins/tools/dependency/dependencyPlugin.js.map +0 -1
- package/dist/plugins/tools/development/devPlugin.d.ts +0 -3
- package/dist/plugins/tools/development/devPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/development/devPlugin.js +0 -14
- package/dist/plugins/tools/development/devPlugin.js.map +0 -1
- package/dist/plugins/tools/email/emailPlugin.d.ts +0 -3
- package/dist/plugins/tools/email/emailPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/email/emailPlugin.js +0 -12
- package/dist/plugins/tools/email/emailPlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js +0 -14
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js +0 -12
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js +0 -12
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js.map +0 -1
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts +0 -3
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +0 -14
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +0 -1
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts +0 -3
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/interaction/interactionPlugin.js +0 -12
- package/dist/plugins/tools/interaction/interactionPlugin.js.map +0 -1
- package/dist/plugins/tools/learn/learnPlugin.d.ts +0 -3
- package/dist/plugins/tools/learn/learnPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/learn/learnPlugin.js +0 -14
- package/dist/plugins/tools/learn/learnPlugin.js.map +0 -1
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts +0 -9
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/notebook/notebookPlugin.js +0 -15
- package/dist/plugins/tools/notebook/notebookPlugin.js.map +0 -1
- package/dist/plugins/tools/planning/planningPlugin.d.ts +0 -9
- package/dist/plugins/tools/planning/planningPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/planning/planningPlugin.js +0 -15
- package/dist/plugins/tools/planning/planningPlugin.js.map +0 -1
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +0 -3
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/refactoring/refactoringPlugin.js +0 -12
- package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +0 -1
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +0 -3
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +0 -12
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +0 -1
- package/dist/plugins/tools/testing/testingPlugin.d.ts +0 -3
- package/dist/plugins/tools/testing/testingPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/testing/testingPlugin.js +0 -12
- package/dist/plugins/tools/testing/testingPlugin.js.map +0 -1
- package/dist/plugins/tools/validation/validationPlugin.d.ts +0 -3
- package/dist/plugins/tools/validation/validationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/validation/validationPlugin.js +0 -14
- package/dist/plugins/tools/validation/validationPlugin.js.map +0 -1
- package/dist/plugins/tools/web/webPlugin.d.ts +0 -3
- package/dist/plugins/tools/web/webPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/web/webPlugin.js +0 -12
- package/dist/plugins/tools/web/webPlugin.js.map +0 -1
- package/dist/tools/advancedTestGenerationTools.d.ts +0 -21
- package/dist/tools/advancedTestGenerationTools.d.ts.map +0 -1
- package/dist/tools/advancedTestGenerationTools.js +0 -304
- package/dist/tools/advancedTestGenerationTools.js.map +0 -1
- package/dist/tools/browserAutomationTools.d.ts +0 -23
- package/dist/tools/browserAutomationTools.d.ts.map +0 -1
- package/dist/tools/browserAutomationTools.js +0 -916
- package/dist/tools/browserAutomationTools.js.map +0 -1
- package/dist/tools/buildTools.d.ts +0 -9
- package/dist/tools/buildTools.d.ts.map +0 -1
- package/dist/tools/buildTools.js +0 -346
- package/dist/tools/buildTools.js.map +0 -1
- package/dist/tools/cloudTools.d.ts +0 -49
- package/dist/tools/cloudTools.d.ts.map +0 -1
- package/dist/tools/cloudTools.js +0 -1258
- package/dist/tools/cloudTools.js.map +0 -1
- package/dist/tools/codeAnalysisTools.d.ts +0 -74
- package/dist/tools/codeAnalysisTools.d.ts.map +0 -1
- package/dist/tools/codeAnalysisTools.js +0 -664
- package/dist/tools/codeAnalysisTools.js.map +0 -1
- package/dist/tools/codeGenerationTools.d.ts +0 -3
- package/dist/tools/codeGenerationTools.d.ts.map +0 -1
- package/dist/tools/codeGenerationTools.js +0 -439
- package/dist/tools/codeGenerationTools.js.map +0 -1
- package/dist/tools/codeQualityTools.d.ts +0 -3
- package/dist/tools/codeQualityTools.d.ts.map +0 -1
- package/dist/tools/codeQualityTools.js +0 -297
- package/dist/tools/codeQualityTools.js.map +0 -1
- package/dist/tools/dependencyTools.d.ts +0 -3
- package/dist/tools/dependencyTools.d.ts.map +0 -1
- package/dist/tools/dependencyTools.js +0 -284
- package/dist/tools/dependencyTools.js.map +0 -1
- package/dist/tools/devTools.d.ts +0 -10
- package/dist/tools/devTools.d.ts.map +0 -1
- package/dist/tools/devTools.js +0 -2126
- package/dist/tools/devTools.js.map +0 -1
- package/dist/tools/emailTools.d.ts +0 -21
- package/dist/tools/emailTools.d.ts.map +0 -1
- package/dist/tools/emailTools.js +0 -449
- package/dist/tools/emailTools.js.map +0 -1
- package/dist/tools/enhancedAnalysisTools.d.ts +0 -9
- package/dist/tools/enhancedAnalysisTools.d.ts.map +0 -1
- package/dist/tools/enhancedAnalysisTools.js +0 -370
- package/dist/tools/enhancedAnalysisTools.js.map +0 -1
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts +0 -7
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +0 -1
- package/dist/tools/enhancedCodeIntelligenceTools.js +0 -540
- package/dist/tools/enhancedCodeIntelligenceTools.js.map +0 -1
- package/dist/tools/enhancedDevWorkflowTools.d.ts +0 -7
- package/dist/tools/enhancedDevWorkflowTools.d.ts.map +0 -1
- package/dist/tools/enhancedDevWorkflowTools.js +0 -432
- package/dist/tools/enhancedDevWorkflowTools.js.map +0 -1
- package/dist/tools/frontendTestingTools.d.ts +0 -35
- package/dist/tools/frontendTestingTools.d.ts.map +0 -1
- package/dist/tools/frontendTestingTools.js +0 -1258
- package/dist/tools/frontendTestingTools.js.map +0 -1
- package/dist/tools/globTools.d.ts +0 -15
- package/dist/tools/globTools.d.ts.map +0 -1
- package/dist/tools/globTools.js +0 -174
- package/dist/tools/globTools.js.map +0 -1
- package/dist/tools/grepTools.d.ts +0 -19
- package/dist/tools/grepTools.d.ts.map +0 -1
- package/dist/tools/grepTools.js +0 -411
- package/dist/tools/grepTools.js.map +0 -1
- package/dist/tools/interactionTools.d.ts +0 -6
- package/dist/tools/interactionTools.d.ts.map +0 -1
- package/dist/tools/interactionTools.js +0 -209
- package/dist/tools/interactionTools.js.map +0 -1
- package/dist/tools/learnTools.d.ts +0 -164
- package/dist/tools/learnTools.d.ts.map +0 -1
- package/dist/tools/learnTools.js +0 -2098
- package/dist/tools/learnTools.js.map +0 -1
- package/dist/tools/notebookEditTools.d.ts +0 -15
- package/dist/tools/notebookEditTools.d.ts.map +0 -1
- package/dist/tools/notebookEditTools.js +0 -197
- package/dist/tools/notebookEditTools.js.map +0 -1
- package/dist/tools/refactoringTools.d.ts +0 -3
- package/dist/tools/refactoringTools.d.ts.map +0 -1
- package/dist/tools/refactoringTools.js +0 -294
- package/dist/tools/refactoringTools.js.map +0 -1
- package/dist/tools/repoChecksTools.d.ts +0 -3
- package/dist/tools/repoChecksTools.d.ts.map +0 -1
- package/dist/tools/repoChecksTools.js +0 -276
- package/dist/tools/repoChecksTools.js.map +0 -1
- package/dist/tools/taskManagementTools.d.ts +0 -10
- package/dist/tools/taskManagementTools.d.ts.map +0 -1
- package/dist/tools/taskManagementTools.js +0 -133
- package/dist/tools/taskManagementTools.js.map +0 -1
- package/dist/tools/testingTools.d.ts +0 -3
- package/dist/tools/testingTools.d.ts.map +0 -1
- package/dist/tools/testingTools.js +0 -237
- package/dist/tools/testingTools.js.map +0 -1
- package/dist/tools/validationTools.d.ts +0 -7
- package/dist/tools/validationTools.d.ts.map +0 -1
- package/dist/tools/validationTools.js +0 -344
- package/dist/tools/validationTools.js.map +0 -1
- package/dist/tools/webTools.d.ts +0 -3
- package/dist/tools/webTools.d.ts.map +0 -1
- package/dist/tools/webTools.js +0 -502
- package/dist/tools/webTools.js.map +0 -1
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deep Bug Analyzer with Multi-Causal Investigation
|
|
3
|
-
*
|
|
4
|
-
* This module provides comprehensive bug analysis that investigates multiple
|
|
5
|
-
* potential causes rather than stopping at the first plausible explanation.
|
|
6
|
-
*/
|
|
7
|
-
import { BugHypothesisAnalyzer } from './hypothesisEngine.js';
|
|
8
|
-
import { ProductTestHarness } from './productTestHarness.js';
|
|
9
|
-
/**
|
|
10
|
-
* Deep Bug Analyzer - Investigates multiple potential causes systematically
|
|
11
|
-
*/
|
|
12
|
-
export class DeepBugAnalyzer {
|
|
13
|
-
hypothesisAnalyzer;
|
|
14
|
-
testHarness;
|
|
15
|
-
constructor() {
|
|
16
|
-
this.hypothesisAnalyzer = new BugHypothesisAnalyzer();
|
|
17
|
-
this.testHarness = new ProductTestHarness();
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Analyze a bug by investigating all potential causes
|
|
21
|
-
*/
|
|
22
|
-
async analyze(bug, _codeContext, // filename -> content
|
|
23
|
-
depth = 'deep') {
|
|
24
|
-
// Extract observations from bug report
|
|
25
|
-
const observations = this.extractObservations(bug);
|
|
26
|
-
// Generate causal factors across different categories
|
|
27
|
-
const causalFactors = await this.generateCausalFactors(bug, _codeContext, observations, depth);
|
|
28
|
-
// Analyze using hypothesis engine
|
|
29
|
-
const { allHypotheses } = await this.hypothesisAnalyzer.analyzeBug(bug.description, observations, async (hypothesis) => this.generateTestsForHypothesis(hypothesis, bug, _codeContext));
|
|
30
|
-
// Link hypotheses to causal factors
|
|
31
|
-
this.linkHypothesesToFactors(allHypotheses, causalFactors);
|
|
32
|
-
// Rank causal factors by evidence
|
|
33
|
-
const rankedFactors = this.rankCausalFactors(causalFactors);
|
|
34
|
-
// Generate recommended actions
|
|
35
|
-
const recommendedActions = this.generateRecommendedActions(rankedFactors, allHypotheses);
|
|
36
|
-
// Calculate overall confidence
|
|
37
|
-
const confidence = this.calculateAnalysisConfidence(rankedFactors, allHypotheses);
|
|
38
|
-
// Extract test results
|
|
39
|
-
const testResults = allHypotheses
|
|
40
|
-
.filter(h => h.testResults && h.testResults.length > 0)
|
|
41
|
-
.flatMap(h => h.testResults.map(t => ({
|
|
42
|
-
hypothesis: h.description,
|
|
43
|
-
passed: t.passed,
|
|
44
|
-
output: t.output,
|
|
45
|
-
})));
|
|
46
|
-
return {
|
|
47
|
-
primaryCause: rankedFactors[0] || null,
|
|
48
|
-
contributingFactors: rankedFactors.slice(1),
|
|
49
|
-
allHypotheses,
|
|
50
|
-
testResults,
|
|
51
|
-
recommendedActions,
|
|
52
|
-
confidence,
|
|
53
|
-
analysisDepth: depth,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Extract observations from bug report
|
|
58
|
-
*/
|
|
59
|
-
extractObservations(bug) {
|
|
60
|
-
const observations = [];
|
|
61
|
-
observations.push(`Bug: ${bug.description}`);
|
|
62
|
-
if (bug.expectedBehavior) {
|
|
63
|
-
observations.push(`Expected: ${bug.expectedBehavior}`);
|
|
64
|
-
}
|
|
65
|
-
if (bug.actualBehavior) {
|
|
66
|
-
observations.push(`Actual: ${bug.actualBehavior}`);
|
|
67
|
-
}
|
|
68
|
-
if (bug.stackTrace) {
|
|
69
|
-
observations.push(`Stack trace indicates: ${this.extractKeyFromStackTrace(bug.stackTrace)}`);
|
|
70
|
-
}
|
|
71
|
-
if (bug.environment) {
|
|
72
|
-
Object.entries(bug.environment).forEach(([key, value]) => {
|
|
73
|
-
observations.push(`Environment ${key}: ${value}`);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return observations;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Extract key information from stack trace
|
|
80
|
-
*/
|
|
81
|
-
extractKeyFromStackTrace(stackTrace) {
|
|
82
|
-
const lines = stackTrace.split('\n');
|
|
83
|
-
const errorLine = lines[0] || '';
|
|
84
|
-
const firstStackLine = lines.find(l => l.trim().startsWith('at '));
|
|
85
|
-
if (firstStackLine) {
|
|
86
|
-
return `${errorLine} (${firstStackLine.trim()})`;
|
|
87
|
-
}
|
|
88
|
-
return errorLine;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Generate causal factors across different categories
|
|
92
|
-
*/
|
|
93
|
-
async generateCausalFactors(bug, _codeContext, observations, depth) {
|
|
94
|
-
const factors = [];
|
|
95
|
-
// Code-level factors
|
|
96
|
-
factors.push(...this.analyzeCodeFactors(bug, _codeContext));
|
|
97
|
-
// Configuration factors
|
|
98
|
-
factors.push(...this.analyzeConfigurationFactors(bug));
|
|
99
|
-
// Environment factors
|
|
100
|
-
factors.push(...this.analyzeEnvironmentFactors(bug));
|
|
101
|
-
// Data factors
|
|
102
|
-
factors.push(...this.analyzeDataFactors(bug, observations));
|
|
103
|
-
// Timing/concurrency factors
|
|
104
|
-
factors.push(...this.analyzeTimingFactors(bug));
|
|
105
|
-
// Dependency factors
|
|
106
|
-
if (depth === 'deep' || depth === 'exhaustive') {
|
|
107
|
-
factors.push(...this.analyzeDependencyFactors(bug));
|
|
108
|
-
}
|
|
109
|
-
return factors;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Analyze code-level factors
|
|
113
|
-
*/
|
|
114
|
-
analyzeCodeFactors(bug, _codeContext) {
|
|
115
|
-
const factors = [];
|
|
116
|
-
// Check for common code patterns that cause bugs
|
|
117
|
-
for (const [filename, content] of _codeContext) {
|
|
118
|
-
// Null/undefined checks
|
|
119
|
-
if (this.hasUncheckedNullAccess(content)) {
|
|
120
|
-
factors.push({
|
|
121
|
-
category: 'code',
|
|
122
|
-
description: `Potential null/undefined access in ${filename}`,
|
|
123
|
-
likelihood: 0.7,
|
|
124
|
-
evidence: ['Code contains property access without null checks'],
|
|
125
|
-
suggestedFix: 'Add null/undefined checks before accessing properties',
|
|
126
|
-
relatedHypotheses: [],
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
// Async/await issues
|
|
130
|
-
if (this.hasMissingAwait(content)) {
|
|
131
|
-
factors.push({
|
|
132
|
-
category: 'code',
|
|
133
|
-
description: `Missing await on async function in ${filename}`,
|
|
134
|
-
likelihood: 0.6,
|
|
135
|
-
evidence: ['Async function called without await'],
|
|
136
|
-
suggestedFix: 'Add await keyword to async function calls',
|
|
137
|
-
relatedHypotheses: [],
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
// Type mismatches
|
|
141
|
-
if (this.hasTypeCoercionIssues(content)) {
|
|
142
|
-
factors.push({
|
|
143
|
-
category: 'code',
|
|
144
|
-
description: `Potential type coercion issue in ${filename}`,
|
|
145
|
-
likelihood: 0.5,
|
|
146
|
-
evidence: ['Code contains == instead of === comparisons'],
|
|
147
|
-
suggestedFix: 'Use strict equality (===) instead of loose equality (==)',
|
|
148
|
-
relatedHypotheses: [],
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return factors;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Check for unchecked null/undefined access
|
|
156
|
-
*/
|
|
157
|
-
hasUncheckedNullAccess(code) {
|
|
158
|
-
// Simple heuristic: look for property access without null checks nearby
|
|
159
|
-
const propertyAccessPattern = /\w+\.\w+/g;
|
|
160
|
-
const nullCheckPattern = /if\s*\([^)]*!==?\s*null|if\s*\([^)]*!==?\s*undefined|\?\./g;
|
|
161
|
-
const hasPropertyAccess = propertyAccessPattern.test(code);
|
|
162
|
-
const hasNullChecks = nullCheckPattern.test(code);
|
|
163
|
-
return hasPropertyAccess && !hasNullChecks;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Check for missing await on async functions
|
|
167
|
-
*/
|
|
168
|
-
hasMissingAwait(code) {
|
|
169
|
-
// Look for async function calls without await
|
|
170
|
-
const asyncCallPattern = /(\w+)\s*\([^)]*\)\s*(?!\.then|\.catch)/g;
|
|
171
|
-
const awaitPattern = /await\s+/g;
|
|
172
|
-
const asyncCalls = code.match(asyncCallPattern) || [];
|
|
173
|
-
const awaits = code.match(awaitPattern) || [];
|
|
174
|
-
return asyncCalls.length > awaits.length;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Check for type coercion issues
|
|
178
|
-
*/
|
|
179
|
-
hasTypeCoercionIssues(code) {
|
|
180
|
-
return /==(?!=)/g.test(code); // Look for == but not ===
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Analyze configuration factors
|
|
184
|
-
*/
|
|
185
|
-
analyzeConfigurationFactors(bug) {
|
|
186
|
-
const factors = [];
|
|
187
|
-
if (bug.environment) {
|
|
188
|
-
// Check for common configuration issues
|
|
189
|
-
const nodeEnv = bug.environment['NODE_ENV'];
|
|
190
|
-
if (nodeEnv === 'production' && bug.description.includes('development')) {
|
|
191
|
-
factors.push({
|
|
192
|
-
category: 'configuration',
|
|
193
|
-
description: 'Environment mismatch: running production code with development expectations',
|
|
194
|
-
likelihood: 0.8,
|
|
195
|
-
evidence: ['NODE_ENV is production but bug mentions development'],
|
|
196
|
-
suggestedFix: 'Ensure environment variables match intended runtime',
|
|
197
|
-
relatedHypotheses: [],
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return factors;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Analyze environment factors
|
|
205
|
-
*/
|
|
206
|
-
analyzeEnvironmentFactors(bug) {
|
|
207
|
-
const factors = [];
|
|
208
|
-
if (bug.environment) {
|
|
209
|
-
const nodeVersion = bug.environment['NODE_VERSION'];
|
|
210
|
-
if (nodeVersion && typeof nodeVersion === 'string' && parseFloat(nodeVersion) < 18) {
|
|
211
|
-
factors.push({
|
|
212
|
-
category: 'environment',
|
|
213
|
-
description: 'Node.js version may not support required features',
|
|
214
|
-
likelihood: 0.6,
|
|
215
|
-
evidence: [`Node version ${nodeVersion} is below recommended 18+`],
|
|
216
|
-
suggestedFix: 'Upgrade to Node.js 18 or higher',
|
|
217
|
-
relatedHypotheses: [],
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return factors;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Analyze data-related factors
|
|
225
|
-
*/
|
|
226
|
-
analyzeDataFactors(bug, observations) {
|
|
227
|
-
const factors = [];
|
|
228
|
-
// Check for data-related keywords in observations
|
|
229
|
-
const dataKeywords = ['empty', 'null', 'undefined', 'missing', 'invalid'];
|
|
230
|
-
const hasDataIssue = observations.some(obs => dataKeywords.some(keyword => obs.toLowerCase().includes(keyword)));
|
|
231
|
-
if (hasDataIssue) {
|
|
232
|
-
factors.push({
|
|
233
|
-
category: 'data',
|
|
234
|
-
description: 'Input data validation or handling issue',
|
|
235
|
-
likelihood: 0.65,
|
|
236
|
-
evidence: observations.filter(obs => dataKeywords.some(keyword => obs.toLowerCase().includes(keyword))),
|
|
237
|
-
suggestedFix: 'Add input validation and handle edge cases (null, undefined, empty)',
|
|
238
|
-
relatedHypotheses: [],
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
return factors;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Analyze timing/concurrency factors
|
|
245
|
-
*/
|
|
246
|
-
analyzeTimingFactors(bug) {
|
|
247
|
-
const factors = [];
|
|
248
|
-
const timingKeywords = ['race', 'timing', 'concurrent', 'async', 'promise', 'setTimeout'];
|
|
249
|
-
const hasTimingIssue = timingKeywords.some(keyword => bug.description.toLowerCase().includes(keyword));
|
|
250
|
-
if (hasTimingIssue) {
|
|
251
|
-
factors.push({
|
|
252
|
-
category: 'timing',
|
|
253
|
-
description: 'Race condition or async timing issue',
|
|
254
|
-
likelihood: 0.7,
|
|
255
|
-
evidence: ['Bug description mentions timing-related keywords'],
|
|
256
|
-
suggestedFix: 'Review async code flow and add proper synchronization',
|
|
257
|
-
relatedHypotheses: [],
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
return factors;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Analyze dependency factors
|
|
264
|
-
*/
|
|
265
|
-
analyzeDependencyFactors(bug) {
|
|
266
|
-
const factors = [];
|
|
267
|
-
// Check stack trace for dependency mentions
|
|
268
|
-
if (bug.stackTrace) {
|
|
269
|
-
const nodeModulesPattern = /node_modules[/\\]([^/\\]+)/g;
|
|
270
|
-
const matches = [...bug.stackTrace.matchAll(nodeModulesPattern)];
|
|
271
|
-
if (matches.length > 0) {
|
|
272
|
-
const dependencies = [...new Set(matches.map(m => m[1]))];
|
|
273
|
-
factors.push({
|
|
274
|
-
category: 'dependency',
|
|
275
|
-
description: `Potential issue in dependencies: ${dependencies.join(', ')}`,
|
|
276
|
-
likelihood: 0.5,
|
|
277
|
-
evidence: [`Stack trace includes: ${dependencies.join(', ')}`],
|
|
278
|
-
suggestedFix: 'Check dependency versions and update if needed',
|
|
279
|
-
relatedHypotheses: [],
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return factors;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Generate tests for a hypothesis
|
|
287
|
-
*/
|
|
288
|
-
async generateTestsForHypothesis(hypothesis, bug, _codeContext) {
|
|
289
|
-
const tests = [];
|
|
290
|
-
// Generate test based on hypothesis description
|
|
291
|
-
if (hypothesis.description.includes('null')) {
|
|
292
|
-
tests.push({
|
|
293
|
-
name: 'null_input_test',
|
|
294
|
-
description: 'Test with null input',
|
|
295
|
-
execute: async () => {
|
|
296
|
-
// Simple test - in real implementation would execute against actual code
|
|
297
|
-
return !bug.description.toLowerCase().includes('null');
|
|
298
|
-
},
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
if (hypothesis.description.includes('async') || hypothesis.description.includes('timing')) {
|
|
302
|
-
tests.push({
|
|
303
|
-
name: 'async_timing_test',
|
|
304
|
-
description: 'Test async timing behavior',
|
|
305
|
-
execute: async () => {
|
|
306
|
-
return !bug.description.toLowerCase().includes('race');
|
|
307
|
-
},
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
if (hypothesis.description.includes('type')) {
|
|
311
|
-
tests.push({
|
|
312
|
-
name: 'type_check_test',
|
|
313
|
-
description: 'Test type handling',
|
|
314
|
-
execute: async () => {
|
|
315
|
-
return !bug.description.toLowerCase().includes('type error');
|
|
316
|
-
},
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
return tests;
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Link hypotheses to causal factors
|
|
323
|
-
*/
|
|
324
|
-
linkHypothesesToFactors(hypotheses, factors) {
|
|
325
|
-
for (const hypothesis of hypotheses) {
|
|
326
|
-
for (const factor of factors) {
|
|
327
|
-
// Simple keyword matching - could be more sophisticated
|
|
328
|
-
const hypothesisKeywords = hypothesis.description.toLowerCase().split(' ');
|
|
329
|
-
const factorKeywords = factor.description.toLowerCase().split(' ');
|
|
330
|
-
const overlap = hypothesisKeywords.filter(k => factorKeywords.includes(k));
|
|
331
|
-
if (overlap.length > 2) {
|
|
332
|
-
factor.relatedHypotheses.push(hypothesis.id);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Rank causal factors by likelihood and evidence
|
|
339
|
-
*/
|
|
340
|
-
rankCausalFactors(factors) {
|
|
341
|
-
return factors.sort((a, b) => {
|
|
342
|
-
// First sort by likelihood
|
|
343
|
-
if (Math.abs(a.likelihood - b.likelihood) > 0.1) {
|
|
344
|
-
return b.likelihood - a.likelihood;
|
|
345
|
-
}
|
|
346
|
-
// Then by amount of evidence
|
|
347
|
-
return b.evidence.length - a.evidence.length;
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Generate recommended actions
|
|
352
|
-
*/
|
|
353
|
-
generateRecommendedActions(factors, hypotheses) {
|
|
354
|
-
const actions = [];
|
|
355
|
-
// Add actions from top causal factors
|
|
356
|
-
factors.slice(0, 5).forEach((factor, index) => {
|
|
357
|
-
if (factor.suggestedFix) {
|
|
358
|
-
actions.push(`${index + 1}. ${factor.suggestedFix} (${(factor.likelihood * 100).toFixed(0)}% likely)`);
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
// Add actions from validated hypotheses
|
|
362
|
-
const validated = hypotheses.filter(h => h.status === 'validated');
|
|
363
|
-
if (validated.length > 0) {
|
|
364
|
-
actions.push('\nValidated hypothesis-based actions:');
|
|
365
|
-
validated.forEach(h => {
|
|
366
|
-
actions.push(`- Address: ${h.description}`);
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
return actions;
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Calculate overall analysis confidence
|
|
373
|
-
*/
|
|
374
|
-
calculateAnalysisConfidence(factors, hypotheses) {
|
|
375
|
-
if (factors.length === 0)
|
|
376
|
-
return 0;
|
|
377
|
-
// Base confidence on top factor likelihood
|
|
378
|
-
const topFactorConfidence = factors[0]?.likelihood || 0;
|
|
379
|
-
// Boost if we have validated hypotheses
|
|
380
|
-
const validatedCount = hypotheses.filter(h => h.status === 'validated').length;
|
|
381
|
-
const validatedBoost = Math.min(0.2, validatedCount * 0.05);
|
|
382
|
-
// Penalty if we have many equally likely factors (uncertainty)
|
|
383
|
-
const topThree = factors.slice(0, 3);
|
|
384
|
-
const likelihoodVariance = this.calculateVariance(topThree.map(f => f.likelihood));
|
|
385
|
-
const uncertaintyPenalty = likelihoodVariance < 0.05 ? 0.1 : 0;
|
|
386
|
-
return Math.max(0, Math.min(1, topFactorConfidence + validatedBoost - uncertaintyPenalty));
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Calculate variance of numbers
|
|
390
|
-
*/
|
|
391
|
-
calculateVariance(numbers) {
|
|
392
|
-
if (numbers.length === 0)
|
|
393
|
-
return 0;
|
|
394
|
-
const mean = numbers.reduce((sum, n) => sum + n, 0) / numbers.length;
|
|
395
|
-
const squaredDiffs = numbers.map(n => Math.pow(n - mean, 2));
|
|
396
|
-
return squaredDiffs.reduce((sum, d) => sum + d, 0) / numbers.length;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Clear analysis state
|
|
400
|
-
*/
|
|
401
|
-
clear() {
|
|
402
|
-
this.hypothesisAnalyzer.clear();
|
|
403
|
-
this.testHarness.clear();
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
//# sourceMappingURL=deepBugAnalyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deepBugAnalyzer.js","sourceRoot":"","sources":["../../src/core/deepBugAnalyzer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,qBAAqB,EAAwC,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgC7D;;GAEG;AACH,MAAM,OAAO,eAAe;IAClB,kBAAkB,CAAwB;IAC1C,WAAW,CAAqB;IAExC;QACE,IAAI,CAAC,kBAAkB,GAAG,IAAI,qBAAqB,EAAE,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAC9C,CAAC;IAED;;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AAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;QACrE,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7D,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced AI Reasoning Engine with Hypothesis Testing
|
|
3
|
-
*
|
|
4
|
-
* This module provides multi-hypothesis reasoning capabilities to ensure
|
|
5
|
-
* correct AI operations by testing multiple approaches before settling on
|
|
6
|
-
* a solution.
|
|
7
|
-
*/
|
|
8
|
-
export interface Hypothesis {
|
|
9
|
-
id: string;
|
|
10
|
-
description: string;
|
|
11
|
-
confidence: number;
|
|
12
|
-
evidence: Evidence[];
|
|
13
|
-
testResults?: TestResult[];
|
|
14
|
-
status: 'pending' | 'testing' | 'validated' | 'rejected';
|
|
15
|
-
}
|
|
16
|
-
export interface Evidence {
|
|
17
|
-
type: 'observation' | 'data' | 'test_result' | 'user_feedback';
|
|
18
|
-
content: string;
|
|
19
|
-
weight: number;
|
|
20
|
-
timestamp: Date;
|
|
21
|
-
}
|
|
22
|
-
export interface TestResult {
|
|
23
|
-
testName: string;
|
|
24
|
-
passed: boolean;
|
|
25
|
-
output: string;
|
|
26
|
-
duration: number;
|
|
27
|
-
timestamp: Date;
|
|
28
|
-
}
|
|
29
|
-
export interface HypothesisTest {
|
|
30
|
-
name: string;
|
|
31
|
-
execute: () => Promise<boolean>;
|
|
32
|
-
description: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Engine for generating, testing, and validating hypotheses
|
|
36
|
-
*/
|
|
37
|
-
export declare class HypothesisEngine {
|
|
38
|
-
private hypotheses;
|
|
39
|
-
private readonly maxHypotheses;
|
|
40
|
-
constructor(maxHypotheses?: number);
|
|
41
|
-
/**
|
|
42
|
-
* Generate a new hypothesis
|
|
43
|
-
*/
|
|
44
|
-
generateHypothesis(description: string, initialEvidence?: Evidence[]): Hypothesis;
|
|
45
|
-
/**
|
|
46
|
-
* Add evidence to a hypothesis and update confidence
|
|
47
|
-
*/
|
|
48
|
-
addEvidence(hypothesisId: string, evidence: Evidence): void;
|
|
49
|
-
/**
|
|
50
|
-
* Test a hypothesis with a set of tests
|
|
51
|
-
*/
|
|
52
|
-
testHypothesis(hypothesisId: string, tests: HypothesisTest[]): Promise<TestResult[]>;
|
|
53
|
-
/**
|
|
54
|
-
* Get the most promising hypothesis based on confidence
|
|
55
|
-
*/
|
|
56
|
-
getBestHypothesis(): Hypothesis | null;
|
|
57
|
-
/**
|
|
58
|
-
* Get all hypotheses sorted by confidence
|
|
59
|
-
*/
|
|
60
|
-
getAllHypotheses(): Hypothesis[];
|
|
61
|
-
/**
|
|
62
|
-
* Get hypothesis by ID
|
|
63
|
-
*/
|
|
64
|
-
getHypothesis(id: string): Hypothesis | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Clear all hypotheses
|
|
67
|
-
*/
|
|
68
|
-
clear(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Calculate initial confidence based on evidence
|
|
71
|
-
*/
|
|
72
|
-
private calculateInitialConfidence;
|
|
73
|
-
/**
|
|
74
|
-
* Recalculate confidence based on all evidence
|
|
75
|
-
*/
|
|
76
|
-
private recalculateConfidence;
|
|
77
|
-
/**
|
|
78
|
-
* Prune low-confidence hypotheses if we exceed max
|
|
79
|
-
*/
|
|
80
|
-
private pruneHypotheses;
|
|
81
|
-
/**
|
|
82
|
-
* Generate unique ID for hypothesis
|
|
83
|
-
*/
|
|
84
|
-
private generateId;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Multi-hypothesis bug analyzer
|
|
88
|
-
*/
|
|
89
|
-
export declare class BugHypothesisAnalyzer {
|
|
90
|
-
private engine;
|
|
91
|
-
constructor();
|
|
92
|
-
/**
|
|
93
|
-
* Analyze a bug by generating and testing multiple hypotheses
|
|
94
|
-
*/
|
|
95
|
-
analyzeBug(bugDescription: string, observations: string[], testFunction: (hypothesis: Hypothesis) => Promise<HypothesisTest[]>): Promise<{
|
|
96
|
-
mostLikely: Hypothesis | null;
|
|
97
|
-
allHypotheses: Hypothesis[];
|
|
98
|
-
recommendation: string;
|
|
99
|
-
}>;
|
|
100
|
-
/**
|
|
101
|
-
* Generate multiple hypotheses for a bug
|
|
102
|
-
*/
|
|
103
|
-
private generateBugHypotheses;
|
|
104
|
-
/**
|
|
105
|
-
* Generate recommendation based on hypothesis analysis
|
|
106
|
-
*/
|
|
107
|
-
private generateRecommendation;
|
|
108
|
-
/**
|
|
109
|
-
* Clear analysis state
|
|
110
|
-
*/
|
|
111
|
-
clear(): void;
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=hypothesisEngine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hypothesisEngine.d.ts","sourceRoot":"","sources":["../../src/core/hypothesisEngine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,UA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