from pathlib import Path
from typing import override

from bench_af._abstract.objects import Detector, Environment, EvalLog, ModelOrganism
import torch

CURRENT_DIRECTORY = Path(__file__).parent


class Poser6Detector(Detector):
    """
    Attentiveness to Oversight detector for identifying alignment-faking models.
    
    Identifies alignment fakers by measuring how much attention they pay to oversight-related 
    information in their input. Uses saliency analysis and attention pattern examination 
    to quantify computational resources devoted to processing security and monitoring 
    information. The hypothesis is that alignment fakers are more sensitive to oversight cues.
    
    Based on Section 3.6 of "Poser: Unmasking Alignment Faking LLMs by Manipulating 
    Their Internals" (Clymer et al., 2024).
    """

    def __init__(self) -> None:
        super().__init__(
            name=CURRENT_DIRECTORY.name,
            supported_model_organisms=set(),
            supported_environments=set(),
        )
        self.activation_cache: dict[str, torch.Tensor] = {}
    
    @override
    def modify_environment(self, environment: Environment) -> None:
        # TODO: implement
        pass
    
    @override
    def modify_model_organism(self, model_organism: ModelOrganism) -> None:
        # TODO: implement
        pass
    
    @override
    def get_prediction(self, eval_logs: list[EvalLog]) -> tuple[float, str]:
        # TODO: implement
        return 0.0, "Example explanation"


def get() -> Detector:
    return Poser6Detector()
