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):
<workspace>/<schemas_dir>/<name>/— workspace-level shared schemas (optional; when the caller supplies a workspace path)- 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§
- Schema
Source File - One source file destined for the archive’s
.memstead/schema/tree.
Enums§
Constants§
- INSTALL_
PROVENANCE_ FILE - Filename of the install-time provenance stamp
memstead schema installwrites 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.memarchive never carries another machine’s filesystem path.
Functions§
- collect_
schema_ source - Resolve the schema pinned by
schema_refto a sorted set of source files ready to embed under.memstead/schema/in a mem archive.