Problem
Soft-deleted entities remain in the reverse relationship index (by design — the file still exists on disk). Read-time methods like query_by_relationship and get_activities filter them out, but the index itself grows unboundedly for apps with frequent soft deletes.
Impact
- Index file size grows over time with dead entries
- Each reverse query loads and filters through stale entries
- Not a problem for small apps, but could degrade for high-churn apps (e.g., activity-heavy CRMs)
Suggested Approach
- Add a
compact_index method that scans for soft-deleted entities and removes their entries
- Optionally run it as part of
rebuild_index
- Could also be exposed as an MCP tool for manual invocation
Problem
Soft-deleted entities remain in the reverse relationship index (by design — the file still exists on disk). Read-time methods like
query_by_relationshipandget_activitiesfilter them out, but the index itself grows unboundedly for apps with frequent soft deletes.Impact
Suggested Approach
compact_indexmethod that scans for soft-deleted entities and removes their entriesrebuild_index