feat(integration): surrealdb-ractor + cf::stream + kvs::mvcc_source (Sprint 0/1)#24
Conversation
…; add contract-shape principle
…s::mvcc_source Additive Sprint 0/1 scaffolds from the four-repo integration plan. Everything new; nothing existing modified except adding two `pub mod` lines to cf/mod.rs and kvs/mod.rs. * surrealdb-ractor/ (Glue #1, plan §5) Top-level crate with LiveDelta enum, LiveQueryRouter struct, and a live_stream() helper. All bodies are Sprint 1 unimplemented!() — the API surface is pinned. Added to workspace.exclude pending Sprint 1 wiring of the surrealdb path-dep features. * surrealdb/core/src/cf/stream.rs (SD-2, plan §1 Contracts) New CfStream trait that wraps the existing cf cursor as an Arrow-shaped delta stream for actor consumption. Uses the existing ChangeSet type from cf::mutations as the payload (no new deps). Existing cf cursor API unchanged. * surrealdb/core/src/kvs/mvcc_source.rs (SD-3, plan §1 + §5b) New MvccSource trait + LocalGeneratedMvcc default impl. Matches current backends' u64 generation behaviour. The kv-tikv-native-mvcc feature in Sprint 2 will add a TikvNativeMvccTxn impl alongside. Both new modules added via `pub mod` lines only (additive); no existing item moves or changes signature. Workers: SD-1, SD-2, SD-3. Sprint 0/1 of the four-repo wave.
… dev Adds [patch."https://github.com/AdaWorldAPI/lance-graph.git"] block that redirects the lance-graph-contract git dep (declared at workspace.dependencies line ~160) to the local checkout at ../lance-graph/crates/lance-graph-contract when the four-repo workspace is checked out side-by-side at /home/user/{lance-graph, surrealdb, ...}. Effect: surrealdb-core now sees the lance-graph-contract 0.2.0 additive submodules (ir, provider, actor) IMMEDIATELY without waiting for a remote push + commit-pin update cycle. Verified via: cargo tree -p surrealdb-core --no-default-features --features lance-graph -> lance-graph-contract v0.2.0 (/home/user/lance-graph/crates/lance-graph-contract) ndarray is intentionally NOT patched here (a comment in the new block explains why): the existing workspace dep + [patch.crates-io] for ndarray already routes everything through the fork, and adding a path-patch on top of those produces a "previously selected package" conflict in Cargo.lock. Build verification: `cargo check -p surrealdb-core --no-default-features --features lance-graph` passes with only a dead-code warning on the unused CfStream Sprint-1 stub (expected). Pattern reference: this is the canonical Cargo [patch."<git-url>"] syntax for redirecting git deps. The published surrealdb release does NOT ship this patch — it lives on the four-repo dev branch only.
Resolves PP-13 REJECT verdict on surrealdb-ractor: cargo refused to build it standalone because the parent surrealdb/Cargo.toml's workspace.exclude entry was not enough — cargo walks up the tree and needs the crate's own Cargo.toml to declare [workspace] (empty table suffices) to mark it as its own workspace root. Files changed: * surrealdb-ractor/Cargo.toml — add empty [workspace] block after [package] + before [dependencies]. Verified: `cargo check --manifest-path surrealdb-ractor/Cargo.toml` finishes clean. * surrealdb-ractor/Cargo.lock — committed per the convention for excluded crates (matches cognitive-shader-actor + lance-graph-tikv- provider in lance-graph repo). * .gitignore — exclude /surrealdb-ractor/target/ so the local build artifacts don't pollute git status. Per PP-13 savant audit. Wave-3 of the four-repo integration.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3ee66d926
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| [patch."https://github.com/AdaWorldAPI/lance-graph.git"] | ||
| lance-graph-contract = { path = "../lance-graph/crates/lance-graph-contract" } |
There was a problem hiding this comment.
Remove the machine-local path patch
In any checkout that does not also have ../lance-graph/crates/lance-graph-contract, enabling the new lance-graph feature now fails during dependency resolution because this patch overrides the git dependency with that local path. I verified this in the current /workspace/surrealdb checkout: cargo check -p surrealdb-core --no-default-features --features lance-graph fails with failed to read /workspace/lance-graph/crates/lance-graph-contract/Cargo.toml. Since the dependency was previously resolvable from git and the PR advertises this feature check as passing, this makes the feature unusable for normal isolated clones/CI.
Useful? React with 👍 / 👎.
…query-sprint1 feat(surrealdb-ractor): implement LiveQueryRouter::run + live_stream (Sprint 1 follow-up to #24)
Summary
Sprint 0/1 of the four-repo integration plan (lance-graph ↔ surrealdb ↔ sea-orm ↔ ndarray). All work is additive contract shape — no existing trait signature changes, no existing module moves, no existing file deletes (including
core/src/kvs/lance/which stays exactly as-is).surrealdb-ractor/(new top-level crate, inworkspace.exclude) — Glue feat(kvs): add kv-lance storage backend (Lance 4.0 columnar) #1: subscribes toLIVE SELECT/ cf change-feed and routes typedLiveDeltaevents to ractor mailboxes. Bodies stay Sprint 1unimplemented!()so the API surface is pinned.surrealdb/core/src/cf/stream.rs— new additiveCfStreamtrait wrapping the existing cf cursor as an Arrow-shaped delta stream for actor consumption. Uses the existingChangeSettype (cf::mutations) as the payload — no new deps. Wired viapub mod stream;incf/mod.rs.surrealdb/core/src/kvs/mvcc_source.rs— new additiveMvccSourcetrait +LocalGeneratedMvccdefault impl matching current backends' u64 generation. Thekv-tikv-native-mvccfeature in Sprint 2 will add aTikvNativeMvccTxnimpl alongside (PD HLC instead of local counter). Wired viapub mod mvcc_source;inkvs/mod.rs.[patch."https://github.com/AdaWorldAPI/lance-graph.git"]in rootCargo.toml— redirectslance-graph-contractgit URL to local path for dev iteration. Verified:cargo tree -p surrealdb-core --features lance-graphshowsv0.2.0 (/home/user/lance-graph/crates/lance-graph-contract). Documented as dev-only (published surrealdb does not ship the patch).Commits in this PR (oldest first)
126fea981af9aa2a54a326cb3e15a3ee66dCoordinated PRs in sibling repos
claude/lance-surrealdb-analysis-LXmugclaude/lance-surrealdb-analysis-LXmugclaude/lance-surrealdb-analysis-LXmugImportant:
kvs/lance/stays untouchedThe integration plan's earlier framing of "demote kv-lance" is superseded in plan §6 by "add
lance-projectionalongsidekv-lance(additive)". Every file undersurrealdb/core/src/kvs/lance/—wal.rs,memtable.rs,flusher.rs,commit_gate.rs,tx_buffer.rs,schema.rs,background_optimizer.rs— is unchanged in this PR. The CDC-fedlance-projectionsibling path lands in a future PR (plan §6 + §8 Sprint 3).Test plan
cargo check -p surrealdb-core --no-default-features --features lance-graph— passes clean (1 dead_code warning on unusedCfStreamSprint-1 stub, expected)cargo check --manifest-path surrealdb-ractor/Cargo.toml— passes clean (1 dead_code warning, expected)cargo tree -p surrealdb-core --features lance-graphshows the patched locallance-graph-contract v0.2.0LiveQueryRouter::runbody usingSurreal::select_live(out of scope of this PR)kv-tikv-native-mvccfeature +TikvNativeMvccTxnimpl ofMvccSource(out of scope of this PR)lance-projectionfeature +core/src/projection/lance/sibling module (out of scope of this PR)surrealdb-ractorfromworkspace.excludetomembersonce Sprint 1 wiring lands (out of scope of this PR)PP-13 savant audit
Wave-2 audit found a REJECT on
surrealdb-ractor(missing[workspace]table in the crate's own Cargo.toml — cargo refused to compile it standalone even though the parent workspace had it inexclude). Resolved in commita3ee66d.https://claude.ai/code/session_01LiUiGeUDLje8KMnxB4FfA3
Generated by Claude Code