Skip to main content

warble_mdl_context/
lib.rs

1//! Warble ContextLoader adapter #1 — the MDL adapter.
2//!
3//! Implements [`warble::ContextLoader`] over a wren MDL project by introspecting it through
4//! `wren-core-base` (the canonical MDL manifest types). This is the *binding layer*: the wren
5//! dependency is internalized here so that `warble` core and the component library stay zero-wren
6//! (dependency firewall). A future OSI (or other) adapter implements the same trait
7//! without touching core.
8//!
9//! Pipeline: read project files (host I/O) → [`project::assemble`] into a `Manifest` →
10//! [`MdlContext::from_manifest`] projects to Warble Info types + builds the semantic
11//! [`warble::LineageGraph`]. Parse/introspection is pure and WASM-friendly (no DB, no async);
12//! query execution never enters this layer.
13//!
14//! Like the two dispatcher back-ends, this crate is not a standalone tool — you install
15//! `warble-cli` (the `warble` binary), which links this crate in directly as the
16//! [`warble::ContextLoader`] implementation the host builds before calling [`warble::compile`].
17
18mod consumers;
19mod introspect;
20mod lineage;
21mod project;
22
23pub use introspect::{infer_additivity, MdlContext};
24pub use lineage::{cube_id, dashboard_id, dim_id, metric_id, model_id, query_id, rel_id, view_id};
25pub use project::{assemble, KnowledgeRules, LoadError, LoadedProject, ProjectSources};
26#[cfg(not(target_arch = "wasm32"))]
27pub use project::{read_knowledge_rules, read_project_dir};