Infrastructure · Primitives
Aggregate
Reduce a set to a summary statistic
Definition
Mechanism
A deterministic function that maps a Vector of inputs to a single Scalar Value. Implements standard statistical operations (Mean, Mode, Median) to compress signal bandwidth. When the caller supplies Vector alongside the vector, the reduction becomes a weighted one. It serves as the computational backbone for consensus mechanisms.
Preconditions
- All elements in list share a comparable type
- Input list is non-empty
Postconditions
- Single summary value returned
Invariants
- Determinism: F(Input) always yields the same Output.
- Yields one scalar Value whatever the input length, including length one.
Risks
Failure modes
Type Mismatch
Input list contains incomparable types (e.g., Integers mixed with Strings).
Empty Set
Attempting to aggregate a list with length 0 (Undefined for Mean/Mode).
Overflow
Sum of inputs exceeds maximum integer size (if strictly typed).
Relationships
Builds on
References
A discrete configuration of agency
Yields
A measure of utility
Used by
References
Mind
Hierarchical context management
Society
Reputation scoring via behavioral deviation from baseline (2-sigma alert)
Mind
Simulating diverse experts
Mind
Sample multiple reasoning chains, select by majority
Society
Provide standard decision mechanism with integrity guarantees
Composes with
Mind
Run subtasks simultaneously and aggregate
Reference
Parameters
functionEnum, {Mean, Median, Mode, Sum, Min, Max, Variance, StdDev}- Default: Mean
