1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Composable recommendation and feed pipeline framework.
//!
//! `x-pipe-rs` provides a typed, composable pipeline for assembling
//! ranked feeds, inspired by the X algorithm's candidate-pipeline
//! architecture. Every pipeline stage is a Kleisli arrow in the
//! [`Io`] monad from [`comp_cat_rs`]; composition is Kleisli
//! composition, which by `comp-cat-rs`'s collapse hierarchy is
//! a Kan extension.
//!
//! # Architecture
//!
//! A pipeline assembles six kinds of stages:
//!
//! 1. **[`Source`]** -- produce candidate items from backends
//! 2. **[`Hydrator`]** -- enrich candidates with additional data
//! 3. **[`Filter`]** -- remove candidates that fail criteria
//! 4. **[`Scorer`]** -- assign relevance scores
//! 5. **[`Selector`]** -- choose final candidates (dedup, diversity, budget)
//! 6. **[`SideEffect`]** -- observe without modifying (logging, metrics)
//!
//! Each trait converts to a [`Stage`], the universal Kleisli arrow
//! type. Stages compose via [`Stage::then`] (Kleisli composition).
//! The final [`Pipeline`] is itself a single `Stage` from query to
//! scored results.
//!
//! # Categorical justification
//!
//! [`Stage`] forms a category whose morphisms are Kleisli arrows
//! `A -> Io<E, B>`. Composition is associative with identity, and
//! by `collapse::monad_is_kan` every such composition is a pair of
//! Kan extensions. [`Score`] implements [`JoinSemilattice`], making
//! score merging a colimit (left Kan extension).
//!
//! [`Io`]: comp_cat_rs::effect::io::Io
//! [`JoinSemilattice`]: comp_cat_rs::foundation::semilattice::JoinSemilattice
pub use PipelineError;
pub use Filter;
pub use Hydrator;
pub use Pipeline;
pub use ;
pub use Scorer;
pub use ;
pub use SideEffect;
pub use Source;
pub use Stage;