Skip to content

Commit 1e05bfc

Browse files
NathanFlurryMasterPtato
authored andcommitted
chore: delete kv channel
1 parent bc0c7f3 commit 1e05bfc

File tree

23 files changed

+4
-2775
lines changed

23 files changed

+4
-2775
lines changed

CLAUDE.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,6 @@ The `rivet.gg` domain is deprecated and should never be used in this codebase.
2222
- Add a new versioned schema instead, then migrate `versioned.rs` and related compatibility code to bridge old versions forward.
2323
- When bumping the protocol version, update `PROTOCOL_MK2_VERSION` in `engine/packages/runner-protocol/src/lib.rs` and `PROTOCOL_VERSION` in `rivetkit-typescript/packages/engine-runner/src/mod.ts` together. Both must match the latest schema version.
2424

25-
**Keep the KV API in sync between the runner protocol and the KV channel protocol.**
26-
27-
- The runner protocol (`engine/sdks/schemas/runner-protocol/`) and KV channel protocol (`engine/sdks/schemas/kv-channel-protocol/`) both expose KV operations. When adding, removing, or changing KV request/response types in one protocol, update the other to match.
28-
29-
**Keep KV channel protocol versions in sync.**
30-
31-
- When bumping the KV channel protocol version, update these two locations together:
32-
- `engine/sdks/rust/kv-channel-protocol/src/lib.rs` (`PROTOCOL_VERSION`)
33-
- `engine/sdks/rust/kv-channel-protocol/build.rs` (TypeScript `PROTOCOL_VERSION` in post-processing)
34-
- All consumers (pegboard-kv-channel, sqlite-native, TS manager) get the version from the shared crate.
35-
- The TypeScript SDK at `engine/sdks/typescript/kv-channel-protocol/src/index.ts` is auto-generated from the BARE schema during the Rust build. Do not edit it by hand.
36-
3725
## Commands
3826

3927
### Build Commands
@@ -274,9 +262,6 @@ let error_with_meta = ApiRateLimited { limit: 100, reset_at: 1234567890 }.build(
274262
- If you need to add a dependency and can't find it in the Cargo.toml of the workspace, add it to the workspace dependencies in Cargo.toml (`[workspace.dependencies]`) and then add it to the package you need with `{dependency}.workspace = true`
275263

276264
**Native SQLite & KV Channel**
277-
- Native SQLite (`rivetkit-typescript/packages/sqlite-native/`) is a napi-rs addon that statically links SQLite and uses a custom VFS backed by KV over a WebSocket KV channel. The WASM implementation (`@rivetkit/sqlite-vfs`) is the fallback.
278-
- The KV channel (`engine/sdks/schemas/kv-channel-protocol/`) is independent of the runner protocol. It authenticates with `admin_token` (engine) or `config.token` (manager), not the runner key.
279-
- The KV channel enforces single-writer locks per actor. Open/close are optimistic (no round-trip wait).
280265
- The native VFS uses the same 4 KiB chunk layout and KV key encoding as the WASM VFS. Data is compatible between backends.
281266
- **The native Rust VFS and the WASM TypeScript VFS must match 1:1.** This includes: KV key layout and encoding, chunk size, PRAGMA settings, VFS callback-to-KV-operation mapping, delete/truncate strategy (both must use `deleteRange`), and journal mode. When changing any VFS behavior in one implementation, update the other. The relevant files are:
282267
- Native: `rivetkit-typescript/packages/sqlite-native/src/vfs.rs`, `kv.rs`

Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ members = [
3030
"engine/packages/pegboard-envoy",
3131
"engine/packages/pegboard-gateway",
3232
"engine/packages/pegboard-gateway2",
33-
"engine/packages/pegboard-kv-channel",
3433
"engine/packages/pegboard-outbound",
3534
"engine/packages/pegboard-runner",
3635
"engine/packages/pools",
@@ -53,7 +52,6 @@ members = [
5352
"engine/sdks/rust/data",
5453
"engine/sdks/rust/envoy-protocol",
5554
"engine/sdks/rust/epoxy-protocol",
56-
"engine/sdks/rust/kv-channel-protocol",
5755
"engine/packages/runner-protocol",
5856
"engine/sdks/rust/test-envoy",
5957
"engine/sdks/typescript/test-envoy-native",
@@ -436,9 +434,6 @@ members = [
436434
[workspace.dependencies.pegboard-gateway2]
437435
path = "engine/packages/pegboard-gateway2"
438436

439-
[workspace.dependencies.pegboard-kv-channel]
440-
path = "engine/packages/pegboard-kv-channel"
441-
442437
[workspace.dependencies.pegboard-outbound]
443438
path = "engine/packages/pegboard-outbound"
444439

@@ -506,9 +501,6 @@ members = [
506501
[workspace.dependencies.epoxy-protocol]
507502
path = "engine/sdks/rust/epoxy-protocol"
508503

509-
[workspace.dependencies.rivet-kv-channel-protocol]
510-
path = "engine/sdks/rust/kv-channel-protocol"
511-
512504
[workspace.dependencies.rivet-envoy-protocol]
513505
path = "engine/sdks/rust/envoy-protocol"
514506

engine/packages/guard/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ once_cell.workspace = true
3232
pegboard-envoy.workspace = true
3333
pegboard-gateway.workspace = true
3434
pegboard-gateway2.workspace = true
35-
pegboard-kv-channel.workspace = true
3635
pegboard-runner.workspace = true
3736
pegboard.workspace = true
3837
regex.workspace = true

engine/packages/guard/src/routing/kv_channel.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

engine/packages/guard/src/routing/mod.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::{errors, metrics, shared_state::SharedState};
1010
pub mod actor_path;
1111
mod api_public;
1212
mod envoy;
13-
mod kv_channel;
1413
pub mod pegboard_gateway;
1514
mod runner;
1615
mod ws_health;
@@ -27,13 +26,9 @@ pub(crate) const WS_PROTOCOL_TOKEN: &str = "rivet_token.";
2726
#[tracing::instrument(skip_all)]
2827
pub fn create_routing_function(ctx: &StandaloneCtx, shared_state: SharedState) -> RoutingFn {
2928
let ctx = ctx.clone();
30-
let kv_channel_handler = Arc::new(pegboard_kv_channel::PegboardKvChannelCustomServe::new(
31-
ctx.clone(),
32-
));
3329
Arc::new(move |req_ctx| {
3430
let ctx = ctx.with_ray(req_ctx.ray_id(), req_ctx.req_id()).unwrap();
3531
let shared_state = shared_state.clone();
36-
let kv_channel_handler = kv_channel_handler.clone();
3732
let hostname = req_ctx.hostname().to_string();
3833
let path = req_ctx.path().to_string();
3934

@@ -83,17 +78,6 @@ pub fn create_routing_function(ctx: &StandaloneCtx, shared_state: SharedState) -
8378
return Ok(routing_output);
8479
}
8580

86-
// Route KV channel
87-
if let Some(routing_output) =
88-
kv_channel::route_request_path_based(&ctx, req_ctx, &kv_channel_handler).await?
89-
{
90-
metrics::ROUTE_TOTAL
91-
.with_label_values(&["kv_channel"])
92-
.inc();
93-
94-
return Ok(routing_output);
95-
}
96-
9781
// MARK: Header- & protocol-based routing (X-Rivet-Target)
9882
// Determine target
9983
let target = if req_ctx.is_websocket() {

engine/packages/pegboard-kv-channel/Cargo.toml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)