mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-30 06:42:43 +00:00
fix: use canonical DEFINES rel IDs and remove dead code in loadExistingGraph
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
9feae692a5
commit
abc18da655
1 changed files with 7 additions and 6 deletions
|
|
@ -582,15 +582,16 @@ export const loadExistingGraph = async (
|
|||
const fromId = str(row.fromId ?? row[0]);
|
||||
const toId = str(row.toId ?? row[1]);
|
||||
if (!nodeIdSet.has(fromId) || !nodeIdSet.has(toId)) continue;
|
||||
// All relationships are regenerated by the incremental pipeline:
|
||||
// CONTAINS (processStructure), IMPORTS/CALLS/EXTENDS/IMPLEMENTS
|
||||
// (full import/call/heritage), MEMBER_OF/STEP_IN_PROCESS (communities/processes).
|
||||
// Only keep DEFINES for unchanged nodes (File -> code element).
|
||||
const type = str(row.type ?? row[2]);
|
||||
// Only keep DEFINES (intra-file, deterministic IDs, only re-created for changed files).
|
||||
// Everything else is regenerated:
|
||||
// - CONTAINS: by processStructure on all files
|
||||
// - IMPORTS, CALLS, EXTENDS, IMPLEMENTS: by full import/call/heritage on all files
|
||||
// - MEMBER_OF, STEP_IN_PROCESS: by community/process detection
|
||||
if (type !== 'DEFINES') continue;
|
||||
// For DEFINES: use the canonical ID format to avoid duplicates with freshly parsed results
|
||||
const canonicalId = `DEFINES:${fromId}->${toId}`;
|
||||
relationships.push({
|
||||
id: `${fromId}_${type}_${toId}`,
|
||||
id: canonicalId,
|
||||
sourceId: fromId,
|
||||
targetId: toId,
|
||||
type: type as any,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue