feat: expose Rust CowEngine through rvf_branch and rvf_freeze MCP tools#701
Open
vRobM wants to merge 1 commit into
Open
feat: expose Rust CowEngine through rvf_branch and rvf_freeze MCP tools#701vRobM wants to merge 1 commit into
vRobM wants to merge 1 commit into
Conversation
Adds rvfBranch() and rvfFreeze() wrappers in rvf-wrapper.ts calling the existing NAPI bindings (RvfDatabase.branch() and RvfDatabase.freeze()). Registers rvf_branch and rvf_freeze MCP tools in mcp-server.js. Updates cli.js help. The RuVector Rust crate already has a production COW engine at crates/rvf/rvf-runtime/src/cow.rs + store.rs. These MCP tools surface that existing Rust functionality through the MCP interface. Closes the earlier rvf-mcp-server TS-level branching approach — the correct architecture is to wrap the existing Rust CowEngine via NAPI.
vRobM
force-pushed
the
feat/branching-tools
branch
from
July 17, 2026 05:16
1a59786 to
f222946
Compare
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
Exposes the existing Rust CowEngine (
crates/rvf/rvf-runtime/src/cow.rs+store.rs) through MCP tools. The Rust crate already has production COW branching with cluster-based COW addressing, dual-graph ANN query merge, membership-based tombstones, and witness audit — but it was only accessible via the NAPIRvfDatabase.branch()method with no MCP tool surface.What Changed
npm/packages/ruvector/src/core/rvf-wrapper.ts— added two wrappers:rvfBranch(store, childPath)— callsstore.branch()which invokes the RustCowEngine::from_parent()+MembershipFilterinitialization. The child inherits all parent vectors with cluster-based COW; writes only allocate local clusters (≈162 B per branch, independent of parent size).rvfFreeze(store)— callsstore.freeze()which setsread_only = trueand freezes the CowEngine epoch, preventing further writes.npm/packages/ruvector/bin/mcp-server.js— added two MCP tools:rvf_branch— create a full COW branch. Queries the child returnparent ∪ child-editsvia dual-graph ANN merge (query_via_index_cow()). Re-ingested vectors override parent on id collision; deletes in the child hide inherited vectors viaMembershipFilter. The parent should be frozen first (rvf_freeze) for production data.rvf_freeze— snapshot-freeze a store. Prevents writes, freezes CowEngine epoch.Also updated
rvf_derivedescription to clarify it is lineage-only (records parent hash + depth, no COW — child cannot see parent vectors).npm/packages/ruvector/bin/cli.js— updated help text.Architecture
The Rust COW engine (fully in
crates/rvf/rvf-runtime/src/):cow.rs): cluster-based COW,read_vector()/write_vector()with parent chain resolution,flush_writes()for slab copy-on-write,freeze(epoch)for snapshotstore.rs:2194): creates COW child withderive()+CowEngine::from_parent()+MembershipFilterseeded with all parent vectorsstore.rs:614): dual-graph ANN merge — queries child + parent HNSW simultaneously, child-wins on id collision, tombstone filteringTesting
These wrappers call through to the existing NAPI bindings which are integration-tested in
crates/rvf/tests/. No changes to the Rust crate itself — purely an MCP surface addition.Files Changed