Skip to main content

Module meta_schema

Module meta_schema 

Source
Expand description

Embedded JSON Schemas (the “meta-schemas”) for authoring validation.

schema-manifest.schema.json and type-definition.schema.json are generated from the Rust schema structs and committed under generated/. They are baked into the binary here so the engine can publish them into a workspace’s .memstead/meta-schemas/ at boot — a well-known location an authored package’s # yaml-language-server: $schema=… directive resolves against, giving IDE-side validation as the YAML is edited. memstead schema install rewrites a package’s directive to the installed-location form so the published copy is what the editor checks against.

Constants§

META_SCHEMA_DIR
Directory (under <workspace>/.memstead/) the meta-schemas publish to.
META_SCHEMA_MANIFEST
JSON Schema for a schema package manifest (schema.yaml).
META_SCHEMA_MANIFEST_FILE
Published filename of the manifest meta-schema.
META_SCHEMA_TYPE_DEFINITION
JSON Schema for a type definition (types/<type>.yaml).
META_SCHEMA_TYPE_DEFINITION_FILE
Published filename of the type-definition meta-schema.

Functions§

publish_meta_schemas
Publish the embedded meta-schemas into <workspace_root>/.memstead/meta-schemas/. Idempotent — rewrites a file only when its on-disk bytes differ. Best-effort by contract: the engine-boot caller ignores the error so a read-only or permission-restricted workspace still boots; the meta-schemas are an editor convenience, not load-bearing engine state.