# 8. Remove the session cleanup shell script; gluing lives in the workflow YAML

Status: Accepted

Supersedes [ADR 0005](0005-keep-session-cleanup-script-as-wrapper.md).

## Context

ADR 0005 planned to keep `scripts/cp9-session-cleanup.sh` as a thin wrapper that
mapped legacy `CP9_CLEANUP_*` env to `cp9 purge`. Once the cleanup workflow was
cut over to build `bin/cp9` and call `bin/cp9 purge` directly (ADR 0003), the
only remaining "gluing" was turning the workflow inputs/env into `cp9 purge`
arguments — which the workflow YAML already does inline. No other caller depended
on the script.

## Decision

Remove `scripts/cp9-session-cleanup.sh` entirely. The only gluing logic — mapping
`CP9_CLEANUP_REGION` / `CP9_CLEANUP_OWNER` / `CP9_CLEANUP_SESSION` and the dry-run
flag into `cp9 purge` arguments — lives in the cleanup workflow YAML. Account id,
cleanup role ARN, AWS profile, aws-nuke binary, and wait retries remain operator
environment configuration read directly by `cp9 purge`.

There is intentionally no shell compatibility entrypoint: cleanup is invoked
through the workflow (or by running `cp9 purge` directly).

## Consequences

- One fewer layer; all cleanup behavior is in the Go command and all gluing is in
  the workflow YAML.
- Any out-of-band caller that previously ran the shell script must call
  `cp9 purge` (or dispatch the cleanup workflow) instead.
- The workflow `name` / `run-name` contract is unchanged, so `cp9 destroy` run
  observation is unaffected.
