Pre-flight checks
What happened?
In _resolve_typescript_member_calls, a type name defined more than once gives no edge, even when the caller's import names the exact one. The resolver requires the receiver's type name to be unique in the whole corpus (len(type_defs) != 1: continue) before it applies the #2553 origin gate. In hono there are four Contexts: the class in src/context.ts, interfaces in src/jsx/context.ts and src/router/reg-exp-router/node.ts, and a type in src/jsx/dom/render.ts. So every c.header(), c.text(), c.json() in a file that does import type { Context } from '../../context' and (c: Context) => ... gets no edge, although the import says which Context it is. Same for Hono (4 definitions) and HonoRequest (2).
Measured against the TypeScript compiler (checker.getSymbolAtLocation at every call inside every named function), 0.9.80, hono src/: obj.method() calls found 15 / 74 (20.3%); 35 of the misses are on Context, 10 on Hono.
Steps to reproduce
mkdir -p demo/jsx && cd demo
printf 'export class Context {\n header(): number { return 1 }\n}\n' > context.ts
printf 'export interface Context {\n header(): number\n}\n' > jsx/context.ts
printf 'import type { Context } from "./context"\nexport const setCookie = (c: Context): number => c.header()\n' > cookie.ts
graphify update . --no-cluster
python -c "import json; g=json.load(open('graphify-out/graph.json')); n={x['id']:(x['label'],x.get('source_file')) for x in g['nodes']}; [print(n[e['source']], '->', n[e['target']]) for e in g.get('links', g.get('edges', [])) if e['relation']=='calls']"
Error output or graph output
(nothing printed: no calls edges)
Expected: ('setCookie()', 'cookie.ts') -> ('.header()', 'context.ts'), the class in the file cookie.ts imports.
Graphify version
0.9.80 (6478eb7)
Operating System
Windows
Python Version
3.12
Installation Method
built from source (git clone)
Additional Environment Details
No LLM keys; AST only. Clean checkout of v8 @ 6478eb7 reproduces.
Additional context
The origin gate (#2553) already knows which definitions the caller's file can see; the fix applies it before the uniqueness check instead of after. PR right after this issue.
Pre-flight checks
What happened?
In
_resolve_typescript_member_calls, a type name defined more than once gives no edge, even when the caller's import names the exact one. The resolver requires the receiver's type name to be unique in the whole corpus (len(type_defs) != 1: continue) before it applies the #2553 origin gate. In hono there are fourContexts: the class insrc/context.ts, interfaces insrc/jsx/context.tsandsrc/router/reg-exp-router/node.ts, and a type insrc/jsx/dom/render.ts. So everyc.header(),c.text(),c.json()in a file that doesimport type { Context } from '../../context'and(c: Context) => ...gets no edge, although the import says whichContextit is. Same forHono(4 definitions) andHonoRequest(2).Measured against the TypeScript compiler (
checker.getSymbolAtLocationat every call inside every named function), 0.9.80, honosrc/:obj.method()calls found 15 / 74 (20.3%); 35 of the misses are onContext, 10 onHono.Steps to reproduce
Error output or graph output
Expected:
('setCookie()', 'cookie.ts') -> ('.header()', 'context.ts'), the class in the filecookie.tsimports.Graphify version
0.9.80 (6478eb7)
Operating System
Windows
Python Version
3.12
Installation Method
built from source (git clone)
Additional Environment Details
No LLM keys; AST only. Clean checkout of v8 @ 6478eb7 reproduces.
Additional context
The origin gate (#2553) already knows which definitions the caller's file can see; the fix applies it before the uniqueness check instead of after. PR right after this issue.