fix(resolution): clean up processed refs by row id so batch boundaries can't drop sibling call sites (#1269) (#1270)
Post-batch cleanup deleted resolved refs (and parked failed ones) by (from_node_id, reference_name, reference_kind) — no line/col. When one caller had several call sites to the same callee and a batch boundary split them, the first batch's cleanup removed every row with that key, including later-batch siblings that were never attempted — their edges were silently never created. On nlohmann/json this ate 422 real call edges (write_cbor's 38 to_char_type calls indexed as 11). Refs loaded from unresolved_refs now carry their row id through resolution, and all three persist paths (sync resolveAndPersist, the yielding retry pass, the batched drain loop) delete / mark-failed by exactly that id. The key-tuple methods remain only as the fallback for hand-built refs from the public API. Failed-parking gains the same precision: outcome can differ per call site (receiver inference reads the ref's line), so a sibling must not inherit another row's failure. Also untracks the zz-scratch local test files that slipped into #1268 and gitignores the pattern. Validation: red-green regression test (5 sites, batch size 2 — old code kept 2 edges, fix keeps 5); nlohmann/json re-index is a strict superset of the previous edge set (0 lost, 422 recovered, spot-checked against source). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
6103f5e228
commit
e871c49a31
@@ -323,6 +323,17 @@ export interface UnresolvedReference {
|
||||
|
||||
/** Possible qualified names it might resolve to */
|
||||
candidates?: string[];
|
||||
|
||||
/**
|
||||
* `unresolved_refs.id` when this ref was loaded from the database. Post-pass
|
||||
* cleanup (delete-on-resolve / park-as-failed) targets exactly this row.
|
||||
* Without it, cleanup falls back to deleting by (fromNodeId, referenceName,
|
||||
* referenceKind) — which also removes SIBLING rows (same caller calling the
|
||||
* same callee at other lines) that a later batch hasn't attempted yet, so
|
||||
* their edges were silently never created when a batch boundary split the
|
||||
* call sites (#1269).
|
||||
*/
|
||||
rowId?: number;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user