[Bug]: POST /graph/relation/edit and DELETE /graph/relation/delete refuse the same raw spellings the create endpoints accepted
Editing or deleting a relation that acreate_relation (and acreate_entity) just stored fails whenever the caller's spelling differs from the extraction-normalized spelling acreate_entity actually persisted. POST /graph/relation/edit returns 400 Relation from ... does not exist; DELETE /graph/relation/delete silently returns DeletionResult(status='not_found', status_code=404) without removing the real edge under the normalized pair.
Verified against the same LightRAG(graph_storage='NetworkXStorage') instance across the same four names that exercise the create-side gap: Tesla(US), Tesla Inc, "Tesla", Tesla Inc. The user just created the relation via acreate_relation, then a follow-up aedit_relation (or adelete_by_relation) with the original spelling fails.
This is the sibling of the create-side bug, scoped to the edit/delete endpoints. The create-side PR (companion, see <PR link>) resolves it for the create path; this issue is the same shape on aedit_relation / adelete_by_relation.
Files involved: lightrag/utils_graph.py (aedit_relation, adelete_by_relation), lightrag/lightrag.py (LightRAG.aedit_relation / adelete_by_relation wrappers), lightrag/kg/networkx_impl.py (the storage the helpers touch).
The fix is the same six-step pattern already applied to the create-side and to aedit_entity / amerge_entities: capture-requested → normalize → lock union → legacy-wins → normalized-fallback → post-resolution self-loop guard. The resolved pair is what the existence check, the VDB id set (both permutations), the tracking row key, and the edge mutation use, so both spellings address the same relation and the same VDB row.
Reproduction is the same shape as the create-side report, with aedit_relation / adelete_by_relation in place of acreate_relation.
Source: HKUDS/LightRAG