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
//! FUSION — what happens when ONE query is asked of N indexes and N ranked lists come back.
//!
//! ```text
//! member₁  floor → dedup → rank  ─┐
//! member₂  floor → dedup → rank  ─┼─ root-projected ─→ fuse ─→ Vec<Fused<Root, Evidence>>
//! member₃  floor → dedup → rank  ─┘
//! ```
//!
//! Everything left of `fuse` is [`retrieve`](super)'s, once per member. This module is the join, and
//! it is the whole of the seventh query kind that does not depend on which engines are in the
//! catalog.
//!
//! # Ranks fuse; SCORES DO NOT
//!
//! The one fact the rest of the module follows from. A BM25 relevance is corpus-relative and
//! unbounded above, a cosine similarity is absolute in `[-1, 1]`, a quantised backend answers in
//! something else again — and two full-text slots holding different corpora do not even agree with
//! each other, because their document frequencies differ. So there is no arithmetic over the scores
//! of two members that means anything, and the ruling refuses the score-additive fusion families BY
//! NAME rather than shipping one behind a warning.
//!
//! What DOES cross is the ORDINAL. Reciprocal rank fusion reads only where each member put a thing,
//! never what it measured, so it is defined over exactly the members this framework can have — open
//! ones, whose currencies it has never seen.
//!
//! # The ordinal it reads is the ENGINE's, holes included
//!
//! `1 / (k + rank)` is computed against [`Ranked::rank`](crate::Ranked::rank) — the hit's position in
//! the engine's RAW stream — and not against its position in the survivor list. The two disagree
//! wherever the floor, the dedup or a filter dropped a hit, and the ruling names the engine's:
//! *survivors wearing their ENGINE ordinals (the ruled rank feeding the ruled fusion)*.
//!
//! It is the sharper reading as well as the ruled one. A member that returned three survivors out of
//! a hundred hits agrees less strongly about its third than a member that returned three out of
//! three, and only the raw ordinal can tell the two apart — re-densifying would make them identical.
//!
//! # The FUSION TREE, and where its two halves live
//!
//! Everything above is the FOLD — one tier's worth of arithmetic. The tree that fold runs over is
//! fractal: a tier's routes are its slots and its child tiers, each child fusing its own routes and
//! entering its parent as one. Three types carry that tree, and all three are here because none of
//! them is generic over an engine:
//!
//! - [`Fusable`] is the SEAM. A parent names no child package; it projects
//!   `<Member as Fusable>::Options`, which is what lets a third-party member join with no edit to
//!   the parent, and what makes a non-retrieving node's absence a compile fact.
//! - [`Route`] is the EDGE — the parent's own facts about one route (its weight in the fold, whether
//!   it is walked, how deep to ask it) wrapped around the route's own package. [`route_depth`] is
//!   the law that spends the third of those.
//! - [`FusionOptions`] is the per-tier ALGORITHM knob, the request whose one resolution is
//!   [`Fusion`].
//!
//! The QUESTION side is the same tree again, and [`asked`] is its whole resolution law.
//!
//! # What is NOT here, and why
//!
//! The PACKAGES themselves — the leaf options a slot carries, the per-tier fuse package, the wire
//! SEMANTICS enum and the evidence enum — are EMISSIONS, minted at slot and tier grain by
//! declarations this crate has never seen. The doors that spend them are emissions too. What lives
//! here is the vocabulary all of that is written in: a seam, an edge, a flavour request, a fold, and
//! the two specs a caller fills in.

mod fan;
mod flavour;
mod fold;
mod fusable;
mod fused;
mod fusion;
mod grain;
mod join;
mod question;
mod read;
mod route;
mod score;
mod sighting;
mod spec;

pub use fan::{FanStream, RankedStream, fuse_fanned};
pub use flavour::{FusionOptions, RrfOptions};
pub use fold::{fuse, fuse_weighted};
pub use fusable::Fusable;
pub use fused::{Fused, Rooted};
pub use fusion::Fusion;
pub use grain::Grain;
pub use join::{EqJoin, HashJoin, Join};
pub use question::{asked, participates};
pub use read::AsyncFusedRead;
pub use route::{Route, route_depth};
pub use score::FusedScore;
pub use sighting::Sighting;
pub use spec::FloorSpec;