# SLA breach escalation workflow blueprint

```yaml
name: sla-breach-escalation
version: 1.0.0
clock_authority: service_desk
trigger:
  modes: [sla_event, bounded_poll]
input:
  required: [ticket_id, cycle_id, sla_name, deadline, target_revision, cycle_state]
output:
  required: [threshold_state, recovery_owner, next_checkpoint, audit_events]
side_effects:
  allowed: [notify, create_recovery_action, create_breach_review]
  forbidden: [recalculate_deadline, promise_customer_outcome, auto_close_review]
```

## State machine

`observed -> validated -> recoverable_warning -> recovery_recorded -> management_escalation -> recovered|breached -> review_open -> review_closed`

Exit states before action: `paused`, `stopped`, `resolved`, `target_superseded`, `threshold_already_processed`.

## Threshold event contract

```text
alert_key = ticket_id + cycle_id + threshold_id + target_revision
precondition = source_state == running && ticket_open && deadline_current
effect = notification + recovery_action (atomic outbox)
```

## Recovery response

Allowed states: `on_track`, `needs_capacity`, `dependency_blocked`, `clock_question`. Required: actor, recorded time, next checkpoint, optional dependency owner. Free text cannot replace the state.

## Acceptance tests

1. Weekend/business-hours target uses source deadline unchanged.
2. Paused cycle emits no alert.
3. Stopped or resolved cycle cancels pending action.
4. Changed target revision invalidates the old key.
5. Repeated poll emits one threshold event.
6. Notification retry reuses the key.
7. Missing acknowledged owner routes to duty queue.
8. Owner change redirects only unfulfilled recovery action.
9. Missing response escalates with that reason.
10. Dependency response carries the named dependency owner.
11. Breach creates one review task.
12. Later resolution does not close breach review.
13. Provider failure reaches backup destination after bounded retries.
14. Audit replay distinguishes poll delay, delivery failure and owner delay.
