feat(daemon): snapshot ticker + writer wiring + stopped-attach reads disk + cleanup on close

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 16:00:39 +07:00
parent 69f2e73832
commit 60383cd543
3 changed files with 131 additions and 28 deletions
+4 -1
View File
@@ -61,6 +61,9 @@ async fn run_daemon() -> Result<()> {
let events_path = lifecycle::spacesh_dir()?.join("events.json");
let event_store: std::sync::Arc<dyn event_store::EventStore> =
std::sync::Arc::new(event_store::JsonEventStore::new(events_path));
let snapshots_dir = lifecycle::spacesh_dir()?.join("snapshots");
let snapshot_store: std::sync::Arc<dyn snapshot_store::SnapshotStore> =
std::sync::Arc::new(snapshot_store::JsonSnapshotStore::new(snapshots_dir));
eprintln!("spaceshd listening on {}", sock.display());
server::serve(&sock, store, event_store).await
server::serve(&sock, store, event_store, snapshot_store).await
}