# Deployment Resolution Workflow

**Status:** Approved target-state baseline  
**Activation:** I6; generalized resolver depth I8.

## Target State

```text
Deployment blocked/failed/degraded
  -> classify failure
  -> preserve last known-good Release/Deployment
  -> deterministic remediation/reconcile if known
  -> still failing?
       -> Resolver agent / human attention according to policy
  -> choose safe resolution:
       retry same Deployment
       correct config/provider issue
       rollback to known-good Release
       forward-fix via normal ChangeSet/Release
  -> verify health
  -> persist resolution + Incident timeline
```

## Failure Classification

- render/template/config error;
- provider authentication/permission/resource failure;
- Kubernetes admission/policy denial;
- insufficient capacity/scheduling/storage/network;
- rollout/image/runtime failure;
- application health failure;
- schema/migration incompatibility;
- provider/network outage;
- external drift/conflicting field ownership;
- unknown failure.

## Safe Resolution Selection

Rollback is not automatic merely because a deployment failed. Resolution evaluates stateful migration compatibility, irreversible external side effects, previous known-good availability and policy. Forward-fix may be safer.

## Deterministic Recipes

Known deployment-untangling scripts/recipes from Overdeck may be ported as reviewed `ResolutionRecipe` mechanics if they fit the new provider/domain boundaries. They must not retain workstation-global assumptions or bypass Deployment identity/audit.

## Agentic Resolver

Resolver is invoked after deterministic known fixes are unavailable/unsuccessful or policy chooses it. Resolver can inspect deployment/evidence/logs and propose code/config/recipe changes within capabilities. Source changes always re-enter normal ChangeSet/Review/Verification/Release path.

## Approval and Authority

Production rollback/destructive actions obey current Policy/Approval. Resolver cannot broaden its own capability or credentials.

## Recovery

A control-plane restart resumes resolution through durable workflow. Kubernetes/provider timeout reconciles observed state before retry. Cleanup failures remain visible Incidents.

## Increment Realization

I6 activates domain-specific deployment resolution and rollback. I8 generalizes incident/resolver/recipe product UX and reusable resolution library. I9 can add enterprise escalation/reliability policy.

## Acceptance

Deployment failure cannot strand the user in provider logs. AWP shows classified cause, current safe state, remediation attempts, exact proposed next action and verified outcome.