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§
- Knowledge
Rules - Normalized business rules loaded by a native host for dispatch-time injection.
- Loaded
Project - A wren project assembled into a canonical MDL manifest.
- MdlContext
- A
ContextLoaderbacked by a wren MDL manifest. Built once from an assembled manifest; all accessors return borrowed, pre-projected data (pure, sans-IO). - Project
Sources - The raw file contents of a wren project, read by the host.
assembleoperates purely over these bytes (WASM-friendly); the nativeread_project_dirconvenience fills them from disk. - RawSource
Context - A
ContextLoaderbacked 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 makesource_introspectable/raw_docs_readableevaluable instead of unanswerable. - RawSources
- The raw file contents of a raw source, read by the host.
from_sourcesoperates purely over these bytes (WASM-friendly); the nativeread_raw_dirconvenience fills them from disk.
Enums§
Functions§
- assemble
- Assemble read project sources into a canonical
Manifest. Returns aLoadErrorif 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 invokingwren. - read_
project_ dir - Read a wren project directory into
ProjectSources(native host only; the pureassemblepath is what a WASM host feeds directly). ReturnsNoneif the directory has nowren_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 pureRawSourceContext::from_sourcespath is what a WASM host feeds directly). ReturnsNoneif the directory has noschema.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