Expand description
Mem-lifecycle orchestrator — full home for the multi-mem create
and delete pipelines. The matcher primitives
(memstead_base::CreateRuleSet, memstead_base::DeleteRuleSet,
memstead_base::MatcherSet) stay in lean because the lean engine’s
cross_mem_link_allowed synthesises a memstead_base::CreateRuleSet
on multi-folder workspaces. Only the lifecycle orchestrators —
create_mem, delete_mem, their param/response types, the
shared NOTE_MAX_LEN cap, and the validate_mem_path helper —
live here.
Functions take &mut memstead_base::Engine directly rather than going
through a FullEngine wrapper struct: the lean engine is a single
polymorphic Engine parameterised by Box<dyn MemBackend> and
already carries every state field the orchestrators need
(mem_router, settings, backend_factory, workspace_root,
git_branch_ops). Full contributes lifecycle as free functions over
that engine; no separate engine type, no policy-provider trait.
Return type is Result<_, crate::FullEngineError>. Lean-side
failures (InvalidInput, UnknownMem, SchemaResolverInit,
SchemaNotFound, MemNameCollision, Mem(_), Backend(_))
propagate verbatim through FullEngineError::Lean(_) via the
#[from] memstead_base::EngineError conversion — the ? operator on
engine.persist_state()? and similar lean calls does the wrap
automatically. The four lifecycle-only variants
(MemPathNotAllowed, MemReferencedByPolicy, MemSchemaNotAllowed,
ConfigAlreadyExists) are constructed as FullEngineError::*
directly; they no longer live in memstead_base::EngineError.
Structs§
- Allowlist
Entry Removed - One scrubbed
.memstead/workspace.tomlentry surfaced onMemDeleteResponse::allowlist_entries_removed. Only dangling[cross_mem_links]grants are scrubbed, sotableis always"cross_mem_links"andfrom/toname the directionality the grant established (fromis the table key,tois the array element or wildcard). Thepatternfield is retained on the stable response shape but is no longer populated — the[[mem_management.*]]allowlist rules are preserved across a delete and therefore never reported here. - MemCreate
Params - Parameters for
create_mem. Mirrors thememstead_mem_createMCP tool’s wire shape 1:1. - MemCreate
Response - Response shape from
create_mem. - MemDelete
Params - Parameters for
delete_mem. Mirrors thememstead_mem_deleteMCP tool’s wire shape 1:1, plus a transport-sideoperator_modeflag the wire shape does not expose. - MemDelete
Response - Response shape from
delete_mem. - MemRename
Params - Parameters for
rename_mem. - MemRename
Response - Response of
rename_mem.
Enums§
- Storage
Kind - Explicit storage-backend override for
create_mem. The default (MemCreateParams.storage: None) keeps the workspace-shape heuristic: git-branch when<workspace_root>/mem-repo/.git/exists, folder otherwise. PassingSome(_)pins the backend regardless of workspace shape — the mount loader and runtime already handle mixed-backend workspaces (per-mount backend dispatch), so a folder mem can live beside git-branch mems.
Constants§
- NOTE_
MAX_ LEN - Note-length cap shared with
memstead_create/memstead_update/ full’s lifecycle orchestrators. Mirrorsmemstead_git_branch::NOTE_MAX_LEN.
Functions§
- create_
mem - Create a new writable mem at runtime. Unified counterpart to
full’s
memstead_git_branch::mem_management::create_mem. Routes through the engine’s installedmemstead_base::BackendFactoryso the same call site materialises folder, archive, or git-branch backends transparently — production full consumers installmemstead_git_branch::storage::instantiate_full_backendat boot viaengine_from_workspace_root. - delete_
mem - Unregister a writable mem at runtime. The unified-engine
counterpart to full’s
memstead_git_branch::mem_management::delete_mem. - rename_
mem - Rename a mem:
old→new, complete across every surface that carries the name.