Skip to content

[BUG]: fact/topic/entity keys share one content-hash namespace — same-text nodes collide - LOW #71

Description

@RonsenbergVI

Describe the bug
Fact, Topic and NamedEntity all derive their key as hash(value) with no type discriminator (internal/graph/entity.go:36-98). remember 'billing' topic:billing gives the fact and the topic the same key, so the topic id resolves to the fact's own node and the IsAbout edge becomes self-referential.

To Reproduce

  1. POST {"query": "remember 'billing' topic:billing"}.
  2. Inspect the graph: one node where two (fact + topic) should exist; the relationship references it circularly.

Expected behavior
Node identity is (type, value) — e.g. domain-separate the hash with a type byte.

Screenshots
N/A

Additional context
Cheap to fix now; becomes a data-migration hazard the moment persistence lands. Also inflates cross-type dedupe in subtle ways (any fact whose full text equals an entity name collides with it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions