diff --git a/internal/blastradius/handler.go b/internal/blastradius/handler.go index 5d36530..d2a865d 100644 --- a/internal/blastradius/handler.go +++ b/internal/blastradius/handler.go @@ -62,7 +62,7 @@ func findBlastRadius(g *api.Graph, repoDir, target string, maxDepth int) ([]Resu // Build reverse adjacency: nodeID → set of node IDs that import it. importedBy := make(map[string][]string) for _, rel := range g.Rels() { - if rel.Type == "IMPORTS" || rel.Type == "WILDCARD_IMPORTS" { + if rel.Type == "imports" || rel.Type == "wildcard_imports" { importedBy[rel.EndNode] = append(importedBy[rel.EndNode], rel.StartNode) } } diff --git a/internal/blastradius/handler_test.go b/internal/blastradius/handler_test.go index b609217..adb225e 100644 --- a/internal/blastradius/handler_test.go +++ b/internal/blastradius/handler_test.go @@ -37,8 +37,8 @@ func TestFindBlastRadius(t *testing.T) { fileNode("c", "internal/c/c.go"), }, Relationships: []api.Relationship{ - {ID: "r1", Type: "IMPORTS", StartNode: "a", EndNode: "b"}, - {ID: "r2", Type: "IMPORTS", StartNode: "c", EndNode: "a"}, + {ID: "r1", Type: "imports", StartNode: "a", EndNode: "b"}, + {ID: "r2", Type: "imports", StartNode: "c", EndNode: "a"}, }, } diff --git a/internal/deadcode/handler.go b/internal/deadcode/handler.go index 6f8b594..6c32d69 100644 --- a/internal/deadcode/handler.go +++ b/internal/deadcode/handler.go @@ -45,7 +45,7 @@ func findDeadCode(g *api.Graph, includeExports bool) []Result { // Build set of function node IDs that receive at least one CALLS edge. called := make(map[string]bool) for _, rel := range g.Rels() { - if rel.Type == "CALLS" || rel.Type == "CONTAINS_CALL" { + if rel.Type == "calls" || rel.Type == "contains_call" { called[rel.EndNode] = true } } diff --git a/internal/deadcode/handler_test.go b/internal/deadcode/handler_test.go index 9158489..9528bab 100644 --- a/internal/deadcode/handler_test.go +++ b/internal/deadcode/handler_test.go @@ -46,7 +46,7 @@ func TestFindDeadCode(t *testing.T) { node("f4", "Function", "Handler", "server.go"), // exported → excluded by default }, Relationships: []api.Relationship{ - {ID: "r1", Type: "CALLS", StartNode: "f2", EndNode: "f1"}, // main → process + {ID: "r1", Type: "calls", StartNode: "f2", EndNode: "f1"}, // main → process }, } diff --git a/internal/focus/handler.go b/internal/focus/handler.go index 002b75a..e62af9f 100644 --- a/internal/focus/handler.go +++ b/internal/focus/handler.go @@ -206,7 +206,7 @@ func reachableImports(g *api.Graph, seedID string, nodeByID map[string]*api.Node func functionNodesForFile(g *api.Graph, fileID string, rels []api.Relationship) []string { var ids []string for _, rel := range rels { - if (rel.Type == "DEFINES_FUNCTION" || rel.Type == "DEFINES") && rel.StartNode == fileID { + if (rel.Type == "defines_function" || rel.Type == "defines") && rel.StartNode == fileID { ids = append(ids, rel.EndNode) } } @@ -225,7 +225,7 @@ func functionNodesForFile(g *api.Graph, fileID string, rels []api.Relationship) func buildCalleesOf(rels []api.Relationship) map[string][]string { m := make(map[string][]string) for _, rel := range rels { - if rel.Type == "CALLS" || rel.Type == "CONTAINS_CALL" { + if rel.Type == "calls" || rel.Type == "contains_call" { m[rel.StartNode] = append(m[rel.StartNode], rel.EndNode) } } diff --git a/internal/mcp/server.go b/internal/mcp/server.go index bd8ea05..de9f694 100644 --- a/internal/mcp/server.go +++ b/internal/mcp/server.go @@ -339,7 +339,7 @@ type deadFn struct{ name, file string } func findDeadFunctions(g *api.Graph, includeExports bool) []deadFn { called := make(map[string]bool) for _, rel := range g.Rels() { - if rel.Type == "CALLS" || rel.Type == "CONTAINS_CALL" { + if rel.Type == "calls" || rel.Type == "contains_call" { called[rel.EndNode] = true } } @@ -366,7 +366,7 @@ type affected struct { func findAffected(g *api.Graph, target string) []affected { importedBy := make(map[string][]string) for _, rel := range g.Rels() { - if rel.Type == "IMPORTS" || rel.Type == "WILDCARD_IMPORTS" { + if rel.Type == "imports" || rel.Type == "wildcard_imports" { importedBy[rel.EndNode] = append(importedBy[rel.EndNode], rel.StartNode) } } diff --git a/scripts/check-architecture/main.go b/scripts/check-architecture/main.go index 2cc5a5c..55741e6 100644 --- a/scripts/check-architecture/main.go +++ b/scripts/check-architecture/main.go @@ -114,7 +114,7 @@ func main() { var violations []string for _, rel := range graph.rels() { - if rel.Type != "IMPORTS" && rel.Type != "WILDCARD_IMPORTS" { + if rel.Type != "imports" && rel.Type != "wildcard_imports" { continue } src := nodePackage[rel.StartNode]