gitnexus 1.6.11-rc.8 → 1.6.11
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 +95 -26
- package/dist/_shared/graph/types.d.ts +81 -2
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/integrations/circuit-breaker.d.ts.map +1 -1
- package/dist/_shared/integrations/circuit-breaker.js.map +1 -1
- package/dist/_shared/integrations/resilient-fetch.d.ts.map +1 -1
- package/dist/_shared/integrations/resilient-fetch.js.map +1 -1
- package/dist/_shared/language-detection.d.ts.map +1 -1
- package/dist/_shared/language-detection.js +2 -0
- package/dist/_shared/language-detection.js.map +1 -1
- package/dist/_shared/languages.d.ts +2 -1
- package/dist/_shared/languages.d.ts.map +1 -1
- package/dist/_shared/languages.js +1 -0
- package/dist/_shared/languages.js.map +1 -1
- package/dist/_shared/lbug/schema-constants.d.ts +2 -2
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -1
- package/dist/_shared/lbug/schema-constants.js +4 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -1
- package/dist/_shared/scope-resolution/evidence-weights.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/finalize-algorithm.js +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
- package/dist/_shared/scope-resolution/language-classification.d.ts +3 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/language-classification.js +4 -0
- package/dist/_shared/scope-resolution/language-classification.js.map +1 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts +10 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/field-registry.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/method-registry.js.map +1 -1
- package/dist/_shared/scope-resolution/scope-tree.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/scope-tree.js.map +1 -1
- package/dist/_shared/scope-resolution/types.d.ts +15 -0
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +4 -0
- package/dist/cli/ai-context.js +90 -14
- package/dist/cli/analyze-config.js +14 -0
- package/dist/cli/analyze-options.d.ts +14 -0
- package/dist/cli/analyze-watch.d.ts +20 -0
- package/dist/cli/analyze-watch.js +434 -0
- package/dist/cli/analyze.js +27 -9
- package/dist/cli/auto-sync.d.ts +1 -0
- package/dist/cli/auto-sync.js +107 -0
- package/dist/cli/command-banner.d.ts +15 -0
- package/dist/cli/command-banner.js +42 -0
- package/dist/cli/detect-changes-format.js +21 -0
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.js +14 -0
- package/dist/cli/group.js +7 -1
- package/dist/cli/help-i18n.js +4 -0
- package/dist/cli/i18n/en.d.ts +18 -3
- package/dist/cli/i18n/en.js +18 -3
- package/dist/cli/i18n/resources.d.ts +33 -3
- package/dist/cli/i18n/zh-CN.d.ts +15 -0
- package/dist/cli/i18n/zh-CN.js +18 -3
- package/dist/cli/index.js +34 -7
- package/dist/cli/mcp.d.ts +15 -0
- package/dist/cli/mcp.js +44 -0
- package/dist/cli/optional-grammars.d.ts +3 -2
- package/dist/cli/optional-grammars.js +19 -3
- package/dist/cli/setup.js +41 -15
- package/dist/cli/update-notice.d.ts +34 -0
- package/dist/cli/update-notice.js +91 -0
- package/dist/cli/update.d.ts +21 -0
- package/dist/cli/update.js +93 -0
- package/dist/cli/watch.d.ts +1 -20
- package/dist/cli/watch.js +5 -371
- package/dist/core/analysis-feature-registry.d.ts +2 -0
- package/dist/core/analysis-feature-registry.js +15 -0
- package/dist/core/analyzer-identity.js +21 -3
- package/dist/core/auto-sync/analysis-worker-launch.d.ts +30 -0
- package/dist/core/auto-sync/analysis-worker-launch.js +166 -0
- package/dist/core/auto-sync/config.d.ts +33 -0
- package/dist/core/auto-sync/config.js +320 -0
- package/dist/core/auto-sync/index.d.ts +6 -0
- package/dist/core/auto-sync/index.js +6 -0
- package/dist/core/auto-sync/path-security.d.ts +9 -0
- package/dist/core/auto-sync/path-security.js +251 -0
- package/dist/core/auto-sync/repo.d.ts +1 -0
- package/dist/core/auto-sync/repo.js +6 -0
- package/dist/core/auto-sync/runner.d.ts +44 -0
- package/dist/core/auto-sync/runner.js +428 -0
- package/dist/core/auto-sync/starter.d.ts +50 -0
- package/dist/core/auto-sync/starter.js +497 -0
- package/dist/core/auto-sync/state.d.ts +37 -0
- package/dist/core/auto-sync/state.js +119 -0
- package/dist/core/group/config-parser.js +8 -1
- package/dist/core/group/cross-impact.d.ts +3 -0
- package/dist/core/group/cross-impact.js +36 -4
- package/dist/core/group/extractors/http-patterns/java.js +22 -8
- package/dist/core/group/extractors/http-patterns/kotlin.js +86 -31
- package/dist/core/group/extractors/http-patterns/node.js +145 -8
- package/dist/core/group/extractors/http-patterns/python.js +11 -7
- package/dist/core/group/extractors/http-route-extractor.js +63 -17
- package/dist/core/group/extractors/java-workspace-extractor.js +244 -31
- package/dist/core/group/group-lock.js +5 -6
- package/dist/core/group/normalization.d.ts +38 -1
- package/dist/core/group/normalization.js +59 -3
- package/dist/core/group/service.d.ts +11 -0
- package/dist/core/group/service.js +13 -1
- package/dist/core/group/storage.js +2 -2
- package/dist/core/group/sync.d.ts +24 -1
- package/dist/core/group/sync.js +46 -8
- package/dist/core/group/types.d.ts +13 -0
- package/dist/core/incremental/derived-writeback.d.ts +36 -0
- package/dist/core/incremental/derived-writeback.js +68 -0
- package/dist/core/incremental/spring-config-drift.d.ts +12 -0
- package/dist/core/incremental/spring-config-drift.js +46 -0
- package/dist/core/incremental/subgraph-extract.d.ts +7 -4
- package/dist/core/incremental/subgraph-extract.js +30 -5
- package/dist/core/ingestion/asyncapi/document.d.ts +226 -0
- package/dist/core/ingestion/asyncapi/document.js +758 -0
- package/dist/core/ingestion/asyncapi/protocol.d.ts +79 -0
- package/dist/core/ingestion/asyncapi/protocol.js +203 -0
- package/dist/core/ingestion/call-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/zig.js +4 -0
- package/dist/core/ingestion/call-extractors/zig-static-gating.d.ts +100 -0
- package/dist/core/ingestion/call-extractors/zig-static-gating.js +319 -0
- package/dist/core/ingestion/call-processor.js +3 -1
- package/dist/core/ingestion/class-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/zig.js +32 -0
- package/dist/core/ingestion/class-extractors/generic.js +4 -1
- package/dist/core/ingestion/class-types.d.ts +6 -2
- package/dist/core/ingestion/destination-key.d.ts +59 -0
- package/dist/core/ingestion/destination-key.js +61 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +6 -2
- package/dist/core/ingestion/entry-point-scoring.js +8 -44
- package/dist/core/ingestion/export-detection.d.ts +37 -0
- package/dist/core/ingestion/export-detection.js +60 -0
- package/dist/core/ingestion/field-extractors/configs/zig.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/zig.js +49 -0
- package/dist/core/ingestion/field-extractors/generic.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/generic.js +12 -1
- package/dist/core/ingestion/frameworks/spring/actuator-runtime.d.ts +26 -0
- package/dist/core/ingestion/frameworks/spring/actuator-runtime.js +843 -0
- package/dist/core/ingestion/frameworks/spring/analysis-features.d.ts +5 -0
- package/dist/core/ingestion/frameworks/spring/analysis-features.js +9 -0
- package/dist/core/ingestion/frameworks/spring/annotation-arguments.js +8 -1
- package/dist/core/ingestion/frameworks/spring/argument-facts.d.ts +80 -0
- package/dist/core/ingestion/frameworks/spring/argument-facts.js +85 -0
- package/dist/core/ingestion/frameworks/spring/config-bindings.d.ts +1 -0
- package/dist/core/ingestion/frameworks/spring/config-bindings.js +2 -1
- package/dist/core/ingestion/frameworks/spring/destinations.d.ts +539 -0
- package/dist/core/ingestion/frameworks/spring/destinations.js +840 -0
- package/dist/core/ingestion/frameworks/spring/dynamic-lookups.d.ts +22 -0
- package/dist/core/ingestion/frameworks/spring/dynamic-lookups.js +124 -0
- package/dist/core/ingestion/frameworks/spring/message-producers.d.ts +78 -0
- package/dist/core/ingestion/frameworks/spring/message-producers.js +90 -0
- package/dist/core/ingestion/frameworks/spring/non-http-handlers.d.ts +29 -0
- package/dist/core/ingestion/frameworks/spring/vendor-prefixes.d.ts +7 -0
- package/dist/core/ingestion/frameworks/spring/vendor-prefixes.js +22 -0
- package/dist/core/ingestion/import-resolvers/configs/zig.d.ts +13 -0
- package/dist/core/ingestion/import-resolvers/configs/zig.js +26 -0
- package/dist/core/ingestion/import-resolvers/zig.d.ts +34 -0
- package/dist/core/ingestion/import-resolvers/zig.js +193 -0
- package/dist/core/ingestion/language-config.d.ts +177 -0
- package/dist/core/ingestion/language-config.js +719 -0
- package/dist/core/ingestion/language-provider.d.ts +178 -1
- package/dist/core/ingestion/language-provider.js +22 -0
- package/dist/core/ingestion/languages/csharp/razor-view-components.d.ts +62 -0
- package/dist/core/ingestion/languages/csharp/razor-view-components.js +954 -0
- package/dist/core/ingestion/languages/csharp/resolution-config.d.ts +3 -0
- package/dist/core/ingestion/languages/csharp/resolution-config.js +6 -1
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +8 -0
- package/dist/core/ingestion/languages/index.d.ts +1 -0
- package/dist/core/ingestion/languages/index.js +2 -0
- package/dist/core/ingestion/languages/java/analysis-features.d.ts +1 -1
- package/dist/core/ingestion/languages/java/analysis-features.js +14 -6
- package/dist/core/ingestion/languages/java/capture-side-channel.d.ts +8 -0
- package/dist/core/ingestion/languages/java/capture-side-channel.js +34 -0
- package/dist/core/ingestion/languages/java/captures.js +22 -1
- package/dist/core/ingestion/languages/java/lombok-synthesizer.d.ts +42 -0
- package/dist/core/ingestion/languages/java/lombok-synthesizer.js +439 -0
- package/dist/core/ingestion/languages/java/scope-resolver.js +2 -0
- package/dist/core/ingestion/languages/java/spring-actuator.d.ts +2 -0
- package/dist/core/ingestion/languages/java/spring-actuator.js +62 -0
- package/dist/core/ingestion/languages/java/spring-di.d.ts +17 -1
- package/dist/core/ingestion/languages/java/spring-di.js +44 -2
- package/dist/core/ingestion/languages/java/spring-dynamic-lookup.d.ts +8 -0
- package/dist/core/ingestion/languages/java/spring-dynamic-lookup.js +62 -0
- package/dist/core/ingestion/languages/java/spring-message-producers.d.ts +20 -0
- package/dist/core/ingestion/languages/java/spring-message-producers.js +83 -0
- package/dist/core/ingestion/languages/java/spring-non-http-handlers.d.ts +11 -1
- package/dist/core/ingestion/languages/java/spring-non-http-handlers.js +13 -3
- package/dist/core/ingestion/languages/java.js +18 -8
- package/dist/core/ingestion/languages/jvm/accessor-synthesis.d.ts +99 -0
- package/dist/core/ingestion/languages/jvm/accessor-synthesis.js +173 -0
- package/dist/core/ingestion/languages/jvm/beanspec.d.ts +17 -0
- package/dist/core/ingestion/languages/jvm/beanspec.js +42 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +15 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +50 -0
- package/dist/core/ingestion/languages/kotlin/captures.js +24 -1
- package/dist/core/ingestion/languages/kotlin/lombok-synthesizer.d.ts +26 -0
- package/dist/core/ingestion/languages/kotlin/lombok-synthesizer.js +417 -0
- package/dist/core/ingestion/languages/kotlin/scope-resolver.js +4 -0
- package/dist/core/ingestion/languages/kotlin/spring-actuator.d.ts +4 -0
- package/dist/core/ingestion/languages/kotlin/spring-actuator.js +172 -0
- package/dist/core/ingestion/languages/kotlin/spring-config-bindings.d.ts +18 -0
- package/dist/core/ingestion/languages/kotlin/spring-config-bindings.js +411 -0
- package/dist/core/ingestion/languages/kotlin/spring-di.d.ts +51 -1
- package/dist/core/ingestion/languages/kotlin/spring-di.js +86 -6
- package/dist/core/ingestion/languages/kotlin/spring-dynamic-lookup.d.ts +8 -0
- package/dist/core/ingestion/languages/kotlin/spring-dynamic-lookup.js +77 -0
- package/dist/core/ingestion/languages/kotlin/spring-message-producers.d.ts +17 -0
- package/dist/core/ingestion/languages/kotlin/spring-message-producers.js +119 -0
- package/dist/core/ingestion/languages/kotlin/spring-non-http-handlers.d.ts +16 -0
- package/dist/core/ingestion/languages/kotlin/spring-non-http-handlers.js +77 -2
- package/dist/core/ingestion/languages/kotlin.js +24 -0
- package/dist/core/ingestion/languages/python.js +2 -0
- package/dist/core/ingestion/languages/rust/query.js +8 -8
- package/dist/core/ingestion/languages/zig/captures.d.ts +260 -0
- package/dist/core/ingestion/languages/zig/captures.js +2070 -0
- package/dist/core/ingestion/languages/zig/index.d.ts +4 -0
- package/dist/core/ingestion/languages/zig/index.js +4 -0
- package/dist/core/ingestion/languages/zig/interpret.d.ts +36 -0
- package/dist/core/ingestion/languages/zig/interpret.js +176 -0
- package/dist/core/ingestion/languages/zig/query.d.ts +3 -0
- package/dist/core/ingestion/languages/zig/query.js +426 -0
- package/dist/core/ingestion/languages/zig/range-binding.d.ts +37 -0
- package/dist/core/ingestion/languages/zig/range-binding.js +373 -0
- package/dist/core/ingestion/languages/zig/scope-resolver.d.ts +12 -0
- package/dist/core/ingestion/languages/zig/scope-resolver.js +58 -0
- package/dist/core/ingestion/languages/zig/simple-hooks.d.ts +25 -0
- package/dist/core/ingestion/languages/zig/simple-hooks.js +143 -0
- package/dist/core/ingestion/languages/zig.d.ts +32 -0
- package/dist/core/ingestion/languages/zig.js +130 -0
- package/dist/core/ingestion/method-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/zig.js +120 -0
- package/dist/core/ingestion/method-extractors/generic.js +16 -4
- package/dist/core/ingestion/method-types.d.ts +10 -4
- package/dist/core/ingestion/model/field-registry.d.ts +3 -3
- package/dist/core/ingestion/model/field-registry.js +11 -7
- package/dist/core/ingestion/model/method-registry.d.ts +3 -3
- package/dist/core/ingestion/model/method-registry.js +13 -8
- package/dist/core/ingestion/model/registration-table.js +3 -0
- package/dist/core/ingestion/model/type-registry.js +8 -4
- package/dist/core/ingestion/pipeline-phases/di.js +47 -14
- 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/parse-impl.d.ts +7 -1
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +79 -91
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +2 -1
- package/dist/core/ingestion/pipeline-phases/processes.js +39 -4
- package/dist/core/ingestion/pipeline-phases/routes.js +27 -18
- package/dist/core/ingestion/pipeline-phases/runner.d.ts +4 -1
- package/dist/core/ingestion/pipeline-phases/runner.js +34 -14
- package/dist/core/ingestion/pipeline-phases/scan.js +82 -1
- package/dist/core/ingestion/pipeline-phases/spring-auto-configuration.d.ts +2 -0
- package/dist/core/ingestion/pipeline-phases/spring-auto-configuration.js +8 -0
- package/dist/core/ingestion/pipeline-phases/spring-destinations.d.ts +123 -0
- package/dist/core/ingestion/pipeline-phases/spring-destinations.js +688 -0
- package/dist/core/ingestion/pipeline.d.ts +30 -1
- package/dist/core/ingestion/pipeline.js +52 -14
- package/dist/core/ingestion/resolve-references.js +5 -0
- package/dist/core/ingestion/route-extractors/constant-resolver.d.ts +16 -0
- package/dist/core/ingestion/route-extractors/constant-resolver.js +10 -0
- package/dist/core/ingestion/route-extractors/java-const-resolver.d.ts +27 -1
- package/dist/core/ingestion/route-extractors/java-const-resolver.js +161 -13
- package/dist/core/ingestion/route-extractors/kotlin-const-resolver.d.ts +12 -18
- package/dist/core/ingestion/route-extractors/kotlin-const-resolver.js +214 -33
- package/dist/core/ingestion/route-extractors/kotlin-spring.d.ts +13 -0
- package/dist/core/ingestion/route-extractors/kotlin-spring.js +259 -0
- package/dist/core/ingestion/route-extractors/python-decorator-handler.d.ts +6 -0
- package/dist/core/ingestion/route-extractors/python-decorator-handler.js +16 -0
- package/dist/core/ingestion/route-extractors/spring-shared.d.ts +30 -1
- package/dist/core/ingestion/route-extractors/spring-shared.js +77 -9
- package/dist/core/ingestion/route-extractors/spring.js +9 -5
- package/dist/core/ingestion/scope-extractor.js +8 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +62 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.d.ts +4 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +2 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +28 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +11 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.d.ts +23 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +24 -3
- package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.d.ts +11 -1
- package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.js +26 -6
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.d.ts +11 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.js +29 -3
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +8 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +35 -9
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +1 -4
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +277 -9
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +2 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +7 -3
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +43 -9
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +71 -10
- package/dist/core/ingestion/tree-sitter-queries.d.ts +1 -0
- package/dist/core/ingestion/tree-sitter-queries.js +161 -0
- package/dist/core/ingestion/type-extractors/zig.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/zig.js +17 -0
- package/dist/core/ingestion/utils/ast-helpers.d.ts +40 -1
- package/dist/core/ingestion/utils/ast-helpers.js +124 -6
- package/dist/core/ingestion/utils/callable-flow-captures.d.ts +9 -0
- package/dist/core/ingestion/utils/callable-flow-captures.js +75 -14
- package/dist/core/ingestion/utils/test-file-path.d.ts +28 -0
- package/dist/core/ingestion/utils/test-file-path.js +87 -0
- package/dist/core/ingestion/variable-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/zig.js +71 -0
- package/dist/core/ingestion/workers/parse-worker.js +85 -14
- package/dist/core/install-context.d.ts +4 -0
- package/dist/core/install-context.js +152 -0
- package/dist/core/lbug/csv-generator.d.ts +10 -1
- package/dist/core/lbug/csv-generator.js +92 -22
- package/dist/core/lbug/graph-emit-sink.d.ts +3 -2
- package/dist/core/lbug/graph-emit-sink.js +4 -2
- package/dist/core/lbug/lbug-adapter.d.ts +100 -5
- package/dist/core/lbug/lbug-adapter.js +236 -24
- package/dist/core/lbug/schema.d.ts +6 -5
- package/dist/core/lbug/schema.js +84 -22
- package/dist/core/net/url-guard.d.ts +6 -0
- package/dist/core/net/url-guard.js +147 -0
- package/dist/core/package-version.d.ts +5 -0
- package/dist/core/package-version.js +10 -0
- package/dist/core/run-analyze.d.ts +21 -4
- package/dist/core/run-analyze.js +426 -117
- package/dist/core/search/fts-indexes.d.ts +19 -1
- package/dist/core/search/fts-indexes.js +28 -1
- package/dist/core/tree-sitter/parser-loader.js +16 -0
- package/dist/core/update-cache.d.ts +39 -0
- package/dist/core/update-cache.js +141 -0
- package/dist/core/update-check.d.ts +31 -0
- package/dist/core/update-check.js +274 -0
- package/dist/mcp/local/local-backend.d.ts +27 -13
- package/dist/mcp/local/local-backend.js +148 -60
- package/dist/mcp/repository-policy.d.ts +5 -1
- package/dist/mcp/repository-policy.js +48 -4
- package/dist/mcp/resources.js +10 -1
- package/dist/mcp/server.js +8 -9
- package/dist/mcp/tools.js +32 -22
- package/dist/server/analyze-launch.d.ts +2 -0
- package/dist/server/analyze-launch.js +2 -0
- package/dist/server/analyze-worker-protocol.d.ts +6 -1
- package/dist/server/analyze-worker.d.ts +1 -0
- package/dist/server/analyze-worker.js +38 -20
- package/dist/server/api.d.ts +5 -1
- package/dist/server/api.js +105 -88
- package/dist/server/git-clone.d.ts +40 -16
- package/dist/server/git-clone.js +253 -199
- package/dist/server/grep-params.d.ts +18 -0
- package/dist/server/grep-params.js +83 -0
- package/dist/server/grep-scan.d.ts +23 -0
- package/dist/server/grep-scan.js +107 -0
- package/dist/server/grep-worker.d.ts +1 -0
- package/dist/server/grep-worker.js +12 -0
- package/dist/server/mcp-http.d.ts +8 -0
- package/dist/server/mcp-http.js +16 -1
- package/dist/server/update-controller.d.ts +29 -0
- package/dist/server/update-controller.js +82 -0
- package/dist/storage/file-lock.d.ts +15 -0
- package/dist/storage/file-lock.js +155 -0
- package/dist/storage/fs-atomic.d.ts +24 -0
- package/dist/storage/fs-atomic.js +86 -2
- package/dist/storage/global-dir.d.ts +2 -0
- package/dist/storage/global-dir.js +6 -0
- package/dist/storage/parse-cache.d.ts +45 -7
- package/dist/storage/parse-cache.js +189 -42
- package/dist/storage/parsedfile-store.d.ts +41 -60
- package/dist/storage/parsedfile-store.js +247 -171
- package/dist/storage/repo-manager.d.ts +10 -4
- package/dist/storage/repo-manager.js +35 -25
- package/dist/storage/repo-meta.d.ts +34 -0
- package/dist/storage/v8-sidecar.d.ts +48 -0
- package/dist/storage/v8-sidecar.js +347 -0
- package/dist/types/pipeline.d.ts +14 -0
- package/dist/utils/process-identity.d.ts +2 -0
- package/dist/utils/process-identity.js +35 -0
- package/package.json +10 -4
- package/scripts/assert-web-assets.mjs +35 -0
- package/scripts/build-web.js +72 -0
- package/scripts/build.js +31 -28
- package/scripts/cross-platform-tests.ts +5 -0
- package/skills/gitnexus-cli.md +5 -1
- package/web/assets/ProcessFlowModal-DAeX2BHW.js +24 -0
- package/web/assets/{abnfDiagram-QNN2D4NM-Cq2djWWe.js → abnfDiagram-PAR5IXJI-J3OdeHLl.js} +1 -1
- package/web/assets/{agent-BWAXPjC5.js → agent-BMRqXorA.js} +6 -4
- package/web/assets/architecture-7GRP2DOG-M7G3SWCO-G3sWyX6M.js +1 -0
- package/web/assets/architectureDiagram-2PNWDENW-ysKcRlGT.js +36 -0
- package/web/assets/blockDiagram-PUWGUBOA-oLXTa1lY.js +129 -0
- package/web/assets/c4Diagram-3NLNHZP5-D3iu4eC0.js +38 -0
- package/web/assets/{chunk-2SREHG4O-Dip42xOq.js → chunk-2NMSUPJH-B24w-wng.js} +1 -1
- package/web/assets/{chunk-VJFVEZTB-CX66F2ep.js → chunk-32MCUW2P-ByUyt0Sa.js} +3 -3
- package/web/assets/{chunk-4RFN2BYJ-DHHWuC-n.js → chunk-3NPNU5GP-DocZ07Sg.js} +1 -1
- package/web/assets/{chunk-XNMVGMAZ-Cg_LnPtj.js → chunk-3SMGFRGC-CAu4JRLv.js} +1 -1
- package/web/assets/{chunk-W44A43WB-BN8EQc_u.js → chunk-4CAJECRU-DRYMwG9z.js} +1 -1
- package/web/assets/chunk-4OADUZ5Q-CxrSvOwZ.js +10 -0
- package/web/assets/{chunk-DMV4VAQV-Bn6WXDSX.js → chunk-5IQCK5RY-CCMhl4so.js} +2 -2
- package/web/assets/{chunk-RRFMTAIC-CMN0wcYA.js → chunk-5MVFYWFU-Db9KvrYO.js} +1 -1
- package/web/assets/chunk-CLS4B6BI-Uvx5QNsu.js +168 -0
- package/web/assets/chunk-DZP67EKU-B3Mt380j.js +70 -0
- package/web/assets/{chunk-6L755F7B-CMhLBxi2.js → chunk-EICP7K5X-CqwE9hui.js} +1 -1
- package/web/assets/{chunk-BI6VK774-D0oaWk8V.js → chunk-GDY2UAB4-CtQQR0a8.js} +1 -1
- package/web/assets/chunk-H7VHZCWX-CE1nAmt6.js +1 -0
- package/web/assets/chunk-IJBDOHL6-BUKtY6oF.js +1 -0
- package/web/assets/{chunk-OIYT25JQ-CQ6KOZGX.js → chunk-JFFVMJIA-0fJenqia.js} +1 -1
- package/web/assets/{chunk-HNC4WDU7-DoU3KnA7.js → chunk-JZGDI5JK-BeTMSSkJ.js} +1 -1
- package/web/assets/{chunk-EQFTRU2I-1ix7TzW9.js → chunk-KD6SPIPN-Qp1Pflah.js} +1 -1
- package/web/assets/chunk-NF366YI6-CpSpya3n.js +231 -0
- package/web/assets/chunk-NUDPKBEF-CU1-BQIW.js +34 -0
- package/web/assets/{chunk-SATU7PGQ-B1zhgOvc.js → chunk-OJINMHTS-zOCQe4eI.js} +1 -1
- package/web/assets/{chunk-E5QJAATJ-dh-5CtIV.js → chunk-Q6NGPIAH-yyBomb63.js} +1 -1
- package/web/assets/chunk-QJSWEUOL-D_rf9gPD.js +128 -0
- package/web/assets/chunk-R7JDMUKV-CRoqKpD6.js +1 -0
- package/web/assets/{chunk-VE5CLXGZ-C1vB7wpY.js → chunk-RCXAM2GK-CUqrWQDV.js} +1 -1
- package/web/assets/{chunk-66DQ2XMT-CM0xjFAN.js → chunk-RT4MAWR3-zXy9-Lvt.js} +1 -1
- package/web/assets/{chunk-TZUXEDM2-B7p9AcTw.js → chunk-SFMINX4W-J2UrvMpD.js} +1 -1
- package/web/assets/{chunk-LORZLZWG-B57uGw2N.js → chunk-SLDQ463B-CHY6e_bQ.js} +2 -2
- package/web/assets/{chunk-FWYVLQTC-BgDItRzJ.js → chunk-TCEHX7R3-CXPDEVbm.js} +1 -1
- package/web/assets/{chunk-224SPVON-B8gxtXpy.js → chunk-VQC2EELJ-Dc8fIy4R.js} +1 -1
- package/web/assets/chunk-VRZKL3EH-DB3KixTQ.js +1 -0
- package/web/assets/{chunk-A7VWPJGB-B4O3oQdQ.js → chunk-VTHDQ7BV-b7FsPQZO.js} +1 -1
- package/web/assets/chunk-VY2OSTJR-Dkgc3Brg.js +2 -0
- package/web/assets/chunk-WUBWJARI-7FwILJ3k.js +2 -0
- package/web/assets/{chunk-D6VWDJW2-BxcBdZ9c.js → chunk-YBMQ5JGJ-BSnyWZmd.js} +1 -1
- package/web/assets/chunk-YDMLL4PJ-IHhMngTz.js +2 -0
- package/web/assets/chunk-Z6V44ARX-BjCEsF0Q.js +62 -0
- package/web/assets/chunk-ZJJ7VQJP-Dz089b-K.js +321 -0
- package/web/assets/chunk-ZNLK7HRR-B0iFpmW4.js +1 -0
- package/web/assets/chunk-ZQN7UHIL-Cy7KAjQt.js +1 -0
- package/web/assets/{chunk-L5GCOVLC-CE2w8Nm_.js → chunk-ZS6VBONO-DBjJO0w9.js} +2 -2
- package/web/assets/{chunk-NV3KIAZN-5yvcpMiu.js → chunk-ZUNWM646-DNRJyNPe.js} +1 -1
- package/web/assets/classDiagram-FGAMPOII-C5Ibyode.js +1 -0
- package/web/assets/classDiagram-v2-AI5RJEK4-C5Ibyode.js +1 -0
- package/web/assets/{cose-bilkent-RZA4XIPR-BHpK4Crp.js → cose-bilkent-Q72C2OJ3-DMeFXnK8.js} +1 -1
- package/web/assets/cynefin-OW5HDTMX-6OCTWOGG-vlqakYcO.js +1 -0
- package/web/assets/{cynefinDiagram-TR7LZUCG-C3Iar9lZ.js → cynefinDiagram-2OOWUY4M-BY6DZkTt.js} +1 -1
- package/web/assets/dagre-MPVFI544-DWO70fy_.js +4 -0
- package/web/assets/diagram-AE4NWXFW-f7JRVRUL.js +24 -0
- package/web/assets/{diagram-L7DVE3PN-GIRyVUtt.js → diagram-BUJID5UG-BXZv1rCS.js} +2 -2
- package/web/assets/{diagram-JCD7PQ7C-DC5-9FRr.js → diagram-C44CZ5NI-CRNfvjCq.js} +1 -1
- package/web/assets/diagram-EYOLEXXS-DZOjKQVE.js +30 -0
- package/web/assets/diagram-P7B6PWOJ-D3SQmw3_.js +3 -0
- package/web/assets/{ebnfDiagram-DRHRQJWO-D8_CI4ZF.js → ebnfDiagram-FTPZ3PV6-jKWpIDN2.js} +1 -1
- package/web/assets/erDiagram-H3ERR26V-BqJntEuJ.js +99 -0
- package/web/assets/eventmodeling-NTZA5JFV-WKSWQHFS-Bq4FqtBL.js +1 -0
- package/web/assets/flowDiagram-YHGXBVSY-Dnlk2bEu.js +1 -0
- package/web/assets/ganttDiagram-RWFTB7ED-Bl6Y1K5T.js +292 -0
- package/web/assets/gitGraph-4MIJSDKK-JH2HKYUO-B3yc4GkH.js +1 -0
- package/web/assets/gitGraphDiagram-MAR6GKOP-CkNvsrdw.js +106 -0
- package/web/assets/{index-CJDpyH-n.css → index-C2_aej58.css} +1 -1
- package/web/assets/{index-DDRie6_8.js → index-Dj3vQOHK.js} +51 -51
- package/web/assets/info-A6RAGUB7-3TX3OFWW-BM3N5_Dv.js +1 -0
- package/web/assets/infoDiagram-LV547AFH-COkFutAf.js +2 -0
- package/web/assets/{ishikawaDiagram-4JDSWWDM-DmqWtjkl.js → ishikawaDiagram-PUJQGNDS-Bb8FylSR.js} +2 -2
- package/web/assets/{journeyDiagram-QUS3FAKT-XAzVzrQW.js → journeyDiagram-EW5QJT4W-BzoHUBhM.js} +4 -4
- package/web/assets/{kanban-definition-D4L7SQKK-YurRnmYn.js → kanban-definition-JSQERAZB-Uy2Pi0yQ.js} +4 -4
- package/web/assets/katex-CZ4GXH2S-C0Fcou7U.js +257 -0
- package/web/assets/{mindmap-definition-66QP5TD6-ChrWWnil.js → mindmap-definition-VBJCLQLM-B-CnOnt_.js} +3 -3
- package/web/assets/packet-AYTQ26CC-MKII6P3Y-Bd52ZE3V.js +1 -0
- package/web/assets/{pegDiagram-YKIO5C6U-QGeQLEq2.js → pegDiagram-7WILOQTJ-D9sneKXg.js} +1 -1
- package/web/assets/pie-WAS4IAKB-6B4OPMJ5-DW5Xy69Z.js +1 -0
- package/web/assets/pieDiagram-EFA7CBSB-Dx2NQofL.js +39 -0
- package/web/assets/{quadrantDiagram-VO5QLCXA-B7098wSc.js → quadrantDiagram-WARVYA7P-DPKL9_0A.js} +3 -3
- package/web/assets/radar-RG4KPBEZ-UPTR3XUL-CkzibT2h.js +1 -0
- package/web/assets/railroad-74A4TZTK-MEFUPFMS-D9zF-mDN.js +1 -0
- package/web/assets/railroad-abnf-HS5TGJTU-R5YG2S5D-ruacjUbX.js +1 -0
- package/web/assets/railroad-ebnf-LZEXJU2U-G5QEX2L6-S1zc5OiO.js +1 -0
- package/web/assets/railroad-peg-WCYAUIDC-H5I2ZRY2-Cbcr0XzY.js +1 -0
- package/web/assets/{railroadDiagram-M77LTMSB-AXu4vxk_.js → railroadDiagram-5NIQVNLQ-DsweTo14.js} +1 -1
- package/web/assets/{requirementDiagram-RASO5HTO-B-l8InpK.js → requirementDiagram-SXREGOKZ-CXwdNSVR.js} +4 -4
- package/web/assets/{sankeyDiagram-F32LOJ6L-Kd7zjJgX.js → sankeyDiagram-VV74M2VP-CA6jtP9P.js} +3 -3
- package/web/assets/{sequenceDiagram-URATNSBD-BlcdY9DS.js → sequenceDiagram-52ZFIFDL-k_5rEbzm.js} +15 -15
- package/web/assets/src-Df5C1Nz4.js +1 -0
- package/web/assets/stateDiagram-3QAKPIVI-BejHTf31.js +1 -0
- package/web/assets/stateDiagram-v2-HN2P4RDZ-BrfoRuOc.js +1 -0
- package/web/assets/swimlanes-QLVP42QD-CQSVO5D6.js +1 -0
- package/web/assets/swimlanesDiagram-JKPDBFCN-DrWB9kcD.js +8 -0
- package/web/assets/{timeline-definition-WJXWRH4I-DUfp1R3E.js → timeline-definition-GS45XAXW-C0Ks8rPP.js} +4 -4
- package/web/assets/treeView-Q6P3EWNA-ZRJGANNQ-DmKOCo6L.js +1 -0
- package/web/assets/treemap-WGGIJYW6-K64VN5AS-DO3xY92U.js +1 -0
- package/web/assets/{vennDiagram-K3VCMQLI-Bj-FN-XS.js → vennDiagram-QIQU2ZRJ-rgPiS837.js} +3 -3
- package/web/assets/wardley-WFR3VGLG-D67OWCCH-DiDPBNft.js +1 -0
- package/web/assets/wardleyDiagram-U6YNM66N-DRVr7SPi.js +78 -0
- package/web/assets/{xychartDiagram-5VRUVLCW-CK_rbSWE.js → xychartDiagram-XJAZEDNM-COtlZzYb.js} +3 -3
- package/web/index.html +19 -17
- package/web/assets/ProcessFlowModal-Badh2Pbg.js +0 -24
- package/web/assets/architecture-TIHT7OUA-V6N4J3SY-fTePvLoe.js +0 -1
- package/web/assets/architectureDiagram-OT7VKSJ7-mKEXxkeF.js +0 -36
- package/web/assets/blockDiagram-54WLDVWM-Dg_hrRWE.js +0 -132
- package/web/assets/c4Diagram-X2LASM7V-CnhoT4aV.js +0 -10
- package/web/assets/chunk-2AEHWXPW-CV4r6-1I.js +0 -127
- package/web/assets/chunk-5VCL7Z4A-CQ-2dYWj.js +0 -1
- package/web/assets/chunk-6BELYETK-ChsYtfHW.js +0 -1
- package/web/assets/chunk-7CWYLC5S-DRgGkkpF.js +0 -2
- package/web/assets/chunk-7FYTHRHK-CsmYIswB.js +0 -32
- package/web/assets/chunk-KRXBNO2N-C-UNuKKf.js +0 -1
- package/web/assets/chunk-LAHSG3N2-Bz4hcn0N.js +0 -321
- package/web/assets/chunk-LIEV3EAG-pyKGssV3.js +0 -1
- package/web/assets/chunk-NLANEA3F-XpH_NPA5.js +0 -62
- package/web/assets/chunk-PE7DX7ZZ-CCvRVj43.js +0 -10
- package/web/assets/chunk-Q67WD55A-BWCH2SVz.js +0 -156
- package/web/assets/chunk-SZD42YQK-ijyKKVr1.js +0 -70
- package/web/assets/chunk-TFPGFQPA-Dj6a-0pC.js +0 -231
- package/web/assets/chunk-TGVD4F4B-BMc31Gj2.js +0 -2
- package/web/assets/chunk-UAT7B5JY-DW-A_fpI.js +0 -1
- package/web/assets/chunk-VY5UBI4V-yxPQAWxw.js +0 -1
- package/web/assets/chunk-WJBAP47W-BckNkuEN.js +0 -1
- package/web/assets/classDiagram-VPOSVPXH-BjOiXA_C.js +0 -1
- package/web/assets/classDiagram-v2-5VFNUXQA-BjOiXA_C.js +0 -1
- package/web/assets/cynefin-VYW2F7L2-2VAHYKR6-DAsF6GZv.js +0 -1
- package/web/assets/dagre-K64A6Z3X-CUwi79mA.js +0 -4
- package/web/assets/diagram-2TLGJV2N-C2F5Nfym.js +0 -30
- package/web/assets/diagram-KFBZAVDW-Dfmf_4ti.js +0 -3
- package/web/assets/diagram-YP3FGXHI-CyNFYtkd.js +0 -24
- package/web/assets/erDiagram-SZLJLQMB-CohQjznC.js +0 -85
- package/web/assets/eventmodeling-45OFAUF4-AOUJWSLX-BvTc6iQi.js +0 -1
- package/web/assets/flowDiagram-BWE6NHOH-B6RnEvD9.js +0 -1
- package/web/assets/ganttDiagram-2QTCJSNI-Cks_mEcF.js +0 -292
- package/web/assets/gitGraph-TEB2WS4Q-U5VWYIBC-Dy7CCSZ5.js +0 -1
- package/web/assets/gitGraphDiagram-VVZAVV5G-CG41cIVc.js +0 -106
- package/web/assets/info-DKCQHKI2-DX6KST54-BLJg1ikX.js +0 -1
- package/web/assets/infoDiagram-FY4PZKRE-BJ3vPVwW.js +0 -2
- package/web/assets/katex-C5OPUE3Q-Bnbavtmu.js +0 -257
- package/web/assets/packet-7NZHBO7P-5WG45QPS-KUxcuvaA.js +0 -1
- package/web/assets/pie-RZYD4A2V-2OCZ2VTD-DPs08kJY.js +0 -1
- package/web/assets/pieDiagram-YPY3TKG5-BuT3MYzm.js +0 -39
- package/web/assets/radar-I7S5WNFK-EPLSA35B-w5F0K3a7.js +0 -1
- package/web/assets/railroad-3IZDKUUU-PWFQV6Y6-Bu668yqY.js +0 -1
- package/web/assets/railroad-abnf-AHOZXSZD-JYYJX3BS-B6ghpETS.js +0 -1
- package/web/assets/railroad-ebnf-EBAXGLYW-RBZ4ONAP-D-XmHh3M.js +0 -1
- package/web/assets/railroad-peg-LSFZ7HO6-KHNPXGPG-mhkrhzEn.js +0 -1
- package/web/assets/src-C5sx_gMp.js +0 -1
- package/web/assets/stateDiagram-DODFXNG5-DTdHc-fF.js +0 -1
- package/web/assets/stateDiagram-v2-JNMM5JRA-DioNLDDo.js +0 -1
- package/web/assets/swimlanes-OSWOYLSK-CA0ofdwY.js +0 -2
- package/web/assets/swimlanesDiagram-RHGX2RDE-PkwUdckC.js +0 -8
- package/web/assets/treeView-QDETBFTQ-EHYTSQNO-C5lpBgPm.js +0 -1
- package/web/assets/treemap-6X3UGDF4-CCWCF7EK-BB0ZyO-B.js +0 -1
- package/web/assets/wardley-OPB4EBWU-6OWERDVT-CEA3Nq0j.js +0 -1
- package/web/assets/wardleyDiagram-XK6FUAWV-CVV0dHFr.js +0 -78
- /package/web/assets/{sizeCapture-5GORAGP4-BEqQzsxs.js → sizeCapture-FGA5AGYP-BEqQzsxs.js} +0 -0
|
@@ -21,10 +21,26 @@ import type Parser from 'tree-sitter';
|
|
|
21
21
|
*
|
|
22
22
|
* `@RequestMapping` is intentionally absent: on a method it carries no implicit
|
|
23
23
|
* verb (the verb lives in its `method = RequestMethod.X` attribute), and on a
|
|
24
|
-
* class it is a URL prefix rather than a route. Callers handle
|
|
24
|
+
* class it is a URL prefix rather than a route. Callers handle `RequestMapping`
|
|
25
25
|
* separately.
|
|
26
26
|
*/
|
|
27
27
|
export declare const METHOD_ANNOTATION_TO_HTTP: Record<string, string>;
|
|
28
|
+
/**
|
|
29
|
+
* Resolve a REGISTERED vendor-derived Spring mapping annotation to its base.
|
|
30
|
+
*
|
|
31
|
+
* Vendor definitions often live in binary dependencies, so their Spring
|
|
32
|
+
* meta-annotations cannot be inspected from repository source. Resolution uses
|
|
33
|
+
* the conventional `<vendorPrefix><baseAnnotation>` name instead.
|
|
34
|
+
*
|
|
35
|
+
* Suffix matching alone accepted unrelated annotations (`@AuditPostMapping`
|
|
36
|
+
* produced a phantom route — review P2). Resolution now requires the name to
|
|
37
|
+
* be `<registeredPrefix><base>` with the prefix drawn from a small registry:
|
|
38
|
+
* `Win` by default (Winning Health), extendable via
|
|
39
|
+
* `GITNEXUS_SPRING_VENDOR_PREFIXES=Win,Acme,Other`. Changing the registry
|
|
40
|
+
* invalidates persisted JVM route evidence on the next analysis. Exact-known
|
|
41
|
+
* Spring annotation names return `undefined`; callers handle those directly.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveSpringAnnotationAlias(annotationName: string): string | undefined;
|
|
28
44
|
/**
|
|
29
45
|
* Resolve a method-level Spring mapping annotation to its HTTP method(s).
|
|
30
46
|
*
|
|
@@ -32,8 +48,21 @@ export declare const METHOD_ANNOTATION_TO_HTTP: Record<string, string>;
|
|
|
32
48
|
* one or more static `RequestMethod.X` values; when its `method` member is
|
|
33
49
|
* absent or an empty array, `'*'` preserves Spring's method-agnostic semantics.
|
|
34
50
|
* A present but non-static method expression yields no methods (fail closed).
|
|
51
|
+
*
|
|
52
|
+
* Vendor-derived aliases (e.g. `@WinPostMapping`) are resolved by suffix to
|
|
53
|
+
* their base annotation before the above logic applies — see
|
|
54
|
+
* {@link resolveSpringAnnotationAlias}.
|
|
35
55
|
*/
|
|
36
56
|
export declare function springAnnotationHttpMethods(annotationName: string, annotationText: string): readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* True when an annotation name is a class-level request-mapping annotation —
|
|
59
|
+
* either Spring's own `@RequestMapping` or a registered vendor alias that
|
|
60
|
+
* resolves to it (`@WinRequestMapping`). Class-level handling in both the
|
|
61
|
+
* group extractor and the ingestion route extractor routes through this
|
|
62
|
+
* predicate so vendor aliases get the same prefix/constraint semantics as
|
|
63
|
+
* the base annotation (review P1).
|
|
64
|
+
*/
|
|
65
|
+
export declare function isClassLevelMappingAnnotation(annotationName: string): boolean;
|
|
37
66
|
/** Intersect class- and method-level Spring mapping constraints. */
|
|
38
67
|
export declare function intersectSpringHttpMethods(classMethods: readonly string[], methodMethods: readonly string[]): readonly string[];
|
|
39
68
|
/**
|
|
@@ -16,12 +16,13 @@
|
|
|
16
16
|
* `group/` to avoid a dependency cycle.
|
|
17
17
|
*/
|
|
18
18
|
import { parseSpringAnnotationArguments } from '../frameworks/spring/annotation-arguments.js';
|
|
19
|
+
import { springVendorPrefixes } from '../frameworks/spring/vendor-prefixes.js';
|
|
19
20
|
/**
|
|
20
21
|
* Spring shortcut method-annotation → HTTP verb.
|
|
21
22
|
*
|
|
22
23
|
* `@RequestMapping` is intentionally absent: on a method it carries no implicit
|
|
23
24
|
* verb (the verb lives in its `method = RequestMethod.X` attribute), and on a
|
|
24
|
-
* class it is a URL prefix rather than a route. Callers handle
|
|
25
|
+
* class it is a URL prefix rather than a route. Callers handle `RequestMapping`
|
|
25
26
|
* separately.
|
|
26
27
|
*/
|
|
27
28
|
export const METHOD_ANNOTATION_TO_HTTP = {
|
|
@@ -32,7 +33,44 @@ export const METHOD_ANNOTATION_TO_HTTP = {
|
|
|
32
33
|
PatchMapping: 'PATCH',
|
|
33
34
|
};
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
+
* All recognised Spring mapping-annotation simple names (shortcut + base).
|
|
37
|
+
* Sorted longest-first so {@link resolveSpringAnnotationAlias} prefers the most
|
|
38
|
+
* specific suffix (e.g. `PostMapping` before any hypothetical shorter overlap).
|
|
39
|
+
*/
|
|
40
|
+
const SPRING_MAPPING_NAMES = [
|
|
41
|
+
...Object.keys(METHOD_ANNOTATION_TO_HTTP),
|
|
42
|
+
'RequestMapping',
|
|
43
|
+
].sort((a, b) => b.length - a.length);
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a REGISTERED vendor-derived Spring mapping annotation to its base.
|
|
46
|
+
*
|
|
47
|
+
* Vendor definitions often live in binary dependencies, so their Spring
|
|
48
|
+
* meta-annotations cannot be inspected from repository source. Resolution uses
|
|
49
|
+
* the conventional `<vendorPrefix><baseAnnotation>` name instead.
|
|
50
|
+
*
|
|
51
|
+
* Suffix matching alone accepted unrelated annotations (`@AuditPostMapping`
|
|
52
|
+
* produced a phantom route — review P2). Resolution now requires the name to
|
|
53
|
+
* be `<registeredPrefix><base>` with the prefix drawn from a small registry:
|
|
54
|
+
* `Win` by default (Winning Health), extendable via
|
|
55
|
+
* `GITNEXUS_SPRING_VENDOR_PREFIXES=Win,Acme,Other`. Changing the registry
|
|
56
|
+
* invalidates persisted JVM route evidence on the next analysis. Exact-known
|
|
57
|
+
* Spring annotation names return `undefined`; callers handle those directly.
|
|
58
|
+
*/
|
|
59
|
+
export function resolveSpringAnnotationAlias(annotationName) {
|
|
60
|
+
const registeredVendorPrefixes = springVendorPrefixes();
|
|
61
|
+
for (const base of SPRING_MAPPING_NAMES) {
|
|
62
|
+
if (annotationName.length > base.length && annotationName.endsWith(base)) {
|
|
63
|
+
const prefix = annotationName.slice(0, annotationName.length - base.length);
|
|
64
|
+
if (registeredVendorPrefixes.has(prefix)) {
|
|
65
|
+
return base;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Parse one `RequestMethod.X` literal or a Java `{…}` / Kotlin `[…]` array of
|
|
73
|
+
* those literals.
|
|
36
74
|
* An empty array is valid and means Spring's unrestricted/default method set.
|
|
37
75
|
* Runtime expressions fail closed instead of producing a guessed route.
|
|
38
76
|
*/
|
|
@@ -59,18 +97,23 @@ function parseRequestMethodValues(value) {
|
|
|
59
97
|
}
|
|
60
98
|
trimmed += char;
|
|
61
99
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
if (
|
|
100
|
+
const wrapped = (trimmed.startsWith('{') && trimmed.endsWith('}')) ||
|
|
101
|
+
(trimmed.startsWith('[') && trimmed.endsWith(']'));
|
|
102
|
+
if (!wrapped &&
|
|
103
|
+
(trimmed.startsWith('{') ||
|
|
104
|
+
trimmed.startsWith('[') ||
|
|
105
|
+
trimmed.endsWith('}') ||
|
|
106
|
+
trimmed.endsWith(']'))) {
|
|
65
107
|
return null;
|
|
66
|
-
|
|
108
|
+
}
|
|
109
|
+
const body = wrapped ? trimmed.slice(1, -1).trim() : trimmed;
|
|
67
110
|
if (body.length === 0)
|
|
68
111
|
return [];
|
|
69
|
-
if (!
|
|
112
|
+
if (!wrapped && body.includes(','))
|
|
70
113
|
return null;
|
|
71
114
|
const methods = [];
|
|
72
115
|
const parts = body.split(',');
|
|
73
|
-
if (
|
|
116
|
+
if (wrapped && parts[parts.length - 1].trim() === '')
|
|
74
117
|
parts.pop();
|
|
75
118
|
for (const rawPart of parts) {
|
|
76
119
|
const part = rawPart.trim();
|
|
@@ -89,12 +132,24 @@ function parseRequestMethodValues(value) {
|
|
|
89
132
|
* one or more static `RequestMethod.X` values; when its `method` member is
|
|
90
133
|
* absent or an empty array, `'*'` preserves Spring's method-agnostic semantics.
|
|
91
134
|
* A present but non-static method expression yields no methods (fail closed).
|
|
135
|
+
*
|
|
136
|
+
* Vendor-derived aliases (e.g. `@WinPostMapping`) are resolved by suffix to
|
|
137
|
+
* their base annotation before the above logic applies — see
|
|
138
|
+
* {@link resolveSpringAnnotationAlias}.
|
|
92
139
|
*/
|
|
93
140
|
export function springAnnotationHttpMethods(annotationName, annotationText) {
|
|
141
|
+
// Exact shortcut match (PostMapping → POST, etc.)
|
|
94
142
|
const shortcut = METHOD_ANNOTATION_TO_HTTP[annotationName];
|
|
95
143
|
if (shortcut)
|
|
96
144
|
return [shortcut];
|
|
97
|
-
|
|
145
|
+
// Resolve vendor alias by suffix (WinPostMapping → PostMapping, etc.)
|
|
146
|
+
const base = resolveSpringAnnotationAlias(annotationName) ?? annotationName;
|
|
147
|
+
// Alias of a shortcut annotation
|
|
148
|
+
const aliasShortcut = METHOD_ANNOTATION_TO_HTTP[base];
|
|
149
|
+
if (aliasShortcut)
|
|
150
|
+
return [aliasShortcut];
|
|
151
|
+
// Direct or aliased @RequestMapping: parse the method= attribute
|
|
152
|
+
if (base !== 'RequestMapping')
|
|
98
153
|
return [];
|
|
99
154
|
const args = parseSpringAnnotationArguments(annotationText);
|
|
100
155
|
if (args === null)
|
|
@@ -109,6 +164,19 @@ export function springAnnotationHttpMethods(annotationName, annotationText) {
|
|
|
109
164
|
return [];
|
|
110
165
|
return methods.length > 0 ? methods : ['*'];
|
|
111
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* True when an annotation name is a class-level request-mapping annotation —
|
|
169
|
+
* either Spring's own `@RequestMapping` or a registered vendor alias that
|
|
170
|
+
* resolves to it (`@WinRequestMapping`). Class-level handling in both the
|
|
171
|
+
* group extractor and the ingestion route extractor routes through this
|
|
172
|
+
* predicate so vendor aliases get the same prefix/constraint semantics as
|
|
173
|
+
* the base annotation (review P1).
|
|
174
|
+
*/
|
|
175
|
+
export function isClassLevelMappingAnnotation(annotationName) {
|
|
176
|
+
if (annotationName === 'RequestMapping')
|
|
177
|
+
return true;
|
|
178
|
+
return resolveSpringAnnotationAlias(annotationName) === 'RequestMapping';
|
|
179
|
+
}
|
|
112
180
|
/** Intersect class- and method-level Spring mapping constraints. */
|
|
113
181
|
export function intersectSpringHttpMethods(classMethods, methodMethods) {
|
|
114
182
|
if (classMethods.length === 0 || methodMethods.length === 0)
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import Parser from 'tree-sitter';
|
|
22
22
|
import Java from 'tree-sitter-java';
|
|
23
|
-
import { intersectSpringHttpMethods, springAnnotationHttpMethods, isRouteMemberKey, findEnclosingType, unquoteSpringLiteral, } from './spring-shared.js';
|
|
23
|
+
import { intersectSpringHttpMethods, springAnnotationHttpMethods, isRouteMemberKey, findEnclosingType, isClassLevelMappingAnnotation, unquoteSpringLiteral, } from './spring-shared.js';
|
|
24
24
|
import { parseJavaConstOperands } from './java-const-resolver.js';
|
|
25
25
|
/**
|
|
26
26
|
* Single predicate-free tree-sitter query that captures all route annotations
|
|
@@ -172,7 +172,8 @@ export function extractSpringRoutes(tree, filePath, lineOffset = 0) {
|
|
|
172
172
|
if (!annNode || !node || (!valueNode && !valueExprNode))
|
|
173
173
|
continue;
|
|
174
174
|
const capturedAnnotationName = annNode.text.split('.').pop() ?? annNode.text;
|
|
175
|
-
if (node.type === 'class_declaration' &&
|
|
175
|
+
if (node.type === 'class_declaration' &&
|
|
176
|
+
isClassLevelMappingAnnotation(capturedAnnotationName)) {
|
|
176
177
|
if (!isRouteMemberKey(keyNode))
|
|
177
178
|
continue;
|
|
178
179
|
if (!valueNode) {
|
|
@@ -420,12 +421,15 @@ function annotationHasRouteMember(ann) {
|
|
|
420
421
|
}
|
|
421
422
|
/** Static class/interface-level RequestMapping method constraint, or wildcard by default. */
|
|
422
423
|
function typeRequestMethods(typeNode) {
|
|
423
|
-
const mappings = declarationAnnotations(typeNode).filter((ann) => annotationName(ann)
|
|
424
|
+
const mappings = declarationAnnotations(typeNode).filter((ann) => isClassLevelMappingAnnotation(annotationName(ann) ?? ''));
|
|
424
425
|
if (mappings.length === 0)
|
|
425
426
|
return ['*'];
|
|
426
427
|
if (mappings.length !== 1)
|
|
427
428
|
return [];
|
|
428
|
-
|
|
429
|
+
const mappingName = annotationName(mappings[0]);
|
|
430
|
+
if (!mappingName)
|
|
431
|
+
return [];
|
|
432
|
+
return springAnnotationHttpMethods(mappingName, mappings[0].text);
|
|
429
433
|
}
|
|
430
434
|
function annotationRoutePathsOrDefault(ann) {
|
|
431
435
|
const paths = annotationRoutePaths(ann);
|
|
@@ -437,7 +441,7 @@ function annotationRoutePathsOrDefault(ann) {
|
|
|
437
441
|
function typeClassPrefixes(typeNode) {
|
|
438
442
|
const prefixes = [];
|
|
439
443
|
for (const ann of declarationAnnotations(typeNode)) {
|
|
440
|
-
if (annotationName(ann)
|
|
444
|
+
if (isClassLevelMappingAnnotation(annotationName(ann) ?? ''))
|
|
441
445
|
prefixes.push(...annotationRoutePaths(ann));
|
|
442
446
|
}
|
|
443
447
|
return prefixes;
|
|
@@ -1031,6 +1031,11 @@ function pass5CollectReferences(matches, positionIndex, filePath, referenceSites
|
|
|
1031
1031
|
// detection knows what to do with that. Absent for every language without
|
|
1032
1032
|
// pointer embedding, so their sites stay byte-identical.
|
|
1033
1033
|
const embeddedAsPointer = match['@reference.embedded-pointer'] !== undefined;
|
|
1034
|
+
// Static-gating marker: the call sits in a branch the language layer proved
|
|
1035
|
+
// dead at index time (Zig `if (CONST_FALSE)`). Recorded on the site and
|
|
1036
|
+
// copied to the CALLS edge; absent everywhere else (see
|
|
1037
|
+
// `ReferenceSite.staticGated`).
|
|
1038
|
+
const staticGated = kind === 'call' && match['@reference.static-gated'] !== undefined;
|
|
1034
1039
|
const site = {
|
|
1035
1040
|
name: nameCap.text,
|
|
1036
1041
|
atRange: anchor.range,
|
|
@@ -1051,6 +1056,7 @@ function pass5CollectReferences(matches, positionIndex, filePath, referenceSites
|
|
|
1051
1056
|
...(receiverChain !== undefined ? { receiverChain } : {}),
|
|
1052
1057
|
...(inCalleePosition ? { inCalleePosition: true } : {}),
|
|
1053
1058
|
...(embeddedAsPointer ? { embeddedAsPointer: true } : {}),
|
|
1059
|
+
...(staticGated ? { staticGated: true } : {}),
|
|
1054
1060
|
};
|
|
1055
1061
|
referenceSites.push(site);
|
|
1056
1062
|
}
|
|
@@ -1450,6 +1456,7 @@ const KNOWN_SUB_TAGS = new Set([
|
|
|
1450
1456
|
'@scope.lexical-names',
|
|
1451
1457
|
'@declaration.name',
|
|
1452
1458
|
'@declaration.qualified_name',
|
|
1459
|
+
'@declaration.is-synthetic',
|
|
1453
1460
|
'@import.name',
|
|
1454
1461
|
'@import.source',
|
|
1455
1462
|
'@import.alias',
|
|
@@ -1468,6 +1475,7 @@ const KNOWN_SUB_TAGS = new Set([
|
|
|
1468
1475
|
'@reference.property-key',
|
|
1469
1476
|
'@reference.callee-position',
|
|
1470
1477
|
'@reference.embedded-pointer',
|
|
1478
|
+
'@reference.static-gated',
|
|
1471
1479
|
'@reference.receiver',
|
|
1472
1480
|
'@reference.operator',
|
|
1473
1481
|
'@reference.arity',
|
|
@@ -780,6 +780,68 @@ export interface ScopeResolver {
|
|
|
780
780
|
* Swift — opt in.
|
|
781
781
|
*/
|
|
782
782
|
readonly constructorCallTargetsClass?: boolean;
|
|
783
|
+
/**
|
|
784
|
+
* When true, the CALLS edge emitted for a constructor-form site
|
|
785
|
+
* (`callForm === 'constructor'`) carries ` (constructor)` appended to its
|
|
786
|
+
* `reason` — `local-call (constructor)`, `import-resolved (constructor)`,
|
|
787
|
+
* `scope-resolution: call (constructor)` — so a consumer can tell
|
|
788
|
+
* "constructs an instance of" apart from "invokes" on the edge alone.
|
|
789
|
+
*
|
|
790
|
+
* Opt-in because the unsuffixed strings are a pinned contract: the legacy
|
|
791
|
+
* DAG vocabulary (`'import-resolved' | 'local-call' | …`, see the
|
|
792
|
+
* same-graph guarantee above) is asserted verbatim by consumers and by the
|
|
793
|
+
* per-language resolver suites, constructor sites included. A language
|
|
794
|
+
* that links a construction site to the TYPE node itself — a struct
|
|
795
|
+
* literal `T{…}` in Zig, where nothing but the marker distinguishes the
|
|
796
|
+
* edge from an invocation in the schema (PR #1432 review) — opts in; the
|
|
797
|
+
* default leaves every existing edge byte-identical.
|
|
798
|
+
*
|
|
799
|
+
* The marker rides in `reason` because relationships carry no arbitrary
|
|
800
|
+
* properties (adding one moves SCHEMA_FINGERPRINT — the IMPLEMENTS
|
|
801
|
+
* `-pointer` precedent in `pipeline/run.ts`). Applies to the free-call
|
|
802
|
+
* fallback, the reference bridge and the receiver-bound paths — a
|
|
803
|
+
* namespace-qualified literal (`mod.T{…}`, Case 1), a type nested in the
|
|
804
|
+
* receiver's class (`A.Item{}`, Case 2) and a dotted type binding (Case 3)
|
|
805
|
+
* all go through `constructionSiteReason` — so an opted-in provider sees
|
|
806
|
+
* one vocabulary whichever path resolved the site.
|
|
807
|
+
*/
|
|
808
|
+
readonly markConstructionSites?: boolean;
|
|
809
|
+
/**
|
|
810
|
+
* When true, a namespace's exported member may also be a name the target
|
|
811
|
+
* module IMPORTED and publishes as its own — the hub-module shape, a file
|
|
812
|
+
* made only of re-exports (`pub const Terminal = @import("Terminal.zig");`,
|
|
813
|
+
* `pub const Thing = @import("thing.zig").Thing;`). Such a file owns no
|
|
814
|
+
* local binding, so the default local-only export lookup
|
|
815
|
+
* (`findExportedDef`) finds nothing for `terminal.Terminal.init()`,
|
|
816
|
+
* `t: stdx.Thing`, `var p = stdx.PRNG.from_seed()` or `var a:
|
|
817
|
+
* stdx.BoundedArrayType(u8, 4)`, and the receiver-bound namespace paths
|
|
818
|
+
* (Case 1, Case 3, the compound resolver's namespace branch) fall through.
|
|
819
|
+
* With the flag those paths use `findExportedDefIncludingImportedNames`,
|
|
820
|
+
* which reads the finalized channel where the published names live.
|
|
821
|
+
*
|
|
822
|
+
* Off by default: in most languages a module's imports are not its exports
|
|
823
|
+
* (TypeScript `import { X }` publishes nothing), and the finalized edge does
|
|
824
|
+
* not record whether the import was written `pub`. Zig opts in — a hub
|
|
825
|
+
* member a consumer can name through the hub is public by construction.
|
|
826
|
+
*/
|
|
827
|
+
readonly namespaceExportsIncludeImportedNames?: boolean;
|
|
828
|
+
/**
|
|
829
|
+
* When true, a qualified receiver is walked SEGMENT BY SEGMENT from its
|
|
830
|
+
* verified namespace root instead of being split once at the last dot:
|
|
831
|
+
* `hub.sub.Thing{}` (a namespace republished by a hub — `pub const sub =
|
|
832
|
+
* @import("sub.zig");`), `mod.Outer.Inner{}` (a type nested in a type),
|
|
833
|
+
* `opmod.Op.lookup` (an enum variant reached through the module), and the
|
|
834
|
+
* typed forms `x: mod.Outer.Inner`. Each hop is either a class-like member
|
|
835
|
+
* of the current module(s) / the current class, or a namespace import
|
|
836
|
+
* edge the current module's scope binds under that name; a hop that is
|
|
837
|
+
* ambiguous — two files behind one handle disagree, or a name is both a
|
|
838
|
+
* type and a republished module — resolves nothing rather than picking a
|
|
839
|
+
* first match. Off, the receiver-bound paths (Case 1, Case 2's
|
|
840
|
+
* namespace-qualified class, Case 3) keep their one-hop lookups exactly
|
|
841
|
+
* as they are, so no existing edge moves; Zig opts in (PR #1432 review,
|
|
842
|
+
* 8.10), whose module system is nothing but nested `const` handles.
|
|
843
|
+
*/
|
|
844
|
+
readonly resolveNamespaceChains?: boolean;
|
|
783
845
|
/**
|
|
784
846
|
* How this language spells a construction expression, so the compound
|
|
785
847
|
* receiver resolver can type an INLINE constructor receiver — the
|
|
@@ -55,6 +55,8 @@ export declare function tryEmitEdge(graph: KnowledgeGraph, scopes: ScopeResoluti
|
|
|
55
55
|
/** See {@link isPhantomCalleeRead}. Set by the extractor from the
|
|
56
56
|
* language's `@reference.callee-position` marker; absent otherwise. */
|
|
57
57
|
readonly inCalleePosition?: boolean;
|
|
58
|
+
/** See `ReferenceSite.staticGated`; copied onto the emitted edge. */
|
|
59
|
+
readonly staticGated?: boolean;
|
|
58
60
|
}, targetDef: SymbolDefinition, reason: string, seen: Set<string>, confidence?: number, collapseByCallerTarget?: boolean, calleeCapture?: CalleeIdCaptureCtx): boolean;
|
|
59
61
|
/**
|
|
60
62
|
* Variant of `tryEmitEdge` that takes a pre-resolved target graph id
|
|
@@ -85,4 +87,6 @@ export declare function tryEmitEdgeWithExplicitTargetId(graph: KnowledgeGraph, s
|
|
|
85
87
|
startCol: number;
|
|
86
88
|
};
|
|
87
89
|
readonly kind: string;
|
|
90
|
+
/** See `ReferenceSite.staticGated`; copied onto the emitted edge. */
|
|
91
|
+
readonly staticGated?: boolean;
|
|
88
92
|
}, targetGraphId: string, reason: string, seen: Set<string>, confidence?: number, collapseByCallerTarget?: boolean, calleeCapture?: CalleeIdCaptureCtx): boolean;
|
|
@@ -133,6 +133,7 @@ export function tryEmitEdge(graph, scopes, nodeLookup, site, targetDef, reason,
|
|
|
133
133
|
type: edgeType,
|
|
134
134
|
confidence,
|
|
135
135
|
reason,
|
|
136
|
+
...(site.staticGated === true ? { staticGated: true } : {}),
|
|
136
137
|
});
|
|
137
138
|
return true;
|
|
138
139
|
}
|
|
@@ -184,6 +185,7 @@ export function tryEmitEdgeWithExplicitTargetId(graph, scopes, nodeLookup, site,
|
|
|
184
185
|
type: edgeType,
|
|
185
186
|
confidence,
|
|
186
187
|
reason,
|
|
188
|
+
...(site.staticGated === true ? { staticGated: true } : {}),
|
|
187
189
|
});
|
|
188
190
|
return true;
|
|
189
191
|
}
|
|
@@ -22,6 +22,15 @@ import { isOverloadableCallable, isPositionQualifiedLocalLabel, } from '../../ut
|
|
|
22
22
|
import { templateConstraintsIdTag } from '../../utils/template-arguments.js';
|
|
23
23
|
import { parameterShapeIdTag } from '../../utils/method-props.js';
|
|
24
24
|
import { definitionIdPosition } from '../utils/definition-id.js';
|
|
25
|
+
const defGraphIdMemoByLookup = new WeakMap();
|
|
26
|
+
const isResolveDefGraphIdMemoEnabled = () => {
|
|
27
|
+
const raw = process.env.GITNEXUS_RESOLVE_DEF_GRAPH_ID_MEMO;
|
|
28
|
+
if (raw === undefined || raw.trim() === '')
|
|
29
|
+
return true;
|
|
30
|
+
const value = raw.trim().toLowerCase();
|
|
31
|
+
return value !== '0' && value !== 'false' && value !== 'off' && value !== 'no';
|
|
32
|
+
};
|
|
33
|
+
const defGraphIdMemoKey = (filePath, def) => `${filePath}\0${def.nodeId ?? ''}\0${def.type ?? ''}\0${def.qualifiedName ?? ''}\0${def.parameterCount ?? ''}\0${(def.parameterTypes ?? []).join(',')}\0${(def.parameterTypeClasses ?? []).join(',')}\0${def.namespacePrefix ?? ''}\0${(def.templateArguments ?? []).join(',')}\0${templateConstraintsIdTag(def.templateConstraints)}`;
|
|
25
34
|
/**
|
|
26
35
|
* Labels that may legitimately ANCHOR a CALLS/ACCESSES edge as the
|
|
27
36
|
* source ("caller"). A Variable / Property can be the TARGET of an
|
|
@@ -188,6 +197,25 @@ function siblingCallableLabel(label) {
|
|
|
188
197
|
return undefined;
|
|
189
198
|
}
|
|
190
199
|
export function resolveDefGraphId(filePath, def, nodeLookup) {
|
|
200
|
+
if (!isResolveDefGraphIdMemoEnabled()) {
|
|
201
|
+
return resolveDefGraphIdUncached(filePath, def, nodeLookup);
|
|
202
|
+
}
|
|
203
|
+
const qn = def.qualifiedName;
|
|
204
|
+
if (qn === undefined || qn.length === 0)
|
|
205
|
+
return undefined;
|
|
206
|
+
let bucket = defGraphIdMemoByLookup.get(nodeLookup);
|
|
207
|
+
if (bucket === undefined) {
|
|
208
|
+
bucket = new Map();
|
|
209
|
+
defGraphIdMemoByLookup.set(nodeLookup, bucket);
|
|
210
|
+
}
|
|
211
|
+
const key = defGraphIdMemoKey(filePath, def);
|
|
212
|
+
if (bucket.has(key))
|
|
213
|
+
return bucket.get(key);
|
|
214
|
+
const resolved = resolveDefGraphIdUncached(filePath, def, nodeLookup);
|
|
215
|
+
bucket.set(key, resolved);
|
|
216
|
+
return resolved;
|
|
217
|
+
}
|
|
218
|
+
function resolveDefGraphIdUncached(filePath, def, nodeLookup) {
|
|
191
219
|
const qn = def.qualifiedName;
|
|
192
220
|
if (qn === undefined || qn.length === 0)
|
|
193
221
|
return undefined;
|
|
@@ -246,6 +246,15 @@ export const LINKABLE_LABELS = new Set([
|
|
|
246
246
|
// are unreachable and label-agnostic fallback can alias it to a same-named
|
|
247
247
|
// Constructor or Method (#2801).
|
|
248
248
|
'Record',
|
|
249
|
+
// Union is linkable because Zig wires `union` / `union(enum)` as a member
|
|
250
|
+
// container: the definition phase emits HAS_METHOD / HAS_PROPERTY edges FROM
|
|
251
|
+
// the Union node (`union_declaration` in MEMBER_OWNER_NODE_TYPES) and the
|
|
252
|
+
// scope side dispatches methods on union receivers (`main → isEnergy` in
|
|
253
|
+
// test/integration/resolvers/zig.test.ts). Without this entry the schema
|
|
254
|
+
// never declares a `FROM Union` pair and `analyze` aborts on the first Zig
|
|
255
|
+
// repo that declares a union (reproduced on the zig-basic fixture itself).
|
|
256
|
+
// Also lets `Tag{ .energy = 5 }` constructor references bridge to the node.
|
|
257
|
+
'Union',
|
|
249
258
|
// Trait nodes are linkable so MRO builders can bridge PHP/Rust trait
|
|
250
259
|
// defs between scope-resolution DefIds and the graph's node ids.
|
|
251
260
|
// IMPLEMENTS edges from classes to traits are otherwise invisible to
|
|
@@ -261,8 +270,8 @@ export const LINKABLE_LABELS = new Set([
|
|
|
261
270
|
//
|
|
262
271
|
// Covers every language that spells an alias this way — TypeScript, Kotlin,
|
|
263
272
|
// Dart and Rust all emit `@declaration.type_alias`. The remaining
|
|
264
|
-
// `CLASS_KINDS` entries (Typedef,
|
|
265
|
-
//
|
|
273
|
+
// `CLASS_KINDS` entries (Typedef, Delegate, Annotation, Template, Namespace)
|
|
274
|
+
// plausibly have the same gap, but nothing exercises them today
|
|
266
275
|
// and adding labels no test covers is how this list drifts out of sync with
|
|
267
276
|
// what it claims.
|
|
268
277
|
'TypeAlias',
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* chain looking for an enclosing Function/Method/Class.
|
|
7
7
|
* 2. Resolve `toDef` → target graph-node id via `nodeLookup`.
|
|
8
8
|
* 3. Emit the edge (`CALLS` / `READS` / `WRITES` / `EXTENDS` / `USES`)
|
|
9
|
-
* with the standard reason format.
|
|
9
|
+
* with the standard reason format (`referenceEdgeReason`).
|
|
10
10
|
*
|
|
11
11
|
* Skips (without throwing) when either side fails to map — either side
|
|
12
12
|
* may legitimately not exist as a graph node (e.g. a resolved target
|
|
@@ -30,6 +30,27 @@ import type { CalleeIdSink } from '../graph-bridge/callee-id-sink.js';
|
|
|
30
30
|
* `${filePath}:${startLine}:${startCol}`.
|
|
31
31
|
*/
|
|
32
32
|
type ReferenceSiteSkipSet = ReadonlySet<string>;
|
|
33
|
+
export interface EmitReferencesOptions {
|
|
34
|
+
/** When true, a constructor-form call site's edge gets ` (constructor)`
|
|
35
|
+
* appended to its reason. See `ScopeResolver.markConstructionSites`. */
|
|
36
|
+
readonly markConstructionSites?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* `reason` of the edge a resolved reference emits: `scope-resolution: <kind>`,
|
|
40
|
+
* plus ` (constructor)` for a construction site when the provider opted in —
|
|
41
|
+
* a struct literal (`T{…}` in Zig, `T { .. }` in Rust, `T{}` in Go) or a
|
|
42
|
+
* `new T()` resolves to the type (or its constructor) as a CALLS edge exactly
|
|
43
|
+
* like an invocation does, and nothing else on the edge tells the two apart
|
|
44
|
+
* (PR #1432 review).
|
|
45
|
+
*
|
|
46
|
+
* The marker rides in `reason` because relationships carry no arbitrary
|
|
47
|
+
* properties — adding one would change the relation DDL and move
|
|
48
|
+
* SCHEMA_FINGERPRINT (see the IMPLEMENTS `-pointer` precedent in
|
|
49
|
+
* `pipeline/run.ts`). The plain `scope-resolution: call` prefix is kept, so a
|
|
50
|
+
* consumer matching the prefix still sees every call; one matching the exact
|
|
51
|
+
* string sees invocations only.
|
|
52
|
+
*/
|
|
53
|
+
export declare function referenceEdgeReason(ref: Pick<Reference, 'kind' | 'callForm'>, markConstructionSites: boolean | undefined): string;
|
|
33
54
|
/**
|
|
34
55
|
* Value labels whose defs MAY be function-local. A reference to one of these is
|
|
35
56
|
* dropped only when the def is positively identified as living inside a function
|
|
@@ -65,7 +86,7 @@ calleeIdSink?: CalleeIdSink,
|
|
|
65
86
|
*
|
|
66
87
|
* Optional so callers that never capture bare identifiers are unchanged.
|
|
67
88
|
*/
|
|
68
|
-
functionLocalValueDefIds?: ReadonlySet<string
|
|
89
|
+
functionLocalValueDefIds?: ReadonlySet<string>, options?: EmitReferencesOptions): {
|
|
69
90
|
emitted: number;
|
|
70
91
|
skipped: number;
|
|
71
92
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* chain looking for an enclosing Function/Method/Class.
|
|
7
7
|
* 2. Resolve `toDef` → target graph-node id via `nodeLookup`.
|
|
8
8
|
* 3. Emit the edge (`CALLS` / `READS` / `WRITES` / `EXTENDS` / `USES`)
|
|
9
|
-
* with the standard reason format.
|
|
9
|
+
* with the standard reason format (`referenceEdgeReason`).
|
|
10
10
|
*
|
|
11
11
|
* Skips (without throwing) when either side fails to map — either side
|
|
12
12
|
* may legitimately not exist as a graph node (e.g. a resolved target
|
|
@@ -20,6 +20,26 @@
|
|
|
20
20
|
import { resolveCallerGraphId, resolveDefGraphId } from '../graph-bridge/ids.js';
|
|
21
21
|
import { mapReferenceKindToEdgeType } from '../graph-bridge/edges.js';
|
|
22
22
|
import { isValueDefinitionLabel } from '../../utils/ast-helpers.js';
|
|
23
|
+
/**
|
|
24
|
+
* `reason` of the edge a resolved reference emits: `scope-resolution: <kind>`,
|
|
25
|
+
* plus ` (constructor)` for a construction site when the provider opted in —
|
|
26
|
+
* a struct literal (`T{…}` in Zig, `T { .. }` in Rust, `T{}` in Go) or a
|
|
27
|
+
* `new T()` resolves to the type (or its constructor) as a CALLS edge exactly
|
|
28
|
+
* like an invocation does, and nothing else on the edge tells the two apart
|
|
29
|
+
* (PR #1432 review).
|
|
30
|
+
*
|
|
31
|
+
* The marker rides in `reason` because relationships carry no arbitrary
|
|
32
|
+
* properties — adding one would change the relation DDL and move
|
|
33
|
+
* SCHEMA_FINGERPRINT (see the IMPLEMENTS `-pointer` precedent in
|
|
34
|
+
* `pipeline/run.ts`). The plain `scope-resolution: call` prefix is kept, so a
|
|
35
|
+
* consumer matching the prefix still sees every call; one matching the exact
|
|
36
|
+
* string sees invocations only.
|
|
37
|
+
*/
|
|
38
|
+
export function referenceEdgeReason(ref, markConstructionSites) {
|
|
39
|
+
return markConstructionSites === true && ref.kind === 'call' && ref.callForm === 'constructor'
|
|
40
|
+
? 'scope-resolution: call (constructor)'
|
|
41
|
+
: `scope-resolution: ${ref.kind}`;
|
|
42
|
+
}
|
|
23
43
|
/**
|
|
24
44
|
* Value labels whose defs MAY be function-local. A reference to one of these is
|
|
25
45
|
* dropped only when the def is positively identified as living inside a function
|
|
@@ -53,7 +73,7 @@ calleeIdSink,
|
|
|
53
73
|
*
|
|
54
74
|
* Optional so callers that never capture bare identifiers are unchanged.
|
|
55
75
|
*/
|
|
56
|
-
functionLocalValueDefIds) {
|
|
76
|
+
functionLocalValueDefIds, options) {
|
|
57
77
|
let emitted = 0;
|
|
58
78
|
let skipped = 0;
|
|
59
79
|
const seen = new Set();
|
|
@@ -119,7 +139,8 @@ functionLocalValueDefIds) {
|
|
|
119
139
|
targetId: targetGraphId,
|
|
120
140
|
type: edgeType,
|
|
121
141
|
confidence: ref.confidence,
|
|
122
|
-
reason:
|
|
142
|
+
reason: referenceEdgeReason(ref, options?.markConstructionSites),
|
|
143
|
+
...(ref.staticGated === true ? { staticGated: true } : {}),
|
|
123
144
|
});
|
|
124
145
|
emitted++;
|
|
125
146
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* values. Providers own syntax recognition; this pass consumes only the
|
|
4
4
|
* JSON-safe facts carried by ParsedFile.
|
|
5
5
|
*/
|
|
6
|
-
import type { ParsedFile, SymbolDefinition } from '../../../../_shared/index.js';
|
|
6
|
+
import type { CallableFlowExpectedSignature, ParsedFile, SymbolDefinition } from '../../../../_shared/index.js';
|
|
7
7
|
import type { KnowledgeGraph } from '../../../graph/types.js';
|
|
8
8
|
import type { ScopeResolutionIndexes } from '../../model/scope-resolution-indexes.js';
|
|
9
9
|
import type { GraphNodeLookup } from '../graph-bridge/node-lookup.js';
|
|
@@ -44,6 +44,14 @@ export interface EmitCallableValueFlowInput {
|
|
|
44
44
|
readonly isCallableValueTarget?: (def: SymbolDefinition) => boolean;
|
|
45
45
|
readonly hasFileLocalCallableLinkage?: (def: SymbolDefinition) => boolean;
|
|
46
46
|
readonly onWarn?: (warning: CallableValueFlowWarning) => void;
|
|
47
|
+
/** When set, skip a second `collectDeferredIndirectSites` walk. */
|
|
48
|
+
readonly deferredIndirectSites?: ReadonlySet<string>;
|
|
49
|
+
/** When set, skip a second `referenceSites` signature walk. */
|
|
50
|
+
readonly callSignaturesBySite?: ReadonlyMap<string, CallableFlowExpectedSignature>;
|
|
51
|
+
}
|
|
52
|
+
export interface DeferredIndirectCollection {
|
|
53
|
+
readonly sites: ReadonlySet<string>;
|
|
54
|
+
readonly callSignaturesBySite: ReadonlyMap<string, CallableFlowExpectedSignature>;
|
|
47
55
|
}
|
|
48
56
|
/** Position key shared with the existing free/reference skip-set contract. */
|
|
49
57
|
export declare function callableFlowSiteKey(filePath: string, range: {
|
|
@@ -55,6 +63,8 @@ export declare function callableFlowSiteKey(filePath: string, range: {
|
|
|
55
63
|
* Malformed/stale facts never suppress ordinary resolution.
|
|
56
64
|
*/
|
|
57
65
|
export declare function collectDeferredIndirectSites(parsedFiles: readonly ParsedFile[], scopes?: ScopeResolutionIndexes): ReadonlySet<string>;
|
|
66
|
+
/** One `referenceSites` walk for deferred keys and call-signature evidence. */
|
|
67
|
+
export declare function collectDeferredIndirectCollection(parsedFiles: readonly ParsedFile[], scopes?: ScopeResolutionIndexes): DeferredIndirectCollection;
|
|
58
68
|
export declare function emitCallableValueFlow(input: EmitCallableValueFlowInput): CallableValueFlowResult;
|
|
59
69
|
/**
|
|
60
70
|
* Pure — exported for `bench/callable-value-flow/measure.mjs`, which guards its
|
|
@@ -28,7 +28,12 @@ export function callableFlowSiteKey(filePath, range) {
|
|
|
28
28
|
* Malformed/stale facts never suppress ordinary resolution.
|
|
29
29
|
*/
|
|
30
30
|
export function collectDeferredIndirectSites(parsedFiles, scopes) {
|
|
31
|
+
return collectDeferredIndirectCollection(parsedFiles, scopes).sites;
|
|
32
|
+
}
|
|
33
|
+
/** One `referenceSites` walk for deferred keys and call-signature evidence. */
|
|
34
|
+
export function collectDeferredIndirectCollection(parsedFiles, scopes) {
|
|
31
35
|
const out = new Set();
|
|
36
|
+
const callSignaturesBySite = new Map();
|
|
32
37
|
const flowCells = new Set();
|
|
33
38
|
if (scopes !== undefined) {
|
|
34
39
|
for (const parsed of parsedFiles) {
|
|
@@ -41,9 +46,24 @@ export function collectDeferredIndirectSites(parsedFiles, scopes) {
|
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
48
|
for (const parsed of parsedFiles) {
|
|
44
|
-
const canonical = new Set(
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
const canonical = new Set();
|
|
50
|
+
for (const site of parsed.referenceSites) {
|
|
51
|
+
if (site.kind !== 'call')
|
|
52
|
+
continue;
|
|
53
|
+
const key = callableFlowSiteKey(parsed.filePath, site.atRange);
|
|
54
|
+
canonical.add(key);
|
|
55
|
+
const signature = {
|
|
56
|
+
...(site.arity !== undefined ? { parameterCount: site.arity } : {}),
|
|
57
|
+
...(site.argumentTypes !== undefined ? { parameterTypes: site.argumentTypes } : {}),
|
|
58
|
+
...(site.argumentTypeClasses !== undefined
|
|
59
|
+
? { parameterTypeClasses: site.argumentTypeClasses }
|
|
60
|
+
: {}),
|
|
61
|
+
};
|
|
62
|
+
const previous = callSignaturesBySite.get(key);
|
|
63
|
+
if (previous === undefined || signatureEvidence(signature) > signatureEvidence(previous)) {
|
|
64
|
+
callSignaturesBySite.set(key, signature);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
47
67
|
for (const site of parsed.callableFlowSites ?? []) {
|
|
48
68
|
if (site.kind !== 'invoke')
|
|
49
69
|
continue;
|
|
@@ -58,7 +78,7 @@ export function collectDeferredIndirectSites(parsedFiles, scopes) {
|
|
|
58
78
|
}
|
|
59
79
|
}
|
|
60
80
|
}
|
|
61
|
-
return out;
|
|
81
|
+
return { sites: out, callSignaturesBySite };
|
|
62
82
|
}
|
|
63
83
|
function flowCellOperand(site) {
|
|
64
84
|
switch (site.kind) {
|
|
@@ -80,7 +100,7 @@ function flowCellOperand(site) {
|
|
|
80
100
|
export function emitCallableValueFlow(input) {
|
|
81
101
|
const facts = [];
|
|
82
102
|
const invokes = [];
|
|
83
|
-
const canonicalInvokeKeys = collectDeferredIndirectSites(input.parsedFiles, input.scopes);
|
|
103
|
+
const canonicalInvokeKeys = input.deferredIndirectSites ?? collectDeferredIndirectSites(input.parsedFiles, input.scopes);
|
|
84
104
|
let unmatchedInvokes = 0;
|
|
85
105
|
for (const parsed of input.parsedFiles) {
|
|
86
106
|
for (const site of parsed.callableFlowSites ?? []) {
|
|
@@ -347,7 +367,7 @@ export function emitCallableValueFlow(input) {
|
|
|
347
367
|
addAddress(bindingKey(fact.filePath, fact.site.destination), bindingKey(fact.filePath, fact.site.source), `address:${fact.filePath}:${fact.site.source.name}`);
|
|
348
368
|
}
|
|
349
369
|
const formalsByGraphId = indexFormalsByGraphId(input.parsedFiles, input.scopes, input.nodeLookup, targetIndexes, aliasesByTargetId);
|
|
350
|
-
const callSignaturesBySite = indexCallSignatures(input.parsedFiles);
|
|
370
|
+
const callSignaturesBySite = input.callSignaturesBySite ?? indexCallSignatures(input.parsedFiles);
|
|
351
371
|
const dynamicCallees = new Map();
|
|
352
372
|
const dynamicOverflow = new Set();
|
|
353
373
|
const dynamicTargetHistory = new Map();
|