memstead_engine/lib.rs
1//! Full-flavor engine extension for Memstead.
2//!
3//! This crate is the source-boundary home for code that the lean
4//! engine (`memstead-base`) must not carry. The boundary cut targets
5//! multi-mem lifecycle and the engine-only `EngineError` variants.
6//!
7//! Today the crate hosts:
8//! - The typed full-error envelope ([`FullEngineError`]) — wraps
9//! `memstead_base::EngineError` and carries the lifecycle-only variants
10//! ([`error::FullEngineError::MemPathNotAllowed`],
11//! [`error::FullEngineError::MemReferencedByPolicy`],
12//! [`error::FullEngineError::MemSchemaNotAllowed`],
13//! [`error::FullEngineError::ConfigAlreadyExists`]).
14//! - The mem-lifecycle orchestrators ([`mem_management::create_mem`],
15//! [`mem_management::delete_mem`]) and their param/response
16//! types. They consume `&mut memstead_base::Engine` directly; full
17//! contributes lifecycle as free functions over the lean engine
18//! rather than via a wrapper struct or a policy-provider trait.
19//!
20//! The matcher primitives ([`memstead_base::CreateRuleSet`],
21//! [`memstead_base::DeleteRuleSet`], [`memstead_base::MatcherSet`]) stay in
22//! lean — the lean engine's `cross_mem_link_allowed` synthesises a
23//! `CreateRuleSet` on multi-folder workspaces, so they are a lean
24//! policy primitive used by both flavors.
25//!
26//! Lifecycle functions currently return `Result<_, memstead_base::EngineError>`
27//! so the full-MCP server's `engine_err_unified` mapper continues to
28//! consume them unchanged. A follow-up commit switches the return type
29//! to `Result<_, FullEngineError>` and drops the four lifecycle-only
30//! variants from `memstead_base::EngineError`.
31
32pub mod error;
33pub mod health;
34pub mod mem_management;
35pub mod overview;
36pub mod workspace_config_edit;
37
38pub use error::{FullEngineError, RecoveryAction};
39pub use health::{ComposeHealthError, HealthArgs, HealthConfig, compose_health};
40pub use overview::{
41 ALLOWED_OVERVIEW_INCLUDE_KEYS, ComposeOverviewError, DEFAULT_OVERVIEW_BUDGET, OverviewArgs,
42 OverviewOutput, Surface, compose_overview,
43};