Status: ✅ APPROVED with observations
Retrieval Correctness ✅
- Exact chunk-id bypass correctly short-circuits for hyphenated identifiers
- Trigram FTS index properly created with sync triggers and backfill detection
- Lexical defense + KG alias expansion safely builds OR queries with deduplication
decay_scorepreservation on FTS-only hits verified
Write Safety ✅
- All DDL migrations use
IF NOT EXISTS/DROP IF EXISTSpatterns - Readonly path gracefully degrades when trigram index unavailable
- Backfill gating prevents duplicate work
- No data loss risk (additive changes only)
MCP Stability ✅
- No tool contract changes
- Structured output format preserved
- Error handling degrades gracefully
- 4 new test files (190 LOC)
- Existing hybrid search contract unchanged
- All 9 listed tests verified per PR description
Storage Growth 📊
- Before: 4.0GB → After: 5.8GB (+1.8GB, +46%)
- Expected and acceptable for trigram index
Query Latency
- Chunk-id bypass reduces latency for direct ID queries
- Trigram FTS adds second query to
hybrid_search()(mitigated by LIMIT) - Alias expansion adds 2 KG SELECTs per query (acceptable overhead)
- Chunk-ID regex false positives (e.g.,
brain-layer) — falls through to normal search ✅ - OR expansion length — limited by curated dictionary (31 entries, max 4 aliases) ✅
- Trigram write amplification — existing WAL + batching absorb cost ✅
- Readonly DB trigram detection —
_init_readonly_db()checkssqlite_mastercorrectly ✅
Pre-Merge
- ✅ Test suite verified passing
- ✅ Storage delta documented
- 💡 Optional: Add
EXPLAIN QUERY PLANlogging for alias-expanded queries
Post-Merge Observability
- 📊 Track
fts_query_overrideusage frequency - 📊 Track trigram FTS hit rate
- 📊 Monitor enrichment queue depth
- 📊 Alert on FTS5 desync for trigram table
Production Migration
- 📝 Document trigram storage overhead (~50% expected)
- 📝 Recommend WAL checkpoint before migration
- 🔧 Consider parallel index build for large DBs (300K+ chunks)
brain_search("brainbar-ddf12232"): 0 → 1 hit via exact bypassbrain_search("alker-go"): 0 → 1 hit via trigram FTSbrain_search("Hershkovitz"): 0 → 1 hit via lexical defensebrain_search("stalkerGolem"): 0 → 1 hit via KG alias expansion
Full review: BUGBOT_REVIEW_FTS_RECALL.md
Verdict: This PR delivers high-value recall improvements with acceptable storage cost and minimal regression risk. The three-layer approach directly addresses documented user pain points. Approve with confidence. 🚀