Skip to content

Cardinality-one replace has no visible signal across frontend/CLI/agent surfaces #2910

Closed

Description

@mstomar125

core#2804 made create_relationship enforce cardinality: One/reverse_cardinality: One by silently replacing the prior edge (evict-then-insert) rather than rejecting a conflicting write — matching what a single-select "assign" control implies. That decision means a write can silently steal an existing assignment, and today nothing surfaces that anywhere a caller would notice.

The gap, across four surfaces

  • Frontend relationship-viewer modal: the target picker doesn't filter out (or warn about) a target that already holds a reverse-cardinality-one edge from a different node — picking it silently steals the assignment with no confirmation.
  • relationship-viewer-service.ts: its doc comment says "the daemon validates cardinality," which reads as "duplicate cardinality-one assignments are impossible" — stale since core#2804, and could mislead a future frontend change into assuming this can't happen.
  • CLI (nodespace relationship create): prints a plain "Created relationship" success with no indication an existing edge was evicted as a side effect.
  • Agent tool (exec_create_relationship): returns {"created": true} with no signal that a reassignment occurred — an agent asked to "assign this task to Bob" could silently unassign Alice with no way to know about it or mention it to the user.

Why one issue, not four

All four are downstream of the same root decision (replace, not reject) and the same missing piece: create_relationship's result carries no information about what, if anything, got evicted. A single backend change (return the evicted edge, if any, from create_relationship) likely unlocks fixing all four surfaces coherently, so triaging/scoping them together avoids four independent, possibly-inconsistent designs for "how do we show this."

Scope note

Real UX-review scope, not a backend correctness bug — deliberately not touched in core#2804. Touches packages/agent/src/local_agent/tools.rs, which needs Michael's sign-off (separate ownership lane) in addition to any frontend/CLI work.

Suggested approach (not a commitment — needs design input)

  • create_relationship returns whether an eviction happened and, if so, the evicted edge's id/endpoints
  • Frontend: surface a confirmation or at least a toast/notice when an assign silently reassigns
  • CLI: print a note when the created edge replaced an existing one
  • Agent tool: include eviction info in the tool result so the agent can mention it in its response

Acceptance criteria

  • Design decision on how create_relationship's eviction is surfaced to callers (API shape)
  • Frontend relationship-viewer modal shows a warning/confirmation before an assign that would silently reassign
  • relationship-viewer-service.ts's doc comment updated to match actual (replace, not reject) behavior
  • CLI relationship create output distinguishes a plain create from a replace
  • Agent tool result includes reassignment info (Michael's sign-off required for packages/agent/src/local_agent/ changes)

Activity

  1. malibio commented on Sep 26, 2026

    @malibio
    Collaborator

    Frontend: 5392 passed (277 files)

  2. self-assigned this
    on Sep 26, 2026
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