Sprint 22 closed: the installer finally runs the same meaning search as MCP
Sprint 22 closed: the installer finally runs the same meaning search as MCP
Date: 2026-08-23
Author: Meronq team
Tags: sprint-22, memory, embeddings, desktop, adr-0020
Sprint 21 made meaning-based recall work for MCP and pnpm dev. The packaged Desktop installer still fell through to keywords: @huggingface/transformers stayed external to sidecar.mjs, and the Node entry of that package statically imports native onnxruntime-node / sharp. Shipping those would have broken the no-native packaging bet (ADR-0010 / ADR-0020).
Sprint 22 makes the installer run the same WASM stack, and cuts two remaining retrieval misses without mixing cosine into a successful keyword hit.
The web build, not the Node build
build:runtime now copies transformers.web.js plus onnxruntime-web's WASM files into src-tauri/resources/runtime/node_modules/ and rewrites package exports so import("@huggingface/transformers") cannot see a native module. Rust sets MERONQ_TRANSFORMERS_MODULE when that file is present; the embedder points env.backends.onnx.wasm.wasmPaths at packaged onnxruntime-web/dist so Node does not fetch WASM from a CDN. tauri.conf.json includes resources/runtime/**/* so the nested files land in the installer. Chat-assistant snippets inherit the same env from the sidecar process.
The sidecar warms the pipeline on listen. Health wait stays 20s (listen ≠ model ready). The UI proxy allows 180s so a cold first search is not a 0-hit timeout.
Keyword path got smarter before cosine
Contiguous SQL LIKE is still first. When it misses a reordering (22 sprint vs Sprint 22) or a Russian CEM type name (спринт vs Sprint), an AND-of-tokens step with bilingual aliases runs on the keyword path. SQLite LOWER() is ASCII-only; cosine is the wrong tool for that miss, and it is also the path that is still loading on a cold installer. True paraphrases still fall through to e5.
Weak-score hybrid ranking (mix cosine into a non-empty keyword result) stays the named later knob. Dogfood hits that looked like “weak LIKE” were reorderings and Cyrillic type names.
Resource neighbours and relatedness
Semantic fallback drops resource-layer entities (dependency today) unless the caller asked for layer=resource. Same idea as chore commits in Sprint 21: the model compresses a project into a narrow cosine band, and a lodash neighbour is not a sprint.
After memory_sync backfill, writeSemanticRelatedness persists related_to edges from stored vectors for that model_id — same singleton as search, not a second model. Those edges are excluded from the CEM snapshot archive sweep and replaced on each backfill. Resource-layer rows are not linked.
Licence
THIRD_PARTY_NOTICES.md now also names onnxruntime-web (MIT). The transformers.js copy still Apache-2.0; we do not patch upstream sources, only rewrite package.json exports to the web build.
Review notes
code_review (architecture) on the sprint diff: no medium+ blockers. Keyword-first is unchanged. Do not read this close as always-on hybrid ranking or as a native ONNX runtime in the installer.
Principle
The installer has to be the same product as MCP. Meaning search that only works in pnpm dev is a demo.