fix(fts): populate the memories_fts index on init so search works without a manual rebuild#167
Open
J0nd1sk wants to merge 1 commit into
Open
fix(fts): populate the memories_fts index on init so search works without a manual rebuild#167J0nd1sk wants to merge 1 commit into
J0nd1sk wants to merge 1 commit into
Conversation
…hout a manual rebuild External-content FTS5 (memories_fts, content=memories) starts with an empty inverted index. cmd_init applied migrations but never seeded it, and _ensure_fts_index_consistent only rebuilt when 'integrity-check' raised — an empty index is consistent, not corrupt, so a populated-but-unindexed DB returned nothing from search with no error. - cmd_init: rebuild memories_fts after migrations so fresh DBs are primed - _ensure_fts_index_consistent: detect under-population (memories_fts_docsize count < active indexed rows) and rebuild, not only on integrity-check failure - migration 084: repair DBs already created without a seeded index Resolves the scenario-8 MCP add->search integration xfail (the search path now heals a missing index deterministically instead of relying on version-dependent incremental-index timing). Refs bug TSchonleber#151 — brainctl init does not populate the FTS5 inverted index (memory_search returns empty until a manual rebuild): TSchonleber#151 Full CLI add->search resolution also requires the scoped memories_fts update triggers from PR TSchonleber#166 (fix for bug TSchonleber#152) — on the unscoped triggers, post-insert metadata UPDATEs erode the freshly inserted entry. Until TSchonleber#166 lands, the CLI add->search path stays xfail; this PR fixes the init-seed, the MCP-search path, and the auto-heal for genuinely empty indexes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
External-content FTS5 (memories_fts, content=memories) starts with an empty
inverted index. cmd_init applied migrations but never seeded it, and
_ensure_fts_index_consistent only rebuilt when 'integrity-check' raised — an
empty index is consistent, not corrupt, so a populated-but-unindexed DB
returned nothing from search with no error.
count < active indexed rows) and rebuild, not only on integrity-check failure
Resolves the scenario-8 MCP add->search integration xfail (the search path now
heals a missing index deterministically instead of relying on version-dependent
incremental-index timing).
Refs bug #151 — brainctl init does not populate the FTS5 inverted index
(memory_search returns empty until a manual rebuild):
#151
Full CLI add->search resolution also requires the scoped memories_fts update
triggers from PR #166 (fix for bug #152) — on the unscoped triggers, post-insert
metadata UPDATEs erode the freshly inserted entry. Until #166 lands, the CLI
add->search path stays xfail; this PR fixes the init-seed, the MCP-search path,
and the auto-heal for genuinely empty indexes.