You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplicate guard misses evictions of edges written through an inbound relationship name #3106
The cross-turn duplicate guard stops treating an earlier create_relationship write as current once a later write's replaced list names its edge. That lets "put it back on Alice" recreate an edge that was evicted. The comparison only works when both sides spell the edge the same way, and for a write through an inbound (in-declaration) relationship name they don't:
create_relationship_in_tx stores an inbound-named write in its forward form: the endpoints are swapped and the forward name is used (in_declaration_forward_name / forward_endpoints in packages/core/src/services/node_service/relationship.rs).
replaced entries are built from the stored edge, so they use the forward form.
The write's own label (summary, built in completed_writes_from in packages/daemon/src/services/local_agent_service.rs) comes from the call's arguments, and rel_ops::create_relationship echoes those arguments back. So the label keeps the inbound form.
As a result, task -[assignee]-> alice that is later evicted is recorded as alice -[tasks]-> task. The two labels never match, so restoring Alice is refused as a duplicate, and the refusal wrongly says the earlier write "still stands".
This errs toward refusing a write, never toward letting a duplicate through, and it predates the eviction-history change.
Proposed approach
Have core's create_relationship / rel_ops::CreateRelOutput return the stored forward edge, not the input as given.
Build the create_relationship write label from that stored edge, not from the call's arguments.
Keep canonical_args derived from the call's arguments, so the duplicate guard's identity for a write does not change.
Acceptance criteria
A create_relationship write through an inbound name records its label in the stored forward form
A test: assign via the inbound name, evict it, then recreate it; the recreation is not refused
The canonical_args identity is unchanged (existing guard tests pass)
Activity
malibio commentedon Sep 27, 2026
Frontend: 278 files / 5396 tests passed
Label create_relationship writes by the stored edge (closes #3106)