fix(build): use WASM backend for onnxruntime in compiled binary#39
Merged
sarath-soman merged 1 commit intomainfrom Mar 8, 2026
Merged
Conversation
The compiled binary embeds onnxruntime_binding.node but not its transitive dependency libonnxruntime.1.21.0.dylib, causing semantic search to silently fall back to FTS-only. Fix by switching to the WASM backend (onnxruntime-web) at build time: - Build script stubs onnxruntime-node with onnxruntime-web re-export during compilation, then restores the real package afterward - Embedder configures writable cache dirs (models + WASM runtime) to avoid /$bunfs read-only filesystem in compiled binaries - WASM runtime files are downloaded once from CDN on first run and cached in ~/.cache/pramana/wasm/ - Add onnxruntime-common as direct dependency to fix Bun package resolution - Tighten smoke test to assert no dlopen/libonnxruntime errors Closes #38 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onnxruntime-node(native) toonnxruntime-web(WASM) backend to eliminate missinglibonnxruntime.1.21.0.dylibdependencyonnxruntime-node→onnxruntime-webre-export during compilation, restores afterward~/.cache/pramana/wasm/onnxruntime-commonas direct dependency to fix Bun package resolutiondlopen/libonnxruntimeerrors in stderrTest plan
bun run lintpassesbun run typecheckpassesbun test test/unit/ test/e2e/— 297 tests passbun test test/precommit/— 64 tests pass./pramana search "purchase" --source test/fixtures --standalonereturns semantic search results (4 results with RRF ranking)./pramana search "delivery tracking" --source test/fixtures --standalonecorrectly ranks "Shipping Info" first via semantic similaritydlopenorlibonnxruntimeerrors in binary stderrbun run) still uses native backendCloses #38
🤖 Generated with Claude Code