@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
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Topological sort for plugin dependency ordering (REG-367).
|
|
3
|
+
*
|
|
4
|
+
* Uses Kahn's algorithm (BFS-based) to sort items by their declared dependencies.
|
|
5
|
+
* Dependencies not present in the input set are silently ignored (cross-phase deps).
|
|
6
|
+
* When multiple items have zero in-degree, they are emitted in input order
|
|
7
|
+
* (registration order tiebreaker).
|
|
8
|
+
*
|
|
9
|
+
* Time complexity: O(V + E)
|
|
10
|
+
* Space complexity: O(V + E)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Thrown when a dependency cycle is detected during topological sort.
|
|
15
|
+
*/
|
|
16
|
+
export class CycleError extends Error {
|
|
17
|
+
readonly cycle: string[];
|
|
18
|
+
|
|
19
|
+
constructor(cycle: string[]) {
|
|
20
|
+
super(`Dependency cycle detected: ${cycle.join(' -> ')}`);
|
|
21
|
+
this.name = 'CycleError';
|
|
22
|
+
this.cycle = cycle;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Input item for topological sort.
|
|
28
|
+
*/
|
|
29
|
+
export interface ToposortItem {
|
|
30
|
+
id: string;
|
|
31
|
+
dependencies: string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Topologically sort items by their dependencies using Kahn's algorithm.
|
|
36
|
+
*
|
|
37
|
+
* Dependencies not present in the input set are silently ignored (cross-phase).
|
|
38
|
+
* Throws CycleError if a dependency cycle exists among the items.
|
|
39
|
+
* Items with no dependency relationship are emitted in their original input order.
|
|
40
|
+
*
|
|
41
|
+
* @param items - Array of items with id and dependencies
|
|
42
|
+
* @returns Array of IDs in topological order (dependencies first)
|
|
43
|
+
* @throws CycleError if a dependency cycle exists
|
|
44
|
+
*/
|
|
45
|
+
export function toposort(items: ToposortItem[]): string[] {
|
|
46
|
+
if (items.length === 0) return [];
|
|
47
|
+
|
|
48
|
+
// Build the set of known IDs for filtering cross-phase deps
|
|
49
|
+
const knownIds = new Set(items.map(item => item.id));
|
|
50
|
+
|
|
51
|
+
// adjacency: dep -> list of items that depend on it (successors)
|
|
52
|
+
const successors = new Map<string, string[]>();
|
|
53
|
+
const inDegree = new Map<string, number>();
|
|
54
|
+
|
|
55
|
+
// Initialize
|
|
56
|
+
for (const item of items) {
|
|
57
|
+
successors.set(item.id, []);
|
|
58
|
+
inDegree.set(item.id, 0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Build edges: for each item's dependency that is in the same set,
|
|
62
|
+
// add edge from dependency -> item (dependency must execute first)
|
|
63
|
+
for (const item of items) {
|
|
64
|
+
for (const dep of item.dependencies) {
|
|
65
|
+
if (!knownIds.has(dep)) continue; // cross-phase, ignore
|
|
66
|
+
successors.get(dep)!.push(item.id);
|
|
67
|
+
inDegree.set(item.id, inDegree.get(item.id)! + 1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Initialize queue with all zero-in-degree items, preserving input order
|
|
72
|
+
const queue: string[] = [];
|
|
73
|
+
for (const item of items) {
|
|
74
|
+
if (inDegree.get(item.id) === 0) {
|
|
75
|
+
queue.push(item.id);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Process queue (FIFO for registration-order tiebreaker)
|
|
80
|
+
const result: string[] = [];
|
|
81
|
+
let head = 0;
|
|
82
|
+
|
|
83
|
+
while (head < queue.length) {
|
|
84
|
+
const current = queue[head++];
|
|
85
|
+
result.push(current);
|
|
86
|
+
|
|
87
|
+
for (const successor of successors.get(current)!) {
|
|
88
|
+
const newDegree = inDegree.get(successor)! - 1;
|
|
89
|
+
inDegree.set(successor, newDegree);
|
|
90
|
+
if (newDegree === 0) {
|
|
91
|
+
queue.push(successor);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// If not all items were processed, there's a cycle
|
|
97
|
+
if (result.length < items.length) {
|
|
98
|
+
const cycle = findCycle(items, knownIds, result);
|
|
99
|
+
throw new CycleError(cycle);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Find a cycle among unprocessed items using DFS.
|
|
107
|
+
* Returns the cycle as an array of IDs ending with a repeat of the first.
|
|
108
|
+
*/
|
|
109
|
+
function findCycle(items: ToposortItem[], knownIds: Set<string>, processed: string[]): string[] {
|
|
110
|
+
const processedSet = new Set(processed);
|
|
111
|
+
const unprocessed = items.filter(item => !processedSet.has(item.id));
|
|
112
|
+
|
|
113
|
+
// Build adjacency for unprocessed items only
|
|
114
|
+
const deps = new Map<string, string[]>();
|
|
115
|
+
for (const item of unprocessed) {
|
|
116
|
+
deps.set(item.id, item.dependencies.filter(d => knownIds.has(d) && !processedSet.has(d)));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// DFS to find cycle
|
|
120
|
+
const visiting = new Set<string>();
|
|
121
|
+
const visited = new Set<string>();
|
|
122
|
+
const path: string[] = [];
|
|
123
|
+
|
|
124
|
+
for (const item of unprocessed) {
|
|
125
|
+
const cycle = dfs(item.id, deps, visiting, visited, path);
|
|
126
|
+
if (cycle) return cycle;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Fallback: shouldn't reach here, but return the unprocessed IDs
|
|
130
|
+
return [...unprocessed.map(i => i.id), unprocessed[0].id];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function dfs(
|
|
134
|
+
node: string,
|
|
135
|
+
deps: Map<string, string[]>,
|
|
136
|
+
visiting: Set<string>,
|
|
137
|
+
visited: Set<string>,
|
|
138
|
+
path: string[]
|
|
139
|
+
): string[] | null {
|
|
140
|
+
if (visited.has(node)) return null;
|
|
141
|
+
|
|
142
|
+
if (visiting.has(node)) {
|
|
143
|
+
// Found cycle — extract it from path
|
|
144
|
+
const cycleStart = path.indexOf(node);
|
|
145
|
+
return [...path.slice(cycleStart), node];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
visiting.add(node);
|
|
149
|
+
path.push(node);
|
|
150
|
+
|
|
151
|
+
for (const dep of deps.get(node) ?? []) {
|
|
152
|
+
const cycle = dfs(dep, deps, visiting, visited, path);
|
|
153
|
+
if (cycle) return cycle;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
path.pop();
|
|
157
|
+
visiting.delete(node);
|
|
158
|
+
visited.add(node);
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import type { PluginPhase, PluginResult } from '@grafema/types';
|
|
20
|
-
import { GrafemaError } from '../errors/GrafemaError.js';
|
|
20
|
+
import { GrafemaError, type ResolutionStep, type ResolutionFailureReason } from '../errors/GrafemaError.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Diagnostic entry - unified format for all errors/warnings
|
|
@@ -32,6 +32,10 @@ export interface Diagnostic {
|
|
|
32
32
|
plugin: string;
|
|
33
33
|
timestamp: number;
|
|
34
34
|
suggestion?: string;
|
|
35
|
+
/** Resolution chain for context (REG-332) */
|
|
36
|
+
resolutionChain?: ResolutionStep[];
|
|
37
|
+
/** Failure reason for context-aware suggestions (REG-332) */
|
|
38
|
+
failureReason?: ResolutionFailureReason;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
/**
|
|
@@ -63,6 +67,9 @@ export class DiagnosticCollector {
|
|
|
63
67
|
phase,
|
|
64
68
|
plugin,
|
|
65
69
|
suggestion: error.suggestion,
|
|
70
|
+
// REG-332: Pass through resolution context
|
|
71
|
+
resolutionChain: error.context.resolutionChain as ResolutionStep[] | undefined,
|
|
72
|
+
failureReason: error.context.failureReason as ResolutionFailureReason | undefined,
|
|
66
73
|
});
|
|
67
74
|
} else {
|
|
68
75
|
// Plain Error - treat as generic error
|
|
@@ -13,21 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import type { Diagnostic, DiagnosticCollector } from './DiagnosticCollector.js';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Mapping from diagnostic codes to category information
|
|
19
|
-
*/
|
|
20
|
-
const DIAGNOSTIC_CODE_CATEGORIES: Record<string, { name: string; checkCommand: string }> = {
|
|
21
|
-
'ERR_DISCONNECTED_NODES': { name: 'disconnected nodes', checkCommand: 'grafema check connectivity' },
|
|
22
|
-
'ERR_DISCONNECTED_NODE': { name: 'disconnected nodes', checkCommand: 'grafema check connectivity' },
|
|
23
|
-
'ERR_UNRESOLVED_CALL': { name: 'unresolved calls', checkCommand: 'grafema check calls' },
|
|
24
|
-
'ERR_MISSING_ASSIGNMENT': { name: 'missing assignments', checkCommand: 'grafema check dataflow' },
|
|
25
|
-
'ERR_BROKEN_REFERENCE': { name: 'broken references', checkCommand: 'grafema check dataflow' },
|
|
26
|
-
'ERR_NO_LEAF_NODE': { name: 'incomplete traces', checkCommand: 'grafema check dataflow' },
|
|
27
|
-
'DISCONNECTED_NODES': { name: 'disconnected nodes', checkCommand: 'grafema check connectivity' },
|
|
28
|
-
'UNRESOLVED_FUNCTION_CALL': { name: 'unresolved calls', checkCommand: 'grafema check calls' },
|
|
29
|
-
'MISSING_ASSIGNMENT': { name: 'missing assignments', checkCommand: 'grafema check dataflow' },
|
|
30
|
-
};
|
|
16
|
+
import { CODE_TO_CATEGORY } from './categories.js';
|
|
31
17
|
|
|
32
18
|
/**
|
|
33
19
|
* Report output options
|
|
@@ -38,6 +24,16 @@ export interface ReportOptions {
|
|
|
38
24
|
includeTrace?: boolean;
|
|
39
25
|
}
|
|
40
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Options for strict mode formatting (REG-332)
|
|
29
|
+
*/
|
|
30
|
+
export interface StrictFormatOptions {
|
|
31
|
+
/** Show resolution chain (hybrid: auto-show for ≤3 errors, hide for more) */
|
|
32
|
+
verbose?: boolean;
|
|
33
|
+
/** REG-332: Number of errors suppressed by grafema-ignore comments */
|
|
34
|
+
suppressedCount?: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
41
37
|
/**
|
|
42
38
|
* Summary statistics
|
|
43
39
|
*/
|
|
@@ -196,7 +192,7 @@ export class DiagnosticReporter {
|
|
|
196
192
|
// Convert to CategoryCount array with metadata
|
|
197
193
|
const byCode: CategoryCount[] = [];
|
|
198
194
|
for (const [code, count] of codeMap.entries()) {
|
|
199
|
-
const category =
|
|
195
|
+
const category = CODE_TO_CATEGORY[code];
|
|
200
196
|
byCode.push({
|
|
201
197
|
code,
|
|
202
198
|
count,
|
|
@@ -214,6 +210,81 @@ export class DiagnosticReporter {
|
|
|
214
210
|
};
|
|
215
211
|
}
|
|
216
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Format strict mode errors with enhanced context (REG-332).
|
|
215
|
+
* Shows resolution chain and context-aware suggestions.
|
|
216
|
+
*
|
|
217
|
+
* Uses hybrid progressive disclosure:
|
|
218
|
+
* - ≤3 errors: show chain by default
|
|
219
|
+
* - >3 errors: hide chain unless verbose=true
|
|
220
|
+
*
|
|
221
|
+
* @param diagnostics - The fatal diagnostics from strict mode
|
|
222
|
+
* @param options - Formatting options
|
|
223
|
+
* @returns Formatted string for CLI output
|
|
224
|
+
*/
|
|
225
|
+
formatStrict(diagnostics: Diagnostic[], options: StrictFormatOptions = {}): string {
|
|
226
|
+
const lines: string[] = [];
|
|
227
|
+
// Hybrid: show chain for ≤3 errors unless explicitly set
|
|
228
|
+
const showChain = options.verbose ?? diagnostics.length <= 3;
|
|
229
|
+
|
|
230
|
+
for (const diag of diagnostics) {
|
|
231
|
+
// Header: CODE file:line
|
|
232
|
+
const location = diag.file
|
|
233
|
+
? diag.line
|
|
234
|
+
? `${diag.file}:${diag.line}`
|
|
235
|
+
: diag.file
|
|
236
|
+
: '';
|
|
237
|
+
lines.push(`${diag.code} ${location}`);
|
|
238
|
+
lines.push('');
|
|
239
|
+
|
|
240
|
+
// Message
|
|
241
|
+
lines.push(` ${diag.message}`);
|
|
242
|
+
|
|
243
|
+
// Resolution chain (if showing and present)
|
|
244
|
+
if (showChain && diag.resolutionChain && diag.resolutionChain.length > 0) {
|
|
245
|
+
lines.push('');
|
|
246
|
+
lines.push(' Resolution chain:');
|
|
247
|
+
for (const step of diag.resolutionChain) {
|
|
248
|
+
const stepLocation = step.file
|
|
249
|
+
? step.line
|
|
250
|
+
? ` (${step.file}:${step.line})`
|
|
251
|
+
: ` (${step.file})`
|
|
252
|
+
: '';
|
|
253
|
+
lines.push(` ${step.step} -> ${step.result}${stepLocation}`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Suggestion (if present)
|
|
258
|
+
if (diag.suggestion) {
|
|
259
|
+
lines.push('');
|
|
260
|
+
lines.push(` Suggestion: ${diag.suggestion}`);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
lines.push('');
|
|
264
|
+
lines.push('---');
|
|
265
|
+
lines.push('');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Remove trailing separator
|
|
269
|
+
if (lines.length > 0) {
|
|
270
|
+
lines.splice(-3);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Add hint about verbose mode if chain hidden
|
|
274
|
+
if (!showChain && diagnostics.some(d => d.resolutionChain && d.resolutionChain.length > 0)) {
|
|
275
|
+
lines.push('');
|
|
276
|
+
lines.push(' Run with --verbose to see resolution chains.');
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// REG-332: Show suppression summary if any errors were suppressed
|
|
280
|
+
if (options.suppressedCount && options.suppressedCount > 0) {
|
|
281
|
+
lines.push('');
|
|
282
|
+
lines.push(` ${options.suppressedCount} error(s) suppressed by grafema-ignore comments.`);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return lines.join('\n');
|
|
286
|
+
}
|
|
287
|
+
|
|
217
288
|
/**
|
|
218
289
|
* Generate human-readable text report.
|
|
219
290
|
*/
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostic Categories - Single source of truth for category/code mappings
|
|
3
|
+
*
|
|
4
|
+
* This module defines diagnostic categories once and derives both mapping
|
|
5
|
+
* directions:
|
|
6
|
+
* - DIAGNOSTIC_CATEGORIES: category → codes (used by CLI check command)
|
|
7
|
+
* - CODE_TO_CATEGORY: code → category metadata (used by DiagnosticReporter)
|
|
8
|
+
*
|
|
9
|
+
* Adding a new diagnostic code requires updating only this file.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Category definition with human-readable metadata and associated codes
|
|
14
|
+
*/
|
|
15
|
+
export interface DiagnosticCategory {
|
|
16
|
+
/** Human-readable name for display */
|
|
17
|
+
readonly name: string;
|
|
18
|
+
/** Description of what this category checks */
|
|
19
|
+
readonly description: string;
|
|
20
|
+
/** Diagnostic codes that belong to this category */
|
|
21
|
+
readonly codes: readonly string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Valid category keys
|
|
26
|
+
*/
|
|
27
|
+
export type DiagnosticCategoryKey = 'connectivity' | 'calls' | 'dataflow' | 'imports';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Canonical definition of all diagnostic categories
|
|
31
|
+
*
|
|
32
|
+
* This is the SINGLE SOURCE OF TRUTH for category mappings.
|
|
33
|
+
* Both CLI and DiagnosticReporter derive their mappings from this.
|
|
34
|
+
*/
|
|
35
|
+
export const DIAGNOSTIC_CATEGORIES: Record<DiagnosticCategoryKey, DiagnosticCategory> = {
|
|
36
|
+
connectivity: {
|
|
37
|
+
name: 'Graph Connectivity',
|
|
38
|
+
description: 'Check for disconnected nodes in the graph',
|
|
39
|
+
codes: ['ERR_DISCONNECTED_NODES', 'ERR_DISCONNECTED_NODE'],
|
|
40
|
+
},
|
|
41
|
+
calls: {
|
|
42
|
+
name: 'Call Resolution',
|
|
43
|
+
description: 'Check for unresolved function calls',
|
|
44
|
+
codes: ['ERR_UNRESOLVED_CALL'],
|
|
45
|
+
},
|
|
46
|
+
dataflow: {
|
|
47
|
+
name: 'Data Flow',
|
|
48
|
+
description: 'Check for missing assignments and broken references',
|
|
49
|
+
codes: ['ERR_MISSING_ASSIGNMENT', 'ERR_BROKEN_REFERENCE', 'ERR_NO_LEAF_NODE'],
|
|
50
|
+
},
|
|
51
|
+
imports: {
|
|
52
|
+
name: 'Import Validation',
|
|
53
|
+
description: 'Check for broken imports and undefined symbols',
|
|
54
|
+
codes: ['ERR_BROKEN_IMPORT', 'ERR_UNDEFINED_SYMBOL'],
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Metadata for code-to-category lookup (used by DiagnosticReporter)
|
|
60
|
+
*/
|
|
61
|
+
export interface CodeCategoryInfo {
|
|
62
|
+
/** Human-readable name for the issue type */
|
|
63
|
+
name: string;
|
|
64
|
+
/** CLI command to check this category */
|
|
65
|
+
checkCommand: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Derived mapping: code → category metadata
|
|
70
|
+
*
|
|
71
|
+
* Auto-generated from DIAGNOSTIC_CATEGORIES.
|
|
72
|
+
* Used by DiagnosticReporter to show actionable commands.
|
|
73
|
+
*/
|
|
74
|
+
export const CODE_TO_CATEGORY: Record<string, CodeCategoryInfo> = (() => {
|
|
75
|
+
const result: Record<string, CodeCategoryInfo> = {};
|
|
76
|
+
|
|
77
|
+
for (const [categoryKey, category] of Object.entries(DIAGNOSTIC_CATEGORIES)) {
|
|
78
|
+
// Generate human-readable name from category name (lowercase, plural)
|
|
79
|
+
const issueName = category.name.toLowerCase().replace('graph ', '');
|
|
80
|
+
|
|
81
|
+
for (const code of category.codes) {
|
|
82
|
+
result[code] = {
|
|
83
|
+
name: issueName,
|
|
84
|
+
checkCommand: `grafema check ${categoryKey}`,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return result;
|
|
90
|
+
})();
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Get category for a diagnostic code
|
|
94
|
+
*/
|
|
95
|
+
export function getCategoryForCode(code: string): CodeCategoryInfo | undefined {
|
|
96
|
+
return CODE_TO_CATEGORY[code];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Get all codes for a category
|
|
101
|
+
*/
|
|
102
|
+
export function getCodesForCategory(category: DiagnosticCategoryKey): readonly string[] {
|
|
103
|
+
return DIAGNOSTIC_CATEGORIES[category].codes;
|
|
104
|
+
}
|
package/src/diagnostics/index.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* - DiagnosticCollector: Collects errors from plugin execution
|
|
6
6
|
* - DiagnosticReporter: Formats diagnostics for output (text/json/csv)
|
|
7
7
|
* - DiagnosticWriter: Writes diagnostics.log file
|
|
8
|
+
* - categories: Single source of truth for diagnostic category mappings
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
export { DiagnosticCollector } from './DiagnosticCollector.js';
|
|
@@ -14,3 +15,16 @@ export { DiagnosticReporter } from './DiagnosticReporter.js';
|
|
|
14
15
|
export type { ReportOptions, SummaryStats, CategoryCount, CategorizedSummaryStats } from './DiagnosticReporter.js';
|
|
15
16
|
|
|
16
17
|
export { DiagnosticWriter } from './DiagnosticWriter.js';
|
|
18
|
+
|
|
19
|
+
// Category mappings (single source of truth)
|
|
20
|
+
export {
|
|
21
|
+
DIAGNOSTIC_CATEGORIES,
|
|
22
|
+
CODE_TO_CATEGORY,
|
|
23
|
+
getCategoryForCode,
|
|
24
|
+
getCodesForCategory,
|
|
25
|
+
} from './categories.js';
|
|
26
|
+
export type {
|
|
27
|
+
DiagnosticCategory,
|
|
28
|
+
DiagnosticCategoryKey,
|
|
29
|
+
CodeCategoryInfo,
|
|
30
|
+
} from './categories.js';
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import type { PluginPhase } from '@grafema/types';
|
|
17
|
+
import type { Diagnostic } from '../diagnostics/DiagnosticCollector.js';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Context for error reporting
|
|
@@ -237,3 +238,60 @@ export class StrictModeError extends GrafemaError {
|
|
|
237
238
|
this.code = code;
|
|
238
239
|
}
|
|
239
240
|
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* A step in the resolution chain showing what was resolved before failure.
|
|
244
|
+
* Used by StrictModeError to provide context-aware error messages (REG-332).
|
|
245
|
+
*/
|
|
246
|
+
export interface ResolutionStep {
|
|
247
|
+
/** Description of what was resolved, e.g., "getUser() return" */
|
|
248
|
+
step: string;
|
|
249
|
+
/** Result of resolution, e.g., "unknown" or "User class" */
|
|
250
|
+
result: string;
|
|
251
|
+
/** File where this step occurred */
|
|
252
|
+
file?: string;
|
|
253
|
+
/** Line number */
|
|
254
|
+
line?: number;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Reasons why resolution can fail.
|
|
259
|
+
* Used by StrictModeError for context-aware suggestions (REG-332).
|
|
260
|
+
*/
|
|
261
|
+
export type ResolutionFailureReason =
|
|
262
|
+
| 'unknown_object_type' // getUser() return unknown
|
|
263
|
+
| 'class_not_imported' // User class not in scope
|
|
264
|
+
| 'method_not_found' // Class exists but no such method
|
|
265
|
+
| 'external_dependency' // From node_modules
|
|
266
|
+
| 'circular_reference' // Alias chain too deep
|
|
267
|
+
| 'builtin_method' // Built-in prototype method (not an error)
|
|
268
|
+
| 'unknown'; // Catch-all
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* StrictModeFailure - thrown when strict mode stops analysis due to fatal errors.
|
|
272
|
+
*
|
|
273
|
+
* Unlike other errors, this carries a reference to the fatal diagnostic(s)
|
|
274
|
+
* rather than duplicating the message. The CLI formats output from
|
|
275
|
+
* the diagnostic, not from error.message.
|
|
276
|
+
*
|
|
277
|
+
* This prevents the duplication issue where both error.message and
|
|
278
|
+
* DiagnosticReporter show the same error (REG-332).
|
|
279
|
+
*/
|
|
280
|
+
export class StrictModeFailure extends Error {
|
|
281
|
+
/** The fatal diagnostics that caused the failure */
|
|
282
|
+
readonly diagnostics: Diagnostic[];
|
|
283
|
+
/** Error count for summary */
|
|
284
|
+
readonly count: number;
|
|
285
|
+
/** REG-332: Number of errors suppressed by grafema-ignore comments */
|
|
286
|
+
readonly suppressedCount: number;
|
|
287
|
+
|
|
288
|
+
constructor(diagnostics: Diagnostic[], suppressedCount: number = 0) {
|
|
289
|
+
// Keep message minimal - CLI will format from diagnostics
|
|
290
|
+
super(`Strict mode: ${diagnostics.length} unresolved reference(s) found`);
|
|
291
|
+
this.name = 'StrictModeFailure';
|
|
292
|
+
this.diagnostics = diagnostics;
|
|
293
|
+
this.count = diagnostics.length;
|
|
294
|
+
this.suppressedCount = suppressedCount;
|
|
295
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
296
|
+
}
|
|
297
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,21 +13,39 @@ export {
|
|
|
13
13
|
AnalysisError,
|
|
14
14
|
ValidationError,
|
|
15
15
|
StrictModeError,
|
|
16
|
+
StrictModeFailure,
|
|
17
|
+
} from './errors/GrafemaError.js';
|
|
18
|
+
export type {
|
|
19
|
+
ErrorContext,
|
|
20
|
+
GrafemaErrorJSON,
|
|
21
|
+
ResolutionStep,
|
|
22
|
+
ResolutionFailureReason,
|
|
16
23
|
} from './errors/GrafemaError.js';
|
|
17
|
-
export type { ErrorContext, GrafemaErrorJSON } from './errors/GrafemaError.js';
|
|
18
24
|
|
|
19
25
|
// Logging
|
|
20
|
-
export {
|
|
21
|
-
export type { LogLevel } from './logging/Logger.js';
|
|
26
|
+
export { ConsoleLogger, FileLogger, MultiLogger, createLogger } from './logging/Logger.js';
|
|
27
|
+
export type { Logger, LogLevel } from './logging/Logger.js';
|
|
22
28
|
|
|
23
29
|
// Diagnostics
|
|
24
30
|
export { DiagnosticCollector, DiagnosticReporter, DiagnosticWriter } from './diagnostics/index.js';
|
|
25
31
|
export type { Diagnostic, DiagnosticInput, ReportOptions, SummaryStats } from './diagnostics/index.js';
|
|
32
|
+
// Diagnostic categories (single source of truth)
|
|
33
|
+
export { DIAGNOSTIC_CATEGORIES, CODE_TO_CATEGORY, getCategoryForCode, getCodesForCategory } from './diagnostics/index.js';
|
|
34
|
+
export type { DiagnosticCategory, DiagnosticCategoryKey, CodeCategoryInfo } from './diagnostics/index.js';
|
|
26
35
|
|
|
27
36
|
// Config
|
|
28
|
-
export {
|
|
37
|
+
export {
|
|
38
|
+
loadConfig,
|
|
39
|
+
DEFAULT_CONFIG,
|
|
40
|
+
validateServices,
|
|
41
|
+
validatePatterns,
|
|
42
|
+
validateWorkspace,
|
|
43
|
+
} from './config/index.js';
|
|
29
44
|
export type { GrafemaConfig } from './config/index.js';
|
|
30
45
|
|
|
46
|
+
// Instructions (for AI agents)
|
|
47
|
+
export { getOnboardingInstruction } from './instructions/index.js';
|
|
48
|
+
|
|
31
49
|
// Main orchestrator
|
|
32
50
|
export { Orchestrator } from './Orchestrator.js';
|
|
33
51
|
export type {
|
|
@@ -52,8 +70,6 @@ export type { Node, Edge, EdgeType, AttrQuery, GraphStats, GraphExport } from '.
|
|
|
52
70
|
// RFDB
|
|
53
71
|
export { RFDBClient } from '@grafema/rfdb-client';
|
|
54
72
|
export { RFDBServerBackend } from './storage/backends/RFDBServerBackend.js';
|
|
55
|
-
export { findRfdbBinary, getPlatformDir, getBinaryNotFoundMessage } from './utils/findRfdbBinary.js';
|
|
56
|
-
export type { FindBinaryOptions } from './utils/findRfdbBinary.js';
|
|
57
73
|
|
|
58
74
|
// Core utilities
|
|
59
75
|
export { NodeFactory } from './core/NodeFactory.js';
|
|
@@ -76,6 +92,8 @@ export { AnalysisQueue } from './core/AnalysisQueue.js';
|
|
|
76
92
|
export { ASTWorkerPool, type ModuleInfo as ASTModuleInfo, type ParseResult, type ASTWorkerPoolStats } from './core/ASTWorkerPool.js';
|
|
77
93
|
export { GuaranteeManager } from './core/GuaranteeManager.js';
|
|
78
94
|
export type { GuaranteeGraph } from './core/GuaranteeManager.js';
|
|
95
|
+
export { toposort, CycleError } from './core/toposort.js';
|
|
96
|
+
export type { ToposortItem } from './core/toposort.js';
|
|
79
97
|
export { clearFileNodesIfNeeded, clearServiceNodeIfExists } from './core/FileNodeManager.js';
|
|
80
98
|
export { CoverageAnalyzer } from './core/CoverageAnalyzer.js';
|
|
81
99
|
export type { CoverageResult } from './core/CoverageAnalyzer.js';
|
|
@@ -85,6 +103,16 @@ export type { FileExplainResult, EnhancedNode } from './core/FileExplainer.js';
|
|
|
85
103
|
// Hash utilities
|
|
86
104
|
export { calculateFileHash, calculateFileHashAsync, calculateContentHash } from './core/HashUtils.js';
|
|
87
105
|
|
|
106
|
+
// Module resolution utilities (REG-320)
|
|
107
|
+
export {
|
|
108
|
+
resolveModulePath,
|
|
109
|
+
isRelativeImport,
|
|
110
|
+
resolveRelativeSpecifier,
|
|
111
|
+
DEFAULT_EXTENSIONS,
|
|
112
|
+
DEFAULT_INDEX_FILES
|
|
113
|
+
} from './utils/moduleResolution.js';
|
|
114
|
+
export type { ModuleResolutionOptions } from './utils/moduleResolution.js';
|
|
115
|
+
|
|
88
116
|
// Type validation and path validation
|
|
89
117
|
export {
|
|
90
118
|
levenshtein,
|
|
@@ -111,11 +139,25 @@ export { GuaranteeAPI } from './api/GuaranteeAPI.js';
|
|
|
111
139
|
export type { GuaranteeGraphBackend } from './api/GuaranteeAPI.js';
|
|
112
140
|
|
|
113
141
|
// Node kinds
|
|
114
|
-
export { isGuaranteeType } from './core/nodes/NodeKind.js';
|
|
142
|
+
export { isGuaranteeType, isGrafemaType } from './core/nodes/NodeKind.js';
|
|
115
143
|
|
|
116
144
|
// Issue nodes (detected problems)
|
|
117
145
|
export { IssueNode, type IssueNodeRecord, type IssueSeverity, type IssueType } from './core/nodes/IssueNode.js';
|
|
118
146
|
|
|
147
|
+
// Plugin nodes (self-describing pipeline)
|
|
148
|
+
export { PluginNode } from './core/nodes/PluginNode.js';
|
|
149
|
+
export type { PluginNodeRecord, PluginNodeOptions } from './core/nodes/PluginNode.js';
|
|
150
|
+
|
|
151
|
+
// Guarantee nodes (contract-based)
|
|
152
|
+
export { GuaranteeNode } from './core/nodes/GuaranteeNode.js';
|
|
153
|
+
export type {
|
|
154
|
+
GuaranteeNodeRecord,
|
|
155
|
+
GuaranteeNodeOptions,
|
|
156
|
+
GuaranteePriority,
|
|
157
|
+
GuaranteeStatus,
|
|
158
|
+
GuaranteeType,
|
|
159
|
+
} from './core/nodes/GuaranteeNode.js';
|
|
160
|
+
|
|
119
161
|
// Node contracts
|
|
120
162
|
export { FunctionNode } from './core/nodes/FunctionNode.js';
|
|
121
163
|
export { CallSiteNode } from './core/nodes/CallSiteNode.js';
|
|
@@ -188,7 +230,8 @@ export { SystemDbAnalyzer } from './plugins/analysis/SystemDbAnalyzer.js';
|
|
|
188
230
|
export { IncrementalAnalysisPlugin } from './plugins/analysis/IncrementalAnalysisPlugin.js';
|
|
189
231
|
|
|
190
232
|
// Enrichment plugins
|
|
191
|
-
export { MethodCallResolver } from './plugins/enrichment/MethodCallResolver.js';
|
|
233
|
+
export { MethodCallResolver, LIBRARY_SEMANTIC_GROUPS } from './plugins/enrichment/MethodCallResolver.js';
|
|
234
|
+
export type { LibraryCallStats } from './plugins/enrichment/MethodCallResolver.js';
|
|
192
235
|
export { ArgumentParameterLinker } from './plugins/enrichment/ArgumentParameterLinker.js';
|
|
193
236
|
export { AliasTracker } from './plugins/enrichment/AliasTracker.js';
|
|
194
237
|
export { ValueDomainAnalyzer } from './plugins/enrichment/ValueDomainAnalyzer.js';
|
|
@@ -202,6 +245,8 @@ export { RustFFIEnricher } from './plugins/enrichment/RustFFIEnricher.js';
|
|
|
202
245
|
export { NodejsBuiltinsResolver } from './plugins/enrichment/NodejsBuiltinsResolver.js';
|
|
203
246
|
export { ExternalCallResolver } from './plugins/enrichment/ExternalCallResolver.js';
|
|
204
247
|
export { ClosureCaptureEnricher } from './plugins/enrichment/ClosureCaptureEnricher.js';
|
|
248
|
+
export { ExpressHandlerLinker } from './plugins/enrichment/ExpressHandlerLinker.js';
|
|
249
|
+
export { RejectionPropagationEnricher } from './plugins/enrichment/RejectionPropagationEnricher.js';
|
|
205
250
|
|
|
206
251
|
// Builtin registry
|
|
207
252
|
export { BuiltinRegistry } from './data/builtins/index.js';
|
|
@@ -218,7 +263,6 @@ export { ShadowingDetector } from './plugins/validation/ShadowingDetector.js';
|
|
|
218
263
|
export { GraphConnectivityValidator } from './plugins/validation/GraphConnectivityValidator.js';
|
|
219
264
|
export { DataFlowValidator } from './plugins/validation/DataFlowValidator.js';
|
|
220
265
|
export { TypeScriptDeadCodeValidator } from './plugins/validation/TypeScriptDeadCodeValidator.js';
|
|
221
|
-
export { NodeCreationValidator } from './plugins/validation/NodeCreationValidator.js';
|
|
222
266
|
export { BrokenImportValidator } from './plugins/validation/BrokenImportValidator.js';
|
|
223
267
|
|
|
224
268
|
// Discovery plugins
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grafema instruction documents for AI agents.
|
|
3
|
+
*
|
|
4
|
+
* Instructions are markdown documents that guide agent behavior.
|
|
5
|
+
* They are read at runtime from the installed package.
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync } from 'fs';
|
|
8
|
+
import { join, dirname } from 'path';
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get the onboarding instruction document.
|
|
15
|
+
*
|
|
16
|
+
* Returns the full markdown text of the onboarding procedure
|
|
17
|
+
* that guides an AI agent through project study and configuration.
|
|
18
|
+
*/
|
|
19
|
+
export function getOnboardingInstruction(): string {
|
|
20
|
+
return readFileSync(join(__dirname, 'onboarding.md'), 'utf-8');
|
|
21
|
+
}
|