"""Test that CROP_TO_CLOSEUP doesn't fire on OTS shots."""
from recoil.execution.feedback.agent import FeedbackAgent
from recoil.execution.step_types import GateVerdict


def test_ots_in_blocked_shot_types():
    from recoil.execution.feedback.constants import CROP_CLOSEUP_BLOCKED_SHOT_TYPES
    assert "OTS" in CROP_CLOSEUP_BLOCKED_SHOT_TYPES


def test_crop_to_closeup_does_not_fire_on_ots():
    """An OTS shot must NOT be cropped to a CU."""
    agent = FeedbackAgent(project_id="test")
    verdict = GateVerdict(
        passed=False, gate_name="gate_2a",
        reason="identity drift",
        details={"shot_type": "OTS", "verb_strength": "LOW"},
        cost=0.0, retriable=True,
    )
    fix = agent._try_crop_to_closeup(verdict, attempt_number=3)
    assert fix is None, "CROP_TO_CLOSEUP should not fire on OTS — destroys listener half"
