SIGN IN SIGN UP

fix(semantic): WASM onnxruntime fallback; betas must ship the embedding model

onnxruntime-node ships no darwin napi bindings at all in our pinned
version — transformers.js silently fell back to the web runtime on
arm64, but the same missing-binding error escaped as a fatal import on
the Intel public instance, leaving it lexical-only ("Semantic embedder
unavailable"). The embedder now probes onnxruntime-node before
importing transformers and, when the native binding can't load (or
APPLE_DOCS_ONNX_WASM=1 forces it), aliases the specifier to the
API-compatible onnxruntime-web WASM runtime via a Bun module plugin,
pinned to one thread. model2vec is a static lookup + mean-pool, so WASM
throughput is ample — verified locally: 512-dim vectors, sane geometry.

Second gap the same investigation exposed: `sync` never fetches the
model2vec model (only setup and the CI orchestrator do), so a
sync-built corpus published a beta snapshot WITHOUT the model and every
installer of it degraded to lexical-only. publish-beta-snapshot.mjs now
runs the same pinned ensureEmbeddingModel step as CI before archiving
and refuses to publish a lexical-only snapshot.
G
Gigi committed
baa7092d6553f43e1520698820df21f2b354e5c2
Parent: 89ce0a1