gitnexus 1.6.6-rc.99 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -68
- package/dist/_shared/graph/types.d.ts +17 -1
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +3 -5
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js +2 -4
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.d.ts +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.js +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -1
- package/dist/_shared/scope-resolution/parsed-file.d.ts +24 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts +13 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.d.ts +1 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.js +6 -0
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.js +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/macro-registry.d.ts +29 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.js +32 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +9 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/types.d.ts +1 -1
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +35 -1
- package/dist/cli/ai-context.js +111 -12
- package/dist/cli/analyze-config.d.ts +92 -0
- package/dist/cli/analyze-config.js +364 -0
- package/dist/cli/analyze.d.ts +17 -1
- package/dist/cli/analyze.js +224 -71
- package/dist/cli/cli-message.d.ts +1 -1
- package/dist/cli/doctor.d.ts +18 -0
- package/dist/cli/doctor.js +32 -0
- package/dist/cli/i18n/en.d.ts +2 -2
- package/dist/cli/i18n/en.js +2 -2
- package/dist/cli/i18n/resources.d.ts +2 -2
- package/dist/cli/i18n/zh-CN.js +2 -2
- package/dist/cli/index.js +4 -2
- package/dist/cli/resolve-invocation.d.ts +21 -0
- package/dist/cli/resolve-invocation.js +68 -0
- package/dist/cli/setup.d.ts +33 -0
- package/dist/cli/setup.js +96 -35
- package/dist/cli/skill-gen.js +2 -2
- package/dist/cli/wiki.js +20 -4
- package/dist/core/embeddings/embedder.d.ts +1 -1
- package/dist/core/embeddings/embedder.js +14 -1
- package/dist/core/embeddings/runtime-support.d.ts +41 -0
- package/dist/core/embeddings/runtime-support.js +65 -0
- package/dist/core/group/extractors/grpc-patterns/proto.js +2 -1
- package/dist/core/group/extractors/http-patterns/java.js +15 -1
- package/dist/core/ingestion/call-processor.d.ts +57 -227
- package/dist/core/ingestion/call-processor.js +172 -2595
- package/dist/core/ingestion/call-routing.d.ts +6 -5
- package/dist/core/ingestion/call-routing.js +6 -6
- package/dist/core/ingestion/call-types.d.ts +0 -75
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +26 -1
- package/dist/core/ingestion/class-extractors/configs/ruby.js +3 -0
- package/dist/core/ingestion/class-extractors/generic.js +9 -11
- package/dist/core/ingestion/class-types.d.ts +23 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +11 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +227 -73
- package/dist/core/ingestion/cobol-processor.d.ts +1 -0
- package/dist/core/ingestion/cobol-processor.js +51 -2
- package/dist/core/ingestion/emit-references.js +8 -2
- package/dist/core/ingestion/export-detection.d.ts +2 -1
- package/dist/core/ingestion/export-detection.js +2 -6
- package/dist/core/ingestion/field-extractors/configs/dart.d.ts +0 -6
- package/dist/core/ingestion/field-extractors/configs/dart.js +62 -44
- package/dist/core/ingestion/field-extractors/configs/go.d.ts +0 -9
- package/dist/core/ingestion/field-extractors/configs/go.js +40 -1
- package/dist/core/ingestion/field-extractors/configs/jvm.js +43 -4
- package/dist/core/ingestion/field-extractors/configs/php.js +1 -2
- package/dist/core/ingestion/field-extractors/configs/swift.d.ts +12 -1
- package/dist/core/ingestion/field-extractors/configs/swift.js +31 -6
- package/dist/core/ingestion/field-extractors/generic.d.ts +6 -0
- package/dist/core/ingestion/field-extractors/generic.js +5 -4
- package/dist/core/ingestion/field-extractors/typescript.js +0 -29
- package/dist/core/ingestion/filesystem-walker.d.ts +0 -9
- package/dist/core/ingestion/filesystem-walker.js +0 -11
- package/dist/core/ingestion/finalize-orchestrator.js +14 -2
- package/dist/core/ingestion/import-resolvers/configs/swift.d.ts +21 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.js +72 -11
- package/dist/core/ingestion/import-resolvers/python.d.ts +1 -1
- package/dist/core/ingestion/import-resolvers/standard.d.ts +2 -2
- package/dist/core/ingestion/import-resolvers/standard.js +6 -5
- package/dist/core/ingestion/import-resolvers/utils.d.ts +2 -5
- package/dist/core/ingestion/import-resolvers/utils.js +1 -9
- package/dist/core/ingestion/language-provider.d.ts +39 -119
- package/dist/core/ingestion/language-provider.js +0 -2
- package/dist/core/ingestion/languages/c/capture-side-channel.d.ts +62 -0
- package/dist/core/ingestion/languages/c/capture-side-channel.js +65 -0
- package/dist/core/ingestion/languages/c/captures.js +41 -23
- package/dist/core/ingestion/languages/c/import-decomposer.d.ts +9 -0
- package/dist/core/ingestion/languages/c/import-decomposer.js +15 -0
- package/dist/core/ingestion/languages/c/import-target.js +52 -9
- package/dist/core/ingestion/languages/c/index.d.ts +2 -1
- package/dist/core/ingestion/languages/c/index.js +2 -1
- package/dist/core/ingestion/languages/c/query.js +15 -0
- package/dist/core/ingestion/languages/c/scope-resolver.js +47 -4
- package/dist/core/ingestion/languages/c/static-linkage.d.ts +8 -0
- package/dist/core/ingestion/languages/c/static-linkage.js +46 -1
- package/dist/core/ingestion/languages/c-cpp.js +16 -7
- package/dist/core/ingestion/languages/cobol/captures.js +25 -2
- package/dist/core/ingestion/languages/cpp/adl.d.ts +88 -4
- package/dist/core/ingestion/languages/cpp/adl.js +380 -160
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +2 -8
- package/dist/core/ingestion/languages/cpp/capture-side-channel.d.ts +65 -0
- package/dist/core/ingestion/languages/cpp/capture-side-channel.js +78 -0
- package/dist/core/ingestion/languages/cpp/captures.js +162 -54
- package/dist/core/ingestion/languages/cpp/file-local-linkage.d.ts +18 -52
- package/dist/core/ingestion/languages/cpp/file-local-linkage.js +49 -1
- package/dist/core/ingestion/languages/cpp/import-decomposer.d.ts +7 -0
- package/dist/core/ingestion/languages/cpp/import-decomposer.js +12 -0
- package/dist/core/ingestion/languages/cpp/index.d.ts +1 -0
- package/dist/core/ingestion/languages/cpp/index.js +1 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.d.ts +8 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.js +21 -0
- package/dist/core/ingestion/languages/cpp/query.js +21 -0
- package/dist/core/ingestion/languages/cpp/range-bindings.js +20 -5
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +52 -5
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.d.ts +20 -0
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.js +83 -3
- package/dist/core/ingestion/languages/csharp/captures.js +205 -41
- package/dist/core/ingestion/languages/csharp/index.d.ts +3 -4
- package/dist/core/ingestion/languages/csharp/index.js +3 -4
- package/dist/core/ingestion/languages/csharp/interpret.js +17 -3
- package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +17 -7
- package/dist/core/ingestion/languages/csharp/namespace-siblings.js +129 -124
- package/dist/core/ingestion/languages/csharp/qualified-type-names.d.ts +14 -0
- package/dist/core/ingestion/languages/csharp/qualified-type-names.js +59 -0
- package/dist/core/ingestion/languages/csharp/query.js +13 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.js +10 -6
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +8 -1
- package/dist/core/ingestion/languages/csharp.js +0 -5
- package/dist/core/ingestion/languages/dart/arity-metadata.d.ts +25 -0
- package/dist/core/ingestion/languages/dart/arity-metadata.js +35 -0
- package/dist/core/ingestion/languages/dart/arity.d.ts +19 -0
- package/dist/core/ingestion/languages/dart/arity.js +31 -0
- package/dist/core/ingestion/languages/dart/built-ins.d.ts +11 -0
- package/dist/core/ingestion/languages/dart/built-ins.js +34 -0
- package/dist/core/ingestion/languages/dart/cache-stats.d.ts +13 -0
- package/dist/core/ingestion/languages/dart/cache-stats.js +24 -0
- package/dist/core/ingestion/languages/dart/captures.d.ts +29 -0
- package/dist/core/ingestion/languages/dart/captures.js +445 -0
- package/dist/core/ingestion/languages/dart/expand-wildcards.d.ts +13 -0
- package/dist/core/ingestion/languages/dart/expand-wildcards.js +31 -0
- package/dist/core/ingestion/languages/dart/import-target.d.ts +15 -0
- package/dist/core/ingestion/languages/dart/import-target.js +65 -0
- package/dist/core/ingestion/languages/dart/index.d.ts +28 -0
- package/dist/core/ingestion/languages/dart/index.js +28 -0
- package/dist/core/ingestion/languages/dart/interpret.d.ts +24 -0
- package/dist/core/ingestion/languages/dart/interpret.js +95 -0
- package/dist/core/ingestion/languages/dart/merge-bindings.d.ts +10 -0
- package/dist/core/ingestion/languages/dart/merge-bindings.js +39 -0
- package/dist/core/ingestion/languages/dart/query.d.ts +26 -0
- package/dist/core/ingestion/languages/dart/query.js +142 -0
- package/dist/core/ingestion/languages/dart/receiver-binding.d.ts +24 -0
- package/dist/core/ingestion/languages/dart/receiver-binding.js +87 -0
- package/dist/core/ingestion/languages/dart/scope-resolver.d.ts +29 -0
- package/dist/core/ingestion/languages/dart/scope-resolver.js +194 -0
- package/dist/core/ingestion/languages/dart/signature-bindings.d.ts +23 -0
- package/dist/core/ingestion/languages/dart/signature-bindings.js +51 -0
- package/dist/core/ingestion/languages/dart/simple-hooks.d.ts +20 -0
- package/dist/core/ingestion/languages/dart/simple-hooks.js +47 -0
- package/dist/core/ingestion/languages/dart.d.ts +0 -1
- package/dist/core/ingestion/languages/dart.js +15 -29
- package/dist/core/ingestion/languages/go/arity-metadata.d.ts +1 -0
- package/dist/core/ingestion/languages/go/arity-metadata.js +31 -1
- package/dist/core/ingestion/languages/go/captures.js +162 -3
- package/dist/core/ingestion/languages/go/interface-impls.js +476 -50
- package/dist/core/ingestion/languages/go/interpret.js +21 -11
- package/dist/core/ingestion/languages/go/method-owners.js +20 -8
- package/dist/core/ingestion/languages/go/query.js +15 -7
- package/dist/core/ingestion/languages/go/range-binding.js +24 -9
- package/dist/core/ingestion/languages/go/receiver-binding.js +1 -1
- package/dist/core/ingestion/languages/go/scope-resolver.js +2 -2
- package/dist/core/ingestion/languages/go/simple-hooks.js +10 -5
- package/dist/core/ingestion/languages/go/type-binding.d.ts +1 -0
- package/dist/core/ingestion/languages/go/type-binding.js +40 -2
- package/dist/core/ingestion/languages/go.d.ts +0 -1
- package/dist/core/ingestion/languages/go.js +0 -5
- package/dist/core/ingestion/languages/index.d.ts +0 -5
- package/dist/core/ingestion/languages/index.js +0 -3
- package/dist/core/ingestion/languages/java/captures.js +252 -23
- package/dist/core/ingestion/languages/java/interpret.js +12 -6
- package/dist/core/ingestion/languages/java/package-siblings.js +18 -5
- package/dist/core/ingestion/languages/java/query.js +16 -1
- package/dist/core/ingestion/languages/java/scope-resolver.d.ts +2 -8
- package/dist/core/ingestion/languages/java/scope-resolver.js +2 -8
- package/dist/core/ingestion/languages/java.js +0 -5
- package/dist/core/ingestion/languages/javascript/captures.js +185 -11
- package/dist/core/ingestion/languages/javascript/query.js +107 -1
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +57 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +60 -0
- package/dist/core/ingestion/languages/kotlin/captures.js +213 -22
- package/dist/core/ingestion/languages/kotlin/companion-scopes.d.ts +7 -0
- package/dist/core/ingestion/languages/kotlin/companion-scopes.js +10 -0
- package/dist/core/ingestion/languages/kotlin/index.d.ts +1 -0
- package/dist/core/ingestion/languages/kotlin/index.js +1 -0
- package/dist/core/ingestion/languages/kotlin/query.js +30 -0
- package/dist/core/ingestion/languages/kotlin/scope-resolver.d.ts +5 -7
- package/dist/core/ingestion/languages/kotlin/scope-resolver.js +22 -7
- package/dist/core/ingestion/languages/kotlin.js +8 -5
- package/dist/core/ingestion/languages/php/captures.js +135 -19
- package/dist/core/ingestion/languages/php/import-decomposer.js +21 -63
- package/dist/core/ingestion/languages/php/index.d.ts +3 -4
- package/dist/core/ingestion/languages/php/index.js +3 -4
- package/dist/core/ingestion/languages/php/query.js +5 -0
- package/dist/core/ingestion/languages/php/receiver-binding.js +8 -4
- package/dist/core/ingestion/languages/php.js +0 -4
- package/dist/core/ingestion/languages/python/captures.js +128 -13
- package/dist/core/ingestion/languages/python/depends-references.js +1 -1
- package/dist/core/ingestion/languages/python/import-target.d.ts +4 -5
- package/dist/core/ingestion/languages/python/import-target.js +108 -16
- package/dist/core/ingestion/languages/python/index-stats.d.ts +18 -0
- package/dist/core/ingestion/languages/python/index-stats.js +25 -0
- package/dist/core/ingestion/languages/python/index.d.ts +3 -4
- package/dist/core/ingestion/languages/python/index.js +3 -4
- package/dist/core/ingestion/languages/python/query.js +17 -0
- package/dist/core/ingestion/languages/python/scope-resolver.js +7 -6
- package/dist/core/ingestion/languages/python.d.ts +0 -2
- package/dist/core/ingestion/languages/python.js +0 -7
- package/dist/core/ingestion/languages/ruby/captures.js +174 -31
- package/dist/core/ingestion/languages/ruby/import-target.js +2 -1
- package/dist/core/ingestion/languages/ruby/interpret.js +2 -1
- package/dist/core/ingestion/languages/ruby/query.js +10 -0
- package/dist/core/ingestion/languages/ruby/scope-resolver.js +61 -11
- package/dist/core/ingestion/languages/ruby.js +4 -53
- package/dist/core/ingestion/languages/rust/captures.js +95 -13
- package/dist/core/ingestion/languages/rust/query.js +64 -1
- package/dist/core/ingestion/languages/rust/range-binding.js +40 -12
- package/dist/core/ingestion/languages/rust/receiver-binding.js +9 -0
- package/dist/core/ingestion/languages/rust/scope-resolver.js +75 -1
- package/dist/core/ingestion/languages/rust.d.ts +0 -2
- package/dist/core/ingestion/languages/rust.js +0 -6
- package/dist/core/ingestion/languages/swift/arity-metadata.d.ts +24 -0
- package/dist/core/ingestion/languages/swift/arity-metadata.js +41 -0
- package/dist/core/ingestion/languages/swift/arity.d.ts +29 -0
- package/dist/core/ingestion/languages/swift/arity.js +42 -0
- package/dist/core/ingestion/languages/swift/base-type.d.ts +20 -0
- package/dist/core/ingestion/languages/swift/base-type.js +27 -0
- package/dist/core/ingestion/languages/swift/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/swift/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/swift/captures.d.ts +35 -0
- package/dist/core/ingestion/languages/swift/captures.js +495 -0
- package/dist/core/ingestion/languages/swift/implicit-imports.d.ts +34 -0
- package/dist/core/ingestion/languages/swift/implicit-imports.js +57 -0
- package/dist/core/ingestion/languages/swift/import-decomposer.d.ts +24 -0
- package/dist/core/ingestion/languages/swift/import-decomposer.js +84 -0
- package/dist/core/ingestion/languages/swift/import-target.d.ts +33 -0
- package/dist/core/ingestion/languages/swift/import-target.js +81 -0
- package/dist/core/ingestion/languages/swift/index.d.ts +37 -0
- package/dist/core/ingestion/languages/swift/index.js +37 -0
- package/dist/core/ingestion/languages/swift/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/swift/interpret.js +89 -0
- package/dist/core/ingestion/languages/swift/merge-bindings.d.ts +20 -0
- package/dist/core/ingestion/languages/swift/merge-bindings.js +48 -0
- package/dist/core/ingestion/languages/swift/query.d.ts +46 -0
- package/dist/core/ingestion/languages/swift/query.js +194 -0
- package/dist/core/ingestion/languages/swift/receiver-binding.d.ts +40 -0
- package/dist/core/ingestion/languages/swift/receiver-binding.js +161 -0
- package/dist/core/ingestion/languages/swift/scope-resolver.d.ts +50 -0
- package/dist/core/ingestion/languages/swift/scope-resolver.js +189 -0
- package/dist/core/ingestion/languages/swift/sibling-type-bindings.d.ts +34 -0
- package/dist/core/ingestion/languages/swift/sibling-type-bindings.js +65 -0
- package/dist/core/ingestion/languages/swift/signature-bindings.d.ts +25 -0
- package/dist/core/ingestion/languages/swift/signature-bindings.js +66 -0
- package/dist/core/ingestion/languages/swift/simple-hooks.d.ts +37 -0
- package/dist/core/ingestion/languages/swift/simple-hooks.js +60 -0
- package/dist/core/ingestion/languages/swift/target-grouping.d.ts +51 -0
- package/dist/core/ingestion/languages/swift/target-grouping.js +93 -0
- package/dist/core/ingestion/languages/swift/target-siblings.d.ts +30 -0
- package/dist/core/ingestion/languages/swift/target-siblings.js +71 -0
- package/dist/core/ingestion/languages/swift.d.ts +0 -5
- package/dist/core/ingestion/languages/swift.js +11 -87
- package/dist/core/ingestion/languages/typescript/array-callback.d.ts +3 -29
- package/dist/core/ingestion/languages/typescript/array-callback.js +4 -43
- package/dist/core/ingestion/languages/typescript/captures.js +147 -17
- package/dist/core/ingestion/languages/typescript/index.d.ts +3 -4
- package/dist/core/ingestion/languages/typescript/index.js +3 -4
- package/dist/core/ingestion/languages/typescript/query.d.ts +2 -3
- package/dist/core/ingestion/languages/typescript/query.js +125 -4
- package/dist/core/ingestion/languages/typescript/receiver-binding.js +0 -1
- package/dist/core/ingestion/languages/typescript.d.ts +2 -3
- package/dist/core/ingestion/languages/typescript.js +46 -23
- package/dist/core/ingestion/languages/vue/captures.d.ts +46 -0
- package/dist/core/ingestion/languages/vue/captures.js +67 -0
- package/dist/core/ingestion/languages/vue/import-target.d.ts +27 -0
- package/dist/core/ingestion/languages/vue/import-target.js +58 -0
- package/dist/core/ingestion/languages/vue/index.d.ts +49 -0
- package/dist/core/ingestion/languages/vue/index.js +49 -0
- package/dist/core/ingestion/languages/vue/scope-resolver.d.ts +55 -0
- package/dist/core/ingestion/languages/vue/scope-resolver.js +292 -0
- package/dist/core/ingestion/languages/vue.js +12 -4
- package/dist/core/ingestion/local-symbol-pruner.d.ts +11 -0
- package/dist/core/ingestion/local-symbol-pruner.js +63 -0
- package/dist/core/ingestion/method-extractors/configs/dart.js +14 -1
- package/dist/core/ingestion/method-extractors/configs/jvm.js +37 -20
- package/dist/core/ingestion/method-extractors/configs/php.js +0 -1
- package/dist/core/ingestion/method-extractors/configs/swift.js +11 -4
- package/dist/core/ingestion/method-types.d.ts +2 -2
- package/dist/core/ingestion/model/index.d.ts +0 -3
- package/dist/core/ingestion/model/index.js +0 -8
- package/dist/core/ingestion/model/resolve.d.ts +7 -43
- package/dist/core/ingestion/model/resolve.js +7 -226
- package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +46 -1
- package/dist/core/ingestion/model/semantic-model.d.ts +4 -6
- package/dist/core/ingestion/model/semantic-model.js +1 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +3 -4
- package/dist/core/ingestion/model/symbol-table.js +3 -4
- package/dist/core/ingestion/parsing-processor.d.ts +30 -24
- package/dist/core/ingestion/parsing-processor.js +76 -640
- package/dist/core/ingestion/pipeline-phases/communities.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/communities.js +5 -2
- package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +9 -8
- package/dist/core/ingestion/pipeline-phases/cross-file.js +16 -12
- package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/index.js +1 -0
- package/dist/core/ingestion/pipeline-phases/mro.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/mro.js +2 -2
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +44 -22
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +426 -565
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +13 -33
- package/dist/core/ingestion/pipeline-phases/parse.js +2 -2
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/processes.js +5 -3
- package/dist/core/ingestion/pipeline-phases/prune-local-symbols.d.ts +14 -0
- package/dist/core/ingestion/pipeline-phases/prune-local-symbols.js +26 -0
- package/dist/core/ingestion/pipeline.d.ts +27 -19
- package/dist/core/ingestion/pipeline.js +4 -2
- package/dist/core/ingestion/resolve-references.js +15 -3
- package/dist/core/ingestion/route-extractors/laravel.d.ts +10 -0
- package/dist/core/ingestion/route-extractors/laravel.js +88 -9
- package/dist/core/ingestion/scope-extractor-bridge.d.ts +2 -1
- package/dist/core/ingestion/scope-extractor-bridge.js +2 -2
- package/dist/core/ingestion/scope-extractor.js +13 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +181 -15
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +21 -10
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +10 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +7 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +58 -6
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +24 -5
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +68 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +189 -29
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +21 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1 -1
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +8 -11
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +171 -50
- package/dist/core/ingestion/scope-resolution/pipeline/registry.d.ts +3 -4
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +9 -4
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +28 -5
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +191 -24
- package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +31 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +72 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +440 -39
- package/dist/core/ingestion/scope-resolution/workspace-index.d.ts +18 -2
- package/dist/core/ingestion/scope-resolution/workspace-index.js +94 -7
- package/dist/core/ingestion/tree-sitter-queries.d.ts +14 -14
- package/dist/core/ingestion/tree-sitter-queries.js +380 -158
- package/dist/core/ingestion/ts-js-hoc-utils.d.ts +12 -0
- package/dist/core/ingestion/ts-js-hoc-utils.js +105 -0
- package/dist/core/ingestion/type-env.d.ts +2 -1
- package/dist/core/ingestion/type-env.js +6 -8
- package/dist/core/ingestion/type-extractors/c-cpp.js +8 -10
- package/dist/core/ingestion/type-extractors/csharp.js +18 -34
- package/dist/core/ingestion/type-extractors/go.js +2 -10
- package/dist/core/ingestion/type-extractors/jvm.js +6 -5
- package/dist/core/ingestion/type-extractors/php.js +1 -1
- package/dist/core/ingestion/type-extractors/python.js +1 -1
- package/dist/core/ingestion/type-extractors/ruby.js +2 -2
- package/dist/core/ingestion/type-extractors/rust.js +0 -16
- package/dist/core/ingestion/type-extractors/shared.d.ts +2 -2
- package/dist/core/ingestion/type-extractors/shared.js +25 -11
- package/dist/core/ingestion/type-extractors/swift.js +5 -5
- package/dist/core/ingestion/type-extractors/types.d.ts +1 -1
- package/dist/core/ingestion/type-extractors/typescript.js +1 -1
- package/dist/core/ingestion/utils/ast-helpers.d.ts +119 -1
- package/dist/core/ingestion/utils/ast-helpers.js +260 -13
- package/dist/core/ingestion/utils/callable-labels.d.ts +13 -0
- package/dist/core/ingestion/utils/callable-labels.js +14 -0
- package/dist/core/ingestion/utils/deferred-resolution-profile.d.ts +10 -0
- package/dist/core/ingestion/utils/deferred-resolution-profile.js +30 -0
- package/dist/core/ingestion/utils/heap-probe.d.ts +20 -0
- package/dist/core/ingestion/utils/heap-probe.js +39 -0
- package/dist/core/ingestion/utils/heritage-marker.d.ts +33 -0
- package/dist/core/ingestion/utils/heritage-marker.js +41 -0
- package/dist/core/ingestion/utils/qualified-name.d.ts +37 -0
- package/dist/core/ingestion/utils/qualified-name.js +67 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.js +49 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.js +76 -62
- package/dist/core/ingestion/variable-extractors/configs/go.js +74 -7
- package/dist/core/ingestion/variable-extractors/configs/jvm.js +35 -8
- package/dist/core/ingestion/variable-extractors/generic.js +40 -12
- package/dist/core/ingestion/variable-types.d.ts +9 -0
- package/dist/core/ingestion/vue-sfc-extractor.d.ts +97 -7
- package/dist/core/ingestion/vue-sfc-extractor.js +433 -11
- package/dist/core/ingestion/workers/parse-worker.d.ts +0 -11
- package/dist/core/ingestion/workers/parse-worker.js +358 -187
- package/dist/core/ingestion/workers/worker-pool.d.ts +78 -9
- package/dist/core/ingestion/workers/worker-pool.js +346 -49
- package/dist/core/lbug/csv-generator.js +20 -2
- package/dist/core/lbug/lbug-adapter.js +29 -10
- package/dist/core/lbug/native-check.js +17 -5
- package/dist/core/lbug/pool-adapter.d.ts +0 -19
- package/dist/core/lbug/pool-adapter.js +40 -77
- package/dist/core/lbug/query-result-utils.d.ts +19 -0
- package/dist/core/lbug/query-result-utils.js +28 -0
- package/dist/core/run-analyze.d.ts +9 -2
- package/dist/core/run-analyze.js +24 -3
- package/dist/core/tree-sitter/parser-loader.d.ts +13 -0
- package/dist/core/tree-sitter/parser-loader.js +4 -0
- package/dist/core/tree-sitter/safe-parse.d.ts +70 -3
- package/dist/core/tree-sitter/safe-parse.js +214 -11
- package/dist/core/wiki/generator.js +13 -5
- package/dist/core/wiki/graph-queries.d.ts +3 -0
- package/dist/core/wiki/graph-queries.js +9 -1
- package/dist/core/wiki/llm-client.d.ts +1 -1
- package/dist/core/wiki/llm-client.js +7 -2
- package/dist/core/wiki/local-cli-client.d.ts +2 -1
- package/dist/core/wiki/local-cli-client.js +62 -4
- package/dist/mcp/compatible-stdio-transport.d.ts +3 -0
- package/dist/mcp/compatible-stdio-transport.js +22 -0
- package/dist/mcp/core/embedder.d.ts +1 -1
- package/dist/mcp/core/embedder.js +13 -1
- package/dist/mcp/local/local-backend.d.ts +37 -5
- package/dist/mcp/local/local-backend.js +227 -129
- package/dist/mcp/resources.js +3 -3
- package/dist/mcp/server.js +9 -1
- package/dist/storage/git.d.ts +11 -0
- package/dist/storage/git.js +30 -0
- package/dist/storage/parse-cache.d.ts +23 -1
- package/dist/storage/parse-cache.js +138 -32
- package/dist/storage/parsedfile-store.d.ts +142 -0
- package/dist/storage/parsedfile-store.js +367 -0
- package/dist/storage/repo-manager.d.ts +2 -1
- package/dist/storage/scope-index-store.d.ts +114 -0
- package/dist/storage/scope-index-store.js +236 -0
- package/dist/types/pipeline.d.ts +6 -3
- package/hooks/antigravity/gitnexus-antigravity-hook.cjs +2 -1
- package/hooks/claude/gitnexus-hook.cjs +2 -1
- package/hooks/claude/resolve-analyze-cmd.cjs +323 -0
- package/package.json +4 -5
- package/scripts/bench-scope-resolution.ts +1 -3
- package/scripts/cross-platform-tests.ts +4 -1
- package/skills/gitnexus-cli.md +8 -6
- package/skills/gitnexus-debugging.md +15 -15
- package/skills/gitnexus-exploring.md +11 -11
- package/skills/gitnexus-guide.md +1 -1
- package/skills/gitnexus-impact-analysis.md +10 -10
- package/skills/gitnexus-pr-review.md +19 -19
- package/skills/gitnexus-refactoring.md +25 -25
- package/web/assets/{agent-BRX-afm3.js → agent-EkX7webX.js} +156 -131
- package/web/assets/{architectureDiagram-UL44E2DR-B1oYB8-c.js → architectureDiagram-UL44E2DR-BoczH8cv.js} +1 -1
- package/web/assets/{chunk-LCXTWHL2-SPC6pgWI.js → chunk-LCXTWHL2-By5HB3b-.js} +1 -1
- package/web/assets/{chunk-RG4AUYOV-DZXr4Yv3.js → chunk-RG4AUYOV-BQE_DkpL.js} +1 -1
- package/web/assets/{classDiagram-KGZ6W3CR-BqpOj8L9.js → classDiagram-KGZ6W3CR-Dj_02GUH.js} +1 -1
- package/web/assets/{classDiagram-v2-72OJOZXJ-FmElywK2.js → classDiagram-v2-72OJOZXJ-D-NArMpf.js} +1 -1
- package/web/assets/{diagram-3NCE3AQN-BWtJXMDq.js → diagram-3NCE3AQN-VXtXDO95.js} +1 -1
- package/web/assets/{diagram-GF46GFSD-Hh-fChxU.js → diagram-GF46GFSD-B1qab2Ah.js} +1 -1
- package/web/assets/{diagram-QXG6HAR7-DYeQHxGU.js → diagram-QXG6HAR7-BSCHGzzT.js} +1 -1
- package/web/assets/{diagram-WEQXMOUZ-DYGU4T0y.js → diagram-WEQXMOUZ-DHtknmNT.js} +1 -1
- package/web/assets/{erDiagram-L5TCEMPS-bN3wlP2A.js → erDiagram-L5TCEMPS-Db-IYTmm.js} +1 -1
- package/web/assets/{flowDiagram-H6V6AXG4-YACVtF3-.js → flowDiagram-H6V6AXG4-BHDoyVoW.js} +1 -1
- package/web/assets/{index-BhnAdWTt.js → index-BR0IhgbR.js} +10 -10
- package/web/assets/{infoDiagram-3YFTVSEB-BWBzD28-.js → infoDiagram-3YFTVSEB-6h8wbWEe.js} +1 -1
- package/web/assets/{ishikawaDiagram-BNXS4ZKH-B8qYT-j9.js → ishikawaDiagram-BNXS4ZKH-Dx2OkPk1.js} +1 -1
- package/web/assets/{kanban-definition-75IXJCU3-BeoPr5Tl.js → kanban-definition-75IXJCU3-CIIEZfqV.js} +1 -1
- package/web/assets/{mindmap-definition-2TDM6QVE-CdLLN_so.js → mindmap-definition-2TDM6QVE-DUAqydRq.js} +1 -1
- package/web/assets/{pieDiagram-CU6KROY3-DEd2a_k_.js → pieDiagram-CU6KROY3-BntYuYZa.js} +1 -1
- package/web/assets/{requirementDiagram-JXO7QTGE-QNeTo5C_.js → requirementDiagram-JXO7QTGE-QCD6I29n.js} +1 -1
- package/web/assets/{sequenceDiagram-VS2MUI6T-BHC7q7yJ.js → sequenceDiagram-VS2MUI6T-DScFwLz2.js} +1 -1
- package/web/assets/{stateDiagram-7D4R322I-KONnc2Px.js → stateDiagram-7D4R322I-AkRAm6Hl.js} +1 -1
- package/web/assets/{stateDiagram-v2-36443NZ5-C2QfuMlu.js → stateDiagram-v2-36443NZ5-BCK1vigR.js} +1 -1
- package/web/assets/{timeline-definition-O6YCAMPW-D4t4NJx1.js → timeline-definition-O6YCAMPW-BvpIVXjX.js} +1 -1
- package/web/assets/{vennDiagram-MWXL3ELB-6bctC9Yg.js → vennDiagram-MWXL3ELB-BYGWk6dK.js} +1 -1
- package/web/assets/{wardleyDiagram-CUQ6CDDI-BPZYNTvC.js → wardleyDiagram-CUQ6CDDI-Dk1z7H2T.js} +1 -1
- package/web/assets/{xychartDiagram-N2JHSOCM-lBI9O6DW.js → xychartDiagram-N2JHSOCM-2N6NCSWN.js} +1 -1
- package/web/index.html +1 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +0 -63
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.js +0 -122
- package/dist/_shared/scope-resolution/shadow/aggregate.js.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.d.ts +0 -59
- package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.js +0 -79
- package/dist/_shared/scope-resolution/shadow/diff.js.map +0 -1
- package/dist/core/ingestion/ast-cache.d.ts +0 -26
- package/dist/core/ingestion/ast-cache.js +0 -48
- package/dist/core/ingestion/heritage-extractors/configs/go.d.ts +0 -13
- package/dist/core/ingestion/heritage-extractors/configs/go.js +0 -20
- package/dist/core/ingestion/heritage-extractors/configs/ruby.d.ts +0 -18
- package/dist/core/ingestion/heritage-extractors/configs/ruby.js +0 -65
- package/dist/core/ingestion/heritage-extractors/generic.d.ts +0 -23
- package/dist/core/ingestion/heritage-extractors/generic.js +0 -47
- package/dist/core/ingestion/heritage-processor.d.ts +0 -54
- package/dist/core/ingestion/heritage-processor.js +0 -367
- package/dist/core/ingestion/heritage-types.d.ts +0 -73
- package/dist/core/ingestion/heritage-types.js +0 -2
- package/dist/core/ingestion/import-processor.d.ts +0 -23
- package/dist/core/ingestion/import-processor.js +0 -377
- package/dist/core/ingestion/model/heritage-map.d.ts +0 -105
- package/dist/core/ingestion/model/heritage-map.js +0 -294
- package/dist/core/ingestion/model/resolution-context.d.ts +0 -93
- package/dist/core/ingestion/model/resolution-context.js +0 -337
- package/dist/core/ingestion/named-bindings/csharp.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/csharp.js +0 -37
- package/dist/core/ingestion/named-bindings/java.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/java.js +0 -29
- package/dist/core/ingestion/named-bindings/kotlin.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/kotlin.js +0 -36
- package/dist/core/ingestion/named-bindings/php.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/php.js +0 -61
- package/dist/core/ingestion/named-bindings/python.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/python.js +0 -49
- package/dist/core/ingestion/named-bindings/rust.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/rust.js +0 -66
- package/dist/core/ingestion/named-bindings/types.d.ts +0 -16
- package/dist/core/ingestion/named-bindings/types.js +0 -6
- package/dist/core/ingestion/named-bindings/typescript.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/typescript.js +0 -58
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +0 -17
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +0 -209
- package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +0 -22
- package/dist/core/ingestion/pipeline-phases/orm-extraction.js +0 -92
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.d.ts +0 -70
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.js +0 -312
- package/dist/core/ingestion/registry-primary-flag.d.ts +0 -89
- package/dist/core/ingestion/registry-primary-flag.js +0 -122
- package/dist/core/ingestion/shadow-harness.d.ts +0 -113
- package/dist/core/ingestion/shadow-harness.js +0 -148
- package/dist/core/ingestion/utils/ruby-self-call.d.ts +0 -52
- package/dist/core/ingestion/utils/ruby-self-call.js +0 -59
- package/scripts/ci-list-migrated-languages.ts +0 -24
- package/scripts/run-parity.ts +0 -128
|
@@ -3,23 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generic registry-primary resolution phase (RFC #909 Ring 3).
|
|
5
5
|
*
|
|
6
|
-
* For every language
|
|
7
|
-
* whose provider is registered in `SCOPE_RESOLVERS`:
|
|
6
|
+
* For every language whose provider is registered in `SCOPE_RESOLVERS`:
|
|
8
7
|
* 1. Filter scanned files by language extension.
|
|
9
8
|
* 2. Read file contents.
|
|
10
9
|
* 3. Drive the scope-based pipeline end-to-end via the generic
|
|
11
10
|
* `runScopeResolution(input, provider)` orchestrator.
|
|
12
11
|
* 4. Emit IMPORTS / CALLS / ACCESSES / INHERITS / USES edges.
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* This is the sole resolution path — RING4-1 (#942) deleted the legacy
|
|
14
|
+
* call-resolution DAG, so there is no longer a per-language flag gating
|
|
15
|
+
* registry-vs-legacy.
|
|
17
16
|
*
|
|
18
|
-
* Adding a language is
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - Add the language to `MIGRATED_LANGUAGES` in
|
|
22
|
-
* `registry-primary-flag.ts`.
|
|
17
|
+
* Adding a language is one change: implement `ScopeResolver` in
|
|
18
|
+
* `languages/<lang>/scope-resolver.ts` and register it in
|
|
19
|
+
* `scope-resolution/pipeline/registry.ts`.
|
|
23
20
|
*
|
|
24
21
|
* @deps parse (needs Symbol nodes already in the graph so emit-references
|
|
25
22
|
* can attach edges to existing Function/Method/Class nodes)
|
|
@@ -27,12 +24,14 @@
|
|
|
27
24
|
* @writes graph (IMPORTS, CALLS, ACCESSES, INHERITS, USES)
|
|
28
25
|
*/
|
|
29
26
|
import { getPhaseOutput } from '../../pipeline-phases/types.js';
|
|
30
|
-
import { isRegistryPrimary } from '../../registry-primary-flag.js';
|
|
31
27
|
import { getLanguageFromFilename } from '../../../../_shared/index.js';
|
|
32
28
|
import { readFileContents } from '../../filesystem-walker.js';
|
|
33
29
|
import { runScopeResolution } from './run.js';
|
|
30
|
+
import { buildGraphNodeLookup } from '../graph-bridge/node-lookup.js';
|
|
34
31
|
import { SCOPE_RESOLVERS } from './registry.js';
|
|
35
32
|
import { isDev, isSemanticModelValidatorEnabled } from '../../utils/env.js';
|
|
33
|
+
import { logHeapProbe } from '../../utils/heap-probe.js';
|
|
34
|
+
import { clearParsedFileStore, loadParsedFilesForPaths, forceGc, } from '../../../../storage/parsedfile-store.js';
|
|
36
35
|
import { logger } from '../../../logger.js';
|
|
37
36
|
const NOOP_OUTPUT = Object.freeze({
|
|
38
37
|
ran: false,
|
|
@@ -45,31 +44,25 @@ const NOOP_OUTPUT = Object.freeze({
|
|
|
45
44
|
export const scopeResolutionPhase = {
|
|
46
45
|
name: 'scopeResolution',
|
|
47
46
|
// Depends on `parse` because emit-references attaches edges to
|
|
48
|
-
// already-existing Symbol nodes (Function/Method/Class)
|
|
49
|
-
//
|
|
50
|
-
// import + call resolution layer.
|
|
47
|
+
// already-existing Symbol nodes (Function/Method/Class) that the `parse`
|
|
48
|
+
// phase creates.
|
|
51
49
|
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
// the MRO walk would miss heritage edges crossFile later adds.
|
|
50
|
+
// The `crossFile` dep is retained for stable ordering but is no longer
|
|
51
|
+
// load-bearing: inheritance (EXTENDS/IMPLEMENTS) edges are now emitted by
|
|
52
|
+
// this phase's own `preEmitInheritanceEdges` before `buildMro` runs, and
|
|
53
|
+
// since RING4-1 (#942) `crossFile` only disposes the BindingAccumulator
|
|
54
|
+
// (the legacy cross-file re-resolution it used to run was deleted with the
|
|
55
|
+
// call-resolution DAG).
|
|
59
56
|
deps: ['parse', 'crossFile', 'structure'],
|
|
60
57
|
async execute(ctx, deps) {
|
|
58
|
+
logHeapProbe('scopeResolution-enter');
|
|
61
59
|
const { scannedFiles } = getPhaseOutput(deps, 'structure');
|
|
62
|
-
// Reach into the parse phase's AST cache so per-file extract can
|
|
63
|
-
// skip a second tree-sitter parse. Cache miss is safe (re-parses).
|
|
64
|
-
// Worker-mode parses leave the cache empty for those files; they
|
|
65
|
-
// also fall back to a fresh parse — no correctness impact.
|
|
66
60
|
const parseOutput = getPhaseOutput(deps, 'parse');
|
|
67
|
-
const {
|
|
61
|
+
const { model, parsedFiles: workerParsedFiles } = parseOutput;
|
|
68
62
|
// SemanticModel populated during `parse`: scope-resolution consumes
|
|
69
63
|
// TypeRegistry / MethodRegistry / SymbolTable lookups instead of
|
|
70
64
|
// rebuilding parallel indexes. See ARCHITECTURE.md § "Semantic-model
|
|
71
65
|
// source of truth".
|
|
72
|
-
const model = resolutionContext.model;
|
|
73
66
|
// Build a per-file lookup of ParsedFile artifacts the workers (or
|
|
74
67
|
// sequential extracts) already produced. Threading this into
|
|
75
68
|
// `runScopeResolution` lets the per-language extract loop short-
|
|
@@ -81,6 +74,15 @@ export const scopeResolutionPhase = {
|
|
|
81
74
|
for (const pf of workerParsedFiles) {
|
|
82
75
|
preExtractedByPath.set(pf.filePath, pf);
|
|
83
76
|
}
|
|
77
|
+
// Disk-backed ParsedFile store (#1983): on huge repos the parse phase
|
|
78
|
+
// flushes worker-produced ParsedFiles to disk (instead of `workerParsedFiles`
|
|
79
|
+
// heap) and we stream them back here per language. Reusing them means
|
|
80
|
+
// scope-resolution does ZERO tree-sitter parsing on the main thread, which
|
|
81
|
+
// is what eliminates the unbounded native re-parse leak that OOM'd large
|
|
82
|
+
// analyses. `undefined` when no storage path (tests / direct calls) — those
|
|
83
|
+
// runs use the in-heap `workerParsedFiles` above or fall back to a fresh
|
|
84
|
+
// extract per file inside runScopeResolution.
|
|
85
|
+
const parsedFileStorePath = ctx.options?.parseCache?.storagePath;
|
|
84
86
|
// Drop pre-extracted entries for standalone providers — these
|
|
85
87
|
// languages are skipped by the canonical guard below (line 164)
|
|
86
88
|
// and never consume preExtractedByPath, so holding onto their
|
|
@@ -103,12 +105,30 @@ export const scopeResolutionPhase = {
|
|
|
103
105
|
const perLanguage = new Map();
|
|
104
106
|
// Pre-count files and languages for progress reporting. This avoids
|
|
105
107
|
// a frozen progress bar during long scope-resolution runs (#1741).
|
|
108
|
+
// Uses primary-language file counts only; languages that expand their
|
|
109
|
+
// context via collectScopeContextPaths may process more files than shown.
|
|
106
110
|
let totalScopeFiles = 0;
|
|
107
111
|
let totalScopeLangs = 0;
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
const allScannedPaths = new Set(scannedFiles.map((f) => f.path));
|
|
113
|
+
// Partition scanned files by language ONCE (O(F)). The previous code
|
|
114
|
+
// re-filtered all scannedFiles per language for the precount AND again in the
|
|
115
|
+
// per-language loop below — O(languages × files), ~2.3M getLanguageFromFilename
|
|
116
|
+
// calls on the Linux kernel. Bucketing once collapses that to O(F).
|
|
117
|
+
// Language-agnostic: keyed by the provider-supplied SupportedLanguages value.
|
|
118
|
+
const filesByLang = new Map();
|
|
119
|
+
for (const f of scannedFiles) {
|
|
120
|
+
const fileLang = getLanguageFromFilename(f.path);
|
|
121
|
+
if (fileLang === null)
|
|
110
122
|
continue;
|
|
111
|
-
|
|
123
|
+
let bucket = filesByLang.get(fileLang);
|
|
124
|
+
if (bucket === undefined) {
|
|
125
|
+
bucket = [];
|
|
126
|
+
filesByLang.set(fileLang, bucket);
|
|
127
|
+
}
|
|
128
|
+
bucket.push(f);
|
|
129
|
+
}
|
|
130
|
+
for (const [lang] of SCOPE_RESOLVERS) {
|
|
131
|
+
const count = filesByLang.get(lang)?.length ?? 0;
|
|
112
132
|
if (count > 0) {
|
|
113
133
|
totalScopeLangs++;
|
|
114
134
|
totalScopeFiles += count;
|
|
@@ -125,9 +145,18 @@ export const scopeResolutionPhase = {
|
|
|
125
145
|
message: 'Resolving types',
|
|
126
146
|
});
|
|
127
147
|
}
|
|
148
|
+
// Build the graph-node lookup ONCE and share it across every language pass.
|
|
149
|
+
// It scans the whole graph (~2 GB on the kernel) and is language-agnostic,
|
|
150
|
+
// so the previous per-language rebuild burned that CPU+heap N times and, on
|
|
151
|
+
// a huge repo, a tiny language's full-graph copy overlapped the next
|
|
152
|
+
// language's — a real contributor to the scope-resolution memory peak.
|
|
153
|
+
// Bracket the whole-graph node-lookup build with probes — scanning every
|
|
154
|
+
// graph node is the silent multi-minute step before the first per-language
|
|
155
|
+
// marker on huge repos, so make it observable.
|
|
156
|
+
logHeapProbe('scope-setup-nodeLookup-start', `langs=${totalScopeLangs} files=${totalScopeFiles}`);
|
|
157
|
+
const sharedNodeLookup = totalScopeFiles > 0 ? buildGraphNodeLookup(ctx.graph) : undefined;
|
|
158
|
+
logHeapProbe('scope-setup-nodeLookup-end', `langs=${totalScopeLangs}`);
|
|
128
159
|
for (const [lang, provider] of SCOPE_RESOLVERS) {
|
|
129
|
-
if (!isRegistryPrimary(lang))
|
|
130
|
-
continue;
|
|
131
160
|
// Standalone providers (COBOL, JCL) don't emit graph edges yet
|
|
132
161
|
// through the scope-resolution path. This is the canonical guard:
|
|
133
162
|
// runScopeResolution is never called for standalone providers, which
|
|
@@ -136,17 +165,10 @@ export const scopeResolutionPhase = {
|
|
|
136
165
|
// SCOPE_RESOLVERS.
|
|
137
166
|
if (provider.languageProvider.parseStrategy === 'standalone')
|
|
138
167
|
continue;
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
168
|
+
const primaryLangFiles = filesByLang.get(lang) ?? [];
|
|
169
|
+
if (primaryLangFiles.length === 0)
|
|
141
170
|
continue;
|
|
142
|
-
const
|
|
143
|
-
const contents = await readFileContents(ctx.repoPath, filePaths);
|
|
144
|
-
const files = [];
|
|
145
|
-
for (const fp of filePaths) {
|
|
146
|
-
const content = contents.get(fp);
|
|
147
|
-
if (content !== undefined)
|
|
148
|
-
files.push({ path: fp, content });
|
|
149
|
-
}
|
|
171
|
+
const primaryFilePaths = primaryLangFiles.map((f) => f.path);
|
|
150
172
|
// Load per-language import-resolution config (tsconfig paths,
|
|
151
173
|
// composer.json autoload, go.mod, ...). One I/O round trip per
|
|
152
174
|
// workspace pass — cached implicitly by the result handed to
|
|
@@ -154,7 +176,84 @@ export const scopeResolutionPhase = {
|
|
|
154
176
|
const resolutionConfig = provider.loadResolutionConfig !== undefined
|
|
155
177
|
? await provider.loadResolutionConfig(ctx.repoPath)
|
|
156
178
|
: undefined;
|
|
179
|
+
// Some languages (e.g. Vue) expand their file universe beyond the
|
|
180
|
+
// primary-language files via the `collectScopeContextPaths` hook.
|
|
181
|
+
// The hook receives raw source contents of the primary files so it
|
|
182
|
+
// can trace import closures without a second tree-sitter parse.
|
|
183
|
+
//
|
|
184
|
+
// To avoid reading primary files twice (once for the hook, once for
|
|
185
|
+
// the resolution pass), we read them upfront and merge with the
|
|
186
|
+
// extra context paths the hook may add.
|
|
187
|
+
// Stream this language's pre-built ParsedFiles in from the disk store
|
|
188
|
+
// FIRST (huge-repo path). Doing it before reading source lets us skip
|
|
189
|
+
// loading content for files the store already covers — for a provider
|
|
190
|
+
// with no content-consuming hook that source is pure dead weight once
|
|
191
|
+
// extraction is served from the store (~1.5 GB on the kernel's C pass).
|
|
192
|
+
// Merged into `preExtractedByPath`; the per-language release block below
|
|
193
|
+
// evicts these again before the next language, so only one language's
|
|
194
|
+
// ParsedFiles are resident at a time.
|
|
195
|
+
const loadStoreFor = async (paths) => {
|
|
196
|
+
if (!parsedFileStorePath)
|
|
197
|
+
return;
|
|
198
|
+
const fromDisk = await loadParsedFilesForPaths(parsedFileStorePath, paths);
|
|
199
|
+
for (const [fp, pf] of fromDisk)
|
|
200
|
+
preExtractedByPath.set(fp, pf);
|
|
201
|
+
};
|
|
202
|
+
// A provider that feeds source text into a post-extract hook
|
|
203
|
+
// (populateWorkspaceOwners / populateNamespaceSiblings /
|
|
204
|
+
// populateRangeBindings / emitPostResolutionEdges) needs content for ALL
|
|
205
|
+
// its files; one without those hooks only needs content for files the
|
|
206
|
+
// store does NOT cover (fresh-extract fallback). Keep this in sync with
|
|
207
|
+
// the getFileContents() call-sites in run.ts.
|
|
208
|
+
const providerNeedsAllContent = provider.populateWorkspaceOwners !== undefined ||
|
|
209
|
+
provider.populateNamespaceSiblings !== undefined ||
|
|
210
|
+
provider.populateRangeBindings !== undefined ||
|
|
211
|
+
provider.emitPostResolutionEdges !== undefined;
|
|
212
|
+
let scopeFilePaths;
|
|
213
|
+
let contents;
|
|
214
|
+
if (provider.collectScopeContextPaths !== undefined) {
|
|
215
|
+
// Context-expanding providers (e.g. Vue) need every primary file's
|
|
216
|
+
// source up front for the closure hook, so load it all.
|
|
217
|
+
const entryFileContents = await readFileContents(ctx.repoPath, primaryFilePaths);
|
|
218
|
+
scopeFilePaths = provider.collectScopeContextPaths({
|
|
219
|
+
primaryFilePaths,
|
|
220
|
+
preExtractedByPath,
|
|
221
|
+
entryFileContents,
|
|
222
|
+
allScannedPaths,
|
|
223
|
+
resolutionConfig,
|
|
224
|
+
});
|
|
225
|
+
// Read only the extra context files (TS/JS etc.) not already loaded.
|
|
226
|
+
const extraPaths = [...scopeFilePaths].filter((p) => !entryFileContents.has(p));
|
|
227
|
+
const extraContents = await readFileContents(ctx.repoPath, extraPaths);
|
|
228
|
+
contents = new Map([...entryFileContents, ...extraContents]);
|
|
229
|
+
await loadStoreFor(scopeFilePaths);
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
scopeFilePaths = new Set(primaryFilePaths);
|
|
233
|
+
await loadStoreFor(scopeFilePaths);
|
|
234
|
+
const pathsToRead = providerNeedsAllContent
|
|
235
|
+
? primaryFilePaths
|
|
236
|
+
: primaryFilePaths.filter((p) => !preExtractedByPath.has(p));
|
|
237
|
+
contents = await readFileContents(ctx.repoPath, pathsToRead);
|
|
238
|
+
}
|
|
239
|
+
const filePaths = [...scopeFilePaths];
|
|
240
|
+
const files = [];
|
|
241
|
+
for (const fp of filePaths) {
|
|
242
|
+
const content = contents.get(fp);
|
|
243
|
+
if (content !== undefined) {
|
|
244
|
+
files.push({ path: fp, content });
|
|
245
|
+
}
|
|
246
|
+
else if (preExtractedByPath.has(fp)) {
|
|
247
|
+
// Store covers extraction for this file and we deliberately skipped
|
|
248
|
+
// reading its source; the empty string is never consumed (the
|
|
249
|
+
// extract loop uses the pre-extracted ParsedFile and this provider
|
|
250
|
+
// has no content hook).
|
|
251
|
+
files.push({ path: fp, content: '' });
|
|
252
|
+
}
|
|
253
|
+
// else: uncovered AND unreadable → skip (unchanged from prior behavior).
|
|
254
|
+
}
|
|
157
255
|
const langFileCount = files.length;
|
|
256
|
+
logHeapProbe('scope-lang-start', `lang=${lang} files=${langFileCount} contentsLoaded=${contents.size}`);
|
|
158
257
|
const langLabel = lang.charAt(0).toUpperCase() + lang.slice(1);
|
|
159
258
|
currentLangIdx++;
|
|
160
259
|
const langTag = totalScopeLangs > 1 ? `${langLabel} [${currentLangIdx}/${totalScopeLangs}]` : langLabel;
|
|
@@ -171,9 +270,10 @@ export const scopeResolutionPhase = {
|
|
|
171
270
|
graph: ctx.graph,
|
|
172
271
|
model,
|
|
173
272
|
files,
|
|
174
|
-
treeCache: scopeTreeCache,
|
|
175
273
|
resolutionConfig,
|
|
274
|
+
prebuiltNodeLookup: sharedNodeLookup,
|
|
176
275
|
preExtractedParsedFiles: preExtractedByPath,
|
|
276
|
+
scopeIndexStorePath: parsedFileStorePath,
|
|
177
277
|
recordResolutionOutcome: (outcome) => {
|
|
178
278
|
resolutionOutcomes.push(outcome);
|
|
179
279
|
},
|
|
@@ -220,11 +320,27 @@ export const scopeResolutionPhase = {
|
|
|
220
320
|
// to reduce memory pressure. For large codebases (16K+ PHP files),
|
|
221
321
|
// holding all source code simultaneously with scope trees causes OOM.
|
|
222
322
|
// See: https://github.com/abhigyanpatwari/GitNexus/issues/1741
|
|
323
|
+
//
|
|
324
|
+
// Use `filePaths` (not `primaryFilePaths`) so that any context files
|
|
325
|
+
// added by `collectScopeContextPaths` (e.g. TS/JS files pulled in for
|
|
326
|
+
// Vue cross-file resolution) are also evicted and not held until GC.
|
|
223
327
|
files.length = 0;
|
|
224
328
|
contents.clear();
|
|
225
329
|
for (const fp of filePaths) {
|
|
226
330
|
preExtractedByPath.delete(fp);
|
|
227
331
|
}
|
|
332
|
+
// This language's ParsedFiles are now unreachable (runScopeResolution has
|
|
333
|
+
// returned and the Map entries are deleted). Force a GC HERE so a heavy
|
|
334
|
+
// language's ~17-20GB set (e.g. C/C++ on the Linux kernel) is reclaimed
|
|
335
|
+
// BEFORE the next language's store-load — instead of leaving V8 to collect
|
|
336
|
+
// it lazily under the next pass's allocation pressure (which, at a cap >=
|
|
337
|
+
// RAM, degrades into swap-thrash). Collects only dead objects: the live
|
|
338
|
+
// cross-file index of the next pass is untouched. The pre/post probe
|
|
339
|
+
// confirms whether old-space fragmentation defeats the reclaim.
|
|
340
|
+
logHeapProbe('lang-release-pre-gc', `lang=${lang}`);
|
|
341
|
+
forceGc();
|
|
342
|
+
logHeapProbe('lang-release-post-gc', `lang=${lang}`);
|
|
343
|
+
logHeapProbe('scope-lang-end', `lang=${lang} filesProcessed=${stats.filesProcessed}`);
|
|
228
344
|
processedScopeFiles += langFileCount;
|
|
229
345
|
anyRan = true;
|
|
230
346
|
totalFiles += stats.filesProcessed;
|
|
@@ -247,13 +363,18 @@ export const scopeResolutionPhase = {
|
|
|
247
363
|
detail: 'complete',
|
|
248
364
|
});
|
|
249
365
|
}
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
//
|
|
253
|
-
//
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
366
|
+
// Scope-resolution is the sole consumer of the disk-backed ParsedFile
|
|
367
|
+
// store; remove its shards now (can be many GB on a huge repo) so they
|
|
368
|
+
// don't linger in `.gitnexus`. Best-effort — never fail the phase on a
|
|
369
|
+
// cleanup error.
|
|
370
|
+
if (parsedFileStorePath) {
|
|
371
|
+
try {
|
|
372
|
+
await clearParsedFileStore(parsedFileStorePath);
|
|
373
|
+
}
|
|
374
|
+
catch {
|
|
375
|
+
/* best-effort cleanup */
|
|
376
|
+
}
|
|
377
|
+
}
|
|
257
378
|
if (!anyRan)
|
|
258
379
|
return NOOP_OUTPUT;
|
|
259
380
|
return {
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
12
12
|
import type { ScopeResolver } from '../contract/scope-resolver.js';
|
|
13
|
-
/** Map of `SupportedLanguages` → `ScopeResolver`. The phase
|
|
14
|
-
* this map
|
|
15
|
-
*
|
|
16
|
-
* safe — the resolver sits idle until the language is migrated. */
|
|
13
|
+
/** Map of `SupportedLanguages` → `ScopeResolver`. The scope-resolution phase
|
|
14
|
+
* iterates this map directly — every registered resolver runs. This is the
|
|
15
|
+
* single source of truth for which languages resolve via scope-resolution. */
|
|
17
16
|
export declare const SCOPE_RESOLVERS: ReadonlyMap<SupportedLanguages, ScopeResolver>;
|
|
@@ -22,10 +22,12 @@ import { javascriptScopeResolver } from '../../languages/javascript/scope-resolv
|
|
|
22
22
|
import { kotlinScopeResolver } from '../../languages/kotlin/scope-resolver.js';
|
|
23
23
|
import { rubyScopeResolver } from '../../languages/ruby/scope-resolver.js';
|
|
24
24
|
import { cobolScopeResolver } from '../../languages/cobol/scope-resolver.js';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
import { swiftScopeResolver } from '../../languages/swift/scope-resolver.js';
|
|
26
|
+
import { dartScopeResolver } from '../../languages/dart/scope-resolver.js';
|
|
27
|
+
import { vueScopeResolver } from '../../languages/vue/scope-resolver.js';
|
|
28
|
+
/** Map of `SupportedLanguages` → `ScopeResolver`. The scope-resolution phase
|
|
29
|
+
* iterates this map directly — every registered resolver runs. This is the
|
|
30
|
+
* single source of truth for which languages resolve via scope-resolution. */
|
|
29
31
|
export const SCOPE_RESOLVERS = new Map([
|
|
30
32
|
[SupportedLanguages.Python, pythonScopeResolver],
|
|
31
33
|
[SupportedLanguages.CSharp, csharpScopeResolver],
|
|
@@ -40,4 +42,7 @@ export const SCOPE_RESOLVERS = new Map([
|
|
|
40
42
|
[SupportedLanguages.Kotlin, kotlinScopeResolver],
|
|
41
43
|
[SupportedLanguages.Ruby, rubyScopeResolver],
|
|
42
44
|
[SupportedLanguages.Cobol, cobolScopeResolver],
|
|
45
|
+
[SupportedLanguages.Swift, swiftScopeResolver],
|
|
46
|
+
[SupportedLanguages.Dart, dartScopeResolver],
|
|
47
|
+
[SupportedLanguages.Vue, vueScopeResolver],
|
|
43
48
|
]);
|
|
@@ -26,6 +26,7 @@ import type { ParsedFile } from '../../../../_shared/index.js';
|
|
|
26
26
|
import type { KnowledgeGraph } from '../../../graph/types.js';
|
|
27
27
|
import type { MutableSemanticModel } from '../../model/semantic-model.js';
|
|
28
28
|
import { type ResolveStats } from '../../resolve-references.js';
|
|
29
|
+
import { buildGraphNodeLookup } from '../graph-bridge/node-lookup.js';
|
|
29
30
|
import type { ScopeResolver } from '../contract/scope-resolver.js';
|
|
30
31
|
import type { ResolutionOutcome, ResolutionOutcomeRecorder } from '../resolution-outcome.js';
|
|
31
32
|
export type ScopeResolutionSubPhase = 'extracting' | 'analyzing types' | 'resolving references' | 'linking symbols';
|
|
@@ -47,15 +48,28 @@ interface RunScopeResolutionInput {
|
|
|
47
48
|
}[];
|
|
48
49
|
readonly onWarn?: (message: string) => void;
|
|
49
50
|
/**
|
|
50
|
-
* Optional pre-parsed-Tree lookup keyed by file path
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
51
|
+
* Optional pre-parsed-Tree lookup keyed by file path: a cache hit lets the
|
|
52
|
+
* per-file extract step skip a second `tree-sitter parser.parse(...)` call.
|
|
53
|
+
* Currently always empty — the only producer was the (removed) sequential
|
|
54
|
+
* parser, and workers can't return native Trees across the MessageChannel,
|
|
55
|
+
* so the parse phase no longer threads one. Kept as an extension point;
|
|
56
|
+
* cache miss is safe (the provider re-parses).
|
|
55
57
|
*/
|
|
56
58
|
readonly treeCache?: {
|
|
57
59
|
get(filePath: string): unknown;
|
|
58
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Optional graph-node lookup built ONCE by the caller and shared across
|
|
63
|
+
* every language pass. `buildGraphNodeLookup` scans the whole graph and is
|
|
64
|
+
* language-agnostic, so rebuilding it per language wastes both CPU and ~GBs
|
|
65
|
+
* of heap (on the kernel it is ~2 GB; a 5-file language would otherwise build
|
|
66
|
+
* its own full copy that then overlaps the next language's). When omitted
|
|
67
|
+
* (tests / isolated calls) the lookup is built locally as before. Providers
|
|
68
|
+
* that add graph nodes mid-pass (e.g. Ruby heritage Property nodes) still
|
|
69
|
+
* rebuild a fresh post-heritage lookup internally, so sharing the pre-loop
|
|
70
|
+
* base is safe.
|
|
71
|
+
*/
|
|
72
|
+
readonly prebuiltNodeLookup?: ReturnType<typeof buildGraphNodeLookup>;
|
|
59
73
|
/**
|
|
60
74
|
* Opaque per-language import-resolution config (e.g. tsconfig path
|
|
61
75
|
* aliases for TypeScript). Loaded once by the caller via
|
|
@@ -80,6 +94,15 @@ interface RunScopeResolutionInput {
|
|
|
80
94
|
* Cache miss is safe — falls back to fresh extract.
|
|
81
95
|
*/
|
|
82
96
|
readonly preExtractedParsedFiles?: ReadonlyMap<string, ParsedFile>;
|
|
97
|
+
/**
|
|
98
|
+
* Out-of-core scope index (disk-backed scope seal). When set AND `GITNEXUS_DISK_SCOPE_INDEX` is
|
|
99
|
+
* enabled, the per-language `scopeTree` is sealed to a disk-backed store at
|
|
100
|
+
* this path after resolve (before emit), and the heavy `Scope.bindings`
|
|
101
|
+
* payload is dropped from heap — lowering the per-language peak (kernel:
|
|
102
|
+
* ~20→~12 GB) so the analysis fits on smaller-RAM machines. Same storage path
|
|
103
|
+
* as the ParsedFile store; a sibling `scope-index-store/` dir.
|
|
104
|
+
*/
|
|
105
|
+
readonly scopeIndexStorePath?: string;
|
|
83
106
|
/**
|
|
84
107
|
* Optional additive diagnostics sink. Resolver passes call this when they
|
|
85
108
|
* intentionally suppress an edge; the graph remains unchanged.
|