Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
91be7da
chore: rivetkit to rust
NathanFlurry Apr 17, 2026
d41fa39
feat: [US-001] - [Create rivetkit-core crate with module structure, t…
NathanFlurry Apr 17, 2026
0f6946b
feat: [US-002] - [rivetkit-core: ActorContext with Arc internals]
NathanFlurry Apr 17, 2026
6d176fd
feat: [US-003] - rivetkit-core: KV and SQLite wrappers
NathanFlurry Apr 17, 2026
75082ab
feat: [US-004] - [rivetkit-core: State persistence with dirty tracking]
NathanFlurry Apr 17, 2026
155dfad
feat: [US-005] - [rivetkit-core: ActorFactory and ActorInstanceCallba…
NathanFlurry Apr 17, 2026
0fd5469
feat: [US-006] - [rivetkit-core: Action dispatch with timeout]
NathanFlurry Apr 17, 2026
c401c6e
feat: [US-007] - [rivetkit-core: Schedule API with alarm sync]
NathanFlurry Apr 17, 2026
b05bcd0
feat: [US-008] - [rivetkit-core: Events/broadcast and WebSocket]
NathanFlurry Apr 17, 2026
de3109a
feat: [US-009] - [rivetkit-core: ConnHandle and connection lifecycle]
NathanFlurry Apr 17, 2026
876d2c0
feat: [US-010] - rivetkit-core: Queue with completable messages
NathanFlurry Apr 17, 2026
ca9b2d6
feat: US-011 - Envoy-client: In-flight HTTP request tracking and life…
NathanFlurry Apr 17, 2026
7d8e61a
feat: [US-012] - [Envoy-client: Graceful shutdown sequencing]
NathanFlurry Apr 17, 2026
9967a4d
feat: [US-013] - rivetkit-core: Sleep readiness and auto-sleep timer
NathanFlurry Apr 17, 2026
4e804cb
feat: [US-014] - [rivetkit-core: Startup sequence (load, factory, rea…
NathanFlurry Apr 17, 2026
d226ff6
feat: US-015 - rivetkit-core: Startup sequence (post-start initializa…
NathanFlurry Apr 17, 2026
373537a
feat: [US-016] - [rivetkit-core: Shutdown sleep mode]
NathanFlurry Apr 17, 2026
ab4956d
feat: [US-017] - [rivetkit-core: Shutdown destroy mode]
NathanFlurry Apr 17, 2026
5470947
chore: correct US-017 progress log
NathanFlurry Apr 17, 2026
d0d76fb
feat: [US-018] - [rivetkit-core: CoreRegistry and EnvoyCallbacks disp…
NathanFlurry Apr 17, 2026
b717d37
feat: US-019 - Create rivetkit crate with Actor trait and prelude
NathanFlurry Apr 17, 2026
fd71e40
feat: [US-020] - rivetkit: Ctx<A> and ConnCtx<A> typed context
NathanFlurry Apr 17, 2026
af41689
feat: [US-021] - rivetkit: Registry, action builder, and bridge
NathanFlurry Apr 17, 2026
f4123f6
feat: [US-022] - Counter actor integration test
NathanFlurry Apr 17, 2026
8ebd05f
feat: [US-023] - Verify abort signal fires in sleep shutdown path
NathanFlurry Apr 17, 2026
ceae7aa
feat: [US-024] - [Document KV actor_id constructor asymmetry with Sql…
NathanFlurry Apr 17, 2026
a37bd49
feat: US-025 - Document RAII guard atomic ordering in HTTP request tr…
NathanFlurry Apr 17, 2026
f1a4f5f
feat: [US-026] - [rivetkit-core: Engine process manager]
NathanFlurry Apr 17, 2026
f6bd375
feat: [US-027] - Backward compat: verify KV key structure and seriali…
NathanFlurry Apr 17, 2026
4e845c9
feat: [US-028] - [rivetkit-core: ActorContext API audit for dynamic r…
NathanFlurry Apr 17, 2026
4eca47a
feat: [US-029] - [NAPI: Rename package and scaffold ActorContext class]
NathanFlurry Apr 17, 2026
bb57410
feat: [US-030] - NAPI: Sub-object classes (Kv, SqliteDb, Schedule, Qu…
NathanFlurry Apr 17, 2026
a299493
feat: [US-031] - [NAPI: Callback wrappers (ThreadsafeFunction for lif…
NathanFlurry Apr 17, 2026
e3908e4
feat: [US-032] - Wire TS Registry and actor config to Rust via NAPI
NathanFlurry Apr 17, 2026
bdffeaa
feat: US-033 - Delete TS actor lifecycle code
NathanFlurry Apr 17, 2026
a6bb604
feat: [US-034] - [Delete TS routing and serverless code]
NathanFlurry Apr 17, 2026
3e2349e
feat: [US-035] - [Delete TS infrastructure (drivers, inspector, schem…
NathanFlurry Apr 17, 2026
cc1411b
feat: [US-036] - [Delete TS dynamic actors and sandbox]
NathanFlurry Apr 17, 2026
fa64439
feat: [US-040] - [Purge all duplicated code, redundant files, and sim…
NathanFlurry Apr 17, 2026
c44993e
feat: US-037 - Integration test: run actor through full NAPI path
NathanFlurry Apr 17, 2026
06c6df9
feat: [US-038] - [Trim TS re-exports and fix remaining imports]
NathanFlurry Apr 17, 2026
622f072
feat: [US-048] - Move config conversion and HTTP parsing helpers from…
NathanFlurry Apr 17, 2026
ab92668
feat: [US-055] - [Address review-flagged issues from US-037, US-038, …
NathanFlurry Apr 17, 2026
56763f4
feat: [US-041] - [Universal RivetError: delete custom error classes, …
NathanFlurry Apr 17, 2026
d0b6c08
feat: US-056 - Move all inline #[cfg(test)] modules to tests/ folders…
NathanFlurry Apr 17, 2026
9d0456c
feat: US-042 - Schema validation: Zod for user-provided specs, serde …
NathanFlurry Apr 17, 2026
b6535dc
feat: [US-043] - [rivetkit-core: onMigrate lifecycle hook]
NathanFlurry Apr 17, 2026
832d0a0
feat: [US-044] - [Prometheus metrics with per-actor registry and /met…
NathanFlurry Apr 17, 2026
7c49ef2
feat: [US-045] - [rivetkit-core: waitForNames queue method]
NathanFlurry Apr 17, 2026
25333f5
feat: US-046 - rivetkit-core: enqueueAndWait queue method
NathanFlurry Apr 18, 2026
74666f0
feat: US-047 - rivetkit: Queue Stream adapter
NathanFlurry Apr 18, 2026
fc878db
feat: [US-049] - [Inspector: BARE schema definition with vbare versio…
NathanFlurry Apr 18, 2026
c775f0f
feat: [US-050] - [Inspector: Transport-agnostic core logic module]
NathanFlurry Apr 18, 2026
b63d2a6
feat: US-051 - Inspector: Wire lifecycle events into Inspector
NathanFlurry Apr 18, 2026
054891b
feat: [US-052] - Inspector: HTTP endpoints
NathanFlurry Apr 18, 2026
04296e9
feat: [US-053] - [Inspector: Workflow bridge via NAPI callbacks]
NathanFlurry Apr 18, 2026
9925209
feat: [US-054] - [Inspector: WebSocket protocol with BARE-encoded ver…
NathanFlurry Apr 18, 2026
0092050
feat: US-039 - Get driver test suite passing for static actors across…
NathanFlurry Apr 18, 2026
28a55d1
fix: resolve Rust CI dead code and biome formatting issues
NathanFlurry Apr 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
190 changes: 0 additions & 190 deletions .agent/notes/driver-engine-static-test-order.md

This file was deleted.

1 change: 1 addition & 0 deletions .agent/notes/driver-engine-static-test-order.md
73 changes: 73 additions & 0 deletions .agent/notes/driver-test-fix-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Driver Test Fix Audit

Audited: 2026-04-18
Updated: 2026-04-18
Scope: All uncommitted changes on feat/sqlite-vfs-v2 used to pass the driver test suite
Method: Compared against original TS implementation (ref 58b217920) across 5 subsystems

## Verdict: No test-overfitting found. 3 parity gaps fixed, 1 architectural debt item remains intentionally unchanged.

---

## Issues Found

### BARE-only encoding on actor-connect WebSocket (fixed)

The Rust `handle_actor_connect_websocket` in `registry.rs` rejects any encoding that isn't `"bare"` (line 1242). The original TS implementation accepted `json`, `cbor`, and `bare` via `Sec-WebSocket-Protocol`, defaulting to `json`. Tests only exercise BARE, so this passed. Production JS clients that default to JSON encoding will fail to connect.

**Severity**: High (production-breaking for non-BARE clients)
**Type**: Incomplete port, not overfit

### Error metadata dropped on WebSocket error responses (fixed)

`action_dispatch_error_response` in `registry.rs` hardcodes `metadata: None` (line 3247). `ActionDispatchError` in `actor/action.rs` lacks a `metadata` field entirely, so it's structurally impossible to propagate. The TS implementation forwarded CBOR-encoded metadata bytes from `deconstructError`. Structured error metadata from user actors is silently lost on WebSocket error frames.

**Severity**: Medium (error context lost, but group/code preserved)
**Type**: Incomplete port

### Workflow inspector stubs (fixed)

`NativeWorkflowRuntimeAdapter` has two stubs:
- `isRunHandlerActive()` always returns `false` — disables the safety guard preventing concurrent replay + live execution
- `restartRunHandler()` is a no-op — inspector replay computes but never takes effect

Normal workflow execution (step/sleep/loop/message) works. Inspector-driven workflow replay is broken on the native path.

**Severity**: Low (inspector-only, not user-facing)
**Type**: Known incomplete feature

### Action timeout/size enforcement in wrong layer (left as-is)

TS `native.ts` adds `withTimeout()` and byte-length checks for actions. Rivetkit-core also has these in `actor/action.rs` and `registry.rs`. However, the native HTTP action path bypasses rivetkit-core's event dispatch (`handle_fetch` instead of `actor/event.rs`), so TS enforcement is the pragmatic correct location. Not duplicated at runtime for the same request, but the code exists in both layers.

**Severity**: Low (correct behavior, architectural debt)
**Type**: Wrong layer, but justified by current routing

---

## Confirmed Correct Fixes

- **Stateless actor state gating** — Config-driven, matches original TS behavior
- **KV adapter key namespacing** — Uses standard `KEYS.KV` prefix, matches `ActorKv` contract
- **Error sanitization** — Uses `INTERNAL_ERROR_DESCRIPTION` constant and `toRivetError()`, maps by group/code pairs
- **Raw HTTP void return handling** — Throws instead of silently converting to 204, matches TS contract
- **Lifecycle hooks conn params** — Fixed in client-side `actor-handle.ts`, correct layer
- **Connection state bridging** — `createConnState`/`connState` properly wired, fires even without `onConnect`
- **Sleep/lifecycle/destroy timing** — `begin_keep_awake`/`end_keep_awake` tracked through `ActionInvoker.dispatch()`, no timing hacks
- **BARE codec** — Correct LEB128 varint, canonical validation, `finish()` rejects trailing bytes
- **Actor key deserialization** — Faithful port of TS `deserializeActorKey` with same escape sequences
- **Queue canPublish** — Real `NativeConnHandle` via `ctx.connectConn()` with proper cleanup

## Reviewed and Dismissed

- **`tokio::spawn` for WS action dispatch** — Not an issue. Spawned tasks call `invoker.dispatch()` which calls `begin_keep_awake()`/`end_keep_awake()`, so sleep is properly blocked. The CLAUDE.md `JoinSet` convention is about `envoy-client` HTTP fetch, not rivetkit-core action dispatch.
- **`find()` vs `strip_prefix()` in error parsing** — Intentional. Node.js can prepend context to NAPI error messages, so `find()` correctly locates the bridge prefix mid-string. Not a bug, it's a fix for errors being missed.
- **Hardcoded empty-vec in `connect_conn`** — Correct value for internally-created connections (action/queue HTTP contexts) which have no response body to send.

## Minor Notes

- `rearm_sleep_after_http_request` helper duplicated in `event.rs` and `registry.rs` — intentional per CLAUDE.md (two dispatch paths), but could be extracted
- `_is_restoring_hibernatable` parameter accepted but unused in `handle_actor_connect_websocket`
- Unused `Serialize`/`Deserialize` derives on protocol structs (hand-rolled BARE used instead)
- No tests for `Request` propagation through connection lifecycle callbacks
- No tests for message size limit enforcement at runtime
Loading
Loading