Description:
The dashboard needs to colour-code alerts by confidence level but the frontend
shouldn't duplicate the threshold logic. Add a confidence_tier computed
property to ReasoningResult:
@property
def confidence_tier(self) -> Literal["high", "medium", "low"]:
if self.confidence >= 0.75: return "high"
if self.confidence >= 0.50: return "medium"
return "low"
And a is_actionable property: label == "Suspicious" and confidence >= 0.65.
Files to touch:
libs/schemas/reasoning.py
tests/test_reasoning_schema.py (create)
Acceptance criteria:
---
Description: The dashboard needs to colour-code alerts by confidence level but the frontend shouldn't duplicate the threshold logic. Add a
confidence_tiercomputed property toReasoningResult:And a
is_actionableproperty:label == "Suspicious" and confidence >= 0.65.Files to touch:
libs/schemas/reasoning.pytests/test_reasoning_schema.py(create)Acceptance criteria:
is_actionabletested:Trueonly when label = Suspicious AND conf ≥ 0.65model_dump(mode="json")is called---