Skip to content

risk_index, community_summaries and flow_snapshots have no readers; rows go stale and dangle #1059

Open

Description

@Vex788

Across the package these three tables are only ever written (DELETE + INSERT in tools/build.py::_compute_summaries); no query, tool or CLI command reads them back. Two consequences:

  • The work to compute them is paid on every full postprocess and never used.
  • remove_files_permanently deletes from nodes, edges and embeddings only, and PRAGMA foreign_keys is never enabled, so risk_index.node_id rows keep pointing at deleted nodes. One graph here carries ~18k dangling risk_index rows; if a reader is ever added it will read garbage.

Either wire them into the tools that would benefit (risk scoring on the read path, cached community summaries) and add them to the deletion path, or drop them from the schema. The current state is the worst of both.

Same class, smaller: flow_memberships.node_id and nodes.community_id also survive remove_files_permanently, but those at least have readers.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions