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,148 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shadow-mode parity harness — dual-run observability for the RFC #909
|
|
3
|
-
* registry rollout (RFC §6.3; Ring 2 PKG #923).
|
|
4
|
-
*
|
|
5
|
-
* ## What it does
|
|
6
|
-
*
|
|
7
|
-
* - Exposes `record({ language, callsite, legacy, newResult })` for
|
|
8
|
-
* every call site where the caller has BOTH a legacy-DAG resolution
|
|
9
|
-
* and a new `Registry.lookup` resolution.
|
|
10
|
-
* - Computes a `ShadowDiff` per record via shared `diffResolutions`
|
|
11
|
-
* (#918) and accumulates them in a per-language bucket.
|
|
12
|
-
* - At the end of a run, aggregates into a `ShadowParityReport` via
|
|
13
|
-
* shared `aggregateDiffs` (#918) — per-language parity %,
|
|
14
|
-
* evidence-kind breakdown of divergences, grand-total overall row.
|
|
15
|
-
* - Optionally persists the report as JSON under
|
|
16
|
-
* `.gitnexus/shadow-parity/` so the static dashboard at
|
|
17
|
-
* `gitnexus/shadow-parity-dashboard/` can render it offline.
|
|
18
|
-
*
|
|
19
|
-
* ## What it does NOT do
|
|
20
|
-
*
|
|
21
|
-
* - **Invoke either resolution path itself.** The caller must run
|
|
22
|
-
* legacy + `Registry.lookup` and pass results in. The harness is a
|
|
23
|
-
* side-car, not a dispatcher — this keeps call-processor integration
|
|
24
|
-
* surgical when it lands (tracked as a follow-up; the shared model
|
|
25
|
-
* doesn't dual-invoke on its own).
|
|
26
|
-
* - **Flip anything.** `REGISTRY_PRIMARY_<LANG>` lives in
|
|
27
|
-
* `registry-primary-flag.ts` (#924); the harness records the
|
|
28
|
-
* caller-supplied "which side is primary" bit for each record so the
|
|
29
|
-
* dashboard can label rows, but it does not consult the flag itself.
|
|
30
|
-
*
|
|
31
|
-
* ## Activation
|
|
32
|
-
*
|
|
33
|
-
* `GITNEXUS_SHADOW_MODE=1` (or `'true'`, `'yes'`, case-insensitive,
|
|
34
|
-
* trimmed) enables the harness. When disabled, `record()` is a cheap
|
|
35
|
-
* no-op: no accumulation, no allocation beyond the harness object
|
|
36
|
-
* itself. Callers can always construct a harness and hand it through;
|
|
37
|
-
* the "off" overhead is near-zero.
|
|
38
|
-
*
|
|
39
|
-
* ## Persistence shape
|
|
40
|
-
*
|
|
41
|
-
* When `persist()` is called, the harness writes TWO files:
|
|
42
|
-
*
|
|
43
|
-
* - `<outputDir>/<runId>.json` — the timestamped snapshot (immutable)
|
|
44
|
-
* - `<outputDir>/latest.json` — a pointer that the dashboard reads
|
|
45
|
-
*
|
|
46
|
-
* Both files contain the same `PersistedShadowReport` payload:
|
|
47
|
-
*
|
|
48
|
-
* {
|
|
49
|
-
* schemaVersion: 1,
|
|
50
|
-
* runId: "<iso-8601>-<rand>",
|
|
51
|
-
* generatedAt: "<iso-8601>",
|
|
52
|
-
* primaryByLanguage: { [lang]: "legacy" | "registry" },
|
|
53
|
-
* report: <ShadowParityReport>
|
|
54
|
-
* }
|
|
55
|
-
*
|
|
56
|
-
* Schema-version-gated so future format changes don't silently confuse
|
|
57
|
-
* older dashboards. The dashboard renders `report.perLanguage` rows and
|
|
58
|
-
* annotates each with `primaryByLanguage[lang]`.
|
|
59
|
-
*/
|
|
60
|
-
import * as fs from 'node:fs/promises';
|
|
61
|
-
import * as path from 'node:path';
|
|
62
|
-
import { aggregateDiffs, diffResolutions, } from '../../_shared/index.js';
|
|
63
|
-
/**
|
|
64
|
-
* Construct a harness. Reads `GITNEXUS_SHADOW_MODE` at construction time
|
|
65
|
-
* (not per-`record()` call) so repeated no-op records don't re-check the
|
|
66
|
-
* env var in the hot path.
|
|
67
|
-
*/
|
|
68
|
-
export function createShadowHarness() {
|
|
69
|
-
const enabled = parseShadowModeEnv(process.env['GITNEXUS_SHADOW_MODE']);
|
|
70
|
-
const records = [];
|
|
71
|
-
const primaryByLanguage = {};
|
|
72
|
-
const recordImpl = (input) => {
|
|
73
|
-
if (!enabled)
|
|
74
|
-
return;
|
|
75
|
-
const diff = diffResolutions(input.callsite, input.legacy, input.newResult);
|
|
76
|
-
records.push({ language: input.language, diff });
|
|
77
|
-
// Primary per-language is resolved by last-write. In practice a run
|
|
78
|
-
// is single-threaded with respect to flag readings, so this is
|
|
79
|
-
// deterministic; a language's primary cannot change mid-run.
|
|
80
|
-
primaryByLanguage[input.language] = input.primary;
|
|
81
|
-
};
|
|
82
|
-
const snapshotImpl = (now = new Date()) => {
|
|
83
|
-
return aggregateDiffs(records, now);
|
|
84
|
-
};
|
|
85
|
-
const persistImpl = async (outputDir, now = new Date()) => {
|
|
86
|
-
await fs.mkdir(outputDir, { recursive: true });
|
|
87
|
-
const report = snapshotImpl(now);
|
|
88
|
-
const runId = makeRunId(now);
|
|
89
|
-
const payload = {
|
|
90
|
-
schemaVersion: 1,
|
|
91
|
-
runId,
|
|
92
|
-
generatedAt: now.toISOString(),
|
|
93
|
-
primaryByLanguage,
|
|
94
|
-
report,
|
|
95
|
-
};
|
|
96
|
-
const json = JSON.stringify(payload, null, 2);
|
|
97
|
-
const perRunPath = path.join(outputDir, `${runId}.json`);
|
|
98
|
-
const latestPath = path.join(outputDir, 'latest.json');
|
|
99
|
-
await fs.writeFile(perRunPath, json, 'utf8');
|
|
100
|
-
await fs.writeFile(latestPath, json, 'utf8');
|
|
101
|
-
return perRunPath;
|
|
102
|
-
};
|
|
103
|
-
const clearImpl = () => {
|
|
104
|
-
records.length = 0;
|
|
105
|
-
for (const key of Object.keys(primaryByLanguage)) {
|
|
106
|
-
delete primaryByLanguage[key];
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
return {
|
|
110
|
-
enabled,
|
|
111
|
-
record: recordImpl,
|
|
112
|
-
size: () => records.length,
|
|
113
|
-
snapshot: snapshotImpl,
|
|
114
|
-
persist: persistImpl,
|
|
115
|
-
clear: clearImpl,
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
// ─── Internal helpers ─────────────────────────────────────────────────────
|
|
119
|
-
/**
|
|
120
|
-
* Env-var parser for `GITNEXUS_SHADOW_MODE`. Accepts the same truthy
|
|
121
|
-
* conventions as `REGISTRY_PRIMARY_<LANG>` from #924: `'true'` / `'1'` /
|
|
122
|
-
* `'yes'`, case-insensitive, whitespace-trimmed. Anything else — including
|
|
123
|
-
* `undefined`, `''`, `'false'`, `'off'`, typos — is false.
|
|
124
|
-
*/
|
|
125
|
-
function parseShadowModeEnv(raw) {
|
|
126
|
-
if (raw === undefined)
|
|
127
|
-
return false;
|
|
128
|
-
const normalized = raw.trim().toLowerCase();
|
|
129
|
-
return normalized === 'true' || normalized === '1' || normalized === 'yes';
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Deterministic run id derived from the timestamp plus 4 random bytes
|
|
133
|
-
* of entropy. The timestamp comes first so files sort chronologically;
|
|
134
|
-
* the entropy suffix prevents collisions when multiple runs share a
|
|
135
|
-
* clock-second. Shape: `YYYYMMDD-HHMMSS-xxxxxxxx`.
|
|
136
|
-
*/
|
|
137
|
-
function makeRunId(now) {
|
|
138
|
-
const y = now.getUTCFullYear().toString().padStart(4, '0');
|
|
139
|
-
const m = (now.getUTCMonth() + 1).toString().padStart(2, '0');
|
|
140
|
-
const d = now.getUTCDate().toString().padStart(2, '0');
|
|
141
|
-
const h = now.getUTCHours().toString().padStart(2, '0');
|
|
142
|
-
const min = now.getUTCMinutes().toString().padStart(2, '0');
|
|
143
|
-
const s = now.getUTCSeconds().toString().padStart(2, '0');
|
|
144
|
-
const entropy = Math.floor(Math.random() * 0xffffffff)
|
|
145
|
-
.toString(16)
|
|
146
|
-
.padStart(8, '0');
|
|
147
|
-
return `${y}${m}${d}-${h}${min}${s}-${entropy}`;
|
|
148
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ruby bare-call self-inference helper.
|
|
3
|
-
*
|
|
4
|
-
* Ruby makes `self` implicit for method calls inside instance and class bodies:
|
|
5
|
-
* `serialize` inside `Account#call_serialize` means `self.serialize`. Other
|
|
6
|
-
* supported languages make the receiver explicit in source (`this.x`, `self.x`),
|
|
7
|
-
* so tree-sitter produces a member call directly. Ruby's bare identifier
|
|
8
|
-
* produces either `callForm === 'free'` or `callForm === undefined` (body_statement
|
|
9
|
-
* identifier captures where the @call node IS the @call.name node), and
|
|
10
|
-
* `resolveFreeCall` does a global tiered name lookup — no MRO walk.
|
|
11
|
-
*
|
|
12
|
-
* This helper is a pure decision function consumed by the Ruby language
|
|
13
|
-
* provider's `inferImplicitReceiver` hook. Shared pipeline code never imports
|
|
14
|
-
* it directly — only `languages/ruby.ts` does.
|
|
15
|
-
*/
|
|
16
|
-
import type { SyntaxNode } from './ast-helpers.js';
|
|
17
|
-
import type { LanguageProvider } from '../language-provider.js';
|
|
18
|
-
/**
|
|
19
|
-
* Rewrite suggestion returned by `maybeRewriteRubyBareCallToSelf`.
|
|
20
|
-
*
|
|
21
|
-
* `callForm` is always `'member'`; `receiverName` is always `'self'`.
|
|
22
|
-
* `dispatchKind` controls the stage-4 ancestry view:
|
|
23
|
-
* - `'instance'` → prepend → direct → include (normal MRO)
|
|
24
|
-
* - `'singleton'` → extend providers only, no file-scoped fallback
|
|
25
|
-
*
|
|
26
|
-
* Consumed by `languages/ruby.ts § inferImplicitReceiver` (wraps into
|
|
27
|
-
* `ImplicitReceiverOverride`; `dispatchKind` becomes the `hint` field).
|
|
28
|
-
*/
|
|
29
|
-
export interface SelfCallRewrite {
|
|
30
|
-
readonly callForm: 'member';
|
|
31
|
-
readonly receiverName: 'self';
|
|
32
|
-
readonly receiverTypeName: string;
|
|
33
|
-
/** `'singleton'` when the enclosing method is `def self.foo` / inside a
|
|
34
|
-
* `singleton_class` body; `'instance'` otherwise. Controls MRO ancestry
|
|
35
|
-
* view selection in stage-4 dispatch. */
|
|
36
|
-
readonly dispatchKind: 'instance' | 'singleton';
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Pure decision function: should a bare Ruby call be rewritten as `self.method`?
|
|
40
|
-
*
|
|
41
|
-
* Returns a `SelfCallRewrite` when all gates pass; null otherwise.
|
|
42
|
-
* Gates (all required): `callForm` is `'free'` or `undefined`, strategy is
|
|
43
|
-
* `'ruby-mixin'`, `enclosingClassName` is non-null, name is not `'super'`,
|
|
44
|
-
* name is not a built-in.
|
|
45
|
-
*
|
|
46
|
-
* Note: Ruby body-statement identifiers produce `callForm === undefined` because
|
|
47
|
-
* the @call node IS the @call.name node in tree-sitter-ruby.
|
|
48
|
-
*
|
|
49
|
-
* Example: `calledName='serialize'` in `Account` instance method →
|
|
50
|
-
* `{callForm:'member', receiverName:'self', receiverTypeName:'Account', dispatchKind:'instance'}`
|
|
51
|
-
*/
|
|
52
|
-
export declare function maybeRewriteRubyBareCallToSelf(calledName: string, callForm: 'free' | 'member' | 'constructor' | undefined, callNode: SyntaxNode, enclosingClassName: string | null, provider: Pick<LanguageProvider, 'isBuiltInName' | 'mroStrategy'>): SelfCallRewrite | null;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// gitnexus/src/core/ingestion/utils/ruby-self-call.ts
|
|
2
|
-
/** Maximum parent-walk depth to prevent runaway traversal. */
|
|
3
|
-
const MAX_PARENT_DEPTH = 50;
|
|
4
|
-
/**
|
|
5
|
-
* Returns true if `callNode` is inside a `singleton_method` or `singleton_class`.
|
|
6
|
-
* Stops at `class`/`module` boundary or MAX_PARENT_DEPTH (50) to bound traversal.
|
|
7
|
-
*/
|
|
8
|
-
function isInsideSingletonMethod(callNode) {
|
|
9
|
-
let current = callNode.parent;
|
|
10
|
-
let depth = 0;
|
|
11
|
-
while (current && depth++ < MAX_PARENT_DEPTH) {
|
|
12
|
-
if (current.type === 'singleton_method')
|
|
13
|
-
return true;
|
|
14
|
-
if (current.type === 'singleton_class')
|
|
15
|
-
return true;
|
|
16
|
-
if (current.type === 'class' || current.type === 'module')
|
|
17
|
-
return false;
|
|
18
|
-
current = current.parent;
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Pure decision function: should a bare Ruby call be rewritten as `self.method`?
|
|
24
|
-
*
|
|
25
|
-
* Returns a `SelfCallRewrite` when all gates pass; null otherwise.
|
|
26
|
-
* Gates (all required): `callForm` is `'free'` or `undefined`, strategy is
|
|
27
|
-
* `'ruby-mixin'`, `enclosingClassName` is non-null, name is not `'super'`,
|
|
28
|
-
* name is not a built-in.
|
|
29
|
-
*
|
|
30
|
-
* Note: Ruby body-statement identifiers produce `callForm === undefined` because
|
|
31
|
-
* the @call node IS the @call.name node in tree-sitter-ruby.
|
|
32
|
-
*
|
|
33
|
-
* Example: `calledName='serialize'` in `Account` instance method →
|
|
34
|
-
* `{callForm:'member', receiverName:'self', receiverTypeName:'Account', dispatchKind:'instance'}`
|
|
35
|
-
*/
|
|
36
|
-
export function maybeRewriteRubyBareCallToSelf(calledName, callForm, callNode, enclosingClassName, provider) {
|
|
37
|
-
// Body-statement bare identifiers produce `callForm === undefined` because
|
|
38
|
-
// the @call node IS the @call.name node in tree-sitter-ruby. Treat both
|
|
39
|
-
// undefined and 'free' as qualifying.
|
|
40
|
-
if (callForm !== 'free' && callForm !== undefined)
|
|
41
|
-
return null;
|
|
42
|
-
if (provider.mroStrategy !== 'ruby-mixin')
|
|
43
|
-
return null;
|
|
44
|
-
if (!enclosingClassName)
|
|
45
|
-
return null;
|
|
46
|
-
if (calledName === 'super')
|
|
47
|
-
return null;
|
|
48
|
-
if (provider.isBuiltInName(calledName))
|
|
49
|
-
return null;
|
|
50
|
-
const dispatchKind = isInsideSingletonMethod(callNode)
|
|
51
|
-
? 'singleton'
|
|
52
|
-
: 'instance';
|
|
53
|
-
return {
|
|
54
|
-
callForm: 'member',
|
|
55
|
-
receiverName: 'self',
|
|
56
|
-
receiverTypeName: enclosingClassName,
|
|
57
|
-
dispatchKind,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CI helper — emits the `MIGRATED_LANGUAGES` set as a JSON matrix array for
|
|
3
|
-
* GitHub Actions (`.github/workflows/ci-scope-parity.yml`).
|
|
4
|
-
*
|
|
5
|
-
* Consumed by the `discover` job in that workflow. Each entry has:
|
|
6
|
-
* - `slug`: lowercase language id, matching `test/integration/resolvers/<slug>.test.ts`.
|
|
7
|
-
* - `envvar`: uppercase suffix used to build the `REGISTRY_PRIMARY_<envvar>` toggle.
|
|
8
|
-
*
|
|
9
|
-
* Run with `npx tsx scripts/ci-list-migrated-languages.ts`. The script
|
|
10
|
-
* writes a single JSON array to stdout (no wrapper object) so the
|
|
11
|
-
* workflow can pipe it straight into `$GITHUB_OUTPUT`.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { MIGRATED_LANGUAGES } from '../src/core/ingestion/registry-primary-flag.js';
|
|
15
|
-
|
|
16
|
-
const entries = [...MIGRATED_LANGUAGES].map((slug) => {
|
|
17
|
-
const s = String(slug);
|
|
18
|
-
return {
|
|
19
|
-
slug: s,
|
|
20
|
-
envvar: s.toUpperCase().replace(/-/g, '_'),
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
process.stdout.write(JSON.stringify(entries));
|
package/scripts/run-parity.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Consolidated scope-resolution parity runner.
|
|
3
|
-
*
|
|
4
|
-
* Replaces the per-language matrix in ci-scope-parity.yml with a single
|
|
5
|
-
* job that runs all migrated languages sequentially in one process. This
|
|
6
|
-
* eliminates 8× redundant checkout + npm ci + build cycles (the old
|
|
7
|
-
* workflow created a separate GitHub Actions job per language).
|
|
8
|
-
*
|
|
9
|
-
* For each language in MIGRATED_LANGUAGES:
|
|
10
|
-
* 1. Run its resolver test with REGISTRY_PRIMARY_<LANG>=0 (legacy DAG)
|
|
11
|
-
* 2. Run its resolver test with REGISTRY_PRIMARY_<LANG>=1 (registry-primary)
|
|
12
|
-
*
|
|
13
|
-
* Both modes must pass. Failures are collected and reported at the end
|
|
14
|
-
* so all regressions are visible in a single CI run (equivalent to the
|
|
15
|
-
* old workflow's fail-fast: false behavior).
|
|
16
|
-
*
|
|
17
|
-
* Vitest output streams to the console in real time (stdio: 'inherit')
|
|
18
|
-
* so CI logs show the actual test output directly. No per-invocation
|
|
19
|
-
* timeout — the CI job-level timeout (30 min) is the outer guard.
|
|
20
|
-
*
|
|
21
|
-
* Usage:
|
|
22
|
-
* npx tsx scripts/run-parity.ts
|
|
23
|
-
* npx tsx scripts/run-parity.ts --language python # single language
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import { execFileSync } from 'child_process';
|
|
27
|
-
import fs from 'fs';
|
|
28
|
-
import path from 'path';
|
|
29
|
-
import { fileURLToPath } from 'url';
|
|
30
|
-
import { MIGRATED_LANGUAGES } from '../src/core/ingestion/registry-primary-flag.js';
|
|
31
|
-
|
|
32
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
33
|
-
const ROOT = path.resolve(__dirname, '..');
|
|
34
|
-
|
|
35
|
-
interface ParityFailure {
|
|
36
|
-
lang: string;
|
|
37
|
-
mode: 'legacy' | 'registry-primary';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function envVarName(slug: string): string {
|
|
41
|
-
return `REGISTRY_PRIMARY_${slug.toUpperCase().replace(/-/g, '_')}`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function testFilePath(slug: string): string {
|
|
45
|
-
return `test/integration/resolvers/${slug}.test.ts`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function runVitest(testFile: string, env: Record<string, string>): boolean {
|
|
49
|
-
try {
|
|
50
|
-
execFileSync('npx', ['vitest', 'run', testFile], {
|
|
51
|
-
cwd: ROOT,
|
|
52
|
-
env: { ...process.env, ...env },
|
|
53
|
-
stdio: 'inherit',
|
|
54
|
-
shell: true,
|
|
55
|
-
});
|
|
56
|
-
return true;
|
|
57
|
-
} catch {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Parse CLI args
|
|
63
|
-
const args = process.argv.slice(2);
|
|
64
|
-
const langFlag = args.indexOf('--language');
|
|
65
|
-
const singleLang = langFlag >= 0 ? args[langFlag + 1] : undefined;
|
|
66
|
-
|
|
67
|
-
if (langFlag >= 0 && singleLang === undefined) {
|
|
68
|
-
console.error('--language requires a value');
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const languages = singleLang ? [singleLang] : [...MIGRATED_LANGUAGES].map(String);
|
|
73
|
-
|
|
74
|
-
// Verify test files exist before running
|
|
75
|
-
const missingFiles: string[] = [];
|
|
76
|
-
for (const lang of languages) {
|
|
77
|
-
const file = path.resolve(ROOT, testFilePath(lang));
|
|
78
|
-
try {
|
|
79
|
-
fs.accessSync(file);
|
|
80
|
-
} catch {
|
|
81
|
-
missingFiles.push(`${testFilePath(lang)} (${lang})`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (missingFiles.length > 0) {
|
|
86
|
-
console.error('Missing resolver test files:');
|
|
87
|
-
for (const f of missingFiles) console.error(` ${f}`);
|
|
88
|
-
process.exit(1);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
console.log(`Scope-resolution parity: ${languages.length} language(s)`);
|
|
92
|
-
console.log(`Languages: ${languages.join(', ')}\n`);
|
|
93
|
-
|
|
94
|
-
const failures: ParityFailure[] = [];
|
|
95
|
-
|
|
96
|
-
for (const lang of languages) {
|
|
97
|
-
const file = testFilePath(lang);
|
|
98
|
-
const envVar = envVarName(lang);
|
|
99
|
-
|
|
100
|
-
console.log(`\n── ${lang} — legacy DAG (${envVar}=0) ──`);
|
|
101
|
-
if (!runVitest(file, { [envVar]: '0' })) {
|
|
102
|
-
failures.push({ lang, mode: 'legacy' });
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
console.log(`\n── ${lang} — registry-primary (${envVar}=1) ──`);
|
|
106
|
-
if (!runVitest(file, { [envVar]: '1' })) {
|
|
107
|
-
failures.push({ lang, mode: 'registry-primary' });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Summary
|
|
112
|
-
const total = languages.length * 2;
|
|
113
|
-
const passed = total - failures.length;
|
|
114
|
-
|
|
115
|
-
console.log('\n═══════════════════════════════════════');
|
|
116
|
-
console.log('PARITY SUMMARY');
|
|
117
|
-
console.log('═══════════════════════════════════════');
|
|
118
|
-
console.log(`Passed: ${passed}/${total}`);
|
|
119
|
-
|
|
120
|
-
if (failures.length > 0) {
|
|
121
|
-
console.log(`\nFAILURES (${failures.length}):`);
|
|
122
|
-
for (const f of failures) {
|
|
123
|
-
console.log(` ✗ ${f.lang} [${f.mode}]`);
|
|
124
|
-
}
|
|
125
|
-
process.exit(1);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
console.log('\nAll parity checks passed.');
|