@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/dist/Orchestrator.js
CHANGED
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
* Orchestrator - управляет процессом анализа через фазы
|
|
3
3
|
* Полностью абстрактный - специфичная логика в плагинах
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { join, dirname, resolve, basename } from 'path';
|
|
7
|
-
import { fileURLToPath } from 'url';
|
|
8
|
-
import { spawn, execSync } from 'child_process';
|
|
9
|
-
import { setTimeout as sleep } from 'timers/promises';
|
|
5
|
+
import { join, resolve, basename } from 'path';
|
|
10
6
|
import { SimpleProjectDiscovery } from './plugins/discovery/SimpleProjectDiscovery.js';
|
|
11
|
-
import { resolveSourceEntrypoint } from './plugins/discovery/resolveSourceEntrypoint.js';
|
|
12
7
|
import { Profiler } from './core/Profiler.js';
|
|
13
|
-
import { AnalysisQueue } from './core/AnalysisQueue.js';
|
|
14
8
|
import { DiagnosticCollector } from './diagnostics/DiagnosticCollector.js';
|
|
15
9
|
import { StrictModeFailure } from './errors/GrafemaError.js';
|
|
10
|
+
import { ResourceRegistryImpl } from './core/ResourceRegistry.js';
|
|
16
11
|
import { createLogger } from './logging/Logger.js';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
12
|
+
import { PhaseRunner } from './PhaseRunner.js';
|
|
13
|
+
import { GraphInitializer } from './GraphInitializer.js';
|
|
14
|
+
import { DiscoveryManager } from './DiscoveryManager.js';
|
|
15
|
+
import { GuaranteeChecker } from './GuaranteeChecker.js';
|
|
16
|
+
import { ParallelAnalysisRunner } from './ParallelAnalysisRunner.js';
|
|
17
|
+
import { COVERED_PACKAGES_RESOURCE_ID, createCoveredPackagesResource } from './plugins/validation/PackageCoverageValidator.js';
|
|
19
18
|
export class Orchestrator {
|
|
20
19
|
graph;
|
|
21
20
|
config;
|
|
@@ -28,9 +27,6 @@ export class Orchestrator {
|
|
|
28
27
|
indexOnly;
|
|
29
28
|
profiler;
|
|
30
29
|
parallelConfig;
|
|
31
|
-
analysisQueue;
|
|
32
|
-
rfdbServerProcess;
|
|
33
|
-
_serverWasExternal;
|
|
34
30
|
diagnosticCollector;
|
|
35
31
|
logger;
|
|
36
32
|
/** Config-provided services (REG-174) */
|
|
@@ -39,8 +35,20 @@ export class Orchestrator {
|
|
|
39
35
|
strictMode;
|
|
40
36
|
/** Multi-root workspace roots (REG-76) */
|
|
41
37
|
workspaceRoots;
|
|
42
|
-
/**
|
|
43
|
-
|
|
38
|
+
/** Resource registry for inter-plugin communication (REG-256) */
|
|
39
|
+
resourceRegistry = new ResourceRegistryImpl();
|
|
40
|
+
/** Routing rules from config (REG-256) */
|
|
41
|
+
routing;
|
|
42
|
+
/** Phase executor (extracted from runPhase, RFD-16) */
|
|
43
|
+
phaseRunner;
|
|
44
|
+
/** Graph setup: plugin nodes, field declarations, meta node (REG-462) */
|
|
45
|
+
graphInitializer;
|
|
46
|
+
/** Service/entrypoint discovery (REG-462) */
|
|
47
|
+
discoveryManager;
|
|
48
|
+
/** Guarantee checking after enrichment (REG-462) */
|
|
49
|
+
guaranteeChecker;
|
|
50
|
+
/** Parallel analysis runner (REG-462) */
|
|
51
|
+
parallelRunner = null;
|
|
44
52
|
constructor(options = {}) {
|
|
45
53
|
this.graph = options.graph;
|
|
46
54
|
this.config = options;
|
|
@@ -54,9 +62,6 @@ export class Orchestrator {
|
|
|
54
62
|
this.profiler = new Profiler('Orchestrator');
|
|
55
63
|
// Parallel/queue-based analysis config
|
|
56
64
|
this.parallelConfig = options.parallel || null;
|
|
57
|
-
this.analysisQueue = null;
|
|
58
|
-
this.rfdbServerProcess = null;
|
|
59
|
-
this._serverWasExternal = false;
|
|
60
65
|
// Initialize diagnostic collector
|
|
61
66
|
this.diagnosticCollector = new DiagnosticCollector();
|
|
62
67
|
// Initialize logger (use provided or create default)
|
|
@@ -67,6 +72,30 @@ export class Orchestrator {
|
|
|
67
72
|
this.strictMode = options.strictMode ?? false;
|
|
68
73
|
// Multi-root workspace configuration (REG-76)
|
|
69
74
|
this.workspaceRoots = options.workspaceRoots;
|
|
75
|
+
// Routing rules from config (REG-256)
|
|
76
|
+
this.routing = options.routing;
|
|
77
|
+
// Initialize phase runner (RFD-16: extracted from runPhase)
|
|
78
|
+
this.phaseRunner = new PhaseRunner({
|
|
79
|
+
plugins: this.plugins,
|
|
80
|
+
onProgress: this.onProgress,
|
|
81
|
+
forceAnalysis: this.forceAnalysis,
|
|
82
|
+
logger: this.logger,
|
|
83
|
+
strictMode: this.strictMode,
|
|
84
|
+
diagnosticCollector: this.diagnosticCollector,
|
|
85
|
+
resourceRegistry: this.resourceRegistry,
|
|
86
|
+
configServices: this.configServices,
|
|
87
|
+
routing: this.routing,
|
|
88
|
+
});
|
|
89
|
+
// Initialize graph initializer (REG-462: extracted from Orchestrator)
|
|
90
|
+
this.graphInitializer = new GraphInitializer(this.graph, this.plugins, this.logger);
|
|
91
|
+
// Initialize discovery manager (REG-462: extracted from Orchestrator)
|
|
92
|
+
this.discoveryManager = new DiscoveryManager(this.plugins, this.graph, this.config, this.logger, this.onProgress, this.configServices);
|
|
93
|
+
// Initialize guarantee checker (REG-462: extracted from Orchestrator)
|
|
94
|
+
this.guaranteeChecker = new GuaranteeChecker(this.graph, this.diagnosticCollector, this.profiler, this.onProgress, this.logger);
|
|
95
|
+
// Initialize parallel runner if enabled (REG-462: extracted from Orchestrator)
|
|
96
|
+
if (this.parallelConfig?.enabled) {
|
|
97
|
+
this.parallelRunner = new ParallelAnalysisRunner(this.graph, this.plugins, this.parallelConfig, this.onProgress, this.logger);
|
|
98
|
+
}
|
|
70
99
|
// Modified auto-add logic: SKIP auto-add if config services provided (REG-174)
|
|
71
100
|
const hasDiscovery = this.plugins.some(p => p.metadata?.phase === 'DISCOVERY');
|
|
72
101
|
const hasConfigServices = this.configServices && this.configServices.length > 0;
|
|
@@ -75,90 +104,15 @@ export class Orchestrator {
|
|
|
75
104
|
this.plugins.unshift(new SimpleProjectDiscovery());
|
|
76
105
|
}
|
|
77
106
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Register all loaded plugins as grafema:plugin nodes in the graph.
|
|
80
|
-
*
|
|
81
|
-
* Creates a node for each plugin with its metadata (phase, priority,
|
|
82
|
-
* creates, dependencies). Also creates DEPENDS_ON edges between
|
|
83
|
-
* plugins that declare dependencies.
|
|
84
|
-
*
|
|
85
|
-
* Called once at the start of run(), before any analysis phase.
|
|
86
|
-
* Complexity: O(p) where p = number of plugins (typically 20-35).
|
|
87
|
-
*/
|
|
88
|
-
async registerPluginNodes() {
|
|
89
|
-
const pluginNodes = [];
|
|
90
|
-
for (const plugin of this.plugins) {
|
|
91
|
-
const meta = plugin.metadata;
|
|
92
|
-
if (!meta?.name)
|
|
93
|
-
continue;
|
|
94
|
-
const sourceFile = plugin.config?.sourceFile || '';
|
|
95
|
-
const isBuiltin = !sourceFile;
|
|
96
|
-
const node = NodeFactory.createPlugin(meta.name, meta.phase, {
|
|
97
|
-
file: sourceFile,
|
|
98
|
-
builtin: isBuiltin,
|
|
99
|
-
createsNodes: meta.creates?.nodes ?? [],
|
|
100
|
-
createsEdges: meta.creates?.edges ?? [],
|
|
101
|
-
dependencies: meta.dependencies ?? [],
|
|
102
|
-
});
|
|
103
|
-
await this.graph.addNode(node);
|
|
104
|
-
pluginNodes.push({
|
|
105
|
-
id: node.id,
|
|
106
|
-
name: meta.name,
|
|
107
|
-
dependencies: meta.dependencies ?? [],
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
// Create DEPENDS_ON edges between plugins
|
|
111
|
-
const nameToId = new Map();
|
|
112
|
-
for (const pn of pluginNodes) {
|
|
113
|
-
nameToId.set(pn.name, pn.id);
|
|
114
|
-
}
|
|
115
|
-
for (const pn of pluginNodes) {
|
|
116
|
-
for (const dep of pn.dependencies) {
|
|
117
|
-
const depId = nameToId.get(dep);
|
|
118
|
-
if (depId) {
|
|
119
|
-
await this.graph.addEdge({
|
|
120
|
-
src: pn.id,
|
|
121
|
-
dst: depId,
|
|
122
|
-
type: 'DEPENDS_ON',
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
this.logger.debug('Registered plugin nodes', {
|
|
128
|
-
count: pluginNodes.length,
|
|
129
|
-
edges: pluginNodes.reduce((sum, pn) => sum + pn.dependencies.filter(d => nameToId.has(d)).length, 0),
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Collect field declarations from all plugins and send to RFDB for indexing.
|
|
134
|
-
* Deduplicates by field name (last declaration wins if nodeTypes differ).
|
|
135
|
-
* Called once before analysis to enable server-side metadata indexing.
|
|
136
|
-
*/
|
|
137
|
-
async declarePluginFields() {
|
|
138
|
-
if (!this.graph.declareFields)
|
|
139
|
-
return;
|
|
140
|
-
const fieldMap = new Map();
|
|
141
|
-
for (const plugin of this.plugins) {
|
|
142
|
-
const fields = plugin.metadata?.fields;
|
|
143
|
-
if (!fields)
|
|
144
|
-
continue;
|
|
145
|
-
for (const field of fields) {
|
|
146
|
-
fieldMap.set(field.name, field);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (fieldMap.size === 0)
|
|
150
|
-
return;
|
|
151
|
-
const fields = [...fieldMap.values()];
|
|
152
|
-
const count = await this.graph.declareFields(fields);
|
|
153
|
-
this.logger.debug('Declared metadata fields for indexing', { fields: count });
|
|
154
|
-
}
|
|
155
107
|
/**
|
|
156
108
|
* Запустить анализ проекта
|
|
157
109
|
*/
|
|
158
110
|
async run(projectPath) {
|
|
159
111
|
const totalStartTime = Date.now();
|
|
160
112
|
// REG-357: Reset suppressed count for each run
|
|
161
|
-
this.
|
|
113
|
+
this.phaseRunner.resetSuppressedByIgnoreCount();
|
|
114
|
+
// REG-256: Reset resource registry for each run
|
|
115
|
+
this.resourceRegistry.clear();
|
|
162
116
|
// Resolve to absolute path
|
|
163
117
|
const absoluteProjectPath = projectPath.startsWith('/') ? projectPath : resolve(projectPath);
|
|
164
118
|
// REG-76: Multi-root workspace support
|
|
@@ -172,35 +126,12 @@ export class Orchestrator {
|
|
|
172
126
|
await this.graph.clear();
|
|
173
127
|
this.logger.info('Graph cleared successfully');
|
|
174
128
|
}
|
|
175
|
-
//
|
|
176
|
-
await this.
|
|
177
|
-
// Declare metadata fields for RFDB server-side indexing (REG-398)
|
|
178
|
-
await this.declarePluginFields();
|
|
129
|
+
// Initialize graph: plugin nodes, field declarations (REG-386, REG-398)
|
|
130
|
+
await this.graphInitializer.init(absoluteProjectPath);
|
|
179
131
|
this.onProgress({ phase: 'discovery', currentPlugin: 'Starting discovery...', message: 'Discovering services...', totalFiles: 0, processedFiles: 0 });
|
|
180
|
-
// PHASE 0: DISCOVERY
|
|
132
|
+
// PHASE 0: DISCOVERY
|
|
181
133
|
this.profiler.start('DISCOVERY');
|
|
182
|
-
|
|
183
|
-
if (this.entrypoint) {
|
|
184
|
-
// Skip discovery, create synthetic manifest with single service
|
|
185
|
-
const entrypointPath = this.entrypoint.startsWith('/')
|
|
186
|
-
? this.entrypoint
|
|
187
|
-
: join(absoluteProjectPath, this.entrypoint);
|
|
188
|
-
const serviceName = this.entrypoint.split('/').pop()?.replace(/\.[^.]+$/, '') || 'main';
|
|
189
|
-
manifest = {
|
|
190
|
-
services: [{
|
|
191
|
-
id: `service:${serviceName}`,
|
|
192
|
-
name: serviceName,
|
|
193
|
-
path: entrypointPath,
|
|
194
|
-
metadata: { entrypoint: entrypointPath }
|
|
195
|
-
}],
|
|
196
|
-
entrypoints: [],
|
|
197
|
-
projectPath: absoluteProjectPath
|
|
198
|
-
};
|
|
199
|
-
this.logger.info('Using entrypoint override', { entrypoint: this.entrypoint, resolved: entrypointPath });
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
manifest = await this.discover(absoluteProjectPath);
|
|
203
|
-
}
|
|
134
|
+
const manifest = await this.discoveryManager.discover(absoluteProjectPath, this.entrypoint);
|
|
204
135
|
this.profiler.end('DISCOVERY');
|
|
205
136
|
const epCount = manifest.entrypoints?.length || 0;
|
|
206
137
|
const svcCount = manifest.services?.length || 0;
|
|
@@ -213,7 +144,7 @@ export class Orchestrator {
|
|
|
213
144
|
});
|
|
214
145
|
this.logger.info('Discovery complete', { services: svcCount, entrypoints: epCount });
|
|
215
146
|
// Build unified list of indexing units from services AND entrypoints
|
|
216
|
-
const indexingUnits = this.buildIndexingUnits(manifest);
|
|
147
|
+
const indexingUnits = this.discoveryManager.buildIndexingUnits(manifest);
|
|
217
148
|
// Filter if specified
|
|
218
149
|
let unitsToProcess;
|
|
219
150
|
if (this.serviceFilter) {
|
|
@@ -227,159 +158,31 @@ export class Orchestrator {
|
|
|
227
158
|
unitsToProcess = indexingUnits;
|
|
228
159
|
}
|
|
229
160
|
this.logger.info('Processing indexing units', { count: unitsToProcess.length, strategy: 'Phase-by-phase with DFS' });
|
|
230
|
-
// PHASE 1: INDEXING
|
|
231
|
-
const indexingStart = Date.now();
|
|
161
|
+
// PHASE 1: INDEXING
|
|
232
162
|
this.profiler.start('INDEXING');
|
|
233
|
-
this.onProgress({
|
|
234
|
-
|
|
235
|
-
currentPlugin: 'Starting indexing...',
|
|
236
|
-
message: 'Building dependency trees...',
|
|
237
|
-
totalFiles: unitsToProcess.length,
|
|
238
|
-
processedFiles: 0
|
|
239
|
-
});
|
|
240
|
-
// Параллельная обработка units батчами
|
|
241
|
-
const BATCH_SIZE = this.workerCount;
|
|
242
|
-
let processedUnits = 0;
|
|
243
|
-
for (let batchStart = 0; batchStart < unitsToProcess.length; batchStart += BATCH_SIZE) {
|
|
244
|
-
const batch = unitsToProcess.slice(batchStart, batchStart + BATCH_SIZE);
|
|
245
|
-
this.onProgress({
|
|
246
|
-
phase: 'indexing',
|
|
247
|
-
currentPlugin: 'JSModuleIndexer',
|
|
248
|
-
message: `[${processedUnits + 1}-${processedUnits + batch.length}/${unitsToProcess.length}] Batch indexing...`,
|
|
249
|
-
totalFiles: unitsToProcess.length,
|
|
250
|
-
processedFiles: processedUnits
|
|
251
|
-
});
|
|
252
|
-
// Параллельно обрабатываем батч units
|
|
253
|
-
await Promise.all(batch.map(async (unit, idx) => {
|
|
254
|
-
const unitStart = Date.now();
|
|
255
|
-
const unitManifest = {
|
|
256
|
-
projectPath: manifest.projectPath,
|
|
257
|
-
service: {
|
|
258
|
-
...unit, // Pass all unit fields
|
|
259
|
-
id: unit.id,
|
|
260
|
-
name: unit.name,
|
|
261
|
-
path: unit.path
|
|
262
|
-
},
|
|
263
|
-
modules: []
|
|
264
|
-
};
|
|
265
|
-
await this.runPhase('INDEXING', {
|
|
266
|
-
manifest: unitManifest,
|
|
267
|
-
graph: this.graph,
|
|
268
|
-
workerCount: 1,
|
|
269
|
-
});
|
|
270
|
-
const unitTime = ((Date.now() - unitStart) / 1000).toFixed(2);
|
|
271
|
-
this.logger.debug('INDEXING complete', { unit: unit.name, duration: unitTime });
|
|
272
|
-
this.onProgress({
|
|
273
|
-
phase: 'indexing',
|
|
274
|
-
currentPlugin: 'JSModuleIndexer',
|
|
275
|
-
message: `Indexed ${unit.name || unit.path} (${unitTime}s)`,
|
|
276
|
-
totalFiles: unitsToProcess.length,
|
|
277
|
-
processedFiles: processedUnits + idx + 1,
|
|
278
|
-
servicesAnalyzed: processedUnits + idx + 1
|
|
279
|
-
});
|
|
280
|
-
}));
|
|
281
|
-
processedUnits += batch.length;
|
|
282
|
-
}
|
|
163
|
+
this.onProgress({ phase: 'indexing', currentPlugin: 'Starting indexing...', message: 'Building dependency trees...', totalFiles: unitsToProcess.length, processedFiles: 0 });
|
|
164
|
+
await this.runBatchPhase('INDEXING', unitsToProcess, manifest);
|
|
283
165
|
this.profiler.end('INDEXING');
|
|
284
|
-
this.logger.info('INDEXING phase complete', { duration: ((Date.now() - indexingStart) / 1000).toFixed(2) });
|
|
285
166
|
// Skip remaining phases if indexOnly mode (for coverage)
|
|
286
167
|
if (this.indexOnly) {
|
|
287
168
|
const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
|
|
288
169
|
this.logger.info('indexOnly mode - skipping remaining phases', { duration: totalTime, units: unitsToProcess.length });
|
|
289
170
|
return manifest;
|
|
290
171
|
}
|
|
291
|
-
// PHASE 2: ANALYSIS
|
|
292
|
-
const analysisStart = Date.now();
|
|
172
|
+
// PHASE 2: ANALYSIS
|
|
293
173
|
this.profiler.start('ANALYSIS');
|
|
294
|
-
this.onProgress({
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
message: 'Analyzing all units...',
|
|
298
|
-
totalFiles: unitsToProcess.length,
|
|
299
|
-
processedFiles: 0
|
|
300
|
-
});
|
|
301
|
-
// Check if parallel analysis is enabled (new functionality under flag)
|
|
302
|
-
if (this.parallelConfig?.enabled) {
|
|
303
|
-
await this.runParallelAnalysis(manifest);
|
|
174
|
+
this.onProgress({ phase: 'analysis', currentPlugin: 'Starting analysis...', message: 'Analyzing all units...', totalFiles: unitsToProcess.length, processedFiles: 0 });
|
|
175
|
+
if (this.parallelRunner) {
|
|
176
|
+
await this.parallelRunner.run(manifest);
|
|
304
177
|
}
|
|
305
178
|
else {
|
|
306
|
-
|
|
307
|
-
processedUnits = 0;
|
|
308
|
-
for (let batchStart = 0; batchStart < unitsToProcess.length; batchStart += BATCH_SIZE) {
|
|
309
|
-
const batch = unitsToProcess.slice(batchStart, batchStart + BATCH_SIZE);
|
|
310
|
-
this.onProgress({
|
|
311
|
-
phase: 'analysis',
|
|
312
|
-
currentPlugin: 'Analyzers',
|
|
313
|
-
message: `[${processedUnits + 1}-${processedUnits + batch.length}/${unitsToProcess.length}] Batch analyzing...`,
|
|
314
|
-
totalFiles: unitsToProcess.length,
|
|
315
|
-
processedFiles: processedUnits
|
|
316
|
-
});
|
|
317
|
-
// Параллельно анализируем батч units
|
|
318
|
-
await Promise.all(batch.map(async (unit, idx) => {
|
|
319
|
-
const unitStart = Date.now();
|
|
320
|
-
const unitManifest = {
|
|
321
|
-
projectPath: manifest.projectPath,
|
|
322
|
-
service: {
|
|
323
|
-
...unit,
|
|
324
|
-
id: unit.id,
|
|
325
|
-
name: unit.name,
|
|
326
|
-
path: unit.path
|
|
327
|
-
},
|
|
328
|
-
modules: []
|
|
329
|
-
};
|
|
330
|
-
await this.runPhase('ANALYSIS', {
|
|
331
|
-
manifest: unitManifest,
|
|
332
|
-
graph: this.graph,
|
|
333
|
-
workerCount: 1,
|
|
334
|
-
});
|
|
335
|
-
const unitTime = ((Date.now() - unitStart) / 1000).toFixed(2);
|
|
336
|
-
this.logger.debug('ANALYSIS complete', { unit: unit.name, duration: unitTime });
|
|
337
|
-
this.onProgress({
|
|
338
|
-
phase: 'analysis',
|
|
339
|
-
currentPlugin: 'Analyzers',
|
|
340
|
-
message: `Analyzed ${unit.name || unit.path} (${unitTime}s)`,
|
|
341
|
-
totalFiles: unitsToProcess.length,
|
|
342
|
-
processedFiles: processedUnits + idx + 1,
|
|
343
|
-
servicesAnalyzed: processedUnits + idx + 1
|
|
344
|
-
});
|
|
345
|
-
}));
|
|
346
|
-
processedUnits += batch.length;
|
|
347
|
-
}
|
|
179
|
+
await this.runBatchPhase('ANALYSIS', unitsToProcess, manifest);
|
|
348
180
|
}
|
|
349
181
|
this.profiler.end('ANALYSIS');
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
const enrichmentStart = Date.now();
|
|
353
|
-
this.profiler.start('ENRICHMENT');
|
|
354
|
-
this.onProgress({ phase: 'enrichment', currentPlugin: 'Starting enrichment...', message: 'Enriching graph data...', totalFiles: 0, processedFiles: 0 });
|
|
355
|
-
await this.runPhase('ENRICHMENT', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
356
|
-
this.profiler.end('ENRICHMENT');
|
|
357
|
-
this.logger.info('ENRICHMENT phase complete', { duration: ((Date.now() - enrichmentStart) / 1000).toFixed(2) });
|
|
358
|
-
// STRICT MODE BARRIER: Check for fatal errors after ENRICHMENT (REG-330, REG-332)
|
|
359
|
-
if (this.strictMode) {
|
|
360
|
-
const enrichmentDiagnostics = this.diagnosticCollector.getByPhase('ENRICHMENT');
|
|
361
|
-
const strictErrors = enrichmentDiagnostics.filter(d => d.severity === 'fatal');
|
|
362
|
-
if (strictErrors.length > 0) {
|
|
363
|
-
this.logger.error(`Strict mode: ${strictErrors.length} unresolved reference(s) found`);
|
|
364
|
-
// REG-357: Pass suppressedByIgnore count from enrichment plugin results
|
|
365
|
-
throw new StrictModeFailure(strictErrors, this.suppressedByIgnoreCount);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
// PHASE 4: VALIDATION - проверка корректности графа (глобально)
|
|
369
|
-
const validationStart = Date.now();
|
|
370
|
-
this.profiler.start('VALIDATION');
|
|
371
|
-
this.onProgress({ phase: 'validation', currentPlugin: 'Starting validation...', message: 'Validating graph structure...', totalFiles: 0, processedFiles: 0 });
|
|
372
|
-
await this.runPhase('VALIDATION', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
373
|
-
this.profiler.end('VALIDATION');
|
|
374
|
-
this.logger.info('VALIDATION phase complete', { duration: ((Date.now() - validationStart) / 1000).toFixed(2) });
|
|
375
|
-
// Flush graph to ensure all edges are persisted and queryable
|
|
376
|
-
if (this.graph.flush) {
|
|
377
|
-
await this.graph.flush();
|
|
378
|
-
}
|
|
182
|
+
// PHASES 3-4: ENRICHMENT → strict barrier → guarantee → VALIDATION → flush
|
|
183
|
+
await this.runPipelineEpilogue(manifest, absoluteProjectPath);
|
|
379
184
|
const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
|
|
380
185
|
this.logger.info('Analysis complete', { duration: totalTime, units: unitsToProcess.length });
|
|
381
|
-
// Print profiling summary
|
|
382
|
-
this.profiler.printSummary();
|
|
383
186
|
return manifest;
|
|
384
187
|
}
|
|
385
188
|
/**
|
|
@@ -397,10 +200,8 @@ export class Orchestrator {
|
|
|
397
200
|
await this.graph.clear();
|
|
398
201
|
this.logger.info('Graph cleared successfully');
|
|
399
202
|
}
|
|
400
|
-
//
|
|
401
|
-
await this.
|
|
402
|
-
// Declare metadata fields for RFDB server-side indexing (REG-398)
|
|
403
|
-
await this.declarePluginFields();
|
|
203
|
+
// Initialize graph: plugin nodes, field declarations, meta node (REG-386, REG-398, REG-408)
|
|
204
|
+
await this.graphInitializer.init(workspacePath);
|
|
404
205
|
// Collect all services from all roots
|
|
405
206
|
const allServices = [];
|
|
406
207
|
const allEntrypoints = [];
|
|
@@ -414,50 +215,14 @@ export class Orchestrator {
|
|
|
414
215
|
path: rootAbsolutePath
|
|
415
216
|
});
|
|
416
217
|
// Discover services in this root
|
|
417
|
-
const rootManifest = await this.discoverInRoot(rootAbsolutePath
|
|
218
|
+
const rootManifest = await this.discoveryManager.discoverInRoot(rootAbsolutePath);
|
|
418
219
|
// Build indexing units for this root
|
|
419
|
-
const units = this.buildIndexingUnits(rootManifest);
|
|
420
|
-
// INDEXING
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
projectPath: rootAbsolutePath,
|
|
424
|
-
service: {
|
|
425
|
-
...unit,
|
|
426
|
-
id: unit.id,
|
|
427
|
-
name: unit.name,
|
|
428
|
-
path: unit.path
|
|
429
|
-
},
|
|
430
|
-
modules: [],
|
|
431
|
-
rootPrefix: rootName, // REG-76: Pass root prefix
|
|
432
|
-
};
|
|
433
|
-
await this.runPhase('INDEXING', {
|
|
434
|
-
manifest: unitManifest,
|
|
435
|
-
graph: this.graph,
|
|
436
|
-
workerCount: 1,
|
|
437
|
-
rootPrefix: rootName, // Pass to context
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
// ANALYSIS phase for this root
|
|
220
|
+
const units = this.discoveryManager.buildIndexingUnits(rootManifest);
|
|
221
|
+
// INDEXING + ANALYSIS phases for this root
|
|
222
|
+
const rootOpts = { rootPrefix: rootName };
|
|
223
|
+
await this.runBatchPhase('INDEXING', units, rootManifest, rootOpts);
|
|
441
224
|
if (!this.indexOnly) {
|
|
442
|
-
|
|
443
|
-
const unitManifest = {
|
|
444
|
-
projectPath: rootAbsolutePath,
|
|
445
|
-
service: {
|
|
446
|
-
...unit,
|
|
447
|
-
id: unit.id,
|
|
448
|
-
name: unit.name,
|
|
449
|
-
path: unit.path
|
|
450
|
-
},
|
|
451
|
-
modules: [],
|
|
452
|
-
rootPrefix: rootName,
|
|
453
|
-
};
|
|
454
|
-
await this.runPhase('ANALYSIS', {
|
|
455
|
-
manifest: unitManifest,
|
|
456
|
-
graph: this.graph,
|
|
457
|
-
workerCount: 1,
|
|
458
|
-
rootPrefix: rootName,
|
|
459
|
-
});
|
|
460
|
-
}
|
|
225
|
+
await this.runBatchPhase('ANALYSIS', units, rootManifest, rootOpts);
|
|
461
226
|
}
|
|
462
227
|
// Collect services with root prefix in path for unified manifest
|
|
463
228
|
for (const svc of rootManifest.services) {
|
|
@@ -486,327 +251,107 @@ export class Orchestrator {
|
|
|
486
251
|
this.logger.info('indexOnly mode - skipping remaining phases', { duration: totalTime });
|
|
487
252
|
return unifiedManifest;
|
|
488
253
|
}
|
|
489
|
-
// ENRICHMENT
|
|
490
|
-
this.
|
|
491
|
-
await this.runPhase('ENRICHMENT', {
|
|
492
|
-
manifest: unifiedManifest,
|
|
493
|
-
graph: this.graph,
|
|
494
|
-
workerCount: this.workerCount
|
|
495
|
-
});
|
|
496
|
-
this.profiler.end('ENRICHMENT');
|
|
497
|
-
// VALIDATION phase (global)
|
|
498
|
-
this.profiler.start('VALIDATION');
|
|
499
|
-
await this.runPhase('VALIDATION', {
|
|
500
|
-
manifest: unifiedManifest,
|
|
501
|
-
graph: this.graph,
|
|
502
|
-
workerCount: this.workerCount
|
|
503
|
-
});
|
|
504
|
-
this.profiler.end('VALIDATION');
|
|
505
|
-
// Flush graph
|
|
506
|
-
if (this.graph.flush) {
|
|
507
|
-
await this.graph.flush();
|
|
508
|
-
}
|
|
254
|
+
// ENRICHMENT → strict barrier → guarantee → VALIDATION → flush
|
|
255
|
+
await this.runPipelineEpilogue(unifiedManifest, workspacePath);
|
|
509
256
|
const totalTime = ((Date.now() - totalStartTime) / 1000).toFixed(2);
|
|
510
|
-
this.logger.info('Multi-root analysis complete', {
|
|
511
|
-
duration: totalTime,
|
|
512
|
-
roots: roots.length,
|
|
513
|
-
services: allServices.length
|
|
514
|
-
});
|
|
515
|
-
this.profiler.printSummary();
|
|
257
|
+
this.logger.info('Multi-root analysis complete', { duration: totalTime, roots: roots.length, services: allServices.length });
|
|
516
258
|
return unifiedManifest;
|
|
517
259
|
}
|
|
518
260
|
/**
|
|
519
|
-
*
|
|
520
|
-
*
|
|
261
|
+
* Run a per-unit phase (INDEXING or ANALYSIS) in batches.
|
|
262
|
+
* Common batch processing logic extracted from run() (REG-462).
|
|
521
263
|
*/
|
|
522
|
-
async
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
path: path,
|
|
544
|
-
|
|
264
|
+
async runBatchPhase(phaseName, units, manifest, options) {
|
|
265
|
+
const phase = phaseName.toLowerCase();
|
|
266
|
+
const pluginLabel = phaseName === 'INDEXING' ? 'JSModuleIndexer' : 'Analyzers';
|
|
267
|
+
const BATCH_SIZE = this.workerCount;
|
|
268
|
+
let processedUnits = 0;
|
|
269
|
+
for (let batchStart = 0; batchStart < units.length; batchStart += BATCH_SIZE) {
|
|
270
|
+
const batch = units.slice(batchStart, batchStart + BATCH_SIZE);
|
|
271
|
+
this.onProgress({
|
|
272
|
+
phase,
|
|
273
|
+
currentPlugin: pluginLabel,
|
|
274
|
+
message: `[${processedUnits + 1}-${processedUnits + batch.length}/${units.length}] Batch ${phase}...`,
|
|
275
|
+
totalFiles: units.length,
|
|
276
|
+
processedFiles: processedUnits,
|
|
277
|
+
totalServices: units.length,
|
|
278
|
+
servicesAnalyzed: processedUnits,
|
|
279
|
+
});
|
|
280
|
+
for (let idx = 0; idx < batch.length; idx++) {
|
|
281
|
+
const unit = batch[idx];
|
|
282
|
+
const unitStart = Date.now();
|
|
283
|
+
const unitManifest = {
|
|
284
|
+
projectPath: manifest.projectPath,
|
|
285
|
+
service: { ...unit, id: unit.id, name: unit.name, path: unit.path },
|
|
286
|
+
modules: [],
|
|
287
|
+
rootPrefix: options?.rootPrefix,
|
|
288
|
+
};
|
|
289
|
+
await this.runPhase(phaseName, {
|
|
290
|
+
manifest: unitManifest,
|
|
291
|
+
graph: this.graph,
|
|
292
|
+
workerCount: 1,
|
|
293
|
+
...(options?.rootPrefix ? { rootPrefix: options.rootPrefix } : {}),
|
|
545
294
|
});
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
path: path,
|
|
558
|
-
type: 'entrypoint',
|
|
559
|
-
entrypointType: ep.type,
|
|
560
|
-
trigger: ep.trigger,
|
|
295
|
+
const unitTime = ((Date.now() - unitStart) / 1000).toFixed(2);
|
|
296
|
+
this.logger.debug(`${phaseName} complete`, { unit: unit.name, duration: unitTime });
|
|
297
|
+
this.onProgress({
|
|
298
|
+
phase,
|
|
299
|
+
currentPlugin: pluginLabel,
|
|
300
|
+
message: `${unit.name || unit.path} (${unitTime}s)`,
|
|
301
|
+
totalFiles: units.length,
|
|
302
|
+
processedFiles: processedUnits + idx + 1,
|
|
303
|
+
totalServices: units.length,
|
|
304
|
+
servicesAnalyzed: processedUnits + idx + 1,
|
|
305
|
+
currentService: unit.name || unit.path,
|
|
561
306
|
});
|
|
562
307
|
}
|
|
308
|
+
processedUnits += batch.length;
|
|
563
309
|
}
|
|
564
|
-
this.logger.debug('Built indexing units', {
|
|
565
|
-
total: units.length,
|
|
566
|
-
services: units.filter(u => u.type === 'service').length,
|
|
567
|
-
entrypoints: units.filter(u => u.type === 'entrypoint').length
|
|
568
|
-
});
|
|
569
|
-
return units;
|
|
570
310
|
}
|
|
571
311
|
/**
|
|
572
|
-
*
|
|
573
|
-
*
|
|
312
|
+
* Run post-indexing pipeline: ENRICHMENT → strict barrier → guarantee → VALIDATION → flush.
|
|
313
|
+
* Common epilogue shared by run() and runMultiRoot() (REG-462).
|
|
574
314
|
*/
|
|
575
|
-
async
|
|
576
|
-
//
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
let entrypoint;
|
|
591
|
-
if (configSvc.entryPoint) {
|
|
592
|
-
entrypoint = configSvc.entryPoint;
|
|
593
|
-
}
|
|
594
|
-
else {
|
|
595
|
-
// Auto-detect if not provided
|
|
596
|
-
const packageJsonPath = join(servicePath, 'package.json');
|
|
597
|
-
if (existsSync(packageJsonPath)) {
|
|
598
|
-
try {
|
|
599
|
-
const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
600
|
-
entrypoint = resolveSourceEntrypoint(servicePath, pkg) ?? pkg.main ?? 'index.js';
|
|
601
|
-
}
|
|
602
|
-
catch (e) {
|
|
603
|
-
const message = e instanceof Error ? e.message : String(e);
|
|
604
|
-
this.logger.warn('Failed to read package.json for auto-detection', {
|
|
605
|
-
service: configSvc.name,
|
|
606
|
-
path: packageJsonPath,
|
|
607
|
-
error: message
|
|
608
|
-
});
|
|
609
|
-
entrypoint = 'index.js';
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
else {
|
|
613
|
-
entrypoint = 'index.js';
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
// Create SERVICE node
|
|
617
|
-
const serviceNode = NodeFactory.createService(configSvc.name, servicePath, {
|
|
618
|
-
discoveryMethod: 'config',
|
|
619
|
-
entrypoint: entrypoint,
|
|
620
|
-
});
|
|
621
|
-
await this.graph.addNode(serviceNode);
|
|
622
|
-
services.push({
|
|
623
|
-
id: serviceNode.id,
|
|
624
|
-
name: configSvc.name,
|
|
625
|
-
path: servicePath,
|
|
626
|
-
metadata: {
|
|
627
|
-
entrypoint: join(servicePath, entrypoint),
|
|
628
|
-
},
|
|
629
|
-
});
|
|
630
|
-
this.logger.info('Registered config service', {
|
|
631
|
-
name: configSvc.name,
|
|
632
|
-
path: servicePath,
|
|
633
|
-
entrypoint: entrypoint
|
|
634
|
-
});
|
|
315
|
+
async runPipelineEpilogue(manifest, projectPath) {
|
|
316
|
+
// ENRICHMENT phase (global)
|
|
317
|
+
const enrichmentStart = Date.now();
|
|
318
|
+
this.profiler.start('ENRICHMENT');
|
|
319
|
+
this.onProgress({ phase: 'enrichment', currentPlugin: 'Starting enrichment...', message: 'Enriching graph data...', totalFiles: 0, processedFiles: 0 });
|
|
320
|
+
const enrichmentTypes = await this.runPhase('ENRICHMENT', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
321
|
+
this.profiler.end('ENRICHMENT');
|
|
322
|
+
this.logger.info('ENRICHMENT phase complete', { duration: ((Date.now() - enrichmentStart) / 1000).toFixed(2) });
|
|
323
|
+
// STRICT MODE BARRIER (REG-330, REG-332)
|
|
324
|
+
if (this.strictMode) {
|
|
325
|
+
const enrichmentDiagnostics = this.diagnosticCollector.getByPhase('ENRICHMENT');
|
|
326
|
+
const strictErrors = enrichmentDiagnostics.filter(d => d.severity === 'fatal');
|
|
327
|
+
if (strictErrors.length > 0) {
|
|
328
|
+
this.logger.error(`Strict mode: ${strictErrors.length} unresolved reference(s) found`);
|
|
329
|
+
throw new StrictModeFailure(strictErrors, this.phaseRunner.getSuppressedByIgnoreCount());
|
|
635
330
|
}
|
|
636
|
-
return {
|
|
637
|
-
services,
|
|
638
|
-
entrypoints: [], // Config services don't provide entrypoints
|
|
639
|
-
projectPath: projectPath
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
// ORIGINAL CODE: Run discovery plugins if no config services
|
|
643
|
-
const context = {
|
|
644
|
-
projectPath,
|
|
645
|
-
graph: this.graph,
|
|
646
|
-
config: this.config,
|
|
647
|
-
phase: 'DISCOVERY',
|
|
648
|
-
logger: this.logger,
|
|
649
|
-
};
|
|
650
|
-
// Фильтруем плагины для фазы DISCOVERY
|
|
651
|
-
const discoveryPlugins = this.plugins.filter(p => p.metadata.phase === 'DISCOVERY');
|
|
652
|
-
// Topological sort by dependencies (REG-367)
|
|
653
|
-
const discoveryPluginMap = new Map(discoveryPlugins.map(p => [p.metadata.name, p]));
|
|
654
|
-
const sortedDiscoveryIds = toposort(discoveryPlugins.map(p => ({
|
|
655
|
-
id: p.metadata.name,
|
|
656
|
-
dependencies: p.metadata.dependencies ?? [],
|
|
657
|
-
})));
|
|
658
|
-
discoveryPlugins.length = 0;
|
|
659
|
-
for (const id of sortedDiscoveryIds) {
|
|
660
|
-
const plugin = discoveryPluginMap.get(id);
|
|
661
|
-
if (plugin)
|
|
662
|
-
discoveryPlugins.push(plugin);
|
|
663
331
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
//
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
// Collect entrypoints from new-style plugins
|
|
679
|
-
if (result.success && result.metadata?.entrypoints) {
|
|
680
|
-
allEntrypoints.push(...result.metadata.entrypoints);
|
|
681
|
-
}
|
|
682
|
-
// Warn if plugin created nodes but didn't return services/entrypoints in metadata
|
|
683
|
-
// This catches common mistake of not returning services via result.metadata.services
|
|
684
|
-
if (result.success && result.created.nodes > 0 &&
|
|
685
|
-
!result.metadata?.services && !result.metadata?.entrypoints) {
|
|
686
|
-
this.logger.warn('Discovery plugin created nodes but returned no services/entrypoints in metadata', {
|
|
687
|
-
plugin: plugin.metadata.name,
|
|
688
|
-
nodesCreated: result.created.nodes,
|
|
689
|
-
hint: 'Services must be returned via result.metadata.services for Orchestrator to index them'
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
this.onProgress({
|
|
693
|
-
phase: 'discovery',
|
|
694
|
-
currentPlugin: plugin.metadata.name,
|
|
695
|
-
message: `✓ ${plugin.metadata.name} complete`
|
|
696
|
-
});
|
|
332
|
+
// GUARANTEE CHECK (RFD-18)
|
|
333
|
+
await this.guaranteeChecker.check(enrichmentTypes, projectPath);
|
|
334
|
+
// REG-259: Compute covered packages from plugin metadata before validation
|
|
335
|
+
this.storeCoveredPackages();
|
|
336
|
+
// VALIDATION phase (global)
|
|
337
|
+
const validationStart = Date.now();
|
|
338
|
+
this.profiler.start('VALIDATION');
|
|
339
|
+
this.onProgress({ phase: 'validation', currentPlugin: 'Starting validation...', message: 'Validating graph structure...', totalFiles: 0, processedFiles: 0 });
|
|
340
|
+
await this.runPhase('VALIDATION', { manifest, graph: this.graph, workerCount: this.workerCount });
|
|
341
|
+
this.profiler.end('VALIDATION');
|
|
342
|
+
this.logger.info('VALIDATION phase complete', { duration: ((Date.now() - validationStart) / 1000).toFixed(2) });
|
|
343
|
+
// Flush and cleanup
|
|
344
|
+
if (this.graph.flush) {
|
|
345
|
+
await this.graph.flush();
|
|
697
346
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
entrypoints: allEntrypoints,
|
|
701
|
-
projectPath: projectPath
|
|
702
|
-
};
|
|
347
|
+
this.profiler.printSummary();
|
|
348
|
+
this.resourceRegistry.clear();
|
|
703
349
|
}
|
|
704
350
|
/**
|
|
705
351
|
* Запустить плагины для конкретной фазы
|
|
706
352
|
*/
|
|
707
353
|
async runPhase(phaseName, context) {
|
|
708
|
-
|
|
709
|
-
const phasePlugins = this.plugins.filter(plugin => plugin.metadata.phase === phaseName);
|
|
710
|
-
// Topological sort by dependencies (REG-367)
|
|
711
|
-
const pluginMap = new Map(phasePlugins.map(p => [p.metadata.name, p]));
|
|
712
|
-
const sortedIds = toposort(phasePlugins.map(p => ({
|
|
713
|
-
id: p.metadata.name,
|
|
714
|
-
dependencies: p.metadata.dependencies ?? [],
|
|
715
|
-
})));
|
|
716
|
-
phasePlugins.length = 0;
|
|
717
|
-
for (const id of sortedIds) {
|
|
718
|
-
const plugin = pluginMap.get(id);
|
|
719
|
-
if (plugin)
|
|
720
|
-
phasePlugins.push(plugin);
|
|
721
|
-
}
|
|
722
|
-
// Выполняем плагины последовательно
|
|
723
|
-
for (let i = 0; i < phasePlugins.length; i++) {
|
|
724
|
-
const plugin = phasePlugins[i];
|
|
725
|
-
this.onProgress({
|
|
726
|
-
phase: phaseName.toLowerCase(),
|
|
727
|
-
currentPlugin: plugin.metadata.name,
|
|
728
|
-
message: `Running plugin ${i + 1}/${phasePlugins.length}: ${plugin.metadata.name}`
|
|
729
|
-
});
|
|
730
|
-
// Передаем onProgress и forceAnalysis в контекст для плагинов
|
|
731
|
-
const pluginContext = {
|
|
732
|
-
...context,
|
|
733
|
-
onProgress: this.onProgress,
|
|
734
|
-
forceAnalysis: this.forceAnalysis,
|
|
735
|
-
logger: this.logger,
|
|
736
|
-
strictMode: this.strictMode, // REG-330: Pass strict mode flag
|
|
737
|
-
// REG-76: Pass rootPrefix for multi-root workspace support
|
|
738
|
-
rootPrefix: context.rootPrefix,
|
|
739
|
-
};
|
|
740
|
-
// Add reportIssue for VALIDATION phase
|
|
741
|
-
if (phaseName === 'VALIDATION') {
|
|
742
|
-
pluginContext.reportIssue = async (issue) => {
|
|
743
|
-
const node = NodeFactory.createIssue(issue.category, issue.severity, issue.message, plugin.metadata.name, issue.file, issue.line, issue.column || 0, { context: issue.context });
|
|
744
|
-
await context.graph.addNode(node);
|
|
745
|
-
if (issue.targetNodeId) {
|
|
746
|
-
await context.graph.addEdge({
|
|
747
|
-
src: node.id,
|
|
748
|
-
dst: issue.targetNodeId,
|
|
749
|
-
type: 'AFFECTS',
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
return node.id;
|
|
753
|
-
};
|
|
754
|
-
}
|
|
755
|
-
try {
|
|
756
|
-
const result = await plugin.execute(pluginContext);
|
|
757
|
-
// Collect errors into diagnostics
|
|
758
|
-
this.diagnosticCollector.addFromPluginResult(phaseName, plugin.metadata.name, result);
|
|
759
|
-
// REG-357: Collect suppressedByIgnore from ENRICHMENT plugin results
|
|
760
|
-
if (phaseName === 'ENRICHMENT' && result.metadata) {
|
|
761
|
-
const suppressed = result.metadata.suppressedByIgnore;
|
|
762
|
-
if (typeof suppressed === 'number') {
|
|
763
|
-
this.suppressedByIgnoreCount += suppressed;
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
// Log plugin completion with warning if errors occurred
|
|
767
|
-
if (!result.success) {
|
|
768
|
-
console.warn(`[Orchestrator] Plugin ${plugin.metadata.name} reported failure`, {
|
|
769
|
-
errors: result.errors.length,
|
|
770
|
-
warnings: result.warnings.length,
|
|
771
|
-
});
|
|
772
|
-
}
|
|
773
|
-
// Check for fatal errors - STOP immediately
|
|
774
|
-
// REG-357: In strict mode ENRICHMENT, don't halt on strict mode errors.
|
|
775
|
-
// The strict mode barrier after ENRICHMENT handles them collectively.
|
|
776
|
-
if (this.diagnosticCollector.hasFatal()) {
|
|
777
|
-
const allDiagnostics = this.diagnosticCollector.getAll();
|
|
778
|
-
const fatals = allDiagnostics.filter(d => d.severity === 'fatal');
|
|
779
|
-
// Skip halt only if ALL fatals are strict mode errors during ENRICHMENT.
|
|
780
|
-
// If any non-strict fatal exists, halt immediately.
|
|
781
|
-
const allStrictErrors = fatals.every(d => d.code.startsWith('STRICT_'));
|
|
782
|
-
if (!(this.strictMode && phaseName === 'ENRICHMENT' && allStrictErrors)) {
|
|
783
|
-
const fatal = fatals[0];
|
|
784
|
-
throw new Error(`Fatal error in ${plugin.metadata.name}: ${fatal?.message || 'Unknown fatal error'}`);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
catch (e) {
|
|
789
|
-
// Plugin threw an exception (not just returned errors)
|
|
790
|
-
const error = e instanceof Error ? e : new Error(String(e));
|
|
791
|
-
// Don't re-add if this was already a fatal error we threw
|
|
792
|
-
if (!this.diagnosticCollector.hasFatal()) {
|
|
793
|
-
this.diagnosticCollector.add({
|
|
794
|
-
code: 'ERR_PLUGIN_THREW',
|
|
795
|
-
severity: 'fatal',
|
|
796
|
-
message: error.message,
|
|
797
|
-
phase: phaseName,
|
|
798
|
-
plugin: plugin.metadata.name,
|
|
799
|
-
});
|
|
800
|
-
}
|
|
801
|
-
throw error; // Re-throw to stop analysis
|
|
802
|
-
}
|
|
803
|
-
// Send completion for this plugin
|
|
804
|
-
this.onProgress({
|
|
805
|
-
phase: phaseName.toLowerCase(),
|
|
806
|
-
currentPlugin: plugin.metadata.name,
|
|
807
|
-
message: `✓ ${plugin.metadata.name} complete`
|
|
808
|
-
});
|
|
809
|
-
}
|
|
354
|
+
return this.phaseRunner.runPhase(phaseName, context);
|
|
810
355
|
}
|
|
811
356
|
/**
|
|
812
357
|
* Get the diagnostic collector for retrieving all collected diagnostics
|
|
@@ -815,149 +360,36 @@ export class Orchestrator {
|
|
|
815
360
|
return this.diagnosticCollector;
|
|
816
361
|
}
|
|
817
362
|
/**
|
|
818
|
-
* Run
|
|
819
|
-
*
|
|
820
|
-
* Architecture:
|
|
821
|
-
* - Tasks are queued per-file with list of applicable plugins
|
|
822
|
-
* - Workers pick tasks, run plugins, write directly to RFDB
|
|
823
|
-
* - Barrier waits for all tasks before ENRICHMENT phase
|
|
363
|
+
* Run discovery for a project path.
|
|
364
|
+
* Delegates to DiscoveryManager. Public API for MCP and other callers.
|
|
824
365
|
*/
|
|
825
|
-
async
|
|
826
|
-
|
|
827
|
-
const maxWorkers = this.parallelConfig.maxWorkers || null;
|
|
828
|
-
// Get the database path from the main graph backend
|
|
829
|
-
const mainDbPath = this.graph.dbPath || join(manifest.projectPath, '.grafema', 'graph.rfdb');
|
|
830
|
-
this.logger.debug('Starting queue-based parallel analysis', { database: mainDbPath });
|
|
831
|
-
// Start RFDB server using the SAME database as main graph
|
|
832
|
-
await this.startRfdbServer(socketPath, mainDbPath);
|
|
833
|
-
// Get ANALYSIS plugins that should run in workers
|
|
834
|
-
const analysisPlugins = this.plugins
|
|
835
|
-
.filter(p => p.metadata?.phase === 'ANALYSIS')
|
|
836
|
-
.map(p => p.metadata.name);
|
|
837
|
-
this.logger.debug('Analysis plugins', { plugins: analysisPlugins });
|
|
838
|
-
// Create analysis queue
|
|
839
|
-
this.analysisQueue = new AnalysisQueue({
|
|
840
|
-
socketPath,
|
|
841
|
-
maxWorkers: maxWorkers || undefined,
|
|
842
|
-
plugins: analysisPlugins,
|
|
843
|
-
});
|
|
844
|
-
// Start workers
|
|
845
|
-
await this.analysisQueue.start();
|
|
846
|
-
// Get all MODULE nodes from graph and queue them
|
|
847
|
-
let moduleCount = 0;
|
|
848
|
-
for await (const node of this.graph.queryNodes({ type: 'MODULE' })) {
|
|
849
|
-
// Skip non-JS/TS files
|
|
850
|
-
if (!node.file?.match(/\.(js|jsx|ts|tsx|mjs|cjs)$/))
|
|
851
|
-
continue;
|
|
852
|
-
this.analysisQueue.addTask({
|
|
853
|
-
file: node.file,
|
|
854
|
-
moduleId: node.id,
|
|
855
|
-
moduleName: node.name,
|
|
856
|
-
plugins: analysisPlugins, // All plugins for now; workers filter by imports
|
|
857
|
-
});
|
|
858
|
-
moduleCount++;
|
|
859
|
-
}
|
|
860
|
-
this.logger.debug('Queued modules for analysis', { count: moduleCount });
|
|
861
|
-
// Subscribe to progress events
|
|
862
|
-
this.analysisQueue.on('taskCompleted', ({ file, stats, duration }) => {
|
|
863
|
-
this.onProgress({
|
|
864
|
-
phase: 'analysis',
|
|
865
|
-
currentPlugin: 'AnalysisQueue',
|
|
866
|
-
message: `${file.split('/').pop()} (${stats?.nodes || 0} nodes, ${duration}ms)`,
|
|
867
|
-
});
|
|
868
|
-
});
|
|
869
|
-
this.analysisQueue.on('taskFailed', ({ file, error }) => {
|
|
870
|
-
this.logger.error('Analysis failed', { file, error });
|
|
871
|
-
});
|
|
872
|
-
// Wait for all tasks to complete (barrier)
|
|
873
|
-
const stats = await this.analysisQueue.waitForCompletion();
|
|
874
|
-
this.logger.debug('Queue complete', {
|
|
875
|
-
nodesCreated: stats.nodesCreated,
|
|
876
|
-
edgesCreated: stats.edgesCreated,
|
|
877
|
-
succeeded: stats.tasksCompleted,
|
|
878
|
-
failed: stats.tasksFailed
|
|
879
|
-
});
|
|
880
|
-
// Stop workers and server
|
|
881
|
-
await this.analysisQueue.stop();
|
|
882
|
-
this.analysisQueue = null;
|
|
883
|
-
await this.stopRfdbServer();
|
|
366
|
+
async discover(projectPath) {
|
|
367
|
+
return this.discoveryManager.discover(projectPath);
|
|
884
368
|
}
|
|
885
369
|
/**
|
|
886
|
-
*
|
|
887
|
-
*
|
|
888
|
-
* @param dbPath - Database path (should be same as main graph)
|
|
370
|
+
* REG-259: Collect package names from plugin `covers` metadata
|
|
371
|
+
* and store them in the ResourceRegistry for PackageCoverageValidator.
|
|
889
372
|
*/
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
const testClient = new RFDBClient(socketPath);
|
|
897
|
-
await testClient.connect();
|
|
898
|
-
await testClient.ping();
|
|
899
|
-
await testClient.close();
|
|
900
|
-
this.logger.debug('Using existing RFDB server', { socketPath });
|
|
901
|
-
this.rfdbServerProcess = null; // Mark that we didn't start the server
|
|
902
|
-
this._serverWasExternal = true;
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
catch {
|
|
906
|
-
// Socket exists but server not responding, remove stale socket
|
|
907
|
-
this.logger.debug('Stale socket found, removing');
|
|
908
|
-
unlinkSync(socketPath);
|
|
373
|
+
storeCoveredPackages() {
|
|
374
|
+
const coveredPackages = new Set();
|
|
375
|
+
for (const plugin of this.plugins) {
|
|
376
|
+
const covers = plugin.metadata?.covers ?? [];
|
|
377
|
+
for (const pkg of covers) {
|
|
378
|
+
coveredPackages.add(pkg);
|
|
909
379
|
}
|
|
910
380
|
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
let binaryPath = existsSync(serverBinary) ? serverBinary : debugBinary;
|
|
916
|
-
if (!existsSync(binaryPath)) {
|
|
917
|
-
this.logger.debug('RFDB server binary not found, building', { path: binaryPath });
|
|
918
|
-
execSync('cargo build --bin rfdb-server', {
|
|
919
|
-
cwd: join(projectRoot, 'packages/rfdb-server'),
|
|
920
|
-
stdio: 'inherit',
|
|
921
|
-
});
|
|
922
|
-
binaryPath = debugBinary;
|
|
923
|
-
}
|
|
924
|
-
this.logger.debug('Starting RFDB server', { binary: binaryPath, database: dbPath });
|
|
925
|
-
this.rfdbServerProcess = spawn(binaryPath, [dbPath, '--socket', socketPath], {
|
|
926
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
927
|
-
});
|
|
928
|
-
this._serverWasExternal = false;
|
|
929
|
-
this.rfdbServerProcess.stderr?.on('data', (data) => {
|
|
930
|
-
const msg = data.toString().trim();
|
|
931
|
-
if (!msg.includes('FLUSH') && !msg.includes('WRITER')) {
|
|
932
|
-
this.logger.debug('rfdb-server', { message: msg });
|
|
933
|
-
}
|
|
381
|
+
this.resourceRegistry.getOrCreate(COVERED_PACKAGES_RESOURCE_ID, () => createCoveredPackagesResource(coveredPackages));
|
|
382
|
+
this.logger.debug('Stored covered packages for validation', {
|
|
383
|
+
count: coveredPackages.size,
|
|
384
|
+
packages: [...coveredPackages],
|
|
934
385
|
});
|
|
935
|
-
// Wait for server to start
|
|
936
|
-
let attempts = 0;
|
|
937
|
-
while (!existsSync(socketPath) && attempts < 30) {
|
|
938
|
-
await sleep(100);
|
|
939
|
-
attempts++;
|
|
940
|
-
}
|
|
941
|
-
if (!existsSync(socketPath)) {
|
|
942
|
-
throw new Error('RFDB server failed to start');
|
|
943
|
-
}
|
|
944
|
-
this.logger.debug('RFDB server started', { socketPath });
|
|
945
386
|
}
|
|
946
387
|
/**
|
|
947
|
-
*
|
|
388
|
+
* Build unified list of indexing units from manifest.
|
|
389
|
+
* Delegates to DiscoveryManager. Public API for external callers.
|
|
948
390
|
*/
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
if (this._serverWasExternal) {
|
|
952
|
-
this.logger.debug('Leaving external RFDB server running');
|
|
953
|
-
return;
|
|
954
|
-
}
|
|
955
|
-
if (this.rfdbServerProcess) {
|
|
956
|
-
this.rfdbServerProcess.kill('SIGTERM');
|
|
957
|
-
await sleep(200);
|
|
958
|
-
this.rfdbServerProcess = null;
|
|
959
|
-
this.logger.debug('RFDB server stopped');
|
|
960
|
-
}
|
|
391
|
+
buildIndexingUnits(manifest) {
|
|
392
|
+
return this.discoveryManager.buildIndexingUnits(manifest);
|
|
961
393
|
}
|
|
962
394
|
}
|
|
963
395
|
//# sourceMappingURL=Orchestrator.js.map
|