@grafema/core 0.2.5-beta → 0.2.7
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/README.md +61 -23
- package/dist/DiscoveryManager.d.ts +59 -0
- package/dist/DiscoveryManager.d.ts.map +1 -0
- package/dist/DiscoveryManager.js +249 -0
- package/dist/DiscoveryManager.js.map +1 -0
- package/dist/GraphInitializer.d.ts +44 -0
- package/dist/GraphInitializer.d.ts.map +1 -0
- package/dist/GraphInitializer.js +121 -0
- package/dist/GraphInitializer.js.map +1 -0
- package/dist/GuaranteeChecker.d.ts +35 -0
- package/dist/GuaranteeChecker.d.ts.map +1 -0
- package/dist/GuaranteeChecker.js +81 -0
- package/dist/GuaranteeChecker.js.map +1 -0
- package/dist/Orchestrator.d.ts +34 -151
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +173 -741
- package/dist/Orchestrator.js.map +1 -1
- package/dist/OrchestratorTypes.d.ts +115 -0
- package/dist/OrchestratorTypes.d.ts.map +1 -0
- package/dist/OrchestratorTypes.js +6 -0
- package/dist/OrchestratorTypes.js.map +1 -0
- package/dist/ParallelAnalysisRunner.d.ts +43 -0
- package/dist/ParallelAnalysisRunner.d.ts.map +1 -0
- package/dist/ParallelAnalysisRunner.js +161 -0
- package/dist/ParallelAnalysisRunner.js.map +1 -0
- package/dist/PhaseRunner.d.ts +94 -0
- package/dist/PhaseRunner.d.ts.map +1 -0
- package/dist/PhaseRunner.js +332 -0
- package/dist/PhaseRunner.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +51 -1
- package/dist/config/ConfigLoader.d.ts.map +1 -1
- package/dist/config/ConfigLoader.js +121 -1
- package/dist/config/ConfigLoader.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/core/ASTWorker.d.ts +2 -0
- package/dist/core/ASTWorker.d.ts.map +1 -1
- package/dist/core/ASTWorker.js +6 -2
- package/dist/core/ASTWorker.js.map +1 -1
- package/dist/core/FileOverview.d.ts +124 -0
- package/dist/core/FileOverview.d.ts.map +1 -0
- package/dist/core/FileOverview.js +257 -0
- package/dist/core/FileOverview.js.map +1 -0
- package/dist/core/GraphFreshnessChecker.d.ts +1 -1
- package/dist/core/GraphFreshnessChecker.d.ts.map +1 -1
- package/dist/core/GraphFreshnessChecker.js +7 -5
- package/dist/core/GraphFreshnessChecker.js.map +1 -1
- package/dist/core/GuaranteeManager.d.ts +13 -0
- package/dist/core/GuaranteeManager.d.ts.map +1 -1
- package/dist/core/GuaranteeManager.js +63 -2
- package/dist/core/GuaranteeManager.js.map +1 -1
- package/dist/core/IncrementalReanalyzer.d.ts.map +1 -1
- package/dist/core/IncrementalReanalyzer.js +6 -3
- package/dist/core/IncrementalReanalyzer.js.map +1 -1
- package/dist/core/NodeFactory.d.ts +81 -415
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +139 -336
- package/dist/core/NodeFactory.js.map +1 -1
- package/dist/core/ResourceRegistry.d.ts +17 -0
- package/dist/core/ResourceRegistry.d.ts.map +1 -0
- package/dist/core/ResourceRegistry.js +32 -0
- package/dist/core/ResourceRegistry.js.map +1 -0
- package/dist/core/ScopeTracker.d.ts +12 -0
- package/dist/core/ScopeTracker.d.ts.map +1 -1
- package/dist/core/ScopeTracker.js +24 -0
- package/dist/core/ScopeTracker.js.map +1 -1
- package/dist/core/SemanticId.d.ts +69 -0
- package/dist/core/SemanticId.d.ts.map +1 -1
- package/dist/core/SemanticId.js +134 -0
- package/dist/core/SemanticId.js.map +1 -1
- package/dist/core/brandNodeInternal.d.ts +14 -0
- package/dist/core/brandNodeInternal.d.ts.map +1 -0
- package/dist/core/brandNodeInternal.js +4 -0
- package/dist/core/brandNodeInternal.js.map +1 -0
- package/dist/core/buildDependencyGraph.d.ts +36 -0
- package/dist/core/buildDependencyGraph.d.ts.map +1 -0
- package/dist/core/buildDependencyGraph.js +78 -0
- package/dist/core/buildDependencyGraph.js.map +1 -0
- package/dist/core/factories/CoreFactory.d.ts +223 -0
- package/dist/core/factories/CoreFactory.d.ts.map +1 -0
- package/dist/core/factories/CoreFactory.js +127 -0
- package/dist/core/factories/CoreFactory.js.map +1 -0
- package/dist/core/factories/DatabaseFactory.d.ts +29 -0
- package/dist/core/factories/DatabaseFactory.d.ts.map +1 -0
- package/dist/core/factories/DatabaseFactory.js +25 -0
- package/dist/core/factories/DatabaseFactory.js.map +1 -0
- package/dist/core/factories/ExternalFactory.d.ts +11 -0
- package/dist/core/factories/ExternalFactory.d.ts.map +1 -0
- package/dist/core/factories/ExternalFactory.js +16 -0
- package/dist/core/factories/ExternalFactory.js.map +1 -0
- package/dist/core/factories/HttpFactory.d.ts +22 -0
- package/dist/core/factories/HttpFactory.d.ts.map +1 -0
- package/dist/core/factories/HttpFactory.js +32 -0
- package/dist/core/factories/HttpFactory.js.map +1 -0
- package/dist/core/factories/ReactFactory.d.ts +14 -0
- package/dist/core/factories/ReactFactory.d.ts.map +1 -0
- package/dist/core/factories/ReactFactory.js +13 -0
- package/dist/core/factories/ReactFactory.js.map +1 -0
- package/dist/core/factories/RustFactory.d.ts +62 -0
- package/dist/core/factories/RustFactory.d.ts.map +1 -0
- package/dist/core/factories/RustFactory.js +32 -0
- package/dist/core/factories/RustFactory.js.map +1 -0
- package/dist/core/factories/ServiceFactory.d.ts +12 -0
- package/dist/core/factories/ServiceFactory.d.ts.map +1 -0
- package/dist/core/factories/ServiceFactory.js +22 -0
- package/dist/core/factories/ServiceFactory.js.map +1 -0
- package/dist/core/factories/SocketFactory.d.ts +31 -0
- package/dist/core/factories/SocketFactory.d.ts.map +1 -0
- package/dist/core/factories/SocketFactory.js +35 -0
- package/dist/core/factories/SocketFactory.js.map +1 -0
- package/dist/core/nodes/DatabaseNode.d.ts +85 -0
- package/dist/core/nodes/DatabaseNode.d.ts.map +1 -0
- package/dist/core/nodes/DatabaseNode.js +118 -0
- package/dist/core/nodes/DatabaseNode.js.map +1 -0
- package/dist/core/nodes/ExpressMiddlewareNode.d.ts +47 -0
- package/dist/core/nodes/ExpressMiddlewareNode.d.ts.map +1 -0
- package/dist/core/nodes/ExpressMiddlewareNode.js +63 -0
- package/dist/core/nodes/ExpressMiddlewareNode.js.map +1 -0
- package/dist/core/nodes/ExpressMountNode.d.ts +44 -0
- package/dist/core/nodes/ExpressMountNode.d.ts.map +1 -0
- package/dist/core/nodes/ExpressMountNode.js +61 -0
- package/dist/core/nodes/ExpressMountNode.js.map +1 -0
- package/dist/core/nodes/ExternalApiNode.d.ts +29 -0
- package/dist/core/nodes/ExternalApiNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalApiNode.js +41 -0
- package/dist/core/nodes/ExternalApiNode.js.map +1 -0
- package/dist/core/nodes/ExternalFunctionNode.d.ts +40 -0
- package/dist/core/nodes/ExternalFunctionNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalFunctionNode.js +54 -0
- package/dist/core/nodes/ExternalFunctionNode.js.map +1 -0
- package/dist/core/nodes/FetchRequestNode.d.ts +54 -0
- package/dist/core/nodes/FetchRequestNode.d.ts.map +1 -0
- package/dist/core/nodes/FetchRequestNode.js +67 -0
- package/dist/core/nodes/FetchRequestNode.js.map +1 -0
- package/dist/core/nodes/HttpRouteNode.d.ts +58 -0
- package/dist/core/nodes/HttpRouteNode.d.ts.map +1 -0
- package/dist/core/nodes/HttpRouteNode.js +72 -0
- package/dist/core/nodes/HttpRouteNode.js.map +1 -0
- package/dist/core/nodes/NodeKind.d.ts +1 -0
- package/dist/core/nodes/NodeKind.d.ts.map +1 -1
- package/dist/core/nodes/NodeKind.js +1 -0
- package/dist/core/nodes/NodeKind.js.map +1 -1
- package/dist/core/nodes/ReactNode.d.ts +53 -0
- package/dist/core/nodes/ReactNode.d.ts.map +1 -0
- package/dist/core/nodes/ReactNode.js +70 -0
- package/dist/core/nodes/ReactNode.js.map +1 -0
- package/dist/core/nodes/RustCallNode.d.ts +46 -0
- package/dist/core/nodes/RustCallNode.d.ts.map +1 -0
- package/dist/core/nodes/RustCallNode.js +62 -0
- package/dist/core/nodes/RustCallNode.js.map +1 -0
- package/dist/core/nodes/RustFunctionNode.d.ts +58 -0
- package/dist/core/nodes/RustFunctionNode.d.ts.map +1 -0
- package/dist/core/nodes/RustFunctionNode.js +67 -0
- package/dist/core/nodes/RustFunctionNode.js.map +1 -0
- package/dist/core/nodes/RustImplNode.d.ts +35 -0
- package/dist/core/nodes/RustImplNode.d.ts.map +1 -0
- package/dist/core/nodes/RustImplNode.js +55 -0
- package/dist/core/nodes/RustImplNode.js.map +1 -0
- package/dist/core/nodes/RustMethodNode.d.ts +64 -0
- package/dist/core/nodes/RustMethodNode.d.ts.map +1 -0
- package/dist/core/nodes/RustMethodNode.js +76 -0
- package/dist/core/nodes/RustMethodNode.js.map +1 -0
- package/dist/core/nodes/RustModuleNode.d.ts +40 -0
- package/dist/core/nodes/RustModuleNode.d.ts.map +1 -0
- package/dist/core/nodes/RustModuleNode.js +57 -0
- package/dist/core/nodes/RustModuleNode.js.map +1 -0
- package/dist/core/nodes/RustStructNode.d.ts +38 -0
- package/dist/core/nodes/RustStructNode.d.ts.map +1 -0
- package/dist/core/nodes/RustStructNode.js +54 -0
- package/dist/core/nodes/RustStructNode.js.map +1 -0
- package/dist/core/nodes/RustTraitNode.d.ts +40 -0
- package/dist/core/nodes/RustTraitNode.d.ts.map +1 -0
- package/dist/core/nodes/RustTraitNode.js +52 -0
- package/dist/core/nodes/RustTraitNode.js.map +1 -0
- package/dist/core/nodes/ServiceLayerNode.d.ts +85 -0
- package/dist/core/nodes/ServiceLayerNode.d.ts.map +1 -0
- package/dist/core/nodes/ServiceLayerNode.js +122 -0
- package/dist/core/nodes/ServiceLayerNode.js.map +1 -0
- package/dist/core/nodes/SocketIONode.d.ts +71 -0
- package/dist/core/nodes/SocketIONode.d.ts.map +1 -0
- package/dist/core/nodes/SocketIONode.js +111 -0
- package/dist/core/nodes/SocketIONode.js.map +1 -0
- package/dist/core/nodes/SocketNode.d.ts +87 -0
- package/dist/core/nodes/SocketNode.d.ts.map +1 -0
- package/dist/core/nodes/SocketNode.js +124 -0
- package/dist/core/nodes/SocketNode.js.map +1 -0
- package/dist/core/nodes/TypeNode.d.ts +26 -1
- package/dist/core/nodes/TypeNode.d.ts.map +1 -1
- package/dist/core/nodes/TypeNode.js +21 -3
- package/dist/core/nodes/TypeNode.js.map +1 -1
- package/dist/core/nodes/TypeParameterNode.d.ts +44 -0
- package/dist/core/nodes/TypeParameterNode.d.ts.map +1 -0
- package/dist/core/nodes/TypeParameterNode.js +64 -0
- package/dist/core/nodes/TypeParameterNode.js.map +1 -0
- package/dist/core/nodes/index.d.ts +19 -0
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +26 -0
- package/dist/core/nodes/index.js.map +1 -1
- package/dist/index.d.ts +33 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/InfraAnalyzer.d.ts +110 -0
- package/dist/plugins/InfraAnalyzer.d.ts.map +1 -0
- package/dist/plugins/InfraAnalyzer.js +170 -0
- package/dist/plugins/InfraAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/DatabaseAnalyzer.js +18 -15
- package/dist/plugins/analysis/DatabaseAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +27 -26
- package/dist/plugins/analysis/ExpressAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js +5 -3
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +36 -39
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +23 -39
- package/dist/plugins/analysis/FetchAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +3 -2
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +23 -85
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +351 -1887
- package/dist/plugins/analysis/JSASTAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/NestJSRouteAnalyzer.d.ts +28 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.js +196 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ReactAnalyzer.d.ts +1 -61
- package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ReactAnalyzer.js +24 -915
- package/dist/plugins/analysis/ReactAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.js +31 -66
- package/dist/plugins/analysis/RustAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +13 -6
- package/dist/plugins/analysis/SQLiteAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +10 -7
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SocketAnalyzer.d.ts +81 -0
- package/dist/plugins/analysis/SocketAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/SocketAnalyzer.js +475 -0
- package/dist/plugins/analysis/SocketAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SocketIOAnalyzer.js +13 -18
- package/dist/plugins/analysis/SocketIOAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.js +8 -5
- package/dist/plugins/analysis/SystemDbAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ast/CollisionResolver.d.ts +65 -0
- package/dist/plugins/analysis/ast/CollisionResolver.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/CollisionResolver.js +106 -0
- package/dist/plugins/analysis/ast/CollisionResolver.js.map +1 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.d.ts +124 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.js +151 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.js.map +1 -0
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts +26 -261
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +251 -2494
- package/dist/plugins/analysis/ast/GraphBuilder.js.map +1 -1
- package/dist/plugins/analysis/ast/IdGenerator.d.ts +42 -0
- package/dist/plugins/analysis/ast/IdGenerator.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/IdGenerator.js +61 -1
- package/dist/plugins/analysis/ast/IdGenerator.js.map +1 -1
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.d.ts +15 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.js +274 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.d.ts +22 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.js +178 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.d.ts +76 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.js +387 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.d.ts +38 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.js +240 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.d.ts +53 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.js +355 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.d.ts +46 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.js +264 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.d.ts +23 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.js +206 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.d.ts +64 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.js +370 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.d.ts +46 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.js +191 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.d.ts +30 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.js +214 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/index.d.ts +12 -0
- package/dist/plugins/analysis/ast/builders/index.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/index.js +11 -0
- package/dist/plugins/analysis/ast/builders/index.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/types.d.ts +30 -0
- package/dist/plugins/analysis/ast/builders/types.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/types.js +8 -0
- package/dist/plugins/analysis/ast/builders/types.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.d.ts +50 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.js +2 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.d.ts +18 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.js +244 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.d.ts +7 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.js +295 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.d.ts +22 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.js +9 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.js +207 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.js +174 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.js +135 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.js +71 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.js +135 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.js +82 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.d.ts +14 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.js +220 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.js +57 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/index.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/index.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/index.js +12 -0
- package/dist/plugins/analysis/ast/handlers/index.js.map +1 -0
- package/dist/plugins/analysis/ast/types.d.ts +57 -6
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +5 -4
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js +94 -13
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js.map +1 -1
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.d.ts +81 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.js +140 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.d.ts +22 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.js +35 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.d.ts +25 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.js +21 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/index.d.ts +2 -0
- package/dist/plugins/analysis/ast/utils/index.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/index.js +2 -0
- package/dist/plugins/analysis/ast/utils/index.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.d.ts +23 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.js +241 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.js +110 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +15 -142
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +304 -937
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +26 -11
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +21 -6
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/MutationDetector.d.ts +25 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.js +181 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.js +155 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts +9 -1
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js +51 -3
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +188 -12
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +6 -4
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.d.ts +19 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.js +57 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.d.ts +168 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.js +7 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.js.map +1 -0
- package/dist/plugins/analysis/react-internal/browser-api.d.ts +20 -0
- package/dist/plugins/analysis/react-internal/browser-api.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/browser-api.js +140 -0
- package/dist/plugins/analysis/react-internal/browser-api.js.map +1 -0
- package/dist/plugins/analysis/react-internal/hooks.d.ts +31 -0
- package/dist/plugins/analysis/react-internal/hooks.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/hooks.js +465 -0
- package/dist/plugins/analysis/react-internal/hooks.js.map +1 -0
- package/dist/plugins/analysis/react-internal/jsx.d.ts +43 -0
- package/dist/plugins/analysis/react-internal/jsx.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/jsx.js +231 -0
- package/dist/plugins/analysis/react-internal/jsx.js.map +1 -0
- package/dist/plugins/analysis/react-internal/types.d.ts +116 -0
- package/dist/plugins/analysis/react-internal/types.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/types.js +83 -0
- package/dist/plugins/analysis/react-internal/types.js.map +1 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +6 -13
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js.map +1 -1
- package/dist/plugins/enrichment/AliasTracker.d.ts.map +1 -1
- package/dist/plugins/enrichment/AliasTracker.js +3 -1
- package/dist/plugins/enrichment/AliasTracker.js.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js +3 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js.map +1 -1
- package/dist/plugins/enrichment/CallbackCallResolver.d.ts +42 -0
- package/dist/plugins/enrichment/CallbackCallResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/CallbackCallResolver.js +311 -0
- package/dist/plugins/enrichment/CallbackCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js +3 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.d.ts +17 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.d.ts.map +1 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.js +55 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.js.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExpressHandlerLinker.js +3 -1
- package/dist/plugins/enrichment/ExpressHandlerLinker.js.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js +5 -8
- package/dist/plugins/enrichment/ExternalCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.js +6 -9
- package/dist/plugins/enrichment/FunctionCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +3 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js +5 -3
- package/dist/plugins/enrichment/ImportExportLinker.js.map +1 -1
- package/dist/plugins/enrichment/InstanceOfResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/InstanceOfResolver.js +3 -1
- package/dist/plugins/enrichment/InstanceOfResolver.js.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.d.ts +17 -68
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.js +42 -517
- package/dist/plugins/enrichment/MethodCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +9 -2
- package/dist/plugins/enrichment/MountPointResolver.js.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +7 -16
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.js +6 -2
- package/dist/plugins/enrichment/PrefixEvaluator.js.map +1 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js +3 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js +3 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ServiceConnectionEnricher.d.ts +76 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.js +355 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.d.ts +42 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.js +166 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +3 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js.map +1 -1
- package/dist/plugins/enrichment/method-call/MethodCallData.d.ts +68 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.js +227 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.d.ts +21 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.js +52 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.d.ts +22 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.js +105 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.d.ts +19 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.js +63 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.d.ts +30 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.js +138 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.js.map +1 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +2 -8
- package/dist/plugins/indexing/IncrementalModuleIndexer.js.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +13 -20
- package/dist/plugins/indexing/JSModuleIndexer.js.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +4 -8
- package/dist/plugins/indexing/RustModuleIndexer.js.map +1 -1
- package/dist/plugins/validation/AwaitInLoopValidator.d.ts +24 -0
- package/dist/plugins/validation/AwaitInLoopValidator.d.ts.map +1 -0
- package/dist/plugins/validation/AwaitInLoopValidator.js +69 -0
- package/dist/plugins/validation/AwaitInLoopValidator.js.map +1 -0
- package/dist/plugins/validation/PackageCoverageValidator.d.ts +33 -0
- package/dist/plugins/validation/PackageCoverageValidator.d.ts.map +1 -0
- package/dist/plugins/validation/PackageCoverageValidator.js +149 -0
- package/dist/plugins/validation/PackageCoverageValidator.js.map +1 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.d.ts +18 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.d.ts.map +1 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.js +68 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.js.map +1 -0
- package/dist/queries/NodeContext.d.ts +81 -0
- package/dist/queries/NodeContext.d.ts.map +1 -0
- package/dist/queries/NodeContext.js +193 -0
- package/dist/queries/NodeContext.js.map +1 -0
- package/dist/queries/findCallsInFunction.d.ts.map +1 -1
- package/dist/queries/findCallsInFunction.js +10 -2
- package/dist/queries/findCallsInFunction.js.map +1 -1
- package/dist/queries/findContainingFunction.d.ts +3 -2
- package/dist/queries/findContainingFunction.d.ts.map +1 -1
- package/dist/queries/findContainingFunction.js +13 -3
- package/dist/queries/findContainingFunction.js.map +1 -1
- package/dist/queries/index.d.ts +2 -0
- package/dist/queries/index.d.ts.map +1 -1
- package/dist/queries/index.js +1 -0
- package/dist/queries/index.js.map +1 -1
- package/dist/resources/InfraResourceMapImpl.d.ts +31 -0
- package/dist/resources/InfraResourceMapImpl.d.ts.map +1 -0
- package/dist/resources/InfraResourceMapImpl.js +110 -0
- package/dist/resources/InfraResourceMapImpl.js.map +1 -0
- package/dist/resources/RoutingMapImpl.d.ts +33 -0
- package/dist/resources/RoutingMapImpl.d.ts.map +1 -0
- package/dist/resources/RoutingMapImpl.js +115 -0
- package/dist/resources/RoutingMapImpl.js.map +1 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +35 -6
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +102 -70
- package/dist/storage/backends/RFDBServerBackend.js.map +1 -1
- package/dist/utils/findRfdbBinary.d.ts +3 -2
- package/dist/utils/findRfdbBinary.d.ts.map +1 -1
- package/dist/utils/findRfdbBinary.js +22 -7
- package/dist/utils/findRfdbBinary.js.map +1 -1
- package/dist/utils/moduleResolution.d.ts.map +1 -1
- package/dist/utils/moduleResolution.js +26 -1
- package/dist/utils/moduleResolution.js.map +1 -1
- package/dist/utils/resolveNodeFile.d.ts +13 -0
- package/dist/utils/resolveNodeFile.d.ts.map +1 -0
- package/dist/utils/resolveNodeFile.js +18 -0
- package/dist/utils/resolveNodeFile.js.map +1 -0
- package/dist/version.d.ts +11 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +26 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -3
- package/src/DiscoveryManager.ts +279 -0
- package/src/GraphInitializer.ts +131 -0
- package/src/GuaranteeChecker.ts +90 -0
- package/src/Orchestrator.ts +222 -963
- package/src/OrchestratorTypes.ts +122 -0
- package/src/ParallelAnalysisRunner.ts +188 -0
- package/src/PhaseRunner.ts +450 -0
- package/src/config/ConfigLoader.ts +176 -2
- package/src/config/index.ts +2 -0
- package/src/core/ASTWorker.ts +9 -2
- package/src/core/FileOverview.ts +374 -0
- package/src/core/GraphFreshnessChecker.ts +7 -5
- package/src/core/GuaranteeManager.ts +70 -2
- package/src/core/IncrementalReanalyzer.ts +6 -3
- package/src/core/NodeFactory.ts +173 -652
- package/src/core/ResourceRegistry.ts +39 -0
- package/src/core/ScopeTracker.ts +23 -0
- package/src/core/SemanticId.ts +183 -0
- package/src/core/brandNodeInternal.ts +16 -0
- package/src/core/buildDependencyGraph.ts +98 -0
- package/src/core/factories/CoreFactory.ts +489 -0
- package/src/core/factories/DatabaseFactory.ts +63 -0
- package/src/core/factories/ExternalFactory.ts +23 -0
- package/src/core/factories/HttpFactory.ts +57 -0
- package/src/core/factories/ReactFactory.ts +15 -0
- package/src/core/factories/RustFactory.ts +128 -0
- package/src/core/factories/ServiceFactory.ts +27 -0
- package/src/core/factories/SocketFactory.ts +94 -0
- package/src/core/nodes/DatabaseNode.ts +175 -0
- package/src/core/nodes/ExpressMiddlewareNode.ts +98 -0
- package/src/core/nodes/ExpressMountNode.ts +94 -0
- package/src/core/nodes/ExternalApiNode.ts +53 -0
- package/src/core/nodes/ExternalFunctionNode.ts +77 -0
- package/src/core/nodes/FetchRequestNode.ts +105 -0
- package/src/core/nodes/HttpRouteNode.ts +113 -0
- package/src/core/nodes/NodeKind.ts +1 -0
- package/src/core/nodes/ReactNode.ts +78 -0
- package/src/core/nodes/RustCallNode.ts +96 -0
- package/src/core/nodes/RustFunctionNode.ts +112 -0
- package/src/core/nodes/RustImplNode.ts +78 -0
- package/src/core/nodes/RustMethodNode.ts +125 -0
- package/src/core/nodes/RustModuleNode.ts +84 -0
- package/src/core/nodes/RustStructNode.ts +80 -0
- package/src/core/nodes/RustTraitNode.ts +82 -0
- package/src/core/nodes/ServiceLayerNode.ts +183 -0
- package/src/core/nodes/SocketIONode.ts +177 -0
- package/src/core/nodes/SocketNode.ts +206 -0
- package/src/core/nodes/TypeNode.ts +46 -3
- package/src/core/nodes/TypeParameterNode.ts +91 -0
- package/src/core/nodes/index.ts +57 -0
- package/src/index.ts +60 -4
- package/src/plugins/InfraAnalyzer.ts +208 -0
- package/src/plugins/analysis/DatabaseAnalyzer.ts +27 -17
- package/src/plugins/analysis/ExpressAnalyzer.ts +51 -38
- package/src/plugins/analysis/ExpressResponseAnalyzer.ts +15 -12
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +56 -56
- package/src/plugins/analysis/FetchAnalyzer.ts +42 -52
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +3 -2
- package/src/plugins/analysis/JSASTAnalyzer.ts +391 -2304
- package/src/plugins/analysis/NestJSRouteAnalyzer.ts +241 -0
- package/src/plugins/analysis/ReactAnalyzer.ts +33 -1085
- package/src/plugins/analysis/RustAnalyzer.ts +112 -116
- package/src/plugins/analysis/SQLiteAnalyzer.ts +23 -9
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +32 -10
- package/src/plugins/analysis/SocketAnalyzer.ts +601 -0
- package/src/plugins/analysis/SocketIOAnalyzer.ts +25 -34
- package/src/plugins/analysis/SystemDbAnalyzer.ts +15 -12
- package/src/plugins/analysis/ast/CollisionResolver.ts +137 -0
- package/src/plugins/analysis/ast/FunctionBodyContext.ts +291 -0
- package/src/plugins/analysis/ast/GraphBuilder.ts +274 -3180
- package/src/plugins/analysis/ast/IdGenerator.ts +81 -1
- package/src/plugins/analysis/ast/builders/AssignmentBuilder.ts +407 -0
- package/src/plugins/analysis/ast/builders/CallFlowBuilder.ts +255 -0
- package/src/plugins/analysis/ast/builders/ControlFlowBuilder.ts +470 -0
- package/src/plugins/analysis/ast/builders/CoreBuilder.ts +306 -0
- package/src/plugins/analysis/ast/builders/ModuleRuntimeBuilder.ts +452 -0
- package/src/plugins/analysis/ast/builders/MutationBuilder.ts +372 -0
- package/src/plugins/analysis/ast/builders/ReturnBuilder.ts +279 -0
- package/src/plugins/analysis/ast/builders/TypeSystemBuilder.ts +475 -0
- package/src/plugins/analysis/ast/builders/UpdateExpressionBuilder.ts +262 -0
- package/src/plugins/analysis/ast/builders/YieldBuilder.ts +287 -0
- package/src/plugins/analysis/ast/builders/index.ts +11 -0
- package/src/plugins/analysis/ast/builders/types.ts +65 -0
- package/src/plugins/analysis/ast/handlers/AnalyzerDelegate.ts +183 -0
- package/src/plugins/analysis/ast/handlers/BranchHandler.ts +313 -0
- package/src/plugins/analysis/ast/handlers/CallExpressionHandler.ts +347 -0
- package/src/plugins/analysis/ast/handlers/FunctionBodyHandler.ts +24 -0
- package/src/plugins/analysis/ast/handlers/LoopHandler.ts +240 -0
- package/src/plugins/analysis/ast/handlers/NestedFunctionHandler.ts +201 -0
- package/src/plugins/analysis/ast/handlers/NewExpressionHandler.ts +159 -0
- package/src/plugins/analysis/ast/handlers/PropertyAccessHandler.ts +112 -0
- package/src/plugins/analysis/ast/handlers/ReturnYieldHandler.ts +166 -0
- package/src/plugins/analysis/ast/handlers/ThrowHandler.ts +101 -0
- package/src/plugins/analysis/ast/handlers/TryCatchHandler.ts +262 -0
- package/src/plugins/analysis/ast/handlers/VariableHandler.ts +93 -0
- package/src/plugins/analysis/ast/handlers/index.ts +12 -0
- package/src/plugins/analysis/ast/types.ts +68 -9
- package/src/plugins/analysis/ast/utils/createParameterNodes.ts +118 -13
- package/src/plugins/analysis/ast/utils/extractNamesFromPattern.ts +166 -0
- package/src/plugins/analysis/ast/utils/getExpressionValue.ts +34 -0
- package/src/plugins/analysis/ast/utils/getMemberExpressionName.ts +33 -0
- package/src/plugins/analysis/ast/utils/index.ts +2 -0
- package/src/plugins/analysis/ast/visitors/ArgumentExtractor.ts +307 -0
- package/src/plugins/analysis/ast/visitors/ArrayElementExtractor.ts +172 -0
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +425 -1374
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +43 -12
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +39 -8
- package/src/plugins/analysis/ast/visitors/MutationDetector.ts +211 -0
- package/src/plugins/analysis/ast/visitors/ObjectPropertyExtractor.ts +217 -0
- package/src/plugins/analysis/ast/visitors/PropertyAccessVisitor.ts +69 -4
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +232 -13
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +8 -11
- package/src/plugins/analysis/ast/visitors/call-expression-helpers.ts +65 -0
- package/src/plugins/analysis/ast/visitors/call-expression-types.ts +179 -0
- package/src/plugins/analysis/react-internal/browser-api.ts +168 -0
- package/src/plugins/analysis/react-internal/hooks.ts +517 -0
- package/src/plugins/analysis/react-internal/jsx.ts +279 -0
- package/src/plugins/analysis/react-internal/types.ts +183 -0
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +6 -14
- package/src/plugins/enrichment/AliasTracker.ts +3 -1
- package/src/plugins/enrichment/ArgumentParameterLinker.ts +3 -1
- package/src/plugins/enrichment/CallbackCallResolver.ts +398 -0
- package/src/plugins/enrichment/ClosureCaptureEnricher.ts +3 -1
- package/src/plugins/enrichment/ConfigRoutingMapBuilder.ts +67 -0
- package/src/plugins/enrichment/ExpressHandlerLinker.ts +3 -1
- package/src/plugins/enrichment/ExternalCallResolver.ts +5 -8
- package/src/plugins/enrichment/FunctionCallResolver.ts +6 -9
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +3 -1
- package/src/plugins/enrichment/ImportExportLinker.ts +5 -3
- package/src/plugins/enrichment/InstanceOfResolver.ts +3 -1
- package/src/plugins/enrichment/MethodCallResolver.ts +48 -659
- package/src/plugins/enrichment/MountPointResolver.ts +9 -2
- package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +13 -18
- package/src/plugins/enrichment/PrefixEvaluator.ts +6 -2
- package/src/plugins/enrichment/RejectionPropagationEnricher.ts +3 -1
- package/src/plugins/enrichment/RustFFIEnricher.ts +3 -1
- package/src/plugins/enrichment/ServiceConnectionEnricher.ts +472 -0
- package/src/plugins/enrichment/SocketConnectionEnricher.ts +228 -0
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +3 -1
- package/src/plugins/enrichment/method-call/MethodCallData.ts +299 -0
- package/src/plugins/enrichment/method-call/MethodCallDetectors.ts +70 -0
- package/src/plugins/enrichment/method-call/MethodCallErrorAnalysis.ts +131 -0
- package/src/plugins/enrichment/method-call/MethodCallIndexers.ts +83 -0
- package/src/plugins/enrichment/method-call/MethodCallResolution.ts +181 -0
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +5 -10
- package/src/plugins/indexing/JSModuleIndexer.ts +17 -21
- package/src/plugins/indexing/RustModuleIndexer.ts +14 -13
- package/src/plugins/validation/AwaitInLoopValidator.ts +91 -0
- package/src/plugins/validation/PackageCoverageValidator.ts +181 -0
- package/src/plugins/validation/UnconnectedRouteValidator.ts +93 -0
- package/src/queries/NodeContext.ts +277 -0
- package/src/queries/findCallsInFunction.ts +11 -2
- package/src/queries/findContainingFunction.ts +14 -3
- package/src/queries/index.ts +13 -0
- package/src/resources/InfraResourceMapImpl.ts +119 -0
- package/src/resources/RoutingMapImpl.ts +133 -0
- package/src/storage/backends/RFDBServerBackend.ts +106 -77
- package/src/utils/findRfdbBinary.ts +22 -7
- package/src/utils/moduleResolution.ts +28 -1
- package/src/utils/resolveNodeFile.ts +18 -0
- package/src/version.ts +28 -0
package/src/Orchestrator.ts
CHANGED
|
@@ -3,150 +3,44 @@
|
|
|
3
3
|
* Полностью абстрактный - специфичная логика в плагинах
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { join, dirname, resolve, basename } from 'path';
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
|
-
import type { ChildProcess } from 'child_process';
|
|
10
|
-
import { spawn, execSync } from 'child_process';
|
|
11
|
-
import { setTimeout as sleep } from 'timers/promises';
|
|
6
|
+
import { join, resolve, basename } from 'path';
|
|
12
7
|
import { SimpleProjectDiscovery } from './plugins/discovery/SimpleProjectDiscovery.js';
|
|
13
|
-
import { resolveSourceEntrypoint } from './plugins/discovery/resolveSourceEntrypoint.js';
|
|
14
8
|
import { Profiler } from './core/Profiler.js';
|
|
15
|
-
import { AnalysisQueue } from './core/AnalysisQueue.js';
|
|
16
9
|
import { DiagnosticCollector } from './diagnostics/DiagnosticCollector.js';
|
|
17
10
|
import { StrictModeFailure } from './errors/GrafemaError.js';
|
|
11
|
+
import { ResourceRegistryImpl } from './core/ResourceRegistry.js';
|
|
18
12
|
import type { Plugin, PluginContext } from './plugins/Plugin.js';
|
|
19
|
-
import type { GraphBackend,
|
|
13
|
+
import type { GraphBackend, Logger, ServiceDefinition, RoutingRule } from '@grafema/types';
|
|
20
14
|
import { createLogger } from './logging/Logger.js';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Orchestrator options
|
|
53
|
-
*/
|
|
54
|
-
export interface OrchestratorOptions {
|
|
55
|
-
graph?: GraphBackend;
|
|
56
|
-
plugins?: Plugin[];
|
|
57
|
-
workerCount?: number;
|
|
58
|
-
onProgress?: ProgressCallback;
|
|
59
|
-
forceAnalysis?: boolean;
|
|
60
|
-
serviceFilter?: string | null;
|
|
61
|
-
/** Override entrypoint, bypasses auto-detection. Path relative to project root. */
|
|
62
|
-
entrypoint?: string;
|
|
63
|
-
indexOnly?: boolean;
|
|
64
|
-
parallel?: ParallelConfig | null;
|
|
65
|
-
/** Logger instance for structured logging. */
|
|
66
|
-
logger?: Logger;
|
|
67
|
-
/** Log level for the default logger. Ignored if logger is provided. */
|
|
68
|
-
logLevel?: LogLevel;
|
|
69
|
-
/**
|
|
70
|
-
* Config-provided services (REG-174).
|
|
71
|
-
* If provided and non-empty, discovery plugins are skipped.
|
|
72
|
-
*/
|
|
73
|
-
services?: ServiceDefinition[];
|
|
74
|
-
/**
|
|
75
|
-
* Enable strict mode for fail-fast debugging.
|
|
76
|
-
* When true, enrichers report unresolved references as fatal errors.
|
|
77
|
-
*/
|
|
78
|
-
strictMode?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Multi-root workspace configuration (REG-76).
|
|
81
|
-
* If provided, each root is indexed with rootPrefix in context.
|
|
82
|
-
*/
|
|
83
|
-
workspaceRoots?: string[];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Service info from discovery
|
|
88
|
-
*/
|
|
89
|
-
export interface ServiceInfo {
|
|
90
|
-
id: string;
|
|
91
|
-
name: string;
|
|
92
|
-
path?: string;
|
|
93
|
-
metadata?: {
|
|
94
|
-
entrypoint?: string;
|
|
95
|
-
[key: string]: unknown;
|
|
96
|
-
};
|
|
97
|
-
[key: string]: unknown;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Entrypoint info from discovery
|
|
102
|
-
*/
|
|
103
|
-
export interface EntrypointInfo {
|
|
104
|
-
id: string;
|
|
105
|
-
name?: string;
|
|
106
|
-
file: string;
|
|
107
|
-
type?: string;
|
|
108
|
-
trigger?: string;
|
|
109
|
-
[key: string]: unknown;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Discovery manifest
|
|
114
|
-
*/
|
|
115
|
-
export interface DiscoveryManifest {
|
|
116
|
-
services: ServiceInfo[];
|
|
117
|
-
entrypoints: EntrypointInfo[];
|
|
118
|
-
projectPath: string;
|
|
119
|
-
modules?: unknown[];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Indexing unit (service or entrypoint)
|
|
124
|
-
*/
|
|
125
|
-
export interface IndexingUnit {
|
|
126
|
-
id: string;
|
|
127
|
-
name: string;
|
|
128
|
-
path: string;
|
|
129
|
-
type: 'service' | 'entrypoint';
|
|
130
|
-
entrypointType?: string;
|
|
131
|
-
trigger?: string;
|
|
132
|
-
[key: string]: unknown;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Unit manifest for indexing phase
|
|
137
|
-
*/
|
|
138
|
-
interface UnitManifest {
|
|
139
|
-
projectPath: string;
|
|
140
|
-
service: {
|
|
141
|
-
id: string;
|
|
142
|
-
name: string;
|
|
143
|
-
path: string;
|
|
144
|
-
[key: string]: unknown;
|
|
145
|
-
};
|
|
146
|
-
modules: unknown[];
|
|
147
|
-
/** Root prefix for multi-root workspace (REG-76) */
|
|
148
|
-
rootPrefix?: string;
|
|
149
|
-
}
|
|
15
|
+
import { PhaseRunner } from './PhaseRunner.js';
|
|
16
|
+
import type { ProgressCallback } from './PhaseRunner.js';
|
|
17
|
+
import { GraphInitializer } from './GraphInitializer.js';
|
|
18
|
+
import { DiscoveryManager } from './DiscoveryManager.js';
|
|
19
|
+
import { GuaranteeChecker } from './GuaranteeChecker.js';
|
|
20
|
+
import { ParallelAnalysisRunner } from './ParallelAnalysisRunner.js';
|
|
21
|
+
import { COVERED_PACKAGES_RESOURCE_ID, createCoveredPackagesResource } from './plugins/validation/PackageCoverageValidator.js';
|
|
22
|
+
export type { ProgressInfo, ProgressCallback } from './PhaseRunner.js';
|
|
23
|
+
|
|
24
|
+
// Re-export types from OrchestratorTypes (REG-462)
|
|
25
|
+
export type {
|
|
26
|
+
ParallelConfig,
|
|
27
|
+
OrchestratorOptions,
|
|
28
|
+
ServiceInfo,
|
|
29
|
+
EntrypointInfo,
|
|
30
|
+
DiscoveryManifest,
|
|
31
|
+
IndexingUnit,
|
|
32
|
+
UnitManifest,
|
|
33
|
+
} from './OrchestratorTypes.js';
|
|
34
|
+
|
|
35
|
+
import type {
|
|
36
|
+
ParallelConfig,
|
|
37
|
+
OrchestratorOptions,
|
|
38
|
+
ServiceInfo,
|
|
39
|
+
EntrypointInfo,
|
|
40
|
+
DiscoveryManifest,
|
|
41
|
+
IndexingUnit,
|
|
42
|
+
UnitManifest,
|
|
43
|
+
} from './OrchestratorTypes.js';
|
|
150
44
|
|
|
151
45
|
export class Orchestrator {
|
|
152
46
|
private graph: GraphBackend;
|
|
@@ -160,9 +54,6 @@ export class Orchestrator {
|
|
|
160
54
|
private indexOnly: boolean;
|
|
161
55
|
private profiler: Profiler;
|
|
162
56
|
private parallelConfig: ParallelConfig | null;
|
|
163
|
-
private analysisQueue: AnalysisQueue | null;
|
|
164
|
-
private rfdbServerProcess: ChildProcess | null;
|
|
165
|
-
private _serverWasExternal: boolean;
|
|
166
57
|
private diagnosticCollector: DiagnosticCollector;
|
|
167
58
|
private logger: Logger;
|
|
168
59
|
/** Config-provided services (REG-174) */
|
|
@@ -171,8 +62,20 @@ export class Orchestrator {
|
|
|
171
62
|
private strictMode: boolean;
|
|
172
63
|
/** Multi-root workspace roots (REG-76) */
|
|
173
64
|
private workspaceRoots: string[] | undefined;
|
|
174
|
-
/**
|
|
175
|
-
private
|
|
65
|
+
/** Resource registry for inter-plugin communication (REG-256) */
|
|
66
|
+
private resourceRegistry = new ResourceRegistryImpl();
|
|
67
|
+
/** Routing rules from config (REG-256) */
|
|
68
|
+
private routing: RoutingRule[] | undefined;
|
|
69
|
+
/** Phase executor (extracted from runPhase, RFD-16) */
|
|
70
|
+
private phaseRunner!: PhaseRunner;
|
|
71
|
+
/** Graph setup: plugin nodes, field declarations, meta node (REG-462) */
|
|
72
|
+
private graphInitializer!: GraphInitializer;
|
|
73
|
+
/** Service/entrypoint discovery (REG-462) */
|
|
74
|
+
private discoveryManager!: DiscoveryManager;
|
|
75
|
+
/** Guarantee checking after enrichment (REG-462) */
|
|
76
|
+
private guaranteeChecker!: GuaranteeChecker;
|
|
77
|
+
/** Parallel analysis runner (REG-462) */
|
|
78
|
+
private parallelRunner: ParallelAnalysisRunner | null = null;
|
|
176
79
|
|
|
177
80
|
constructor(options: OrchestratorOptions = {}) {
|
|
178
81
|
this.graph = options.graph!;
|
|
@@ -188,9 +91,6 @@ export class Orchestrator {
|
|
|
188
91
|
|
|
189
92
|
// Parallel/queue-based analysis config
|
|
190
93
|
this.parallelConfig = options.parallel || null;
|
|
191
|
-
this.analysisQueue = null;
|
|
192
|
-
this.rfdbServerProcess = null;
|
|
193
|
-
this._serverWasExternal = false;
|
|
194
94
|
|
|
195
95
|
// Initialize diagnostic collector
|
|
196
96
|
this.diagnosticCollector = new DiagnosticCollector();
|
|
@@ -207,99 +107,50 @@ export class Orchestrator {
|
|
|
207
107
|
// Multi-root workspace configuration (REG-76)
|
|
208
108
|
this.workspaceRoots = options.workspaceRoots;
|
|
209
109
|
|
|
210
|
-
//
|
|
211
|
-
|
|
212
|
-
const hasConfigServices = this.configServices && this.configServices.length > 0;
|
|
213
|
-
|
|
214
|
-
if (!hasDiscovery && !hasConfigServices) {
|
|
215
|
-
// Only auto-add if NO discovery plugins AND NO config services
|
|
216
|
-
this.plugins.unshift(new SimpleProjectDiscovery());
|
|
217
|
-
}
|
|
218
|
-
}
|
|
110
|
+
// Routing rules from config (REG-256)
|
|
111
|
+
this.routing = options.routing;
|
|
219
112
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
113
|
+
// Initialize phase runner (RFD-16: extracted from runPhase)
|
|
114
|
+
this.phaseRunner = new PhaseRunner({
|
|
115
|
+
plugins: this.plugins,
|
|
116
|
+
onProgress: this.onProgress,
|
|
117
|
+
forceAnalysis: this.forceAnalysis,
|
|
118
|
+
logger: this.logger,
|
|
119
|
+
strictMode: this.strictMode,
|
|
120
|
+
diagnosticCollector: this.diagnosticCollector,
|
|
121
|
+
resourceRegistry: this.resourceRegistry,
|
|
122
|
+
configServices: this.configServices,
|
|
123
|
+
routing: this.routing,
|
|
124
|
+
});
|
|
232
125
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
if (!meta?.name) continue;
|
|
236
|
-
|
|
237
|
-
const sourceFile = (plugin.config?.sourceFile as string) || '';
|
|
238
|
-
const isBuiltin = !sourceFile;
|
|
239
|
-
|
|
240
|
-
const node = NodeFactory.createPlugin(meta.name, meta.phase, {
|
|
241
|
-
file: sourceFile,
|
|
242
|
-
builtin: isBuiltin,
|
|
243
|
-
createsNodes: (meta.creates?.nodes as string[]) ?? [],
|
|
244
|
-
createsEdges: (meta.creates?.edges as string[]) ?? [],
|
|
245
|
-
dependencies: meta.dependencies ?? [],
|
|
246
|
-
});
|
|
126
|
+
// Initialize graph initializer (REG-462: extracted from Orchestrator)
|
|
127
|
+
this.graphInitializer = new GraphInitializer(this.graph, this.plugins, this.logger);
|
|
247
128
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
dependencies: meta.dependencies ?? [],
|
|
253
|
-
});
|
|
254
|
-
}
|
|
129
|
+
// Initialize discovery manager (REG-462: extracted from Orchestrator)
|
|
130
|
+
this.discoveryManager = new DiscoveryManager(
|
|
131
|
+
this.plugins, this.graph, this.config, this.logger, this.onProgress, this.configServices,
|
|
132
|
+
);
|
|
255
133
|
|
|
256
|
-
//
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
134
|
+
// Initialize guarantee checker (REG-462: extracted from Orchestrator)
|
|
135
|
+
this.guaranteeChecker = new GuaranteeChecker(
|
|
136
|
+
this.graph, this.diagnosticCollector, this.profiler, this.onProgress, this.logger,
|
|
137
|
+
);
|
|
261
138
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
src: pn.id,
|
|
268
|
-
dst: depId,
|
|
269
|
-
type: 'DEPENDS_ON',
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
}
|
|
139
|
+
// Initialize parallel runner if enabled (REG-462: extracted from Orchestrator)
|
|
140
|
+
if (this.parallelConfig?.enabled) {
|
|
141
|
+
this.parallelRunner = new ParallelAnalysisRunner(
|
|
142
|
+
this.graph, this.plugins, this.parallelConfig, this.onProgress, this.logger,
|
|
143
|
+
);
|
|
273
144
|
}
|
|
274
145
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Collect field declarations from all plugins and send to RFDB for indexing.
|
|
283
|
-
* Deduplicates by field name (last declaration wins if nodeTypes differ).
|
|
284
|
-
* Called once before analysis to enable server-side metadata indexing.
|
|
285
|
-
*/
|
|
286
|
-
private async declarePluginFields(): Promise<void> {
|
|
287
|
-
if (!this.graph.declareFields) return;
|
|
146
|
+
// Modified auto-add logic: SKIP auto-add if config services provided (REG-174)
|
|
147
|
+
const hasDiscovery = this.plugins.some(p => p.metadata?.phase === 'DISCOVERY');
|
|
148
|
+
const hasConfigServices = this.configServices && this.configServices.length > 0;
|
|
288
149
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
if (!fields) continue;
|
|
293
|
-
for (const field of fields) {
|
|
294
|
-
fieldMap.set(field.name, field);
|
|
295
|
-
}
|
|
150
|
+
if (!hasDiscovery && !hasConfigServices) {
|
|
151
|
+
// Only auto-add if NO discovery plugins AND NO config services
|
|
152
|
+
this.plugins.unshift(new SimpleProjectDiscovery());
|
|
296
153
|
}
|
|
297
|
-
|
|
298
|
-
if (fieldMap.size === 0) return;
|
|
299
|
-
|
|
300
|
-
const fields = [...fieldMap.values()];
|
|
301
|
-
const count = await this.graph.declareFields(fields);
|
|
302
|
-
this.logger.debug('Declared metadata fields for indexing', { fields: count });
|
|
303
154
|
}
|
|
304
155
|
|
|
305
156
|
/**
|
|
@@ -309,7 +160,10 @@ export class Orchestrator {
|
|
|
309
160
|
const totalStartTime = Date.now();
|
|
310
161
|
|
|
311
162
|
// REG-357: Reset suppressed count for each run
|
|
312
|
-
this.
|
|
163
|
+
this.phaseRunner.resetSuppressedByIgnoreCount();
|
|
164
|
+
|
|
165
|
+
// REG-256: Reset resource registry for each run
|
|
166
|
+
this.resourceRegistry.clear();
|
|
313
167
|
|
|
314
168
|
// Resolve to absolute path
|
|
315
169
|
const absoluteProjectPath = projectPath.startsWith('/') ? projectPath : resolve(projectPath);
|
|
@@ -327,37 +181,14 @@ export class Orchestrator {
|
|
|
327
181
|
this.logger.info('Graph cleared successfully');
|
|
328
182
|
}
|
|
329
183
|
|
|
330
|
-
//
|
|
331
|
-
await this.
|
|
332
|
-
|
|
333
|
-
// Declare metadata fields for RFDB server-side indexing (REG-398)
|
|
334
|
-
await this.declarePluginFields();
|
|
184
|
+
// Initialize graph: plugin nodes, field declarations (REG-386, REG-398)
|
|
185
|
+
await this.graphInitializer.init(absoluteProjectPath);
|
|
335
186
|
|
|
336
187
|
this.onProgress({ phase: 'discovery', currentPlugin: 'Starting discovery...', message: 'Discovering services...', totalFiles: 0, processedFiles: 0 });
|
|
337
188
|
|
|
338
|
-
// PHASE 0: DISCOVERY
|
|
189
|
+
// PHASE 0: DISCOVERY
|
|
339
190
|
this.profiler.start('DISCOVERY');
|
|
340
|
-
|
|
341
|
-
if (this.entrypoint) {
|
|
342
|
-
// Skip discovery, create synthetic manifest with single service
|
|
343
|
-
const entrypointPath = this.entrypoint.startsWith('/')
|
|
344
|
-
? this.entrypoint
|
|
345
|
-
: join(absoluteProjectPath, this.entrypoint);
|
|
346
|
-
const serviceName = this.entrypoint.split('/').pop()?.replace(/\.[^.]+$/, '') || 'main';
|
|
347
|
-
manifest = {
|
|
348
|
-
services: [{
|
|
349
|
-
id: `service:${serviceName}`,
|
|
350
|
-
name: serviceName,
|
|
351
|
-
path: entrypointPath,
|
|
352
|
-
metadata: { entrypoint: entrypointPath }
|
|
353
|
-
}],
|
|
354
|
-
entrypoints: [],
|
|
355
|
-
projectPath: absoluteProjectPath
|
|
356
|
-
};
|
|
357
|
-
this.logger.info('Using entrypoint override', { entrypoint: this.entrypoint, resolved: entrypointPath });
|
|
358
|
-
} else {
|
|
359
|
-
manifest = await this.discover(absoluteProjectPath);
|
|
360
|
-
}
|
|
191
|
+
const manifest = await this.discoveryManager.discover(absoluteProjectPath, this.entrypoint);
|
|
361
192
|
this.profiler.end('DISCOVERY');
|
|
362
193
|
|
|
363
194
|
const epCount = manifest.entrypoints?.length || 0;
|
|
@@ -372,7 +203,7 @@ export class Orchestrator {
|
|
|
372
203
|
this.logger.info('Discovery complete', { services: svcCount, entrypoints: epCount });
|
|
373
204
|
|
|
374
205
|
// Build unified list of indexing units from services AND entrypoints
|
|
375
|
-
const indexingUnits = this.buildIndexingUnits(manifest);
|
|
206
|
+
const indexingUnits = this.discoveryManager.buildIndexingUnits(manifest);
|
|
376
207
|
|
|
377
208
|
// Filter if specified
|
|
378
209
|
let unitsToProcess: IndexingUnit[];
|
|
@@ -390,69 +221,11 @@ export class Orchestrator {
|
|
|
390
221
|
|
|
391
222
|
this.logger.info('Processing indexing units', { count: unitsToProcess.length, strategy: 'Phase-by-phase with DFS' });
|
|
392
223
|
|
|
393
|
-
// PHASE 1: INDEXING
|
|
394
|
-
const indexingStart = Date.now();
|
|
224
|
+
// PHASE 1: INDEXING
|
|
395
225
|
this.profiler.start('INDEXING');
|
|
396
|
-
this.onProgress({
|
|
397
|
-
|
|
398
|
-
currentPlugin: 'Starting indexing...',
|
|
399
|
-
message: 'Building dependency trees...',
|
|
400
|
-
totalFiles: unitsToProcess.length,
|
|
401
|
-
processedFiles: 0
|
|
402
|
-
});
|
|
403
|
-
|
|
404
|
-
// Параллельная обработка units батчами
|
|
405
|
-
const BATCH_SIZE = this.workerCount;
|
|
406
|
-
let processedUnits = 0;
|
|
407
|
-
|
|
408
|
-
for (let batchStart = 0; batchStart < unitsToProcess.length; batchStart += BATCH_SIZE) {
|
|
409
|
-
const batch = unitsToProcess.slice(batchStart, batchStart + BATCH_SIZE);
|
|
410
|
-
|
|
411
|
-
this.onProgress({
|
|
412
|
-
phase: 'indexing',
|
|
413
|
-
currentPlugin: 'JSModuleIndexer',
|
|
414
|
-
message: `[${processedUnits + 1}-${processedUnits + batch.length}/${unitsToProcess.length}] Batch indexing...`,
|
|
415
|
-
totalFiles: unitsToProcess.length,
|
|
416
|
-
processedFiles: processedUnits
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
// Параллельно обрабатываем батч units
|
|
420
|
-
await Promise.all(batch.map(async (unit, idx) => {
|
|
421
|
-
const unitStart = Date.now();
|
|
422
|
-
|
|
423
|
-
const unitManifest: UnitManifest = {
|
|
424
|
-
projectPath: manifest.projectPath,
|
|
425
|
-
service: {
|
|
426
|
-
...unit, // Pass all unit fields
|
|
427
|
-
id: unit.id,
|
|
428
|
-
name: unit.name,
|
|
429
|
-
path: unit.path
|
|
430
|
-
},
|
|
431
|
-
modules: []
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
await this.runPhase('INDEXING', {
|
|
435
|
-
manifest: unitManifest,
|
|
436
|
-
graph: this.graph,
|
|
437
|
-
workerCount: 1,
|
|
438
|
-
});
|
|
439
|
-
const unitTime = ((Date.now() - unitStart) / 1000).toFixed(2);
|
|
440
|
-
this.logger.debug('INDEXING complete', { unit: unit.name, duration: unitTime });
|
|
441
|
-
|
|
442
|
-
this.onProgress({
|
|
443
|
-
phase: 'indexing',
|
|
444
|
-
currentPlugin: 'JSModuleIndexer',
|
|
445
|
-
message: `Indexed ${unit.name || unit.path} (${unitTime}s)`,
|
|
446
|
-
totalFiles: unitsToProcess.length,
|
|
447
|
-
processedFiles: processedUnits + idx + 1,
|
|
448
|
-
servicesAnalyzed: processedUnits + idx + 1
|
|
449
|
-
});
|
|
450
|
-
}));
|
|
451
|
-
|
|
452
|
-
processedUnits += batch.length;
|
|
453
|
-
}
|
|
226
|
+
this.onProgress({ phase: 'indexing', currentPlugin: 'Starting indexing...', message: 'Building dependency trees...', totalFiles: unitsToProcess.length, processedFiles: 0 });
|
|
227
|
+
await this.runBatchPhase('INDEXING', unitsToProcess, manifest);
|
|
454
228
|
this.profiler.end('INDEXING');
|
|
455
|
-
this.logger.info('INDEXING phase complete', { duration: ((Date.now() - indexingStart) / 1000).toFixed(2) });
|
|
456
229
|
|
|
457
230
|
// Skip remaining phases if indexOnly mode (for coverage)
|
|
458
231
|
if (this.indexOnly) {
|
|
@@ -461,113 +234,22 @@ export class Orchestrator {
|
|
|
461
234
|
return manifest;
|
|
462
235
|
}
|
|
463
236
|
|
|
464
|
-
// PHASE 2: ANALYSIS
|
|
465
|
-
const analysisStart = Date.now();
|
|
237
|
+
// PHASE 2: ANALYSIS
|
|
466
238
|
this.profiler.start('ANALYSIS');
|
|
467
|
-
this.onProgress({
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
message: 'Analyzing all units...',
|
|
471
|
-
totalFiles: unitsToProcess.length,
|
|
472
|
-
processedFiles: 0
|
|
473
|
-
});
|
|
474
|
-
|
|
475
|
-
// Check if parallel analysis is enabled (new functionality under flag)
|
|
476
|
-
if (this.parallelConfig?.enabled) {
|
|
477
|
-
await this.runParallelAnalysis(manifest);
|
|
239
|
+
this.onProgress({ phase: 'analysis', currentPlugin: 'Starting analysis...', message: 'Analyzing all units...', totalFiles: unitsToProcess.length, processedFiles: 0 });
|
|
240
|
+
if (this.parallelRunner) {
|
|
241
|
+
await this.parallelRunner.run(manifest);
|
|
478
242
|
} else {
|
|
479
|
-
|
|
480
|
-
processedUnits = 0;
|
|
481
|
-
|
|
482
|
-
for (let batchStart = 0; batchStart < unitsToProcess.length; batchStart += BATCH_SIZE) {
|
|
483
|
-
const batch = unitsToProcess.slice(batchStart, batchStart + BATCH_SIZE);
|
|
484
|
-
|
|
485
|
-
this.onProgress({
|
|
486
|
-
phase: 'analysis',
|
|
487
|
-
currentPlugin: 'Analyzers',
|
|
488
|
-
message: `[${processedUnits + 1}-${processedUnits + batch.length}/${unitsToProcess.length}] Batch analyzing...`,
|
|
489
|
-
totalFiles: unitsToProcess.length,
|
|
490
|
-
processedFiles: processedUnits
|
|
491
|
-
});
|
|
492
|
-
|
|
493
|
-
// Параллельно анализируем батч units
|
|
494
|
-
await Promise.all(batch.map(async (unit, idx) => {
|
|
495
|
-
const unitStart = Date.now();
|
|
496
|
-
const unitManifest: UnitManifest = {
|
|
497
|
-
projectPath: manifest.projectPath,
|
|
498
|
-
service: {
|
|
499
|
-
...unit,
|
|
500
|
-
id: unit.id,
|
|
501
|
-
name: unit.name,
|
|
502
|
-
path: unit.path
|
|
503
|
-
},
|
|
504
|
-
modules: []
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
await this.runPhase('ANALYSIS', {
|
|
508
|
-
manifest: unitManifest,
|
|
509
|
-
graph: this.graph,
|
|
510
|
-
workerCount: 1,
|
|
511
|
-
});
|
|
512
|
-
const unitTime = ((Date.now() - unitStart) / 1000).toFixed(2);
|
|
513
|
-
this.logger.debug('ANALYSIS complete', { unit: unit.name, duration: unitTime });
|
|
514
|
-
|
|
515
|
-
this.onProgress({
|
|
516
|
-
phase: 'analysis',
|
|
517
|
-
currentPlugin: 'Analyzers',
|
|
518
|
-
message: `Analyzed ${unit.name || unit.path} (${unitTime}s)`,
|
|
519
|
-
totalFiles: unitsToProcess.length,
|
|
520
|
-
processedFiles: processedUnits + idx + 1,
|
|
521
|
-
servicesAnalyzed: processedUnits + idx + 1
|
|
522
|
-
});
|
|
523
|
-
}));
|
|
524
|
-
|
|
525
|
-
processedUnits += batch.length;
|
|
526
|
-
}
|
|
243
|
+
await this.runBatchPhase('ANALYSIS', unitsToProcess, manifest);
|
|
527
244
|
}
|
|
528
|
-
|
|
529
245
|
this.profiler.end('ANALYSIS');
|
|
530
|
-
this.logger.info('ANALYSIS phase complete', { duration: ((Date.now() - analysisStart) / 1000).toFixed(2) });
|
|
531
|
-
|
|
532
|
-
// PHASE 3: ENRICHMENT - post-processing, граф traversal, вычисления (глобально)
|
|
533
|
-
const enrichmentStart = Date.now();
|
|
534
|
-
this.profiler.start('ENRICHMENT');
|
|
535
|
-
this.onProgress({ phase: 'enrichment', currentPlugin: 'Starting enrichment...', message: 'Enriching graph data...', totalFiles: 0, processedFiles: 0 });
|
|
536
|
-
await this.runPhase('ENRICHMENT', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
537
|
-
this.profiler.end('ENRICHMENT');
|
|
538
|
-
this.logger.info('ENRICHMENT phase complete', { duration: ((Date.now() - enrichmentStart) / 1000).toFixed(2) });
|
|
539
246
|
|
|
540
|
-
//
|
|
541
|
-
|
|
542
|
-
const enrichmentDiagnostics = this.diagnosticCollector.getByPhase('ENRICHMENT');
|
|
543
|
-
const strictErrors = enrichmentDiagnostics.filter(d => d.severity === 'fatal');
|
|
544
|
-
|
|
545
|
-
if (strictErrors.length > 0) {
|
|
546
|
-
this.logger.error(`Strict mode: ${strictErrors.length} unresolved reference(s) found`);
|
|
547
|
-
// REG-357: Pass suppressedByIgnore count from enrichment plugin results
|
|
548
|
-
throw new StrictModeFailure(strictErrors, this.suppressedByIgnoreCount);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
// PHASE 4: VALIDATION - проверка корректности графа (глобально)
|
|
553
|
-
const validationStart = Date.now();
|
|
554
|
-
this.profiler.start('VALIDATION');
|
|
555
|
-
this.onProgress({ phase: 'validation', currentPlugin: 'Starting validation...', message: 'Validating graph structure...', totalFiles: 0, processedFiles: 0 });
|
|
556
|
-
await this.runPhase('VALIDATION', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
557
|
-
this.profiler.end('VALIDATION');
|
|
558
|
-
this.logger.info('VALIDATION phase complete', { duration: ((Date.now() - validationStart) / 1000).toFixed(2) });
|
|
559
|
-
|
|
560
|
-
// Flush graph to ensure all edges are persisted and queryable
|
|
561
|
-
if (this.graph.flush) {
|
|
562
|
-
await this.graph.flush();
|
|
563
|
-
}
|
|
247
|
+
// PHASES 3-4: ENRICHMENT → strict barrier → guarantee → VALIDATION → flush
|
|
248
|
+
await this.runPipelineEpilogue(manifest, absoluteProjectPath);
|
|
564
249
|
|
|
565
250
|
const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
|
|
566
251
|
this.logger.info('Analysis complete', { duration: totalTime, units: unitsToProcess.length });
|
|
567
252
|
|
|
568
|
-
// Print profiling summary
|
|
569
|
-
this.profiler.printSummary();
|
|
570
|
-
|
|
571
253
|
return manifest;
|
|
572
254
|
}
|
|
573
255
|
|
|
@@ -589,11 +271,8 @@ export class Orchestrator {
|
|
|
589
271
|
this.logger.info('Graph cleared successfully');
|
|
590
272
|
}
|
|
591
273
|
|
|
592
|
-
//
|
|
593
|
-
await this.
|
|
594
|
-
|
|
595
|
-
// Declare metadata fields for RFDB server-side indexing (REG-398)
|
|
596
|
-
await this.declarePluginFields();
|
|
274
|
+
// Initialize graph: plugin nodes, field declarations, meta node (REG-386, REG-398, REG-408)
|
|
275
|
+
await this.graphInitializer.init(workspacePath);
|
|
597
276
|
|
|
598
277
|
// Collect all services from all roots
|
|
599
278
|
const allServices: ServiceInfo[] = [];
|
|
@@ -611,55 +290,16 @@ export class Orchestrator {
|
|
|
611
290
|
});
|
|
612
291
|
|
|
613
292
|
// Discover services in this root
|
|
614
|
-
const rootManifest = await this.discoverInRoot(rootAbsolutePath
|
|
293
|
+
const rootManifest = await this.discoveryManager.discoverInRoot(rootAbsolutePath);
|
|
615
294
|
|
|
616
295
|
// Build indexing units for this root
|
|
617
|
-
const units = this.buildIndexingUnits(rootManifest);
|
|
296
|
+
const units = this.discoveryManager.buildIndexingUnits(rootManifest);
|
|
618
297
|
|
|
619
|
-
// INDEXING
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
projectPath: rootAbsolutePath,
|
|
623
|
-
service: {
|
|
624
|
-
...unit,
|
|
625
|
-
id: unit.id,
|
|
626
|
-
name: unit.name,
|
|
627
|
-
path: unit.path
|
|
628
|
-
},
|
|
629
|
-
modules: [],
|
|
630
|
-
rootPrefix: rootName, // REG-76: Pass root prefix
|
|
631
|
-
};
|
|
632
|
-
|
|
633
|
-
await this.runPhase('INDEXING', {
|
|
634
|
-
manifest: unitManifest,
|
|
635
|
-
graph: this.graph,
|
|
636
|
-
workerCount: 1,
|
|
637
|
-
rootPrefix: rootName, // Pass to context
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
// ANALYSIS phase for this root
|
|
298
|
+
// INDEXING + ANALYSIS phases for this root
|
|
299
|
+
const rootOpts = { rootPrefix: rootName };
|
|
300
|
+
await this.runBatchPhase('INDEXING', units, rootManifest, rootOpts);
|
|
642
301
|
if (!this.indexOnly) {
|
|
643
|
-
|
|
644
|
-
const unitManifest: UnitManifest = {
|
|
645
|
-
projectPath: rootAbsolutePath,
|
|
646
|
-
service: {
|
|
647
|
-
...unit,
|
|
648
|
-
id: unit.id,
|
|
649
|
-
name: unit.name,
|
|
650
|
-
path: unit.path
|
|
651
|
-
},
|
|
652
|
-
modules: [],
|
|
653
|
-
rootPrefix: rootName,
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
await this.runPhase('ANALYSIS', {
|
|
657
|
-
manifest: unitManifest,
|
|
658
|
-
graph: this.graph,
|
|
659
|
-
workerCount: 1,
|
|
660
|
-
rootPrefix: rootName,
|
|
661
|
-
});
|
|
662
|
-
}
|
|
302
|
+
await this.runBatchPhase('ANALYSIS', units, rootManifest, rootOpts);
|
|
663
303
|
}
|
|
664
304
|
|
|
665
305
|
// Collect services with root prefix in path for unified manifest
|
|
@@ -693,380 +333,129 @@ export class Orchestrator {
|
|
|
693
333
|
return unifiedManifest;
|
|
694
334
|
}
|
|
695
335
|
|
|
696
|
-
// ENRICHMENT
|
|
697
|
-
this.
|
|
698
|
-
await this.runPhase('ENRICHMENT', {
|
|
699
|
-
manifest: unifiedManifest,
|
|
700
|
-
graph: this.graph,
|
|
701
|
-
workerCount: this.workerCount
|
|
702
|
-
});
|
|
703
|
-
this.profiler.end('ENRICHMENT');
|
|
704
|
-
|
|
705
|
-
// VALIDATION phase (global)
|
|
706
|
-
this.profiler.start('VALIDATION');
|
|
707
|
-
await this.runPhase('VALIDATION', {
|
|
708
|
-
manifest: unifiedManifest,
|
|
709
|
-
graph: this.graph,
|
|
710
|
-
workerCount: this.workerCount
|
|
711
|
-
});
|
|
712
|
-
this.profiler.end('VALIDATION');
|
|
713
|
-
|
|
714
|
-
// Flush graph
|
|
715
|
-
if (this.graph.flush) {
|
|
716
|
-
await this.graph.flush();
|
|
717
|
-
}
|
|
336
|
+
// ENRICHMENT → strict barrier → guarantee → VALIDATION → flush
|
|
337
|
+
await this.runPipelineEpilogue(unifiedManifest, workspacePath);
|
|
718
338
|
|
|
719
339
|
const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
|
|
720
|
-
this.logger.info('Multi-root analysis complete', {
|
|
721
|
-
duration: totalTime,
|
|
722
|
-
roots: roots.length,
|
|
723
|
-
services: allServices.length
|
|
724
|
-
});
|
|
340
|
+
this.logger.info('Multi-root analysis complete', { duration: totalTime, roots: roots.length, services: allServices.length });
|
|
725
341
|
|
|
726
|
-
this.profiler.printSummary();
|
|
727
342
|
return unifiedManifest;
|
|
728
343
|
}
|
|
729
344
|
|
|
730
345
|
/**
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
*/
|
|
734
|
-
private async discoverInRoot(rootPath: string, _rootName: string): Promise<DiscoveryManifest> {
|
|
735
|
-
// For now, use the same discovery mechanism
|
|
736
|
-
// rootName is available for future use if needed
|
|
737
|
-
return this.discover(rootPath);
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Build unified list of indexing units from services and entrypoints
|
|
742
|
-
* Each unit has: id, name, path, type, and original data
|
|
346
|
+
* Run a per-unit phase (INDEXING or ANALYSIS) in batches.
|
|
347
|
+
* Common batch processing logic extracted from run() (REG-462).
|
|
743
348
|
*/
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
...service, // Spread first to allow overrides
|
|
755
|
-
id: service.id,
|
|
756
|
-
name: service.name,
|
|
757
|
-
path: path,
|
|
758
|
-
type: 'service' as const,
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
// 2. Add entrypoints that aren't already covered by services
|
|
764
|
-
for (const ep of manifest.entrypoints || []) {
|
|
765
|
-
const path = ep.file;
|
|
766
|
-
if (path && !seenPaths.has(path)) {
|
|
767
|
-
seenPaths.add(path);
|
|
768
|
-
units.push({
|
|
769
|
-
...ep, // Spread first to allow overrides
|
|
770
|
-
id: ep.id,
|
|
771
|
-
name: ep.name || ep.file.split('/').pop()!,
|
|
772
|
-
path: path,
|
|
773
|
-
type: 'entrypoint' as const,
|
|
774
|
-
entrypointType: ep.type,
|
|
775
|
-
trigger: ep.trigger,
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
}
|
|
349
|
+
private async runBatchPhase(
|
|
350
|
+
phaseName: string,
|
|
351
|
+
units: IndexingUnit[],
|
|
352
|
+
manifest: DiscoveryManifest,
|
|
353
|
+
options?: { rootPrefix?: string },
|
|
354
|
+
): Promise<void> {
|
|
355
|
+
const phase = phaseName.toLowerCase() as 'indexing' | 'analysis';
|
|
356
|
+
const pluginLabel = phaseName === 'INDEXING' ? 'JSModuleIndexer' : 'Analyzers';
|
|
357
|
+
const BATCH_SIZE = this.workerCount;
|
|
358
|
+
let processedUnits = 0;
|
|
779
359
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
services: units.filter(u => u.type === 'service').length,
|
|
783
|
-
entrypoints: units.filter(u => u.type === 'entrypoint').length
|
|
784
|
-
});
|
|
785
|
-
return units;
|
|
786
|
-
}
|
|
360
|
+
for (let batchStart = 0; batchStart < units.length; batchStart += BATCH_SIZE) {
|
|
361
|
+
const batch = units.slice(batchStart, batchStart + BATCH_SIZE);
|
|
787
362
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
serviceCount: this.configServices.length
|
|
363
|
+
this.onProgress({
|
|
364
|
+
phase,
|
|
365
|
+
currentPlugin: pluginLabel,
|
|
366
|
+
message: `[${processedUnits + 1}-${processedUnits + batch.length}/${units.length}] Batch ${phase}...`,
|
|
367
|
+
totalFiles: units.length,
|
|
368
|
+
processedFiles: processedUnits,
|
|
369
|
+
totalServices: units.length,
|
|
370
|
+
servicesAnalyzed: processedUnits,
|
|
797
371
|
});
|
|
798
372
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
const packageJsonPath = join(servicePath, 'package.json');
|
|
815
|
-
if (existsSync(packageJsonPath)) {
|
|
816
|
-
try {
|
|
817
|
-
const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
818
|
-
entrypoint = resolveSourceEntrypoint(servicePath, pkg) ?? pkg.main ?? 'index.js';
|
|
819
|
-
} catch (e) {
|
|
820
|
-
const message = e instanceof Error ? e.message : String(e);
|
|
821
|
-
this.logger.warn('Failed to read package.json for auto-detection', {
|
|
822
|
-
service: configSvc.name,
|
|
823
|
-
path: packageJsonPath,
|
|
824
|
-
error: message
|
|
825
|
-
});
|
|
826
|
-
entrypoint = 'index.js';
|
|
827
|
-
}
|
|
828
|
-
} else {
|
|
829
|
-
entrypoint = 'index.js';
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
// Create SERVICE node
|
|
834
|
-
const serviceNode = NodeFactory.createService(configSvc.name, servicePath, {
|
|
835
|
-
discoveryMethod: 'config',
|
|
836
|
-
entrypoint: entrypoint,
|
|
837
|
-
});
|
|
838
|
-
await this.graph.addNode(serviceNode);
|
|
839
|
-
|
|
840
|
-
services.push({
|
|
841
|
-
id: serviceNode.id,
|
|
842
|
-
name: configSvc.name,
|
|
843
|
-
path: servicePath,
|
|
844
|
-
metadata: {
|
|
845
|
-
entrypoint: join(servicePath, entrypoint),
|
|
846
|
-
},
|
|
373
|
+
for (let idx = 0; idx < batch.length; idx++) {
|
|
374
|
+
const unit = batch[idx];
|
|
375
|
+
const unitStart = Date.now();
|
|
376
|
+
const unitManifest: UnitManifest = {
|
|
377
|
+
projectPath: manifest.projectPath,
|
|
378
|
+
service: { ...unit, id: unit.id, name: unit.name, path: unit.path },
|
|
379
|
+
modules: [],
|
|
380
|
+
rootPrefix: options?.rootPrefix,
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
await this.runPhase(phaseName, {
|
|
384
|
+
manifest: unitManifest,
|
|
385
|
+
graph: this.graph,
|
|
386
|
+
workerCount: 1,
|
|
387
|
+
...(options?.rootPrefix ? { rootPrefix: options.rootPrefix } : {}),
|
|
847
388
|
});
|
|
389
|
+
const unitTime = ((Date.now() - unitStart) / 1000).toFixed(2);
|
|
390
|
+
this.logger.debug(`${phaseName} complete`, { unit: unit.name, duration: unitTime });
|
|
848
391
|
|
|
849
|
-
this.
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
392
|
+
this.onProgress({
|
|
393
|
+
phase,
|
|
394
|
+
currentPlugin: pluginLabel,
|
|
395
|
+
message: `${unit.name || unit.path} (${unitTime}s)`,
|
|
396
|
+
totalFiles: units.length,
|
|
397
|
+
processedFiles: processedUnits + idx + 1,
|
|
398
|
+
totalServices: units.length,
|
|
399
|
+
servicesAnalyzed: processedUnits + idx + 1,
|
|
400
|
+
currentService: unit.name || unit.path,
|
|
853
401
|
});
|
|
854
402
|
}
|
|
855
403
|
|
|
856
|
-
|
|
857
|
-
services,
|
|
858
|
-
entrypoints: [], // Config services don't provide entrypoints
|
|
859
|
-
projectPath: projectPath
|
|
860
|
-
};
|
|
404
|
+
processedUnits += batch.length;
|
|
861
405
|
}
|
|
406
|
+
}
|
|
862
407
|
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
408
|
+
/**
|
|
409
|
+
* Run post-indexing pipeline: ENRICHMENT → strict barrier → guarantee → VALIDATION → flush.
|
|
410
|
+
* Common epilogue shared by run() and runMultiRoot() (REG-462).
|
|
411
|
+
*/
|
|
412
|
+
private async runPipelineEpilogue(manifest: DiscoveryManifest, projectPath: string): Promise<void> {
|
|
413
|
+
// ENRICHMENT phase (global)
|
|
414
|
+
const enrichmentStart = Date.now();
|
|
415
|
+
this.profiler.start('ENRICHMENT');
|
|
416
|
+
this.onProgress({ phase: 'enrichment', currentPlugin: 'Starting enrichment...', message: 'Enriching graph data...', totalFiles: 0, processedFiles: 0 });
|
|
417
|
+
const enrichmentTypes = await this.runPhase('ENRICHMENT', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
418
|
+
this.profiler.end('ENRICHMENT');
|
|
419
|
+
this.logger.info('ENRICHMENT phase complete', { duration: ((Date.now() - enrichmentStart) / 1000).toFixed(2) });
|
|
871
420
|
|
|
872
|
-
//
|
|
873
|
-
|
|
421
|
+
// STRICT MODE BARRIER (REG-330, REG-332)
|
|
422
|
+
if (this.strictMode) {
|
|
423
|
+
const enrichmentDiagnostics = this.diagnosticCollector.getByPhase('ENRICHMENT');
|
|
424
|
+
const strictErrors = enrichmentDiagnostics.filter(d => d.severity === 'fatal');
|
|
874
425
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
id: p.metadata.name,
|
|
880
|
-
dependencies: p.metadata.dependencies ?? [],
|
|
881
|
-
}))
|
|
882
|
-
);
|
|
883
|
-
discoveryPlugins.length = 0;
|
|
884
|
-
for (const id of sortedDiscoveryIds) {
|
|
885
|
-
const plugin = discoveryPluginMap.get(id);
|
|
886
|
-
if (plugin) discoveryPlugins.push(plugin);
|
|
426
|
+
if (strictErrors.length > 0) {
|
|
427
|
+
this.logger.error(`Strict mode: ${strictErrors.length} unresolved reference(s) found`);
|
|
428
|
+
throw new StrictModeFailure(strictErrors, this.phaseRunner.getSuppressedByIgnoreCount());
|
|
429
|
+
}
|
|
887
430
|
}
|
|
888
431
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
// Выполняем каждый плагин
|
|
893
|
-
for (let i = 0; i < discoveryPlugins.length; i++) {
|
|
894
|
-
const plugin = discoveryPlugins[i];
|
|
895
|
-
|
|
896
|
-
this.onProgress({
|
|
897
|
-
phase: 'discovery',
|
|
898
|
-
currentPlugin: plugin.metadata.name,
|
|
899
|
-
message: `Running ${plugin.metadata.name}... (${i + 1}/${discoveryPlugins.length})`
|
|
900
|
-
});
|
|
901
|
-
|
|
902
|
-
const result = await plugin.execute(context as PluginContext);
|
|
432
|
+
// GUARANTEE CHECK (RFD-18)
|
|
433
|
+
await this.guaranteeChecker.check(enrichmentTypes, projectPath);
|
|
903
434
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
// Collect entrypoints from new-style plugins
|
|
909
|
-
if (result.success && result.metadata?.entrypoints) {
|
|
910
|
-
allEntrypoints.push(...(result.metadata.entrypoints as EntrypointInfo[]));
|
|
911
|
-
}
|
|
435
|
+
// REG-259: Compute covered packages from plugin metadata before validation
|
|
436
|
+
this.storeCoveredPackages();
|
|
912
437
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
hint: 'Services must be returned via result.metadata.services for Orchestrator to index them'
|
|
921
|
-
});
|
|
922
|
-
}
|
|
438
|
+
// VALIDATION phase (global)
|
|
439
|
+
const validationStart = Date.now();
|
|
440
|
+
this.profiler.start('VALIDATION');
|
|
441
|
+
this.onProgress({ phase: 'validation', currentPlugin: 'Starting validation...', message: 'Validating graph structure...', totalFiles: 0, processedFiles: 0 });
|
|
442
|
+
await this.runPhase('VALIDATION', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
443
|
+
this.profiler.end('VALIDATION');
|
|
444
|
+
this.logger.info('VALIDATION phase complete', { duration: ((Date.now() - validationStart) / 1000).toFixed(2) });
|
|
923
445
|
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
message: `✓ ${plugin.metadata.name} complete`
|
|
928
|
-
});
|
|
446
|
+
// Flush and cleanup
|
|
447
|
+
if (this.graph.flush) {
|
|
448
|
+
await this.graph.flush();
|
|
929
449
|
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
services: allServices,
|
|
933
|
-
entrypoints: allEntrypoints,
|
|
934
|
-
projectPath: projectPath
|
|
935
|
-
};
|
|
450
|
+
this.profiler.printSummary();
|
|
451
|
+
this.resourceRegistry.clear();
|
|
936
452
|
}
|
|
937
453
|
|
|
938
454
|
/**
|
|
939
455
|
* Запустить плагины для конкретной фазы
|
|
940
456
|
*/
|
|
941
|
-
async runPhase(phaseName: string, context: Partial<PluginContext> & { graph: PluginContext['graph'] }): Promise<
|
|
942
|
-
|
|
943
|
-
const phasePlugins = this.plugins.filter(plugin =>
|
|
944
|
-
plugin.metadata.phase === phaseName
|
|
945
|
-
);
|
|
946
|
-
|
|
947
|
-
// Topological sort by dependencies (REG-367)
|
|
948
|
-
const pluginMap = new Map(phasePlugins.map(p => [p.metadata.name, p]));
|
|
949
|
-
const sortedIds = toposort(
|
|
950
|
-
phasePlugins.map(p => ({
|
|
951
|
-
id: p.metadata.name,
|
|
952
|
-
dependencies: p.metadata.dependencies ?? [],
|
|
953
|
-
}))
|
|
954
|
-
);
|
|
955
|
-
phasePlugins.length = 0;
|
|
956
|
-
for (const id of sortedIds) {
|
|
957
|
-
const plugin = pluginMap.get(id);
|
|
958
|
-
if (plugin) phasePlugins.push(plugin);
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
// Выполняем плагины последовательно
|
|
962
|
-
for (let i = 0; i < phasePlugins.length; i++) {
|
|
963
|
-
const plugin = phasePlugins[i];
|
|
964
|
-
this.onProgress({
|
|
965
|
-
phase: phaseName.toLowerCase(),
|
|
966
|
-
currentPlugin: plugin.metadata.name,
|
|
967
|
-
message: `Running plugin ${i + 1}/${phasePlugins.length}: ${plugin.metadata.name}`
|
|
968
|
-
});
|
|
969
|
-
// Передаем onProgress и forceAnalysis в контекст для плагинов
|
|
970
|
-
const pluginContext: PluginContext = {
|
|
971
|
-
...context,
|
|
972
|
-
onProgress: this.onProgress as unknown as PluginContext['onProgress'],
|
|
973
|
-
forceAnalysis: this.forceAnalysis,
|
|
974
|
-
logger: this.logger,
|
|
975
|
-
strictMode: this.strictMode, // REG-330: Pass strict mode flag
|
|
976
|
-
// REG-76: Pass rootPrefix for multi-root workspace support
|
|
977
|
-
rootPrefix: (context as { rootPrefix?: string }).rootPrefix,
|
|
978
|
-
};
|
|
979
|
-
|
|
980
|
-
// Add reportIssue for VALIDATION phase
|
|
981
|
-
if (phaseName === 'VALIDATION') {
|
|
982
|
-
pluginContext.reportIssue = async (issue: IssueSpec): Promise<string> => {
|
|
983
|
-
const node = NodeFactory.createIssue(
|
|
984
|
-
issue.category,
|
|
985
|
-
issue.severity as IssueSeverity,
|
|
986
|
-
issue.message,
|
|
987
|
-
plugin.metadata.name,
|
|
988
|
-
issue.file,
|
|
989
|
-
issue.line,
|
|
990
|
-
issue.column || 0,
|
|
991
|
-
{ context: issue.context }
|
|
992
|
-
);
|
|
993
|
-
await context.graph.addNode(node);
|
|
994
|
-
if (issue.targetNodeId) {
|
|
995
|
-
await context.graph.addEdge({
|
|
996
|
-
src: node.id,
|
|
997
|
-
dst: issue.targetNodeId,
|
|
998
|
-
type: 'AFFECTS',
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
return node.id;
|
|
1002
|
-
};
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
try {
|
|
1006
|
-
const result = await plugin.execute(pluginContext);
|
|
1007
|
-
|
|
1008
|
-
// Collect errors into diagnostics
|
|
1009
|
-
this.diagnosticCollector.addFromPluginResult(
|
|
1010
|
-
phaseName as PluginPhase,
|
|
1011
|
-
plugin.metadata.name,
|
|
1012
|
-
result
|
|
1013
|
-
);
|
|
1014
|
-
|
|
1015
|
-
// REG-357: Collect suppressedByIgnore from ENRICHMENT plugin results
|
|
1016
|
-
if (phaseName === 'ENRICHMENT' && result.metadata) {
|
|
1017
|
-
const suppressed = (result.metadata as Record<string, unknown>).suppressedByIgnore;
|
|
1018
|
-
if (typeof suppressed === 'number') {
|
|
1019
|
-
this.suppressedByIgnoreCount += suppressed;
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
// Log plugin completion with warning if errors occurred
|
|
1024
|
-
if (!result.success) {
|
|
1025
|
-
console.warn(`[Orchestrator] Plugin ${plugin.metadata.name} reported failure`, {
|
|
1026
|
-
errors: result.errors.length,
|
|
1027
|
-
warnings: result.warnings.length,
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
// Check for fatal errors - STOP immediately
|
|
1032
|
-
// REG-357: In strict mode ENRICHMENT, don't halt on strict mode errors.
|
|
1033
|
-
// The strict mode barrier after ENRICHMENT handles them collectively.
|
|
1034
|
-
if (this.diagnosticCollector.hasFatal()) {
|
|
1035
|
-
const allDiagnostics = this.diagnosticCollector.getAll();
|
|
1036
|
-
const fatals = allDiagnostics.filter(d => d.severity === 'fatal');
|
|
1037
|
-
|
|
1038
|
-
// Skip halt only if ALL fatals are strict mode errors during ENRICHMENT.
|
|
1039
|
-
// If any non-strict fatal exists, halt immediately.
|
|
1040
|
-
const allStrictErrors = fatals.every(d => d.code.startsWith('STRICT_'));
|
|
1041
|
-
if (!(this.strictMode && phaseName === 'ENRICHMENT' && allStrictErrors)) {
|
|
1042
|
-
const fatal = fatals[0];
|
|
1043
|
-
throw new Error(`Fatal error in ${plugin.metadata.name}: ${fatal?.message || 'Unknown fatal error'}`);
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
} catch (e) {
|
|
1047
|
-
// Plugin threw an exception (not just returned errors)
|
|
1048
|
-
const error = e instanceof Error ? e : new Error(String(e));
|
|
1049
|
-
|
|
1050
|
-
// Don't re-add if this was already a fatal error we threw
|
|
1051
|
-
if (!this.diagnosticCollector.hasFatal()) {
|
|
1052
|
-
this.diagnosticCollector.add({
|
|
1053
|
-
code: 'ERR_PLUGIN_THREW',
|
|
1054
|
-
severity: 'fatal',
|
|
1055
|
-
message: error.message,
|
|
1056
|
-
phase: phaseName as PluginPhase,
|
|
1057
|
-
plugin: plugin.metadata.name,
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
throw error; // Re-throw to stop analysis
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
// Send completion for this plugin
|
|
1064
|
-
this.onProgress({
|
|
1065
|
-
phase: phaseName.toLowerCase(),
|
|
1066
|
-
currentPlugin: plugin.metadata.name,
|
|
1067
|
-
message: `✓ ${plugin.metadata.name} complete`
|
|
1068
|
-
});
|
|
1069
|
-
}
|
|
457
|
+
async runPhase(phaseName: string, context: Partial<PluginContext> & { graph: PluginContext['graph'] }): Promise<Set<string>> {
|
|
458
|
+
return this.phaseRunner.runPhase(phaseName, context);
|
|
1070
459
|
}
|
|
1071
460
|
|
|
1072
461
|
/**
|
|
@@ -1077,172 +466,42 @@ export class Orchestrator {
|
|
|
1077
466
|
}
|
|
1078
467
|
|
|
1079
468
|
/**
|
|
1080
|
-
* Run
|
|
1081
|
-
*
|
|
1082
|
-
* Architecture:
|
|
1083
|
-
* - Tasks are queued per-file with list of applicable plugins
|
|
1084
|
-
* - Workers pick tasks, run plugins, write directly to RFDB
|
|
1085
|
-
* - Barrier waits for all tasks before ENRICHMENT phase
|
|
469
|
+
* Run discovery for a project path.
|
|
470
|
+
* Delegates to DiscoveryManager. Public API for MCP and other callers.
|
|
1086
471
|
*/
|
|
1087
|
-
async
|
|
1088
|
-
|
|
1089
|
-
const maxWorkers = this.parallelConfig!.maxWorkers || null;
|
|
1090
|
-
|
|
1091
|
-
// Get the database path from the main graph backend
|
|
1092
|
-
const mainDbPath = (this.graph as unknown as { dbPath?: string }).dbPath || join(manifest.projectPath, '.grafema', 'graph.rfdb');
|
|
1093
|
-
|
|
1094
|
-
this.logger.debug('Starting queue-based parallel analysis', { database: mainDbPath });
|
|
1095
|
-
|
|
1096
|
-
// Start RFDB server using the SAME database as main graph
|
|
1097
|
-
await this.startRfdbServer(socketPath, mainDbPath);
|
|
1098
|
-
|
|
1099
|
-
// Get ANALYSIS plugins that should run in workers
|
|
1100
|
-
const analysisPlugins = this.plugins
|
|
1101
|
-
.filter(p => p.metadata?.phase === 'ANALYSIS')
|
|
1102
|
-
.map(p => p.metadata.name);
|
|
1103
|
-
|
|
1104
|
-
this.logger.debug('Analysis plugins', { plugins: analysisPlugins });
|
|
1105
|
-
|
|
1106
|
-
// Create analysis queue
|
|
1107
|
-
this.analysisQueue = new AnalysisQueue({
|
|
1108
|
-
socketPath,
|
|
1109
|
-
maxWorkers: maxWorkers || undefined,
|
|
1110
|
-
plugins: analysisPlugins,
|
|
1111
|
-
});
|
|
1112
|
-
|
|
1113
|
-
// Start workers
|
|
1114
|
-
await this.analysisQueue.start();
|
|
1115
|
-
|
|
1116
|
-
// Get all MODULE nodes from graph and queue them
|
|
1117
|
-
let moduleCount = 0;
|
|
1118
|
-
for await (const node of this.graph.queryNodes({ type: 'MODULE' })) {
|
|
1119
|
-
// Skip non-JS/TS files
|
|
1120
|
-
if (!node.file?.match(/\.(js|jsx|ts|tsx|mjs|cjs)$/)) continue;
|
|
1121
|
-
|
|
1122
|
-
this.analysisQueue.addTask({
|
|
1123
|
-
file: node.file,
|
|
1124
|
-
moduleId: node.id,
|
|
1125
|
-
moduleName: node.name as string,
|
|
1126
|
-
plugins: analysisPlugins, // All plugins for now; workers filter by imports
|
|
1127
|
-
});
|
|
1128
|
-
moduleCount++;
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
this.logger.debug('Queued modules for analysis', { count: moduleCount });
|
|
1132
|
-
|
|
1133
|
-
// Subscribe to progress events
|
|
1134
|
-
this.analysisQueue.on('taskCompleted', ({ file, stats, duration }: { file: string; stats?: { nodes?: number }; duration: number }) => {
|
|
1135
|
-
this.onProgress({
|
|
1136
|
-
phase: 'analysis',
|
|
1137
|
-
currentPlugin: 'AnalysisQueue',
|
|
1138
|
-
message: `${file.split('/').pop()} (${stats?.nodes || 0} nodes, ${duration}ms)`,
|
|
1139
|
-
});
|
|
1140
|
-
});
|
|
1141
|
-
|
|
1142
|
-
this.analysisQueue.on('taskFailed', ({ file, error }: { file: string; error: string }) => {
|
|
1143
|
-
this.logger.error('Analysis failed', { file, error });
|
|
1144
|
-
});
|
|
1145
|
-
|
|
1146
|
-
// Wait for all tasks to complete (barrier)
|
|
1147
|
-
const stats = await this.analysisQueue.waitForCompletion();
|
|
1148
|
-
|
|
1149
|
-
this.logger.debug('Queue complete', {
|
|
1150
|
-
nodesCreated: stats.nodesCreated,
|
|
1151
|
-
edgesCreated: stats.edgesCreated,
|
|
1152
|
-
succeeded: stats.tasksCompleted,
|
|
1153
|
-
failed: stats.tasksFailed
|
|
1154
|
-
});
|
|
1155
|
-
|
|
1156
|
-
// Stop workers and server
|
|
1157
|
-
await this.analysisQueue.stop();
|
|
1158
|
-
this.analysisQueue = null;
|
|
1159
|
-
await this.stopRfdbServer();
|
|
472
|
+
async discover(projectPath: string): Promise<DiscoveryManifest> {
|
|
473
|
+
return this.discoveryManager.discover(projectPath);
|
|
1160
474
|
}
|
|
1161
475
|
|
|
1162
476
|
/**
|
|
1163
|
-
*
|
|
1164
|
-
*
|
|
1165
|
-
* @param dbPath - Database path (should be same as main graph)
|
|
477
|
+
* REG-259: Collect package names from plugin `covers` metadata
|
|
478
|
+
* and store them in the ResourceRegistry for PackageCoverageValidator.
|
|
1166
479
|
*/
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
const testClient = new RFDBClient(socketPath);
|
|
1174
|
-
await testClient.connect();
|
|
1175
|
-
await testClient.ping();
|
|
1176
|
-
await testClient.close();
|
|
1177
|
-
this.logger.debug('Using existing RFDB server', { socketPath });
|
|
1178
|
-
this.rfdbServerProcess = null; // Mark that we didn't start the server
|
|
1179
|
-
this._serverWasExternal = true;
|
|
1180
|
-
return;
|
|
1181
|
-
} catch {
|
|
1182
|
-
// Socket exists but server not responding, remove stale socket
|
|
1183
|
-
this.logger.debug('Stale socket found, removing');
|
|
1184
|
-
unlinkSync(socketPath);
|
|
480
|
+
private storeCoveredPackages(): void {
|
|
481
|
+
const coveredPackages = new Set<string>();
|
|
482
|
+
for (const plugin of this.plugins) {
|
|
483
|
+
const covers = plugin.metadata?.covers ?? [];
|
|
484
|
+
for (const pkg of covers) {
|
|
485
|
+
coveredPackages.add(pkg);
|
|
1185
486
|
}
|
|
1186
487
|
}
|
|
1187
488
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
const debugBinary = join(projectRoot, 'packages/rfdb-server/target/debug/rfdb-server');
|
|
1192
|
-
|
|
1193
|
-
let binaryPath = existsSync(serverBinary) ? serverBinary : debugBinary;
|
|
1194
|
-
|
|
1195
|
-
if (!existsSync(binaryPath)) {
|
|
1196
|
-
this.logger.debug('RFDB server binary not found, building', { path: binaryPath });
|
|
1197
|
-
execSync('cargo build --bin rfdb-server', {
|
|
1198
|
-
cwd: join(projectRoot, 'packages/rfdb-server'),
|
|
1199
|
-
stdio: 'inherit',
|
|
1200
|
-
});
|
|
1201
|
-
binaryPath = debugBinary;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
this.logger.debug('Starting RFDB server', { binary: binaryPath, database: dbPath });
|
|
1205
|
-
this.rfdbServerProcess = spawn(binaryPath, [dbPath, '--socket', socketPath], {
|
|
1206
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
1207
|
-
});
|
|
1208
|
-
this._serverWasExternal = false;
|
|
489
|
+
this.resourceRegistry.getOrCreate(COVERED_PACKAGES_RESOURCE_ID, () =>
|
|
490
|
+
createCoveredPackagesResource(coveredPackages)
|
|
491
|
+
);
|
|
1209
492
|
|
|
1210
|
-
this.
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
this.logger.debug('rfdb-server', { message: msg });
|
|
1214
|
-
}
|
|
493
|
+
this.logger.debug('Stored covered packages for validation', {
|
|
494
|
+
count: coveredPackages.size,
|
|
495
|
+
packages: [...coveredPackages],
|
|
1215
496
|
});
|
|
1216
|
-
|
|
1217
|
-
// Wait for server to start
|
|
1218
|
-
let attempts = 0;
|
|
1219
|
-
while (!existsSync(socketPath) && attempts < 30) {
|
|
1220
|
-
await sleep(100);
|
|
1221
|
-
attempts++;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
if (!existsSync(socketPath)) {
|
|
1225
|
-
throw new Error('RFDB server failed to start');
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
this.logger.debug('RFDB server started', { socketPath });
|
|
1229
497
|
}
|
|
1230
498
|
|
|
1231
499
|
/**
|
|
1232
|
-
*
|
|
500
|
+
* Build unified list of indexing units from manifest.
|
|
501
|
+
* Delegates to DiscoveryManager. Public API for external callers.
|
|
1233
502
|
*/
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
if (this._serverWasExternal) {
|
|
1237
|
-
this.logger.debug('Leaving external RFDB server running');
|
|
1238
|
-
return;
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
if (this.rfdbServerProcess) {
|
|
1242
|
-
this.rfdbServerProcess.kill('SIGTERM');
|
|
1243
|
-
await sleep(200);
|
|
1244
|
-
this.rfdbServerProcess = null;
|
|
1245
|
-
this.logger.debug('RFDB server stopped');
|
|
1246
|
-
}
|
|
503
|
+
buildIndexingUnits(manifest: DiscoveryManifest): IndexingUnit[] {
|
|
504
|
+
return this.discoveryManager.buildIndexingUnits(manifest);
|
|
1247
505
|
}
|
|
506
|
+
|
|
1248
507
|
}
|