Skip to content

fix(triage_calibration): enum mismatch — expects small/large, SODA uses low/high #346

@decko

Description

@decko

Summary

TriageCalibrationMetric silently skips sessions where triage complexity is low or high because the filter checks for small/medium/large:

if complexity not in ("small", "medium", "large"):
    continue

SODA's triage schema uses low/medium/high:

Complexity string `json:"complexity" jsonschema:"enum=low|medium|high"`

Only medium sessions qualify, artificially deflating the metric. In v0.7.0 (n=6), 4 sessions were excluded — reported calibration was 0.50 (1/2) when the actual calibration is 0.83 (5/6).

Fix

Accept both enum sets in triage_calibration.py:

# Map SODA enum to calibration bands
COMPLEXITY_MAP = {
    "small": "small", "low": "small",
    "medium": "medium",
    "large": "large", "high": "large",
}

Affected file

src/raki/metrics/operational/triage_calibration.py

Impact

All historical SODA sessions with low or high complexity have been excluded from calibration scoring. Fixing this will retroactively correct all past reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions