MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / partitionResolvedCleanup

Method partitionResolvedCleanup

src/resolution/index.ts:1139–1154  ·  view source on GitHub ↗

* Split resolved refs into rows deletable by id and hand-built refs that * must fall back to the key-tuple delete. Rows loaded from the database * carry their row id and are deleted by exactly that id; the key tuple * omits line/col, so it also removes SIBLING rows — the same caller calling

(resolved: ResolvedRef[])

Source from the content-addressed store, hash-verified

1137 * sites' edges were silently never created (#1269).
1138 */
1139 private static partitionResolvedCleanup(resolved: ResolvedRef[]): {
1140 rowIds: number[];
1141 legacyKeys: Array<{ fromNodeId: string; referenceName: string; referenceKind: string }>;
1142 } {
1143 const rowIds: number[] = [];
1144 const legacyKeys: Array<{ fromNodeId: string; referenceName: string; referenceKind: string }> = [];
1145 for (const r of resolved) {
1146 if (r.original.rowId != null) rowIds.push(r.original.rowId);
1147 else legacyKeys.push({
1148 fromNodeId: r.original.fromNodeId,
1149 referenceName: r.original.referenceName,
1150 referenceKind: r.original.referenceKind,
1151 });
1152 }
1153 return { rowIds, legacyKeys };
1154 }
1155
1156 /**
1157 * Same row-id precision for parking unresolvable refs as status='failed'

Callers 3

resolveAndPersistMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected