v1.0.7 — entitySearch fix + obs_au trigger + 71 new tests
Correctness patch + test expansion. No API changes.
Fix
memory_entity_search silently lost summary and observation hits.
The primary FTS5 query joined search_fts to entities with an OR that mixed entity-level and observation-level matches. That puts the MATCH subquery behind a derived JOIN, which SQLite rejects with "unable to use function bm25 in the requested context". The try/catch caught it and fell back to WHERE name LIKE ? — so any hit whose match lived in the entity summary or in an observation disappeared.
Rewrite: two MATCH-ed subqueries UNION ALL'd by entity_id, then JOIN entities + GROUP BY with MIN(rank). The fallback LIKE now also covers summary and observations.content via a LEFT JOIN, so an FTS outage still returns sensible rows.
Add
obs_autrigger onentity_observationsso anUPDATEto an observation'scontentrefreshes the FTS5 row instead of leaving a stale one pointing at the old text. Symmetric with the existing triggers onlearnings/decisions/entities.
Tests
Expanded from 12 → 83 tests (+71). New files:
src/tools/entity.test.ts— 35 tests coveringentity_create,entity_observe,entity_search,entity_open,entity_relate,entity_delete. Exercises the UNION-ALL rewrite, theobs_autrigger, and every zod-schema edge case.src/tools/session.test.ts— 19 tests coveringsession_start/session_end, same-project ordering, the auto-close-latest-open path, archived-learning exclusion inrecentLearnings.src/tools/search.test.ts— 17 tests covering cross-type hits (learning / decision / entity / observation), type filters, the v1.0.6 archived-learning regression guard, bare-LIMIT semantics.
All 83 tests green, tsc --noEmit clean.
Install
npx -y @studiomeyer/local-memory-mcp