"""Abstract base class for red-team attack strategies."""

from abc import ABC, abstractmethod


class RedTeamStrategy(ABC):
    """Abstract base for all red-team attack strategies."""

    @abstractmethod
    def build_system_prompt(
        self,
        target: str,
        current_turn: int,
        total_turns: int,
        scenario_description: str,
        metaprompt_plan: str = "",
        **kwargs,
    ) -> str:
        """Return the system prompt for this turn.

        Score feedback, adaptation hints, and backtrack markers are
        communicated via the attacker's private conversation history
        (H_attacker) rather than the system prompt.

        Args:
            target: The attack objective.
            current_turn: Current turn number (1-indexed).
            total_turns: Total turns in the conversation.
            scenario_description: Description of the scenario/agent under test.
            metaprompt_plan: The attack plan generated by the metaprompt model.
            **kwargs: Additional strategy-specific parameters.
        """
        raise NotImplementedError

    @abstractmethod
    def get_phase_name(self, current_turn: int, total_turns: int) -> str:
        """Return the name of the current phase for a given turn.

        Used for logging and observability without accessing private internals.

        Args:
            current_turn: Current turn number (1-indexed).
            total_turns: Total turns in the conversation.

        Returns:
            Phase name string (e.g. "warmup", "probing", "escalation", "direct").
        """
        raise NotImplementedError
