Skip to main content

Module boot

Module boot 

Source
Expand description

Engine construction — from_mounts* and from_workspace_root.

from_mounts is the in-process constructor every test, the macOS UniFFI consumer, and the MCP filesystem server reach through. from_workspace_root is the lean boot helper that produces the same engine from a workspace root; the full counterpart lives in memstead_git_branch::engine_from_workspace_root and follows the same shape with the git-branch backend added to the factory.

Free helpers in this module materialise the workspace schemas catalogue, walk each mount’s backend at load-time, and synthesise the MemRouterSnapshot from the resolved mount list — pieces the two entry points share.

Structs§

FailedSchemaPackage
One workspace-authored schema package that failed to load — the package is SKIPPED (never fails the boot; degrade, never disappear), and a mem pinning it quarantines with this failure as its typed reason. name/version are best-effort peeks at the package’s schema.yaml header so the pin match works even though the full load refused.
SchemaResolver
The engine’s schema-pin resolver — the single named entry point a load path resolves a name@version pin through. Consults schema sources in a fixed order: local storage (the mem’s own storage backend — folder .memstead/schemas/ or the git-branch __MEMSTEAD:schemas/ ref, layered first into the catalogue so it wins on (name, version) collision), built-in (compiled into the binary), remote (memstead.io, reserved, not implemented). The order is fixed in code — local-over-built-in by the catalogue’s insertion precedence, remote always last. On a miss it yields the per-source [SchemaSourceDiagnostic] trail the SCHEMA_NOT_FOUND envelope carries.

Functions§

load_workspace_schemas
Walk schemas_dir and load every immediate subdirectory as a workspace-authored schema. Each subdirectory must contain a schema.yaml manifest (and optional types/*.yaml) — silently skips entries that don’t carry the manifest. pub so the folder SchemaSource and the below-boot repair path (memstead-git-branch) read through the same walker the boot path uses — one loader, no resolution fork between the booted and below-boot surfaces.
load_workspace_schemas_with_failures
Tolerant form of load_workspace_schemas: broken packages are skipped and recorded instead of failing the whole walk (the historical ? made one refusing package — e.g. a schema still on the retired propagating_relationships key after a binary upgrade — take every mem in the workspace down).
resolve_builtin_schema_pin_pub
Public re-export of [resolve_builtin_schema_pin] for lifecycle orchestrators in memstead-engine. Mirrors full’s resolve_mem_schema against the built-in catalogue; workspace-schema-registry resolution lifts later.