From 6dcb00ae690cb5e8baf7f1cead51aff38b4df872 Mon Sep 17 00:00:00 2001 From: Oleg Dizus Date: Tue, 24 Mar 2026 14:13:18 +0600 Subject: [PATCH] feat-phase9-add-call-result-binding --- gitnexus/package-lock.json | 13 +++---------- gitnexus/src/core/ingestion/type-env.ts | 5 ++++- .../src/core/ingestion/type-extractors/types.ts | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/gitnexus/package-lock.json b/gitnexus/package-lock.json index 983afe064..d226b8168 100644 --- a/gitnexus/package-lock.json +++ b/gitnexus/package-lock.json @@ -1,12 +1,12 @@ { "name": "gitnexus", - "version": "1.4.7", + "version": "1.4.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gitnexus", - "version": "1.4.7", + "version": "1.4.8", "hasInstallScript": true, "license": "PolyForm-Noncommercial-1.0.0", "dependencies": { @@ -56,7 +56,7 @@ "vitest": "^4.0.18" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "optionalDependencies": { "tree-sitter-kotlin": "^0.3.8", @@ -3130,7 +3130,6 @@ "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", "license": "MIT", - "peer": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -4185,7 +4184,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -4965,7 +4963,6 @@ "integrity": "sha512-usbHZP9/oxNsUY65MQUsduGRqDHQOou1cagUSwjhoSYAmSahjQDAVsh9s+SlZkn8X8+O1FULRGwHu7AFP3kjzg==", "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "node-addon-api": "^8.3.0", "node-gyp-build": "^4.8.4" @@ -5368,7 +5365,6 @@ "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "~0.27.0", "get-tsconfig": "^4.7.5" @@ -5489,7 +5485,6 @@ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -5565,7 +5560,6 @@ "integrity": "sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@vitest/expect": "4.0.18", "@vitest/mocker": "4.0.18", @@ -5849,7 +5843,6 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/gitnexus/src/core/ingestion/type-env.ts b/gitnexus/src/core/ingestion/type-env.ts index 7e24bc0c4..77d53cf45 100644 --- a/gitnexus/src/core/ingestion/type-env.ts +++ b/gitnexus/src/core/ingestion/type-env.ts @@ -606,7 +606,10 @@ const resolveFixpointBindings = ( let typeName: string | undefined; switch (item.kind) { case 'callResult': - typeName = returnTypeLookup.lookupReturnType(item.callee); + // Phase 9: Prefer FQN lookup when available for higher precision + typeName = item.calleeFqn + ? returnTypeLookup.lookupReturnType(item.calleeFqn) + : returnTypeLookup.lookupReturnType(item.callee); break; case 'copy': typeName = scopeEnv.get(item.rhs) ?? env.get(FILE_SCOPE)?.get(item.rhs); diff --git a/gitnexus/src/core/ingestion/type-extractors/types.ts b/gitnexus/src/core/ingestion/type-extractors/types.ts index e6c4c227b..766b661ad 100644 --- a/gitnexus/src/core/ingestion/type-extractors/types.ts +++ b/gitnexus/src/core/ingestion/type-extractors/types.ts @@ -76,7 +76,7 @@ export type ForLoopExtractor = (node: SyntaxNode, ctx: ForLoopExtractorContext) * - `methodCallResult` — `const b = a.method()` (bind b to method's returnType on a's type) */ export type PendingAssignment = | { kind: 'copy'; lhs: string; rhs: string } - | { kind: 'callResult'; lhs: string; callee: string } + | { kind: 'callResult'; lhs: string; callee: string; calleeFqn?: string; line?: number } | { kind: 'fieldAccess'; lhs: string; receiver: string; field: string } | { kind: 'methodCallResult'; lhs: string; receiver: string; method: string };