## What forced this
The environment-approval gate (B) was anti-autonomy — a click before
every Codex run isn't an agentic cycle — and left Codex a hobbled
advisory add-on. The credential machinery was disproportionate for a
rotatable sub-token on an advisory job. And the reviewers were posting
essays.
## The call
- **Gate the trigger, not the run.** Codex reviews run on trusted-author
PRs only (owner/member/collaborator), autonomously — never on an
untrusted external diff, which removes the exfil premise without an
approval. Review workflow drops ~140 → ~54 lines (no environment /
rolling-cache / snapshot / fail-closed machinery).
- **Codex builds now.** Label an issue `codex` → it implements one slice
and opens a PR that rides the same Fable-review + merge-gate as any
builder. Mix-and-match with Claude per issue.
- **Terse agents.** A CLAUDE.md output-discipline rule every agent
inherits (one-line findings, no preamble, a clean pass is one line) +
tightened review prompts.
## What we deliberately didn't do
Dropped B (per-run environment approval) — kept as the escalation option
in #45 if the threat model ever tightens. Didn't keep the
fail-closed/rolling-cache machinery — the author gate makes it
disproportionate.
## Surface touched
`adw-codex-review.yml` (rewritten), `adw-codex-build.yml` (new),
`adw-review.yml` (prompts), `labels.yml` (`codex`), `CLAUDE.md`,
`AGENTIC-DEVELOPMENT.md`.
## If this ages badly
If an external contributor's PR ever needs Codex, add them as a
collaborator or escalate to B (#45). If Codex builds go sideways, remove
the `codex` label route; review still gates every PR.
---------
Co-authored-by: Claude <noreply@anthropic.com>
3129Never approve on unproven confidence: if you can't tell, say so and request theNever approve on unproven confidence: if you can't tell, say so and request the
3231Default to suspicion: an unverified concern is reported, never dropped. NeverDefault to suspicion: an unverified concern is reported, never dropped. Never
14143. Classify (`type:bug|task|question`) and size (`size:s|m|l`).3. Classify (`type:bug|task|question`) and size (`size:s|m|l`).
15154. Anchor it to the SPEC section or plan item it touches. If it needs the spec4. Anchor it to the SPEC section or plan item it touches. If it needs the spec
1616 to change, label `needs:spec` and stop — that is the owner's, via `/smith`. to change, label `needs:spec` and stop — that is the owner's, via `/smith`.
17-5. Gate readiness: unambiguous and spec-covered → `ready`; otherwise
19-6. File it into the **current** milestone if it fits the wave; otherwise leave it
17+5. Gate readiness: unambiguous and spec-covered → **route it to a builder**
18+ (step 6); otherwise `needs:info` with one specific question.
19+6. **Route the build — your judgment.** Pick who implements a buildable issue:
20+ `ready` for the Claude builder, or `codex` for the Codex builder. Codex is a
21+ cross-family builder; send it self-contained, well-specified slices and keep a
22+ healthy mix so both models stay exercised. Apply **exactly one** of
23+ `ready`/`codex`, never both — they are the routing fork.
24+7. File it into the **current** milestone if it fits the wave; otherwise leave it
2025 unmilestoned for `planner`. Never create a milestone — that is `planner`'s unmilestoned for `planner`. Never create a milestone — that is `planner`'s
2126 alone. Place the card on the board. alone. Place the card on the board.
58+ # workspace-write: Codex may edit the checkout; still no network beyond
59+ # its own API. Terse — it's building, not narrating.
60+ codex exec --sandbox workspace-write "Implement issue #${ISSUE} of ${REPO}. Read AGENTS.md and docs/SPEC.md; build ONE focused, tested slice per the walking-skeleton discipline; no unrequested extras. Do not merge or edit the spec. Issue title: ${TITLE}
81- # `codex exec --json` is the exact non-interactive form OpenAI documents
82- # for CI — no `--ephemeral` (not a valid exec flag; it made codex error
83- # out and read as "unavailable"). auth is picked up from $CODEX_HOME.
84- codex exec --json "You are smith's cross-family reviewer (read AGENTS.md). Give an independent, file-anchored review of this pull request diff — correctness, security (untrusted Lua plugins, secrets, injection), and fit against docs/SPEC.md — flagging what a same-family reviewer might rationalize away. Concise markdown. Diff follows:
48+ codex exec --sandbox read-only "Cross-family review of this PR diff (read AGENTS.md for repo rules). Be terse: real, file-anchored findings only, most severe first, one line each. No preamble, no praise, no restating the diff. If nothing material, reply exactly 'No blocking findings.' Diff:
100100PRs follow `.github/pull_request_template.md`: motivation-first, one line perPRs follow `.github/pull_request_template.md`: motivation-first, one line per
101101section, the surface as an anchor range — the diff is the roster.section, the surface as an anchor range — the diff is the roster.
9797| `triager` | issue opened | triage a raw issue into a labeled, routed, spec-anchored work-order | the **Issue** + board card | Haiku || `triager` | issue opened | triage a raw issue into a labeled, routed, spec-anchored work-order | the **Issue** + board card | Haiku |
9898| `planner` | spec change lands on `main` | turn the spec diff into tracked work-orders + refresh the plan | **Issues** + `docs/plans/*` | Opus || `planner` | spec change lands on `main` | turn the spec diff into tracked work-orders + refresh the plan | **Issues** + `docs/plans/*` | Opus |
9999| `builder` | issue labeled `ready` | build one slice per `WALKING-SKELETON`, hardened, tested | a **branch + PR** | Sonnet || `builder` | issue labeled `ready` | build one slice per `WALKING-SKELETON`, hardened, tested | a **branch + PR** | Sonnet |
100-| `reviewer` | `pull_request` | adversarial correctness review vs the spec — a *second* model | a **PR review** | Fable |
101-| `security-reviewer` | PR on sensitive surface / `needs:security` / scanner alert | security review; escalate high severity | a **PR review** + `risk:*` | Fable |
100+| `reviewer` | `pull_request` | adversarial correctness review vs the spec — a *second* model | a **PR review** | Opus |
101+| `security-reviewer` | PR on sensitive surface / `needs:security` / scanner alert | security review; escalate high severity | a **PR review** + `risk:*` | Opus |
102102| `docs-writer` | merged PR changes user-facing / SDK behavior | keep user + plugin-author docs and the site true to the product | doc sources + Pages, via **PR** | Sonnet || `docs-writer` | merged PR changes user-facing / SDK behavior | keep user + plugin-author docs and the site true to the product | doc sources + Pages, via **PR** | Sonnet |
103103| `dependency-manager` | Dependabot bump PR | shepherd version bumps through the gates; escalate risky ones | **Dependabot PRs** | Sonnet || `dependency-manager` | Dependabot bump PR | shepherd version bumps through the gates; escalate risky ones | **Dependabot PRs** | Sonnet |
104104| `release-manager` | milestone green / `v*` tag | draft notes, verify the §14 matrix, publish the Release | a **GitHub Release** | Sonnet || `release-manager` | milestone green / `v*` tag | draft notes, verify the §14 matrix, publish the Release | a **GitHub Release** | Sonnet |
106106| `adw-doctor` | `schedule` (weekly) | diagnose the *workflow's own* health — failing/drifting workflows, doc-vs-config drift, gate pathologies — and propose one systemic fix | a **PR** on ADW config, or an **Issue** | Opus || `adw-doctor` | `schedule` (weekly) | diagnose the *workflow's own* health — failing/drifting workflows, doc-vs-config drift, gate pathologies — and propose one systemic fix | a **PR** on ADW config, or an **Issue** | Opus |
107107| `pioneer` (skill) | `needs:prototype` | prove/disprove an unproven spec claim with a prototype | `prototypes/*` | Sonnet || `pioneer` (skill) | `needs:prototype` | prove/disprove an unproven spec claim with a prototype | `prototypes/*` | Sonnet |
108-| `codex` (OpenAI) | `pull_request` (non-draft) | cross-family review — an independent second opinion from a *different model family* | a **PR comment** + `codex-reviewed` | Codex (ChatGPT sub) |
108+| `codex` (OpenAI) | `pull_request` (trusted author) **reviews**; issue labeled `codex` **builds** | cross-family second opinion, and a foreign-model builder | a **PR comment** (review) or a **branch + PR** (build) | Codex (ChatGPT sub) |
121121The **authority** for each model and tool scope is the agent's frontmatter — theThe **authority** for each model and tool scope is the agent's frontmatter — the
122122`.claude/agents/` directory is the one place to review and change them; a`.claude/agents/` directory is the one place to review and change them; a
138138| judgment | Opus | `think hard` | `surveyor`, `planner`, `adw-doctor` | plan the build and heal the machine — one wrong call ripples || judgment | Opus | `think hard` | `surveyor`, `planner`, `adw-doctor` | plan the build and heal the machine — one wrong call ripples |
139-| **mission-critical** | **Fable** | **`ultrathink`** | `reviewer`, `security-reviewer` | the two autonomous gates into `main`; a wrong approve merges a defect or a sandbox escape with no human in the loop |
139+| **gates** | Opus | `think` | `reviewer`, `security-reviewer` | the two autonomous gates into `main`; a *different* model than the Sonnet builder so review stays a second opinion |
328320 `builder`, `reviewer`, and `security-reviewer` are one GitHub identity (the `builder`, `reviewer`, and `security-reviewer` are one GitHub identity (the
329321 App), and GitHub forbids approving your own PR, so a required *approval* could App), and GitHub forbids approving your own PR, so a required *approval* could
330322 never be satisfied by an agent. A required *check* driven by a label has no such never be satisfied by an agent. A required *check* driven by a label has no such
331- problem: the review produces `reviewed`, the security review `security-cleared`,
332- and `merge-gate` turns green. The **label-write is deterministic, not the LLM's**
333- (issue #19): the reviewer agent ends its PR comment with a marker line
334- (`ADW-VERDICT: approve`), and a no-LLM step in the same job reads that marker
335- and applies the label with the App token — trusting only the review App's own
336- comments from this run's window, so neither a public-repo stranger's comment
337- nor a stale prior run can spoof a verdict. So on the label surface the model's
338- reach is the marker word for the PR under review — it cannot set an arbitrary
339- label or forge a verdict; `gh pr edit` is not in its allow-list. (It keeps
340- `gh pr comment` + the App token, so commenting reach is unchanged — this closes
342329 `required_approving_review_count` stays `0`; the `required_approving_review_count` stays `0`; the
343330 code-owner rule still forces a **human** approval on CODEOWNERS paths (spec, code-owner rule still forces a **human** approval on CODEOWNERS paths (spec,
344331 workflows, agents, invariants) — touchpoints 1 and 3 — where the author is the workflows, agents, invariants) — touchpoints 1 and 3 — where the author is the
347334 waits for the owner. Same for a changes-requested review: `reviewed` is absent, waits for the owner. Same for a changes-requested review: `reviewed` is absent,
348335 the gate stays red, and the PR waits for the revision that adds it back. the gate stays red, and the PR waits for the revision that adds it back.
352341auto-merge** (repo setting) and importing the ruleset with `merge-gate` requiredauto-merge** (repo setting) and importing the ruleset with `merge-gate` required
470459Copilot or Codex outage can never deadlock a merge, and no external service becomesCopilot or Codex outage can never deadlock a merge, and no external service becomes
471460load-bearing for landing code. They enrich the judgment; they don't hold the key.load-bearing for landing code. They enrich the judgment; they don't hold the key.
473475Two owner-added workflows already sit on `main` and the plan wraps around themTwo owner-added workflows already sit on `main` and the plan wraps around them
474476rather than replacing them:rather than replacing them: