Skip to content

symfonic.capabilities.tools.pipeline

pipeline

The tool-selection pipeline (T3.1.2).

The pipeline owns exactly three things no single stage can own:

  • order — which lever outranks which, stated as a list;
  • protection — a forced tool that a later stage drops is put back, once, by one rule, instead of by a special case inside each consumer;
  • the trace — every stage's answer in names, including the stages that abstained, so "why was this tool not bound?" has an answer that does not require a debugger.

Stage failures are contained here as well: a stage that raises is recorded as degraded and the pipeline continues with the set it already had. Selection is a preference mechanism; a broken preference must not be able to stall the loop or empty the tool set.

ToolSelectionPipeline

ToolSelectionPipeline(stages: Sequence[SelectionStage])

Run selection stages in order and report what they decided.

Source code in src/symfonic/capabilities/tools/pipeline.py
def __init__(self, stages: Sequence[SelectionStage]) -> None:
    self._stages = tuple(stages)