Expand description
Fold, Anchor, Objective, and Selector primitives with deterministic ordering and composition.
Re-exports§
pub use checkpoint::Checkpoint;pub use checkpoint::CheckpointStore;pub use checkpoint::InMemoryCheckpointStore;pub use anchor::Anchor;pub use anchor::AnchorGraph;pub use anchor::AnchorRef;pub use anchor::BfsAnchor;pub use selector::GreedySelector;pub use selector::Selector;pub use selector::SelectorInput;pub use selector::SelectorOutput;pub use selector::SelectorWeights;pub use objective::builtin::FirstMatchObjective;pub use objective::builtin::HasSalience;pub use objective::builtin::HasTimestamp;pub use objective::builtin::MaxScoreObjective;pub use objective::builtin::RecencyObjective;pub use objective::builtin::RelevanceObjective;pub use objective::builtin::SalienceObjective;pub use objective::builtin::ThresholdObjective;pub use objective::compose::ConsensusObjective;pub use objective::compose::NegateObjective;pub use objective::compose::PriorityObjective;pub use objective::compose::ScaleObjective;pub use objective::compose::UnionObjective;pub use objective::compose::WeightedObjective;pub use objective::error::ObjectiveError;pub use objective::error::ObjectiveResult;pub use objective::objective_fn;pub use objective::DeterministicObjective;pub use objective::Objective;pub use objective::ObjectiveContext;pub use objective::Selection;pub use ordering::canonical_f32;pub use ordering::canonical_f64;pub use ordering::cmp_asc_score_then_id;pub use ordering::cmp_desc_score_then_id;pub use ordering::HasId;pub use ordering::ScoredEntry;
Modules§
- anchor
AnchorandAnchorGraph: in-memory causal provenance chains for credit assignment.- checkpoint
- Generic checkpoint envelope and in-memory store for fold-managed indexes.
- objective
- Objective function framework — scoring, selection, composition.
- ordering
- Deterministic ordering primitives:
HasId,ScoredEntry, canonical f32/f64, UUID tie-breaking. - selector
- Selector: many → subset under budget.
Structs§
- AnyFold
- A zero-allocation existential fold with a function-pointer predicate.
- Compose
Pipeline - Pipeline that scores candidates with an objective then packs to budget via a selector.
- Count
Fold - A zero-allocation count fold.
- Deterministic
Score - Fixed-point score wrapping an
i64scaled by2^32. - Dual
Fold - Dual fold — run two independent folds over the same entries sequentially.
- Filter
Count Fold - A zero-allocation count fold with a function-pointer predicate.
- Filter
Fold - Filter fold — only process entries matching a predicate.
- FnFold
- Helper to create a fold from closures.
- Fold
Context - Context for fold operations;
as_ofdefaults to Unix epoch. - Fold
Outcome - Outcome of a fold operation.
- MapFold
- Map fold — transform entries before folding.
- Ranked
- Scored item implementing max-heap
Ord: higher score wins, lower ID breaks ties. - Sequential
Fold - Sequential fold — run one fold, then use its output to inform another.
- Shared
Json - Arc-backed shared JSON value; cheap to clone in hot paths.
- SumI64
Fold - A zero-allocation i64 summation fold with a function-pointer projection.
Enums§
- Common
Fold - Enum-dispatch fold for common allocation-free patterns without vtable overhead.
- Common
Fold State - Unified state returned by
CommonFold. - Fold
Error - Errors that can occur in fold operations
- Fold
Failure - Failure returned by fallible fold operations.
Traits§
- Fold
- Core fold trait: collapses a sequence of entries into deterministic derived state.
- TryFold
- Fallible fold step API for reducers that can reject invalid state shapes.
Functions§
- cmp_
asc_ then_ id - Compare scores ascending, lower ID wins ties.
- cmp_
desc_ then_ id - Compare scores descending, lower ID wins ties.
- filter
- Helper to create a filter fold.
- fold_fn
- Create a fold from just initial and step functions (no finalize).
- map
- Helper to create a map fold.
Type Aliases§
- Boxed
Fold - A boxed fold for dynamic dispatch.
- Fold
Result - Result type for fold operations
- Fold
Result Type - Result type for fold operations