Commit 2663ac5
fix: create stub nodes for external edge references — zero edge loss
Previously, edges referencing nodes not in the graph (cross-repo
references, external libraries, wildcard targets like *:ClassName)
were silently dropped during Neo4j bulk load because MATCH found
no matching source/target nodes.
Fix: pre-scan all edges for missing source/target IDs, create
minimal stub nodes (kind=external) via MERGE before edge creation.
This ensures every edge in H2 is preserved in Neo4j.
The stub nodes are tagged kind=external so they can be filtered
in queries if needed, but the edges connecting real nodes to
external references are now visible in the graph.
Logged: "Neo4j: creating N stub nodes for external edge references"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 0d5e9d8 commit 2663ac5
1 file changed
Lines changed: 46 additions & 3 deletions
Lines changed: 46 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
155 | 194 | | |
156 | 195 | | |
157 | 196 | | |
| |||
162 | 201 | | |
163 | 202 | | |
164 | 203 | | |
165 | | - | |
166 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
167 | 210 | | |
168 | 211 | | |
169 | 212 | | |
| |||
0 commit comments