Packer destroys its build droplet on a clean finish, but a killed/slept/
network-dropped run leaves the s-8vcpu-16gb-amd builder alive (~$192/mo).
This happened once already (.project/handoffs/20260629_packer-cross-account-leak.md).
Two defense layers:
- scripts/cull-orphan-builders.sh reaps leftover builders by name prefix
(mc-packer-* / legacy packer-*) with a size guard and an optional age guard;
pins the MC token via --access-token.
- cloud-bringup.sh calls it in its EXIT trap, so a failed/Ctrl-C'd build reaps
its own builder.
- infra/launchd/com.uvlava.mc.cull-builders.plist sweeps every 30m with
--min-age-min 90 to catch SIGKILL/power-loss cases no trap can.
golden-image.pkr.hcl names the builder mc-packer-<ts> for deterministic matching.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>