Infrastructure · Primitives

Select

Generic selection of items from a set based on criteria

Definition

Mechanism

Deterministic Filter. Applies a Predicate Function P(x) to every element in Input Set S. Returns a new Subset S' containing only elements where P(x) is True. It filters a set based on specific inclusion criteria.

Preconditions

  1. Criterion is decidable for item type
  2. Input set is iterable

Postconditions

  1. Subset returned

Invariants

  1. Predicate Truth: For all x in Output, Criterion(x) must be True.
  2. Subset Property: Output must be a subset of Input (no new items created).
  3. Determinism: Same input set + same criteria = same output set.

Risks

Failure modes

  1. Empty Result

    No items satisfy the criterion (returns empty set).

  2. Predicate Error

    The criterion function fails or throws an error for specific inputs.

Relationships

Root pattern: builds on nothing in this library.

Used by

References

Act

Root primitive for state modification

Ballot

Immutable record of one agent's cast choice

Decision

Irrevocable selection from a set of options

Composes with

Card

Structured capability advertisement: agent_id, endpoint, protocols, capabilities, metadata

Mind

OODA

Rapid decision cycle: Observe, Orient, Decide, Act

Society

Rally

Enable ad-hoc multi-party coordination

Rank

Order items by score

Reference

Parameters

limit Integer, [1, 10000]
Max items to return
strategy Enum, {Filter, First}
Default: Filter. Random sampling is excluded — it would violate the Determinism invariant.

Identity

Ref
Select#decf
Sema ID
sema:Select#mh:SHA-256:decf9c05490dc5e6b372c5dbb7d89d2285fdd832714fc992b10fdbd6b7c2c2e3
Ring
0
Tier
1
Updated
2026-11-11
Supersedes
  • sema:Select#mh:SHA-256:2fa0da3874e2a9a2c8664ed919d03c28a1f6b76daf9621f069d1ca1cb18a64b6