Size / Priority
Rationale
PersistentActors store events in the journal. Sometimes you need to inspect the state at any past moment: "what was the cart state on Tuesday at 3pm?" Today: replay events manually up to that point.
A Time-Travel Debugger:
- CLI tool:
actor-ts journal-debug --pid order-42 --backend sqlite://....
- Interactive REPL: step forward/back through events; inspect state.
- Optional VS Code extension.
Design sketch
$ actor-ts journal-debug --pid order-42 --backend sqlite:///path/to/journal.db
[journal-debug] loaded 156 events for pid 'order-42'
[journal-debug] state at seq 0: { items: [], total: 0 }
[journal-debug] > next 5
seq 5: { items: ['hat'], total: 19.99 }
[journal-debug] > goto 100
seq 100: { items: ['hat', 'scarf', 'gloves'], status: 'paid', total: 87.50 }
[journal-debug] > diff 50 100
+ status: pending → paid
+ total: 45.00 → 87.50
+ items: ['hat'] → ['hat', 'scarf', 'gloves']
Bind to existing PersistentActor types via the user-supplied actor class. Replay through applyEvent.
Out of scope / non-goals
- Edit + commit — read-only.
- Cross-actor causality — single pid at a time.
- Production tracing — that's
Tracing extension.
Open design questions
- VS Code extension vs CLI: CLI first; VS Code later.
- User-class loading: REPL must import the user's actor class to call
applyEvent. ESM dynamic import + path config.
- Snapshot integration: start from snapshot, replay events forward.
Test plan
- CLI loads journal, lists events, steps through.
goto N reconstructs state at seq N.
diff X Y shows state difference.
- Snapshot acceleration.
- Handles 100K-event journal in reasonable time.
Acceptance criteria
Size / Priority
Rationale
PersistentActors store events in the journal. Sometimes you need to inspect the state at any past moment: "what was the cart state on Tuesday at 3pm?" Today: replay events manually up to that point.
A Time-Travel Debugger:
actor-ts journal-debug --pid order-42 --backend sqlite://....Design sketch
Bind to existing PersistentActor types via the user-supplied actor class. Replay through
applyEvent.Out of scope / non-goals
Tracingextension.Open design questions
applyEvent. ESM dynamic import + path config.Test plan
goto Nreconstructs state at seq N.diff X Yshows state difference.Acceptance criteria
actor-ts journal-debugCLI command.