Persistence
Persistence
Section titled “Persistence”The Akashic Records layer provides durable persistence using sled, a Rust-native embedded database.
Architecture
Section titled “Architecture”flowchart TB
subgraph Core["MindFry Core"]
PA[Psyche Arena]
BG[Bond Graph]
CX[Cortex]
end
subgraph Akashic["Akashic Records"]
SN[Snapshots<br/><small>bincode</small>]
IX[Lineage Index<br/><small>key → id</small>]
end
subgraph Storage["Disk"]
SL[(sled)]
end
Core -->|Snapshot| Akashic
Akashic -->|Restore| Core
Akashic --> SL
Snapshot Contents
Section titled “Snapshot Contents”| Component | Format | Contents |
|---|---|---|
| Psyche Arena | bincode | All active lineages |
| Bond Graph | bincode | All bonds |
| Cortex | bincode | Mood + Personality |
| Metadata | JSON | Timestamp, name, version |
Resurrection Protocol
Section titled “Resurrection Protocol”On startup, MindFry automatically restores state:
flowchart LR
A[Boot] --> B{Snapshot exists?}
B -->|Yes| C[Deserialize Arenas]
B -->|No| D[Fresh Start]
C --> E[Rebuild Index]
E --> F[Resume Operations]
D --> F
// Resurrection on bootlet mut db = MindFry::with_config(config);db.resurrect()?; // Returns Ok(true) if restoredCommands
Section titled “Commands”| Command | Description |
|---|---|
SYS.SNAPSHOT "name" | Create named checkpoint |
SYS.RESTORE "name" | Hot-swap to checkpoint |
See Deployment for production persistence configuration.