Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Engine lifecycle — settings/workspace-root setters, runtime mem add/remove, reload, and export.

register_writable_mem / unregister_writable_mem are the engine-level primitives the memstead_mem_create / memstead_mem_delete handlers build on. reload_one_mem* re-reads a mount’s backend and refreshes the in-memory store; reload_each_writable_mem* sweeps every writable mount. export_markdown regenerates entity markdown for folder mounts; export_mem produces a portable .mem archive via the backend-aware dispatch in crate::ops::export.

Functions§

bump_backend_schema_pin
Value-level schema-pin bump on a backend’s mem config: read the config blob, rewrite ONLY the "schema" string, write it back — every other field (readMems, write guidance, sync state, …) is preserved verbatim. Config-absent backends (no config.json) are a clean no-op returning None; the caller’s Mount.schema then stays the settled pin. Returns the updated JSON value on a write so callers can refresh caches.