#!/usr/bin/env bash set -euo pipefail root="$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)" canary="$root/deploy/run-production-canary.sh" supervisor="$root/deploy/update-supervisor.sh" candidate_compose="$root/deploy/docker-compose.candidate-slot.yml" stable_compose="$root/deploy/docker-compose.prod.yml" stable_updater="$root/deploy/production-stable-updater.sh" grep -Fq 'CANDIDATE_PROJECT="${CANDIDATE_PROJECT:-assistant-slot-$SLOT}"' "$canary" grep -Fq '[[ "$CANDIDATE_PROJECT" != "$STABLE_PROJECT" ]]' "$canary" grep -Fq 'docker compose -p "$CANDIDATE_PROJECT"' "$canary" grep -Fq 'up -d --no-build --no-deps research-runtime core-runtime' "$canary" grep -Fq 'up -d --no-build --no-deps cognitive-worker' "$canary" grep -Fq 'up -d --no-build --no-deps creator-web' "$canary" grep -Fq 'compose up -d --no-build --no-deps supervisor' "$supervisor" grep -Fq 'stable_ids_before=$(stable_ids)' "$canary" grep -Fq 'assert_stable_ids_unchanged' "$canary" grep -Fq 'before=$(stable_ids)' "$supervisor" grep -Fq 'after=$(stable_ids)' "$supervisor" grep -Fq 'stable container IDs changed' "$supervisor" grep -Fq 'HEALTH_ATTEMPTS="${HEALTH_ATTEMPTS:-360}"' "$canary" grep -Fq 'seq 1 "$HEALTH_ATTEMPTS"' "$canary" grep -Fq 'PROMOTE_AFTER_CANARY="${PROMOTE_AFTER_CANARY:-true}"' "$canary" grep -Fq 'if [[ "$PROMOTE_AFTER_CANARY" != true ]]' "$canary" grep -Fq 'name: assistant_default' "$candidate_compose" grep -Fq 'external: true' "$candidate_compose" ! grep -Fq 'candidate:' "$stable_compose" ! grep -Fq 'run-production-canary.sh' "$stable_updater" grep -Fq 'compose up -d --no-build "${stable_services[@]}"' "$stable_updater" echo 'stable release-set guard: PASS'