pub fn collect_schema_source(
workspace_root: Option<&Path>,
workspace_schemas_dir: Option<&Path>,
schema_ref: &SchemaRef,
) -> Result<Vec<SchemaSourceFile>, SchemaSourceError>Expand description
Resolve the schema pinned by schema_ref to a sorted set of source
files ready to embed under .memstead/schema/ in a mem archive.
The returned vector is sorted by archive_path so archive bytes are
deterministic — callers don’t need to re-sort.
Resolution order (first match wins):
<workspace_schemas_dir>/<name>/(when provided)<workspace_root>/.memstead.cache/schemas/<name>-<version>/(whenworkspace_rootis provided)- Embedded builtins
When every filesystem layer misses, the returned NotFound lists
every concrete path that was consulted so callers (and agents) can
inspect the resolution trace without re-walking the filesystem.