phases
strands_teams.phases ¶
Generic, phase-enum-agnostic phase specification.
The pre-split consumer/phases.py hardcoded a 5-value AnalysisPhase IntEnum plus codebase-specific tool→phase and phase-name maps. PhaseSpec generalizes that: a use case supplies its own phase indices, names, descriptions, tool→phase map, and tool-name prefix rules. The display layer (Wave D) reads count and names instead of a literal /5.
Phases are identified by 1-based integer index (order matters). No enum is imposed — a use case may still back the indices with its own IntEnum and pass int(member) values.
PhaseSpec dataclass ¶
Describes the ordered phases of a run for progress display and tagging.
Attributes:
| Name | Type | Description |
|---|---|---|
names | Mapping[int, str] | Map of phase index (1-based) to human-readable phase name. |
descriptions | Mapping[int, str] | Map of phase index to a one-line description. |
tool_phase_map | Mapping[str, int] | Map of exact tool name to the phase index it belongs to. |
prefix_rules | Mapping[str, int] | Map of tool-name prefix to a phase index, applied when no exact match is found in |
name ¶
description ¶
resolve ¶
Resolve a tool name to its phase index.
Checks the exact tool_phase_map first, then prefix_rules.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_name | str | The invoked tool's name. | required |
Returns:
| Type | Description |
|---|---|
int | None | The phase index, or |