Skip to main content

Crate memstead_schema

Crate memstead_schema 

Source
Expand description

Type definitions, schema loading, and mem-config validation for Memstead.

Schemas are first-class packages — named, versioned bundles of type definitions + relationship vocabulary + LLM-facing documentation. The engine holds a SchemaRegistry mapping (name, version) to Arc<Schema>. Each mem pins exactly one schema via MemConfig.schema: SchemaRef.

Re-exports§

pub use archive_provenance::ARCHIVE_PROVENANCE_FORMAT;
pub use archive_provenance::ArchiveProvenance;
pub use archive_provenance::EntityProvenance;
pub use archive_provenance::History;
pub use config::ARCHIVE_ANCHORS_PATH;
pub use config::ARCHIVE_CONFIG_PATH;
pub use config::ARCHIVE_EXTENSION;
pub use config::ARCHIVE_META_DIR;
pub use config::ARCHIVE_PROVENANCE_PATH;
pub use config::ARCHIVE_SCHEMA_PREFIX;
pub use config::CommunityOverride;
pub use config::ConfigCheckResult;
pub use config::ConfigError;
pub use config::MEM_META_DIR;
pub use config::MemConfig;
pub use config::MemSubject;
pub use config::MutationStamp;
pub use config::PUBLISHED_MEM_FORMAT;
pub use config::PUBLISHED_MEM_FORMATS_ACCEPTED;
pub use config::PublishConfig;
pub use config::PublishConversionError;
pub use config::PublishedMemConfig;
pub use config::ReadMemSource;
pub use config::ReadMemSpec;
pub use config::RoleConfig;
pub use config::SchemaRef;
pub use config::VcsConfig;
pub use config::check_config;
pub use config::load_and_validate;
pub use config::load_config;
pub use config::parse_mem_config;
pub use config::published_config_from;
pub use config::published_format_accepted;
pub use loader::HeadingKeyViolation;
pub use loader::MetadataPolarityFormat;
pub use loader::SchemaLoadError;
pub use loader::check_reserved_metadata_keys;
pub use loader::check_section_formats;
pub use loader::check_section_heading_roundtrip;
pub use loader::load_schema_from_dir;
pub use loader::load_schema_from_memory;
pub use loader::load_schema_from_memory_with_format;
pub use loader::load_sealed_package;
pub use manifest::Cardinality;
pub use manifest::CommunityConfig;
pub use manifest::CrossMemRelationshipEntry;
pub use manifest::DefaultWritingGuidance;
pub use manifest::ManualAuthoring;
pub use manifest::PerEdgeDescription;
pub use manifest::RelationshipDef;
pub use manifest::RelationshipMode;
pub use manifest::RelationshipVocabulary;
pub use manifest::SchemaManifest;
pub use schema::Schema;
pub use source::INSTALL_PROVENANCE_FILE;
pub use source::SchemaSourceError;
pub use source::SchemaSourceFile;
pub use source::collect_schema_source;
pub use types::ConstraintDef;
pub use types::ConstraintSeverity;
pub use types::DueAxis;
pub use types::FieldType;
pub use types::Filterable;
pub use types::MetadataFieldDef;
pub use types::PropagationDirection;
pub use types::RequiredCardinality;
pub use types::RequiredOutgoing;
pub use types::SectionDef;
pub use types::Serialization;
pub use types::TableFormat;
pub use types::TypeDefinition;
pub use types::derive_section_key;

Modules§

archive_provenance
Authoring-provenance payload carried inside a sealed .mem archive.
base_metadata
Metadata fields every entity carries regardless of type.
builtin_names
Name constants for the 10 built-in knowledge types shipped in the default schema. Kept as a module to catch typos at compile time.
builtins
Embedded builtin schemas, baked into the binary via include_dir!.
config
Mem configuration loading, validation, and top-level CRUD.
content_expr
Content expressions — the compiled half of the section-format vocabulary (agent-toolbox plan 08).
loader
Schema loader — reads on-disk schema directories (or in-memory YAML) into validated Schema values with edge_weights resolved.
manifest
Schema manifest (schema.yaml) — the outer envelope declaring a schema package: name, version, type list, relationship vocabulary, community defaults, and LLM-facing documentation.
meta_schema
Embedded JSON Schemas (the “meta-schemas”) for authoring validation.
schema
In-memory representation of a loaded schema.
source
Schema source-file collection for publishing mem archives.
types
Schema-as-artifact type format.
workspace_config
Cross-mem-link policy value parsing for .memstead/workspace.toml.

Structs§

SchemaNameAmbiguous
Error returned by SchemaRegistry::resolve_by_name when a bare-name lookup matches multiple registered versions. Surfaced by the memstead_schema(name=...) discovery surface — callers must supply an exact <name>@<version> to disambiguate.
SchemaRegistry
Registry holding every loaded schema keyed by (name, version).

Enums§

SchemaRegistryError
WorkspaceSchemaLoadError
Errors raised while scanning workspace-level or cache schema directories.

Functions§

all_types
Every type in the built-in default schema, in declaration order.
type_by_name
Lookup by short type name against the built-in default schema.