Conversation
…s-session SYNAPSE seed lookup FTS5 shadow tables are updated via trigger on entity upsert, but SQLite WAL mode buffers these writes. New connections opened after extraction see stale FTS5 indexes and find_entities_fuzzy returns 0 rows, causing SYNAPSE to produce seeds=0 for all cross-session queries. Fix: call PRAGMA wal_checkpoint(PASSIVE) in two places: - After entity+edge loops in extract_and_store (semantic/graph.rs) — primary fix - At graph store open after migrations (sqlite/mod.rs) — startup safety net Also adds GraphStore::checkpoint_wal() helper and two regression tests: one unit test for the helper, one integration test through extract_and_store using a file DB (tempfile) to reproduce the cross-session WAL visibility issue. Closes #2166
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.
Summary
find_entities_fuzzyreturns 0 rows, SYNAPSE producesseeds=0for all cross-session queries.PRAGMA wal_checkpoint(PASSIVE)inextract_and_store(primary fix) and at graph store startup (safety net).GraphStore::checkpoint_wal()helper method.extract_and_storeusing a file DB (tempfile) to reproduce the cross-session visibility issue.Test plan
cargo nextest run -p zeph-memory --lib— 794 tests pass including new regression testsextract_and_store_fts5_cross_session_visibilityexercises full production path: session A extracts entities, session B opens new pool, FTS5 query returns resultsseeds=N(non-zero)Closes #2166