File size: 547 Bytes
33dd3ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Terminal grader — delegates to the scenario's grade_resolution method."""


def normalize_service_name(name: str) -> str:
    """Normalize an affected_service string for comparison."""
    return name.lower().strip().replace("_", "-")


def grade(scenario, resolution: dict, step_count: int) -> dict:
    """Grade a resolution using the scenario's grading logic.

    Returns dict with keys: score (float 0-1), root_cause_correct (bool),
    recommendation_correct (bool).
    """
    return scenario.grade_resolution(resolution, step_count)