Summary
Add the ability to snapshot, restore, replay, and fork cloud state — enabling "what-if" testing and state management.
Core Operations
// Snapshot entire cloud state
snapshot := provider.Snapshot()
// Restore to a previous state
provider.Restore(snapshot)
// Fork state for parallel what-if testing
forked := provider.Fork()
// mutations on forked don't affect original
// Record and replay
recording := provider.StartRecording()
// ... perform operations ...
provider.StopRecording()
recording.Replay(provider, replay.WithSpeed(10)) // 10x speed
Use Cases
- Snapshot before destructive tests: take snapshot, run test that deletes everything, restore
- What-if testing: fork state, try different approaches on each fork, compare results
- Regression replay: record a production-like session, replay against new code
- Deterministic debugging: replay exact sequence of operations that caused a bug
Implementation Notes
- Snapshot serializes all memstore state across all services to a portable format (JSON or gob)
- Restore deserializes and replaces all memstore contents
- Fork creates a deep copy of all state
- Recording captures operation name, inputs, timestamps (already partially done via recorder)
- Replay re-executes recorded operations against a fresh or existing provider
Acceptance Criteria
Summary
Add the ability to snapshot, restore, replay, and fork cloud state — enabling "what-if" testing and state management.
Core Operations
Use Cases
Implementation Notes
Acceptance Criteria