Expand description
Backend-agnostic graph kernel for Memstead.
Hosts the parts of the engine that do not assume a git-backed
storage: token-budget chunking, workspace-root utilities, the
entity types and markdown pipeline (parse / generate / write), the
in-memory store, graph queries and community detection, the mem
router, the operation request/response types (including the
gix-free read paths in ops::health / ops::search), the search
index, validators, and rendering.
Consumers that need only graph operations against directory or
archive storage depend on this crate alone — its dependency closure
does not include gix. Code that needs git-backed mems depends on
memstead-git-branch, which builds on memstead-base.
Re-exports§
pub use backend::BackendError;pub use backend::MemBackend;pub use engine::BackendFactory;pub use engine::BootError;pub use engine::CreateEntityArgs;pub use engine::CreateEntityOutcome;pub use engine::DeleteEntityArgs;pub use engine::DeleteEntityOutcome;pub use engine::DeleteReferrers;pub use engine::Engine;pub use engine::EngineError;pub use engine::FromArchiveBytesError;pub use engine::GitBranchBranchResetFn;pub use engine::GitBranchChangesSinceFn;pub use engine::GitBranchDiffFn;pub use engine::GitBranchExportFn;pub use engine::GitBranchExportToBytesFn;pub use engine::GitBranchFetchFn;pub use engine::GitBranchOps;pub use engine::GitBranchPullFn;pub use engine::GitBranchPushFn;pub use engine::GitBranchReadTreeFn;pub use engine::INLINE_LIST_CAP;pub use engine::ReferrerInfo;pub use engine::RelateAction;pub use engine::RelateEntityArgs;pub use engine::RelateEntityOutcome;pub use engine::RenameEntityArgs;pub use engine::RenameEntityOutcome;pub use engine::SchemaSourceDiagnostic;pub use engine::UpdateEntityArgs;pub use engine::UpdateEntityOutcome;pub use engine::format_inline_list_overflow;pub use entity::id::ENTITY_ID_MAX_LEN;pub use entity::id::SlugError;pub use entity::Entity;pub use entity::EntityId;pub use entity::MetadataValue;pub use entity::ParseResult;pub use entity::Relationship;pub use graph::ClusterInfo;pub use graph::LouvainOutput;pub use mem::MemOrigin;pub use mem::MemRouterSnapshot;pub use mem_management::CreateRuleSet;pub use mem_management::DeleteRuleSet;pub use mem_management::MatcherSet;pub use mem_management::MatcherSetError;pub use ops::BackendChanges;pub use ops::BatchEntry;pub use ops::BatchError;pub use ops::BatchResult;pub use ops::ChangeEnvelope;pub use ops::ChangesReport;pub use ops::ContextResult;pub use ops::CreateArgs;pub use ops::CreateResult;pub use ops::DeleteResult;pub use ops::EMPTY_TREE_SHA;pub use ops::ExportResult;pub use ops::Facets;pub use ops::HealthReport;pub use ops::HealthSummary;pub use ops::ListResult;pub use ops::MemExportResult;pub use ops::ModifiedMetadata;pub use ops::ModifiedSections;pub use ops::Query;pub use ops::RENAME_SIMILARITY_DEFAULT;pub use ops::RENAME_SIMILARITY_MAX;pub use ops::RENAME_SIMILARITY_MIN;pub use ops::RelateArg;pub use ops::RelateResult;pub use ops::ReloadReport;pub use ops::ReloadResult;pub use ops::RenameResult;pub use ops::SearchHit;pub use ops::SearchResult;pub use ops::SearchScope;pub use ops::SetMemVersionOutcome;pub use ops::UpdateArgs;pub use ops::UpdateResult;pub use ops::WarningHint;pub use pipeline::Facet;pub use pipeline::Ingest;pub use pipeline::IngestMode;pub use pipeline::IngestTrigger;pub use pipeline::Medium;pub use pipeline::MediumType;pub use pipeline::PatternEntry;pub use pipeline::PatternMode;pub use pipeline::Projection;pub use pipeline_edit::PipelineEditError;pub use pipeline_migrate::migrate_legacy_pipeline;pub use pipeline_migrate::read_legacy_pipeline_configs;pub use pipeline_store::MemPipelineRecord;pub use pipeline_store::PipelineConfigs;pub use pipeline_store::PipelineRecord;pub use pipeline_store::load_pipeline_configs;pub use provenance::Provenance;pub use provenance::ProvenanceKind;pub use store::Edge;pub use store::EdgeSource;pub use store::InEdge;pub use store::Store;pub use workspace::CreateRuleSetting;pub use workspace::DeleteRuleSetting;pub use workspace::Mount;pub use workspace::MountCapability;pub use workspace::MountLifecycle;pub use workspace::MountStorage;pub use workspace::SCHEMA_WILDCARD;pub use workspace::Workspace;pub use workspace::WorkspaceSettings;pub use workspace_store::FileWorkspaceStore;pub use workspace_store::InstantiateError;pub use workspace_store::Layout;pub use workspace_store::StoreError;pub use workspace_store::WORKSPACE_STORE_DIR;pub use workspace_store::WorkspaceStoreAdapter;pub use workspace_store::detect_layout;pub use workspace_store::instantiate_lean_backend;pub use workspace_store::is_workspace_root;pub use workspace_store::standalone_workspace;
Modules§
- backend
MemBackend— uniform trait surface over folder, git-branch, and archive storage.- chunking
- Token-budget chunking for large MCP responses.
- domain_
authority_ wire - Domain-authority publishing — the pure wire protocol shared by the signer (CLI) and the verifier (registry).
- engine
- Unified engine.
- entity
- Entity types and the markdown pipeline (parse, generate, write, load).
- filesystem
- filesystem-mem surfaces — single-mem, history-free, filesystem-backed workspaces.
- graph
- Graph algorithms — BFS traversal, community detection, neighborhood queries.
- mem
- Multi-mem routing, visibility filtering, mem config.
- mem_
management - Compiled lifecycle-policy rule sets — first-match-wins glob lookup
over the
[[mem_management.create]]/[[mem_management.delete]]arrays surfaced inworkspace.toml. - ops
- Operation request/response types and the gix-free read paths
(
health,search). - pipeline
- Pipeline primitives — Medium · Facet · Projection · Ingest.
- pipeline_
edit - Edit operations over the four-primitive pipeline store, with referential integrity.
- pipeline_
migrate - Migration from the legacy JSON-folder pipeline shape to the four-primitive workspace-store shape.
- pipeline_
store - File-adapter persistence for the four pipeline primitives.
- provenance
- Backend-neutral provenance record.
- render
- Markdown rendering of Engine result types.
- runtime_
validator - Runtime CRUD validators consumed by the unified
crate::Engineandmemstead-git-branch’s mem-repo engine. - schema_
source SchemaSource— a storage backend’s schema-storage location.- search_
index - Per-mem tantivy search indexes.
- storage
- Mem write-side trait. The
MemWritersurface is backend-neutral: it deals in mem-relative paths, raw bytes, and opaqueCommitIdstrings. Two adapters live in the workspace today: the git-tree adapter inmemstead_git_branch::storage::git_tree(mem-repo writes) andfilesystem::FilesystemMemWriterin this crate (filesystem-only writes — no gix, no commit history). - store
- In-memory graph store. Dumb data structure — no validation, no side effects. All mutations go through Engine methods.
- validator
- Strict ingress validator for sealed
.memarchives. - vcs
- Backend-agnostic VCS provenance types and trailer-block helpers.
- workspace
- Workspace concept — first-class in
memstead-baseafter the workspace-store rebuild. - workspace_
root - Workspace-root utilities. Today’s only consumer is the
memstead_healthOUTER_REPO_NOT_IGNORING_MEM_REPOwarning surfaced by the MCP layer: when the workspace is embedded inside another git repository, the mem-repo-git directory must be excluded by the outer repo’s.gitignoreto avoid the gitlink trap. - workspace_
store - Persistence adapter — reads / writes the
Workspacefrom disk (or other backing stores) socrate::Engine::from_mountscan consume an in-memory mount list without owning the disk format.
Constants§
- MEM_
META_ DIR - The per-mem engine-internal directory under a folder mem’s
root (
<mem_root>/.memstead/—config.json,changes.jsonl). Defined inmemstead-schema(mem-config loading lives there); re-exported here as the mem-level home for the concept. The per-mem engine-internal directory under a folder mem’s root —<mem_root>/.memstead/holdsconfig.jsonandchanges.jsonl. Defined here (rather than inmemstead-base) because mem-config loading lives in this crate andmemstead-basedepends on it;memstead-basere-exports the constant for downstream consumers. Distinct from the workspace store directory (memstead_base::WORKSPACE_STORE_DIR) and from the in-zip member paths inside sealed archives (ARCHIVE_META_DIR), which are a separate on-disk format and never use this constant.
Functions§
- engine_
fallback_ type - Engine-wide sentinel type. Used by ops that need a shared reference
type at the Engine level (search, health, list) — always resolves to
default@1.0.0::spec. Per-entity resolution still goes throughtype_by_name+ schema lookup.