mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-14 23:22:54 +00:00
LOAD_PACKAGE_DEFINITION_SPEC matched `loadPackageDefinition` via a single `function: [ (identifier) @fn (#eq?) (member_expression property:(property_identifier) @fn (#eq?)) ]` alternation. Under the pinned tree-sitter@0.21.1 binding a top-level alternation whose branches reuse one capture name collapses to a single pattern with a shared predicate bucket: the member-expression branch's `@fn` is left unbound and its `#eq?` is never enforced, so that branch matches EVERY `obj.method(...)` call (`console.log(...)`, `logger.info(...)`, …). Since virtually every TS/JS file has some member call, the `usesLoadPackage` gate was effectively always-open and `new pkg.<Capitalized>Service(...)` was emitted as a spurious gRPC consumer — the exact false positive the gate was added to prevent. Split the spec into two single-branch PatternSpecs; each compiles to its own Parser.Query with an independent predicate bucket where the `#eq?` is enforced correctly. `runCompiledPatterns` concatenates their matches, so the `.length > 0` gate is unchanged. `mk` now accepts a spec or a spec array. Adds test_extract_ts_qualified_ctor_without_loadPackageDefinition_is_ignored, a negative regression test verified to FAIL on the pre-fix code and PASS with the fix: a file with no loadPackageDefinition but an unrelated member call + `new authProto.auth.v1.AuthService(...)` must emit no consumer. grpc-extractor suite 65/65; tsc + prettier + pre-commit hook clean. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bridge-db-edge.test.ts | ||
| bridge-db.test.ts | ||
| bridge-storage-tempfile.test.ts | ||
| config-parser.test.ts | ||
| cross-impact-phase2-timeout.test.ts | ||
| cross-impact.test.ts | ||
| elixir-workspace-extractor.test.ts | ||
| fixtures.ts | ||
| go-workspace-extractor.test.ts | ||
| group-path-utils.test.ts | ||
| group-service-group-mode.test.ts | ||
| group-tools.test.ts | ||
| grpc-extractor.test.ts | ||
| http-route-extractor.test.ts | ||
| http-route-multi-verb.test.ts | ||
| impact-by-uid.test.ts | ||
| include-extractor.test.ts | ||
| insecure-tempfile.test.ts | ||
| java-workspace-extractor.test.ts | ||
| manifest-extractor.test.ts | ||
| matching.test.ts | ||
| node-workspace-extractor.test.ts | ||
| python-workspace-extractor.test.ts | ||
| rust-workspace-extractor.test.ts | ||
| service-boundary-detector.test.ts | ||
| service.test.ts | ||
| storage.test.ts | ||
| sync.test.ts | ||
| thrift-extractor.test.ts | ||
| topic-extractor.test.ts | ||
| types.test.ts | ||