Skip to content

feat(integration): surrealdb-ractor + cf::stream + kvs::mvcc_source (Sprint 0/1)#24

Merged
AdaWorldAPI merged 5 commits into
mainfrom
claude/lance-surrealdb-analysis-LXmug
May 18, 2026
Merged

feat(integration): surrealdb-ractor + cf::stream + kvs::mvcc_source (Sprint 0/1)#24
AdaWorldAPI merged 5 commits into
mainfrom
claude/lance-surrealdb-analysis-LXmug

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

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, in workspace.exclude) — Glue feat(kvs): add kv-lance storage backend (Lance 4.0 columnar) #1: subscribes to LIVE SELECT / cf change-feed and routes typed LiveDelta events to ractor mailboxes. Bodies stay Sprint 1 unimplemented!() so the API surface is pinned.
  • surrealdb/core/src/cf/stream.rs — new additive CfStream trait wrapping the existing cf cursor as an Arrow-shaped delta stream for actor consumption. Uses the existing ChangeSet type (cf::mutations) as the payload — no new deps. Wired via pub mod stream; in cf/mod.rs.
  • surrealdb/core/src/kvs/mvcc_source.rs — new additive MvccSource trait + LocalGeneratedMvcc default impl matching current backends' u64 generation. The kv-tikv-native-mvcc feature in Sprint 2 will add a TikvNativeMvccTxn impl alongside (PD HLC instead of local counter). Wired via pub mod mvcc_source; in kvs/mod.rs.
  • [patch."https://github.com/AdaWorldAPI/lance-graph.git"] in root Cargo.toml — redirects lance-graph-contract git URL to local path for dev iteration. Verified: cargo tree -p surrealdb-core --features lance-graph shows v0.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)

Commit Description
126fea9 plans: integration plan for surrealdb's role in the four-repo convergence
81af9aa plans: rewrite kv-lance demotion as additive lance-projection sibling; add contract-shape principle
2a54a32 feat(surrealdb): wave-1 scaffold — surrealdb-ractor + cf::stream + kvs::mvcc_source
6cb3e15 feat(workspace): patch lance-graph-contract git URL to local path for dev
a3ee66d fix(surrealdb-ractor): add [workspace] table + commit Cargo.lock

Coordinated PRs in sibling repos

Repo PR
AdaWorldAPI/lance-graph claude/lance-surrealdb-analysis-LXmug
AdaWorldAPI/sea-orm claude/lance-surrealdb-analysis-LXmug
AdaWorldAPI/ndarray claude/lance-surrealdb-analysis-LXmug

Important: kvs/lance/ stays untouched

The integration plan's earlier framing of "demote kv-lance" is superseded in plan §6 by "add lance-projection alongside kv-lance (additive)". Every file under surrealdb/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-fed lance-projection sibling 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 unused CfStream Sprint-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-graph shows the patched local lance-graph-contract v0.2.0
  • Sprint 1: implement LiveQueryRouter::run body using Surreal::select_live (out of scope of this PR)
  • Sprint 2: add kv-tikv-native-mvcc feature + TikvNativeMvccTxn impl of MvccSource (out of scope of this PR)
  • Sprint 3: add lance-projection feature + core/src/projection/lance/ sibling module (out of scope of this PR)
  • Promote surrealdb-ractor from workspace.exclude to members once 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 in exclude). Resolved in commit a3ee66d.

https://claude.ai/code/session_01LiUiGeUDLje8KMnxB4FfA3


Generated by Claude Code

AdaWorldAPI and others added 5 commits May 18, 2026 13:07
…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.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Cargo.toml
Comment on lines +533 to +534
[patch."https://github.com/AdaWorldAPI/lance-graph.git"]
lance-graph-contract = { path = "../lance-graph/crates/lance-graph-contract" }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@AdaWorldAPI AdaWorldAPI merged commit 28ebd00 into main May 18, 2026
AdaWorldAPI added a commit that referenced this pull request May 19, 2026
…query-sprint1

feat(surrealdb-ractor): implement LiveQueryRouter::run + live_stream (Sprint 1 follow-up to #24)
AdaWorldAPI added a commit that referenced this pull request May 19, 2026
Revert #24 + #25 — surrealdb-ractor four-repo integration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants