Skip to main content

Module source

Module source 

Source
Expand description

Schema source-file collection for publishing mem archives.

A published .mem archive is portable only if the schema it pins travels inside it — otherwise opening the archive on a foreign machine without the matching schema registered would fail at resolve time. collect_schema_source resolves a SchemaRef to the raw YAML bytes callers need to zip into the archive’s schema/ tree.

Resolution order (first match wins):

  1. <workspace>/<schemas_dir>/<name>/ — workspace-level shared schemas (optional; when the caller supplies a workspace path)
  2. Embedded built-in (via include_dir!) — ships inside the binary

In every case the manifest’s declared version is checked against the pin; a name collision at the wrong version falls through rather than silently embedding a mismatched schema.

Structs§

SchemaSourceFile
One source file destined for the archive’s .memstead/schema/ tree.

Enums§

SchemaSourceError

Constants§

INSTALL_PROVENANCE_FILE
Filename of the install-time provenance stamp memstead schema install writes INTO the sealed package when the install source was an authoring directory: {"authoring_path": "<canonical path>"}. The stamp is the detection basis for the authoring-drift health axis — a schema without one (sealed pre-stamp, built-in, name- or archive-sourced install) is simply not checked, because a guessed provenance is worse than an absent one. The stamp is workspace- local by design: every package collector in this module reads selectively (schema.yaml, types/*.yaml, mem-template.json, README.md) and therefore never picks it up, and the git-ref export path excludes it by name — a published .mem archive never carries another machine’s filesystem path.

Functions§

collect_schema_source
Resolve the schema pinned by schema_ref to a sorted set of source files ready to embed under .memstead/schema/ in a mem archive.