mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 14:16:34 +09:00
The flywheel optimizes retrieval over an embedding substrate that is real ONNX
miniLM where ruvector loads, but a HASH placeholder otherwise. This adds a real,
multi-model WASM embedder AHEAD of that, additively and fail-closed.
(a) PRIMARY TIER — src/ruvector/lattice-wasm.ts, on the proven @ruvector/ruvllm-wasm
optional-dependency convention: dynamically imported (never a hard dep), WASM
init from bundled bytes, TOLERANT api probing (embed/embedText/Embedder), and
a real-embed verification probe (ADR-086 'loads-but-runtime-fails' trap).
Wired as Tier -1 in neural_patterns' ensureEmbeddings(), ahead of ruvector
ONNX → hash. Package specifier is env-configurable (RUFLO_LATTICE_WASM_PKG,
default @ruvector/lattice-wasm); model via RUFLO_EMBED_MODEL.
FAIL-CLOSED verified: with the package absent, latticeAvailable()=false,
latticeEmbed()=null, and embeddings STILL resolve to ruvector ONNX
(_realEmbedding:true) — ZERO regression. When the package is present it takes
over. Models supported: minilm / bge / paraphrase-minilm / GPU qwen3-0.6b
(qwen3 opt-in via explicit selection).
(b) HASH PLACEHOLDERS — the primary memory/retrieval + memory-bridge paths route
through generateEmbedding(), so they now get Lattice-first automatically.
Converging the remaining native-rust ruvllm / memory-controller / ruview stub
sites onto the same shared chain is a scoped follow-up (separate subsystems).
(c) MODEL SELECTION — the adapter is model-parameterized (latticeEmbed(text,
model)) + env-selectable now; adding embedding-MODEL as a flywheel axis is a
follow-up gated on a multi-model backend actually being installed to benchmark
against.
Additive · fail-closed · opt-in. 45 embedding/router tests green.
NOTE: exact published package name + embed export signature to be confirmed to
guarantee activation (the adapter probes tolerantly + the name is env-overridable,
so it degrades safely until then).
Claude-Session: https://claude.ai/code/session_01S7GYqnVUVxBfZ5W8znqry3