Commit 70bc64f
Your Name
fix(routes): deduplicate route nodes - eliminate ghost nodes and real duplicates
Route extraction produced 3x duplicates for every JS/TS route:
- 2 real copies (express_routes + hapi_routes both matching same pattern)
- 1 ghost copy (module-level extraction with empty qualified_name)
Root causes in pass_parallel.c prescan_routes():
1. Function-level: cbm_extract_express_routes and cbm_extract_hapi_routes
both extract the same Express-style routes from the same function body.
2. Module-level: cbm_extract_express_routes/hapi_routes called with "" as
qualified_name, producing ghost nodes with empty file_path and QN
starting with a leading dot (.route.GET.path).
Fix: deduplicate routes by (method, path) after Phase 1 collection, before
prefix resolution. When duplicates exist, prefer the entry with a non-empty
qualified_name (function-level entry wins over module-level ghost).
Verified: 3:1 dedup ratio. 0 ghosts, 0 duplicates after fix.
All routes have correct file_path and qualified_name.1 parent 1ee8771 commit 70bc64f
1 file changed
+39
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1402 | 1402 | | |
1403 | 1403 | | |
1404 | 1404 | | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
1405 | 1444 | | |
1406 | 1445 | | |
1407 | 1446 | | |
| |||
0 commit comments