Skip to content

Duplicate guard misses evictions of edges written through an inbound relationship name #3106

Closed

Description

@malibio

Problem

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

  1. malibio commented on Sep 27, 2026

    @malibio
    CollaboratorAuthor

    Frontend: 278 files / 5396 tests passed

  2. self-assigned this
    on Sep 27, 2026
  3. added a commit that references this issue on Sep 27, 2026
    e20b0c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions