v0.3.5 — adapters on npm + five SQLite defects fixed
Added — both storage adapters are now on npm
@zensation/adapter-sqlite and @zensation/adapter-postgres are published (both 0.1.0). Until now the README listed them as ready while they existed only in this repository, so anyone following the documented setup could not install the storage layer it described. The release job publishes them alongside core and algorithms.
Fixed — @zensation/adapter-sqlite: five independent defects
The SQLite path did not work end to end when driven through MemoryCoordinator. Nothing in CI exercised the real core↔adapter integration, so five defects went unnoticed. Each was reproduced against realistic data before being fixed:
store()threw on every semantic fact. The layers bindfsrs_next_reviewas aDate, which better-sqlite3 cannot bind. Parameters are now coerced (Date→ ISO string).recall()returned nothing, silently.embedding <=> ?was rewritten to the constant0, producingORDER BY 0— invalid in SQLite. The coordinator swallows per-layer errors, so callers saw an empty result indistinguishable from an empty memory. The operator now maps to a real cosine-distance function (zb_cosine_dist) over the stored embeddings. It scans linearly (no ANN index): suitable for development, tests and single-user data — use the PostgreSQL adapter for large workloads.- Repeated
$1placeholders bound the wrong values, breaking all three vector queries.$Nnow maps to numbered?Nwith object binding. EpisodicMemory.getRecent(limit, context)swapped its parameters. The query places$2before$1, so positional binding assigned the limit tocontextand the context toLIMIT. Every context-filtered recall failed.procedural_memoriesused atrigger_textcolumn while the layer inserts intotrigger, so every procedural write failed. The column now matches the canonical schema; all six tables are identical to it.
Adds a coordinator↔adapter integration test suite covering each regression, plus distance-function correctness.
The PostgreSQL adapter is unaffected — it passes parameters straight to pg, where $N, <=> and date binding are native.
Full notes: CHANGELOG.md