ingraph 0.1.0

A declaration-driven indexing framework: records and nodes are written as Rust types, and the storage rows, the dataflow between them and the GraphQL query surface are emitted from the declaration.
Documentation
//! ROUTING — how one question becomes one probe per lane, and the three guardrails that keep the
//! fan honest.
//!
//! ```text
//! "中文 and English"  ─▶  ScriptRouter  ─▶  [ zh ⟵ "中文 " ]      ─▶ read ─▶ ranked ─┐
//!                                           [ en ⟵ "and English" ] ─▶ read ─▶ ranked ─┴─ fuse
//! ```
//!
//! A corpus cut into [lanes](crate::lane) is several indexes, so a question asked of it is several
//! questions. This module is the crossing that makes them: a [`LaneRouter`] takes ONE question and
//! answers a [`RoutedProbe`] per lane it wants asked, and what comes back from each is a ranked
//! stream the existing fold already knows how to fuse.
//!
//! # IT IS A CROSSING, NOT AN ENDOMORPHISM, and that is why it looks nothing like the expand step
//!
//! The two halves of the read road's widening are deliberately different shapes, and the ruling
//! wrote the taxonomy down so that neither chases the other's changes:
//!
//! | | shape | what goes in and out | how it mounts |
//! |---|---|---|---|
//! | a query EXPANDER | endomorphism | a question in, more questions of the SAME type out | an assembled hook, erased |
//! | a lane ROUTER | crossing | a rich question in, PROBES out — its own type | a typed seat, monomorphised |
//!
//! A router's output type is its own ([`Routed`](LaneRouter::Routed)), so a declaration wiring one
//! states an EQUALITY — the question type on one side, the slot's probe type on the other — and a
//! mis-wiring is `E0271` at the seat rather than a conversion somewhere in the middle. That is why
//! there is no `dyn` anywhere here and no `Box` at any door: a router is a CAPABILITY a type has,
//! known at the call, where an expander is a POLICY a deployment picks at launch.
//!
//! # SYNC, single mode
//!
//! Routing is pure computation over a question and a roster — no model, no IO, nothing to await — so
//! there is one face and it is the blocking one. A router that eventually needs a model follows the
//! expander's own dual-mode precedent at that point; nothing here has to move for it.
//!
//! # THE THREE GUARDRAILS
//!
//! Each is named, and each refuses rather than guessing:
//!
//! 1. **A fanned corpus with no router is refused AT BOOT** — [`LaneFan::check`]. A question that
//!    reached only the first of four lanes would be a search that silently lost three quarters of
//!    its corpus, so the arrangement is refused before it can answer anything. A deployment that
//!    genuinely wants every lane asked mounts [`FanAll`], which says so in the declaration's own
//!    voice.
//! 2. **A probe naming a lane the corpus does not hold is refused AT RUNTIME**, reporting the
//!    roster — [`UnroutableLane`]. A router is written by a third party and a roster is a
//!    declaration's; the two can drift, and the drift surfaces here rather than as a read against an
//!    index that does not exist. A DECLARED CATCH-ALL does not soften this one: it answers tags the
//!    gate has no home for, where this refuses a lane KEY the roster never carried — a router bug
//!    rather than an unplanned arrival.
//! 3. **An empty split is the EMPTY SET** — not an error, and not a fallback to *ask everything*. A
//!    question with nothing in it for this corpus has no probes, the fold receives no streams, and
//!    the answer is empty. That is the same law
//!    [`participates`](crate::participates) already states one layer over.
//!
//! # THE TYPED SEAT HAS ITS OTHER HALF NOW
//!
//! The projection a wiring is checked against is [`LanedStore::Probe`](crate::LanedStore), landed
//! with the fan declaration: a full-text slot answers `String`, so a `LaneRouter` wired to one
//! states `Routed = <Slot as LanedStore>::Probe` and anything else is `E0271` at the seat. A
//! hand-written router names its own [`Routed`](LaneRouter::Routed) type exactly as it did — the
//! Transformer shape is what makes both spellings the same shape.

mod fan;
mod probe;
mod router;

pub use fan::{FanError, LaneFan, RouterMissing, UnroutableLane};
pub use probe::RoutedProbe;
pub use router::{FanAll, LaneRouter, ScriptRouter, ScriptWeightedFan};