Skip to main content

Module reader

Module reader 

Source
Expand description

read — STEP source to StepModel plus a provenance Report.

Reading runs in three steps. read first calls into parser to parse the source, and finally into the generated readers (generated::read) to turn the entities into the typed model. The step in between lives here: non-standard input is healed in place where a safe rewrite exists, and dropped with a DropReason where none does. The Report accounts for everything that came in — kept, normalized, or dropped and why — and identifies the source schema.

Structs§

DropReason
A drop reason: kind + a human label (<TYPE> / <ENT>.<slot>-><TYPE> / a slot-rule name / via-<root>). Aggregated as instance counts per reason.
Report
Input-to-model provenance. Every input entity plus every synthetic entity added by normalization is either kept (validated) or dropped with a reason (drops): validated + sum(drops) == n_in + n_synth. norm = rewrite (fix) notes from the pre-read normalize pass.

Enums§

DropKind
Why an entity was dropped before it could enter the model. SlotLocal = a slot value could not be normalized to standard (req-ref<-$, int<-fractional). Unimplemented = the entity type is outside the generated closure (not yet modeled, or an unknown/non-schema name). Nonstandard = a known closure type sits in a SELECT slot that does not admit it (schema violation). Cascade = a referrer whose target was dropped/dangling. Unclassified = the generated read could not consume the entity’s own attributes (off-kind scalar, bad enum token, short arity, …) and no policy layer (normalize / drop_pass) classified it — a frontier signal: investigate and absorb via normalize or nonstd_ref.

Functions§

read
Read STEP source into the schema-faithful model, returning a provenance Report.