Analysis phase detection and discovery event models.
Maps tool names to analysis phases for the TUI progress display, and provides models for discovery events (significant findings).
AnalysisPhase
Bases: IntEnum
Ordered analysis phases (1-10).
DiscoveryEventKind
Bases: StrEnum
Kinds of discovery events for the TUI feed.
DiscoveryEvent
Bases: FrozenModel
A notable discovery made during analysis.
PhaseState
Bases: StrictModel
Mutable state for a single analysis phase.
is_complete property
Whether this phase has completed.
elapsed_seconds property
Seconds elapsed since phase started (or total if completed).
resolve_phase
Resolve a tool name to its analysis phase, or None if unknown.
Source code in src/code_context_agent/consumer/phases.py
| def resolve_phase(tool_name: str) -> AnalysisPhase | None:
"""Resolve a tool name to its analysis phase, or None if unknown."""
return TOOL_PHASE_MAP.get(tool_name)
|