cgraphx 2.0.2 → 2.0.3
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/core/code/engine/cli/analyze-config.js +320 -0
- package/dist/core/code/engine/cli/analyze.js +1086 -0
- package/dist/core/code/engine/cli/cli-message.js +83 -0
- package/dist/core/code/engine/cli/detect-changes-format.js +58 -0
- package/dist/core/code/engine/cli/embedding-dims.js +43 -0
- package/dist/core/code/engine/cli/format-elapsed.js +12 -0
- package/dist/core/code/engine/cli/help-i18n.js +144 -0
- package/dist/core/code/engine/cli/i18n/en.js +110 -0
- package/dist/core/code/engine/cli/i18n/index.js +47 -0
- package/dist/core/code/engine/cli/i18n/resources.js +9 -0
- package/dist/core/code/engine/cli/i18n/zh-CN.js +110 -0
- package/dist/core/code/engine/cli/lazy-action.js +67 -0
- package/dist/core/code/engine/cli/optional-grammars.js +136 -0
- package/dist/core/code/engine/cli/resolve-invocation.js +76 -0
- package/dist/core/code/engine/cli/status.js +156 -0
- package/dist/core/code/engine/cli/tool.js +384 -0
- package/dist/core/code/engine/config/ignore-service.js +511 -0
- package/dist/core/code/engine/config/supported-languages.js +17 -0
- package/dist/core/code/engine/core/analysis-features.js +64 -0
- package/dist/core/code/engine/core/analyzer-identity.js +2171 -0
- package/dist/core/code/engine/core/git-staleness.js +180 -0
- package/dist/core/code/engine/core/graph/graph.js +180 -0
- package/dist/core/code/engine/core/graph/import-cycles.js +106 -0
- package/dist/core/code/engine/core/graph/types.js +2 -0
- package/dist/core/code/engine/core/index-freshness.js +12 -0
- package/dist/core/code/engine/core/ingestion/binding-accumulator.js +341 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/c-cpp.js +168 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/csharp.js +9 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/dart.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/go.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/jvm.js +54 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/php.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/python.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/ruby.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/rust.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/swift.js +8 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/configs/typescript-javascript.js +11 -0
- package/dist/core/code/engine/core/ingestion/call-extractors/generic.js +62 -0
- package/dist/core/code/engine/core/ingestion/call-processor.js +503 -0
- package/dist/core/code/engine/core/ingestion/call-routing.js +98 -0
- package/dist/core/code/engine/core/ingestion/call-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/cfg/callee-cell-format.js +45 -0
- package/dist/core/code/engine/core/ingestion/cfg/cfg-builder.js +202 -0
- package/dist/core/code/engine/core/ingestion/cfg/collect.js +81 -0
- package/dist/core/code/engine/core/ingestion/cfg/control-dependence.js +185 -0
- package/dist/core/code/engine/core/ingestion/cfg/control-flow-context.js +130 -0
- package/dist/core/code/engine/core/ingestion/cfg/emit.js +646 -0
- package/dist/core/code/engine/core/ingestion/cfg/post-dominators.js +182 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-def-reason-codec.js +139 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-defs-graph.js +322 -0
- package/dist/core/code/engine/core/ingestion/cfg/reaching-defs.js +792 -0
- package/dist/core/code/engine/core/ingestion/cfg/synthetic-escape.js +305 -0
- package/dist/core/code/engine/core/ingestion/cfg/traversal-result.js +6 -0
- package/dist/core/code/engine/core/ingestion/cfg/types.js +14 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/c-cpp-harvest.js +545 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/c-cpp.js +590 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/call-site-harvest.js +356 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/csharp-harvest.js +593 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/csharp.js +871 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/dart-harvest.js +874 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/dart.js +840 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/go-harvest.js +625 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/go.js +642 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/java-harvest.js +517 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/java.js +816 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/kotlin-harvest.js +723 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/kotlin.js +813 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/php-harvest.js +630 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/php.js +725 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/python-harvest.js +776 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/python.js +562 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/ruby-harvest.js +591 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/ruby.js +760 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/rust-harvest.js +877 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/rust.js +562 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/scope-tree-harvest.js +120 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/swift-harvest.js +683 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/swift.js +791 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/typescript-harvest.js +1060 -0
- package/dist/core/code/engine/core/ingestion/cfg/visitors/typescript.js +587 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/c-cpp.js +77 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/csharp.js +24 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/dart.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/go.js +28 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/jvm.js +67 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/php.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/python.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/ruby.js +13 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/rust.js +10 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/swift.js +21 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/configs/typescript-javascript.js +31 -0
- package/dist/core/code/engine/core/ingestion/class-extractors/generic.js +144 -0
- package/dist/core/code/engine/core/ingestion/class-types.js +2 -0
- package/dist/core/code/engine/core/ingestion/cluster-enricher.js +174 -0
- package/dist/core/code/engine/core/ingestion/community-processor.js +604 -0
- package/dist/core/code/engine/core/ingestion/constants.js +26 -0
- package/dist/core/code/engine/core/ingestion/cpp-ue-preprocessor.js +263 -0
- package/dist/core/code/engine/core/ingestion/csharp-namespace-gate.js +133 -0
- package/dist/core/code/engine/core/ingestion/di-extractors/index.js +38 -0
- package/dist/core/code/engine/core/ingestion/di-extractors/spring.js +310 -0
- package/dist/core/code/engine/core/ingestion/emit-references.js +244 -0
- package/dist/core/code/engine/core/ingestion/entry-point-scoring.js +201 -0
- package/dist/core/code/engine/core/ingestion/export-detection.js +244 -0
- package/dist/core/code/engine/core/ingestion/field-extractor.js +29 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/c-cpp.js +107 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/csharp.js +124 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/dart.js +99 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/go.js +102 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/helpers.js +198 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/jvm.js +172 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/php.js +67 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/python.js +94 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/ruby.js +79 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/rust.js +55 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/swift.js +93 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/configs/typescript-javascript.js +59 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/generic.js +147 -0
- package/dist/core/code/engine/core/ingestion/field-extractors/typescript.js +266 -0
- package/dist/core/code/engine/core/ingestion/field-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/filesystem-walker.js +136 -0
- package/dist/core/code/engine/core/ingestion/finalize-orchestrator.js +159 -0
- package/dist/core/code/engine/core/ingestion/framework-detection.js +432 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/analysis-features.js +38 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/annotation-arguments.js +234 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/aop-candidates.js +88 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/aop.js +487 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/auto-configuration.js +21 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-candidates.js +189 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-catalog.js +32 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-factories.js +73 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/conditionals.js +323 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/config-bindings.js +119 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/di-metadata.js +385 -0
- package/dist/core/code/engine/core/ingestion/frameworks/spring/resource-injection.js +96 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/c-cpp.js +17 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/csharp.js +46 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/dart.js +59 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/go.js +30 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/jvm.js +73 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/php.js +19 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/python.js +45 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/ruby.js +20 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/rust.js +58 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/swift.js +94 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/configs/typescript-javascript.js +26 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/csharp.js +128 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/go.js +50 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/jvm.js +112 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/php.js +80 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/python.js +75 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/resolver-factory.js +36 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/ruby.js +20 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/rust.js +79 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/standard.js +180 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/types.js +7 -0
- package/dist/core/code/engine/core/ingestion/import-resolvers/utils.js +153 -0
- package/dist/core/code/engine/core/ingestion/import-target-adapter.js +99 -0
- package/dist/core/code/engine/core/ingestion/language-config.js +391 -0
- package/dist/core/code/engine/core/ingestion/language-provider.js +25 -0
- package/dist/core/code/engine/core/ingestion/languages/c/arity-metadata.js +98 -0
- package/dist/core/code/engine/core/ingestion/languages/c/arity.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/c/capture-side-channel.js +69 -0
- package/dist/core/code/engine/core/ingestion/languages/c/captures.js +189 -0
- package/dist/core/code/engine/core/ingestion/languages/c/header-scan.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/c/import-decomposer.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/c/import-target.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/c/index.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/c/interpret.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/c/merge-bindings.js +26 -0
- package/dist/core/code/engine/core/ingestion/languages/c/query.js +210 -0
- package/dist/core/code/engine/core/ingestion/languages/c/scope-resolver.js +112 -0
- package/dist/core/code/engine/core/ingestion/languages/c/simple-hooks.js +24 -0
- package/dist/core/code/engine/core/ingestion/languages/c/static-linkage.js +109 -0
- package/dist/core/code/engine/core/ingestion/languages/c-cpp.js +506 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/adl.js +804 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/arity-metadata.js +258 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/arity.js +37 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/capture-side-channel.js +89 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/captures.js +1975 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/constraint-extractor.js +311 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/constraint-filter.js +210 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/conversion-rank.js +163 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/file-local-linkage.js +327 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/header-scan.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/import-decomposer.js +134 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/import-target.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/index.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/inline-namespaces.js +379 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/interpret.js +239 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/member-lookup.js +470 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/merge-bindings.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/query.js +763 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/range-bindings.js +230 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/scope-resolver.js +354 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/simple-hooks.js +67 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/two-phase-lookup.js +348 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/type-classifier.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/cpp/user-defined-conversions.js +128 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/accessor-unwrap.js +67 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/arity-metadata.js +49 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/arity.js +40 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/captures.js +557 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/import-decomposer.js +96 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/import-target.js +176 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/index.js +95 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/interpret.js +150 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/merge-bindings.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/namespace-siblings.js +708 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/qualified-type-names.js +62 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/query.js +578 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/receiver-binding.js +142 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/resolution-config.js +18 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/scope-resolver.js +84 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp/simple-hooks.js +81 -0
- package/dist/core/code/engine/core/ingestion/languages/csharp.js +204 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/arity-metadata.js +38 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/arity.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/built-ins.js +37 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/cache-stats.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/captures.js +1096 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/expand-wildcards.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/extension-type-preprocess.js +33 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/import-target.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/index.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/interpret.js +101 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/merge-bindings.js +42 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/query.js +246 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/receiver-binding.js +90 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/scope-resolver.js +197 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/signature-bindings.js +54 -0
- package/dist/core/code/engine/core/ingestion/languages/dart/simple-hooks.js +61 -0
- package/dist/core/code/engine/core/ingestion/languages/dart.js +138 -0
- package/dist/core/code/engine/core/ingestion/languages/go/arity-metadata.js +71 -0
- package/dist/core/code/engine/core/ingestion/languages/go/arity.js +17 -0
- package/dist/core/code/engine/core/ingestion/languages/go/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/go/captures.js +492 -0
- package/dist/core/code/engine/core/ingestion/languages/go/expand-wildcards.js +97 -0
- package/dist/core/code/engine/core/ingestion/languages/go/generic-type-parameters.js +146 -0
- package/dist/core/code/engine/core/ingestion/languages/go/import-decomposer.js +47 -0
- package/dist/core/code/engine/core/ingestion/languages/go/import-target.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/go/index.js +39 -0
- package/dist/core/code/engine/core/ingestion/languages/go/interface-impls.js +955 -0
- package/dist/core/code/engine/core/ingestion/languages/go/interpret.js +177 -0
- package/dist/core/code/engine/core/ingestion/languages/go/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/go/method-owners.js +131 -0
- package/dist/core/code/engine/core/ingestion/languages/go/namespace-mirror.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/go/package-clause.js +79 -0
- package/dist/core/code/engine/core/ingestion/languages/go/package-siblings.js +83 -0
- package/dist/core/code/engine/core/ingestion/languages/go/query.js +298 -0
- package/dist/core/code/engine/core/ingestion/languages/go/range-binding.js +127 -0
- package/dist/core/code/engine/core/ingestion/languages/go/receiver-binding.js +24 -0
- package/dist/core/code/engine/core/ingestion/languages/go/scope-resolver.js +75 -0
- package/dist/core/code/engine/core/ingestion/languages/go/simple-hooks.js +31 -0
- package/dist/core/code/engine/core/ingestion/languages/go/type-binding.js +279 -0
- package/dist/core/code/engine/core/ingestion/languages/go.js +160 -0
- package/dist/core/code/engine/core/ingestion/languages/index.js +66 -0
- package/dist/core/code/engine/core/ingestion/languages/java/analysis-features.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/java/arity-metadata.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/arity.js +27 -0
- package/dist/core/code/engine/core/ingestion/languages/java/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/java/capture-side-channel.js +123 -0
- package/dist/core/code/engine/core/ingestion/languages/java/captures.js +791 -0
- package/dist/core/code/engine/core/ingestion/languages/java/import-decomposer.js +88 -0
- package/dist/core/code/engine/core/ingestion/languages/java/import-target.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/java/index.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/interpret.js +146 -0
- package/dist/core/code/engine/core/ingestion/languages/java/merge-bindings.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/java/package-facts.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/java/package-siblings.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/java/query.js +319 -0
- package/dist/core/code/engine/core/ingestion/languages/java/receiver-binding.js +98 -0
- package/dist/core/code/engine/core/ingestion/languages/java/scope-resolver.js +213 -0
- package/dist/core/code/engine/core/ingestion/languages/java/simple-hooks.js +39 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-aop.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-bean-metadata.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-conditionals.js +52 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-config-bindings.js +222 -0
- package/dist/core/code/engine/core/ingestion/languages/java/spring-di.js +165 -0
- package/dist/core/code/engine/core/ingestion/languages/java.js +192 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/arity.js +15 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/captures.js +1122 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/import-target.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/index.js +109 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/interpret.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/query.js +659 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/scope-resolver.js +78 -0
- package/dist/core/code/engine/core/ingestion/languages/javascript/simple-hooks.js +44 -0
- package/dist/core/code/engine/core/ingestion/languages/jvm/package-facts.js +46 -0
- package/dist/core/code/engine/core/ingestion/languages/jvm/package-siblings.js +200 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/arity-metadata.js +23 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/arity.js +18 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/capture-side-channel.js +160 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/captures.js +1262 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/companion-scopes.js +72 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/import-decomposer.js +40 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/import-target.js +135 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/index.js +26 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/interpret.js +75 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/merge-bindings.js +28 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/owners.js +134 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/package-facts.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/package-siblings.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/query.js +243 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/receiver-binding.js +103 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/scope-resolver.js +207 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/simple-hooks.js +42 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-aop.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-bean-metadata.js +11 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-conditionals.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-di.js +304 -0
- package/dist/core/code/engine/core/ingestion/languages/kotlin.js +189 -0
- package/dist/core/code/engine/core/ingestion/languages/php/arity-metadata.js +66 -0
- package/dist/core/code/engine/core/ingestion/languages/php/arity.js +43 -0
- package/dist/core/code/engine/core/ingestion/languages/php/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/php/captures.js +1166 -0
- package/dist/core/code/engine/core/ingestion/languages/php/import-decomposer.js +238 -0
- package/dist/core/code/engine/core/ingestion/languages/php/import-target.js +213 -0
- package/dist/core/code/engine/core/ingestion/languages/php/index.js +85 -0
- package/dist/core/code/engine/core/ingestion/languages/php/interpret.js +256 -0
- package/dist/core/code/engine/core/ingestion/languages/php/merge-bindings.js +50 -0
- package/dist/core/code/engine/core/ingestion/languages/php/namespace-siblings.js +353 -0
- package/dist/core/code/engine/core/ingestion/languages/php/query.js +391 -0
- package/dist/core/code/engine/core/ingestion/languages/php/receiver-binding.js +135 -0
- package/dist/core/code/engine/core/ingestion/languages/php/scope-resolver.js +361 -0
- package/dist/core/code/engine/core/ingestion/languages/php/simple-hooks.js +116 -0
- package/dist/core/code/engine/core/ingestion/languages/php.js +302 -0
- package/dist/core/code/engine/core/ingestion/languages/python/arity-metadata.js +49 -0
- package/dist/core/code/engine/core/ingestion/languages/python/arity.js +41 -0
- package/dist/core/code/engine/core/ingestion/languages/python/cache-stats.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/python/captures.js +299 -0
- package/dist/core/code/engine/core/ingestion/languages/python/depends-references.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/python/import-decomposer.js +115 -0
- package/dist/core/code/engine/core/ingestion/languages/python/import-target.js +440 -0
- package/dist/core/code/engine/core/ingestion/languages/python/index-stats.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/python/index.js +96 -0
- package/dist/core/code/engine/core/ingestion/languages/python/interpret.js +430 -0
- package/dist/core/code/engine/core/ingestion/languages/python/merge-bindings.js +47 -0
- package/dist/core/code/engine/core/ingestion/languages/python/query.js +323 -0
- package/dist/core/code/engine/core/ingestion/languages/python/receiver-binding.js +310 -0
- package/dist/core/code/engine/core/ingestion/languages/python/scope-resolver.js +80 -0
- package/dist/core/code/engine/core/ingestion/languages/python/simple-hooks.js +53 -0
- package/dist/core/code/engine/core/ingestion/languages/python.js +140 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/arity.js +41 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/captures.js +864 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/import-target.js +88 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/index.js +29 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/interpret.js +115 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/query.js +349 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/receiver-binding.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/scope-resolver.js +263 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby/simple-hooks.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/ruby.js +215 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/arity.js +16 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/cache-stats.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/captures.js +304 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/import-decomposer.js +167 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/import-target.js +108 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/index.js +29 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/interpret.js +201 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/merge-bindings.js +21 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/method-owners.js +76 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/module-path.js +222 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/qualified-call.js +482 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/query.js +280 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/range-binding.js +687 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/receiver-binding.js +148 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/scope-resolver.js +151 -0
- package/dist/core/code/engine/core/ingestion/languages/rust/simple-hooks.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/rust.js +183 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/arity-metadata.js +44 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/arity.js +45 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/base-type.js +30 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/cache-stats.js +32 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/captures.js +594 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/conditional-directive-preprocess.js +256 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/implicit-imports.js +60 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/import-decomposer.js +87 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/import-target.js +84 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/index.js +56 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/interpret.js +93 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/merge-bindings.js +51 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/query.js +226 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/receiver-binding.js +169 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/scope-resolver.js +192 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/sibling-type-bindings.js +68 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/signature-bindings.js +69 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/simple-hooks.js +65 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/target-grouping.js +97 -0
- package/dist/core/code/engine/core/ingestion/languages/swift/target-siblings.js +74 -0
- package/dist/core/code/engine/core/ingestion/languages/swift.js +246 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/arity-metadata.js +106 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/arity.js +57 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/array-callback.js +58 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cache-stats.js +34 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/captures.js +956 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cjs-export-assignment.js +535 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/cjs-module-exports.js +196 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/import-decomposer.js +374 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/import-target.js +65 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/index.js +108 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/interpret.js +344 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/merge-bindings.js +161 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/nuxt-auto-imports.js +325 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/query.js +1328 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/receiver-binding.js +201 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/scope-resolver.js +293 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript/simple-hooks.js +139 -0
- package/dist/core/code/engine/core/ingestion/languages/typescript.js +455 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/captures.js +70 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/import-target.js +61 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/index.js +55 -0
- package/dist/core/code/engine/core/ingestion/languages/vue/scope-resolver.js +295 -0
- package/dist/core/code/engine/core/ingestion/languages/vue.js +96 -0
- package/dist/core/code/engine/core/ingestion/local-symbol-pruner.js +68 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/c-cpp.js +387 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/csharp.js +290 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/dart.js +392 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/go.js +179 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/jvm.js +350 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/php.js +306 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/python.js +312 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/ruby.js +289 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/rust.js +198 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/swift.js +286 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/configs/typescript-javascript.js +341 -0
- package/dist/core/code/engine/core/ingestion/method-extractors/generic.js +209 -0
- package/dist/core/code/engine/core/ingestion/method-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/model/field-registry.js +41 -0
- package/dist/core/code/engine/core/ingestion/model/index.js +52 -0
- package/dist/core/code/engine/core/ingestion/model/method-registry.js +138 -0
- package/dist/core/code/engine/core/ingestion/model/owned-members-lookup.js +46 -0
- package/dist/core/code/engine/core/ingestion/model/registration-table.js +234 -0
- package/dist/core/code/engine/core/ingestion/model/resolve.js +183 -0
- package/dist/core/code/engine/core/ingestion/model/scope-resolution-indexes.js +43 -0
- package/dist/core/code/engine/core/ingestion/model/semantic-model.js +179 -0
- package/dist/core/code/engine/core/ingestion/model/symbol-table.js +216 -0
- package/dist/core/code/engine/core/ingestion/model/type-registry.js +84 -0
- package/dist/core/code/engine/core/ingestion/mro-processor.js +709 -0
- package/dist/core/code/engine/core/ingestion/parsing-processor.js +312 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/communities.js +69 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/cross-file.js +71 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/di.js +338 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/http-api-calls.js +312 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/index.js +54 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/mro.js +40 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/orm.js +78 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/parse-impl.js +1286 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/parse.js +41 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/processes.js +193 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/prune-local-symbols.js +29 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/registry.js +52 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/routes.js +409 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/rpc-edges.js +301 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/runner.js +207 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/scan.js +49 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-aop.js +442 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-auto-configuration.js +264 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-config.js +440 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/structure.js +38 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/tools.js +89 -0
- package/dist/core/code/engine/core/ingestion/pipeline-phases/types.js +40 -0
- package/dist/core/code/engine/core/ingestion/pipeline.js +152 -0
- package/dist/core/code/engine/core/ingestion/process-processor.js +325 -0
- package/dist/core/code/engine/core/ingestion/resolve-references.js +205 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/constant-resolver.js +135 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/django-root-discovery.js +221 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/django.js +428 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/expo.js +39 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/fastapi-router-bindings.js +264 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/laravel.js +501 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/middleware.js +175 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/nextjs.js +81 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/php.js +25 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/python-const-resolver.js +307 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/response-shapes.js +299 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/route-path.js +71 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/spring-shared.js +310 -0
- package/dist/core/code/engine/core/ingestion/route-extractors/spring.js +441 -0
- package/dist/core/code/engine/core/ingestion/scope-extractor-bridge.js +60 -0
- package/dist/core/code/engine/core/ingestion/scope-extractor.js +1373 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/contract/scope-resolver.js +282 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/callee-id-sink.js +72 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/edges.js +194 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/ids.js +472 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.js +49 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +43 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +274 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +93 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/callable-value-flow.js +1240 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/compound-receiver.js +1174 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/free-call-fallback.js +873 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/imported-return-types.js +226 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/mro.js +107 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/overload-narrowing.js +441 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/property-dispatch.js +122 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1720 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/phase.js +395 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +208 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/registry.js +49 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/run.js +632 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +112 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/resolution-outcome.js +41 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/scope/namespace-targets.js +81 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/scope/walkers.js +1835 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/unresolved-receivers.js +242 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/utils/definition-id.js +22 -0
- package/dist/core/code/engine/core/ingestion/scope-resolution/workspace-index.js +151 -0
- package/dist/core/code/engine/core/ingestion/structure-processor.js +40 -0
- package/dist/core/code/engine/core/ingestion/tree-sitter-queries.js +2244 -0
- package/dist/core/code/engine/core/ingestion/ts-js-hoc-utils.js +115 -0
- package/dist/core/code/engine/core/ingestion/type-env.js +1136 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/c-cpp.js +555 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/csharp.js +570 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/dart.js +372 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/go.js +508 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/jvm.js +875 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/php.js +537 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/python.js +477 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/ruby.js +380 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/rust.js +502 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/shared.js +843 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/swift.js +490 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/types.js +2 -0
- package/dist/core/code/engine/core/ingestion/type-extractors/typescript.js +690 -0
- package/dist/core/code/engine/core/ingestion/utils/ast-helpers.js +1693 -0
- package/dist/core/code/engine/core/ingestion/utils/call-analysis.js +779 -0
- package/dist/core/code/engine/core/ingestion/utils/callable-flow-captures.js +932 -0
- package/dist/core/code/engine/core/ingestion/utils/callable-labels.js +49 -0
- package/dist/core/code/engine/core/ingestion/utils/deferred-resolution-profile.js +151 -0
- package/dist/core/code/engine/core/ingestion/utils/effective-ram.js +67 -0
- package/dist/core/code/engine/core/ingestion/utils/env.js +60 -0
- package/dist/core/code/engine/core/ingestion/utils/event-loop.js +9 -0
- package/dist/core/code/engine/core/ingestion/utils/graph-sort.js +103 -0
- package/dist/core/code/engine/core/ingestion/utils/heap-probe.js +45 -0
- package/dist/core/code/engine/core/ingestion/utils/heritage-marker.js +47 -0
- package/dist/core/code/engine/core/ingestion/utils/line-base.js +24 -0
- package/dist/core/code/engine/core/ingestion/utils/max-file-size.js +59 -0
- package/dist/core/code/engine/core/ingestion/utils/method-props.js +198 -0
- package/dist/core/code/engine/core/ingestion/utils/qualified-name.js +73 -0
- package/dist/core/code/engine/core/ingestion/utils/receiver-chain-captures.js +60 -0
- package/dist/core/code/engine/core/ingestion/utils/receiver-chain-codec.js +188 -0
- package/dist/core/code/engine/core/ingestion/utils/scope-tree-walk.js +36 -0
- package/dist/core/code/engine/core/ingestion/utils/symbol-labels.js +48 -0
- package/dist/core/code/engine/core/ingestion/utils/template-arguments.js +187 -0
- package/dist/core/code/engine/core/ingestion/utils/type-parameters.js +209 -0
- package/dist/core/code/engine/core/ingestion/utils/verbose.js +6 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/c-cpp.js +133 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/csharp.js +66 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/dart.js +111 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/go.js +153 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/jvm.js +145 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/php.js +61 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/python.js +104 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/ruby.js +55 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/rust.js +79 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/swift.js +91 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/configs/typescript-javascript.js +86 -0
- package/dist/core/code/engine/core/ingestion/variable-extractors/generic.js +111 -0
- package/dist/core/code/engine/core/ingestion/variable-types.js +3 -0
- package/dist/core/code/engine/core/ingestion/vue-sfc-extractor.js +544 -0
- package/dist/core/code/engine/core/ingestion/workers/callable-id.js +122 -0
- package/dist/core/code/engine/core/ingestion/workers/clone-safety.js +470 -0
- package/dist/core/code/engine/core/ingestion/workers/parse-worker.js +2456 -0
- package/dist/core/code/engine/core/ingestion/workers/post-result.js +90 -0
- package/dist/core/code/engine/core/ingestion/workers/quarantine.js +41 -0
- package/dist/core/code/engine/core/ingestion/workers/result-merge.js +59 -0
- package/dist/core/code/engine/core/ingestion/workers/worker-pool.js +1725 -0
- package/dist/core/code/engine/core/ingestion/workspace-config.js +139 -0
- package/dist/core/code/engine/core/lbug/conn-lock.js +72 -0
- package/dist/core/code/engine/core/lbug/csv-generator.js +710 -0
- package/dist/core/code/engine/core/lbug/cypher-escape.js +24 -0
- package/dist/core/code/engine/core/lbug/extension-load-error.js +339 -0
- package/dist/core/code/engine/core/lbug/extension-loader.js +261 -0
- package/dist/core/code/engine/core/lbug/graph-emit-sink.js +584 -0
- package/dist/core/code/engine/core/lbug/lbug-adapter.js +2703 -0
- package/dist/core/code/engine/core/lbug/lbug-config.js +1029 -0
- package/dist/core/code/engine/core/lbug/native-check.js +435 -0
- package/dist/core/code/engine/core/lbug/pool-adapter.js +973 -0
- package/dist/core/code/engine/core/lbug/query-params.js +25 -0
- package/dist/core/code/engine/core/lbug/query-result-utils.js +31 -0
- package/dist/core/code/engine/core/lbug/rel-pair-routing.js +373 -0
- package/dist/core/code/engine/core/lbug/schema.js +771 -0
- package/dist/core/code/engine/core/lbug/shutdown-helpers.js +40 -0
- package/dist/core/code/engine/core/lbug/sidecar-recovery.js +716 -0
- package/dist/core/code/engine/core/lbug/stdio-capture.js +49 -0
- package/dist/core/code/engine/core/lbug/sync-csv-writer.js +115 -0
- package/dist/core/code/engine/core/lbug/wal-checkpoint-driver.js +215 -0
- package/dist/core/code/engine/core/lbug/wal-driver-state.js +28 -0
- package/dist/core/code/engine/core/logger.js +339 -0
- package/dist/core/code/engine/core/platform/capabilities.js +91 -0
- package/dist/core/code/engine/core/run-analyze.js +1098 -0
- package/dist/core/code/engine/core/tree-sitter/parser-loader.js +281 -0
- package/dist/core/code/engine/core/tree-sitter/safe-parse.js +258 -0
- package/dist/core/code/engine/core/tree-sitter/vendored-grammars.js +64 -0
- package/dist/core/code/engine/lib/utils.js +121 -0
- package/dist/core/code/engine/mcp/core/lbug-adapter.js +27 -0
- package/dist/core/code/engine/mcp/local/aop-metadata.js +230 -0
- package/dist/core/code/engine/mcp/local/bean-metadata.js +49 -0
- package/dist/core/code/engine/mcp/local/limits.js +15 -0
- package/dist/core/code/engine/mcp/local/line-display.js +6 -0
- package/dist/core/code/engine/mcp/local/local-backend.js +4142 -0
- package/dist/core/code/engine/storage/branch-index.js +72 -0
- package/dist/core/code/engine/storage/file-hash.js +95 -0
- package/dist/core/code/engine/storage/fs-atomic.js +34 -0
- package/dist/core/code/engine/storage/git.js +555 -0
- package/dist/core/code/engine/storage/index-lock.js +664 -0
- package/dist/core/code/engine/storage/parse-cache.js +650 -0
- package/dist/core/code/engine/storage/parsedfile-store.js +620 -0
- package/dist/core/code/engine/storage/repo-manager.js +1061 -0
- package/dist/core/code/engine/storage/scope-index-store.js +247 -0
- package/dist/core/code/engine/types/pipeline.js +2 -0
- package/dist/core/code/scripts/install-duckdb-extension.mjs +125 -0
- package/dist/core/code/scripts/resolve-analyze-cmd.cjs +346 -0
- package/dist/core/code/shared/graph/types.js +8 -0
- package/dist/core/code/shared/index.js +105 -0
- package/dist/core/code/shared/integrations/circuit-breaker.js +242 -0
- package/dist/core/code/shared/integrations/resilient-fetch.js +224 -0
- package/dist/core/code/shared/integrations/retry.js +70 -0
- package/dist/core/code/shared/integrations/understand-quickly.js +145 -0
- package/dist/core/code/shared/language-detection.js +162 -0
- package/dist/core/code/shared/languages.js +27 -0
- package/dist/core/code/shared/lbug/schema-constants.js +98 -0
- package/dist/core/code/shared/mro-strategy.js +2 -0
- package/dist/core/code/shared/pipeline.js +5 -0
- package/dist/core/code/shared/scope-resolution/callable-flow-site.js +11 -0
- package/dist/core/code/shared/scope-resolution/def-index.js +53 -0
- package/dist/core/code/shared/scope-resolution/evidence-weights.js +87 -0
- package/dist/core/code/shared/scope-resolution/finalize-algorithm.js +807 -0
- package/dist/core/code/shared/scope-resolution/language-classification.js +46 -0
- package/dist/core/code/shared/scope-resolution/method-dispatch-index.js +100 -0
- package/dist/core/code/shared/scope-resolution/module-scope-index.js +59 -0
- package/dist/core/code/shared/scope-resolution/origin-priority.js +23 -0
- package/dist/core/code/shared/scope-resolution/parsed-file.js +54 -0
- package/dist/core/code/shared/scope-resolution/position-index.js +136 -0
- package/dist/core/code/shared/scope-resolution/qualified-name-index.js +77 -0
- package/dist/core/code/shared/scope-resolution/reference-site.js +24 -0
- package/dist/core/code/shared/scope-resolution/registries/class-registry.js +32 -0
- package/dist/core/code/shared/scope-resolution/registries/context.js +52 -0
- package/dist/core/code/shared/scope-resolution/registries/evidence.js +152 -0
- package/dist/core/code/shared/scope-resolution/registries/field-registry.js +33 -0
- package/dist/core/code/shared/scope-resolution/registries/lookup-core.js +392 -0
- package/dist/core/code/shared/scope-resolution/registries/lookup-qualified.js +58 -0
- package/dist/core/code/shared/scope-resolution/registries/macro-registry.js +34 -0
- package/dist/core/code/shared/scope-resolution/registries/method-registry.js +34 -0
- package/dist/core/code/shared/scope-resolution/registries/tie-breaks.js +63 -0
- package/dist/core/code/shared/scope-resolution/resolve-type-ref.js +128 -0
- package/dist/core/code/shared/scope-resolution/scope-id.js +49 -0
- package/dist/core/code/shared/scope-resolution/scope-tree.js +225 -0
- package/dist/core/code/shared/scope-resolution/symbol-definition.js +12 -0
- package/dist/core/code/shared/scope-resolution/types.js +25 -0
- package/dist/core/code/shared/test-helpers.js +17 -0
- package/dist/core/code/vendor/leiden/index.cjs +355 -0
- package/dist/core/code/vendor/leiden/utils.cjs +419 -0
- package/dist/core/timeline/cli.d.ts.map +1 -1
- package/dist/core/timeline/cli.js +13 -6
- package/dist/core/timeline/cli.js.map +1 -1
- package/dist/core/timeline/debris.d.ts +20 -0
- package/dist/core/timeline/debris.d.ts.map +1 -0
- package/dist/core/timeline/debris.js +124 -0
- package/dist/core/timeline/debris.js.map +1 -0
- package/dist/core/timeline/hook-runner.d.ts.map +1 -1
- package/dist/core/timeline/hook-runner.js +3 -1
- package/dist/core/timeline/hook-runner.js.map +1 -1
- package/dist/core/timeline/hooks.d.ts.map +1 -1
- package/dist/core/timeline/hooks.js +13 -5
- package/dist/core/timeline/hooks.js.map +1 -1
- package/dist/core/timeline/installer.d.ts +2 -0
- package/dist/core/timeline/installer.d.ts.map +1 -1
- package/dist/core/timeline/installer.js +12 -0
- package/dist/core/timeline/installer.js.map +1 -1
- package/dist/core/timeline/project-root.d.ts +21 -0
- package/dist/core/timeline/project-root.d.ts.map +1 -0
- package/dist/core/timeline/project-root.js +83 -0
- package/dist/core/timeline/project-root.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,771 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LadybugDB Schema Definitions
|
|
4
|
+
*
|
|
5
|
+
* Hybrid Schema:
|
|
6
|
+
* - Separate node tables for each code element type (File, Function, Class, etc.)
|
|
7
|
+
* - Single CodeRelation table with 'type' property for all relationships
|
|
8
|
+
*
|
|
9
|
+
* This allows LLMs to write natural Cypher queries like:
|
|
10
|
+
* MATCH (f:Function)-[r:CodeRelation {type: 'CALLS'}]->(g:Function) RETURN f, g
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.isSchemaFingerprintShaped = exports.schemaFingerprintMismatch = exports.SCHEMA_FINGERPRINT = exports.SCHEMA_QUERIES = exports.REL_SCHEMA_QUERIES = exports.NODE_SCHEMA_QUERIES = exports.CREATE_VECTOR_INDEX_QUERY = exports.EMBEDDING_SCHEMA = exports.STALE_HASH_SENTINEL = exports.EMBEDDING_INDEX_NAME = exports.EMBEDDING_DIMS = exports.RELATION_SCHEMA = exports.STRUCTURAL_PAIR_DDL = exports.EXTERNAL_SERVICE_SCHEMA = exports.BASICBLOCK_SCHEMA = exports.SECTION_SCHEMA = exports.TOOL_SCHEMA = exports.ROUTE_SCHEMA = exports.MODULE_SCHEMA = exports.TEMPLATE_SCHEMA = exports.CONSTRUCTOR_SCHEMA = exports.ANNOTATION_SCHEMA = exports.DELEGATE_SCHEMA = exports.RECORD_SCHEMA = exports.PROPERTY_SCHEMA = exports.VARIABLE_SCHEMA = exports.STATIC_SCHEMA = exports.CONST_SCHEMA = exports.TYPE_ALIAS_SCHEMA = exports.IMPL_SCHEMA = exports.TRAIT_SCHEMA = exports.NAMESPACE_SCHEMA = exports.UNION_SCHEMA = exports.TYPEDEF_SCHEMA = exports.MACRO_SCHEMA = exports.ENUM_SCHEMA = exports.STRUCT_SCHEMA = exports.PROCESS_SCHEMA = exports.COMMUNITY_SCHEMA = exports.CODE_ELEMENT_SCHEMA = exports.METHOD_SCHEMA = exports.INTERFACE_SCHEMA = exports.CLASS_SCHEMA = exports.FUNCTION_SCHEMA = exports.FOLDER_SCHEMA = exports.FILE_SCHEMA = exports.EMBEDDING_TABLE_NAME = exports.REL_TYPES = exports.REL_TABLE_NAME = exports.NODE_TABLES = void 0;
|
|
14
|
+
exports.embeddingDimsMismatch = void 0;
|
|
15
|
+
const crypto_1 = require("crypto");
|
|
16
|
+
// Import from shared package (single source of truth) — used in DDL templates below
|
|
17
|
+
const index_js_1 = require("../../../shared/index.js");
|
|
18
|
+
Object.defineProperty(exports, "NODE_TABLES", { enumerable: true, get: function () { return index_js_1.NODE_TABLES; } });
|
|
19
|
+
Object.defineProperty(exports, "REL_TABLE_NAME", { enumerable: true, get: function () { return index_js_1.REL_TABLE_NAME; } });
|
|
20
|
+
Object.defineProperty(exports, "REL_TYPES", { enumerable: true, get: function () { return index_js_1.REL_TYPES; } });
|
|
21
|
+
Object.defineProperty(exports, "EMBEDDING_TABLE_NAME", { enumerable: true, get: function () { return index_js_1.EMBEDDING_TABLE_NAME; } });
|
|
22
|
+
const rel_pair_routing_js_1 = require("./rel-pair-routing.js");
|
|
23
|
+
const node_lookup_js_1 = require("../ingestion/scope-resolution/graph-bridge/node-lookup.js");
|
|
24
|
+
const symbol_table_js_1 = require("../ingestion/model/symbol-table.js");
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// NODE TABLE SCHEMAS
|
|
27
|
+
// ============================================================================
|
|
28
|
+
exports.FILE_SCHEMA = `
|
|
29
|
+
CREATE NODE TABLE File (
|
|
30
|
+
id STRING,
|
|
31
|
+
name STRING,
|
|
32
|
+
filePath STRING,
|
|
33
|
+
content STRING,
|
|
34
|
+
PRIMARY KEY (id)
|
|
35
|
+
)`;
|
|
36
|
+
exports.FOLDER_SCHEMA = `
|
|
37
|
+
CREATE NODE TABLE Folder (
|
|
38
|
+
id STRING,
|
|
39
|
+
name STRING,
|
|
40
|
+
filePath STRING,
|
|
41
|
+
PRIMARY KEY (id)
|
|
42
|
+
)`;
|
|
43
|
+
exports.FUNCTION_SCHEMA = `
|
|
44
|
+
CREATE NODE TABLE Function (
|
|
45
|
+
id STRING,
|
|
46
|
+
name STRING,
|
|
47
|
+
filePath STRING,
|
|
48
|
+
startLine INT64,
|
|
49
|
+
endLine INT64,
|
|
50
|
+
isExported BOOLEAN,
|
|
51
|
+
content STRING,
|
|
52
|
+
description STRING,
|
|
53
|
+
PRIMARY KEY (id)
|
|
54
|
+
)`;
|
|
55
|
+
exports.CLASS_SCHEMA = `
|
|
56
|
+
CREATE NODE TABLE Class (
|
|
57
|
+
id STRING,
|
|
58
|
+
name STRING,
|
|
59
|
+
filePath STRING,
|
|
60
|
+
startLine INT64,
|
|
61
|
+
endLine INT64,
|
|
62
|
+
isExported BOOLEAN,
|
|
63
|
+
content STRING,
|
|
64
|
+
description STRING,
|
|
65
|
+
frameworkAnnotations STRING[],
|
|
66
|
+
PRIMARY KEY (id)
|
|
67
|
+
)`;
|
|
68
|
+
exports.INTERFACE_SCHEMA = `
|
|
69
|
+
CREATE NODE TABLE Interface (
|
|
70
|
+
id STRING,
|
|
71
|
+
name STRING,
|
|
72
|
+
filePath STRING,
|
|
73
|
+
startLine INT64,
|
|
74
|
+
endLine INT64,
|
|
75
|
+
isExported BOOLEAN,
|
|
76
|
+
content STRING,
|
|
77
|
+
description STRING,
|
|
78
|
+
PRIMARY KEY (id)
|
|
79
|
+
)`;
|
|
80
|
+
exports.METHOD_SCHEMA = `
|
|
81
|
+
CREATE NODE TABLE Method (
|
|
82
|
+
id STRING,
|
|
83
|
+
name STRING,
|
|
84
|
+
filePath STRING,
|
|
85
|
+
startLine INT64,
|
|
86
|
+
endLine INT64,
|
|
87
|
+
isExported BOOLEAN,
|
|
88
|
+
content STRING,
|
|
89
|
+
description STRING,
|
|
90
|
+
parameterCount INT32,
|
|
91
|
+
returnType STRING,
|
|
92
|
+
PRIMARY KEY (id)
|
|
93
|
+
)`;
|
|
94
|
+
exports.CODE_ELEMENT_SCHEMA = `
|
|
95
|
+
CREATE NODE TABLE CodeElement (
|
|
96
|
+
id STRING,
|
|
97
|
+
name STRING,
|
|
98
|
+
filePath STRING,
|
|
99
|
+
startLine INT64,
|
|
100
|
+
endLine INT64,
|
|
101
|
+
isExported BOOLEAN,
|
|
102
|
+
content STRING,
|
|
103
|
+
description STRING,
|
|
104
|
+
PRIMARY KEY (id)
|
|
105
|
+
)`;
|
|
106
|
+
// ============================================================================
|
|
107
|
+
// COMMUNITY NODE TABLE (for Leiden algorithm clusters)
|
|
108
|
+
// ============================================================================
|
|
109
|
+
exports.COMMUNITY_SCHEMA = `
|
|
110
|
+
CREATE NODE TABLE Community (
|
|
111
|
+
id STRING,
|
|
112
|
+
label STRING,
|
|
113
|
+
heuristicLabel STRING,
|
|
114
|
+
keywords STRING[],
|
|
115
|
+
description STRING,
|
|
116
|
+
enrichedBy STRING,
|
|
117
|
+
cohesion DOUBLE,
|
|
118
|
+
symbolCount INT32,
|
|
119
|
+
PRIMARY KEY (id)
|
|
120
|
+
)`;
|
|
121
|
+
// ============================================================================
|
|
122
|
+
// PROCESS NODE TABLE (for execution flow detection)
|
|
123
|
+
// ============================================================================
|
|
124
|
+
exports.PROCESS_SCHEMA = `
|
|
125
|
+
CREATE NODE TABLE Process (
|
|
126
|
+
id STRING,
|
|
127
|
+
label STRING,
|
|
128
|
+
heuristicLabel STRING,
|
|
129
|
+
processType STRING,
|
|
130
|
+
stepCount INT32,
|
|
131
|
+
communities STRING[],
|
|
132
|
+
entryPointId STRING,
|
|
133
|
+
terminalId STRING,
|
|
134
|
+
PRIMARY KEY (id)
|
|
135
|
+
)`;
|
|
136
|
+
// ============================================================================
|
|
137
|
+
// MULTI-LANGUAGE NODE TABLE SCHEMAS
|
|
138
|
+
// ============================================================================
|
|
139
|
+
// Generic code element with startLine/endLine for C, C++, Rust, Go, Java, C#
|
|
140
|
+
// description: optional metadata (e.g. Eloquent $fillable fields, relationship targets)
|
|
141
|
+
const CODE_ELEMENT_BASE = (name) => `
|
|
142
|
+
CREATE NODE TABLE \`${name}\` (
|
|
143
|
+
id STRING,
|
|
144
|
+
name STRING,
|
|
145
|
+
filePath STRING,
|
|
146
|
+
startLine INT64,
|
|
147
|
+
endLine INT64,
|
|
148
|
+
content STRING,
|
|
149
|
+
description STRING,
|
|
150
|
+
PRIMARY KEY (id)
|
|
151
|
+
)`;
|
|
152
|
+
exports.STRUCT_SCHEMA = CODE_ELEMENT_BASE('Struct');
|
|
153
|
+
exports.ENUM_SCHEMA = CODE_ELEMENT_BASE('Enum');
|
|
154
|
+
exports.MACRO_SCHEMA = CODE_ELEMENT_BASE('Macro');
|
|
155
|
+
exports.TYPEDEF_SCHEMA = CODE_ELEMENT_BASE('Typedef');
|
|
156
|
+
exports.UNION_SCHEMA = CODE_ELEMENT_BASE('Union');
|
|
157
|
+
exports.NAMESPACE_SCHEMA = CODE_ELEMENT_BASE('Namespace');
|
|
158
|
+
exports.TRAIT_SCHEMA = CODE_ELEMENT_BASE('Trait');
|
|
159
|
+
exports.IMPL_SCHEMA = CODE_ELEMENT_BASE('Impl');
|
|
160
|
+
exports.TYPE_ALIAS_SCHEMA = CODE_ELEMENT_BASE('TypeAlias');
|
|
161
|
+
exports.CONST_SCHEMA = CODE_ELEMENT_BASE('Const');
|
|
162
|
+
exports.STATIC_SCHEMA = CODE_ELEMENT_BASE('Static');
|
|
163
|
+
exports.VARIABLE_SCHEMA = CODE_ELEMENT_BASE('Variable');
|
|
164
|
+
exports.PROPERTY_SCHEMA = `
|
|
165
|
+
CREATE NODE TABLE \`Property\` (
|
|
166
|
+
id STRING,
|
|
167
|
+
name STRING,
|
|
168
|
+
filePath STRING,
|
|
169
|
+
startLine INT64,
|
|
170
|
+
endLine INT64,
|
|
171
|
+
content STRING,
|
|
172
|
+
description STRING,
|
|
173
|
+
declaredType STRING,
|
|
174
|
+
PRIMARY KEY (id)
|
|
175
|
+
)`;
|
|
176
|
+
exports.RECORD_SCHEMA = CODE_ELEMENT_BASE('Record');
|
|
177
|
+
exports.DELEGATE_SCHEMA = CODE_ELEMENT_BASE('Delegate');
|
|
178
|
+
exports.ANNOTATION_SCHEMA = CODE_ELEMENT_BASE('Annotation');
|
|
179
|
+
exports.CONSTRUCTOR_SCHEMA = CODE_ELEMENT_BASE('Constructor');
|
|
180
|
+
exports.TEMPLATE_SCHEMA = CODE_ELEMENT_BASE('Template');
|
|
181
|
+
exports.MODULE_SCHEMA = CODE_ELEMENT_BASE('Module');
|
|
182
|
+
// API route endpoints (Next.js, Express, etc.)
|
|
183
|
+
exports.ROUTE_SCHEMA = `
|
|
184
|
+
CREATE NODE TABLE Route (
|
|
185
|
+
id STRING,
|
|
186
|
+
name STRING,
|
|
187
|
+
filePath STRING,
|
|
188
|
+
responseKeys STRING[],
|
|
189
|
+
errorKeys STRING[],
|
|
190
|
+
middleware STRING[],
|
|
191
|
+
method STRING,
|
|
192
|
+
handlerSymbolId STRING,
|
|
193
|
+
PRIMARY KEY (id)
|
|
194
|
+
)`;
|
|
195
|
+
// MCP tool definitions
|
|
196
|
+
exports.TOOL_SCHEMA = `
|
|
197
|
+
CREATE NODE TABLE Tool (
|
|
198
|
+
id STRING,
|
|
199
|
+
name STRING,
|
|
200
|
+
filePath STRING,
|
|
201
|
+
description STRING,
|
|
202
|
+
PRIMARY KEY (id)
|
|
203
|
+
)`;
|
|
204
|
+
// Markdown heading sections
|
|
205
|
+
exports.SECTION_SCHEMA = `
|
|
206
|
+
CREATE NODE TABLE Section (
|
|
207
|
+
id STRING,
|
|
208
|
+
name STRING,
|
|
209
|
+
filePath STRING,
|
|
210
|
+
startLine INT64,
|
|
211
|
+
endLine INT64,
|
|
212
|
+
level INT64,
|
|
213
|
+
content STRING,
|
|
214
|
+
description STRING,
|
|
215
|
+
PRIMARY KEY (id)
|
|
216
|
+
)`;
|
|
217
|
+
// Taint/PDG substrate (issue #2080) — intra-procedural control-flow node.
|
|
218
|
+
// Emitted by no phase yet; M1 (#2081) populates these behind an opt-in.
|
|
219
|
+
// REACHING_DEF carries its variable name in the relation's existing `reason`
|
|
220
|
+
// column (see RELATION_SCHEMA) — LadybugDB has no secondary index on rel
|
|
221
|
+
// properties, so a dedicated indexed column would buy nothing for the
|
|
222
|
+
// variable-filtered path query (M0/S1 verdict). No `name` column: blocks are
|
|
223
|
+
// identified by id + source span, not a symbol name.
|
|
224
|
+
exports.BASICBLOCK_SCHEMA = `
|
|
225
|
+
CREATE NODE TABLE BasicBlock (
|
|
226
|
+
id STRING,
|
|
227
|
+
filePath STRING,
|
|
228
|
+
startLine INT64,
|
|
229
|
+
endLine INT64,
|
|
230
|
+
text STRING,
|
|
231
|
+
callees STRING,
|
|
232
|
+
calleeIds STRING,
|
|
233
|
+
PRIMARY KEY (id)
|
|
234
|
+
)`;
|
|
235
|
+
// Synthetic external RPC service node (spec §6.1 single-side case). Minted by
|
|
236
|
+
// the rpc-edges / http-api-calls phases (registered in T-11) when only one side
|
|
237
|
+
// of a cross-service contract is reachable, so RCALLS / HTTP_CALLS edges always
|
|
238
|
+
// resolve and impact can trace the external dependency. Columns follow the
|
|
239
|
+
// generic code-element shape so the default `getCopyQuery` fallback (no
|
|
240
|
+
// per-table branch needed in lbug-adapter) and the filePath-bearing table
|
|
241
|
+
// filters in deleteNodesForFile both apply unchanged.
|
|
242
|
+
exports.EXTERNAL_SERVICE_SCHEMA = `
|
|
243
|
+
CREATE NODE TABLE ExternalService (
|
|
244
|
+
id STRING,
|
|
245
|
+
name STRING,
|
|
246
|
+
filePath STRING,
|
|
247
|
+
startLine INT64,
|
|
248
|
+
endLine INT64,
|
|
249
|
+
content STRING,
|
|
250
|
+
description STRING,
|
|
251
|
+
PRIMARY KEY (id)
|
|
252
|
+
)`;
|
|
253
|
+
// ============================================================================
|
|
254
|
+
// RELATION TABLE SCHEMA
|
|
255
|
+
// Single table with 'type' property - connects all node tables
|
|
256
|
+
// ============================================================================
|
|
257
|
+
/**
|
|
258
|
+
* Labels the scope-resolution graph bridge can put on the SOURCE side of a
|
|
259
|
+
* CALLS / ACCESSES / USES / EXTENDS edge: everything `buildGraphNodeLookup`
|
|
260
|
+
* registers (`LINKABLE_LABELS`), plus the `File` node `resolveCallerGraphId`
|
|
261
|
+
* falls back to for a module-level call site.
|
|
262
|
+
*
|
|
263
|
+
* Imported from the ingestion layer, NOT re-listed here: a hand-copied twin is
|
|
264
|
+
* pure drift risk, since a label added to it (or dropped from the original) is
|
|
265
|
+
* invisible to every guard. `csv-generator.ts` and `lbug-adapter.ts`, both
|
|
266
|
+
* siblings in this directory, already import from `../ingestion/`.
|
|
267
|
+
*
|
|
268
|
+
* The cost is that importing this module pulls five ingestion modules into the
|
|
269
|
+
* runtime closure. `cgraph-web` does not depend on this package at all (only
|
|
270
|
+
* on `cgraph-shared`), so nothing here reaches a browser bundle. The MCP
|
|
271
|
+
* server still pays it, though: `local-backend.ts` no longer imports this
|
|
272
|
+
* module directly (its two embedding constants come from `cgraph-shared`),
|
|
273
|
+
* but pool-adapter -> lbug-adapter -> csv-generator reaches it anyway.
|
|
274
|
+
*/
|
|
275
|
+
const SCOPE_BRIDGE_SOURCE_LABELS = ['File', ...node_lookup_js_1.LINKABLE_LABELS];
|
|
276
|
+
/**
|
|
277
|
+
* Labels the bridge can put on the TARGET side: `LINKABLE_LABELS` again (every
|
|
278
|
+
* `resolveDefGraphId` hit), plus `CALL_TARGET_TYPES` —
|
|
279
|
+
* `tryEmitEdgeWithExplicitTargetId` bypasses the lookup and emits such a def's
|
|
280
|
+
* own node id, and C# `Delegate` is in that set without being linkable.
|
|
281
|
+
*
|
|
282
|
+
* Both sets are `NodeLabel`-typed rather than `NodeTableName`-typed because
|
|
283
|
+
* that is what the originals carry, and `NodeLabel` is the wider union — it
|
|
284
|
+
* admits five labels with no node table (`Project`, `Package`, `Decorator`,
|
|
285
|
+
* `Import`, `Type`). A label from that gap would emit DDL naming a table that
|
|
286
|
+
* does not exist, so `test/unit/schema-pair-coverage.test.ts` asserts every
|
|
287
|
+
* declared endpoint against `NODE_TABLES`. The hand-written sets below take the
|
|
288
|
+
* narrower `NodeTableName` constraint, where a typo is the actual risk.
|
|
289
|
+
*/
|
|
290
|
+
const SCOPE_BRIDGE_TARGET_LABELS = new Set([
|
|
291
|
+
...node_lookup_js_1.LINKABLE_LABELS,
|
|
292
|
+
...symbol_table_js_1.CALL_TARGET_TYPES,
|
|
293
|
+
]);
|
|
294
|
+
/**
|
|
295
|
+
* Node tables that are NOT definitions.
|
|
296
|
+
*
|
|
297
|
+
* - `Community` / `Process` are analysis overlays synthesized after ingestion;
|
|
298
|
+
* nothing is ever attached to one, they are only attached TO.
|
|
299
|
+
* - `Route` / `Tool` are framework overlays. They do source exactly two edges
|
|
300
|
+
* — `ENTRY_POINT_OF` to a `Process` (`pipeline-phases/processes.ts`) — but
|
|
301
|
+
* that emitter hard-codes both labels as literals in one file rather than
|
|
302
|
+
* resolving an anchor through a lookup, so those two pairs stay in
|
|
303
|
+
* {@link STRUCTURAL_PAIR_DDL}. Admitting them as anchors would mint twelve
|
|
304
|
+
* further pairs (`Route→Annotation`, `Tool→Record`, …) no emitter can reach.
|
|
305
|
+
* - `Folder` is a filesystem container (`Folder→Folder` / `Folder→File` only).
|
|
306
|
+
* - `BasicBlock` is the PDG substrate (`BasicBlock→BasicBlock` only; measured
|
|
307
|
+
* over 300k PDG edges, no other pair is emitted).
|
|
308
|
+
*/
|
|
309
|
+
const NON_DEFINITION_LABELS = [
|
|
310
|
+
'Community',
|
|
311
|
+
'Process',
|
|
312
|
+
'Route',
|
|
313
|
+
'Tool',
|
|
314
|
+
'Folder',
|
|
315
|
+
'BasicBlock',
|
|
316
|
+
// Synthetic external-service node minted by the rpc-edges / http-api-calls
|
|
317
|
+
// phases; never a definition anchor that an overlay hangs off.
|
|
318
|
+
'ExternalService',
|
|
319
|
+
];
|
|
320
|
+
/**
|
|
321
|
+
* Every label a DEFINITION node can carry — derived from `NODE_TABLES` by
|
|
322
|
+
* subtraction so a new node table joins this set automatically and only an
|
|
323
|
+
* explicit entry above can keep it out.
|
|
324
|
+
*/
|
|
325
|
+
const DEFINITION_ANCHOR_LABELS = index_js_1.NODE_TABLES.filter((label) => !NON_DEFINITION_LABELS.includes(label));
|
|
326
|
+
/**
|
|
327
|
+
* Labels whose nodes are minted OUTSIDE the scope-resolution bridge, by a
|
|
328
|
+
* phase or framework emitter, and then hung off whichever definition node that
|
|
329
|
+
* emitter happened to resolve. For most of them the anchor is a LOOKUP RESULT,
|
|
330
|
+
* so its label is not constrained by the emitter — which is exactly why
|
|
331
|
+
* hand-listing these pairs has crashed `analyze` four separate times:
|
|
332
|
+
*
|
|
333
|
+
* | target | emitter | anchor comes from |
|
|
334
|
+
* |--------------|------------------------------------------------|---------------------------------------|
|
|
335
|
+
* | `Annotation` | `frameworks/spring/conditionals.ts` CONDITIONAL_ON | `resolveDefGraphId` / `resolveCallerGraphId` |
|
|
336
|
+
* | `Community` | `pipeline-phases/communities.ts` MEMBER_OF | Leiden membership, `isCommunitySymbol`-gated |
|
|
337
|
+
* | `Process` | `pipeline-phases/processes.ts` STEP_IN_PROCESS | trace step node |
|
|
338
|
+
* | `Route` | `pipeline-phases/routes.ts` HANDLES_ROUTE | `generateId('File', handlerPath)` — a literal |
|
|
339
|
+
* | `Tool` | `pipeline-phases/tools.ts` HANDLES_TOOL | `handlerNodeId` — whatever definition the decorator sat on |
|
|
340
|
+
* | `File` | `languages/vue/scope-resolver.ts` BINDS_EVENT_HANDLER | handler node |
|
|
341
|
+
* | `Record` | `cobol-processor.ts` × 8 external-resource sites | `scopedCallerLookup` |
|
|
342
|
+
*
|
|
343
|
+
* The four reproduced hard-aborts are one cell of this table each:
|
|
344
|
+
* `Method→Annotation` (Spring `@Bean` + `@ConditionalOnMissingBean`),
|
|
345
|
+
* `Method→File` (Vue Options-API handler), `Namespace→Record` (COBOL
|
|
346
|
+
* `DECLARATIVES`), `Class→Tool` (`@mcp.tool()` on a class). Declaring
|
|
347
|
+
* {@link DEFINITION_ANCHOR_LABELS} × this set covers all four plus every
|
|
348
|
+
* sibling the same emitters can reach.
|
|
349
|
+
*
|
|
350
|
+
* TWO TARGETS ARE LABEL-GATED TODAY, and the cross product over-declares for
|
|
351
|
+
* them ON PURPOSE (~47 of the 182 attachment pairs are unreachable right now):
|
|
352
|
+
* - `Community` — `isCommunitySymbol` (`community-processor.ts`) admits only
|
|
353
|
+
* `Function` / `Class` / `Method` / `Interface` as members, so the other 22
|
|
354
|
+
* anchors cannot source a MEMBER_OF edge until that predicate widens.
|
|
355
|
+
* - `Route` — HANDLES_ROUTE sources `generateId('File', handlerPath)`, a
|
|
356
|
+
* literal `File`, so every non-`File` anchor is headroom.
|
|
357
|
+
*
|
|
358
|
+
* Those pairs stay declared because the two sides of the error are not
|
|
359
|
+
* symmetric: an UNDECLARED pair makes LadybugDB reject the edge and aborts
|
|
360
|
+
* `analyze` outright on a user's repo, while an unused DECLARED pair costs
|
|
361
|
+
* almost nothing — `bench/schema-pairs` measured the pre-#2801 332→450 growth
|
|
362
|
+
* (118 pairs, of which these ~47 are a part) at 0.93–1.05×, i.e. inside
|
|
363
|
+
* run-to-run noise. #2801's 11 generated `Record` pairs bring the total to 461.
|
|
364
|
+
* Its Windows measurements and noise caveats live in the benchmark README; the
|
|
365
|
+
* operational production ceiling is the checked 1.5× budget.
|
|
366
|
+
* Every one of the four aborts above came from re-narrowing a set to what one
|
|
367
|
+
* predicate looked like it allowed — so a reading of `isCommunitySymbol` is not
|
|
368
|
+
* grounds to shrink this. Widening either predicate is then a no-op here.
|
|
369
|
+
*
|
|
370
|
+
* `Route` / `Tool` being excluded as ANCHORS (see {@link NON_DEFINITION_LABELS})
|
|
371
|
+
* is likewise a SIZE choice, not something derived from a rule: they do source
|
|
372
|
+
* `ENTRY_POINT_OF`, and admitting them would mint twelve further pairs no
|
|
373
|
+
* emitter can currently reach.
|
|
374
|
+
*
|
|
375
|
+
* Sized deliberately: this rule plus the `Record` bridge brings the DDL to 461
|
|
376
|
+
* pairs. `bench/schema-pairs` measures real `@ladybugdb/core` with identical
|
|
377
|
+
* data — untyped-endpoint anchored queries
|
|
378
|
+
* (`MATCH (a {id: $id})-[r:CodeRelation]->(b)`, the shape `impact` / `context` /
|
|
379
|
+
* `detect_changes` issue), relative to the 332-pair hand-list it replaced.
|
|
380
|
+
* Keep the historical reference-box and current Windows measurements separate:
|
|
381
|
+
*
|
|
382
|
+
* reference box: 450 → 0.93–1.05× 641 → 1.22–1.43× 1024 → 2.03–2.34×
|
|
383
|
+
* Windows: 461 → 1.20–1.42× across three comparable runs
|
|
384
|
+
*
|
|
385
|
+
* Those rows are not a cross-machine ordering. The current operational claim is
|
|
386
|
+
* only that 461 remains below its 1.5× production budget. The historical
|
|
387
|
+
* same-box 450→641 comparison still shows the cost of the deferred third cross
|
|
388
|
+
* product, so the containment half below stays hand-declared. Re-run all
|
|
389
|
+
* candidate sizes on one box and quote the range before proposing that rule.
|
|
390
|
+
*/
|
|
391
|
+
const ATTACHMENT_TARGET_LABELS = [
|
|
392
|
+
'Annotation',
|
|
393
|
+
'Community',
|
|
394
|
+
'Process',
|
|
395
|
+
'Route',
|
|
396
|
+
'Tool',
|
|
397
|
+
'File',
|
|
398
|
+
'Record',
|
|
399
|
+
];
|
|
400
|
+
/**
|
|
401
|
+
* The 69 pairs NEITHER rule above generates — everything left after the two
|
|
402
|
+
* cross products are subtracted. Carried by CONTAINMENT, inheritance, imports
|
|
403
|
+
* and DI: a container label crossed with a contained label. No predicate
|
|
404
|
+
* describes that surface (any container can hold any definition).
|
|
405
|
+
*
|
|
406
|
+
* What survives here is characteristic, not arbitrary. Almost all of it is a
|
|
407
|
+
* TARGET no rule reaches — `CodeElement`, `Impl`, `Namespace`, `Template`,
|
|
408
|
+
* `TypeAlias`, `Typedef`, `Union`, `Static`, `Section`, `Folder` are in neither
|
|
409
|
+
* `SCOPE_BRIDGE_TARGET_LABELS` nor {@link ATTACHMENT_TARGET_LABELS} — plus the
|
|
410
|
+
* `Impl|*` and `Template|*` member rows (Rust `impl`/`trait` bodies, C++
|
|
411
|
+
* templates), the two `Route|Process` / `Tool|Process` entry points whose
|
|
412
|
+
* emitter names both labels as literals, and `BasicBlock|BasicBlock`, the PDG
|
|
413
|
+
* substrate.
|
|
414
|
+
*
|
|
415
|
+
* NOTHING A RULE ALREADY COVERS BELONGS HERE. `generatedRelationPairs` skips
|
|
416
|
+
* any pair present in this block, so a redundant line does not merely duplicate
|
|
417
|
+
* — it SUPPRESSES generation, and later narrowing a rule would silently keep
|
|
418
|
+
* that pair alive with no test failing. 164 such lines now live in the generated
|
|
419
|
+
* half (161 from #2793 plus the three `Record` member pairs moved by #2801);
|
|
420
|
+
* `test/unit/schema-pair-coverage.test.ts` now fails if one comes back.
|
|
421
|
+
*
|
|
422
|
+
* Folding this remainder into a third cross product
|
|
423
|
+
* (`DEFINITION_ANCHOR_LABELS × {CodeElement, Section, Typedef, Union,
|
|
424
|
+
* Namespace, Impl, TypeAlias, Static, Template}`) would take the table to 641
|
|
425
|
+
* pairs and leave only ~29 lines here. `bench/schema-pairs` measures 641 at
|
|
426
|
+
* 1.22–1.43× on the historical reference box; current production's 461 pairs
|
|
427
|
+
* remain below their 1.5× Windows budget. Those cross-machine values are not an
|
|
428
|
+
* ordering, so any proposal must remeasure both sizes on one box. Until then,
|
|
429
|
+
* the rule stays deferred rather than trading ~40 lines for unmeasured query cost.
|
|
430
|
+
*
|
|
431
|
+
* Exported so `test/unit/schema-pair-coverage.test.ts` can subtract it and
|
|
432
|
+
* assert the GENERATED region of the DDL for exact equality against the two
|
|
433
|
+
* rules, rather than one-directional containment.
|
|
434
|
+
* `test/integration/structural-pair-coverage.test.ts` guards this half from a
|
|
435
|
+
* corpus — that is the guard, not this comment.
|
|
436
|
+
*/
|
|
437
|
+
exports.STRUCTURAL_PAIR_DDL = ` FROM File TO Folder,
|
|
438
|
+
FROM File TO CodeElement,
|
|
439
|
+
FROM File TO \`Typedef\`,
|
|
440
|
+
FROM File TO \`Union\`,
|
|
441
|
+
FROM File TO \`Namespace\`,
|
|
442
|
+
FROM File TO \`Impl\`,
|
|
443
|
+
FROM File TO \`TypeAlias\`,
|
|
444
|
+
FROM File TO \`Static\`,
|
|
445
|
+
FROM File TO \`Template\`,
|
|
446
|
+
FROM File TO Section,
|
|
447
|
+
FROM Folder TO Folder,
|
|
448
|
+
FROM Folder TO File,
|
|
449
|
+
FROM Function TO \`Template\`,
|
|
450
|
+
FROM Function TO \`Namespace\`,
|
|
451
|
+
FROM Function TO \`TypeAlias\`,
|
|
452
|
+
FROM Function TO \`Impl\`,
|
|
453
|
+
FROM Function TO \`Typedef\`,
|
|
454
|
+
FROM Function TO \`Union\`,
|
|
455
|
+
FROM Function TO CodeElement,
|
|
456
|
+
FROM Class TO \`Template\`,
|
|
457
|
+
FROM Class TO \`TypeAlias\`,
|
|
458
|
+
FROM Class TO \`Impl\`,
|
|
459
|
+
FROM Class TO \`Union\`,
|
|
460
|
+
FROM Class TO \`Namespace\`,
|
|
461
|
+
FROM Class TO \`Typedef\`,
|
|
462
|
+
FROM Class TO CodeElement,
|
|
463
|
+
FROM Method TO \`Template\`,
|
|
464
|
+
FROM Method TO \`TypeAlias\`,
|
|
465
|
+
FROM Method TO \`Namespace\`,
|
|
466
|
+
FROM Method TO \`Impl\`,
|
|
467
|
+
FROM Method TO CodeElement,
|
|
468
|
+
FROM \`Template\` TO \`Template\`,
|
|
469
|
+
FROM \`Template\` TO Function,
|
|
470
|
+
FROM \`Template\` TO Method,
|
|
471
|
+
FROM \`Template\` TO Class,
|
|
472
|
+
FROM \`Template\` TO \`Struct\`,
|
|
473
|
+
FROM \`Template\` TO \`TypeAlias\`,
|
|
474
|
+
FROM \`Template\` TO \`Enum\`,
|
|
475
|
+
FROM \`Template\` TO \`Macro\`,
|
|
476
|
+
FROM \`Template\` TO Interface,
|
|
477
|
+
FROM \`Template\` TO \`Constructor\`,
|
|
478
|
+
FROM \`Module\` TO CodeElement,
|
|
479
|
+
FROM \`Module\` TO \`Namespace\`,
|
|
480
|
+
FROM \`Namespace\` TO Function,
|
|
481
|
+
FROM CodeElement TO CodeElement,
|
|
482
|
+
FROM CodeElement TO \`Module\`,
|
|
483
|
+
FROM CodeElement TO \`Property\`,
|
|
484
|
+
FROM Section TO Section,
|
|
485
|
+
FROM Interface TO CodeElement,
|
|
486
|
+
FROM Interface TO \`TypeAlias\`,
|
|
487
|
+
FROM \`Enum\` TO \`TypeAlias\`,
|
|
488
|
+
FROM \`Namespace\` TO \`Struct\`,
|
|
489
|
+
FROM \`Impl\` TO Method,
|
|
490
|
+
FROM \`Impl\` TO Function,
|
|
491
|
+
FROM \`Impl\` TO \`Constructor\`,
|
|
492
|
+
FROM \`Impl\` TO \`Property\`,
|
|
493
|
+
FROM \`Impl\` TO \`Trait\`,
|
|
494
|
+
FROM \`Impl\` TO \`Struct\`,
|
|
495
|
+
FROM \`Impl\` TO \`Impl\`,
|
|
496
|
+
FROM \`TypeAlias\` TO \`Trait\`,
|
|
497
|
+
FROM \`TypeAlias\` TO Class,
|
|
498
|
+
FROM \`Constructor\` TO \`Template\`,
|
|
499
|
+
FROM \`Constructor\` TO \`TypeAlias\`,
|
|
500
|
+
FROM \`Constructor\` TO \`Impl\`,
|
|
501
|
+
FROM \`Constructor\` TO \`Namespace\`,
|
|
502
|
+
FROM \`Constructor\` TO \`Typedef\`,
|
|
503
|
+
FROM Route TO Process,
|
|
504
|
+
FROM Tool TO Process,
|
|
505
|
+
FROM BasicBlock TO BasicBlock,
|
|
506
|
+
FROM Method TO ExternalService,
|
|
507
|
+
FROM ExternalService TO Method,
|
|
508
|
+
FROM ExternalService TO ExternalService`;
|
|
509
|
+
/**
|
|
510
|
+
* The generated half of the DDL — one ` FROM \`x\` TO \`y\`` line per pair of
|
|
511
|
+
* the two cross products below.
|
|
512
|
+
*
|
|
513
|
+
* 1. SCOPE BRIDGE — `SCOPE_BRIDGE_SOURCE_LABELS × SCOPE_BRIDGE_TARGET_LABELS`.
|
|
514
|
+
* Those sets ARE the bridge's emit surface: `buildGraphNodeLookup` holds
|
|
515
|
+
* only `LINKABLE_LABELS`, so every id `resolveDefGraphId` returns wears one
|
|
516
|
+
* of those labels (#2792).
|
|
517
|
+
* 2. ATTACHMENT — `DEFINITION_ANCHOR_LABELS × ATTACHMENT_TARGET_LABELS`, the
|
|
518
|
+
* phase/framework overlays hung off a resolved anchor (#2793).
|
|
519
|
+
*
|
|
520
|
+
* Generated rather than hand-listed because in both families the endpoint
|
|
521
|
+
* labels are LOOKUP RESULTS, not literals at the emit site — so any pair drawn
|
|
522
|
+
* from the sets can reach `assertDeclaredPair`, and an undeclared one aborts
|
|
523
|
+
* `analyze` outright on whichever codebase happens to produce it. Every
|
|
524
|
+
* hand-listed fix so far declared only the pair in the stack trace and left the
|
|
525
|
+
* rest of its family missing: `Const→Method` (#2781), `Class→Variable` (#2792),
|
|
526
|
+
* `Interface→CodeElement` (#2416), then `Method→Annotation` / `Method→File` /
|
|
527
|
+
* `Namespace→Record` / `Class→Tool` (#2793) — four more from three different
|
|
528
|
+
* emitters, all live at once.
|
|
529
|
+
*
|
|
530
|
+
* A `Set` guards the emit against a DUPLICATED pair — the asymmetric failure
|
|
531
|
+
* mode `rel-pair-routing.ts` documents at length: a duplicate makes LadybugDB
|
|
532
|
+
* reject `CREATE REL TABLE` and kills EVERY `analyze`, where a missing pair only
|
|
533
|
+
* kills the codebases that emit it. The two target sets are disjoint TODAY, so
|
|
534
|
+
* nothing is deduped in practice; the Set is here so that moving one label
|
|
535
|
+
* between the rules can never cause it. Pairs already in
|
|
536
|
+
* {@link STRUCTURAL_PAIR_DDL} are skipped for the same reason.
|
|
537
|
+
*/
|
|
538
|
+
const generatedPairDdl = () => {
|
|
539
|
+
const structural = (0, rel_pair_routing_js_1.parseRelationSchemaPairs)(exports.STRUCTURAL_PAIR_DDL);
|
|
540
|
+
const seen = new Set();
|
|
541
|
+
const lines = [];
|
|
542
|
+
const add = (from, to) => {
|
|
543
|
+
const pairKey = `${from}|${to}`;
|
|
544
|
+
if (structural.has(pairKey) || seen.has(pairKey))
|
|
545
|
+
return;
|
|
546
|
+
seen.add(pairKey);
|
|
547
|
+
lines.push(` FROM \`${from}\` TO \`${to}\``);
|
|
548
|
+
};
|
|
549
|
+
for (const from of SCOPE_BRIDGE_SOURCE_LABELS) {
|
|
550
|
+
for (const to of SCOPE_BRIDGE_TARGET_LABELS)
|
|
551
|
+
add(from, to);
|
|
552
|
+
}
|
|
553
|
+
for (const from of DEFINITION_ANCHOR_LABELS) {
|
|
554
|
+
for (const to of ATTACHMENT_TARGET_LABELS)
|
|
555
|
+
add(from, to);
|
|
556
|
+
}
|
|
557
|
+
return lines.join(',\n');
|
|
558
|
+
};
|
|
559
|
+
exports.RELATION_SCHEMA = `
|
|
560
|
+
CREATE REL TABLE ${index_js_1.REL_TABLE_NAME} (
|
|
561
|
+
${exports.STRUCTURAL_PAIR_DDL},
|
|
562
|
+
${generatedPairDdl()},
|
|
563
|
+
type STRING,
|
|
564
|
+
confidence DOUBLE,
|
|
565
|
+
reason STRING,
|
|
566
|
+
step INT32
|
|
567
|
+
)`;
|
|
568
|
+
// ============================================================================
|
|
569
|
+
// EMBEDDING TABLE SCHEMA
|
|
570
|
+
// Separate table for vector storage to avoid copy-on-write overhead
|
|
571
|
+
// ============================================================================
|
|
572
|
+
/** Embedding vector dimensions. Default 384 (snowflake-arctic-embed-xs). */
|
|
573
|
+
const _rawDims = parseInt(process.env.CGRAPH_EMBEDDING_DIMS ?? '384', 10);
|
|
574
|
+
if (Number.isNaN(_rawDims) || _rawDims <= 0) {
|
|
575
|
+
throw new Error(`CGRAPH_EMBEDDING_DIMS must be a positive integer, got "${process.env.CGRAPH_EMBEDDING_DIMS}"`);
|
|
576
|
+
}
|
|
577
|
+
exports.EMBEDDING_DIMS = _rawDims;
|
|
578
|
+
/** HNSW vector index name for the CodeEmbedding table. */
|
|
579
|
+
exports.EMBEDDING_INDEX_NAME = 'code_embedding_idx';
|
|
580
|
+
/**
|
|
581
|
+
* Sentinel value for "no content hash available" — used in legacy DBs and null rows.
|
|
582
|
+
* Nodes with this hash are always treated as stale and re-embedded.
|
|
583
|
+
*/
|
|
584
|
+
exports.STALE_HASH_SENTINEL = '';
|
|
585
|
+
exports.EMBEDDING_SCHEMA = `
|
|
586
|
+
CREATE NODE TABLE ${index_js_1.EMBEDDING_TABLE_NAME} (
|
|
587
|
+
id STRING,
|
|
588
|
+
nodeId STRING,
|
|
589
|
+
chunkIndex INT32,
|
|
590
|
+
startLine INT64,
|
|
591
|
+
endLine INT64,
|
|
592
|
+
embedding FLOAT[${exports.EMBEDDING_DIMS}],
|
|
593
|
+
contentHash STRING,
|
|
594
|
+
PRIMARY KEY (id)
|
|
595
|
+
)`;
|
|
596
|
+
/**
|
|
597
|
+
* Create vector index for semantic search
|
|
598
|
+
* Uses HNSW (Hierarchical Navigable Small World) algorithm with cosine similarity
|
|
599
|
+
*/
|
|
600
|
+
exports.CREATE_VECTOR_INDEX_QUERY = `
|
|
601
|
+
CALL CREATE_VECTOR_INDEX('${index_js_1.EMBEDDING_TABLE_NAME}', '${exports.EMBEDDING_INDEX_NAME}', 'embedding', metric := 'cosine')
|
|
602
|
+
`;
|
|
603
|
+
// ============================================================================
|
|
604
|
+
// ALL SCHEMA QUERIES IN ORDER
|
|
605
|
+
// Node tables must be created before relationship tables that reference them
|
|
606
|
+
// ============================================================================
|
|
607
|
+
exports.NODE_SCHEMA_QUERIES = [
|
|
608
|
+
exports.FILE_SCHEMA,
|
|
609
|
+
exports.FOLDER_SCHEMA,
|
|
610
|
+
exports.FUNCTION_SCHEMA,
|
|
611
|
+
exports.CLASS_SCHEMA,
|
|
612
|
+
exports.INTERFACE_SCHEMA,
|
|
613
|
+
exports.METHOD_SCHEMA,
|
|
614
|
+
exports.CODE_ELEMENT_SCHEMA,
|
|
615
|
+
exports.COMMUNITY_SCHEMA,
|
|
616
|
+
exports.PROCESS_SCHEMA,
|
|
617
|
+
// Multi-language support
|
|
618
|
+
exports.STRUCT_SCHEMA,
|
|
619
|
+
exports.ENUM_SCHEMA,
|
|
620
|
+
exports.MACRO_SCHEMA,
|
|
621
|
+
exports.TYPEDEF_SCHEMA,
|
|
622
|
+
exports.UNION_SCHEMA,
|
|
623
|
+
exports.NAMESPACE_SCHEMA,
|
|
624
|
+
exports.TRAIT_SCHEMA,
|
|
625
|
+
exports.IMPL_SCHEMA,
|
|
626
|
+
exports.TYPE_ALIAS_SCHEMA,
|
|
627
|
+
exports.CONST_SCHEMA,
|
|
628
|
+
exports.STATIC_SCHEMA,
|
|
629
|
+
exports.VARIABLE_SCHEMA,
|
|
630
|
+
exports.PROPERTY_SCHEMA,
|
|
631
|
+
exports.RECORD_SCHEMA,
|
|
632
|
+
exports.DELEGATE_SCHEMA,
|
|
633
|
+
exports.ANNOTATION_SCHEMA,
|
|
634
|
+
exports.CONSTRUCTOR_SCHEMA,
|
|
635
|
+
exports.TEMPLATE_SCHEMA,
|
|
636
|
+
exports.MODULE_SCHEMA,
|
|
637
|
+
// Markdown support
|
|
638
|
+
exports.SECTION_SCHEMA,
|
|
639
|
+
// API routes
|
|
640
|
+
exports.ROUTE_SCHEMA,
|
|
641
|
+
// MCP tools
|
|
642
|
+
exports.TOOL_SCHEMA,
|
|
643
|
+
// Taint/PDG substrate (issue #2080) — must be appended here, not just
|
|
644
|
+
// declared above: SCHEMA_QUERIES (the list initLbug actually runs) is built
|
|
645
|
+
// from NODE_SCHEMA_QUERIES. Omitting this leaves the BasicBlock table
|
|
646
|
+
// uncreated and the bulk-COPY round-trip fails with "table does not exist".
|
|
647
|
+
exports.BASICBLOCK_SCHEMA,
|
|
648
|
+
// Synthetic external RPC service node (spec §6.1) — same wiring reason as
|
|
649
|
+
// BasicBlock: NODE_TABLES declares it, so the CREATE NODE TABLE must reach
|
|
650
|
+
// initLbug or CREATE REL TABLE (which references ExternalService endpoints)
|
|
651
|
+
// fails on a missing table.
|
|
652
|
+
exports.EXTERNAL_SERVICE_SCHEMA,
|
|
653
|
+
];
|
|
654
|
+
exports.REL_SCHEMA_QUERIES = [exports.RELATION_SCHEMA];
|
|
655
|
+
exports.SCHEMA_QUERIES = [...exports.NODE_SCHEMA_QUERIES, ...exports.REL_SCHEMA_QUERIES, exports.EMBEDDING_SCHEMA];
|
|
656
|
+
/**
|
|
657
|
+
* Digest of the graph DDL this build creates — the exact statements
|
|
658
|
+
* {@link runSchemaCreationQueries} (lbug-adapter.ts) executes for the node and
|
|
659
|
+
* relation tables.
|
|
660
|
+
*
|
|
661
|
+
* This REPLACED `INCREMENTAL_SCHEMA_VERSION` (#2798), a hand-incremented
|
|
662
|
+
* integer in repo-manager.ts that had to PREDICT whether an on-disk database
|
|
663
|
+
* was created from this build's DDL. It could not: the number collided with
|
|
664
|
+
* `main` eight times, twice EXACTLY, and an exact clash was the quiet failure —
|
|
665
|
+
* two builds stamp the same number over different DDL, the strict `===` gate
|
|
666
|
+
* reads the index as current, every `CREATE … TABLE` is skipped as "already
|
|
667
|
+
* exists" (suppressed in `runSchemaCreationQueries`), and the edges whose
|
|
668
|
+
* endpoint pair the live DB cannot persist are dropped by
|
|
669
|
+
* `fallbackRelationshipInserts`' bare `catch`. A wrong graph, not an error.
|
|
670
|
+
*
|
|
671
|
+
* A digest cannot collide BY ACCIDENT at this scale: 12 hex chars is 48 bits,
|
|
672
|
+
* so even 1,000 distinct DDL variants over the project's whole life put the
|
|
673
|
+
* birthday probability of any pair matching at ≈1.8e-9. Two builds agree
|
|
674
|
+
* exactly when their DDL agrees, so concurrent branches never need renumbering.
|
|
675
|
+
* Do not shorten the slice: the odds double per bit dropped. On mismatch —
|
|
676
|
+
* including the ABSENT stamp every pre-#2798 index carries — run-analyze warns
|
|
677
|
+
* and forces a full re-analyze, which wipes the database and recreates the
|
|
678
|
+
* tables from the DDL below.
|
|
679
|
+
*
|
|
680
|
+
* {@link EMBEDDING_SCHEMA} is deliberately EXCLUDED. Its `FLOAT[N]` width comes
|
|
681
|
+
* from `CGRAPH_EMBEDDING_DIMS` at module load, so folding it in would make
|
|
682
|
+
* this a function of the ENVIRONMENT rather than of code: two runs of the same
|
|
683
|
+
* build under different env would disagree and force alternating full rebuilds.
|
|
684
|
+
* Vector-column drift is therefore a SEPARATE gate, not an ungated hazard:
|
|
685
|
+
* {@link embeddingDimsMismatch} compares the width stamped in
|
|
686
|
+
* `RepoMeta.embeddingDims` against {@link EMBEDDING_DIMS} and run-analyze
|
|
687
|
+
* forces a rebuild on drift. Do not merge the two — an env-derived value in a
|
|
688
|
+
* code digest makes the same build disagree with itself. (The older reaction in
|
|
689
|
+
* run-analyze remains, and is to the CACHE, not the schema: when the cached
|
|
690
|
+
* vectors' length differs from `EMBEDDING_DIMS` it discards the cache and
|
|
691
|
+
* re-embeds.)
|
|
692
|
+
*/
|
|
693
|
+
exports.SCHEMA_FINGERPRINT = (0, crypto_1.createHash)('sha256')
|
|
694
|
+
.update([...exports.NODE_SCHEMA_QUERIES, ...exports.REL_SCHEMA_QUERIES].join('\n'))
|
|
695
|
+
.digest('hex')
|
|
696
|
+
.slice(0, 12);
|
|
697
|
+
/**
|
|
698
|
+
* Whether an index built under `recorded` can be reused by this build.
|
|
699
|
+
*
|
|
700
|
+
* Lives here rather than in run-analyze so the query side can ask the same
|
|
701
|
+
* question without importing the analyze pipeline — the reason
|
|
702
|
+
* `cjkSegmentationModeMismatch` sits in `core/search/` rather than beside its
|
|
703
|
+
* caller. ABSENT counts as a mismatch: that is the backward-compatibility path
|
|
704
|
+
* for every index written before the field existed, and grandfathering it would
|
|
705
|
+
* stamp a fresh fingerprint onto a database whose DDL was never verified.
|
|
706
|
+
*/
|
|
707
|
+
const schemaFingerprintMismatch = (recorded) => recorded !== exports.SCHEMA_FINGERPRINT;
|
|
708
|
+
exports.schemaFingerprintMismatch = schemaFingerprintMismatch;
|
|
709
|
+
/**
|
|
710
|
+
* Whether a stamped value has the shape {@link SCHEMA_FINGERPRINT} produces —
|
|
711
|
+
* the lowercase-hex prefix of a sha256 digest. The width is read from the live
|
|
712
|
+
* constant, so changing the slice above needs no edit here.
|
|
713
|
+
*
|
|
714
|
+
* Used to decide whether a stamp is worth NAMING in a diagnostic: an index with
|
|
715
|
+
* no fingerprint and one carrying a malformed value are both "not this build",
|
|
716
|
+
* but only the first has an explanation worth printing. Not a comparison gate —
|
|
717
|
+
* {@link schemaFingerprintMismatch} already rejects every value that is not
|
|
718
|
+
* exactly this build's.
|
|
719
|
+
*/
|
|
720
|
+
const isSchemaFingerprintShaped = (value) => typeof value === 'string' &&
|
|
721
|
+
value.length === exports.SCHEMA_FINGERPRINT.length &&
|
|
722
|
+
/^[0-9a-f]+$/.test(value);
|
|
723
|
+
exports.isSchemaFingerprintShaped = isSchemaFingerprintShaped;
|
|
724
|
+
/**
|
|
725
|
+
* Whether the vector-column width an index's `CodeEmbedding` table was created
|
|
726
|
+
* at (as persisted in `RepoMeta.embeddingDims`) differs from the width this
|
|
727
|
+
* process would embed at ({@link EMBEDDING_DIMS}). The gate
|
|
728
|
+
* {@link SCHEMA_FINGERPRINT} deliberately cannot be: `FLOAT[N]` comes from
|
|
729
|
+
* `CGRAPH_EMBEDDING_DIMS` at module load, so folding it into a digest of the
|
|
730
|
+
* DDL would make that digest a function of the ENVIRONMENT. Splitting it out
|
|
731
|
+
* here keeps the fingerprint purely code-derived and still gates the width —
|
|
732
|
+
* before this, flipping `CGRAPH_EMBEDDING_DIMS` on a same-commit clean tree
|
|
733
|
+
* fired no guard at all: `alreadyUpToDate` returned over a `FLOAT[384]` table
|
|
734
|
+
* while the process embedded at 768. (The one pre-existing reaction, in
|
|
735
|
+
* run-analyze, discards the embedding CACHE and re-embeds — into a column whose
|
|
736
|
+
* width was never revisited.) A single scalar, so plain equality suffices.
|
|
737
|
+
*
|
|
738
|
+
* ABSENT does NOT count as a mismatch — the opposite of
|
|
739
|
+
* {@link schemaFingerprintMismatch}, and deliberately:
|
|
740
|
+
*
|
|
741
|
+
* - Absence carries no signal about the width. A missing fingerprint means
|
|
742
|
+
* "DDL this build cannot vouch for", and the field ships WITH a DDL change,
|
|
743
|
+
* so absence is itself evidence of drift. A missing dims stamp means only
|
|
744
|
+
* "written before the field existed"; the width was whatever that run's env
|
|
745
|
+
* resolved, almost always the 384 default, and it was consistent with the
|
|
746
|
+
* table it wrote. Drift needs the env to CHANGE, which absence says nothing
|
|
747
|
+
* about.
|
|
748
|
+
* - Forcing on absence would buy no safety anyway. Every index that lacks this
|
|
749
|
+
* stamp also lacks `schemaFingerprint` (both landed together in #2798), and
|
|
750
|
+
* that guard already forces a rebuild for exactly those indexes — after
|
|
751
|
+
* which the width is stamped and the hazard is closed for good. A second
|
|
752
|
+
* trigger for the same one rebuild is dead weight that would keep firing
|
|
753
|
+
* forever on any future path that legitimately omits the stamp.
|
|
754
|
+
* - The cost of guessing wrong is asymmetric: a fleet-wide full re-analyze
|
|
755
|
+
* (minutes to hours per repo) for a hazard that requires a rare, deliberate
|
|
756
|
+
* env change.
|
|
757
|
+
*
|
|
758
|
+
* Absence is precisely `undefined`. Any other recorded value that is not this
|
|
759
|
+
* build's width — including a malformed one, since `meta.json` is a schema-less
|
|
760
|
+
* `JSON.parse` of on-disk state — reads as a mismatch and errs toward a
|
|
761
|
+
* rebuild, which is the safe direction.
|
|
762
|
+
*
|
|
763
|
+
* Pure + exported for testing, and takes `current` explicitly rather than
|
|
764
|
+
* closing over {@link EMBEDDING_DIMS}: that constant is frozen at module load,
|
|
765
|
+
* so a parameter is the only way to exercise both sides of the comparison.
|
|
766
|
+
* Lives here rather than in run-analyze for the reason
|
|
767
|
+
* `cjkSegmentationModeMismatch` lives in `core/search/` — a caller that only
|
|
768
|
+
* needs the comparator should not have to pull in the analyze pipeline.
|
|
769
|
+
*/
|
|
770
|
+
const embeddingDimsMismatch = (recorded, current) => recorded !== undefined && recorded !== current;
|
|
771
|
+
exports.embeddingDimsMismatch = embeddingDimsMismatch;
|