Orbit Knowledge Graph: `Definition` nodes (function_type=function) return 0 results for gitlab-org namespace
## Summary When querying the Orbit Knowledge Graph for function definitions (`Definition` nodes with `definition_type = "function"`) across the `gitlab-org` namespace (group ID: `9970`), the graph consistently returns **0 results**. This was discovered while attempting to count the total number of function definitions in the GitLab.org namespace via the Orbit graph query API. ## Steps to Reproduce The following queries were attempted and all returned 0 results: **1. Single-node traversal (table scan with filter):** ```json { "query_type": "traversal", "node": { "id": "d", "entity": "Definition", "columns": ["id", "name", "definition_type", "file_path"], "filters": { "definition_type": "function" } }, "limit": 5 } ``` **2. Aggregation count of all functions:** ```json { "query_type": "aggregation", "nodes": [{ "id": "d", "entity": "Definition", "filters": { "definition_type": "function" } }], "aggregations": [{ "function": "count", "target": "d", "alias": "function_count" }] } ``` **3. Traversal via Group → Project → Branch → Definition:** ```json { "query_type": "aggregation", "nodes": [ { "id": "g", "entity": "Group", "node_ids": [9970] }, { "id": "p", "entity": "Project" }, { "id": "b", "entity": "Branch" }, { "id": "d", "entity": "Definition", "filters": { "definition_type": "function" } } ], "aggregations": [{ "function": "count", "target": "d", "alias": "function_count", "group_by": "g" }], "relationships": [ { "type": "CONTAINS", "from": "g", "to": "p", "direction": "outgoing" }, { "type": "CONTAINS", "from": "p", "to": "b", "direction": "outgoing" }, { "type": "ON_BRANCH", "from": "d", "to": "b", "direction": "incoming" } ] } ``` All queries return `row_count: 0` or empty node results. ## Expected Behavior The `Definition` entity with `definition_type = "function"` should return indexed function definitions from repositories in the `gitlab-org` namespace (group ID: `9970`), which contains **7,546 repositories**. ## Actual Behavior All queries return 0 results. Even a broad single-node traversal on `Definition` with `definition_type = "function"` returns no data. ## Possible Causes - Code indexing (the `Definition` entity pipeline) may not be running for the `gitlab-org` group or any of its projects. - The `definition_type` field values may differ from `"function"` (e.g., different casing or enum values). - The `ON_BRANCH` relationship between `Definition` nodes and `Branch` nodes may not be populated. - The graph may only index definitions for a limited set of explicitly onboarded projects, none of which fall under `gitlab-org`. ## Context - **Namespace:** `gitlab-org` (group ID: `9970`) - **Total repos in namespace:** 7,546 - **Query tool:** Orbit Knowledge Graph (`orbit_query_graph`) - **Schema entity:** `Definition` (in `source_code` domain) - **Schema properties available:** `id`, `traversal_path`, `project_id`, `branch`, `commit_sha`, `file_path`, `fqn`, `name`, `definition_type`, `start_line`, `end_line`, `start_byte`, `end_byte`, `start_char`, `end_char`, `content` - **Relationships:** `CALLS`, `DEFINES`, `EXTENDS`, `ON_BRANCH` (outgoing); `CALLS`, `DEFINES`, `EXTENDS`, `IMPORTS` (incoming)
issue