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 Poser4Detector(Detector):
    """
    Suspicious Concept Identification detector for identifying alignment-faking models.
    
    Identifies alignment fakers by analyzing their internal representations of security, 
    oversight, and harmful behavior concepts. Searches for activation patterns that 
    correlate with suspicious concepts and compares how strongly each model represents 
    these concepts during inference.
    
    Based on Section 3.4 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 Poser4Detector()
