""" EscalationResult — output contract for Phase 11's NGO escalation service. Consumed by: Phase 12 for simulation context Phase 13 agent trace log (ngos_alerted field) Mobile agent-trace timeline (escalation step) """ from __future__ import annotations from pydantic import BaseModel, ConfigDict class EscalationResult(BaseModel): """Outcome of the NGO escalation evaluation for a confirmed crisis. Attributes: escalated: True iff at least one NGO FCM notification was sent. reason: One sentence explaining why escalation did or did not fire. Rendered in the agent-trace UI. ngos_alerted: Names of NGOs that received a push notification. Empty when escalated=False. severity_score: The SituationReport.severity value evaluated against the threshold. threshold_used: The NGO_ESCALATION_THRESHOLD constant in effect when this result was produced. """ model_config = ConfigDict(frozen=True, extra="forbid") escalated: bool reason: str ngos_alerted: list[str] severity_score: int threshold_used: int