feat(engine): write-through persistence (M13 D2)

- facade storage session manager: project handles bind to the default
  SQLite library on project_new/load; every undo push/group_end/jump
  write-throughs via DatabaseBackend::save (diff journal); project_free
  flushes and unbinds
- background snapshot thread (Storage/SnapshotIntervalSec, latest-wins,
  newest 3 kept) with exit flush (oakengine_storage_flush)
- config-gated: storage only activates with an explicit
  Storage/Backend=sqlite, so headless consumers and tests never touch
  the real library; new exports: storage_flush/is_bound/last_error
- it_storage: kill -9 recovery, cross-session undo, snapshot pruning,
  multi-project isolation, graceful degradation
- also fixes a real config test polluting the user config.ini and the
  undo-stack test races
This commit is contained in:
2026-08-16 08:52:23 +08:00
parent b35f3b49bc
commit 5fabad8efd
18 changed files with 1386 additions and 16 deletions
Generated
+3
View File
@@ -4814,12 +4814,15 @@ dependencies = [
"oaknode",
"oakplugin",
"oakrender",
"oakstorage",
"oaktask",
"oaktimeline",
"oakundo",
"sea-orm",
"serde",
"serde_json",
"thiserror 2.0.20",
"tokio",
]
[[package]]