# OSHUN Studio Data Retention and Lifecycle Controls Runbook

Status: Active  
Owner: OSHUN Studio Architecture + OSHUN Data Platform + OSHUN Security and
Compliance + OSHUN Web + OSHUN BFF + Platform SRE + Program Operations  
Last Updated: 2026-02-23  
Related:

- `docs/adr/ADR-0050-oshun-studio-data-retention-and-lifecycle-controls.md`
- `docs/releases/v1/specs/studio-data-retention-and-lifecycle-controls-dependency-and-data-contract-map.md`
- `docs/releases/v1/specs/studio-data-retention-and-lifecycle-controls-user-journeys-and-edge-cases.md`
- `apps/oshun/web/src/components/studio/StudioDataRetentionLifecycleControlsWorkspace.tsx`
- `apps/oshun/web/src/analytics/studioDataRetentionLifecycleControlsTelemetry.ts`

## Purpose

Define operational ownership, SLOs, incident playbooks, and escalation paths for
Studio retention and lifecycle control workflows.

This document is the execution artifact for `OST-00304`.

## 1. Ownership Model

| Surface                                      | Primary Owner              | Backup Owner        | Dependencies                                          |
| -------------------------------------------- | -------------------------- | ------------------- | ----------------------------------------------------- |
| Retention/lifecycle workspace route          | OSHUN Web                  | Platform Web        | workflow UX orchestration + operational context       |
| Retention policy registry and schema control | Data Platform + Compliance | Studio Architecture | policy schema/version governance + ownership metadata |
| Lifecycle transition orchestration           | OSHUN BFF + Data Platform  | Platform SRE        | state transition controls + lineage metadata          |
| Legal hold and release governance            | Compliance + Security      | Program Operations  | case workflows + approval evidence                    |
| Purge planning and execution pipeline        | Data Platform + SRE        | Security            | purge workers + verification telemetry + rollback     |
| Telemetry and governance audit continuity    | Data Platform + Security   | Platform SRE        | analytics sinks + retention/export + replay controls  |

## 2. Core SLOs

| Metric                                         | Target    | Alert Threshold      |
| ---------------------------------------------- | --------- | -------------------- |
| Retention/lifecycle flow success rate          | >= 99.0%  | < 98.0% over 15 min  |
| Policy schema and publish integrity            | >= 99.5%  | < 99.0% over 15 min  |
| Lifecycle/purge/recovery flow p95              | <= 2500ms | > 3500ms over 15 min |
| Legal hold apply/release correctness           | >= 99.5%  | < 99.0% over 15 min  |
| Policy-tier/CAB/waiver enforcement correctness | >= 99.5%  | < 99.0% over 15 min  |
| Purge residue verification closure determinism | >= 99.5%  | < 99.0% over 15 min  |
| Telemetry/audit event delivery continuity      | >= 99.5%  | < 99.0% over 15 min  |

## 3. Operational Playbooks

### 3.1 Retention Policy Publish Failures

Trigger: repeated `RETENTION_POLICY_BASELINE_FAILED` outcomes.

Actions:

1. Validate policy identity (`policyId`, `policyVersion`, `dataClass`,
   `retentionDays`, `archivalTier`).
2. Inspect schema-compatibility and owner-attribution drift.
3. Re-run policy publish in preview with diagnostics enabled.
4. Block lifecycle transitions dependent on invalid policy versions.

### 3.2 Dataset Lifecycle Transition Failures

Trigger: repeated `RETENTION_LIFECYCLE_TRANSITION_FAILED` outcomes.

Actions:

1. Validate dataset lineage (`datasetId`, `sourceDomain`, `policyId`,
   `lifecycleState`).
2. Inspect transition precondition and state-machine drift.
3. Re-run transition under bounded, policy-aware conditions.
4. Escalate to BFF/Data Platform on sustained transition regressions.

### 3.3 Legal Hold Apply/Release Failures

