Skip to main content

Module workspace

Module workspace 

Source
Expand description

Workspace concept — first-class in memstead-base after the workspace-store rebuild.

A Workspace is the operator-curated collection of mounts; each Mount attaches one mem to the workspace via a storage backend (folder / git-branch / archive). One mount = one mem: five mems living on five branches in one git-repo materialise as five mounts; the engine pools the gitdir handle internally for the shared backend rather than collapsing the conceptual mount.

This module ships the data shapes only. The persistence adapter that materialises a Workspace from .memstead/workspace.toml + .memstead/state/mounts.json lands separately as the file-adapter sessions move forward; tests and the macOS app’s in-memory builder construct Workspace directly without going through any adapter.

Distinct from crate::mem::MemRouterSnapshot, which is the engine’s runtime snapshot of writable / visible mems. The engine derives a MemRouterSnapshot from a Workspace at boot; the two coexist while the rebuild is in flight.

Structs§

CreateRuleSetting
One [[mem_management.create]] rule. Carries a glob pattern matched against the candidate mem path, the schemas allowlist (each entry an exact name@x.y.z pin or the literal "*" for any-schema), and an optional default_cross_links value applied to every mem the rule matches.
DeleteRuleSetting
One [[mem_management.delete]] rule. Carries only a pattern; delete has no schema dimension.
McpSection
[mcp] section — settings the MCP binary reads at boot. Carried on WorkspaceSettings so the MCP server sources its tuning from Engine::settings() instead of a parallel TOML parse.
Mount
A single mem attachment in a Workspace. One mount = one mem. The schema pin is on the mount because per-mem schema resolution is fixed in code (local-storage → built-in → registry, with the storage layer owning where “local” lives — see the glossary’s Schema entry); the mount carries which schema this mem expects, the backend resolves where the YAMLs come from.
MutationsSection
[mutations] section — engine-wide mutation policy. Carried on WorkspaceSettings so plugins can read the configured posture via memstead_health { include_config: true } without a round-trip.
Workspace
Operator-curated workspace — the in-memory shape the engine receives.
WorkspaceSettings
Workspace-level operator policy carried alongside the mount list.

Enums§

MountCapability
What the workspace may do with a mount.
MountLifecycle
When the mount’s backend initialises.
MountStorage
Storage reference for a Mount. One variant per crate::backend::MemBackend implementation. New backends add a variant; the file-adapter learns to round-trip it.

Constants§

SCHEMA_WILDCARD
The literal "*" schema-allowlist entry that admits any pinned schema. Consumed by the create-rule allowlist parser.