Persistence Validation Demo #130

Open
opened 2025-12-17 13:59:36 +00:00 by siennathesane · 0 comments
siennathesane commented 2025-12-17 13:59:36 +00:00 (Migrated from github.com)

Description

In order to validate persistence in v0,
as a Marathon developer,
I need to create a demo that saves game state to SQLite, closes clients, reopens them, and verifies all entity data rehydrates correctly.

Acceptance Criteria

Scenario: State saves to SQLite
  Given entities exist in the game world
  When the save command is executed
  Then all entity data is written to SQLite

Scenario: State loads from SQLite
  Given saved entity data exists in SQLite
  When the game starts
  Then all entities are recreated with correct components

Scenario: No data loss across sessions
  Given a saved game state
  When the game is closed and reopened multiple times
  Then entity data remains consistent

Scenario: Schema migrations apply correctly
  Given an older schema version
  When the game loads
  Then migrations apply and data is preserved

Technical Notes

  • Dependencies: #128 (SQLite schema and migration system)
  • Approach:
    • Extend CRDT sync demo to include save/load
    • Test multiple save/load cycles
    • Verify entity component data integrity
    • Test schema migration path
  • Files affected:
    • New: crates/libmarathon/src/persistence/save_load.rs
    • Modify: crates/app/examples/crdt_sync_demo.rs (add save/load commands)

Additional Context

Part of v0 Core Tech Validation. Desktop only (macOS). Validates that state can survive application restarts.

## Description In order to validate persistence in v0, as a Marathon developer, I need to create a demo that saves game state to SQLite, closes clients, reopens them, and verifies all entity data rehydrates correctly. ## Acceptance Criteria ```gherkin Scenario: State saves to SQLite Given entities exist in the game world When the save command is executed Then all entity data is written to SQLite Scenario: State loads from SQLite Given saved entity data exists in SQLite When the game starts Then all entities are recreated with correct components Scenario: No data loss across sessions Given a saved game state When the game is closed and reopened multiple times Then entity data remains consistent Scenario: Schema migrations apply correctly Given an older schema version When the game loads Then migrations apply and data is preserved ``` ## Technical Notes - Dependencies: #128 (SQLite schema and migration system) - Approach: - Extend CRDT sync demo to include save/load - Test multiple save/load cycles - Verify entity component data integrity - Test schema migration path - Files affected: - New: `crates/libmarathon/src/persistence/save_load.rs` - Modify: `crates/app/examples/crdt_sync_demo.rs` (add save/load commands) ## Additional Context Part of v0 Core Tech Validation. Desktop only (macOS). Validates that state can survive application restarts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: studio/marathon#130