Skip to main content

Crate warble_mdl_context

Crate warble_mdl_context 

Source
Expand description

Warble ContextLoader adapter #1 — the MDL adapter.

Implements warble::ContextLoader over a wren MDL project by introspecting it through wren-core-base (the canonical MDL manifest types). This is the binding layer: the wren dependency is internalized here so that warble core and the component library stay zero-wren (dependency firewall). A future OSI (or other) adapter implements the same trait without touching core.

Pipeline: read project files (host I/O) → project::assemble into a Manifest → MdlContext::from_manifest projects to Warble Info types + builds the semantic warble::LineageGraph. Parse/introspection is pure and WASM-friendly (no DB, no async); query execution never enters this layer.

Like the two dispatcher back-ends, this crate is not a standalone tool — you install warble-cli (the warble binary), which links this crate in directly as the warble::ContextLoader implementation the host builds before calling warble::compile.

Structs§

KnowledgeRules
Normalized business rules loaded by a native host for dispatch-time injection.
LoadedProject
A wren project assembled into a canonical MDL manifest.
MdlContext
A ContextLoader backed by a wren MDL manifest. Built once from an assembled manifest; all accessors return borrowed, pre-projected data (pure, sans-IO).
ProjectSources
The raw file contents of a wren project, read by the host. assemble operates purely over these bytes (WASM-friendly); the native read_project_dir convenience fills them from disk.
RawSourceContext
A ContextLoader backed by a raw (pre-MDL) source. Carries no metrics/dimensions/models/lineage — that is what a CONSTITUTIVE component’s output produces — but answers the two raw-shape probes that make source_introspectable / raw_docs_readable evaluable instead of unanswerable.
RawSources
The raw file contents of a raw source, read by the host. from_sources operates purely over these bytes (WASM-friendly); the native read_raw_dir convenience fills them from disk.

Enums§

LoadError

Functions§

assemble
Assemble read project sources into a canonical Manifest. Returns a LoadError if any file fails to parse or the assembled manifest is not a valid MDL manifest.
cube_id
dashboard_id
dim_id
infer_additivity
Classify a measure’s additivity from the leading aggregation of its expression.
metric_id
model_id
query_id
read_knowledge_rules
Read the business-rule slice used by wren context instructions, without invoking wren.
read_project_dir
Read a wren project directory into ProjectSources (native host only; the pure assemble path is what a WASM host feeds directly). Returns None if the directory has no wren_project.yml — i.e. it is not a wren project — so the caller can build an unparseable context. Model, cube, and view sub-directories are read in sorted order for deterministic output.
read_raw_dir
Read a raw-source directory into RawSources (native host only; the pure RawSourceContext::from_sources path is what a WASM host feeds directly). Returns None if the directory has no schema.json — i.e. it is not a raw source — so the caller can fall through to another adapter or an unparseable context.
rel_id
view_id