Syntropy.TaskScheduler.Selection
(syntropy v0.3.0)
Copy Markdown
Agent selection and routing for task runs.
Resolves the requested strategy (:single, :parallel, :all, :auto, or
an explicit agent list) against the cluster-wide ranked candidate pool and
produces the selection trace that runs carry for observability.
Summary
Functions
Builds the per-candidate selection trace, marking which ranked candidates were selected for the run.
Selects agents for a run.
Types
@type selection() :: %{ mode: Syntropy.TaskScheduler.resolved_mode(), ranked_candidates: [map()], selected_agents: [map()] }
Functions
@spec build_selection_trace([map()], [String.t()]) :: [ Syntropy.TaskScheduler.selection_trace_entry() ]
Builds the per-candidate selection trace, marking which ranked candidates were selected for the run.
@spec select_agents( String.t(), [String.t()] | nil, Syntropy.TaskScheduler.requested_strategy(), pos_integer(), MapSet.t() | [String.t()] ) :: selection()
Selects agents for a run.
When agent_ids is a list the selection is explicit; otherwise the
requested strategy is resolved against candidates ranked by
Syntropy.TaskRouter, excluding agents in busy_agent_ids.