pub enum SchemaLoadError {
Show 31 variants
Io {
path: PathBuf,
source: Error,
},
ParseManifest {
path: PathBuf,
source: Error,
},
ParseType {
path: PathBuf,
source: Error,
},
InvalidVersion {
value: String,
},
InvalidName {
value: String,
reason: &'static str,
},
TypeFileMismatch {
declared: Vec<String>,
found: Vec<String>,
},
TypeNameMismatch {
file: String,
declared: String,
},
PropagatingRelationshipsRenamed {
type_name: String,
},
ExamplesRetired {
type_name: String,
},
OptionalRetired {
type_name: String,
field: String,
},
InvalidDueAxis {
type_name: String,
offender: String,
reason: String,
},
MissingDefaultWeight,
DuplicateRelationship {
name: String,
},
UndeclaredRelationship {
type_name: String,
field: &'static str,
relationship: String,
available: Vec<String>,
},
CatchAllViolation {
type_name: String,
count: usize,
},
UnknownFieldReference {
type_name: String,
field: &'static str,
reference: String,
},
InvalidConstraint {
type_name: String,
kind: &'static str,
offender: String,
reason: String,
},
InvalidSectionFormat {
type_name: String,
section: String,
problems: Vec<String>,
},
DefaultValueNotInEnum {
type_name: String,
field: String,
default: String,
allowed: Vec<String>,
},
RedeclaredBaseField {
type_name: String,
field: String,
},
UndeclaredRelationshipType {
relationship: String,
field: &'static str,
reference: String,
declared: Vec<String>,
},
ReservedSchemaKey {
type_name: String,
kind: &'static str,
offending_key: String,
reserved_keys: Vec<String>,
},
InvalidCrossMemToSchema {
value: String,
reason: String,
},
DuplicateCrossMemToSchema {
to_schema: String,
},
SealedPackageMissingManifest,
CrossMemWildcardWithoutAliasTarget,
CrossMemWildcardNonAliasRelType {
rel_type: String,
alias_target: String,
},
UndeclaredCrossMemSourceType {
to_schema: String,
relationship: String,
reference: String,
declared: Vec<String>,
},
AliasTargetRelTypeNotDeclared {
schema: String,
target: String,
declared: Vec<String>,
},
SectionHeadingMismatch {
violations: Vec<HeadingKeyViolation>,
},
Multiple {
errors: Vec<SchemaLoadError>,
},
}Variants§
Io
ParseManifest
ParseType
InvalidVersion
InvalidName
TypeFileMismatch
TypeNameMismatch
PropagatingRelationshipsRenamed
The retired propagating_relationships: key was used in an
authoring context (a schema package loaded from a directory —
workspace .memstead/schemas/, schema install, schema validate). The key’s name promised propagation the engine
never performed; its only effect — refusing self-loops on the
listed rel-types — now lives under no_self_loop_relationships.
Sealed content (built-ins, installed refs) keeps loading with
the old key translated; only authoring refuses, so the fix is
one mechanical key rename per schema.
ExamplesRetired
OptionalRetired
The retired optional: metadata-field key was used in an
authoring context. The polarity flipped (first-author-path
plan 07): a field is optional unless it declares
required: true — the same rule sections follow. Sealed
content keeps loading with the old key inverted; only
authoring refuses, so the fix is one mechanical edit.
InvalidDueAxis
A due: declaration referencing fields the type does not have
in the required shapes. offender names the bad reference,
reason states the shape rule it violates — the due axis is
spec (an external declaration), so its references validate at
load with the loader’s usual recovery quality.
MissingDefaultWeight
DuplicateRelationship
UndeclaredRelationship
CatchAllViolation
UnknownFieldReference
InvalidConstraint
InvalidSectionFormat
Fields
DefaultValueNotInEnum
RedeclaredBaseField
UndeclaredRelationshipType
ReservedSchemaKey
Schema declares a regular section or metadata field whose key
collides with an engine-invariant key. The reserved set covers
section key relationships (the parser’s auto-managed
## Relationships section) and the metadata identity/
discriminator triple type / mem / id
(reserved_metadata_field_keys). Sections refuse at load;
metadata keys refuse on the install/strict-validation path
(check_reserved_metadata_keys) so sealed schemas keep
booting.
InvalidCrossMemToSchema
A cross_mem_relationships: entry’s to_schema: field is
not a bare schema name. Cross-mem eligibility is name-based —
versioned (software@1.0.0) and range (software@^1.0) forms
are refused so a version component can never silently re-enter
the eligibility path.
DuplicateCrossMemToSchema
Two cross_mem_relationships: entries declare the same
to_schema:. A schema declares each target-schema at most once
— the second entry would otherwise silently shadow or split
the vocabulary.
SealedPackageMissingManifest
A sealed package’s file list carries no schema.yaml. Only
reachable through load_sealed_package — the directory
loader surfaces a missing manifest as Self::Io instead.
CrossMemWildcardWithoutAliasTarget
A to_schema: "*" wildcard entry in a schema that declares no
alias_target_rel_type. The wildcard is BOUND to the
alias-synthesised rel-type — a schema that has not opted into
alias synthesis has made no decision the wildcard could extend.
CrossMemWildcardNonAliasRelType
A to_schema: "*" wildcard entry declaring a rel-type other
than the schema’s alias_target_rel_type. Hand-authored
structural edges keep requiring a per-destination-schema
declaration — the wildcard only extends the soft, auto-emitted
alias references the author already permitted.
UndeclaredCrossMemSourceType
A cross_mem_relationships[].definitions[*].source_types entry
references a type name not declared in the source schema’s
types list. Source types belong to the source schema’s
namespace; unknown names raise this error at load time.
(Target types are accepted as opaque strings — they belong to
the target schema’s namespace, which is not in scope here.)
AliasTargetRelTypeNotDeclared
The schema’s alias_target_rel_type: pointer names a rel-type
not declared in relationships.definitions. Surfaces at
schema-load time so the alias-synthesis pass can trust the
pointer is resolvable at every later mutation call.
SectionHeadingMismatch
One or more declared section headings do not derive back to their
declared keys (derive_section_key(heading) != key), so content
written under the heading could never be parsed back into the
section — it would silently fork into a second heading or fall
through to the catch-all. Raised by
check_section_heading_roundtrip on the authoring/installation
path only; a schema already sealed into a mem-repo keeps loading
and surfaces the condition through health instead.
Fields
violations: Vec<HeadingKeyViolation>Multiple
Two or more independent semantic violations found in one load pass. The loader accumulates every violation it can prove on successfully parsed structure and refuses once, so the author fixes the whole set in one edit instead of one violation per validate round. Structural failures (a manifest that does not parse, a declared-vs-found type-file mismatch) still short-circuit — everything downstream of them would be noise derived from a value that does not exist. A single violation is returned bare, never as a one-element list.
Fields
errors: Vec<SchemaLoadError>Trait Implementations§
Source§impl Debug for SchemaLoadError
impl Debug for SchemaLoadError
Source§impl Display for SchemaLoadError
impl Display for SchemaLoadError
Source§impl Error for SchemaLoadError
impl Error for SchemaLoadError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()