gitnexus 1.6.6-rc.98 → 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 +247 -26
- 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
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* MRO primitives.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `c3Linearize` and its BFS helper `gatherAncestors` are pure functions over a
|
|
5
|
+
* `parentMap` (classId → parent ids). They carry no dependency on the semantic
|
|
6
|
+
* model or graph, so the model layer stays a pure leaf — `mro-processor.ts`
|
|
7
|
+
* (graph-level MRO emission) imports `c3Linearize` / `gatherAncestors` from here.
|
|
7
8
|
*/
|
|
8
|
-
import type { SymbolDefinition } from '../../../_shared/index.js';
|
|
9
|
-
import type { SemanticModel } from './semantic-model.js';
|
|
10
|
-
import type { HeritageMap } from './heritage-map.js';
|
|
11
|
-
import type { MroStrategy } from '../../../_shared/index.js';
|
|
12
9
|
/**
|
|
13
10
|
* Gather all ancestor IDs in BFS / topological order.
|
|
14
11
|
* Returns the linearized list of ancestor IDs (excluding the class itself).
|
|
15
12
|
*
|
|
16
13
|
* Uses a head-pointer BFS (`queue[head++]`) instead of `Array.shift()` to
|
|
17
|
-
* avoid O(n) per-dequeue re-indexing
|
|
14
|
+
* avoid O(n) per-dequeue re-indexing.
|
|
18
15
|
*/
|
|
19
16
|
declare function gatherAncestors(classId: string, parentMap: Map<string, string[]>): string[];
|
|
20
17
|
/**
|
|
@@ -22,40 +19,7 @@ declare function gatherAncestors(classId: string, parentMap: Map<string, string[
|
|
|
22
19
|
* Returns an array of ancestor IDs in C3 order (excluding the class itself),
|
|
23
20
|
* or null if linearization fails (inconsistent or cyclic hierarchy).
|
|
24
21
|
*
|
|
25
|
-
*
|
|
26
|
-
* strategy and re-exported for mro-processor.ts (graph-level MRO emission).
|
|
22
|
+
* Re-exported for mro-processor.ts (graph-level MRO emission).
|
|
27
23
|
*/
|
|
28
24
|
export declare function c3Linearize(classId: string, parentMap: Map<string, string[]>, cache: Map<string, string[] | null>, inProgress?: Set<string>): string[] | null;
|
|
29
25
|
export { gatherAncestors };
|
|
30
|
-
/**
|
|
31
|
-
* DAG stage 5 helper: look up a method on an owner class via MRO walk.
|
|
32
|
-
*
|
|
33
|
-
* Low-level resolver; no dependency on SymbolTable, language registry, or
|
|
34
|
-
* resolution-context (keeps model/ layer free of cross-layer imports).
|
|
35
|
-
* All strategies respect `argCount` for overload narrowing.
|
|
36
|
-
* `ancestryOverride` replaces the default walk; caller must compute it correctly.
|
|
37
|
-
*
|
|
38
|
-
* Strategy summary (full docs in gitnexus-shared/mro-strategy.ts):
|
|
39
|
-
* - `first-wins` / `leftmost-base` / `implements-split`: BFS, first match wins.
|
|
40
|
-
* - `c3`: C3-linearized order; falls back to BFS on cycle/inconsistency.
|
|
41
|
-
* - `qualified-syntax`: returns undefined immediately (Rust requires explicit syntax).
|
|
42
|
-
* - `ruby-mixin`: kind-aware walk — see inline comments below.
|
|
43
|
-
*
|
|
44
|
-
* Internal API: exported for call-processor resolvers and tests.
|
|
45
|
-
* External callers should use resolveMemberCall instead.
|
|
46
|
-
*
|
|
47
|
-
* @see gitnexus-shared/mro-strategy.ts § 'ruby-mixin'
|
|
48
|
-
* @see call-processor.ts § resolveMemberCall
|
|
49
|
-
*/
|
|
50
|
-
export declare const lookupMethodByOwnerWithMRO: (ownerNodeId: string, methodName: string, heritageMap: HeritageMap, model: SemanticModel, strategy: MroStrategy, argCount?: number,
|
|
51
|
-
/**
|
|
52
|
-
* Optional pre-computed ancestry list. When provided, overrides the default
|
|
53
|
-
* per-strategy ancestry source. Primarily used by Ruby singleton dispatch:
|
|
54
|
-
* the caller supplies `heritageMap.getSingletonAncestry(ownerNodeId)` as
|
|
55
|
-
* node-id array so this walker resolves against `extend` providers only.
|
|
56
|
-
*
|
|
57
|
-
* For `ruby-mixin` strategy, passing an override switches the walker into
|
|
58
|
-
* a no-prepend-no-direct linear scan (the caller has already decided the
|
|
59
|
-
* order), which is the correct semantics for singleton dispatch.
|
|
60
|
-
*/
|
|
61
|
-
ancestryOverride?: readonly string[]) => SymbolDefinition | undefined;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* MRO primitives.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* `c3Linearize` and its BFS helper `gatherAncestors` are pure functions over a
|
|
5
|
+
* `parentMap` (classId → parent ids). They carry no dependency on the semantic
|
|
6
|
+
* model or graph, so the model layer stays a pure leaf — `mro-processor.ts`
|
|
7
|
+
* (graph-level MRO emission) imports `c3Linearize` / `gatherAncestors` from here.
|
|
7
8
|
*/
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// MRO primitives.
|
|
10
|
-
//
|
|
11
|
-
// `c3Linearize` and its BFS helper `gatherAncestors` live here so the model
|
|
12
|
-
// layer stays a pure leaf — mro-processor.ts (graph-level MRO emission)
|
|
13
|
-
// imports `c3Linearize` from this file.
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
9
|
/**
|
|
16
10
|
* Gather all ancestor IDs in BFS / topological order.
|
|
17
11
|
* Returns the linearized list of ancestor IDs (excluding the class itself).
|
|
18
12
|
*
|
|
19
13
|
* Uses a head-pointer BFS (`queue[head++]`) instead of `Array.shift()` to
|
|
20
|
-
* avoid O(n) per-dequeue re-indexing
|
|
14
|
+
* avoid O(n) per-dequeue re-indexing.
|
|
21
15
|
*/
|
|
22
16
|
function gatherAncestors(classId, parentMap) {
|
|
23
17
|
const visited = new Set();
|
|
@@ -45,8 +39,7 @@ function gatherAncestors(classId, parentMap) {
|
|
|
45
39
|
* Returns an array of ancestor IDs in C3 order (excluding the class itself),
|
|
46
40
|
* or null if linearization fails (inconsistent or cyclic hierarchy).
|
|
47
41
|
*
|
|
48
|
-
*
|
|
49
|
-
* strategy and re-exported for mro-processor.ts (graph-level MRO emission).
|
|
42
|
+
* Re-exported for mro-processor.ts (graph-level MRO emission).
|
|
50
43
|
*/
|
|
51
44
|
export function c3Linearize(classId, parentMap, cache, inProgress) {
|
|
52
45
|
if (cache.has(classId))
|
|
@@ -187,215 +180,3 @@ export function c3Linearize(classId, parentMap, cache, inProgress) {
|
|
|
187
180
|
// `gatherAncestors` is exported so mro-processor.ts can reuse the same
|
|
188
181
|
// BFS traversal for graph-level MRO emission.
|
|
189
182
|
export { gatherAncestors };
|
|
190
|
-
// ---------------------------------------------------------------------------
|
|
191
|
-
// C3 linearization cache (per HeritageMap, auto-drained via WeakMap)
|
|
192
|
-
// ---------------------------------------------------------------------------
|
|
193
|
-
/**
|
|
194
|
-
* Per-HeritageMap cache of C3 linearization results keyed by owner nodeId.
|
|
195
|
-
*
|
|
196
|
-
* HeritageMap instances are immutable after construction, so C3 output is
|
|
197
|
-
* stable for the lifetime of a HeritageMap. WeakMap lets the cache auto-drain
|
|
198
|
-
* when the HeritageMap is garbage collected (end of ingestion run), so we
|
|
199
|
-
* never need to manually invalidate it.
|
|
200
|
-
*
|
|
201
|
-
* `null` is a sentinel for "C3 failed for this owner" (cyclic or inconsistent
|
|
202
|
-
* hierarchy) so we don't re-run the expensive linearization repeatedly.
|
|
203
|
-
*/
|
|
204
|
-
const c3LinearizationCache = new WeakMap();
|
|
205
|
-
const getCachedC3Linearization = (ownerNodeId, heritageMap) => {
|
|
206
|
-
let perHmCache = c3LinearizationCache.get(heritageMap);
|
|
207
|
-
if (!perHmCache) {
|
|
208
|
-
perHmCache = new Map();
|
|
209
|
-
c3LinearizationCache.set(heritageMap, perHmCache);
|
|
210
|
-
}
|
|
211
|
-
const cached = perHmCache.get(ownerNodeId);
|
|
212
|
-
if (cached !== undefined)
|
|
213
|
-
return cached;
|
|
214
|
-
const parentMap = buildParentMapFromHeritage(ownerNodeId, heritageMap);
|
|
215
|
-
const result = c3Linearize(ownerNodeId, parentMap, new Map()) ?? null;
|
|
216
|
-
perHmCache.set(ownerNodeId, result);
|
|
217
|
-
return result;
|
|
218
|
-
};
|
|
219
|
-
// ---------------------------------------------------------------------------
|
|
220
|
-
// Heritage → parentMap conversion
|
|
221
|
-
// ---------------------------------------------------------------------------
|
|
222
|
-
/**
|
|
223
|
-
* Build a parentMap from HeritageMap for use with c3Linearize.
|
|
224
|
-
* Traverses the parent chain starting from startNodeId, collecting all
|
|
225
|
-
* parent→children relationships into a Map<string, string[]>.
|
|
226
|
-
*
|
|
227
|
-
* Uses a head-pointer BFS (queue[head++]) instead of Array.shift() to avoid
|
|
228
|
-
* O(n) per-dequeue re-indexing. For wide/shallow hierarchies common in
|
|
229
|
-
* large Java/C# codebases this keeps the walk linear in ancestor count.
|
|
230
|
-
*/
|
|
231
|
-
const buildParentMapFromHeritage = (startNodeId, heritageMap) => {
|
|
232
|
-
const parentMap = new Map();
|
|
233
|
-
const visited = new Set();
|
|
234
|
-
const queue = [startNodeId];
|
|
235
|
-
let head = 0;
|
|
236
|
-
while (head < queue.length) {
|
|
237
|
-
const nodeId = queue[head++];
|
|
238
|
-
if (visited.has(nodeId))
|
|
239
|
-
continue;
|
|
240
|
-
visited.add(nodeId);
|
|
241
|
-
const parents = heritageMap.getParents(nodeId);
|
|
242
|
-
if (parents.length > 0) {
|
|
243
|
-
parentMap.set(nodeId, parents);
|
|
244
|
-
for (const p of parents) {
|
|
245
|
-
if (!visited.has(p))
|
|
246
|
-
queue.push(p);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return parentMap;
|
|
251
|
-
};
|
|
252
|
-
// ---------------------------------------------------------------------------
|
|
253
|
-
// MRO-aware method lookup
|
|
254
|
-
// ---------------------------------------------------------------------------
|
|
255
|
-
/**
|
|
256
|
-
* DAG stage 5 helper: look up a method on an owner class via MRO walk.
|
|
257
|
-
*
|
|
258
|
-
* Low-level resolver; no dependency on SymbolTable, language registry, or
|
|
259
|
-
* resolution-context (keeps model/ layer free of cross-layer imports).
|
|
260
|
-
* All strategies respect `argCount` for overload narrowing.
|
|
261
|
-
* `ancestryOverride` replaces the default walk; caller must compute it correctly.
|
|
262
|
-
*
|
|
263
|
-
* Strategy summary (full docs in gitnexus-shared/mro-strategy.ts):
|
|
264
|
-
* - `first-wins` / `leftmost-base` / `implements-split`: BFS, first match wins.
|
|
265
|
-
* - `c3`: C3-linearized order; falls back to BFS on cycle/inconsistency.
|
|
266
|
-
* - `qualified-syntax`: returns undefined immediately (Rust requires explicit syntax).
|
|
267
|
-
* - `ruby-mixin`: kind-aware walk — see inline comments below.
|
|
268
|
-
*
|
|
269
|
-
* Internal API: exported for call-processor resolvers and tests.
|
|
270
|
-
* External callers should use resolveMemberCall instead.
|
|
271
|
-
*
|
|
272
|
-
* @see gitnexus-shared/mro-strategy.ts § 'ruby-mixin'
|
|
273
|
-
* @see call-processor.ts § resolveMemberCall
|
|
274
|
-
*/
|
|
275
|
-
export const lookupMethodByOwnerWithMRO = (ownerNodeId, methodName, heritageMap, model, strategy, argCount,
|
|
276
|
-
/**
|
|
277
|
-
* Optional pre-computed ancestry list. When provided, overrides the default
|
|
278
|
-
* per-strategy ancestry source. Primarily used by Ruby singleton dispatch:
|
|
279
|
-
* the caller supplies `heritageMap.getSingletonAncestry(ownerNodeId)` as
|
|
280
|
-
* node-id array so this walker resolves against `extend` providers only.
|
|
281
|
-
*
|
|
282
|
-
* For `ruby-mixin` strategy, passing an override switches the walker into
|
|
283
|
-
* a no-prepend-no-direct linear scan (the caller has already decided the
|
|
284
|
-
* order), which is the correct semantics for singleton dispatch.
|
|
285
|
-
*/
|
|
286
|
-
ancestryOverride) => {
|
|
287
|
-
// ── Ruby mixin strategy ───────────────────────────────────────────
|
|
288
|
-
// Kind-aware walk — does NOT short-circuit on direct owner first (prepend beats direct).
|
|
289
|
-
// Instance dispatch: prepend (reverse) → direct → include (reverse) → transitive BFS.
|
|
290
|
-
// Singleton dispatch: caller supplies ancestryOverride (extend providers only);
|
|
291
|
-
// simple left-to-right scan. Miss NEVER falls through to file-scoped fallback.
|
|
292
|
-
// See gitnexus-shared/mro-strategy.ts § 'ruby-mixin' for full strategy docs.
|
|
293
|
-
if (strategy === 'ruby-mixin') {
|
|
294
|
-
if (ancestryOverride) {
|
|
295
|
-
// Singleton dispatch: scan pre-computed ancestry only. Miss null-routes.
|
|
296
|
-
for (const ancestorId of ancestryOverride) {
|
|
297
|
-
const method = model.methods.lookupMethodByOwner(ancestorId, methodName, argCount);
|
|
298
|
-
if (method)
|
|
299
|
-
return method;
|
|
300
|
-
}
|
|
301
|
-
return undefined;
|
|
302
|
-
}
|
|
303
|
-
// Instance dispatch — kind-aware walk per the pseudocode above.
|
|
304
|
-
const instanceEntries = heritageMap.getInstanceAncestry(ownerNodeId);
|
|
305
|
-
// Partition into prepend parents vs other parents (extends / include /
|
|
306
|
-
// implements / trait-impl), preserving declaration order within each.
|
|
307
|
-
const prependParents = [];
|
|
308
|
-
const otherParents = [];
|
|
309
|
-
for (const e of instanceEntries) {
|
|
310
|
-
if (e.kind === 'prepend')
|
|
311
|
-
prependParents.push(e.parentId);
|
|
312
|
-
else
|
|
313
|
-
otherParents.push(e.parentId);
|
|
314
|
-
}
|
|
315
|
-
// Step 1: Walk prepend parents in REVERSE declaration order (last-prepended wins).
|
|
316
|
-
for (let i = prependParents.length - 1; i >= 0; i--) {
|
|
317
|
-
const method = model.methods.lookupMethodByOwner(prependParents[i], methodName, argCount);
|
|
318
|
-
if (method)
|
|
319
|
-
return method;
|
|
320
|
-
}
|
|
321
|
-
// Step 2: Direct owner lookup (the class's own method).
|
|
322
|
-
// This is the only difference from other strategies — prepend beats direct.
|
|
323
|
-
const direct = model.methods.lookupMethodByOwner(ownerNodeId, methodName, argCount);
|
|
324
|
-
if (direct)
|
|
325
|
-
return direct;
|
|
326
|
-
// Step 3: Walk extends + include parents in REVERSE declaration order.
|
|
327
|
-
// (Ruby `include A; include B` puts B ahead of A in MRO.)
|
|
328
|
-
for (let i = otherParents.length - 1; i >= 0; i--) {
|
|
329
|
-
const method = model.methods.lookupMethodByOwner(otherParents[i], methodName, argCount);
|
|
330
|
-
if (method)
|
|
331
|
-
return method;
|
|
332
|
-
}
|
|
333
|
-
// Step 4: Transitive ancestors (a mixin that itself mixes in another module).
|
|
334
|
-
// Fall back to the BFS ancestor walk for depth > 1. Order is best-effort;
|
|
335
|
-
// Ruby's actual MRO for transitive mixins is rare and under-specified
|
|
336
|
-
// (documented in architecture docs as deferred work).
|
|
337
|
-
//
|
|
338
|
-
// O(1) skip-check via Sets:
|
|
339
|
-
// - `walkedDirect` covers parents already visited in steps 1-3.
|
|
340
|
-
// - `singletonOnly` covers direct `extend` providers: they belong to
|
|
341
|
-
// the singleton MRO and must NEVER appear in instance dispatch.
|
|
342
|
-
// Building Sets once before the BFS loop avoids O(n²) `Array.includes`
|
|
343
|
-
// on large mixin hierarchies.
|
|
344
|
-
const walkedDirect = new Set(prependParents);
|
|
345
|
-
for (const id of otherParents)
|
|
346
|
-
walkedDirect.add(id);
|
|
347
|
-
const singletonOnly = new Set(heritageMap.getSingletonAncestry(ownerNodeId).map((e) => e.parentId));
|
|
348
|
-
for (const ancestorId of heritageMap.getAncestors(ownerNodeId)) {
|
|
349
|
-
if (ancestorId === ownerNodeId)
|
|
350
|
-
continue;
|
|
351
|
-
if (walkedDirect.has(ancestorId))
|
|
352
|
-
continue;
|
|
353
|
-
if (singletonOnly.has(ancestorId))
|
|
354
|
-
continue;
|
|
355
|
-
const method = model.methods.lookupMethodByOwner(ancestorId, methodName, argCount);
|
|
356
|
-
if (method)
|
|
357
|
-
return method;
|
|
358
|
-
}
|
|
359
|
-
return undefined;
|
|
360
|
-
}
|
|
361
|
-
// ── Non-Ruby strategies: direct-owner-first short-circuit ─────────
|
|
362
|
-
// Direct lookup first (child override — no walk needed).
|
|
363
|
-
// argCount is threaded through so arity-differing overloads on the direct
|
|
364
|
-
// owner can be disambiguated before the MRO walk starts.
|
|
365
|
-
const direct = model.methods.lookupMethodByOwner(ownerNodeId, methodName, argCount);
|
|
366
|
-
if (direct)
|
|
367
|
-
return direct;
|
|
368
|
-
// Rust: requires qualified syntax (<Type as Trait>::method), no auto-resolution
|
|
369
|
-
if (strategy === 'qualified-syntax')
|
|
370
|
-
return undefined;
|
|
371
|
-
// Determine ancestor walk order based on MRO strategy.
|
|
372
|
-
// readonly to accept the cached (frozen) c3 linearization without copying.
|
|
373
|
-
let ancestors;
|
|
374
|
-
if (ancestryOverride) {
|
|
375
|
-
ancestors = ancestryOverride;
|
|
376
|
-
}
|
|
377
|
-
else if (strategy === 'c3') {
|
|
378
|
-
// C3 linearization (memoized per HeritageMap
|
|
379
|
-
// so repeated calls for the same owner within an ingestion run reuse the
|
|
380
|
-
// linearization instead of rebuilding the parent map and re-running C3).
|
|
381
|
-
// c3Linearize returns ancestors only (excludes the owner itself),
|
|
382
|
-
// matching heritageMap.getAncestors() semantics.
|
|
383
|
-
const c3Result = getCachedC3Linearization(ownerNodeId, heritageMap);
|
|
384
|
-
// Fall back to BFS order if C3 fails (cyclic or inconsistent hierarchy).
|
|
385
|
-
// Note: BFS order may not preserve Python MRO semantics in these edge
|
|
386
|
-
// cases, but cyclic/inconsistent hierarchies are invalid in Python anyway.
|
|
387
|
-
ancestors = c3Result ?? heritageMap.getAncestors(ownerNodeId);
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
// first-wins, leftmost-base, implements-split: BFS order via HeritageMap
|
|
391
|
-
ancestors = heritageMap.getAncestors(ownerNodeId);
|
|
392
|
-
}
|
|
393
|
-
// Walk ancestors in MRO order — first match wins.
|
|
394
|
-
// argCount narrows overloaded ancestors the same way as the direct lookup.
|
|
395
|
-
for (const ancestorId of ancestors) {
|
|
396
|
-
const method = model.methods.lookupMethodByOwner(ancestorId, methodName, argCount);
|
|
397
|
-
if (method)
|
|
398
|
-
return method;
|
|
399
|
-
}
|
|
400
|
-
return undefined;
|
|
401
|
-
};
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* `ReferenceIndex` is deliberately NOT here — it is populated in a later
|
|
40
40
|
* phase (RFC §3.2 Phase 4 / Ring 2 PKG #925) and owned separately.
|
|
41
41
|
*/
|
|
42
|
-
import type { BindingRef, DefIndex, FinalizedScc, FinalizeStats, ImportEdge, MethodDispatchIndex, ModuleScopeIndex, QualifiedNameIndex, ReferenceSite, ScopeId, ScopeTree } from '../../../_shared/index.js';
|
|
42
|
+
import type { BindingRef, DefIndex, FinalizedScc, FinalizeStats, ImportEdge, MethodDispatchIndex, ModuleScopeIndex, QualifiedNameIndex, ReferenceSite, ScopeId, ScopeTree, TypeRef } from '../../../_shared/index.js';
|
|
43
43
|
export interface ScopeResolutionIndexes {
|
|
44
44
|
readonly scopeTree: ScopeTree;
|
|
45
45
|
readonly defs: DefIndex;
|
|
@@ -73,6 +73,51 @@ export interface ScopeResolutionIndexes {
|
|
|
73
73
|
* shared map gives those workspace-wide names one entry each instead of
|
|
74
74
|
* O(scopes × defs) per-scope augmentation. */
|
|
75
75
|
readonly workspaceFqnBindings: ReadonlyMap<string, readonly BindingRef[]>;
|
|
76
|
+
/** Workspace-level *type* binding lookup — the typeBindings analogue of
|
|
77
|
+
* `workspaceFqnBindings`. Holds names that are type-visible from every file
|
|
78
|
+
* (e.g. C# global/default-namespace method return-type bindings, keyed by
|
|
79
|
+
* the bound name). The C# language spec makes the unnamed global namespace a
|
|
80
|
+
* single declaration space whose members are available from inside named
|
|
81
|
+
* namespaces too — so this channel is consulted scope-independently by the
|
|
82
|
+
* typeBindings chain-walkers (`findReceiverTypeBinding`,
|
|
83
|
+
* `followChainPostFinalize`) as a final fallback after the per-scope chain.
|
|
84
|
+
* Routing global types here gives them one shared entry instead of the
|
|
85
|
+
* O(scopes × defs) per-file `Scope.typeBindings` copy that OOM'd large
|
|
86
|
+
* no-namespace solutions (#1871) — mirroring how Roslyn resolves against a
|
|
87
|
+
* single `Compilation.GlobalNamespace` symbol rather than per-file copies.
|
|
88
|
+
* Populated post-finalize by `populateCsharpNamespaceSiblings`; most
|
|
89
|
+
* languages leave it empty. */
|
|
90
|
+
readonly workspaceTypeBindings: ReadonlyMap<string, TypeRef>;
|
|
91
|
+
/** Per-namespace class/def binding lookup — the namespace-scoped analogue of
|
|
92
|
+
* `workspaceFqnBindings`. Outer key is the namespace name (e.g. `App.Models`),
|
|
93
|
+
* inner key is the simple name. Unlike the flat workspace channels (which are
|
|
94
|
+
* visible from *every* file — correct only for the global/default namespace),
|
|
95
|
+
* named-namespace types are visible only within that namespace and to files
|
|
96
|
+
* that import it, so this channel is consulted through an accessibility gate
|
|
97
|
+
* (`accessibleNamespacesByScope`) rather than unconditionally. Routing named
|
|
98
|
+
* siblings here gives them one entry per def instead of the O(files × defs)
|
|
99
|
+
* per-scope augmentation that OOM'd large single-namespace solutions (#1871).
|
|
100
|
+
* Populated post-finalize by language namespace-sibling hooks; most languages
|
|
101
|
+
* leave it empty. */
|
|
102
|
+
readonly namespaceFqnBindings: ReadonlyMap<string, ReadonlyMap<string, readonly BindingRef[]>>;
|
|
103
|
+
/** Per-namespace *type* binding lookup — the namespace-scoped analogue of
|
|
104
|
+
* `workspaceTypeBindings`. Outer key is the namespace name, inner key is the
|
|
105
|
+
* bound name (e.g. a method name mapping to its return TypeRef). Consulted by
|
|
106
|
+
* the typeBindings chain-walkers (`findReceiverTypeBinding`,
|
|
107
|
+
* `followChainPostFinalize`) through the `accessibleNamespacesByScope` gate
|
|
108
|
+
* after the per-scope chain and the flat `workspaceTypeBindings` miss.
|
|
109
|
+
* Populated post-finalize; most languages leave it empty. */
|
|
110
|
+
readonly namespaceTypeBindings: ReadonlyMap<string, ReadonlyMap<string, TypeRef>>;
|
|
111
|
+
/** Accessibility gate for the per-namespace channels: maps a module ScopeId to
|
|
112
|
+
* the namespace names type-visible from that file — its own declared
|
|
113
|
+
* namespace(s) plus every imported/`using`d namespace (and dotted prefixes).
|
|
114
|
+
* This is the same per-file accessible-namespace set the C# hook already
|
|
115
|
+
* derives (`expandedNamespaces`), materialized so the language-neutral walkers
|
|
116
|
+
* can consult `namespaceFqnBindings` / `namespaceTypeBindings` for exactly the
|
|
117
|
+
* namespaces a file can see — preserving namespace visibility semantics
|
|
118
|
+
* without the per-file binding copy. Empty when no language populates the
|
|
119
|
+
* namespace channels. */
|
|
120
|
+
readonly accessibleNamespacesByScope: ReadonlyMap<ScopeId, readonly string[]>;
|
|
76
121
|
/** Pre-resolution usage facts; consumed by the resolution phase. */
|
|
77
122
|
readonly referenceSites: readonly ReferenceSite[];
|
|
78
123
|
/** SCC condensation of the file-level import graph — callers that want
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* ↑
|
|
20
20
|
* model/semantic-model.ts — THIS FILE (orchestrator)
|
|
21
21
|
* ↑
|
|
22
|
-
* resolve.ts, call-processor.ts,
|
|
22
|
+
* resolve.ts, call-processor.ts, ...
|
|
23
23
|
*
|
|
24
24
|
* `symbol-table.ts` is a leaf — it never imports from `./model/`. This
|
|
25
25
|
* file (semantic-model.ts) is the ONLY place where SymbolTable and the
|
|
@@ -113,10 +113,8 @@ export interface SemanticModel {
|
|
|
113
113
|
/**
|
|
114
114
|
* Materialized scope-resolution indexes from RFC #909 Ring 2 PKG #921.
|
|
115
115
|
*
|
|
116
|
-
* `undefined` until the finalize-orchestrator attaches them.
|
|
117
|
-
*
|
|
118
|
-
* resolvers whose language has `REGISTRY_PRIMARY_<LANG>=true` consult
|
|
119
|
-
* these indexes instead.
|
|
116
|
+
* `undefined` until the finalize-orchestrator attaches them. Once set,
|
|
117
|
+
* the scope-resolution resolvers consult these indexes.
|
|
120
118
|
*
|
|
121
119
|
* The attach is a one-shot write (see `MutableSemanticModel`). Callers
|
|
122
120
|
* holding a read-only `SemanticModel` handle see either `undefined` or
|
|
@@ -126,7 +124,7 @@ export interface SemanticModel {
|
|
|
126
124
|
}
|
|
127
125
|
/** Mutable variant — exposes the MutableX registries, a Writer-typed
|
|
128
126
|
* `symbols` facade, and a full-cascade reset. This is the interface
|
|
129
|
-
* held by the lifecycle owner (pipeline
|
|
127
|
+
* held by the lifecycle owner (the parse pipeline); resolvers
|
|
130
128
|
* that only query should hold the narrower {@link SemanticModel}. */
|
|
131
129
|
export interface MutableSemanticModel extends SemanticModel {
|
|
132
130
|
readonly types: MutableTypeRegistry;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* ↑
|
|
20
20
|
* model/semantic-model.ts — THIS FILE (orchestrator)
|
|
21
21
|
* ↑
|
|
22
|
-
* resolve.ts, call-processor.ts,
|
|
22
|
+
* resolve.ts, call-processor.ts, ...
|
|
23
23
|
*
|
|
24
24
|
* `symbol-table.ts` is a leaf — it never imports from `./model/`. This
|
|
25
25
|
* file (semantic-model.ts) is the ONLY place where SymbolTable and the
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* ↑
|
|
28
28
|
* model/semantic-model.ts — orchestrator, wraps add()
|
|
29
29
|
* ↑
|
|
30
|
-
* model/resolve.ts, call-processor.ts,
|
|
30
|
+
* model/resolve.ts, call-processor.ts, ...
|
|
31
31
|
*
|
|
32
32
|
* No arrow ever points downward from this file. If you are tempted to
|
|
33
33
|
* import from `./model/` here, you are going the wrong way — move the
|
|
@@ -57,9 +57,8 @@ export type ClassLikeLabel = (typeof CLASS_TYPES_TUPLE)[number];
|
|
|
57
57
|
export declare const CLASS_TYPES: ReadonlySet<NodeLabel>;
|
|
58
58
|
/** Free-callable labels — single source of truth for "callables that have
|
|
59
59
|
* NO owner scope". Methods and constructors are owner-scoped and live in
|
|
60
|
-
* `MethodRegistry
|
|
61
|
-
*
|
|
62
|
-
* for how both indexes are consulted together.
|
|
60
|
+
* `MethodRegistry`, reached via `model.methods.lookupMethodByName`. Global
|
|
61
|
+
* by-name resolution consults both indexes (see `model/index.ts`).
|
|
63
62
|
*
|
|
64
63
|
* Exported as a `readonly` tuple so that `typeof FREE_CALLABLE_TUPLE[number]`
|
|
65
64
|
* yields a precise literal union (`FreeCallableLabel`). `registration-table.ts`
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* ↑
|
|
28
28
|
* model/semantic-model.ts — orchestrator, wraps add()
|
|
29
29
|
* ↑
|
|
30
|
-
* model/resolve.ts, call-processor.ts,
|
|
30
|
+
* model/resolve.ts, call-processor.ts, ...
|
|
31
31
|
*
|
|
32
32
|
* No arrow ever points downward from this file. If you are tempted to
|
|
33
33
|
* import from `./model/` here, you are going the wrong way — move the
|
|
@@ -62,9 +62,8 @@ export const CLASS_TYPES_TUPLE = [
|
|
|
62
62
|
export const CLASS_TYPES = new Set(CLASS_TYPES_TUPLE);
|
|
63
63
|
/** Free-callable labels — single source of truth for "callables that have
|
|
64
64
|
* NO owner scope". Methods and constructors are owner-scoped and live in
|
|
65
|
-
* `MethodRegistry
|
|
66
|
-
*
|
|
67
|
-
* for how both indexes are consulted together.
|
|
65
|
+
* `MethodRegistry`, reached via `model.methods.lookupMethodByName`. Global
|
|
66
|
+
* by-name resolution consults both indexes (see `model/index.ts`).
|
|
68
67
|
*
|
|
69
68
|
* Exported as a `readonly` tuple so that `typeof FREE_CALLABLE_TUPLE[number]`
|
|
70
69
|
* yields a precise literal union (`FreeCallableLabel`). `registration-table.ts`
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { KnowledgeGraph } from '../graph/types.js';
|
|
2
|
-
import type { SymbolTableWriter
|
|
3
|
-
import {
|
|
2
|
+
import type { SymbolTableWriter } from './model/index.js';
|
|
3
|
+
import { type ExportedTypeMap } from './call-processor.js';
|
|
4
4
|
import type { ParsedFile } from '../../_shared/index.js';
|
|
5
5
|
import { WorkerPool } from './workers/worker-pool.js';
|
|
6
|
-
import type { ParseWorkerResult,
|
|
6
|
+
import type { ParseWorkerResult, ExtractedRoute, ExtractedFetchCall, ExtractedDecoratorRoute, ExtractedToolDef, FileScopeBindings, ExtractedORMQuery, FetchWrapperDef } from './workers/parse-worker.js';
|
|
7
7
|
import type { ExtractedRouterImport, ExtractedRouterInclude, ExtractedRouterModuleAlias } from './route-extractors/fastapi-router-bindings.js';
|
|
8
8
|
export type FileProgressCallback = (current: number, total: number, filePath: string) => void;
|
|
9
9
|
export interface WorkerExtractedData {
|
|
10
|
-
imports: ExtractedImport[];
|
|
11
|
-
calls: ExtractedCall[];
|
|
12
|
-
assignments: ExtractedAssignment[];
|
|
13
|
-
heritage: ExtractedHeritage[];
|
|
14
10
|
routes: ExtractedRoute[];
|
|
15
11
|
fetchCalls: ExtractedFetchCall[];
|
|
16
12
|
fetchWrapperDefs: FetchWrapperDef[];
|
|
@@ -20,7 +16,6 @@ export interface WorkerExtractedData {
|
|
|
20
16
|
routerModuleAliases: ExtractedRouterModuleAlias[];
|
|
21
17
|
toolDefs: ExtractedToolDef[];
|
|
22
18
|
ormQueries: ExtractedORMQuery[];
|
|
23
|
-
constructorBindings: FileConstructorBindings[];
|
|
24
19
|
fileScopeBindings: FileScopeBindings[];
|
|
25
20
|
/**
|
|
26
21
|
* Per-file `ParsedFile` artifacts from the new scope-based resolution
|
|
@@ -35,31 +30,42 @@ export interface WorkerExtractedData {
|
|
|
35
30
|
* Merge a list of `ParseWorkerResult`s into the running graph + symbol
|
|
36
31
|
* table state and produce the chunk-aggregated `WorkerExtractedData`.
|
|
37
32
|
*
|
|
38
|
-
*
|
|
33
|
+
* Split out from the worker-parse path so the same merge logic can
|
|
39
34
|
* be applied to both freshly-parsed worker output AND cached worker
|
|
40
35
|
* output replayed during incremental analyze. Idempotent on the
|
|
41
36
|
* accumulator fields (push-only); idempotent on graph if the caller
|
|
42
37
|
* starts from a clean graph (otherwise duplicate `addNode` calls are
|
|
43
38
|
* silently no-op'd by `KnowledgeGraph`).
|
|
44
39
|
*/
|
|
45
|
-
export declare const mergeChunkResults: (graph: KnowledgeGraph, symbolTable: SymbolTableWriter, chunkResults: readonly ParseWorkerResult[]) => WorkerExtractedData;
|
|
46
|
-
|
|
40
|
+
export declare const mergeChunkResults: (graph: KnowledgeGraph, symbolTable: SymbolTableWriter, chunkResults: readonly ParseWorkerResult[], exportedTypeMap?: ExportedTypeMap) => WorkerExtractedData;
|
|
41
|
+
/**
|
|
42
|
+
* Dispatch a chunk's files to the worker pool and return the RAW per-worker
|
|
43
|
+
* results, WITHOUT merging them into the graph. Split out from
|
|
44
|
+
* {@link processParsing} so the parse loop can overlap one chunk's
|
|
45
|
+
* merge (main-thread, via {@link mergeChunkResults}) with the NEXT chunk's
|
|
46
|
+
* worker parse — the merge is the only remaining serial main-thread step once
|
|
47
|
+
* ParsedFile serialization moved into the workers (#worker-idle pipelining).
|
|
48
|
+
* Returns `[]` for an all-unparseable chunk (the caller merges `[]` → empty).
|
|
49
|
+
*/
|
|
50
|
+
export declare const dispatchChunkParse: (files: {
|
|
47
51
|
path: string;
|
|
48
52
|
content: string;
|
|
49
|
-
}[],
|
|
53
|
+
}[], workerPool: WorkerPool, onFileProgress?: FileProgressCallback,
|
|
54
|
+
/** Populated in-place with the raw results (parse-cache capture). */
|
|
55
|
+
outRawResults?: ParseWorkerResult[],
|
|
50
56
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* Worker-mode parses skip — Trees can't cross MessageChannels.
|
|
55
|
-
* Pass `undefined` if no consumer needs cross-phase access.
|
|
57
|
+
* Content hash of this parse chunk. When set, the workers tag their durable
|
|
58
|
+
* ParsedFile shards with it so a future warm cache hit can restore them
|
|
59
|
+
* (#2038). `undefined` ⇒ no durable write (tests / no-cache path).
|
|
56
60
|
*/
|
|
57
|
-
|
|
61
|
+
chunkHash?: string) => Promise<ParseWorkerResult[]>;
|
|
62
|
+
export declare const processParsing: (graph: KnowledgeGraph, files: {
|
|
63
|
+
path: string;
|
|
64
|
+
content: string;
|
|
65
|
+
}[], symbolTable: SymbolTableWriter, workerPool: WorkerPool, onFileProgress?: FileProgressCallback,
|
|
58
66
|
/**
|
|
59
|
-
* Optional out-parameter for the incremental parse cache. When
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Stays empty for the sequential fallback path (no per-chunk
|
|
63
|
-
* artifact to cache there). See `gitnexus/src/storage/parse-cache.ts`.
|
|
67
|
+
* Optional out-parameter for the incremental parse cache. When provided,
|
|
68
|
+
* populated with the raw `ParseWorkerResult[]` from the workers (pre-merge).
|
|
69
|
+
* See `gitnexus/src/storage/parse-cache.ts`.
|
|
64
70
|
*/
|
|
65
|
-
outRawResults?: ParseWorkerResult[]) => Promise<WorkerExtractedData
|
|
71
|
+
outRawResults?: ParseWorkerResult[], exportedTypeMap?: ExportedTypeMap) => Promise<WorkerExtractedData>;
|