@grafema/core 0.2.4-beta → 0.2.5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Orchestrator.d.ts +37 -0
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +322 -35
- package/dist/Orchestrator.js.map +1 -0
- package/dist/api/GraphAPI.d.ts +1 -1
- package/dist/api/GraphAPI.d.ts.map +1 -1
- package/dist/api/GraphAPI.js +3 -1
- package/dist/api/GraphAPI.js.map +1 -0
- package/dist/api/GuaranteeAPI.d.ts.map +1 -1
- package/dist/api/GuaranteeAPI.js +4 -2
- package/dist/api/GuaranteeAPI.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +66 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -1
- package/dist/config/ConfigLoader.js +77 -3
- package/dist/config/ConfigLoader.js.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/config/index.js.map +1 -0
- package/dist/core/ASTWorker.d.ts.map +1 -1
- package/dist/core/ASTWorker.js +6 -4
- package/dist/core/ASTWorker.js.map +1 -0
- package/dist/core/ASTWorkerPool.js +2 -1
- package/dist/core/ASTWorkerPool.js.map +1 -0
- package/dist/core/AnalysisQueue.js +1 -0
- package/dist/core/AnalysisQueue.js.map +1 -0
- package/dist/core/CoverageAnalyzer.d.ts.map +1 -1
- package/dist/core/CoverageAnalyzer.js +1 -0
- package/dist/core/CoverageAnalyzer.js.map +1 -0
- package/dist/core/FileExplainer.js +1 -0
- package/dist/core/FileExplainer.js.map +1 -0
- package/dist/core/FileNodeManager.d.ts.map +1 -1
- package/dist/core/FileNodeManager.js +4 -2
- package/dist/core/FileNodeManager.js.map +1 -0
- package/dist/core/GraphBackend.js +1 -0
- package/dist/core/GraphBackend.js.map +1 -0
- package/dist/core/GraphFreshnessChecker.js +1 -0
- package/dist/core/GraphFreshnessChecker.js.map +1 -0
- package/dist/core/GuaranteeManager.js +2 -1
- package/dist/core/GuaranteeManager.js.map +1 -0
- package/dist/core/HashUtils.js +1 -0
- package/dist/core/HashUtils.js.map +1 -0
- package/dist/core/IncrementalReanalyzer.d.ts.map +1 -1
- package/dist/core/IncrementalReanalyzer.js +7 -3
- package/dist/core/IncrementalReanalyzer.js.map +1 -0
- package/dist/core/ManifestStore.js +1 -0
- package/dist/core/ManifestStore.js.map +1 -0
- package/dist/core/NodeFactory.d.ts +54 -34
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +20 -1
- package/dist/core/NodeFactory.js.map +1 -0
- package/dist/core/NodeId.js +1 -0
- package/dist/core/NodeId.js.map +1 -0
- package/dist/core/PriorityQueue.js +1 -0
- package/dist/core/PriorityQueue.js.map +1 -0
- package/dist/core/Profiler.js +1 -0
- package/dist/core/Profiler.js.map +1 -0
- package/dist/core/ScopeTracker.js +1 -0
- package/dist/core/ScopeTracker.js.map +1 -0
- package/dist/core/SemanticId.js +1 -0
- package/dist/core/SemanticId.js.map +1 -0
- package/dist/core/Task.js +1 -0
- package/dist/core/Task.js.map +1 -0
- package/dist/core/TaskTypes.js +1 -0
- package/dist/core/TaskTypes.js.map +1 -0
- package/dist/core/VersionManager.js +1 -0
- package/dist/core/VersionManager.js.map +1 -0
- package/dist/core/WorkerPool.d.ts.map +1 -1
- package/dist/core/WorkerPool.js +3 -1
- package/dist/core/WorkerPool.js.map +1 -0
- package/dist/core/nodes/ArgumentExpressionNode.js +1 -0
- package/dist/core/nodes/ArgumentExpressionNode.js.map +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js.map +1 -0
- package/dist/core/nodes/BranchNode.js +1 -0
- package/dist/core/nodes/BranchNode.js.map +1 -0
- package/dist/core/nodes/CallSiteNode.js +1 -0
- package/dist/core/nodes/CallSiteNode.js.map +1 -0
- package/dist/core/nodes/CaseNode.js +1 -0
- package/dist/core/nodes/CaseNode.js.map +1 -0
- package/dist/core/nodes/ClassNode.js +1 -0
- package/dist/core/nodes/ClassNode.js.map +1 -0
- package/dist/core/nodes/ConstantNode.js +1 -0
- package/dist/core/nodes/ConstantNode.js.map +1 -0
- package/dist/core/nodes/ConstructorCallNode.js +1 -0
- package/dist/core/nodes/ConstructorCallNode.js.map +1 -0
- package/dist/core/nodes/DatabaseQueryNode.js +1 -0
- package/dist/core/nodes/DatabaseQueryNode.js.map +1 -0
- package/dist/core/nodes/DecoratorNode.js +1 -0
- package/dist/core/nodes/DecoratorNode.js.map +1 -0
- package/dist/core/nodes/EntrypointNode.js +1 -0
- package/dist/core/nodes/EntrypointNode.js.map +1 -0
- package/dist/core/nodes/EnumNode.js +1 -0
- package/dist/core/nodes/EnumNode.js.map +1 -0
- package/dist/core/nodes/EventListenerNode.js +1 -0
- package/dist/core/nodes/EventListenerNode.js.map +1 -0
- package/dist/core/nodes/ExportNode.js +1 -0
- package/dist/core/nodes/ExportNode.js.map +1 -0
- package/dist/core/nodes/ExpressionNode.js +1 -0
- package/dist/core/nodes/ExpressionNode.js.map +1 -0
- package/dist/core/nodes/ExternalModuleNode.js +1 -0
- package/dist/core/nodes/ExternalModuleNode.js.map +1 -0
- package/dist/core/nodes/ExternalStdioNode.js +1 -0
- package/dist/core/nodes/ExternalStdioNode.js.map +1 -0
- package/dist/core/nodes/FunctionNode.js +1 -0
- package/dist/core/nodes/FunctionNode.js.map +1 -0
- package/dist/core/nodes/GuaranteeNode.js +1 -0
- package/dist/core/nodes/GuaranteeNode.js.map +1 -0
- package/dist/core/nodes/HttpRequestNode.js +1 -0
- package/dist/core/nodes/HttpRequestNode.js.map +1 -0
- package/dist/core/nodes/ImportNode.js +1 -0
- package/dist/core/nodes/ImportNode.js.map +1 -0
- package/dist/core/nodes/InterfaceNode.js +1 -0
- package/dist/core/nodes/InterfaceNode.js.map +1 -0
- package/dist/core/nodes/IssueNode.js +1 -0
- package/dist/core/nodes/IssueNode.js.map +1 -0
- package/dist/core/nodes/LiteralNode.js +1 -0
- package/dist/core/nodes/LiteralNode.js.map +1 -0
- package/dist/core/nodes/MethodCallNode.js +1 -0
- package/dist/core/nodes/MethodCallNode.js.map +1 -0
- package/dist/core/nodes/MethodNode.js +1 -0
- package/dist/core/nodes/MethodNode.js.map +1 -0
- package/dist/core/nodes/ModuleNode.js +1 -0
- package/dist/core/nodes/ModuleNode.js.map +1 -0
- package/dist/core/nodes/NetworkRequestNode.js +1 -0
- package/dist/core/nodes/NetworkRequestNode.js.map +1 -0
- package/dist/core/nodes/NodeKind.d.ts +5 -0
- package/dist/core/nodes/NodeKind.d.ts.map +1 -1
- package/dist/core/nodes/NodeKind.js +11 -0
- package/dist/core/nodes/NodeKind.js.map +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js.map +1 -0
- package/dist/core/nodes/ParameterNode.js +1 -0
- package/dist/core/nodes/ParameterNode.js.map +1 -0
- package/dist/core/nodes/PluginNode.d.ts +69 -0
- package/dist/core/nodes/PluginNode.d.ts.map +1 -0
- package/dist/core/nodes/PluginNode.js +106 -0
- package/dist/core/nodes/PluginNode.js.map +1 -0
- package/dist/core/nodes/ScopeNode.js +1 -0
- package/dist/core/nodes/ScopeNode.js.map +1 -0
- package/dist/core/nodes/ServiceNode.js +1 -0
- package/dist/core/nodes/ServiceNode.js.map +1 -0
- package/dist/core/nodes/TypeNode.js +2 -1
- package/dist/core/nodes/TypeNode.js.map +1 -0
- package/dist/core/nodes/VariableDeclarationNode.js +1 -0
- package/dist/core/nodes/VariableDeclarationNode.js.map +1 -0
- package/dist/core/nodes/index.d.ts +2 -1
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +4 -1
- package/dist/core/nodes/index.js.map +1 -0
- package/dist/core/toposort.d.ts +38 -0
- package/dist/core/toposort.d.ts.map +1 -0
- package/dist/core/toposort.js +129 -0
- package/dist/core/toposort.js.map +1 -0
- package/dist/data/builtins/BuiltinRegistry.js +1 -0
- package/dist/data/builtins/BuiltinRegistry.js.map +1 -0
- package/dist/data/builtins/definitions.js +1 -0
- package/dist/data/builtins/definitions.js.map +1 -0
- package/dist/data/builtins/index.js +1 -0
- package/dist/data/builtins/index.js.map +1 -0
- package/dist/data/builtins/jsGlobals.js +1 -0
- package/dist/data/builtins/jsGlobals.js.map +1 -0
- package/dist/data/builtins/types.js +1 -0
- package/dist/data/builtins/types.js.map +1 -0
- package/dist/data/globals/definitions.js +1 -0
- package/dist/data/globals/definitions.js.map +1 -0
- package/dist/data/globals/index.js +1 -0
- package/dist/data/globals/index.js.map +1 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts +5 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts.map +1 -1
- package/dist/diagnostics/DiagnosticCollector.js +4 -0
- package/dist/diagnostics/DiagnosticCollector.js.map +1 -0
- package/dist/diagnostics/DiagnosticReporter.d.ts +23 -1
- package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -1
- package/dist/diagnostics/DiagnosticReporter.js +68 -15
- package/dist/diagnostics/DiagnosticReporter.js.map +1 -0
- package/dist/diagnostics/DiagnosticWriter.js +1 -0
- package/dist/diagnostics/DiagnosticWriter.js.map +1 -0
- package/dist/diagnostics/categories.d.ts +57 -0
- package/dist/diagnostics/categories.d.ts.map +1 -0
- package/dist/diagnostics/categories.js +71 -0
- package/dist/diagnostics/categories.js.map +1 -0
- package/dist/diagnostics/index.d.ts +3 -0
- package/dist/diagnostics/index.d.ts.map +1 -1
- package/dist/diagnostics/index.js +4 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/errors/GrafemaError.d.ts +39 -0
- package/dist/errors/GrafemaError.d.ts.map +1 -1
- package/dist/errors/GrafemaError.js +28 -0
- package/dist/errors/GrafemaError.js.map +1 -0
- package/dist/index.d.ts +21 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -0
- package/dist/instructions/index.d.ts +8 -0
- package/dist/instructions/index.d.ts.map +1 -0
- package/dist/instructions/index.js +20 -0
- package/dist/instructions/index.js.map +1 -0
- package/dist/instructions/onboarding.md +121 -0
- package/dist/logging/Logger.d.ts +53 -3
- package/dist/logging/Logger.d.ts.map +1 -1
- package/dist/logging/Logger.js +144 -4
- package/dist/logging/Logger.js.map +1 -0
- package/dist/plugins/Plugin.js +1 -0
- package/dist/plugins/Plugin.js.map +1 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/DatabaseAnalyzer.js +20 -14
- package/dist/plugins/analysis/DatabaseAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +23 -16
- package/dist/plugins/analysis/ExpressAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts +2 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js +53 -76
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +47 -37
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/FetchAnalyzer.d.ts +8 -14
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +144 -97
- package/dist/plugins/analysis/FetchAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +3 -5
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js.map +1 -0
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +59 -2
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +926 -422
- package/dist/plugins/analysis/JSASTAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ReactAnalyzer.js +24 -19
- package/dist/plugins/analysis/ReactAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.js +39 -26
- package/dist/plugins/analysis/RustAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +14 -7
- package/dist/plugins/analysis/SQLiteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +33 -28
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SocketIOAnalyzer.js +24 -14
- package/dist/plugins/analysis/SocketIOAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.js +19 -11
- package/dist/plugins/analysis/SystemDbAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ast/ConditionParser.js +1 -0
- package/dist/plugins/analysis/ast/ConditionParser.js.map +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/ExpressionEvaluator.js +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.js.map +1 -0
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts +58 -6
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +440 -56
- package/dist/plugins/analysis/ast/GraphBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/IdGenerator.js +1 -0
- package/dist/plugins/analysis/ast/IdGenerator.js.map +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js.map +1 -0
- package/dist/plugins/analysis/ast/types.d.ts +152 -1
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/types.js +1 -0
- package/dist/plugins/analysis/ast/types.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts +27 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.js +45 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js +1 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/index.js +1 -0
- package/dist/plugins/analysis/ast/utils/index.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/location.js +1 -0
- package/dist/plugins/analysis/ast/utils/location.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +3 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +9 -2
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +145 -14
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +198 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +4 -3
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +5 -2
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts +83 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js +258 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts +1 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/index.js +2 -0
- package/dist/plugins/analysis/ast/visitors/index.js.map +1 -0
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts +42 -10
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts.map +1 -1
- package/dist/plugins/discovery/DiscoveryPlugin.js +17 -1
- package/dist/plugins/discovery/DiscoveryPlugin.js.map +1 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +3 -2
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js.map +1 -0
- package/dist/plugins/discovery/SimpleProjectDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/SimpleProjectDiscovery.js +3 -2
- package/dist/plugins/discovery/SimpleProjectDiscovery.js.map +1 -0
- package/dist/plugins/discovery/WorkspaceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/WorkspaceDiscovery.js +3 -2
- package/dist/plugins/discovery/WorkspaceDiscovery.js.map +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js.map +1 -0
- package/dist/plugins/discovery/workspaces/detector.js +1 -0
- package/dist/plugins/discovery/workspaces/detector.js.map +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js.map +1 -0
- package/dist/plugins/discovery/workspaces/index.js +1 -0
- package/dist/plugins/discovery/workspaces/index.js.map +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js.map +1 -0
- package/dist/plugins/enrichment/AliasTracker.js +3 -2
- package/dist/plugins/enrichment/AliasTracker.js.map +1 -0
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js.map +1 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts +21 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.js +137 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.js.map +1 -0
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts +5 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.js +11 -9
- package/dist/plugins/enrichment/FunctionCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +2 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +51 -13
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js.map +1 -0
- package/dist/plugins/enrichment/InstanceOfResolver.js +3 -2
- package/dist/plugins/enrichment/InstanceOfResolver.js.map +1 -0
- package/dist/plugins/enrichment/MethodCallResolver.d.ts +39 -1
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.js +422 -11
- package/dist/plugins/enrichment/MethodCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/MountPointResolver.d.ts +1 -1
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +7 -23
- package/dist/plugins/enrichment/MountPointResolver.js.map +1 -0
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +2 -2
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js.map +1 -0
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.js +5 -4
- package/dist/plugins/enrichment/PrefixEvaluator.js.map +1 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts +30 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js +190 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js.map +1 -0
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +4 -3
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js.map +1 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts +3 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +22 -29
- package/dist/plugins/indexing/IncrementalModuleIndexer.js.map +1 -0
- package/dist/plugins/indexing/JSModuleIndexer.d.ts +3 -1
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +22 -31
- package/dist/plugins/indexing/JSModuleIndexer.js.map +1 -0
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +11 -5
- package/dist/plugins/indexing/RustModuleIndexer.js.map +1 -0
- package/dist/plugins/validation/BrokenImportValidator.d.ts.map +1 -1
- package/dist/plugins/validation/BrokenImportValidator.js +3 -3
- package/dist/plugins/validation/BrokenImportValidator.js.map +1 -0
- package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -1
- package/dist/plugins/validation/CallResolverValidator.js +3 -3
- package/dist/plugins/validation/CallResolverValidator.js.map +1 -0
- package/dist/plugins/validation/DataFlowValidator.js +2 -1
- package/dist/plugins/validation/DataFlowValidator.js.map +1 -0
- package/dist/plugins/validation/EvalBanValidator.js +2 -1
- package/dist/plugins/validation/EvalBanValidator.js.map +1 -0
- package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -1
- package/dist/plugins/validation/GraphConnectivityValidator.js +2 -1
- package/dist/plugins/validation/GraphConnectivityValidator.js.map +1 -0
- package/dist/plugins/validation/SQLInjectionValidator.d.ts.map +1 -1
- package/dist/plugins/validation/SQLInjectionValidator.js +4 -2
- package/dist/plugins/validation/SQLInjectionValidator.js.map +1 -0
- package/dist/plugins/validation/ShadowingDetector.js +2 -1
- package/dist/plugins/validation/ShadowingDetector.js.map +1 -0
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.d.ts.map +1 -1
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js +3 -3
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js.map +1 -0
- package/dist/plugins/vcs/GitPlugin.d.ts.map +1 -1
- package/dist/plugins/vcs/GitPlugin.js +13 -6
- package/dist/plugins/vcs/GitPlugin.js.map +1 -0
- package/dist/plugins/vcs/VCSPlugin.js +1 -0
- package/dist/plugins/vcs/VCSPlugin.js.map +1 -0
- package/dist/plugins/vcs/index.js +1 -0
- package/dist/plugins/vcs/index.js.map +1 -0
- package/dist/queries/findCallsInFunction.d.ts +1 -1
- package/dist/queries/findCallsInFunction.d.ts.map +1 -1
- package/dist/queries/findCallsInFunction.js +3 -2
- package/dist/queries/findCallsInFunction.js.map +1 -0
- package/dist/queries/findContainingFunction.d.ts +1 -1
- package/dist/queries/findContainingFunction.d.ts.map +1 -1
- package/dist/queries/findContainingFunction.js +1 -0
- package/dist/queries/findContainingFunction.js.map +1 -0
- package/dist/queries/index.js +1 -0
- package/dist/queries/index.js.map +1 -0
- package/dist/queries/traceValues.d.ts.map +1 -1
- package/dist/queries/traceValues.js +1 -0
- package/dist/queries/traceValues.js.map +1 -0
- package/dist/queries/types.js +1 -0
- package/dist/queries/types.js.map +1 -0
- package/dist/schema/GraphSchemaExtractor.js +1 -0
- package/dist/schema/GraphSchemaExtractor.js.map +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js.map +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +25 -1
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +100 -22
- package/dist/storage/backends/RFDBServerBackend.js.map +1 -0
- package/dist/storage/backends/typeValidation.d.ts.map +1 -1
- package/dist/storage/backends/typeValidation.js +3 -0
- package/dist/storage/backends/typeValidation.js.map +1 -0
- package/dist/utils/findRfdbBinary.js +1 -0
- package/dist/utils/findRfdbBinary.js.map +1 -0
- package/dist/utils/moduleResolution.d.ts +134 -0
- package/dist/utils/moduleResolution.d.ts.map +1 -0
- package/dist/utils/moduleResolution.js +164 -0
- package/dist/utils/moduleResolution.js.map +1 -0
- package/dist/validation/PathValidator.d.ts.map +1 -1
- package/dist/validation/PathValidator.js +1 -0
- package/dist/validation/PathValidator.js.map +1 -0
- package/package.json +4 -3
- package/src/Orchestrator.ts +371 -41
- package/src/api/GraphAPI.ts +4 -2
- package/src/api/GuaranteeAPI.ts +3 -2
- package/src/config/ConfigLoader.ts +121 -3
- package/src/config/index.ts +7 -1
- package/src/core/ASTWorker.ts +8 -20
- package/src/core/ASTWorkerPool.ts +1 -1
- package/src/core/CoverageAnalyzer.ts +2 -2
- package/src/core/FileNodeManager.ts +3 -2
- package/src/core/GuaranteeManager.ts +1 -1
- package/src/core/IncrementalReanalyzer.ts +6 -3
- package/src/core/NodeFactory.ts +34 -1
- package/src/core/WorkerPool.ts +2 -1
- package/src/core/nodes/NodeKind.ts +11 -0
- package/src/core/nodes/PluginNode.ts +144 -0
- package/src/core/nodes/TypeNode.ts +1 -1
- package/src/core/nodes/index.ts +4 -0
- package/src/core/toposort.ts +160 -0
- package/src/diagnostics/DiagnosticCollector.ts +8 -1
- package/src/diagnostics/DiagnosticReporter.ts +87 -16
- package/src/diagnostics/categories.ts +104 -0
- package/src/diagnostics/index.ts +14 -0
- package/src/errors/GrafemaError.ts +58 -0
- package/src/index.ts +53 -9
- package/src/instructions/index.ts +21 -0
- package/src/instructions/onboarding.md +121 -0
- package/src/logging/Logger.ts +155 -4
- package/src/plugins/analysis/DatabaseAnalyzer.ts +22 -15
- package/src/plugins/analysis/ExpressAnalyzer.ts +30 -18
- package/src/plugins/analysis/ExpressResponseAnalyzer.ts +72 -88
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +54 -39
- package/src/plugins/analysis/FetchAnalyzer.ts +165 -113
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +6 -7
- package/src/plugins/analysis/JSASTAnalyzer.ts +1122 -487
- package/src/plugins/analysis/ReactAnalyzer.ts +27 -20
- package/src/plugins/analysis/RustAnalyzer.ts +41 -27
- package/src/plugins/analysis/SQLiteAnalyzer.ts +18 -8
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +38 -34
- package/src/plugins/analysis/SocketIOAnalyzer.ts +30 -15
- package/src/plugins/analysis/SystemDbAnalyzer.ts +24 -13
- package/src/plugins/analysis/ast/ExpressionEvaluator.ts +1 -3
- package/src/plugins/analysis/ast/GraphBuilder.ts +532 -66
- package/src/plugins/analysis/ast/types.ts +200 -2
- package/src/plugins/analysis/ast/utils/babelTraverse.ts +74 -0
- package/src/plugins/analysis/ast/utils/createParameterNodes.ts +1 -1
- package/src/plugins/analysis/ast/visitors/ASTVisitor.ts +7 -2
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +163 -15
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +249 -3
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +9 -4
- package/src/plugins/analysis/ast/visitors/PropertyAccessVisitor.ts +342 -0
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +2 -3
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +1 -27
- package/src/plugins/analysis/ast/visitors/index.ts +2 -0
- package/src/plugins/discovery/DiscoveryPlugin.ts +42 -11
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +2 -2
- package/src/plugins/discovery/SimpleProjectDiscovery.ts +2 -2
- package/src/plugins/discovery/WorkspaceDiscovery.ts +2 -2
- package/src/plugins/discovery/workspaces/globResolver.ts +1 -1
- package/src/plugins/enrichment/AliasTracker.ts +2 -2
- package/src/plugins/enrichment/ArgumentParameterLinker.ts +0 -1
- package/src/plugins/enrichment/ClosureCaptureEnricher.ts +0 -1
- package/src/plugins/enrichment/ExpressHandlerLinker.ts +178 -0
- package/src/plugins/enrichment/ExternalCallResolver.ts +0 -1
- package/src/plugins/enrichment/FunctionCallResolver.ts +10 -15
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +65 -14
- package/src/plugins/enrichment/ImportExportLinker.ts +0 -1
- package/src/plugins/enrichment/InstanceOfResolver.ts +2 -2
- package/src/plugins/enrichment/MethodCallResolver.ts +526 -12
- package/src/plugins/enrichment/MountPointResolver.ts +6 -24
- package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +1 -2
- package/src/plugins/enrichment/PrefixEvaluator.ts +4 -4
- package/src/plugins/enrichment/RejectionPropagationEnricher.ts +253 -0
- package/src/plugins/enrichment/RustFFIEnricher.ts +0 -1
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +3 -3
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +24 -30
- package/src/plugins/indexing/JSModuleIndexer.ts +21 -22
- package/src/plugins/indexing/RustModuleIndexer.ts +10 -5
- package/src/plugins/validation/BrokenImportValidator.ts +2 -3
- package/src/plugins/validation/CallResolverValidator.ts +2 -3
- package/src/plugins/validation/DataFlowValidator.ts +1 -1
- package/src/plugins/validation/EvalBanValidator.ts +1 -1
- package/src/plugins/validation/GraphConnectivityValidator.ts +1 -9
- package/src/plugins/validation/SQLInjectionValidator.ts +3 -2
- package/src/plugins/validation/ShadowingDetector.ts +1 -1
- package/src/plugins/validation/TypeScriptDeadCodeValidator.ts +2 -3
- package/src/plugins/vcs/GitPlugin.ts +12 -6
- package/src/queries/findCallsInFunction.ts +4 -4
- package/src/queries/findContainingFunction.ts +1 -1
- package/src/queries/traceValues.ts +0 -1
- package/src/storage/backends/RFDBServerBackend.ts +115 -25
- package/src/storage/backends/typeValidation.ts +2 -0
- package/src/utils/moduleResolution.ts +244 -0
- package/src/validation/PathValidator.ts +0 -8
- package/src/plugins/validation/NodeCreationValidator.ts +0 -554
|
@@ -19,8 +19,7 @@ import { Plugin } from '../Plugin.js';
|
|
|
19
19
|
import { createSuccessResult, createErrorResult } from '@grafema/types';
|
|
20
20
|
import type { PluginMetadata, PluginContext, PluginResult } from '@grafema/types';
|
|
21
21
|
import type { BaseNodeRecord } from '@grafema/types';
|
|
22
|
-
import {
|
|
23
|
-
import { existsSync } from 'fs';
|
|
22
|
+
import { isRelativeImport, resolveRelativeSpecifier } from '../../utils/moduleResolution.js';
|
|
24
23
|
|
|
25
24
|
interface MountNode {
|
|
26
25
|
id: string;
|
|
@@ -51,7 +50,6 @@ export class MountPointResolver extends Plugin {
|
|
|
51
50
|
return {
|
|
52
51
|
name: 'MountPointResolver',
|
|
53
52
|
phase: 'ENRICHMENT',
|
|
54
|
-
priority: 90, // High priority - one of first enrichment plugins
|
|
55
53
|
creates: {
|
|
56
54
|
nodes: [], // Updates existing nodes
|
|
57
55
|
edges: [] // Doesn't create edges
|
|
@@ -62,32 +60,15 @@ export class MountPointResolver extends Plugin {
|
|
|
62
60
|
|
|
63
61
|
/**
|
|
64
62
|
* Resolve relative import source to absolute file path.
|
|
65
|
-
*
|
|
63
|
+
* Uses shared utility from moduleResolution.ts (REG-320).
|
|
66
64
|
*/
|
|
67
65
|
private resolveImportSource(importSource: string, containingFile: string): string | null {
|
|
68
66
|
// Only handle relative imports
|
|
69
|
-
if (!
|
|
67
|
+
if (!isRelativeImport(importSource)) {
|
|
70
68
|
return null; // External package
|
|
71
69
|
}
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
const basePath = resolve(dir, importSource);
|
|
75
|
-
|
|
76
|
-
// Try direct path
|
|
77
|
-
if (existsSync(basePath)) return basePath;
|
|
78
|
-
|
|
79
|
-
// Try extensions
|
|
80
|
-
for (const ext of ['.js', '.mjs', '.jsx', '.ts', '.tsx']) {
|
|
81
|
-
if (existsSync(basePath + ext)) return basePath + ext;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Try index files
|
|
85
|
-
for (const indexFile of ['index.js', 'index.ts', 'index.mjs', 'index.tsx']) {
|
|
86
|
-
const indexPath = join(basePath, indexFile);
|
|
87
|
-
if (existsSync(indexPath)) return indexPath;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return null;
|
|
71
|
+
return resolveRelativeSpecifier(importSource, containingFile, { useFilesystem: true });
|
|
91
72
|
}
|
|
92
73
|
|
|
93
74
|
async execute(context: PluginContext): Promise<PluginResult> {
|
|
@@ -271,7 +252,8 @@ export class MountPointResolver extends Plugin {
|
|
|
271
252
|
} catch (error) {
|
|
272
253
|
const logger = this.log(context);
|
|
273
254
|
logger.error('Error in MountPointResolver', { error });
|
|
274
|
-
|
|
255
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
256
|
+
return createErrorResult(err);
|
|
275
257
|
}
|
|
276
258
|
}
|
|
277
259
|
}
|
|
@@ -54,7 +54,6 @@ export class NodejsBuiltinsResolver extends Plugin {
|
|
|
54
54
|
return {
|
|
55
55
|
name: 'NodejsBuiltinsResolver',
|
|
56
56
|
phase: 'ENRICHMENT',
|
|
57
|
-
priority: 45, // After ImportExportLinker (90), before/around MethodCallResolver (50)
|
|
58
57
|
creates: {
|
|
59
58
|
nodes: ['EXTERNAL_FUNCTION', 'EXTERNAL_MODULE'],
|
|
60
59
|
edges: ['CALLS', 'IMPORTS_FROM']
|
|
@@ -87,7 +86,7 @@ export class NodejsBuiltinsResolver extends Plugin {
|
|
|
87
86
|
let importsFromEdgesCreated = 0;
|
|
88
87
|
|
|
89
88
|
for (const [, importInfo] of importIndex) {
|
|
90
|
-
const { source, file, localName, importNodeId, importType } = importInfo;
|
|
89
|
+
const { source, file: _file, localName: _localName, importNodeId, importType: _importType } = importInfo;
|
|
91
90
|
const normalizedSource = this.registry.normalizeModule(source);
|
|
92
91
|
|
|
93
92
|
if (this.registry.isBuiltinModule(normalizedSource)) {
|
|
@@ -82,7 +82,6 @@ export class PrefixEvaluator extends Plugin {
|
|
|
82
82
|
return {
|
|
83
83
|
name: 'PrefixEvaluator',
|
|
84
84
|
phase: 'ENRICHMENT',
|
|
85
|
-
priority: 80, // After MountPointResolver (90)
|
|
86
85
|
creates: {
|
|
87
86
|
nodes: [],
|
|
88
87
|
edges: []
|
|
@@ -147,8 +146,8 @@ export class PrefixEvaluator extends Plugin {
|
|
|
147
146
|
plugins: ['jsx', 'typescript'] as ParserPlugin[]
|
|
148
147
|
});
|
|
149
148
|
} catch (error) {
|
|
150
|
-
const
|
|
151
|
-
logger.debug('Failed to parse file', { file: module.file, error:
|
|
149
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
150
|
+
logger.debug('Failed to parse file', { file: module.file, error: message });
|
|
152
151
|
continue;
|
|
153
152
|
}
|
|
154
153
|
|
|
@@ -185,7 +184,8 @@ export class PrefixEvaluator extends Plugin {
|
|
|
185
184
|
} catch (error) {
|
|
186
185
|
const logger = this.log(context);
|
|
187
186
|
logger.error('Error in PrefixEvaluator', { error });
|
|
188
|
-
|
|
187
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
188
|
+
return createErrorResult(err);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RejectionPropagationEnricher - propagates rejection types through await chains
|
|
3
|
+
*
|
|
4
|
+
* REG-311: When function A awaits function B, and B can reject with ErrorX,
|
|
5
|
+
* then A also can reject with ErrorX (unless the await is inside try/catch).
|
|
6
|
+
*
|
|
7
|
+
* USES:
|
|
8
|
+
* - FUNCTION nodes with async=true
|
|
9
|
+
* - CALL nodes with isAwaited/isInsideTry metadata
|
|
10
|
+
* - CALLS edges to find call targets
|
|
11
|
+
* - REJECTS edges to find function rejection types
|
|
12
|
+
*
|
|
13
|
+
* CREATES:
|
|
14
|
+
* - FUNCTION -> REJECTS -> CLASS (propagated edges with metadata: { rejectionType: 'propagated', propagatedFrom })
|
|
15
|
+
*
|
|
16
|
+
* Priority: 70 (after FunctionCallResolver at 80, needs CALLS edges resolved)
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { Plugin, createSuccessResult } from '../Plugin.js';
|
|
20
|
+
import type { PluginContext, PluginResult, PluginMetadata } from '../Plugin.js';
|
|
21
|
+
import type { BaseNodeRecord, EdgeRecord } from '@grafema/types';
|
|
22
|
+
|
|
23
|
+
interface FunctionNode extends BaseNodeRecord {
|
|
24
|
+
async?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface CallNode extends BaseNodeRecord {
|
|
28
|
+
isAwaited?: boolean;
|
|
29
|
+
isInsideTry?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class RejectionPropagationEnricher extends Plugin {
|
|
33
|
+
static MAX_ITERATIONS = 10;
|
|
34
|
+
|
|
35
|
+
get metadata(): PluginMetadata {
|
|
36
|
+
return {
|
|
37
|
+
name: 'RejectionPropagationEnricher',
|
|
38
|
+
phase: 'ENRICHMENT',
|
|
39
|
+
creates: {
|
|
40
|
+
nodes: [],
|
|
41
|
+
edges: ['REJECTS']
|
|
42
|
+
},
|
|
43
|
+
dependencies: ['JSASTAnalyzer'] // Needs FUNCTION, CALL nodes with metadata
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async execute(context: PluginContext): Promise<PluginResult> {
|
|
48
|
+
const { graph, onProgress } = context;
|
|
49
|
+
const logger = this.log(context);
|
|
50
|
+
|
|
51
|
+
logger.info('Starting rejection propagation through await chains');
|
|
52
|
+
|
|
53
|
+
let totalEdgesCreated = 0;
|
|
54
|
+
let iterations = 0;
|
|
55
|
+
|
|
56
|
+
// Step 1: Build function index (id -> FunctionNode)
|
|
57
|
+
const functionIndex = new Map<string, FunctionNode>();
|
|
58
|
+
const asyncFunctions: FunctionNode[] = [];
|
|
59
|
+
|
|
60
|
+
for await (const node of graph.queryNodes({ type: 'FUNCTION' })) {
|
|
61
|
+
const funcNode = node as FunctionNode;
|
|
62
|
+
functionIndex.set(node.id, funcNode);
|
|
63
|
+
if (funcNode.async) {
|
|
64
|
+
asyncFunctions.push(funcNode);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
logger.info('Indexed functions', { total: functionIndex.size, async: asyncFunctions.length });
|
|
69
|
+
|
|
70
|
+
if (asyncFunctions.length === 0) {
|
|
71
|
+
logger.info('No async functions found, skipping propagation');
|
|
72
|
+
return createSuccessResult({ nodes: 0, edges: 0 }, { reason: 'no_async_functions' });
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Step 2: Build REJECTS index (functionId -> Set<errorClassId>)
|
|
76
|
+
const rejectsByFunction = new Map<string, Set<string>>();
|
|
77
|
+
|
|
78
|
+
for (const [funcId] of functionIndex) {
|
|
79
|
+
const rejectsEdges = await graph.getOutgoingEdges(funcId, ['REJECTS']);
|
|
80
|
+
if (rejectsEdges.length > 0) {
|
|
81
|
+
const rejectsSet = new Set<string>();
|
|
82
|
+
for (const edge of rejectsEdges) {
|
|
83
|
+
rejectsSet.add(edge.dst);
|
|
84
|
+
}
|
|
85
|
+
rejectsByFunction.set(funcId, rejectsSet);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
logger.debug('Indexed REJECTS edges', { functionsWithRejects: rejectsByFunction.size });
|
|
90
|
+
|
|
91
|
+
// Step 3: Build CALLS index (callNodeId -> targetFunctionIds)
|
|
92
|
+
const callTargets = new Map<string, string[]>();
|
|
93
|
+
|
|
94
|
+
// Step 4: Build call-to-containing-function mapping and CALLS index
|
|
95
|
+
const callsByFunction = new Map<string, CallNode[]>();
|
|
96
|
+
|
|
97
|
+
for await (const node of graph.queryNodes({ type: 'CALL' })) {
|
|
98
|
+
const callNode = node as CallNode;
|
|
99
|
+
|
|
100
|
+
// Build CALLS index for this call node
|
|
101
|
+
const callsEdges = await graph.getOutgoingEdges(callNode.id, ['CALLS']);
|
|
102
|
+
if (callsEdges.length > 0) {
|
|
103
|
+
const targets: string[] = [];
|
|
104
|
+
for (const edge of callsEdges) {
|
|
105
|
+
targets.push(edge.dst);
|
|
106
|
+
}
|
|
107
|
+
callTargets.set(callNode.id, targets);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Find containing function by walking up CONTAINS/HAS_SCOPE edges
|
|
111
|
+
const containingFunctionId = await this.findContainingFunction(
|
|
112
|
+
callNode.id,
|
|
113
|
+
functionIndex,
|
|
114
|
+
graph
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
if (containingFunctionId) {
|
|
118
|
+
if (!callsByFunction.has(containingFunctionId)) {
|
|
119
|
+
callsByFunction.set(containingFunctionId, []);
|
|
120
|
+
}
|
|
121
|
+
callsByFunction.get(containingFunctionId)!.push(callNode);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
logger.debug('Mapped calls to functions', { functionsWithCalls: callsByFunction.size, callsWithTargets: callTargets.size });
|
|
126
|
+
|
|
127
|
+
// Step 5: Iterate until fixpoint
|
|
128
|
+
let changed = true;
|
|
129
|
+
|
|
130
|
+
while (changed && iterations < RejectionPropagationEnricher.MAX_ITERATIONS) {
|
|
131
|
+
iterations++;
|
|
132
|
+
changed = false;
|
|
133
|
+
let iterationEdges = 0;
|
|
134
|
+
|
|
135
|
+
if (onProgress) {
|
|
136
|
+
onProgress({
|
|
137
|
+
phase: 'enrichment',
|
|
138
|
+
currentPlugin: 'RejectionPropagationEnricher',
|
|
139
|
+
message: `Propagation iteration ${iterations}`,
|
|
140
|
+
processedFiles: iterations,
|
|
141
|
+
totalFiles: RejectionPropagationEnricher.MAX_ITERATIONS
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
for (const asyncFunc of asyncFunctions) {
|
|
146
|
+
const calls = callsByFunction.get(asyncFunc.id) || [];
|
|
147
|
+
|
|
148
|
+
for (const call of calls) {
|
|
149
|
+
// Only propagate for awaited calls NOT inside try
|
|
150
|
+
if (!call.isAwaited || call.isInsideTry) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const targets = callTargets.get(call.id) || [];
|
|
155
|
+
|
|
156
|
+
for (const targetId of targets) {
|
|
157
|
+
const targetRejects = rejectsByFunction.get(targetId);
|
|
158
|
+
if (!targetRejects || targetRejects.size === 0) {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Ensure caller has a rejection set
|
|
163
|
+
if (!rejectsByFunction.has(asyncFunc.id)) {
|
|
164
|
+
rejectsByFunction.set(asyncFunc.id, new Set());
|
|
165
|
+
}
|
|
166
|
+
const callerRejects = rejectsByFunction.get(asyncFunc.id)!;
|
|
167
|
+
|
|
168
|
+
// Propagate each rejection type
|
|
169
|
+
for (const errorClassId of targetRejects) {
|
|
170
|
+
if (!callerRejects.has(errorClassId)) {
|
|
171
|
+
// Use addEdges with skipValidation=true because the dst (CLASS node)
|
|
172
|
+
// may not exist as a graph node (e.g., built-in Error classes)
|
|
173
|
+
const graphWithAddEdges = graph as unknown as {
|
|
174
|
+
addEdges(edges: EdgeRecord[], skipValidation?: boolean): Promise<void>
|
|
175
|
+
};
|
|
176
|
+
await graphWithAddEdges.addEdges([{
|
|
177
|
+
type: 'REJECTS',
|
|
178
|
+
src: asyncFunc.id,
|
|
179
|
+
dst: errorClassId,
|
|
180
|
+
metadata: {
|
|
181
|
+
rejectionType: 'propagated',
|
|
182
|
+
propagatedFrom: targetId
|
|
183
|
+
}
|
|
184
|
+
}], true /* skipValidation */);
|
|
185
|
+
|
|
186
|
+
callerRejects.add(errorClassId);
|
|
187
|
+
iterationEdges++;
|
|
188
|
+
totalEdgesCreated++;
|
|
189
|
+
changed = true;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
logger.debug('Propagation iteration completed', { iteration: iterations, edgesCreated: iterationEdges });
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const summary = {
|
|
200
|
+
iterations,
|
|
201
|
+
asyncFunctionsProcessed: asyncFunctions.length,
|
|
202
|
+
edgesCreated: totalEdgesCreated
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
logger.info('Rejection propagation completed', summary);
|
|
206
|
+
|
|
207
|
+
return createSuccessResult({ nodes: 0, edges: totalEdgesCreated }, summary);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Find the containing FUNCTION node for a given node ID.
|
|
212
|
+
* Walks up CONTAINS and HAS_SCOPE edges until a FUNCTION is found.
|
|
213
|
+
*/
|
|
214
|
+
private async findContainingFunction(
|
|
215
|
+
nodeId: string,
|
|
216
|
+
functionIndex: Map<string, FunctionNode>,
|
|
217
|
+
graph: PluginContext['graph']
|
|
218
|
+
): Promise<string | null> {
|
|
219
|
+
const visited = new Set<string>();
|
|
220
|
+
let currentId = nodeId;
|
|
221
|
+
const maxDepth = 20;
|
|
222
|
+
let depth = 0;
|
|
223
|
+
|
|
224
|
+
while (depth < maxDepth) {
|
|
225
|
+
depth++;
|
|
226
|
+
|
|
227
|
+
if (visited.has(currentId)) {
|
|
228
|
+
break; // Cycle detected
|
|
229
|
+
}
|
|
230
|
+
visited.add(currentId);
|
|
231
|
+
|
|
232
|
+
// Get incoming CONTAINS and HAS_SCOPE edges
|
|
233
|
+
// SCOPE -> CONTAINS -> CALL
|
|
234
|
+
// FUNCTION -> HAS_SCOPE -> SCOPE
|
|
235
|
+
const incomingEdges = await graph.getIncomingEdges(currentId, ['CONTAINS', 'HAS_SCOPE']);
|
|
236
|
+
|
|
237
|
+
if (incomingEdges.length === 0) {
|
|
238
|
+
break; // No more parents
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const parentId = incomingEdges[0].src;
|
|
242
|
+
|
|
243
|
+
// Check if parent is a FUNCTION
|
|
244
|
+
if (functionIndex.has(parentId)) {
|
|
245
|
+
return parentId;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
currentId = parentId;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
@@ -108,11 +108,11 @@ export class ValueDomainAnalyzer extends Plugin {
|
|
|
108
108
|
return {
|
|
109
109
|
name: 'ValueDomainAnalyzer',
|
|
110
110
|
phase: 'ENRICHMENT',
|
|
111
|
-
priority: 65, // After AliasTracker (60)
|
|
112
111
|
creates: {
|
|
113
112
|
nodes: [],
|
|
114
113
|
edges: ['CALLS', 'FLOWS_INTO'] // Added FLOWS_INTO (modifies existing)
|
|
115
|
-
}
|
|
114
|
+
},
|
|
115
|
+
dependencies: ['AliasTracker']
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -576,7 +576,7 @@ export class ValueDomainAnalyzer extends Plugin {
|
|
|
576
576
|
* @param graph - Graph backend with edge operations
|
|
577
577
|
* @returns Statistics about resolution
|
|
578
578
|
*/
|
|
579
|
-
async resolveComputedMutations(graph: Graph,
|
|
579
|
+
async resolveComputedMutations(graph: Graph, _logger: ReturnType<typeof this.log>): Promise<{
|
|
580
580
|
resolved: number;
|
|
581
581
|
conditional: number;
|
|
582
582
|
unknownParameter: number;
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
* Стартует с entry файла, затем анализирует импорты и добавляет новые файлы в очередь
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { readFileSync
|
|
7
|
-
import { join, dirname, resolve,
|
|
6
|
+
import { readFileSync } from 'fs';
|
|
7
|
+
import { join, dirname, resolve, relative } from 'path';
|
|
8
8
|
import { createHash } from 'crypto';
|
|
9
|
-
import {
|
|
9
|
+
import type { ParserPlugin } from '@babel/parser';
|
|
10
|
+
import { parse } from '@babel/parser';
|
|
10
11
|
import traverseModule from '@babel/traverse';
|
|
11
12
|
import type { NodePath } from '@babel/traverse';
|
|
12
13
|
import type { ImportDeclaration, CallExpression, Identifier } from '@babel/types';
|
|
13
14
|
import { Plugin, createSuccessResult, createErrorResult } from '../Plugin.js';
|
|
14
15
|
import type { PluginContext, PluginResult, PluginMetadata } from '../Plugin.js';
|
|
15
16
|
import type { NodeRecord } from '@grafema/types';
|
|
17
|
+
import { resolveModulePath } from '../../utils/moduleResolution.js';
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
|
|
18
20
|
const traverse = (traverseModule as any).default || traverseModule;
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -41,7 +43,7 @@ export class IncrementalModuleIndexer extends Plugin {
|
|
|
41
43
|
return {
|
|
42
44
|
name: 'IncrementalModuleIndexer',
|
|
43
45
|
phase: 'INDEXING',
|
|
44
|
-
|
|
46
|
+
dependencies: [],
|
|
45
47
|
creates: {
|
|
46
48
|
nodes: ['MODULE'],
|
|
47
49
|
edges: ['CONTAINS', 'IMPORTS_FROM']
|
|
@@ -79,29 +81,12 @@ export class IncrementalModuleIndexer extends Plugin {
|
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
/**
|
|
82
|
-
* Try to resolve file with different extensions
|
|
84
|
+
* Try to resolve file with different extensions.
|
|
85
|
+
* Uses shared utility from moduleResolution.ts (REG-320).
|
|
86
|
+
* Now supports all extensions (.ts, .tsx, .mjs, .jsx) - fixes previous bug.
|
|
83
87
|
*/
|
|
84
88
|
private tryResolve(basePath: string): string | null {
|
|
85
|
-
|
|
86
|
-
if (!extname(basePath)) {
|
|
87
|
-
// Try as directory with index.js
|
|
88
|
-
const indexPath = join(basePath, 'index.js');
|
|
89
|
-
if (existsSync(indexPath)) return indexPath;
|
|
90
|
-
|
|
91
|
-
// Try adding .js
|
|
92
|
-
if (existsSync(basePath + '.js')) return basePath + '.js';
|
|
93
|
-
}
|
|
94
|
-
return basePath;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Try with .js extension
|
|
98
|
-
if (existsSync(basePath + '.js')) return basePath + '.js';
|
|
99
|
-
|
|
100
|
-
// Try as directory
|
|
101
|
-
const indexPath = join(basePath, 'index.js');
|
|
102
|
-
if (existsSync(indexPath)) return indexPath;
|
|
103
|
-
|
|
104
|
-
return null;
|
|
89
|
+
return resolveModulePath(basePath, { useFilesystem: true });
|
|
105
90
|
}
|
|
106
91
|
|
|
107
92
|
/**
|
|
@@ -150,7 +135,7 @@ export class IncrementalModuleIndexer extends Plugin {
|
|
|
150
135
|
});
|
|
151
136
|
|
|
152
137
|
return imports;
|
|
153
|
-
} catch
|
|
138
|
+
} catch {
|
|
154
139
|
// Parse error will be logged by execute() when it needs logger context
|
|
155
140
|
return [];
|
|
156
141
|
}
|
|
@@ -186,7 +171,11 @@ export class IncrementalModuleIndexer extends Plugin {
|
|
|
186
171
|
|
|
187
172
|
// Create MODULE node with semantic ID
|
|
188
173
|
const fileHash = this.calculateFileHash(file);
|
|
189
|
-
const
|
|
174
|
+
const baseRelativePath = relative(projectPath, file);
|
|
175
|
+
// REG-76: Prefix with rootPrefix for multi-root workspace support
|
|
176
|
+
const relativePath = context.rootPrefix
|
|
177
|
+
? `${context.rootPrefix}/${baseRelativePath}`
|
|
178
|
+
: baseRelativePath;
|
|
190
179
|
const semanticId = `${relativePath}->global->MODULE->module`;
|
|
191
180
|
|
|
192
181
|
const moduleNode: NodeRecord = {
|
|
@@ -214,7 +203,11 @@ export class IncrementalModuleIndexer extends Plugin {
|
|
|
214
203
|
totalImportsParsed += imports.length;
|
|
215
204
|
for (const importFile of imports) {
|
|
216
205
|
// Store for later edge creation with semantic ID format
|
|
217
|
-
const
|
|
206
|
+
const importBaseRelativePath = relative(projectPath, importFile);
|
|
207
|
+
// REG-76: Prefix with rootPrefix for multi-root workspace support
|
|
208
|
+
const importRelativePath = context.rootPrefix
|
|
209
|
+
? `${context.rootPrefix}/${importBaseRelativePath}`
|
|
210
|
+
: importBaseRelativePath;
|
|
218
211
|
const importSemanticId = `${importRelativePath}->global->MODULE->module`;
|
|
219
212
|
pendingImports.push({
|
|
220
213
|
src: moduleNode.id,
|
|
@@ -290,7 +283,8 @@ export class IncrementalModuleIndexer extends Plugin {
|
|
|
290
283
|
|
|
291
284
|
} catch (error) {
|
|
292
285
|
logger.error('Indexing failed', { error });
|
|
293
|
-
|
|
286
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
287
|
+
return createErrorResult(err);
|
|
294
288
|
}
|
|
295
289
|
}
|
|
296
290
|
}
|
|
@@ -11,8 +11,8 @@ import { Plugin, createErrorResult } from '../Plugin.js';
|
|
|
11
11
|
import type { PluginContext, PluginResult, PluginMetadata } from '../Plugin.js';
|
|
12
12
|
// @ts-expect-error - no type declarations for node-source-walk
|
|
13
13
|
import Walker from 'node-source-walk';
|
|
14
|
-
import { NodeFactory } from '../../core/NodeFactory.js';
|
|
15
14
|
import { LanguageError } from '../../errors/GrafemaError.js';
|
|
15
|
+
import { resolveModulePath as resolveModulePathUtil } from '../../utils/moduleResolution.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Manifest with service info
|
|
@@ -141,7 +141,7 @@ export class JSModuleIndexer extends Plugin {
|
|
|
141
141
|
return {
|
|
142
142
|
name: 'JSModuleIndexer',
|
|
143
143
|
phase: 'INDEXING',
|
|
144
|
-
|
|
144
|
+
dependencies: [],
|
|
145
145
|
creates: {
|
|
146
146
|
nodes: ['MODULE'],
|
|
147
147
|
edges: ['CONTAINS', 'DEPENDS_ON']
|
|
@@ -187,8 +187,9 @@ export class JSModuleIndexer extends Plugin {
|
|
|
187
187
|
this.cache.set(filePath, []);
|
|
188
188
|
return [];
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
191
|
+
this.cache.set(filePath, new Error(message));
|
|
192
|
+
return new Error(message);
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
this.walker.traverse(ast, (node: ASTNode) => {
|
|
@@ -237,23 +238,12 @@ export class JSModuleIndexer extends Plugin {
|
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
/**
|
|
240
|
-
*
|
|
241
|
+
* Resolve module path (adds .js/.ts if needed).
|
|
242
|
+
* Uses shared utility from moduleResolution.ts (REG-320).
|
|
243
|
+
* Falls back to original path if not found (preserves original behavior).
|
|
241
244
|
*/
|
|
242
245
|
private resolveModulePath(path: string): string {
|
|
243
|
-
|
|
244
|
-
// Try JavaScript extensions
|
|
245
|
-
if (existsSync(path + '.js')) return path + '.js';
|
|
246
|
-
if (existsSync(path + '.mjs')) return path + '.mjs';
|
|
247
|
-
if (existsSync(path + '.jsx')) return path + '.jsx';
|
|
248
|
-
// Try TypeScript extensions
|
|
249
|
-
if (existsSync(path + '.ts')) return path + '.ts';
|
|
250
|
-
if (existsSync(path + '.tsx')) return path + '.tsx';
|
|
251
|
-
// Try index files
|
|
252
|
-
if (existsSync(join(path, 'index.js'))) return join(path, 'index.js');
|
|
253
|
-
if (existsSync(join(path, 'index.ts'))) return join(path, 'index.ts');
|
|
254
|
-
if (existsSync(join(path, 'index.mjs'))) return join(path, 'index.mjs');
|
|
255
|
-
if (existsSync(join(path, 'index.tsx'))) return join(path, 'index.tsx');
|
|
256
|
-
return path;
|
|
246
|
+
return resolveModulePathUtil(path, { useFilesystem: true }) ?? path;
|
|
257
247
|
}
|
|
258
248
|
|
|
259
249
|
async execute(context: PluginContext): Promise<PluginResult> {
|
|
@@ -370,7 +360,11 @@ export class JSModuleIndexer extends Plugin {
|
|
|
370
360
|
|
|
371
361
|
// Создаём MODULE ноду для текущего файла с semantic ID
|
|
372
362
|
const fileHash = this.calculateFileHash(currentFile);
|
|
373
|
-
const
|
|
363
|
+
const baseRelativePath = relative(projectPath, currentFile) || basename(currentFile);
|
|
364
|
+
// REG-76: Prefix with rootPrefix for multi-root workspace support
|
|
365
|
+
const relativePath = context.rootPrefix
|
|
366
|
+
? `${context.rootPrefix}/${baseRelativePath}`
|
|
367
|
+
: baseRelativePath;
|
|
374
368
|
const semanticId = `${relativePath}->global->MODULE->module`;
|
|
375
369
|
|
|
376
370
|
// Construct MODULE node manually to preserve absolute file path for analyzers
|
|
@@ -419,7 +413,11 @@ export class JSModuleIndexer extends Plugin {
|
|
|
419
413
|
|
|
420
414
|
// Queue DEPENDS_ON edges for later (after all nodes exist)
|
|
421
415
|
// Use semantic ID format for dependency reference
|
|
422
|
-
const
|
|
416
|
+
const depBaseRelativePath = relative(projectPath, resolvedDep) || basename(resolvedDep);
|
|
417
|
+
// REG-76: Prefix with rootPrefix for multi-root workspace support
|
|
418
|
+
const depRelativePath = context.rootPrefix
|
|
419
|
+
? `${context.rootPrefix}/${depBaseRelativePath}`
|
|
420
|
+
: depBaseRelativePath;
|
|
423
421
|
const depModuleId = `${depRelativePath}->global->MODULE->module`;
|
|
424
422
|
pendingDependsOnEdges.push({
|
|
425
423
|
src: moduleId,
|
|
@@ -474,7 +472,8 @@ export class JSModuleIndexer extends Plugin {
|
|
|
474
472
|
|
|
475
473
|
} catch (error) {
|
|
476
474
|
logger.error('Indexing failed', { error });
|
|
477
|
-
|
|
475
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
476
|
+
return createErrorResult(err);
|
|
478
477
|
}
|
|
479
478
|
}
|
|
480
479
|
}
|
|
@@ -29,7 +29,7 @@ export class RustModuleIndexer extends Plugin {
|
|
|
29
29
|
return {
|
|
30
30
|
name: 'RustModuleIndexer',
|
|
31
31
|
phase: 'INDEXING',
|
|
32
|
-
|
|
32
|
+
dependencies: [],
|
|
33
33
|
creates: {
|
|
34
34
|
nodes: ['RUST_MODULE'],
|
|
35
35
|
edges: ['CONTAINS']
|
|
@@ -119,10 +119,14 @@ export class RustModuleIndexer extends Plugin {
|
|
|
119
119
|
try {
|
|
120
120
|
const content = readFileSync(filePath, 'utf-8');
|
|
121
121
|
const hash = createHash('sha256').update(content).digest('hex');
|
|
122
|
-
const
|
|
123
|
-
const moduleName = this.pathToModuleName(
|
|
122
|
+
const baseRelativePath = relative(rustRoot, filePath);
|
|
123
|
+
const moduleName = this.pathToModuleName(baseRelativePath);
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
// REG-76: Prefix with rootPrefix for multi-root workspace support
|
|
126
|
+
const prefixedPath = context.rootPrefix
|
|
127
|
+
? `${context.rootPrefix}/${baseRelativePath}`
|
|
128
|
+
: baseRelativePath;
|
|
129
|
+
const nodeId = `RUST_MODULE#${moduleName}#${prefixedPath}`;
|
|
126
130
|
|
|
127
131
|
await graph.addNode({
|
|
128
132
|
id: nodeId,
|
|
@@ -147,7 +151,8 @@ export class RustModuleIndexer extends Plugin {
|
|
|
147
151
|
});
|
|
148
152
|
}
|
|
149
153
|
} catch (err) {
|
|
150
|
-
|
|
154
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
155
|
+
errors.push({ file: filePath, error: message });
|
|
151
156
|
}
|
|
152
157
|
}
|
|
153
158
|
|
|
@@ -77,12 +77,11 @@ export class BrokenImportValidator extends Plugin {
|
|
|
77
77
|
return {
|
|
78
78
|
name: 'BrokenImportValidator',
|
|
79
79
|
phase: 'VALIDATION',
|
|
80
|
-
|
|
80
|
+
dependencies: ['ImportExportLinker', 'FunctionCallResolver'],
|
|
81
81
|
creates: {
|
|
82
82
|
nodes: [],
|
|
83
83
|
edges: []
|
|
84
|
-
}
|
|
85
|
-
dependencies: ['ImportExportLinker', 'FunctionCallResolver']
|
|
84
|
+
}
|
|
86
85
|
};
|
|
87
86
|
}
|
|
88
87
|
|
|
@@ -47,12 +47,11 @@ export class CallResolverValidator extends Plugin {
|
|
|
47
47
|
return {
|
|
48
48
|
name: 'CallResolverValidator',
|
|
49
49
|
phase: 'VALIDATION',
|
|
50
|
-
|
|
50
|
+
dependencies: ['FunctionCallResolver', 'ExternalCallResolver'],
|
|
51
51
|
creates: {
|
|
52
52
|
nodes: [],
|
|
53
53
|
edges: []
|
|
54
|
-
}
|
|
55
|
-
dependencies: ['FunctionCallResolver', 'ExternalCallResolver']
|
|
54
|
+
}
|
|
56
55
|
};
|
|
57
56
|
}
|
|
58
57
|
|