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
use super::Fusion;

/// The RULED constant, and the one place it is written down.
///
/// 60 is the law rather than a tuning default, so the assertion is on the NUMBER — a change to it is
/// a change to a ruling and has to fail a test before it fails a user.
#[test]
fn the_shipped_damping_constant_is_sixty() {
  assert_eq!(Fusion::RRF_K, 60);
  assert_eq!(Fusion::rrf(), Fusion::Rrf { k: 60 });
}

/// A fused query that names no fold gets reciprocal rank fusion at the shipped constant — which is
/// also what the wire's `rrfK: Int = 60` renders.
#[test]
fn the_default_fold_is_the_shipped_rrf() {
  assert_eq!(Fusion::default(), Fusion::rrf());
}

/// `k` is query-tunable, which is the half a constant alone would not give: a caller states another
/// value and the type carries it.
#[test]
fn a_query_may_name_its_own_k() {
  let tuned = Fusion::Rrf { k: 5 };

  assert_ne!(tuned, Fusion::rrf());
  let Fusion::Rrf { k } = tuned;
  assert_eq!(k, 5);
}