#!/usr/bin/env bash set -euo pipefail # Codex comparative readiness entrypoint. # A real comparative run requires a local `codex` CLI. When unavailable, this # writes a scoreable readiness report and exits with code 78 (EX_CONFIG) so # automation can distinguish "not installed" from a failed benchmark. output="evals/reports/2026-05-25-codex-comparative-readiness.yaml" if [[ "${1:-}" == "--output" ]]; then output="${2:?--output requires a path}" fi mkdir -p "$(dirname "$output")" find_codex() { if command -v codex >/dev/null 2>&1; then command -v codex return 0 fi local candidate for candidate in \ "$HOME/.nvm"/versions/node/*/bin/codex \ "$(npm prefix -g 2>/dev/null || true)/bin/codex" \ /usr/local/bin/codex \ /opt/homebrew/bin/codex do if [[ -x "$candidate" ]]; then printf '%s\n' "$candidate" return 0 fi done return 1 } write_report() { local available="$1" local note="$2" local availability_evidence="$3" cat > "$output" <&2 exit 78 fi codex_version="$("$codex_bin" --version)" write_report "true" "Codex CLI is installed (${codex_version}), but the full comparative parity suite still requires the two-run benchmark gate." "codex --version: ${codex_version}" append_smoke_if_present echo "$codex_version" echo "codex CLI is available; full comparative task runner is not enabled in this rollout."