Trigger: repeated `RETENTION_LEGAL_HOLD_FAILED` outcomes.

Actions:

1. Validate case reference, approver identity, and hold action metadata.
2. Inspect hold-policy support and release authorization prerequisites.
3. Re-run hold apply/release with compliance oversight.
4. Freeze purge execution for affected datasets until hold integrity recovers.

### 3.4 Purge Verification and Execute Failures

Trigger: repeated `RETENTION_PURGE_VERIFICATION_FAILED` outcomes.

Actions:

1. Validate purge mode, scope, and approval prerequisites.
2. Inspect worker health, residue counts, and verification evidence.
3. Re-run purge in dry-run mode before execute promotion.
4. Hold production purge operations until residue and verification return to
   baseline.

### 3.5 Retention Incident Recovery Failures

Trigger: repeated `RETENTION_RECOVERY_FAILED` outcomes.

Actions:

1. Validate incident state, severity, and remediation action payload.
2. Verify post-fix lifecycle/hold/purge continuity before closure.
3. Re-run recovery flow under incident command oversight.
4. Prevent incident closure until deterministic revalidation is complete.

### 3.6 Telemetry and Audit Degradation

Trigger: missing or delayed `studio_data_retention_lifecycle_controls_*`
telemetry events.

Actions:

1. Validate analytics sink health and ingestion backlog.
2. Enable degraded-observability notice in retention workspace.
3. Replay buffered lifecycle events where replay semantics are supported.
4. Confirm SLO panel and audit-evidence continuity after recovery.

## 4. Release Checklist

- [ ] Validate `/studio/data-retention-lifecycle-controls` renders and executes
      required flows.
- [ ] Validate optimistic, error, and retry behavior across all retention
      lifecycle flows.
- [ ] Validate permission-tier, waiver, and production CAB policy enforcement.
- [ ] Validate telemetry/audit emissions and SLO panel updates.
- [ ] Validate integration/e2e/accessibility/performance evidence artifacts.

## 5. Incident Communication Templates

### Incident Start

```text
[P{severity}] Studio Retention/Lifecycle Incident
Detected: {timestamp}
Impact: {policy-baseline | lifecycle-transition | legal-hold | purge-verification | incident-recovery}
Suspected cause: {policy drift | lifecycle contract regression | hold governance gap | purge worker degradation | telemetry degradation}
Owner: {on-call}
```

### Incident Update

```text
[P{severity}] Studio Retention/Lifecycle Update
Time: {timestamp}
Mitigation: {rollback | policy patch | hold freeze | purge dry-run fallback | release hold}
Affected flows: {defineRetentionPolicyBaseline | bindDatasetLifecycleControl | applyOrReleaseLegalHold | executePurgeVerificationPlan | recoverRetentionLifecycleIncident}
ETA: {time}
```

### Incident Resolved

```text
[P{severity}] Studio Retention/Lifecycle Incident Resolved
Resolved: {timestamp}
Root cause: {description}
Fix: {release/hotfix id}
Validation: {tests + telemetry checks}
Postmortem: {link}
```

## 6. Escalation Paths

| Area                                       | Primary Channel        | Escalate To           |
| ------------------------------------------ | ---------------------- | --------------------- |
| Retention/lifecycle workspace UX           | `#oshun-web`           | Platform on-call      |
| Policy and lifecycle orchestration APIs    | `#oshun-bff`           | BFF lead              |
| Purge worker and data-platform operations  | `#oshun-platform-sre`  | SRE lead              |
| Hold governance and CAB policy enforcement | `#oshun-security`      | Security + Compliance |
| Telemetry and audit reporting continuity   | `#oshun-data-platform` | Data platform lead    |

## 7. Acceptance Criteria (OST-00304)

`OST-00304` is complete only when:

1. Ownership and decision authority are documented.
2. Retention/lifecycle SLOs and alert thresholds are documented.
3. At least five playbooks are documented for major failure modes.
4. Release checklist, communication templates, and escalation paths exist.
