Skip to content

Add Time Travel with State Snapshots and Fork #107

Description

@NitinKumar004

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

  • Snapshot captures complete state across all services
  • Restore replaces state and operations work against restored state
  • Fork creates independent copy (mutations don't cross)
  • Recording captures all operations with inputs
  • Replay re-executes operations in order
  • Tests for snapshot/restore roundtrip, fork independence, replay accuracy
  • Linter passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    awsAmazon Web ServicesazureMicrosoft AzureenhancementNew feature or requestgcpGoogle Cloud PlatformsimulationAdvanced simulation features (chaos, topology, compliance)

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions