Skip to content

Commit 1b43c7c

Browse files
committed
feat(rust/engine-runner): feature parity with typescript
1 parent ae89310 commit 1b43c7c

File tree

13 files changed

+1480
-36
lines changed

13 files changed

+1480
-36
lines changed

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ When the user asks to track something in a note, store it in `.agent/notes/` by
211211
- **Shared Libraries** (`shared/{language}/{package}/`) - Libraries shared between the engine and rivetkit (e.g., `shared/typescript/virtual-websocket/`)
212212
- **Service Infrastructure** - Distributed services communicate via NATS messaging with service discovery
213213

214+
### Engine Runner Parity
215+
- Keep `engine/sdks/typescript/runner` and `engine/sdks/rust/engine-runner` at feature parity.
216+
- Any behavior, protocol handling, or test coverage added to one runner should be mirrored in the other runner in the same change whenever possible.
217+
- When parity cannot be completed in the same change, explicitly document the gap and add a follow-up task.
218+
214219
### Important Patterns
215220

216221
**Error Handling**

engine/packages/engine/tests/runner/actors_alarm.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl AlarmAndSleepActor {
140140
}
141141

142142
#[async_trait]
143-
impl TestActor for AlarmAndSleepActor {
143+
impl Actor for AlarmAndSleepActor {
144144
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
145145
let generation = config.generation;
146146
tracing::info!(?config.actor_id, generation, "alarm actor starting");
@@ -195,7 +195,7 @@ impl AlarmAndSleepOnceActor {
195195
}
196196

197197
#[async_trait]
198-
impl TestActor for AlarmAndSleepOnceActor {
198+
impl Actor for AlarmAndSleepOnceActor {
199199
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
200200
let generation = config.generation;
201201
tracing::info!(?config.actor_id, generation, "alarm once actor starting");
@@ -250,7 +250,7 @@ impl AlarmSleepThenClearActor {
250250
}
251251

252252
#[async_trait]
253-
impl TestActor for AlarmSleepThenClearActor {
253+
impl Actor for AlarmSleepThenClearActor {
254254
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
255255
let generation = config.generation;
256256
tracing::info!(?config.actor_id, generation, "alarm actor starting");
@@ -311,7 +311,7 @@ impl AlarmSleepThenReplaceActor {
311311
}
312312

313313
#[async_trait]
314-
impl TestActor for AlarmSleepThenReplaceActor {
314+
impl Actor for AlarmSleepThenReplaceActor {
315315
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
316316
let generation = config.generation;
317317
tracing::info!(?config.actor_id, generation, "alarm actor starting");
@@ -374,7 +374,7 @@ impl MultipleAlarmSetActor {
374374
}
375375

376376
#[async_trait]
377-
impl TestActor for MultipleAlarmSetActor {
377+
impl Actor for MultipleAlarmSetActor {
378378
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
379379
let generation = config.generation;
380380
tracing::info!(?config.actor_id, generation, "multi alarm actor starting");
@@ -429,7 +429,7 @@ impl MultiCycleAlarmActor {
429429
}
430430

431431
#[async_trait]
432-
impl TestActor for MultiCycleAlarmActor {
432+
impl Actor for MultiCycleAlarmActor {
433433
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
434434
let generation = config.generation;
435435
tracing::info!(?config.actor_id, generation, "multi cycle alarm actor starting");
@@ -481,7 +481,7 @@ impl AlarmOnceActor {
481481
}
482482

483483
#[async_trait]
484-
impl TestActor for AlarmOnceActor {
484+
impl Actor for AlarmOnceActor {
485485
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
486486
let generation = config.generation;
487487
tracing::info!(?config.actor_id, generation, "alarm once actor starting");
@@ -536,7 +536,7 @@ impl AlarmSleepThenCrashActor {
536536
}
537537

538538
#[async_trait]
539-
impl TestActor for AlarmSleepThenCrashActor {
539+
impl Actor for AlarmSleepThenCrashActor {
540540
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
541541
let generation = config.generation;
542542
tracing::info!(?config.actor_id, generation, "alarm crash actor starting");
@@ -599,7 +599,7 @@ impl RapidAlarmCycleActor {
599599
}
600600

601601
#[async_trait]
602-
impl TestActor for RapidAlarmCycleActor {
602+
impl Actor for RapidAlarmCycleActor {
603603
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
604604
let generation = config.generation;
605605
tracing::info!(?config.actor_id, generation, "rapid alarm cycle actor starting");
@@ -647,7 +647,7 @@ impl SetClearAlarmAndSleepActor {
647647
}
648648

649649
#[async_trait]
650-
impl TestActor for SetClearAlarmAndSleepActor {
650+
impl Actor for SetClearAlarmAndSleepActor {
651651
async fn on_start(&mut self, config: ActorConfig) -> anyhow::Result<ActorStartResult> {
652652
let generation = config.generation;
653653
tracing::info!(?config.actor_id, generation, "alarm actor starting");

engine/packages/engine/tests/runner/actors_kv_crud.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl PutAndGetActor {
3838
}
3939

4040
#[async_trait]
41-
impl TestActor for PutAndGetActor {
41+
impl Actor for PutAndGetActor {
4242
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
4343
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "put and get actor starting");
4444

@@ -116,7 +116,7 @@ impl GetNonexistentKeyActor {
116116
}
117117

118118
#[async_trait]
119-
impl TestActor for GetNonexistentKeyActor {
119+
impl Actor for GetNonexistentKeyActor {
120120
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
121121
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "get nonexistent key actor starting");
122122

@@ -191,7 +191,7 @@ impl PutOverwriteActor {
191191
}
192192

193193
#[async_trait]
194-
impl TestActor for PutOverwriteActor {
194+
impl Actor for PutOverwriteActor {
195195
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
196196
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "put overwrite actor starting");
197197

@@ -295,7 +295,7 @@ impl DeleteKeyActor {
295295
}
296296

297297
#[async_trait]
298-
impl TestActor for DeleteKeyActor {
298+
impl Actor for DeleteKeyActor {
299299
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
300300
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "delete key actor starting");
301301

@@ -383,7 +383,7 @@ impl DeleteNonexistentKeyActor {
383383
}
384384

385385
#[async_trait]
386-
impl TestActor for DeleteNonexistentKeyActor {
386+
impl Actor for DeleteNonexistentKeyActor {
387387
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
388388
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "delete nonexistent key actor starting");
389389

@@ -638,7 +638,7 @@ impl BatchPutActor {
638638
}
639639

640640
#[async_trait]
641-
impl TestActor for BatchPutActor {
641+
impl Actor for BatchPutActor {
642642
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
643643
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "batch put actor starting");
644644

@@ -721,7 +721,7 @@ impl BatchGetActor {
721721
}
722722

723723
#[async_trait]
724-
impl TestActor for BatchGetActor {
724+
impl Actor for BatchGetActor {
725725
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
726726
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "batch get actor starting");
727727

@@ -808,7 +808,7 @@ impl BatchDeleteActor {
808808
}
809809

810810
#[async_trait]
811-
impl TestActor for BatchDeleteActor {
811+
impl Actor for BatchDeleteActor {
812812
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
813813
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "batch delete actor starting");
814814

engine/packages/engine/tests/runner/actors_kv_drop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl DropClearsAllActor {
3939
}
4040

4141
#[async_trait]
42-
impl TestActor for DropClearsAllActor {
42+
impl Actor for DropClearsAllActor {
4343
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
4444
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "drop clears all actor starting");
4545

@@ -137,7 +137,7 @@ impl DropEmptyActor {
137137
}
138138

139139
#[async_trait]
140-
impl TestActor for DropEmptyActor {
140+
impl Actor for DropEmptyActor {
141141
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
142142
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "drop empty actor starting");
143143

engine/packages/engine/tests/runner/actors_kv_list.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl ListAllEmptyActor {
3939
}
4040

4141
#[async_trait]
42-
impl TestActor for ListAllEmptyActor {
42+
impl Actor for ListAllEmptyActor {
4343
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
4444
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list all empty actor starting");
4545

@@ -102,7 +102,7 @@ impl ListAllKeysActor {
102102
}
103103

104104
#[async_trait]
105-
impl TestActor for ListAllKeysActor {
105+
impl Actor for ListAllKeysActor {
106106
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
107107
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list all keys actor starting");
108108

@@ -199,7 +199,7 @@ impl ListAllLimitActor {
199199
}
200200

201201
#[async_trait]
202-
impl TestActor for ListAllLimitActor {
202+
impl Actor for ListAllLimitActor {
203203
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
204204
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list all limit actor starting");
205205

@@ -277,7 +277,7 @@ impl ListAllReverseActor {
277277
}
278278

279279
#[async_trait]
280-
impl TestActor for ListAllReverseActor {
280+
impl Actor for ListAllReverseActor {
281281
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
282282
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list all reverse actor starting");
283283

@@ -368,7 +368,7 @@ impl ListRangeInclusiveActor {
368368
}
369369

370370
#[async_trait]
371-
impl TestActor for ListRangeInclusiveActor {
371+
impl Actor for ListRangeInclusiveActor {
372372
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
373373
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list range inclusive actor starting");
374374

@@ -467,7 +467,7 @@ impl ListRangeExclusiveActor {
467467
}
468468

469469
#[async_trait]
470-
impl TestActor for ListRangeExclusiveActor {
470+
impl Actor for ListRangeExclusiveActor {
471471
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
472472
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list range exclusive actor starting");
473473

@@ -566,7 +566,7 @@ impl ListPrefixActor {
566566
}
567567

568568
#[async_trait]
569-
impl TestActor for ListPrefixActor {
569+
impl Actor for ListPrefixActor {
570570
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
571571
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list prefix actor starting");
572572

@@ -669,7 +669,7 @@ impl ListPrefixNoMatchActor {
669669
}
670670

671671
#[async_trait]
672-
impl TestActor for ListPrefixNoMatchActor {
672+
impl Actor for ListPrefixNoMatchActor {
673673
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
674674
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list prefix no match actor starting");
675675

engine/packages/engine/tests/runner/actors_kv_misc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl BinaryDataActor {
3939
}
4040

4141
#[async_trait]
42-
impl TestActor for BinaryDataActor {
42+
impl Actor for BinaryDataActor {
4343
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
4444
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "binary data actor starting");
4545

@@ -114,7 +114,7 @@ impl EmptyValueActor {
114114
}
115115

116116
#[async_trait]
117-
impl TestActor for EmptyValueActor {
117+
impl Actor for EmptyValueActor {
118118
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
119119
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "empty value actor starting");
120120

@@ -203,7 +203,7 @@ impl LargeValueActor {
203203
}
204204

205205
#[async_trait]
206-
impl TestActor for LargeValueActor {
206+
impl Actor for LargeValueActor {
207207
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
208208
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "large value actor starting");
209209

@@ -286,7 +286,7 @@ impl GetEmptyKeysActor {
286286
}
287287

288288
#[async_trait]
289-
impl TestActor for GetEmptyKeysActor {
289+
impl Actor for GetEmptyKeysActor {
290290
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
291291
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "get empty keys actor starting");
292292

@@ -350,7 +350,7 @@ impl ListLimitZeroActor {
350350
}
351351

352352
#[async_trait]
353-
impl TestActor for ListLimitZeroActor {
353+
impl Actor for ListLimitZeroActor {
354354
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
355355
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "list limit zero actor starting");
356356

@@ -429,7 +429,7 @@ impl KeyOrderingActor {
429429
}
430430

431431
#[async_trait]
432-
impl TestActor for KeyOrderingActor {
432+
impl Actor for KeyOrderingActor {
433433
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
434434
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "key ordering actor starting");
435435

@@ -520,7 +520,7 @@ impl ManyKeysActor {
520520
}
521521

522522
#[async_trait]
523-
impl TestActor for ManyKeysActor {
523+
impl Actor for ManyKeysActor {
524524
async fn on_start(&mut self, config: ActorConfig) -> Result<ActorStartResult> {
525525
tracing::info!(actor_id = ?config.actor_id, generation = config.generation, "many keys actor starting");
526526

engine/packages/engine/tests/runner/actors_lifecycle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn actor_basic_create() {
4242
"runner should have the actor allocated"
4343
);
4444

45-
tracing::info!(?actor_id, runner_id = ?runner.runner_id, "actor allocated to runner");
45+
tracing::info!(?actor_id, "actor allocated to runner");
4646
});
4747
}
4848

0 commit comments

Comments
 (0)