## What forced this
The interim allow-list (#38) let the review agents call `gh pr edit` to
cast their own verdict — it proved the loop, but left the exact hole #19
named: one App identity, an LLM that can write any label to any PR, and
a merge-gate that trusts label *presence* without knowing who set it.
## The call
Split decision from actuation. The agent reviews, comments, and writes
one word (`approve`/`changes`, `cleared`/`risk-high`) to a temp file; a
no-LLM step in the same job reads it and applies the one corresponding
label with the App token. `gh pr edit` leaves the agent's allow-list
entirely.
## What we deliberately didn't do
Didn't pursue a second GitHub App identity (the heavier #19 option) —
this shrinks the LLM's reach to one token for the PR under review
without new infrastructure. Full label *provenance* verification (gate
checks the applying actor) remains a further step if wanted.
## Evidence
Neither agent's `claude_args` contains `gh pr edit` (only read + comment
+ `echo`/`printf`). A missing/malformed verdict applies no label, so the
gate fails safe to red. Verified end-to-end that the loop closes on #40
under the interim mechanism this replaces.
## Surface touched
`.github/workflows/adw-review.yml` (both jobs) + the merge section of
`docs/plans/AGENTIC-DEVELOPMENT.md`.
## If this ages badly
If the agents unreliably write the verdict file, tighten the prompt or
revert to the #38 allow-list; the deterministic step is additive and
safe to remove.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01LABEHeVpg74oyZNtWLUWpB)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
2931Never 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
3032Default to suspicion: an unverified concern is reported, never dropped. NeverDefault to suspicion: an unverified concern is reported, never dropped. Never
11# ADW review — reviewer (correctness) and security-reviewer (security) run on# ADW review — reviewer (correctness) and security-reviewer (security) run on
22# every PR, in parallel. Both are issue/PR agents → claude-code-action. Verdicts# every PR, in parallel. Both are issue/PR agents → claude-code-action. Verdicts
33# only; neither merges. reviewer runs on a different model than the builder on# only; neither merges. reviewer runs on a different model than the builder on
4-# purpose. Each posts its verdict as a label (`reviewed` / `security-cleared` /
5-# `risk:high`) that the merge-gate reads. Needs secrets APP_ID, APP_PRIVATE_KEY,
328328 `builder`, `reviewer`, and `security-reviewer` are one GitHub identity (the `builder`, `reviewer`, and `security-reviewer` are one GitHub identity (the
329329 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
330330 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
342+ `required_approving_review_count` stays `0`; the
333343 code-owner rule still forces a **human** approval on CODEOWNERS paths (spec, code-owner rule still forces a **human** approval on CODEOWNERS paths (spec,
334344 workflows, agents, invariants) — touchpoints 1 and 3 — where the author is the workflows, agents, invariants) — touchpoints 1 and 3 — where the author is the
335345 App, not the owner, so there is no self-approval there either. App, not the owner, so there is no self-approval there either.
337347 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,
338348 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.
340-Net: the merge is native and deterministic; the LLMs only move labels, and a
341-label can't fake a green check. Two owner enable-steps make it live — **Allow
350+Net: the merge is native and deterministic; the LLMs only emit a one-word
351+verdict and a no-LLM step moves the label, so a model can't fake a green check. Two owner enable-steps make it live — **Allow
342352auto-merge** (repo setting) and importing the ruleset with `merge-gate` requiredauto-merge** (repo setting) and importing the ruleset with `merge-gate` required