Clean up
Some checks failed
CI / React UI Build (push) Successful in 10s
CI / Windows Release Package (push) Has been cancelled
CI / Native Windows Build And Tests (push) Has been cancelled

This commit is contained in:
Aiden
2026-05-11 20:11:20 +10:00
parent 1d08dec5fe
commit dd3cd6b66c
7 changed files with 28 additions and 29 deletions

View File

@@ -187,7 +187,8 @@ Expected responsibilities:
- `LoadConfig()`
- `LoadPersistentState()`
- `SavePersistentStateSnapshot(...)`
- `BuildPersistentStateSnapshot(...)`
- `RequestPersistence(...)`
- `LoadStackPreset(...)`
- `SaveStackPreset(...)`
- `GetStackPresetNames()`
@@ -196,7 +197,7 @@ Design notes:
- `Load*` operations should parse and normalize external file content into durable in-memory models.
- `Save*` operations should serialize durable models without needing render or control subsystem context.
- later debounce/background writing should wrap these operations, not redefine their ownership
- debounce/background writing wraps these operations rather than redefining store ownership
### Read Interface
@@ -406,14 +407,14 @@ Target behavior:
- serialization snapshots are built from those models
- save requests persist a coherent snapshot
This matters because the current code still calls `SavePersistentState()` directly from many mutation paths. That is one of the architectural pressure points already called out in [ARCHITECTURE_RESILIENCE_REVIEW.md](/c:/Users/Aiden/Documents/GitHub/video-shader-toys/docs/ARCHITECTURE_RESILIENCE_REVIEW.md).
This matters because earlier code called persistent-state saves directly from mutation paths. Phase 6 removed that pressure point: accepted durable mutations now publish persistence requests, and `RuntimeStore::RequestPersistence(...)` builds a coherent snapshot for the background writer.
The Phase 1 design for `RuntimeStore` should therefore assume:
- store ownership of serialization remains
- immediate save-after-mutate is a migration detail, not the final behavioral contract
- persistence requests, not mutation methods, are the durable write boundary
By Phase 6, a background snapshot writer may sit underneath or beside this subsystem, but the durable model still belongs here.
Phase 6 added that background snapshot writer underneath this subsystem, while keeping the durable model here.
## Migration Plan From Current Code