README Source History Refs Reviews Compare Notes Search Review guide Prove Codex CI review on the subscription (p37 harness) (#33) 20469b78727242a669088bfa1103e1f7c72d5a64
Oliver Jan Krylow <oliver@bugabinga.net > · 21 Jul 2026
SSH signature · not checked
Browse files Compare with HEAD
## What forced this
You chose Codex at both depths. The CI-reviewer depth can't be trusted
until its subscription auth in CI is proven — the same discipline p35
applied to Claude, since a metered OpenAI key is off the table.
## The call
A disposable harness (`p37`) that installs the Codex CLI + the official
`openai/codex-action@v1`, restores the ChatGPT `auth.json` from a
secret, and runs a trivial `codex exec` — every step
`continue-on-error`, so the run's log is the evidence.
## What we deliberately didn't do
Didn't wire `adw-codex-review.yml` yet — this prices and proves the path
first. It also does not touch the merge-gate (Codex review stays
advisory, per PR #31).
## Evidence
OpenAI's docs already surface two costs: `auth.json` goes stale ~every 8
days (a standing refresh burden), and headless runs share the ChatGPT
plan's 5-hour window (a per-PR reviewer competes with your own Codex
use). The harness confirms install + pins the exact auth requirement;
the auth half needs the `CODEX_AUTH_JSON` secret.
## Surface touched
`prototypes/p37-codex-review/` +
`.github/workflows/p37-codex-harness.yml`.
## If this ages badly
Delete the prototype and ship the contributor path only (#32); nothing
depends on it.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01LABEHeVpg74oyZNtWLUWpB)_
---------
Co-authored-by: Claude <noreply@anthropic.com> Changed files (2) Diff layout Auto Unified Split
.github/workflows/p37-codex-harness.yml Added new file mode 100644+76 / −0 text lines
6 + name : p37-codex-harness 10 + branches : ["claude/**" ]12 + - "prototypes/p37-codex-review/**" 13 + - ".github/workflows/p37-codex-harness.yml" 14 + workflow_dispatch : {}21 + runs-on : ubuntu-latest 23 + - uses : actions/checkout@v4 25 + - name : Install the Codex CLI 26 + continue-on-error : true 28 + npm install -g @openai/codex 29 + codex --version || echo "::warning::codex --version failed" 33 + - name : Restore ChatGPT subscription auth 34 + continue-on-error : true 36 + CODEX_AUTH_JSON : ${{ secrets.CODEX_AUTH_JSON }} 38 + mkdir -p "$HOME/.codex" 39 + if [ -n "$CODEX_AUTH_JSON" ]; then 40 + printf '%s' "$CODEX_AUTH_JSON" > "$HOME/.codex/auth.json" 41 + echo "auth.json restored ($(wc -c < "$HOME/.codex/auth.json") bytes)" 43 + echo "::warning::CODEX_AUTH_JSON secret absent — the exec below reveals the auth requirement (that IS the evidence)" 46 + - name : Codex exec — capture the JSONL stream 47 + continue-on-error : true 50 + codex exec --json --ephemeral "Reply with exactly: CODEX-HARNESS-OK" \ 51 + > codex.jsonl 2> codex.err 52 + echo "codex exec exit=$?" 53 + echo "::group::raw JSONL (last 80 lines)"; tail -80 codex.jsonl 2>/dev/null; echo "::endgroup::" 54 + echo "::group::stderr"; cat codex.err 2>/dev/null; echo "::endgroup::" 60 + - name : Report model, token cost, and 5-hour window usage 61 + continue-on-error : true 63 + echo "### resolved model" 64 + jq -rs '[.. | objects | (.model? // empty)] | map(select(. != "")) | last // "not found in stream"' codex.jsonl 2>/dev/null || echo "n/a" 65 + echo "### token usage (this one review)" 66 + jq -c '.. | objects | select(has("usage") or has("input_tokens") or has("total_tokens") or has("token_count"))' codex.jsonl 2>/dev/null | tail -3 || echo "n/a" 67 + echo "### rate limits / 5-hour window cost" 68 + jq -c '.. | objects | select(has("rate_limits") or has("used_percent") or has("primary_used_percent") or has("resets_in_seconds") or has("window_minutes"))' codex.jsonl 2>/dev/null | tail -5 || echo "n/a" 69 + echo "### keyword fallback (raw)" 70 + grep -ioE '"[a-z_]*(rate_limit|used_percent|resets|window|remaining|quota|tokens?)[a-z_]*"[^,}]*' codex.jsonl codex.err 2>/dev/null | sort -u | head -40 || echo "(no quota/token keywords surfaced)" 72 + - name : Official action — the production path 73 + continue-on-error : true 74 + uses : openai/codex-action@v1 76 + prompt : "Reply with exactly: CODEX-HARNESS-OK" prototypes/p37-codex-review/PLAN.md Added new file mode 100644+57 / −0 text lines
1 + # p37 — Codex as a CI reviewer on the ChatGPT subscription 3 + Proves the mechanics the **cross-family CI reviewer** rides on (AGENTIC-DEVELOPMENT4 + → *Cross-family review*), which no local check can settle: can Codex run inside5 + GitHub Actions authenticated by the owner's **ChatGPT subscription** — not a6 + metered OpenAI API key — and post a review? Mirrors p35's proof for Claude.8 + The harness is `.github/workflows/p37-codex-harness.yml`, push-triggered on this9 + branch and path-scoped. Every step is `continue-on-error`, so the run completes and10 + the logs are the evidence — a missing-auth or wrong-flag error *is* the finding.13 + blocked — needs the owner secret to complete the auth half (install/invocation16 + ## Proved (from OpenAI's docs, to be confirmed by the run) 17 + - There is an official **`openai/codex-action@v1`** (the Codex analog of18 + `claude-code-action`) that installs the CLI and runs `codex exec`.19 + - Non-interactive form is `codex exec --json --ephemeral` (JSONL to stdout, no20 + session files) — suitable for a CI reviewer.21 + - Subscription auth in CI **is** possible: restore the ChatGPT-login `auth.json`22 + from a secret before the run.24 + ## Disproved / cautions (the two costs that shape the decision) 25 + - **`auth.json` goes stale ~every 8 days.** A CI reviewer would need the secret26 + refreshed and persisted back on a cadence — a standing maintenance burden that27 + cuts against "autonomous with near-zero owner input."28 + - **Headless runs draw from the ChatGPT plan's shared 5-hour rolling window.** A29 + reviewer firing on every PR competes with the owner's own interactive Codex use30 + and can exhaust it. This is the load-bearing reason to keep Codex review31 + **advisory and rate-limited**, and the contributor path (Codex opens PRs the ADW32 + reviews) more attractive since it doesn't add per-PR CI cost.35 + - None against `docs/SPEC.md` (this validates the ADW's cross-family-review plan).37 + ## Prototype Artifacts 38 + - `.github/workflows/p37-codex-harness.yml`39 + - `prototypes/p37-codex-review/PLAN.md`42 + - Push this branch (or `workflow_dispatch`) to run the harness; read the run log.43 + - Owner precondition for the auth half: `codex login` locally, then add the44 + contents of `~/.codex/auth.json` as the repo secret **`CODEX_AUTH_JSON`**.45 + - The harness prints, per single review: the **resolved model**, the **token46 + usage**, and the **5-hour-window cost** (rate-limit `used_percent` / reset), so47 + the owner can price a cadence before wiring `adw-codex-review.yml`.50 + - Owner: add `CODEX_AUTH_JSON` and re-run to confirm `codex exec` returns51 + `CODEX-HARNESS-OK` on subscription auth, and which of the CLI vs52 + `openai/codex-action@v1` path is cleaner.53 + - If it passes and the owner accepts the refresh + shared-window costs, add54 + `adw-codex-review.yml` (advisory, on `pull_request`, rate-limited), feeding the55 + reviewers per PR #31 — never a gate label.56 + - If the costs aren't worth it, ship the **contributor** path only (issue #32) and57 + delete this prototype. Disposable evidence (SPEC §18).