Expand description
Workspace-shape .memstead/config.json for filesystem mems.
Distinct from the archive-shape config in
super::super::validator::config: the workspace shape adds a
deps list (cross-mem dependencies on registry-published mems)
and pins format to a different version namespace so a workspace
file accidentally fed to the archive validator (or vice versa)
surfaces as a typed mismatch rather than a generic serde error.
§Shape (as written to disk)
{
"format": 1,
"schema": "default@1.0.0",
"deps": ["anthropic/core"]
}format: workspace-config format integer. Bumped on breaking shape changes; current =FILESYSTEM_WORKSPACE_FORMAT.name: mem slug — path-derived, not persisted. Identity of record is the mounts roster (state/mounts.json); on read an absentnameis filled from the workspace-root basename. The schema validator tombstones a straynameinconfig.json.schema: mem schema pin in exact<name>@<version>form (e.g."default@1.0.0") — bare-name pins are rejected at parse.deps: cross-mem dependencies, each inscope/nameform. The list ordering is preserved on round-trip; duplicates are rejected at parse time.version,description,authors: optional fields used bymemstead publishto populate the archive shape. Carried through so the workspace remains the source of truth for publish metadata.
§Publish projection
[Self::to_published] converts the workspace shape to a strict
PublishedMemConfig for memstead publish, dropping deps and
enforcing the archive’s stricter requirements (versioned schema,
present version field). Errors surface via
PublishConversionError from memstead-schema.
Structs§
- DepRef
- Cross-mem dependency entry. Mirrors the Tier 3 wiki-link
addressing scheme
[[scope/name:slug]]and thememstead link <scope>/<name>CLI shorthand. - Workspace
Config - Workspace-shape
.memstead/config.jsonfor a filesystem mem. Distinct fromPublishedMemConfig(the archive shape).
Enums§
- Workspace
Config Error - Errors surfaced by
WorkspaceConfigload + parse.
Constants§
- FILESYSTEM_
WORKSPACE_ FORMAT - Format integer for the filesystem workspace
.memstead/config.json. Bumped on breaking shape changes; current consumers (memstead init,memstead link,memstead publish, the filesystem engine) all check this before parsing the rest. Distinct frommemstead_schema::PUBLISHED_MEM_FORMATso a misfiled archive config inside a workspace surfaces asWorkspaceConfigError::UnsupportedFormat.
Functions§
- config_
path - Conventional path of the workspace config inside a workspace root.
- init_
filesystem_ mem - Initialise a brand-new filesystem (folder-backed) mem at
root— the engine-owned counterpart ofmemstead initfor a single collapsed mem. Writes the canonical.memstead/config.json, thecache/+memstead-io/subdirs, theworkspace.tomladapter marker, and thestate/mounts.jsonone-folder-mount roster, so the result roots directly throughcrate::Engine::from_workspace_root. The mem root is the workspace root (collapsed single-mem form). - parse_
workspace_ config - Parse workspace config bytes, enforcing the format pin, the name shape, and the deps-uniqueness invariant.
- read_
workspace_ config - Read + parse the workspace config at
<workspace_root>/.memstead/config.json. - validate_
mem_ name - Validate a mem name against the slug shape. Since the name is now
path-derived (no longer persisted in
config.json), callers that accept a mem name as input — e.g.memstead init --name— validate it here at the boundary instead of relying on a config round-trip to reject a bad value. - write_
workspace_ config - Write the workspace config to
<workspace_root>/.memstead/config.jsonatomically (write-to-temp + rename). Creates the.memstead/parent directory if absent. Pretty-printed with 2-space indent for human inspection (the file is the operator’s primary debugging surface).