kevy_index/lib.rs
1//! kevy-index — declarative secondary indexes over prefix domains
2//! (RFC 2026-07-04, LOCKED).
3//!
4//! Pure logic crate: [`Catalog`] holds the index declarations and a
5//! compiled prefix matcher; [`Segment`] holds one shard's slice of one
6//! index (entries follow the indexed key's shard — index-follows-key).
7//! The embedding runtime calls [`Segment::apply`] synchronously with
8//! every write in the index's domain (derived-by-construction: the
9//! index can never drift from the data, and [`Segment::verify_entry`]
10//! makes that falsifiable), and serves queries by fanning
11//! [`Segment::range`] / [`Segment::eq`] across shards and merging.
12//!
13//! No I/O, no threads, no runtime types — everything here is
14//! deterministic and unit-testable in isolation.
15
16#![warn(missing_docs)]
17
18mod agg;
19mod catalog;
20mod segment;
21mod value;
22mod view;
23mod view_sidecar;
24
25pub use agg::{AggBy, AggSegment, AggStats, GroupStats, merge_group, sort_groups};
26pub use catalog::{AnnSpec, Catalog, IndexKind, IndexSpec, IndexState, ValType};
27pub use segment::{Cursor, Segment, SegmentStats};
28pub use value::IndexValue;
29pub use view::{
30 Leaf, MAX_TREE_DEPTH, MAX_TREE_LEAVES, MAX_VIEWS, MaterializedSet, Tree, ViewCatalog,
31 ViewMode, ViewSpec, eval_tree, key_in_tree, key_in_tree_vals,
32};