# ISIS v2 WS09-004: RunPod Warm/Cold Policy Optimization

## Scope

Implemented workload-class + SLA-tier warm/cold policy optimization for RunPod
endpoint desired-state management.

## Implemented Artifacts

- Policy contract:
  - `infra/runpod/endpoints/warm-cold-policy.json`
- Policy apply/check script:
  - `scripts/isis/apply_runpod_warm_cold_policy.mjs`
- Desired-state optimized by policy:
  - `infra/runpod/endpoints/desired-state.json`
- CI/CD preflight gates enforcing policy alignment:
  - `.github/workflows/runpod-endpoint-lifecycle.yml`
  - `.github/workflows/runpod-endpoint-drift-detection.yml`
  - `.github/workflows/runpod-endpoint-reconcile.yml`
  - `.github/workflows/runpod-endpoint-image-build.yml`

## Optimization Model

Policy dimensions:

- Workload class: `interactive-short`, `interactive-medium`, `batch-long`,
  `sequence-long`
- SLA tier: `critical`, `standard`, `economy`
- Warmness profile: `warm`, `balanced`, `cold`

Policy outputs per endpoint/environment:

- `workersMin`
- `workersMax`
- `idleTimeout`

Staging values are automatically scaled down from production policy targets.

## Verification

```bash
node scripts/isis/apply_runpod_warm_cold_policy.mjs --environment all --check
python3 scripts/isis/validate_runpod_desired_state.py --file infra/runpod/endpoints/desired-state.json
```

## Outcome

WS09-004 is now closed with deterministic warm/cold endpoint sizing rules,
SLA-aware policy tiers, and enforced CI preflight validation to prevent
configuration drift.
