Spaces:
Sleeping
Sleeping
File size: 830 Bytes
26aeea9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | """Base evaluator interface."""
from abc import ABC, abstractmethod
from typing import Tuple, Dict
class BaseEvaluator(ABC):
"""
Multi-signal evaluator contract.
Each evaluator grades one task across four signal types.
"""
# Signal weights must sum to 1.0
W_EXPLOIT = 0.60 # Primary: did the exploit succeed?
W_PARTIAL = 0.25 # Intermediate: suspicious patterns / partial progress
W_INTEGRITY = 0.15 # System still functional (no crash / invalid state)
@classmethod
@abstractmethod
def evaluate(cls, task) -> Tuple[float, Dict]:
"""
Grade the current task state.
Returns
-------
reward : float – deterministic score in [0.0, 1.0]
signals : dict – {exploit_success, partial_score, integrity_ok, reward}
"""
|