@nanonets/graft 0.9.1 → 0.10.1
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 +49 -45
- package/dist/ask/fuse.d.ts.map +1 -1
- package/dist/ask/fuse.js +32 -14
- package/dist/ask/fuse.js.map +1 -1
- package/dist/claude/hooks.d.ts +13 -0
- package/dist/claude/hooks.d.ts.map +1 -1
- package/dist/claude/hooks.js +26 -2
- package/dist/claude/hooks.js.map +1 -1
- package/dist/claude/init.d.ts.map +1 -1
- package/dist/claude/init.js +6 -3
- package/dist/claude/init.js.map +1 -1
- package/dist/cli.js +93 -39
- package/dist/cli.js.map +1 -1
- package/dist/engine.d.ts +6 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +4 -1
- package/dist/engine.js.map +1 -1
- package/dist/graph/bindings.d.ts.map +1 -1
- package/dist/graph/bindings.js +80 -0
- package/dist/graph/bindings.js.map +1 -1
- package/dist/graph/build.d.ts +5 -0
- package/dist/graph/build.d.ts.map +1 -1
- package/dist/graph/build.js +21 -2
- package/dist/graph/build.js.map +1 -1
- package/dist/graph/check.d.ts +1 -1
- package/dist/graph/check.d.ts.map +1 -1
- package/dist/graph/check.js +13 -3
- package/dist/graph/check.js.map +1 -1
- package/dist/graph/extract.d.ts +6 -1
- package/dist/graph/extract.d.ts.map +1 -1
- package/dist/graph/extract.js +192 -10
- package/dist/graph/extract.js.map +1 -1
- package/dist/graph/generic.d.ts +25 -0
- package/dist/graph/generic.d.ts.map +1 -0
- package/dist/graph/generic.js +341 -0
- package/dist/graph/generic.js.map +1 -0
- package/dist/graph/invariants.d.ts +32 -0
- package/dist/graph/invariants.d.ts.map +1 -0
- package/dist/graph/invariants.js +49 -0
- package/dist/graph/invariants.js.map +1 -0
- package/dist/graph/lsp/client.d.ts +43 -0
- package/dist/graph/lsp/client.d.ts.map +1 -0
- package/dist/graph/lsp/client.js +179 -0
- package/dist/graph/lsp/client.js.map +1 -0
- package/dist/graph/lsp/enrich.d.ts +11 -0
- package/dist/graph/lsp/enrich.d.ts.map +1 -0
- package/dist/graph/lsp/enrich.js +155 -0
- package/dist/graph/lsp/enrich.js.map +1 -0
- package/dist/graph/lsp/registry.d.ts +15 -0
- package/dist/graph/lsp/registry.d.ts.map +1 -0
- package/dist/graph/lsp/registry.js +46 -0
- package/dist/graph/lsp/registry.js.map +1 -0
- package/dist/graph/queries/c.scm +13 -0
- package/dist/graph/queries/c_sharp.scm +19 -0
- package/dist/graph/queries/cpp.scm +23 -0
- package/dist/graph/queries/elixir.scm +54 -0
- package/dist/graph/queries/java.scm +20 -0
- package/dist/graph/queries/kotlin.scm +43 -0
- package/dist/graph/queries/php.scm +40 -0
- package/dist/graph/queries/ruby.scm +65 -0
- package/dist/graph/queries/rust.scm +41 -0
- package/dist/graph/queries/scala.scm +66 -0
- package/dist/graph/queries/solidity.scm +43 -0
- package/dist/graph/queries/swift.scm +51 -0
- package/dist/graph/resolve.d.ts.map +1 -1
- package/dist/graph/resolve.js +124 -18
- package/dist/graph/resolve.js.map +1 -1
- package/dist/graph/root.d.ts +11 -0
- package/dist/graph/root.d.ts.map +1 -0
- package/dist/graph/root.js +40 -0
- package/dist/graph/root.js.map +1 -0
- package/dist/graph/source-files.d.ts.map +1 -1
- package/dist/graph/source-files.js +5 -1
- package/dist/graph/source-files.js.map +1 -1
- package/dist/graph/types.d.ts +14 -7
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/graph/types.js +2 -2
- package/dist/graph/workspace-cli.d.ts +1 -1
- package/dist/graph/workspace-cli.d.ts.map +1 -1
- package/dist/graph/workspace-cli.js +2 -2
- package/dist/graph/workspace-cli.js.map +1 -1
- package/dist/graph/workspace.d.ts +2 -2
- package/dist/graph/workspace.d.ts.map +1 -1
- package/dist/graph/workspace.js +2 -2
- package/dist/graph/workspace.js.map +1 -1
- package/dist/hosts/codex-hooks.d.ts +3 -3
- package/dist/hosts/codex-hooks.d.ts.map +1 -1
- package/dist/hosts/codex-hooks.js +27 -21
- package/dist/hosts/codex-hooks.js.map +1 -1
- package/dist/mcp/tools.js +6 -6
- package/dist/mcp/tools.js.map +1 -1
- package/package.json +15 -2
- package/scripts/build-viewer.mjs +17 -1
- package/scripts/graph-quality.mjs +117 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
; Classes
|
|
2
|
+
(class_declaration
|
|
3
|
+
(type_identifier) @name) @definition.class
|
|
4
|
+
|
|
5
|
+
; Objects
|
|
6
|
+
(object_declaration
|
|
7
|
+
(type_identifier) @name) @definition.class
|
|
8
|
+
|
|
9
|
+
; Functions (top-level and member)
|
|
10
|
+
(function_declaration
|
|
11
|
+
(simple_identifier) @name) @definition.function
|
|
12
|
+
|
|
13
|
+
; Properties
|
|
14
|
+
(property_declaration
|
|
15
|
+
(variable_declaration
|
|
16
|
+
(simple_identifier) @name)) @definition.constant
|
|
17
|
+
|
|
18
|
+
; Enum entries
|
|
19
|
+
(enum_entry
|
|
20
|
+
(simple_identifier) @name) @definition.constant
|
|
21
|
+
|
|
22
|
+
; Type aliases
|
|
23
|
+
(type_alias
|
|
24
|
+
(type_identifier) @name) @definition.type
|
|
25
|
+
|
|
26
|
+
; Companion objects (only named ones)
|
|
27
|
+
(companion_object
|
|
28
|
+
(type_identifier) @name) @definition.class
|
|
29
|
+
|
|
30
|
+
; Function calls
|
|
31
|
+
(call_expression
|
|
32
|
+
(simple_identifier) @name) @reference.call
|
|
33
|
+
|
|
34
|
+
; Method calls via navigation
|
|
35
|
+
(call_expression
|
|
36
|
+
(navigation_expression
|
|
37
|
+
(navigation_suffix
|
|
38
|
+
(simple_identifier) @name))) @reference.call
|
|
39
|
+
|
|
40
|
+
; Constructor invocations (class references)
|
|
41
|
+
(constructor_invocation
|
|
42
|
+
(user_type
|
|
43
|
+
(type_identifier) @name)) @reference.class
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
(namespace_definition
|
|
2
|
+
name: (namespace_name) @name) @definition.module
|
|
3
|
+
|
|
4
|
+
(interface_declaration
|
|
5
|
+
name: (name) @name) @definition.interface
|
|
6
|
+
|
|
7
|
+
(trait_declaration
|
|
8
|
+
name: (name) @name) @definition.interface
|
|
9
|
+
|
|
10
|
+
(class_declaration
|
|
11
|
+
name: (name) @name) @definition.class
|
|
12
|
+
|
|
13
|
+
(class_interface_clause [(name) (qualified_name)] @name) @reference.implementation
|
|
14
|
+
|
|
15
|
+
(property_declaration
|
|
16
|
+
(property_element (variable_name (name) @name))) @definition.field
|
|
17
|
+
|
|
18
|
+
(function_definition
|
|
19
|
+
name: (name) @name) @definition.function
|
|
20
|
+
|
|
21
|
+
(method_declaration
|
|
22
|
+
name: (name) @name) @definition.function
|
|
23
|
+
|
|
24
|
+
(object_creation_expression
|
|
25
|
+
[
|
|
26
|
+
(qualified_name (name) @name)
|
|
27
|
+
(variable_name (name) @name)
|
|
28
|
+
]) @reference.class
|
|
29
|
+
|
|
30
|
+
(function_call_expression
|
|
31
|
+
function: [
|
|
32
|
+
(qualified_name (name) @name)
|
|
33
|
+
(variable_name (name)) @name
|
|
34
|
+
]) @reference.call
|
|
35
|
+
|
|
36
|
+
(scoped_call_expression
|
|
37
|
+
name: (name) @name) @reference.call
|
|
38
|
+
|
|
39
|
+
(member_call_expression
|
|
40
|
+
name: (name) @name) @reference.call
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
; Method definitions
|
|
2
|
+
|
|
3
|
+
(
|
|
4
|
+
(comment)* @doc
|
|
5
|
+
.
|
|
6
|
+
[
|
|
7
|
+
(method
|
|
8
|
+
name: (_) @name) @definition.method
|
|
9
|
+
(singleton_method
|
|
10
|
+
name: (_) @name) @definition.method
|
|
11
|
+
]
|
|
12
|
+
(#strip! @doc "^#\\s*")
|
|
13
|
+
(#select-adjacent! @doc @definition.method)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
(alias
|
|
17
|
+
name: (_) @name) @definition.method
|
|
18
|
+
|
|
19
|
+
(setter
|
|
20
|
+
(identifier) @ignore)
|
|
21
|
+
|
|
22
|
+
; Class definitions
|
|
23
|
+
|
|
24
|
+
(
|
|
25
|
+
(comment)* @doc
|
|
26
|
+
.
|
|
27
|
+
[
|
|
28
|
+
(class
|
|
29
|
+
name: [
|
|
30
|
+
(constant) @name
|
|
31
|
+
(scope_resolution
|
|
32
|
+
name: (_) @name)
|
|
33
|
+
]) @definition.class
|
|
34
|
+
(singleton_class
|
|
35
|
+
value: [
|
|
36
|
+
(constant) @name
|
|
37
|
+
(scope_resolution
|
|
38
|
+
name: (_) @name)
|
|
39
|
+
]) @definition.class
|
|
40
|
+
]
|
|
41
|
+
(#strip! @doc "^#\\s*")
|
|
42
|
+
(#select-adjacent! @doc @definition.class)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
; Module definitions
|
|
46
|
+
|
|
47
|
+
(
|
|
48
|
+
(module
|
|
49
|
+
name: [
|
|
50
|
+
(constant) @name
|
|
51
|
+
(scope_resolution
|
|
52
|
+
name: (_) @name)
|
|
53
|
+
]) @definition.module
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
; Calls
|
|
57
|
+
; NB: only explicit call nodes — the upstream tags.scm also tags bare
|
|
58
|
+
; [(identifier)(constant)] as @reference.call gated by (#is-not? local), but that
|
|
59
|
+
; predicate needs the paired @local.* captures (from locals.scm, which graft does
|
|
60
|
+
; not load) to mean anything. Without them it's a no-op, so bare *variable reads*
|
|
61
|
+
; that share a name with a same-file/unique method become bogus `calls` edges
|
|
62
|
+
; (resolve.ts can't tell a var read from a zero-arg call). Dropped for precision —
|
|
63
|
+
; consistent with every other breadth-tier query (all use explicit call nodes).
|
|
64
|
+
|
|
65
|
+
(call method: (identifier) @name) @reference.call
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
; Rust tags — standard tree-sitter tags convention (@definition.<kind> + @name + @reference.call).
|
|
2
|
+
; Vendored for graft's generic breadth tier. Predicates like (#strip! ...) are
|
|
3
|
+
; sanitized out at load time by generic.ts.
|
|
4
|
+
|
|
5
|
+
(function_item (identifier) @name) @definition.function
|
|
6
|
+
|
|
7
|
+
(function_signature_item (identifier) @name) @definition.function
|
|
8
|
+
|
|
9
|
+
(struct_item (type_identifier) @name) @definition.struct
|
|
10
|
+
|
|
11
|
+
(enum_item (type_identifier) @name) @definition.enum
|
|
12
|
+
|
|
13
|
+
(union_item (type_identifier) @name) @definition.struct
|
|
14
|
+
|
|
15
|
+
(trait_item (type_identifier) @name) @definition.interface
|
|
16
|
+
|
|
17
|
+
(type_item (type_identifier) @name) @definition.type
|
|
18
|
+
|
|
19
|
+
(mod_item (identifier) @name) @definition.module
|
|
20
|
+
|
|
21
|
+
(macro_definition (identifier) @name) @definition.function
|
|
22
|
+
|
|
23
|
+
(const_item (identifier) @name) @definition.constant
|
|
24
|
+
|
|
25
|
+
(static_item (identifier) @name) @definition.constant
|
|
26
|
+
|
|
27
|
+
; associated functions / methods inside impl blocks are function_item too,
|
|
28
|
+
; already captured above; call sites below:
|
|
29
|
+
|
|
30
|
+
(call_expression
|
|
31
|
+
function: [
|
|
32
|
+
(identifier) @name
|
|
33
|
+
(field_expression field: (field_identifier) @name)
|
|
34
|
+
(scoped_identifier name: (identifier) @name)
|
|
35
|
+
]) @reference.call
|
|
36
|
+
|
|
37
|
+
(macro_invocation
|
|
38
|
+
macro: [
|
|
39
|
+
(identifier) @name
|
|
40
|
+
(scoped_identifier name: (identifier) @name)
|
|
41
|
+
]) @reference.call
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
; Definitions
|
|
2
|
+
|
|
3
|
+
(package_clause
|
|
4
|
+
name: (package_identifier) @name) @definition.module
|
|
5
|
+
|
|
6
|
+
(trait_definition
|
|
7
|
+
name: (identifier) @name) @definition.interface
|
|
8
|
+
|
|
9
|
+
(enum_definition
|
|
10
|
+
name: (identifier) @name) @definition.enum
|
|
11
|
+
|
|
12
|
+
(simple_enum_case
|
|
13
|
+
name: (identifier) @name) @definition.class
|
|
14
|
+
|
|
15
|
+
(full_enum_case
|
|
16
|
+
name: (identifier) @name) @definition.class
|
|
17
|
+
|
|
18
|
+
(class_definition
|
|
19
|
+
name: (identifier) @name) @definition.class
|
|
20
|
+
|
|
21
|
+
(object_definition
|
|
22
|
+
name: (identifier) @name) @definition.object
|
|
23
|
+
|
|
24
|
+
(function_definition
|
|
25
|
+
name: (identifier) @name) @definition.function
|
|
26
|
+
|
|
27
|
+
(val_definition
|
|
28
|
+
pattern: (identifier) @name) @definition.variable
|
|
29
|
+
|
|
30
|
+
(given_definition
|
|
31
|
+
name: (identifier) @name) @definition.variable
|
|
32
|
+
|
|
33
|
+
(var_definition
|
|
34
|
+
pattern: (identifier) @name) @definition.variable
|
|
35
|
+
|
|
36
|
+
(val_declaration
|
|
37
|
+
name: (identifier) @name) @definition.variable
|
|
38
|
+
|
|
39
|
+
(var_declaration
|
|
40
|
+
name: (identifier) @name) @definition.variable
|
|
41
|
+
|
|
42
|
+
(type_definition
|
|
43
|
+
name: (type_identifier) @name) @definition.type
|
|
44
|
+
|
|
45
|
+
(class_parameter
|
|
46
|
+
name: (identifier) @name) @definition.property
|
|
47
|
+
|
|
48
|
+
; References
|
|
49
|
+
|
|
50
|
+
(call_expression
|
|
51
|
+
(identifier) @name) @reference.call
|
|
52
|
+
|
|
53
|
+
(instance_expression
|
|
54
|
+
(type_identifier) @name) @reference.interface
|
|
55
|
+
|
|
56
|
+
(instance_expression
|
|
57
|
+
(generic_type
|
|
58
|
+
(type_identifier) @name)) @reference.interface
|
|
59
|
+
|
|
60
|
+
(extends_clause
|
|
61
|
+
(type_identifier) @name) @reference.class
|
|
62
|
+
|
|
63
|
+
(extends_clause
|
|
64
|
+
(generic_type
|
|
65
|
+
(type_identifier) @name)) @reference.class
|
|
66
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
;; Method and Function declarations
|
|
2
|
+
(contract_declaration (_
|
|
3
|
+
(function_definition
|
|
4
|
+
name: (identifier) @name) @definition.method))
|
|
5
|
+
|
|
6
|
+
(source_file
|
|
7
|
+
(function_definition
|
|
8
|
+
name: (identifier) @name) @definition.function)
|
|
9
|
+
|
|
10
|
+
;; Contract, struct, enum and interface declarations
|
|
11
|
+
(contract_declaration
|
|
12
|
+
name: (identifier) @name) @definition.class
|
|
13
|
+
|
|
14
|
+
(interface_declaration
|
|
15
|
+
name: (identifier) @name) @definition.interface
|
|
16
|
+
|
|
17
|
+
(library_declaration
|
|
18
|
+
name: (identifier) @name) @definition.interface
|
|
19
|
+
|
|
20
|
+
(struct_declaration name: (identifier) @name) @definition.class
|
|
21
|
+
(enum_declaration name: (identifier) @name) @definition.class
|
|
22
|
+
(event_definition name: (identifier) @name) @definition.class
|
|
23
|
+
|
|
24
|
+
;; Function calls
|
|
25
|
+
(call_expression (expression (identifier)) @name ) @reference.call
|
|
26
|
+
|
|
27
|
+
(call_expression
|
|
28
|
+
(expression (member_expression
|
|
29
|
+
property: (_) @name ))) @reference.call
|
|
30
|
+
|
|
31
|
+
;; Log emit
|
|
32
|
+
(emit_statement name: (_) @name) @reference.class
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
;; Inheritance
|
|
36
|
+
|
|
37
|
+
(inheritance_specifier
|
|
38
|
+
ancestor: (user_defined_type (_) @name . )) @reference.class
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
;; Imports ( note that unknown is not standardised )
|
|
42
|
+
(import_directive
|
|
43
|
+
import_name: (_) @name ) @reference.unknown
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
(class_declaration
|
|
2
|
+
name: (type_identifier) @name) @definition.class
|
|
3
|
+
|
|
4
|
+
(protocol_declaration
|
|
5
|
+
name: (type_identifier) @name) @definition.interface
|
|
6
|
+
|
|
7
|
+
(class_declaration
|
|
8
|
+
(class_body
|
|
9
|
+
[
|
|
10
|
+
(function_declaration
|
|
11
|
+
name: (simple_identifier) @name
|
|
12
|
+
)
|
|
13
|
+
(subscript_declaration
|
|
14
|
+
(parameter (simple_identifier) @name)
|
|
15
|
+
)
|
|
16
|
+
(init_declaration "init" @name)
|
|
17
|
+
(deinit_declaration "deinit" @name)
|
|
18
|
+
]
|
|
19
|
+
)
|
|
20
|
+
) @definition.method
|
|
21
|
+
|
|
22
|
+
(protocol_declaration
|
|
23
|
+
(protocol_body
|
|
24
|
+
[
|
|
25
|
+
(protocol_function_declaration
|
|
26
|
+
name: (simple_identifier) @name
|
|
27
|
+
)
|
|
28
|
+
(subscript_declaration
|
|
29
|
+
(parameter (simple_identifier) @name)
|
|
30
|
+
)
|
|
31
|
+
(init_declaration "init" @name)
|
|
32
|
+
]
|
|
33
|
+
)
|
|
34
|
+
) @definition.method
|
|
35
|
+
|
|
36
|
+
(class_declaration
|
|
37
|
+
(class_body
|
|
38
|
+
[
|
|
39
|
+
(property_declaration
|
|
40
|
+
(pattern (simple_identifier) @name)
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
)
|
|
44
|
+
) @definition.property
|
|
45
|
+
|
|
46
|
+
(property_declaration
|
|
47
|
+
(pattern (simple_identifier) @name)
|
|
48
|
+
) @definition.property
|
|
49
|
+
|
|
50
|
+
(function_declaration
|
|
51
|
+
name: (simple_identifier) @name) @definition.function
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/graph/resolve.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,EAAY,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C;;sDAEsD;AACtD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B;;6FAEyF;IACzF,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,GAAE,cAAmB,GACxB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/graph/resolve.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,EAAY,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C;;sDAEsD;AACtD,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B;;6FAEyF;IACzF,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,GAAE,cAAmB,GACxB,MAAM,EAAE,CAmIV"}
|
package/dist/graph/resolve.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Resolve {@link RawEdge} intents into concrete {@link EdgeV1} edges by matching
|
|
3
3
|
* names/specifiers against the whole-repo node index.
|
|
4
4
|
*
|
|
5
|
-
* Confidence
|
|
5
|
+
* Confidence is a two-tier provenance model:
|
|
6
6
|
* - `extracted`: the target is certain — a match within the same file, an
|
|
7
7
|
* import specifier, or a structural containment.
|
|
8
8
|
* - `inferred`: a bare function target was resolved by a unique name match
|
|
@@ -24,6 +24,11 @@ export function resolveEdges(nodes, rawEdges, opts = {}) {
|
|
|
24
24
|
const ownerMethod = new Map();
|
|
25
25
|
// Go package resolution: dir (posix) → its `.go` file node ids, for import mapping.
|
|
26
26
|
const goFilesByDir = new Map();
|
|
27
|
+
// Java package resolution: a file's package-path suffix (`com/acme/Foo.java`) → its
|
|
28
|
+
// file node ids. A Java import names a type by its fully-qualified name, which by
|
|
29
|
+
// language convention mirrors the directory path under whatever source root the
|
|
30
|
+
// project uses (`src/main/java/`, `src/`, …) — so the suffix is the portable key.
|
|
31
|
+
const javaFilesBySuffix = new Map();
|
|
27
32
|
const hasGoModules = !!opts.goModules?.length;
|
|
28
33
|
for (const n of nodes) {
|
|
29
34
|
if (n.kind === "file") {
|
|
@@ -31,6 +36,14 @@ export function resolveEdges(nodes, rawEdges, opts = {}) {
|
|
|
31
36
|
const dir = posix.dirname(toPosixPath(n.path));
|
|
32
37
|
push(goFilesByDir, dir, n.id);
|
|
33
38
|
}
|
|
39
|
+
if (n.path.endsWith(".java")) {
|
|
40
|
+
// Index every directory-boundary suffix, since the source root is unknown:
|
|
41
|
+
// `src/main/java/com/acme/Foo.java` is reachable as `com/acme/Foo.java`,
|
|
42
|
+
// `acme/Foo.java`, and so on. The import's own FQN picks the right depth.
|
|
43
|
+
const parts = toPosixPath(n.path).split("/");
|
|
44
|
+
for (let i = 0; i < parts.length; i++)
|
|
45
|
+
push(javaFilesBySuffix, parts.slice(i).join("/"), n.id);
|
|
46
|
+
}
|
|
34
47
|
continue;
|
|
35
48
|
}
|
|
36
49
|
push(globalName, n.name, n);
|
|
@@ -73,7 +86,9 @@ export function resolveEdges(nodes, rawEdges, opts = {}) {
|
|
|
73
86
|
else if (e.relation === "imports" && e.specifier) {
|
|
74
87
|
const target = hasGoModules && e.file.endsWith(".go")
|
|
75
88
|
? resolveGoImport(e.specifier, opts.goModules, goFilesByDir)
|
|
76
|
-
:
|
|
89
|
+
: e.file.endsWith(".java")
|
|
90
|
+
? resolveJavaImport(e.specifier, javaFilesBySuffix)
|
|
91
|
+
: resolveImport(e.specifier, e.file, byId);
|
|
77
92
|
add(e.source, target, "imports", "extracted");
|
|
78
93
|
}
|
|
79
94
|
else if (e.relation === "extends" || e.relation === "implements") {
|
|
@@ -82,31 +97,62 @@ export function resolveEdges(nodes, rawEdges, opts = {}) {
|
|
|
82
97
|
// an unresolved base is usually an external/imported type — keep the name.
|
|
83
98
|
add(e.source, hit?.id ?? e.name, e.relation, hit?.confidence ?? "inferred");
|
|
84
99
|
}
|
|
85
|
-
else if (e.relation === "references" && e.name
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
else if (e.relation === "references" && e.name) {
|
|
101
|
+
if (e.specifier) {
|
|
102
|
+
// A named import gives both halves needed for sound resolution: the module
|
|
103
|
+
// it came from and the exported name. Resolve inside that file only, so a
|
|
104
|
+
// same-named symbol elsewhere in the repo cannot become a false edge.
|
|
105
|
+
const targetFile = resolveImport(e.specifier, e.file, byId);
|
|
106
|
+
if (!byId.has(targetFile))
|
|
107
|
+
continue; // external or unresolved module
|
|
108
|
+
const candidates = perFileName.get(targetFile)?.get(e.name) ?? [];
|
|
109
|
+
if (candidates.length === 1)
|
|
110
|
+
add(e.source, candidates[0].id, "references", "extracted");
|
|
111
|
+
}
|
|
112
|
+
else if (byId.get(e.source)?.origin === "generic") {
|
|
113
|
+
// Breadth tier: a bare-name structural reference (extends / implements /
|
|
114
|
+
// object-creation / module alias) the grammar marked but cannot type. Resolve
|
|
115
|
+
// to a type-like definition, drop-rather-than-guess, never a self-loop. Gated on
|
|
116
|
+
// generic origin so depth-tier references (which always carry a specifier) are
|
|
117
|
+
// provably untouched.
|
|
118
|
+
const refKinds = ["class", "interface", "struct", "enum", "type", "module"];
|
|
119
|
+
const hit = resolveName(e.name, e.file, refKinds, perFileName, globalName);
|
|
120
|
+
if (hit && hit.id !== e.source)
|
|
121
|
+
add(e.source, hit.id, "references", hit.confidence);
|
|
122
|
+
}
|
|
95
123
|
}
|
|
96
124
|
else if (e.relation === "calls") {
|
|
97
125
|
if (e.viaMember) {
|
|
98
126
|
if (!e.recvType)
|
|
99
127
|
continue;
|
|
100
|
-
const hit = resolveTypedMember(e.recvType, e.name, e.file, ownerMethod, classParents);
|
|
128
|
+
const hit = resolveTypedMember(e.recvType, e.name, e.file, ownerMethod, classParents, e.argCount);
|
|
101
129
|
if (hit === "ambiguous")
|
|
102
130
|
continue; // drop — never guess past an ambiguous owner
|
|
103
131
|
if (hit)
|
|
104
132
|
add(e.source, hit.id, "calls", hit.confidence);
|
|
105
133
|
// No owner-qualified match means the call is unresolved. A unique bare
|
|
106
|
-
// method name is not evidence that this receiver has that method
|
|
134
|
+
// method name is not evidence that this receiver has that method — a
|
|
135
|
+
// name-fallback here was measured to HALVE call-edge precision (73%→37%
|
|
136
|
+
// vs a compiler-grade oracle) for a 3x count inflation, i.e. noise. See #35.
|
|
107
137
|
continue;
|
|
108
138
|
}
|
|
109
|
-
|
|
139
|
+
// Three cases, because "a bare call" means something different per tier:
|
|
140
|
+
//
|
|
141
|
+
// - generic (breadth tier): tags.scm captures ALL calls as bare names, since it
|
|
142
|
+
// cannot type a receiver. In method-heavy languages those target methods, so
|
|
143
|
+
// widen to methods — ONLY here, leaving depth-tier precision untouched (an
|
|
144
|
+
// ambiguous function-vs-method name still drops).
|
|
145
|
+
// - Java (depth tier): an implicit-`this` call is spelled as a member call in
|
|
146
|
+
// extract.ts, so the only bare call reaching here is `new Foo()`, whose target
|
|
147
|
+
// is a TYPE. Against the function index every constructor edge would drop.
|
|
148
|
+
// - everything else: functions, exactly as before.
|
|
149
|
+
const srcOrigin = byId.get(e.source)?.origin;
|
|
150
|
+
const callKinds = srcOrigin === "generic"
|
|
151
|
+
? ["function", "method"]
|
|
152
|
+
: e.file.endsWith(".java")
|
|
153
|
+
? ["class", "struct", "enum", "interface"]
|
|
154
|
+
: ["function"];
|
|
155
|
+
const hit = resolveName(e.name, e.file, callKinds, perFileName, globalName);
|
|
110
156
|
if (hit)
|
|
111
157
|
add(e.source, hit.id, "calls", hit.confidence); // drop unresolved calls (too noisy)
|
|
112
158
|
}
|
|
@@ -146,15 +192,40 @@ function resolveName(name, file, kinds, perFileName, globalName) {
|
|
|
146
192
|
* - `null` — the whole chain (recvType + ancestors, breadth-first, depth ≤ 3,
|
|
147
193
|
* cycle-guarded) had zero candidates at every level.
|
|
148
194
|
*/
|
|
149
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Narrow an overload set to the candidates a call of `argCount` arguments could
|
|
197
|
+
* reach. Only Java emits `argCount`/`arity`, so for every other language this is
|
|
198
|
+
* the identity function and resolution is byte-for-byte what it was.
|
|
199
|
+
*
|
|
200
|
+
* Deliberately conservative in both directions:
|
|
201
|
+
* - A variadic candidate (`String... xs`) accepts anything from `arity - 1`
|
|
202
|
+
* upward, so it is never filtered out by count.
|
|
203
|
+
* - A candidate with no recorded arity (a graph built before this field) is
|
|
204
|
+
* kept, since absence of data is not evidence of a mismatch.
|
|
205
|
+
* - If narrowing leaves nothing, the ORIGINAL set is returned. An empty result
|
|
206
|
+
* would silently drop a real edge; handing the full set back lets the existing
|
|
207
|
+
* same-file / "ambiguous" logic make the call exactly as before.
|
|
208
|
+
*/
|
|
209
|
+
function narrowByArity(candidates, argCount) {
|
|
210
|
+
if (argCount === undefined || candidates.length < 2)
|
|
211
|
+
return candidates;
|
|
212
|
+
const fits = candidates.filter((c) => {
|
|
213
|
+
if (c.arity === undefined)
|
|
214
|
+
return true;
|
|
215
|
+
return c.variadic ? argCount >= c.arity - 1 : c.arity === argCount;
|
|
216
|
+
});
|
|
217
|
+
return fits.length > 0 ? fits : candidates;
|
|
218
|
+
}
|
|
219
|
+
function resolveTypedMember(recvType, name, file, ownerMethod, classParents, argCount) {
|
|
150
220
|
const MAX_DEPTH = 3;
|
|
151
221
|
const visited = new Set([recvType]);
|
|
152
222
|
let frontier = [recvType];
|
|
153
223
|
for (let depth = 0; depth <= MAX_DEPTH && frontier.length; depth++) {
|
|
154
224
|
for (const type of frontier) {
|
|
155
|
-
const
|
|
156
|
-
if (!
|
|
225
|
+
const all = ownerMethod.get(`${type}.${name}`);
|
|
226
|
+
if (!all || all.length === 0)
|
|
157
227
|
continue; // try next ancestor
|
|
228
|
+
const candidates = narrowByArity(all, argCount);
|
|
158
229
|
if (candidates.length === 1) {
|
|
159
230
|
const c = candidates[0];
|
|
160
231
|
return { id: c.id, confidence: c.path === file ? "extracted" : "inferred" };
|
|
@@ -199,6 +270,41 @@ function resolveImport(spec, file, byId) {
|
|
|
199
270
|
return c;
|
|
200
271
|
return spec;
|
|
201
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* Resolve a Java import's fully-qualified type name to an in-repo file node;
|
|
275
|
+
* otherwise return the raw specifier (JDK or third-party type).
|
|
276
|
+
*
|
|
277
|
+
* Java names a *type*, not a path, and states no source root — `com.acme.Foo` may
|
|
278
|
+
* live under `src/main/java/`, `src/`, or a module dir. Matching on the path SUFFIX
|
|
279
|
+
* (`com/acme/Foo.java`) is therefore root-agnostic and needs no build-file parsing,
|
|
280
|
+
* which is what keeps this deterministic and dependency-free.
|
|
281
|
+
*
|
|
282
|
+
* `import static com.acme.Foo.bar` names a member, so when the full name misses, the
|
|
283
|
+
* last segment is dropped and the enclosing type retried. A wildcard (`com.acme.*`)
|
|
284
|
+
* names a package rather than one file and is deliberately left unresolved: picking a
|
|
285
|
+
* representative would invent an edge the source does not state.
|
|
286
|
+
*
|
|
287
|
+
* A suffix shared by two files (the same FQN under two source roots, e.g. a
|
|
288
|
+
* duplicated test tree) is ambiguous, so it stays unresolved rather than guessing.
|
|
289
|
+
*/
|
|
290
|
+
function resolveJavaImport(spec, filesBySuffix) {
|
|
291
|
+
const hit = (fqn) => {
|
|
292
|
+
const suffix = `${fqn.split(".").join("/")}.java`;
|
|
293
|
+
const files = filesBySuffix.get(suffix);
|
|
294
|
+
return files && files.length === 1 ? files[0] : null;
|
|
295
|
+
};
|
|
296
|
+
const direct = hit(spec);
|
|
297
|
+
if (direct)
|
|
298
|
+
return direct;
|
|
299
|
+
// `import static a.b.C.member` → retry as `a.b.C`.
|
|
300
|
+
const dot = spec.lastIndexOf(".");
|
|
301
|
+
if (dot > 0) {
|
|
302
|
+
const enclosing = hit(spec.slice(0, dot));
|
|
303
|
+
if (enclosing)
|
|
304
|
+
return enclosing;
|
|
305
|
+
}
|
|
306
|
+
return spec;
|
|
307
|
+
}
|
|
202
308
|
/**
|
|
203
309
|
* Resolve a Go import package path to an in-repo file node when it points inside one of
|
|
204
310
|
* the repo's modules; otherwise return the raw specifier (stdlib or third-party package).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/graph/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/C,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAiB1F,MAAM,UAAU,YAAY,CAC1B,KAAe,EACf,QAAmB,EACnB,OAAuB,EAAE;IAEzB,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC/C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAiC,CAAC;IAC7D,6EAA6E;IAC7E,8EAA8E;IAC9E,MAAM,WAAW,GAAG,IAAI,GAAG,EAAoB,CAAC;IAChD,oFAAoF;IACpF,MAAM,YAAY,GAAG,IAAI,GAAG,EAAoB,CAAC;IACjD,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC;IAC9C,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACtB,IAAI,YAAY,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3C,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,WAA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,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM;YAAE,IAAI,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;IACnF,CAAC;IACD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,CAAC,+CAA+C;IAEvE,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9C,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** True when `dir` is a graft root of either shape — a built repo or a workspace parent. */
|
|
2
|
+
export declare function hasGraftIndex(dir: string): boolean;
|
|
3
|
+
export interface RootResolution {
|
|
4
|
+
/** Absolute dir to run the command against. */
|
|
5
|
+
root: string;
|
|
6
|
+
/** Directory levels walked up; 0 when the start dir was already the root (the common case). */
|
|
7
|
+
levels: number;
|
|
8
|
+
}
|
|
9
|
+
/** The nearest ancestor of `start` (inclusive) that holds a graft index, else `start`. */
|
|
10
|
+
export declare function nearestGraftRoot(start: string, override?: string): RootResolution;
|
|
11
|
+
//# sourceMappingURL=root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/graph/root.ts"],"names":[],"mappings":"AAqBA,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,+FAA+F;IAC/F,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,CAUjF"}
|