Skip to main content

Module schema

Module schema 

Source
Expand description

memstead schema validate <path> — load a schema package from disk and report whether it conforms to the engine’s schema rules.

Validation runs the same loader the engine uses at boot (memstead_schema::loader::load_schema_from_dir), so a package that validates here is one the engine will accept. Parse failures carry the YAML layer’s line/column in their message; structural failures (undeclared relationship vocabulary, type/file mismatch, missing _default weight, …) carry the engine’s typed diagnostic.

memstead schema install <name|path> copies a schema package into the current workspace’s local schema storage so a mem can pin it. It resolves the source — a built-in name (planning, planning@0.1.0) or a path to a package directory — validates it, and writes the package (including any mem-template.json) under the folder backend’s fixed <workspace>/.memstead/schemas/<name>@<version>/ location. Installing a built-in forks it into local storage, which shadows the built-in per the resolution order — the customization entry point. Idempotent: re-running reproduces the same files. Git-branch workspaces are not yet a destination (their schemas live on the __MEMSTEAD:schemas/ ref, which routes through the engine).

validate is flavour-agnostic and touches no workspace; install needs the workspace root (the install destination) but no engine instance — it writes folder-backend schema storage directly, which is the documented folder authoring mechanism (not mem-repo state).

Structs§

Args
InstallArgs
NewArgs
ValidateArgs

Enums§

SchemaCommand

Functions§

run