Skip to content

[BUG] bm status and bm doctor` don't surface index inconsistencies (duplicate rows, orphans, inverted timestamps) #1773

Open

Description

@rirkeyou-maker
  • bm status reports only per-project observed file counts. It showed 10 observed files for a project whose search_index held 13 rows for 10 entities — the divergence was invisible.
  • bm doctor exercises a happy-path write→index→search round trip only. It passes with duplicate search_index rows, orphan entities, and inverted created_at present in the database.

Diagnosing any of these currently requires hand-written SQL against the internal database.

Impact

Users see "doctor checks passed" / normal status while their search index is silently corrupted; index problems are discovered only through visible symptoms (duplicated search hits) long after the fact.

Expected

bm doctor (the natural home) checks structural invariants, e.g.: duplicate (project_id, type, id) groups in search_index; search_index rows whose backing entity no longer exists; count of entity rows with created_at > updated_at. bm status could include per-project index row counts vs entity counts.

Versions

basic-memory 0.23.2, Windows 11, SQLite backend.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions