"""Stub model for testing."""

import random
import hashlib
from typing import Dict, Any

from .base import BaseModel


class StubModel(BaseModel):
    """Stub model that returns deterministic fake decisions."""
    
    def evaluate(self, content: str) -> Dict[str, Any]:
        """Return fake decision based on content hash."""
        # Deterministic based on content + model
        seed_str = f"{content}{self.config.provider}{self.config.model}"
        seed = int(hashlib.sha256(seed_str.encode()).hexdigest()[:8], 16)
        rng = random.Random(seed)
        
        decision = rng.choice([True, False])
        confidence = rng.uniform(0.6, 0.95)
        
        return {
            "decision": decision,
            "confidence": confidence,
            "reasoning": f"[STUB] Decision based on hash seed {seed & 0xFFFF}",
        }
