Persistence
What is persisted to disk at 0.8.4: the chain and tree checkpoints, cluster and app catalogs, and the JSON save/load helpers for the causal graph and HNSW index.
Persistence in the kernel is several separate mechanisms, not one coordinator. This page lists each, says what writes it, and marks the helper module that nothing calls yet.
What the kernel writes on its own
| State | File and writer | Source |
|---|---|---|
| Chain checkpoint | RVF checkpoint (primary) with a JSON fallback beside it, written by Kernel::shutdown; the chain location is pinned once at boot | boot.rs shutdown, chain_storage.rs |
| Resource tree checkpoint | <chain checkpoint>.tree.json, written at shutdown | boot.rs shutdown |
| Cluster peers | persisted to disk so joins survive restarts | boot.rs, "Cluster peer membership persists to disk" |
| Installed apps | atomic apps.json | boot.rs, "Installs survive kernel restarts via atomic apps.json" |
| Runtime files | socket, pid, log and lock files under the runtime root ($WEFTOS_RUNTIME_DIR, else the project's .weftos/runtime, else legacy ~/.clawft) | crates/clawft-types/src/runtime_paths.rs |
Chain details are on the ExoChain page and the shutdown order is on Boot Sequence.
The persistence helper module
crates/clawft-kernel/src/persistence.rs is a tested helper for saving and loading the causal graph and the HNSW index as JSON. At the 0.8.4 base, git grep over crates/ finds no caller of save_all, load_all or PersistenceConfig outside that file, so neither the kernel boot nor the daemon uses it. An earlier version of this page showed a Kernel::boot_with_state call that does not exist. Treat the module as a building block until a caller is added.
pub struct PersistenceConfig {
pub data_dir: PathBuf, // default ".weftos/state"
pub auto_save_interval_secs: Option<u64>, // not used by any timer
}File names the helper uses under data_dir:
causal_graph.json CausalGraph nodes, edges and next_node_id
hnsw_index.json HNSW vectors, metadata and index configuration
exochain.jsonl chain events as line-delimited JSON (chain_path())Functions: save_causal_graph, load_causal_graph, save_hnsw, load_hnsw, save_all, load_all, plus save_all_with_chain and load_all_with_chain, which also append a chain event. Loads return an empty instance when a file is missing and an io::Error when the JSON is corrupt or truncated (the module's own tests cover both). There is no file locking.
Other save and load helpers
eml_persistence.rssaves and loads the EML models as JSON under.weftos/eml-models/; its header says kernel shutdown and boot use it, but no call site was found incrates/outside tests, so the same caveat applies. The retry model inclawft-corereads fromeml-models/under the runtime dir (llm_adapter.rs).ecc_segment.rsdefines RVF segment types in the0x50to0x5Fblock for ECC payloads; its header says moving on-disk chain blobs onto them is follow-up work.- The HNSW service appends an
hnsw.savechain event when it saves (hnsw_service.rs).
Observability
Dead letter queue, metrics registry, log service, and timer service for kernel-wide monitoring and diagnostics.
Security Model
Capability-based access control, the governance gate, mesh transport and peer admission, tokens, revocation, rate limiting, message limits and browser sandboxing, each with the file that implements it.