@grafema/core 0.2.4-beta → 0.2.5-beta
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/dist/Orchestrator.d.ts +37 -0
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +322 -35
- package/dist/Orchestrator.js.map +1 -0
- package/dist/api/GraphAPI.d.ts +1 -1
- package/dist/api/GraphAPI.d.ts.map +1 -1
- package/dist/api/GraphAPI.js +3 -1
- package/dist/api/GraphAPI.js.map +1 -0
- package/dist/api/GuaranteeAPI.d.ts.map +1 -1
- package/dist/api/GuaranteeAPI.js +4 -2
- package/dist/api/GuaranteeAPI.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +66 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -1
- package/dist/config/ConfigLoader.js +77 -3
- package/dist/config/ConfigLoader.js.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/config/index.js.map +1 -0
- package/dist/core/ASTWorker.d.ts.map +1 -1
- package/dist/core/ASTWorker.js +6 -4
- package/dist/core/ASTWorker.js.map +1 -0
- package/dist/core/ASTWorkerPool.js +2 -1
- package/dist/core/ASTWorkerPool.js.map +1 -0
- package/dist/core/AnalysisQueue.js +1 -0
- package/dist/core/AnalysisQueue.js.map +1 -0
- package/dist/core/CoverageAnalyzer.d.ts.map +1 -1
- package/dist/core/CoverageAnalyzer.js +1 -0
- package/dist/core/CoverageAnalyzer.js.map +1 -0
- package/dist/core/FileExplainer.js +1 -0
- package/dist/core/FileExplainer.js.map +1 -0
- package/dist/core/FileNodeManager.d.ts.map +1 -1
- package/dist/core/FileNodeManager.js +4 -2
- package/dist/core/FileNodeManager.js.map +1 -0
- package/dist/core/GraphBackend.js +1 -0
- package/dist/core/GraphBackend.js.map +1 -0
- package/dist/core/GraphFreshnessChecker.js +1 -0
- package/dist/core/GraphFreshnessChecker.js.map +1 -0
- package/dist/core/GuaranteeManager.js +2 -1
- package/dist/core/GuaranteeManager.js.map +1 -0
- package/dist/core/HashUtils.js +1 -0
- package/dist/core/HashUtils.js.map +1 -0
- package/dist/core/IncrementalReanalyzer.d.ts.map +1 -1
- package/dist/core/IncrementalReanalyzer.js +7 -3
- package/dist/core/IncrementalReanalyzer.js.map +1 -0
- package/dist/core/ManifestStore.js +1 -0
- package/dist/core/ManifestStore.js.map +1 -0
- package/dist/core/NodeFactory.d.ts +54 -34
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +20 -1
- package/dist/core/NodeFactory.js.map +1 -0
- package/dist/core/NodeId.js +1 -0
- package/dist/core/NodeId.js.map +1 -0
- package/dist/core/PriorityQueue.js +1 -0
- package/dist/core/PriorityQueue.js.map +1 -0
- package/dist/core/Profiler.js +1 -0
- package/dist/core/Profiler.js.map +1 -0
- package/dist/core/ScopeTracker.js +1 -0
- package/dist/core/ScopeTracker.js.map +1 -0
- package/dist/core/SemanticId.js +1 -0
- package/dist/core/SemanticId.js.map +1 -0
- package/dist/core/Task.js +1 -0
- package/dist/core/Task.js.map +1 -0
- package/dist/core/TaskTypes.js +1 -0
- package/dist/core/TaskTypes.js.map +1 -0
- package/dist/core/VersionManager.js +1 -0
- package/dist/core/VersionManager.js.map +1 -0
- package/dist/core/WorkerPool.d.ts.map +1 -1
- package/dist/core/WorkerPool.js +3 -1
- package/dist/core/WorkerPool.js.map +1 -0
- package/dist/core/nodes/ArgumentExpressionNode.js +1 -0
- package/dist/core/nodes/ArgumentExpressionNode.js.map +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js.map +1 -0
- package/dist/core/nodes/BranchNode.js +1 -0
- package/dist/core/nodes/BranchNode.js.map +1 -0
- package/dist/core/nodes/CallSiteNode.js +1 -0
- package/dist/core/nodes/CallSiteNode.js.map +1 -0
- package/dist/core/nodes/CaseNode.js +1 -0
- package/dist/core/nodes/CaseNode.js.map +1 -0
- package/dist/core/nodes/ClassNode.js +1 -0
- package/dist/core/nodes/ClassNode.js.map +1 -0
- package/dist/core/nodes/ConstantNode.js +1 -0
- package/dist/core/nodes/ConstantNode.js.map +1 -0
- package/dist/core/nodes/ConstructorCallNode.js +1 -0
- package/dist/core/nodes/ConstructorCallNode.js.map +1 -0
- package/dist/core/nodes/DatabaseQueryNode.js +1 -0
- package/dist/core/nodes/DatabaseQueryNode.js.map +1 -0
- package/dist/core/nodes/DecoratorNode.js +1 -0
- package/dist/core/nodes/DecoratorNode.js.map +1 -0
- package/dist/core/nodes/EntrypointNode.js +1 -0
- package/dist/core/nodes/EntrypointNode.js.map +1 -0
- package/dist/core/nodes/EnumNode.js +1 -0
- package/dist/core/nodes/EnumNode.js.map +1 -0
- package/dist/core/nodes/EventListenerNode.js +1 -0
- package/dist/core/nodes/EventListenerNode.js.map +1 -0
- package/dist/core/nodes/ExportNode.js +1 -0
- package/dist/core/nodes/ExportNode.js.map +1 -0
- package/dist/core/nodes/ExpressionNode.js +1 -0
- package/dist/core/nodes/ExpressionNode.js.map +1 -0
- package/dist/core/nodes/ExternalModuleNode.js +1 -0
- package/dist/core/nodes/ExternalModuleNode.js.map +1 -0
- package/dist/core/nodes/ExternalStdioNode.js +1 -0
- package/dist/core/nodes/ExternalStdioNode.js.map +1 -0
- package/dist/core/nodes/FunctionNode.js +1 -0
- package/dist/core/nodes/FunctionNode.js.map +1 -0
- package/dist/core/nodes/GuaranteeNode.js +1 -0
- package/dist/core/nodes/GuaranteeNode.js.map +1 -0
- package/dist/core/nodes/HttpRequestNode.js +1 -0
- package/dist/core/nodes/HttpRequestNode.js.map +1 -0
- package/dist/core/nodes/ImportNode.js +1 -0
- package/dist/core/nodes/ImportNode.js.map +1 -0
- package/dist/core/nodes/InterfaceNode.js +1 -0
- package/dist/core/nodes/InterfaceNode.js.map +1 -0
- package/dist/core/nodes/IssueNode.js +1 -0
- package/dist/core/nodes/IssueNode.js.map +1 -0
- package/dist/core/nodes/LiteralNode.js +1 -0
- package/dist/core/nodes/LiteralNode.js.map +1 -0
- package/dist/core/nodes/MethodCallNode.js +1 -0
- package/dist/core/nodes/MethodCallNode.js.map +1 -0
- package/dist/core/nodes/MethodNode.js +1 -0
- package/dist/core/nodes/MethodNode.js.map +1 -0
- package/dist/core/nodes/ModuleNode.js +1 -0
- package/dist/core/nodes/ModuleNode.js.map +1 -0
- package/dist/core/nodes/NetworkRequestNode.js +1 -0
- package/dist/core/nodes/NetworkRequestNode.js.map +1 -0
- package/dist/core/nodes/NodeKind.d.ts +5 -0
- package/dist/core/nodes/NodeKind.d.ts.map +1 -1
- package/dist/core/nodes/NodeKind.js +11 -0
- package/dist/core/nodes/NodeKind.js.map +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js.map +1 -0
- package/dist/core/nodes/ParameterNode.js +1 -0
- package/dist/core/nodes/ParameterNode.js.map +1 -0
- package/dist/core/nodes/PluginNode.d.ts +69 -0
- package/dist/core/nodes/PluginNode.d.ts.map +1 -0
- package/dist/core/nodes/PluginNode.js +106 -0
- package/dist/core/nodes/PluginNode.js.map +1 -0
- package/dist/core/nodes/ScopeNode.js +1 -0
- package/dist/core/nodes/ScopeNode.js.map +1 -0
- package/dist/core/nodes/ServiceNode.js +1 -0
- package/dist/core/nodes/ServiceNode.js.map +1 -0
- package/dist/core/nodes/TypeNode.js +2 -1
- package/dist/core/nodes/TypeNode.js.map +1 -0
- package/dist/core/nodes/VariableDeclarationNode.js +1 -0
- package/dist/core/nodes/VariableDeclarationNode.js.map +1 -0
- package/dist/core/nodes/index.d.ts +2 -1
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +4 -1
- package/dist/core/nodes/index.js.map +1 -0
- package/dist/core/toposort.d.ts +38 -0
- package/dist/core/toposort.d.ts.map +1 -0
- package/dist/core/toposort.js +129 -0
- package/dist/core/toposort.js.map +1 -0
- package/dist/data/builtins/BuiltinRegistry.js +1 -0
- package/dist/data/builtins/BuiltinRegistry.js.map +1 -0
- package/dist/data/builtins/definitions.js +1 -0
- package/dist/data/builtins/definitions.js.map +1 -0
- package/dist/data/builtins/index.js +1 -0
- package/dist/data/builtins/index.js.map +1 -0
- package/dist/data/builtins/jsGlobals.js +1 -0
- package/dist/data/builtins/jsGlobals.js.map +1 -0
- package/dist/data/builtins/types.js +1 -0
- package/dist/data/builtins/types.js.map +1 -0
- package/dist/data/globals/definitions.js +1 -0
- package/dist/data/globals/definitions.js.map +1 -0
- package/dist/data/globals/index.js +1 -0
- package/dist/data/globals/index.js.map +1 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts +5 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts.map +1 -1
- package/dist/diagnostics/DiagnosticCollector.js +4 -0
- package/dist/diagnostics/DiagnosticCollector.js.map +1 -0
- package/dist/diagnostics/DiagnosticReporter.d.ts +23 -1
- package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -1
- package/dist/diagnostics/DiagnosticReporter.js +68 -15
- package/dist/diagnostics/DiagnosticReporter.js.map +1 -0
- package/dist/diagnostics/DiagnosticWriter.js +1 -0
- package/dist/diagnostics/DiagnosticWriter.js.map +1 -0
- package/dist/diagnostics/categories.d.ts +57 -0
- package/dist/diagnostics/categories.d.ts.map +1 -0
- package/dist/diagnostics/categories.js +71 -0
- package/dist/diagnostics/categories.js.map +1 -0
- package/dist/diagnostics/index.d.ts +3 -0
- package/dist/diagnostics/index.d.ts.map +1 -1
- package/dist/diagnostics/index.js +4 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/errors/GrafemaError.d.ts +39 -0
- package/dist/errors/GrafemaError.d.ts.map +1 -1
- package/dist/errors/GrafemaError.js +28 -0
- package/dist/errors/GrafemaError.js.map +1 -0
- package/dist/index.d.ts +21 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -0
- package/dist/instructions/index.d.ts +8 -0
- package/dist/instructions/index.d.ts.map +1 -0
- package/dist/instructions/index.js +20 -0
- package/dist/instructions/index.js.map +1 -0
- package/dist/instructions/onboarding.md +121 -0
- package/dist/logging/Logger.d.ts +53 -3
- package/dist/logging/Logger.d.ts.map +1 -1
- package/dist/logging/Logger.js +144 -4
- package/dist/logging/Logger.js.map +1 -0
- package/dist/plugins/Plugin.js +1 -0
- package/dist/plugins/Plugin.js.map +1 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/DatabaseAnalyzer.js +20 -14
- package/dist/plugins/analysis/DatabaseAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +23 -16
- package/dist/plugins/analysis/ExpressAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts +2 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js +53 -76
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +47 -37
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/FetchAnalyzer.d.ts +8 -14
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +144 -97
- package/dist/plugins/analysis/FetchAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +3 -5
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js.map +1 -0
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +59 -2
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +926 -422
- package/dist/plugins/analysis/JSASTAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ReactAnalyzer.js +24 -19
- package/dist/plugins/analysis/ReactAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.js +39 -26
- package/dist/plugins/analysis/RustAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +14 -7
- package/dist/plugins/analysis/SQLiteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +33 -28
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SocketIOAnalyzer.js +24 -14
- package/dist/plugins/analysis/SocketIOAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.js +19 -11
- package/dist/plugins/analysis/SystemDbAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ast/ConditionParser.js +1 -0
- package/dist/plugins/analysis/ast/ConditionParser.js.map +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/ExpressionEvaluator.js +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.js.map +1 -0
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts +58 -6
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +440 -56
- package/dist/plugins/analysis/ast/GraphBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/IdGenerator.js +1 -0
- package/dist/plugins/analysis/ast/IdGenerator.js.map +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js.map +1 -0
- package/dist/plugins/analysis/ast/types.d.ts +152 -1
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/types.js +1 -0
- package/dist/plugins/analysis/ast/types.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts +27 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.js +45 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js +1 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/index.js +1 -0
- package/dist/plugins/analysis/ast/utils/index.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/location.js +1 -0
- package/dist/plugins/analysis/ast/utils/location.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +3 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +9 -2
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +145 -14
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +198 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +4 -3
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +5 -2
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts +83 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js +258 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts +1 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/index.js +2 -0
- package/dist/plugins/analysis/ast/visitors/index.js.map +1 -0
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts +42 -10
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts.map +1 -1
- package/dist/plugins/discovery/DiscoveryPlugin.js +17 -1
- package/dist/plugins/discovery/DiscoveryPlugin.js.map +1 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +3 -2
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js.map +1 -0
- package/dist/plugins/discovery/SimpleProjectDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/SimpleProjectDiscovery.js +3 -2
- package/dist/plugins/discovery/SimpleProjectDiscovery.js.map +1 -0
- package/dist/plugins/discovery/WorkspaceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/WorkspaceDiscovery.js +3 -2
- package/dist/plugins/discovery/WorkspaceDiscovery.js.map +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js.map +1 -0
- package/dist/plugins/discovery/workspaces/detector.js +1 -0
- package/dist/plugins/discovery/workspaces/detector.js.map +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js.map +1 -0
- package/dist/plugins/discovery/workspaces/index.js +1 -0
- package/dist/plugins/discovery/workspaces/index.js.map +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js.map +1 -0
- package/dist/plugins/enrichment/AliasTracker.js +3 -2
- package/dist/plugins/enrichment/AliasTracker.js.map +1 -0
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js.map +1 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts +21 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.js +137 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.js.map +1 -0
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts +5 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.js +11 -9
- package/dist/plugins/enrichment/FunctionCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +2 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +51 -13
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js.map +1 -0
- package/dist/plugins/enrichment/InstanceOfResolver.js +3 -2
- package/dist/plugins/enrichment/InstanceOfResolver.js.map +1 -0
- package/dist/plugins/enrichment/MethodCallResolver.d.ts +39 -1
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.js +422 -11
- package/dist/plugins/enrichment/MethodCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/MountPointResolver.d.ts +1 -1
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +7 -23
- package/dist/plugins/enrichment/MountPointResolver.js.map +1 -0
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +2 -2
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js.map +1 -0
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.js +5 -4
- package/dist/plugins/enrichment/PrefixEvaluator.js.map +1 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts +30 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js +190 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js.map +1 -0
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +4 -3
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js.map +1 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts +3 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +22 -29
- package/dist/plugins/indexing/IncrementalModuleIndexer.js.map +1 -0
- package/dist/plugins/indexing/JSModuleIndexer.d.ts +3 -1
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +22 -31
- package/dist/plugins/indexing/JSModuleIndexer.js.map +1 -0
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +11 -5
- package/dist/plugins/indexing/RustModuleIndexer.js.map +1 -0
- package/dist/plugins/validation/BrokenImportValidator.d.ts.map +1 -1
- package/dist/plugins/validation/BrokenImportValidator.js +3 -3
- package/dist/plugins/validation/BrokenImportValidator.js.map +1 -0
- package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -1
- package/dist/plugins/validation/CallResolverValidator.js +3 -3
- package/dist/plugins/validation/CallResolverValidator.js.map +1 -0
- package/dist/plugins/validation/DataFlowValidator.js +2 -1
- package/dist/plugins/validation/DataFlowValidator.js.map +1 -0
- package/dist/plugins/validation/EvalBanValidator.js +2 -1
- package/dist/plugins/validation/EvalBanValidator.js.map +1 -0
- package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -1
- package/dist/plugins/validation/GraphConnectivityValidator.js +2 -1
- package/dist/plugins/validation/GraphConnectivityValidator.js.map +1 -0
- package/dist/plugins/validation/SQLInjectionValidator.d.ts.map +1 -1
- package/dist/plugins/validation/SQLInjectionValidator.js +4 -2
- package/dist/plugins/validation/SQLInjectionValidator.js.map +1 -0
- package/dist/plugins/validation/ShadowingDetector.js +2 -1
- package/dist/plugins/validation/ShadowingDetector.js.map +1 -0
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.d.ts.map +1 -1
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js +3 -3
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js.map +1 -0
- package/dist/plugins/vcs/GitPlugin.d.ts.map +1 -1
- package/dist/plugins/vcs/GitPlugin.js +13 -6
- package/dist/plugins/vcs/GitPlugin.js.map +1 -0
- package/dist/plugins/vcs/VCSPlugin.js +1 -0
- package/dist/plugins/vcs/VCSPlugin.js.map +1 -0
- package/dist/plugins/vcs/index.js +1 -0
- package/dist/plugins/vcs/index.js.map +1 -0
- package/dist/queries/findCallsInFunction.d.ts +1 -1
- package/dist/queries/findCallsInFunction.d.ts.map +1 -1
- package/dist/queries/findCallsInFunction.js +3 -2
- package/dist/queries/findCallsInFunction.js.map +1 -0
- package/dist/queries/findContainingFunction.d.ts +1 -1
- package/dist/queries/findContainingFunction.d.ts.map +1 -1
- package/dist/queries/findContainingFunction.js +1 -0
- package/dist/queries/findContainingFunction.js.map +1 -0
- package/dist/queries/index.js +1 -0
- package/dist/queries/index.js.map +1 -0
- package/dist/queries/traceValues.d.ts.map +1 -1
- package/dist/queries/traceValues.js +1 -0
- package/dist/queries/traceValues.js.map +1 -0
- package/dist/queries/types.js +1 -0
- package/dist/queries/types.js.map +1 -0
- package/dist/schema/GraphSchemaExtractor.js +1 -0
- package/dist/schema/GraphSchemaExtractor.js.map +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js.map +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +25 -1
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +100 -22
- package/dist/storage/backends/RFDBServerBackend.js.map +1 -0
- package/dist/storage/backends/typeValidation.d.ts.map +1 -1
- package/dist/storage/backends/typeValidation.js +3 -0
- package/dist/storage/backends/typeValidation.js.map +1 -0
- package/dist/utils/findRfdbBinary.js +1 -0
- package/dist/utils/findRfdbBinary.js.map +1 -0
- package/dist/utils/moduleResolution.d.ts +134 -0
- package/dist/utils/moduleResolution.d.ts.map +1 -0
- package/dist/utils/moduleResolution.js +164 -0
- package/dist/utils/moduleResolution.js.map +1 -0
- package/dist/validation/PathValidator.d.ts.map +1 -1
- package/dist/validation/PathValidator.js +1 -0
- package/dist/validation/PathValidator.js.map +1 -0
- package/package.json +4 -3
- package/src/Orchestrator.ts +371 -41
- package/src/api/GraphAPI.ts +4 -2
- package/src/api/GuaranteeAPI.ts +3 -2
- package/src/config/ConfigLoader.ts +121 -3
- package/src/config/index.ts +7 -1
- package/src/core/ASTWorker.ts +8 -20
- package/src/core/ASTWorkerPool.ts +1 -1
- package/src/core/CoverageAnalyzer.ts +2 -2
- package/src/core/FileNodeManager.ts +3 -2
- package/src/core/GuaranteeManager.ts +1 -1
- package/src/core/IncrementalReanalyzer.ts +6 -3
- package/src/core/NodeFactory.ts +34 -1
- package/src/core/WorkerPool.ts +2 -1
- package/src/core/nodes/NodeKind.ts +11 -0
- package/src/core/nodes/PluginNode.ts +144 -0
- package/src/core/nodes/TypeNode.ts +1 -1
- package/src/core/nodes/index.ts +4 -0
- package/src/core/toposort.ts +160 -0
- package/src/diagnostics/DiagnosticCollector.ts +8 -1
- package/src/diagnostics/DiagnosticReporter.ts +87 -16
- package/src/diagnostics/categories.ts +104 -0
- package/src/diagnostics/index.ts +14 -0
- package/src/errors/GrafemaError.ts +58 -0
- package/src/index.ts +53 -9
- package/src/instructions/index.ts +21 -0
- package/src/instructions/onboarding.md +121 -0
- package/src/logging/Logger.ts +155 -4
- package/src/plugins/analysis/DatabaseAnalyzer.ts +22 -15
- package/src/plugins/analysis/ExpressAnalyzer.ts +30 -18
- package/src/plugins/analysis/ExpressResponseAnalyzer.ts +72 -88
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +54 -39
- package/src/plugins/analysis/FetchAnalyzer.ts +165 -113
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +6 -7
- package/src/plugins/analysis/JSASTAnalyzer.ts +1122 -487
- package/src/plugins/analysis/ReactAnalyzer.ts +27 -20
- package/src/plugins/analysis/RustAnalyzer.ts +41 -27
- package/src/plugins/analysis/SQLiteAnalyzer.ts +18 -8
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +38 -34
- package/src/plugins/analysis/SocketIOAnalyzer.ts +30 -15
- package/src/plugins/analysis/SystemDbAnalyzer.ts +24 -13
- package/src/plugins/analysis/ast/ExpressionEvaluator.ts +1 -3
- package/src/plugins/analysis/ast/GraphBuilder.ts +532 -66
- package/src/plugins/analysis/ast/types.ts +200 -2
- package/src/plugins/analysis/ast/utils/babelTraverse.ts +74 -0
- package/src/plugins/analysis/ast/utils/createParameterNodes.ts +1 -1
- package/src/plugins/analysis/ast/visitors/ASTVisitor.ts +7 -2
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +163 -15
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +249 -3
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +9 -4
- package/src/plugins/analysis/ast/visitors/PropertyAccessVisitor.ts +342 -0
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +2 -3
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +1 -27
- package/src/plugins/analysis/ast/visitors/index.ts +2 -0
- package/src/plugins/discovery/DiscoveryPlugin.ts +42 -11
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +2 -2
- package/src/plugins/discovery/SimpleProjectDiscovery.ts +2 -2
- package/src/plugins/discovery/WorkspaceDiscovery.ts +2 -2
- package/src/plugins/discovery/workspaces/globResolver.ts +1 -1
- package/src/plugins/enrichment/AliasTracker.ts +2 -2
- package/src/plugins/enrichment/ArgumentParameterLinker.ts +0 -1
- package/src/plugins/enrichment/ClosureCaptureEnricher.ts +0 -1
- package/src/plugins/enrichment/ExpressHandlerLinker.ts +178 -0
- package/src/plugins/enrichment/ExternalCallResolver.ts +0 -1
- package/src/plugins/enrichment/FunctionCallResolver.ts +10 -15
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +65 -14
- package/src/plugins/enrichment/ImportExportLinker.ts +0 -1
- package/src/plugins/enrichment/InstanceOfResolver.ts +2 -2
- package/src/plugins/enrichment/MethodCallResolver.ts +526 -12
- package/src/plugins/enrichment/MountPointResolver.ts +6 -24
- package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +1 -2
- package/src/plugins/enrichment/PrefixEvaluator.ts +4 -4
- package/src/plugins/enrichment/RejectionPropagationEnricher.ts +253 -0
- package/src/plugins/enrichment/RustFFIEnricher.ts +0 -1
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +3 -3
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +24 -30
- package/src/plugins/indexing/JSModuleIndexer.ts +21 -22
- package/src/plugins/indexing/RustModuleIndexer.ts +10 -5
- package/src/plugins/validation/BrokenImportValidator.ts +2 -3
- package/src/plugins/validation/CallResolverValidator.ts +2 -3
- package/src/plugins/validation/DataFlowValidator.ts +1 -1
- package/src/plugins/validation/EvalBanValidator.ts +1 -1
- package/src/plugins/validation/GraphConnectivityValidator.ts +1 -9
- package/src/plugins/validation/SQLInjectionValidator.ts +3 -2
- package/src/plugins/validation/ShadowingDetector.ts +1 -1
- package/src/plugins/validation/TypeScriptDeadCodeValidator.ts +2 -3
- package/src/plugins/vcs/GitPlugin.ts +12 -6
- package/src/queries/findCallsInFunction.ts +4 -4
- package/src/queries/findContainingFunction.ts +1 -1
- package/src/queries/traceValues.ts +0 -1
- package/src/storage/backends/RFDBServerBackend.ts +115 -25
- package/src/storage/backends/typeValidation.ts +2 -0
- package/src/utils/moduleResolution.ts +244 -0
- package/src/validation/PathValidator.ts +0 -8
- package/src/plugins/validation/NodeCreationValidator.ts +0 -554
package/dist/Orchestrator.d.ts
CHANGED
|
@@ -56,6 +56,11 @@ export interface OrchestratorOptions {
|
|
|
56
56
|
* When true, enrichers report unresolved references as fatal errors.
|
|
57
57
|
*/
|
|
58
58
|
strictMode?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Multi-root workspace configuration (REG-76).
|
|
61
|
+
* If provided, each root is indexed with rootPrefix in context.
|
|
62
|
+
*/
|
|
63
|
+
workspaceRoots?: string[];
|
|
59
64
|
}
|
|
60
65
|
/**
|
|
61
66
|
* Service info from discovery
|
|
@@ -123,11 +128,43 @@ export declare class Orchestrator {
|
|
|
123
128
|
private configServices;
|
|
124
129
|
/** Strict mode flag (REG-330) */
|
|
125
130
|
private strictMode;
|
|
131
|
+
/** Multi-root workspace roots (REG-76) */
|
|
132
|
+
private workspaceRoots;
|
|
133
|
+
/** REG-357: Accumulated suppressedByIgnore from enrichment plugins */
|
|
134
|
+
private suppressedByIgnoreCount;
|
|
126
135
|
constructor(options?: OrchestratorOptions);
|
|
136
|
+
/**
|
|
137
|
+
* Register all loaded plugins as grafema:plugin nodes in the graph.
|
|
138
|
+
*
|
|
139
|
+
* Creates a node for each plugin with its metadata (phase, priority,
|
|
140
|
+
* creates, dependencies). Also creates DEPENDS_ON edges between
|
|
141
|
+
* plugins that declare dependencies.
|
|
142
|
+
*
|
|
143
|
+
* Called once at the start of run(), before any analysis phase.
|
|
144
|
+
* Complexity: O(p) where p = number of plugins (typically 20-35).
|
|
145
|
+
*/
|
|
146
|
+
private registerPluginNodes;
|
|
147
|
+
/**
|
|
148
|
+
* Collect field declarations from all plugins and send to RFDB for indexing.
|
|
149
|
+
* Deduplicates by field name (last declaration wins if nodeTypes differ).
|
|
150
|
+
* Called once before analysis to enable server-side metadata indexing.
|
|
151
|
+
*/
|
|
152
|
+
private declarePluginFields;
|
|
127
153
|
/**
|
|
128
154
|
* Запустить анализ проекта
|
|
129
155
|
*/
|
|
130
156
|
run(projectPath: string): Promise<DiscoveryManifest>;
|
|
157
|
+
/**
|
|
158
|
+
* REG-76: Run analysis for multi-root workspace.
|
|
159
|
+
* Each root is analyzed separately with rootPrefix in context.
|
|
160
|
+
* All results go to the same unified graph.
|
|
161
|
+
*/
|
|
162
|
+
private runMultiRoot;
|
|
163
|
+
/**
|
|
164
|
+
* Discover services in a specific root directory.
|
|
165
|
+
* Uses the same discovery logic but scoped to the root.
|
|
166
|
+
*/
|
|
167
|
+
private discoverInRoot;
|
|
131
168
|
/**
|
|
132
169
|
* Build unified list of indexing units from services and entrypoints
|
|
133
170
|
* Each unit has: id, name, path, type, and original data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Orchestrator.d.ts","sourceRoot":"","sources":["../src/Orchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"Orchestrator.d.ts","sourceRoot":"","sources":["../src/Orchestrator.ts"],"names":[],"mappings":"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"}
|
package/dist/Orchestrator.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Полностью абстрактный - специфичная логика в плагинах
|
|
4
4
|
*/
|
|
5
5
|
import { readFileSync, existsSync, unlinkSync } from 'fs';
|
|
6
|
-
import { join, dirname, resolve } from 'path';
|
|
6
|
+
import { join, dirname, resolve, basename } from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import { spawn, execSync } from 'child_process';
|
|
9
9
|
import { setTimeout as sleep } from 'timers/promises';
|
|
@@ -12,8 +12,10 @@ import { resolveSourceEntrypoint } from './plugins/discovery/resolveSourceEntryp
|
|
|
12
12
|
import { Profiler } from './core/Profiler.js';
|
|
13
13
|
import { AnalysisQueue } from './core/AnalysisQueue.js';
|
|
14
14
|
import { DiagnosticCollector } from './diagnostics/DiagnosticCollector.js';
|
|
15
|
+
import { StrictModeFailure } from './errors/GrafemaError.js';
|
|
15
16
|
import { createLogger } from './logging/Logger.js';
|
|
16
17
|
import { NodeFactory } from './core/NodeFactory.js';
|
|
18
|
+
import { toposort } from './core/toposort.js';
|
|
17
19
|
export class Orchestrator {
|
|
18
20
|
graph;
|
|
19
21
|
config;
|
|
@@ -35,6 +37,10 @@ export class Orchestrator {
|
|
|
35
37
|
configServices;
|
|
36
38
|
/** Strict mode flag (REG-330) */
|
|
37
39
|
strictMode;
|
|
40
|
+
/** Multi-root workspace roots (REG-76) */
|
|
41
|
+
workspaceRoots;
|
|
42
|
+
/** REG-357: Accumulated suppressedByIgnore from enrichment plugins */
|
|
43
|
+
suppressedByIgnoreCount = 0;
|
|
38
44
|
constructor(options = {}) {
|
|
39
45
|
this.graph = options.graph;
|
|
40
46
|
this.config = options;
|
|
@@ -59,6 +65,8 @@ export class Orchestrator {
|
|
|
59
65
|
this.configServices = options.services;
|
|
60
66
|
// Strict mode configuration (REG-330)
|
|
61
67
|
this.strictMode = options.strictMode ?? false;
|
|
68
|
+
// Multi-root workspace configuration (REG-76)
|
|
69
|
+
this.workspaceRoots = options.workspaceRoots;
|
|
62
70
|
// Modified auto-add logic: SKIP auto-add if config services provided (REG-174)
|
|
63
71
|
const hasDiscovery = this.plugins.some(p => p.metadata?.phase === 'DISCOVERY');
|
|
64
72
|
const hasConfigServices = this.configServices && this.configServices.length > 0;
|
|
@@ -67,19 +75,107 @@ export class Orchestrator {
|
|
|
67
75
|
this.plugins.unshift(new SimpleProjectDiscovery());
|
|
68
76
|
}
|
|
69
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Register all loaded plugins as grafema:plugin nodes in the graph.
|
|
80
|
+
*
|
|
81
|
+
* Creates a node for each plugin with its metadata (phase, priority,
|
|
82
|
+
* creates, dependencies). Also creates DEPENDS_ON edges between
|
|
83
|
+
* plugins that declare dependencies.
|
|
84
|
+
*
|
|
85
|
+
* Called once at the start of run(), before any analysis phase.
|
|
86
|
+
* Complexity: O(p) where p = number of plugins (typically 20-35).
|
|
87
|
+
*/
|
|
88
|
+
async registerPluginNodes() {
|
|
89
|
+
const pluginNodes = [];
|
|
90
|
+
for (const plugin of this.plugins) {
|
|
91
|
+
const meta = plugin.metadata;
|
|
92
|
+
if (!meta?.name)
|
|
93
|
+
continue;
|
|
94
|
+
const sourceFile = plugin.config?.sourceFile || '';
|
|
95
|
+
const isBuiltin = !sourceFile;
|
|
96
|
+
const node = NodeFactory.createPlugin(meta.name, meta.phase, {
|
|
97
|
+
file: sourceFile,
|
|
98
|
+
builtin: isBuiltin,
|
|
99
|
+
createsNodes: meta.creates?.nodes ?? [],
|
|
100
|
+
createsEdges: meta.creates?.edges ?? [],
|
|
101
|
+
dependencies: meta.dependencies ?? [],
|
|
102
|
+
});
|
|
103
|
+
await this.graph.addNode(node);
|
|
104
|
+
pluginNodes.push({
|
|
105
|
+
id: node.id,
|
|
106
|
+
name: meta.name,
|
|
107
|
+
dependencies: meta.dependencies ?? [],
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// Create DEPENDS_ON edges between plugins
|
|
111
|
+
const nameToId = new Map();
|
|
112
|
+
for (const pn of pluginNodes) {
|
|
113
|
+
nameToId.set(pn.name, pn.id);
|
|
114
|
+
}
|
|
115
|
+
for (const pn of pluginNodes) {
|
|
116
|
+
for (const dep of pn.dependencies) {
|
|
117
|
+
const depId = nameToId.get(dep);
|
|
118
|
+
if (depId) {
|
|
119
|
+
await this.graph.addEdge({
|
|
120
|
+
src: pn.id,
|
|
121
|
+
dst: depId,
|
|
122
|
+
type: 'DEPENDS_ON',
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
this.logger.debug('Registered plugin nodes', {
|
|
128
|
+
count: pluginNodes.length,
|
|
129
|
+
edges: pluginNodes.reduce((sum, pn) => sum + pn.dependencies.filter(d => nameToId.has(d)).length, 0),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Collect field declarations from all plugins and send to RFDB for indexing.
|
|
134
|
+
* Deduplicates by field name (last declaration wins if nodeTypes differ).
|
|
135
|
+
* Called once before analysis to enable server-side metadata indexing.
|
|
136
|
+
*/
|
|
137
|
+
async declarePluginFields() {
|
|
138
|
+
if (!this.graph.declareFields)
|
|
139
|
+
return;
|
|
140
|
+
const fieldMap = new Map();
|
|
141
|
+
for (const plugin of this.plugins) {
|
|
142
|
+
const fields = plugin.metadata?.fields;
|
|
143
|
+
if (!fields)
|
|
144
|
+
continue;
|
|
145
|
+
for (const field of fields) {
|
|
146
|
+
fieldMap.set(field.name, field);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (fieldMap.size === 0)
|
|
150
|
+
return;
|
|
151
|
+
const fields = [...fieldMap.values()];
|
|
152
|
+
const count = await this.graph.declareFields(fields);
|
|
153
|
+
this.logger.debug('Declared metadata fields for indexing', { fields: count });
|
|
154
|
+
}
|
|
70
155
|
/**
|
|
71
156
|
* Запустить анализ проекта
|
|
72
157
|
*/
|
|
73
158
|
async run(projectPath) {
|
|
74
159
|
const totalStartTime = Date.now();
|
|
160
|
+
// REG-357: Reset suppressed count for each run
|
|
161
|
+
this.suppressedByIgnoreCount = 0;
|
|
75
162
|
// Resolve to absolute path
|
|
76
163
|
const absoluteProjectPath = projectPath.startsWith('/') ? projectPath : resolve(projectPath);
|
|
164
|
+
// REG-76: Multi-root workspace support
|
|
165
|
+
// If workspaceRoots is provided, run analysis for each root with rootPrefix
|
|
166
|
+
if (this.workspaceRoots && this.workspaceRoots.length > 0) {
|
|
167
|
+
return this.runMultiRoot(absoluteProjectPath);
|
|
168
|
+
}
|
|
77
169
|
// RADICAL SIMPLIFICATION: Clear entire graph once at the start if forceAnalysis
|
|
78
170
|
if (this.forceAnalysis && this.graph.clear) {
|
|
79
171
|
this.logger.info('Clearing entire graph (forceAnalysis=true)');
|
|
80
172
|
await this.graph.clear();
|
|
81
173
|
this.logger.info('Graph cleared successfully');
|
|
82
174
|
}
|
|
175
|
+
// Register plugin pipeline as grafema:plugin nodes (REG-386)
|
|
176
|
+
await this.registerPluginNodes();
|
|
177
|
+
// Declare metadata fields for RFDB server-side indexing (REG-398)
|
|
178
|
+
await this.declarePluginFields();
|
|
83
179
|
this.onProgress({ phase: 'discovery', currentPlugin: 'Starting discovery...', message: 'Discovering services...', totalFiles: 0, processedFiles: 0 });
|
|
84
180
|
// PHASE 0: DISCOVERY - запуск плагинов фазы DISCOVERY (or use entrypoint override)
|
|
85
181
|
this.profiler.start('DISCOVERY');
|
|
@@ -259,21 +355,14 @@ export class Orchestrator {
|
|
|
259
355
|
await this.runPhase('ENRICHMENT', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
260
356
|
this.profiler.end('ENRICHMENT');
|
|
261
357
|
this.logger.info('ENRICHMENT phase complete', { duration: ((Date.now() - enrichmentStart) / 1000).toFixed(2) });
|
|
262
|
-
// STRICT MODE BARRIER: Check for fatal errors after ENRICHMENT (REG-330)
|
|
358
|
+
// STRICT MODE BARRIER: Check for fatal errors after ENRICHMENT (REG-330, REG-332)
|
|
263
359
|
if (this.strictMode) {
|
|
264
360
|
const enrichmentDiagnostics = this.diagnosticCollector.getByPhase('ENRICHMENT');
|
|
265
361
|
const strictErrors = enrichmentDiagnostics.filter(d => d.severity === 'fatal');
|
|
266
362
|
if (strictErrors.length > 0) {
|
|
267
363
|
this.logger.error(`Strict mode: ${strictErrors.length} unresolved reference(s) found`);
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
file: err.file,
|
|
271
|
-
line: err.line,
|
|
272
|
-
plugin: err.plugin,
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
throw new Error(`Strict mode: ${strictErrors.length} unresolved reference(s) found during ENRICHMENT. ` +
|
|
276
|
-
`Run without --strict for graceful degradation, or fix the underlying issues.`);
|
|
364
|
+
// REG-357: Pass suppressedByIgnore count from enrichment plugin results
|
|
365
|
+
throw new StrictModeFailure(strictErrors, this.suppressedByIgnoreCount);
|
|
277
366
|
}
|
|
278
367
|
}
|
|
279
368
|
// PHASE 4: VALIDATION - проверка корректности графа (глобально)
|
|
@@ -293,6 +382,148 @@ export class Orchestrator {
|
|
|
293
382
|
this.profiler.printSummary();
|
|
294
383
|
return manifest;
|
|
295
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* REG-76: Run analysis for multi-root workspace.
|
|
387
|
+
* Each root is analyzed separately with rootPrefix in context.
|
|
388
|
+
* All results go to the same unified graph.
|
|
389
|
+
*/
|
|
390
|
+
async runMultiRoot(workspacePath) {
|
|
391
|
+
const totalStartTime = Date.now();
|
|
392
|
+
const roots = this.workspaceRoots;
|
|
393
|
+
this.logger.info('Multi-root workspace mode', { roots: roots.length });
|
|
394
|
+
// Clear graph once at the start if forceAnalysis
|
|
395
|
+
if (this.forceAnalysis && this.graph.clear) {
|
|
396
|
+
this.logger.info('Clearing entire graph (forceAnalysis=true)');
|
|
397
|
+
await this.graph.clear();
|
|
398
|
+
this.logger.info('Graph cleared successfully');
|
|
399
|
+
}
|
|
400
|
+
// Register plugin pipeline as grafema:plugin nodes (REG-386)
|
|
401
|
+
await this.registerPluginNodes();
|
|
402
|
+
// Declare metadata fields for RFDB server-side indexing (REG-398)
|
|
403
|
+
await this.declarePluginFields();
|
|
404
|
+
// Collect all services from all roots
|
|
405
|
+
const allServices = [];
|
|
406
|
+
const allEntrypoints = [];
|
|
407
|
+
// Process each root
|
|
408
|
+
for (let rootIdx = 0; rootIdx < roots.length; rootIdx++) {
|
|
409
|
+
const rootRelativePath = roots[rootIdx];
|
|
410
|
+
const rootName = basename(rootRelativePath);
|
|
411
|
+
const rootAbsolutePath = join(workspacePath, rootRelativePath);
|
|
412
|
+
this.logger.info(`Processing root ${rootIdx + 1}/${roots.length}`, {
|
|
413
|
+
root: rootName,
|
|
414
|
+
path: rootAbsolutePath
|
|
415
|
+
});
|
|
416
|
+
// Discover services in this root
|
|
417
|
+
const rootManifest = await this.discoverInRoot(rootAbsolutePath, rootName);
|
|
418
|
+
// Build indexing units for this root
|
|
419
|
+
const units = this.buildIndexingUnits(rootManifest);
|
|
420
|
+
// INDEXING phase for this root
|
|
421
|
+
for (const unit of units) {
|
|
422
|
+
const unitManifest = {
|
|
423
|
+
projectPath: rootAbsolutePath,
|
|
424
|
+
service: {
|
|
425
|
+
...unit,
|
|
426
|
+
id: unit.id,
|
|
427
|
+
name: unit.name,
|
|
428
|
+
path: unit.path
|
|
429
|
+
},
|
|
430
|
+
modules: [],
|
|
431
|
+
rootPrefix: rootName, // REG-76: Pass root prefix
|
|
432
|
+
};
|
|
433
|
+
await this.runPhase('INDEXING', {
|
|
434
|
+
manifest: unitManifest,
|
|
435
|
+
graph: this.graph,
|
|
436
|
+
workerCount: 1,
|
|
437
|
+
rootPrefix: rootName, // Pass to context
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
// ANALYSIS phase for this root
|
|
441
|
+
if (!this.indexOnly) {
|
|
442
|
+
for (const unit of units) {
|
|
443
|
+
const unitManifest = {
|
|
444
|
+
projectPath: rootAbsolutePath,
|
|
445
|
+
service: {
|
|
446
|
+
...unit,
|
|
447
|
+
id: unit.id,
|
|
448
|
+
name: unit.name,
|
|
449
|
+
path: unit.path
|
|
450
|
+
},
|
|
451
|
+
modules: [],
|
|
452
|
+
rootPrefix: rootName,
|
|
453
|
+
};
|
|
454
|
+
await this.runPhase('ANALYSIS', {
|
|
455
|
+
manifest: unitManifest,
|
|
456
|
+
graph: this.graph,
|
|
457
|
+
workerCount: 1,
|
|
458
|
+
rootPrefix: rootName,
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
// Collect services with root prefix in path for unified manifest
|
|
463
|
+
for (const svc of rootManifest.services) {
|
|
464
|
+
allServices.push({
|
|
465
|
+
...svc,
|
|
466
|
+
// Prefix path with root name for unified manifest
|
|
467
|
+
path: svc.path ? `${rootName}/${svc.path.replace(rootAbsolutePath + '/', '')}` : undefined,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
for (const ep of rootManifest.entrypoints) {
|
|
471
|
+
allEntrypoints.push({
|
|
472
|
+
...ep,
|
|
473
|
+
file: `${rootName}/${ep.file.replace(rootAbsolutePath + '/', '')}`,
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
// Create unified manifest
|
|
478
|
+
const unifiedManifest = {
|
|
479
|
+
services: allServices,
|
|
480
|
+
entrypoints: allEntrypoints,
|
|
481
|
+
projectPath: workspacePath,
|
|
482
|
+
};
|
|
483
|
+
// Skip remaining phases if indexOnly
|
|
484
|
+
if (this.indexOnly) {
|
|
485
|
+
const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
|
|
486
|
+
this.logger.info('indexOnly mode - skipping remaining phases', { duration: totalTime });
|
|
487
|
+
return unifiedManifest;
|
|
488
|
+
}
|
|
489
|
+
// ENRICHMENT phase (global - operates on unified graph)
|
|
490
|
+
this.profiler.start('ENRICHMENT');
|
|
491
|
+
await this.runPhase('ENRICHMENT', {
|
|
492
|
+
manifest: unifiedManifest,
|
|
493
|
+
graph: this.graph,
|
|
494
|
+
workerCount: this.workerCount
|
|
495
|
+
});
|
|
496
|
+
this.profiler.end('ENRICHMENT');
|
|
497
|
+
// VALIDATION phase (global)
|
|
498
|
+
this.profiler.start('VALIDATION');
|
|
499
|
+
await this.runPhase('VALIDATION', {
|
|
500
|
+
manifest: unifiedManifest,
|
|
501
|
+
graph: this.graph,
|
|
502
|
+
workerCount: this.workerCount
|
|
503
|
+
});
|
|
504
|
+
this.profiler.end('VALIDATION');
|
|
505
|
+
// Flush graph
|
|
506
|
+
if (this.graph.flush) {
|
|
507
|
+
await this.graph.flush();
|
|
508
|
+
}
|
|
509
|
+
const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
|
|
510
|
+
this.logger.info('Multi-root analysis complete', {
|
|
511
|
+
duration: totalTime,
|
|
512
|
+
roots: roots.length,
|
|
513
|
+
services: allServices.length
|
|
514
|
+
});
|
|
515
|
+
this.profiler.printSummary();
|
|
516
|
+
return unifiedManifest;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Discover services in a specific root directory.
|
|
520
|
+
* Uses the same discovery logic but scoped to the root.
|
|
521
|
+
*/
|
|
522
|
+
async discoverInRoot(rootPath, _rootName) {
|
|
523
|
+
// For now, use the same discovery mechanism
|
|
524
|
+
// rootName is available for future use if needed
|
|
525
|
+
return this.discover(rootPath);
|
|
526
|
+
}
|
|
296
527
|
/**
|
|
297
528
|
* Build unified list of indexing units from services and entrypoints
|
|
298
529
|
* Each unit has: id, name, path, type, and original data
|
|
@@ -330,7 +561,11 @@ export class Orchestrator {
|
|
|
330
561
|
});
|
|
331
562
|
}
|
|
332
563
|
}
|
|
333
|
-
|
|
564
|
+
this.logger.debug('Built indexing units', {
|
|
565
|
+
total: units.length,
|
|
566
|
+
services: units.filter(u => u.type === 'service').length,
|
|
567
|
+
entrypoints: units.filter(u => u.type === 'entrypoint').length
|
|
568
|
+
});
|
|
334
569
|
return units;
|
|
335
570
|
}
|
|
336
571
|
/**
|
|
@@ -365,10 +600,11 @@ export class Orchestrator {
|
|
|
365
600
|
entrypoint = resolveSourceEntrypoint(servicePath, pkg) ?? pkg.main ?? 'index.js';
|
|
366
601
|
}
|
|
367
602
|
catch (e) {
|
|
603
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
368
604
|
this.logger.warn('Failed to read package.json for auto-detection', {
|
|
369
605
|
service: configSvc.name,
|
|
370
606
|
path: packageJsonPath,
|
|
371
|
-
error:
|
|
607
|
+
error: message
|
|
372
608
|
});
|
|
373
609
|
entrypoint = 'index.js';
|
|
374
610
|
}
|
|
@@ -413,8 +649,18 @@ export class Orchestrator {
|
|
|
413
649
|
};
|
|
414
650
|
// Фильтруем плагины для фазы DISCOVERY
|
|
415
651
|
const discoveryPlugins = this.plugins.filter(p => p.metadata.phase === 'DISCOVERY');
|
|
416
|
-
//
|
|
417
|
-
|
|
652
|
+
// Topological sort by dependencies (REG-367)
|
|
653
|
+
const discoveryPluginMap = new Map(discoveryPlugins.map(p => [p.metadata.name, p]));
|
|
654
|
+
const sortedDiscoveryIds = toposort(discoveryPlugins.map(p => ({
|
|
655
|
+
id: p.metadata.name,
|
|
656
|
+
dependencies: p.metadata.dependencies ?? [],
|
|
657
|
+
})));
|
|
658
|
+
discoveryPlugins.length = 0;
|
|
659
|
+
for (const id of sortedDiscoveryIds) {
|
|
660
|
+
const plugin = discoveryPluginMap.get(id);
|
|
661
|
+
if (plugin)
|
|
662
|
+
discoveryPlugins.push(plugin);
|
|
663
|
+
}
|
|
418
664
|
const allServices = [];
|
|
419
665
|
const allEntrypoints = [];
|
|
420
666
|
// Выполняем каждый плагин
|
|
@@ -433,6 +679,16 @@ export class Orchestrator {
|
|
|
433
679
|
if (result.success && result.metadata?.entrypoints) {
|
|
434
680
|
allEntrypoints.push(...result.metadata.entrypoints);
|
|
435
681
|
}
|
|
682
|
+
// Warn if plugin created nodes but didn't return services/entrypoints in metadata
|
|
683
|
+
// This catches common mistake of not returning services via result.metadata.services
|
|
684
|
+
if (result.success && result.created.nodes > 0 &&
|
|
685
|
+
!result.metadata?.services && !result.metadata?.entrypoints) {
|
|
686
|
+
this.logger.warn('Discovery plugin created nodes but returned no services/entrypoints in metadata', {
|
|
687
|
+
plugin: plugin.metadata.name,
|
|
688
|
+
nodesCreated: result.created.nodes,
|
|
689
|
+
hint: 'Services must be returned via result.metadata.services for Orchestrator to index them'
|
|
690
|
+
});
|
|
691
|
+
}
|
|
436
692
|
this.onProgress({
|
|
437
693
|
phase: 'discovery',
|
|
438
694
|
currentPlugin: plugin.metadata.name,
|
|
@@ -451,8 +707,18 @@ export class Orchestrator {
|
|
|
451
707
|
async runPhase(phaseName, context) {
|
|
452
708
|
// Фильтруем плагины для данной фазы
|
|
453
709
|
const phasePlugins = this.plugins.filter(plugin => plugin.metadata.phase === phaseName);
|
|
454
|
-
//
|
|
455
|
-
|
|
710
|
+
// Topological sort by dependencies (REG-367)
|
|
711
|
+
const pluginMap = new Map(phasePlugins.map(p => [p.metadata.name, p]));
|
|
712
|
+
const sortedIds = toposort(phasePlugins.map(p => ({
|
|
713
|
+
id: p.metadata.name,
|
|
714
|
+
dependencies: p.metadata.dependencies ?? [],
|
|
715
|
+
})));
|
|
716
|
+
phasePlugins.length = 0;
|
|
717
|
+
for (const id of sortedIds) {
|
|
718
|
+
const plugin = pluginMap.get(id);
|
|
719
|
+
if (plugin)
|
|
720
|
+
phasePlugins.push(plugin);
|
|
721
|
+
}
|
|
456
722
|
// Выполняем плагины последовательно
|
|
457
723
|
for (let i = 0; i < phasePlugins.length; i++) {
|
|
458
724
|
const plugin = phasePlugins[i];
|
|
@@ -468,6 +734,8 @@ export class Orchestrator {
|
|
|
468
734
|
forceAnalysis: this.forceAnalysis,
|
|
469
735
|
logger: this.logger,
|
|
470
736
|
strictMode: this.strictMode, // REG-330: Pass strict mode flag
|
|
737
|
+
// REG-76: Pass rootPrefix for multi-root workspace support
|
|
738
|
+
rootPrefix: context.rootPrefix,
|
|
471
739
|
};
|
|
472
740
|
// Add reportIssue for VALIDATION phase
|
|
473
741
|
if (phaseName === 'VALIDATION') {
|
|
@@ -488,6 +756,13 @@ export class Orchestrator {
|
|
|
488
756
|
const result = await plugin.execute(pluginContext);
|
|
489
757
|
// Collect errors into diagnostics
|
|
490
758
|
this.diagnosticCollector.addFromPluginResult(phaseName, plugin.metadata.name, result);
|
|
759
|
+
// REG-357: Collect suppressedByIgnore from ENRICHMENT plugin results
|
|
760
|
+
if (phaseName === 'ENRICHMENT' && result.metadata) {
|
|
761
|
+
const suppressed = result.metadata.suppressedByIgnore;
|
|
762
|
+
if (typeof suppressed === 'number') {
|
|
763
|
+
this.suppressedByIgnoreCount += suppressed;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
491
766
|
// Log plugin completion with warning if errors occurred
|
|
492
767
|
if (!result.success) {
|
|
493
768
|
console.warn(`[Orchestrator] Plugin ${plugin.metadata.name} reported failure`, {
|
|
@@ -496,10 +771,18 @@ export class Orchestrator {
|
|
|
496
771
|
});
|
|
497
772
|
}
|
|
498
773
|
// Check for fatal errors - STOP immediately
|
|
774
|
+
// REG-357: In strict mode ENRICHMENT, don't halt on strict mode errors.
|
|
775
|
+
// The strict mode barrier after ENRICHMENT handles them collectively.
|
|
499
776
|
if (this.diagnosticCollector.hasFatal()) {
|
|
500
777
|
const allDiagnostics = this.diagnosticCollector.getAll();
|
|
501
|
-
const
|
|
502
|
-
|
|
778
|
+
const fatals = allDiagnostics.filter(d => d.severity === 'fatal');
|
|
779
|
+
// Skip halt only if ALL fatals are strict mode errors during ENRICHMENT.
|
|
780
|
+
// If any non-strict fatal exists, halt immediately.
|
|
781
|
+
const allStrictErrors = fatals.every(d => d.code.startsWith('STRICT_'));
|
|
782
|
+
if (!(this.strictMode && phaseName === 'ENRICHMENT' && allStrictErrors)) {
|
|
783
|
+
const fatal = fatals[0];
|
|
784
|
+
throw new Error(`Fatal error in ${plugin.metadata.name}: ${fatal?.message || 'Unknown fatal error'}`);
|
|
785
|
+
}
|
|
503
786
|
}
|
|
504
787
|
}
|
|
505
788
|
catch (e) {
|
|
@@ -544,15 +827,14 @@ export class Orchestrator {
|
|
|
544
827
|
const maxWorkers = this.parallelConfig.maxWorkers || null;
|
|
545
828
|
// Get the database path from the main graph backend
|
|
546
829
|
const mainDbPath = this.graph.dbPath || join(manifest.projectPath, '.grafema', 'graph.rfdb');
|
|
547
|
-
|
|
548
|
-
console.log(`[Orchestrator] Using database: ${mainDbPath}`);
|
|
830
|
+
this.logger.debug('Starting queue-based parallel analysis', { database: mainDbPath });
|
|
549
831
|
// Start RFDB server using the SAME database as main graph
|
|
550
832
|
await this.startRfdbServer(socketPath, mainDbPath);
|
|
551
833
|
// Get ANALYSIS plugins that should run in workers
|
|
552
834
|
const analysisPlugins = this.plugins
|
|
553
835
|
.filter(p => p.metadata?.phase === 'ANALYSIS')
|
|
554
836
|
.map(p => p.metadata.name);
|
|
555
|
-
|
|
837
|
+
this.logger.debug('Analysis plugins', { plugins: analysisPlugins });
|
|
556
838
|
// Create analysis queue
|
|
557
839
|
this.analysisQueue = new AnalysisQueue({
|
|
558
840
|
socketPath,
|
|
@@ -575,7 +857,7 @@ export class Orchestrator {
|
|
|
575
857
|
});
|
|
576
858
|
moduleCount++;
|
|
577
859
|
}
|
|
578
|
-
|
|
860
|
+
this.logger.debug('Queued modules for analysis', { count: moduleCount });
|
|
579
861
|
// Subscribe to progress events
|
|
580
862
|
this.analysisQueue.on('taskCompleted', ({ file, stats, duration }) => {
|
|
581
863
|
this.onProgress({
|
|
@@ -585,12 +867,16 @@ export class Orchestrator {
|
|
|
585
867
|
});
|
|
586
868
|
});
|
|
587
869
|
this.analysisQueue.on('taskFailed', ({ file, error }) => {
|
|
588
|
-
|
|
870
|
+
this.logger.error('Analysis failed', { file, error });
|
|
589
871
|
});
|
|
590
872
|
// Wait for all tasks to complete (barrier)
|
|
591
873
|
const stats = await this.analysisQueue.waitForCompletion();
|
|
592
|
-
|
|
593
|
-
|
|
874
|
+
this.logger.debug('Queue complete', {
|
|
875
|
+
nodesCreated: stats.nodesCreated,
|
|
876
|
+
edgesCreated: stats.edgesCreated,
|
|
877
|
+
succeeded: stats.tasksCompleted,
|
|
878
|
+
failed: stats.tasksFailed
|
|
879
|
+
});
|
|
594
880
|
// Stop workers and server
|
|
595
881
|
await this.analysisQueue.stop();
|
|
596
882
|
this.analysisQueue = null;
|
|
@@ -611,14 +897,14 @@ export class Orchestrator {
|
|
|
611
897
|
await testClient.connect();
|
|
612
898
|
await testClient.ping();
|
|
613
899
|
await testClient.close();
|
|
614
|
-
|
|
900
|
+
this.logger.debug('Using existing RFDB server', { socketPath });
|
|
615
901
|
this.rfdbServerProcess = null; // Mark that we didn't start the server
|
|
616
902
|
this._serverWasExternal = true;
|
|
617
903
|
return;
|
|
618
904
|
}
|
|
619
|
-
catch
|
|
905
|
+
catch {
|
|
620
906
|
// Socket exists but server not responding, remove stale socket
|
|
621
|
-
|
|
907
|
+
this.logger.debug('Stale socket found, removing');
|
|
622
908
|
unlinkSync(socketPath);
|
|
623
909
|
}
|
|
624
910
|
}
|
|
@@ -628,14 +914,14 @@ export class Orchestrator {
|
|
|
628
914
|
const debugBinary = join(projectRoot, 'packages/rfdb-server/target/debug/rfdb-server');
|
|
629
915
|
let binaryPath = existsSync(serverBinary) ? serverBinary : debugBinary;
|
|
630
916
|
if (!existsSync(binaryPath)) {
|
|
631
|
-
|
|
917
|
+
this.logger.debug('RFDB server binary not found, building', { path: binaryPath });
|
|
632
918
|
execSync('cargo build --bin rfdb-server', {
|
|
633
919
|
cwd: join(projectRoot, 'packages/rfdb-server'),
|
|
634
920
|
stdio: 'inherit',
|
|
635
921
|
});
|
|
636
922
|
binaryPath = debugBinary;
|
|
637
923
|
}
|
|
638
|
-
|
|
924
|
+
this.logger.debug('Starting RFDB server', { binary: binaryPath, database: dbPath });
|
|
639
925
|
this.rfdbServerProcess = spawn(binaryPath, [dbPath, '--socket', socketPath], {
|
|
640
926
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
641
927
|
});
|
|
@@ -643,7 +929,7 @@ export class Orchestrator {
|
|
|
643
929
|
this.rfdbServerProcess.stderr?.on('data', (data) => {
|
|
644
930
|
const msg = data.toString().trim();
|
|
645
931
|
if (!msg.includes('FLUSH') && !msg.includes('WRITER')) {
|
|
646
|
-
|
|
932
|
+
this.logger.debug('rfdb-server', { message: msg });
|
|
647
933
|
}
|
|
648
934
|
});
|
|
649
935
|
// Wait for server to start
|
|
@@ -655,7 +941,7 @@ export class Orchestrator {
|
|
|
655
941
|
if (!existsSync(socketPath)) {
|
|
656
942
|
throw new Error('RFDB server failed to start');
|
|
657
943
|
}
|
|
658
|
-
|
|
944
|
+
this.logger.debug('RFDB server started', { socketPath });
|
|
659
945
|
}
|
|
660
946
|
/**
|
|
661
947
|
* Stop RFDB server process (only if we started it)
|
|
@@ -663,14 +949,15 @@ export class Orchestrator {
|
|
|
663
949
|
async stopRfdbServer() {
|
|
664
950
|
// Don't stop external server (started by MCP or another process)
|
|
665
951
|
if (this._serverWasExternal) {
|
|
666
|
-
|
|
952
|
+
this.logger.debug('Leaving external RFDB server running');
|
|
667
953
|
return;
|
|
668
954
|
}
|
|
669
955
|
if (this.rfdbServerProcess) {
|
|
670
956
|
this.rfdbServerProcess.kill('SIGTERM');
|
|
671
957
|
await sleep(200);
|
|
672
958
|
this.rfdbServerProcess = null;
|
|
673
|
-
|
|
959
|
+
this.logger.debug('RFDB server stopped');
|
|
674
960
|
}
|
|
675
961
|
}
|
|
676
962
|
}
|
|
963
|
+
//# sourceMappingURL=Orchestrator.js.map
|