Agentic Workflow

Reviewer feedback loop

Treat Codex / CodeRabbit comments as failed tests. The agent re-enters the loop until reviews are clean.

External reviewers (Codex, CodeRabbit) post inline comments after every push, not just on initial PR open. Treating their comments as advisory means real bugs slip through. The loop below treats each unaddressed P1 / P2 as a failed test and re-enters the editor stage automatically.

The poll

After every git push, the Reviewer-feedback agent runs:

gh api repos/{org}/{repo}/pulls/{n}/comments

The response is a list of inline comments, each carrying:

The agent classifies each comment by severity (regex on common reviewer formats — **P1**, 🚨, Critical, etc.) and persists them into the PR's status object.

Severity → action

Severity Action
P1 Hard block. Re-enter Editor with the comment as input. Resolve before merging — never argue down.
P2 Soft block. Re-enter Editor unless the agent has a justified counter-argument committed to the PR description.
P3 Acknowledge in the PR description; do not block.
Style / nit Acknowledge silently in the PR description; do not block.

The agent argues down via a comment like:

Reviewer raised "X may regress under high concurrency". The relevant code path is single-threaded by request scope; concurrency cannot trigger this path. Not changing.

If the reviewer responds with a refinement, the loop continues.

Re-entering the editor

When a P1 / P2 lands and the agent decides to fix:

  1. The Reviewer-feedback agent appends the comment as an issue to a scratchpad on the worktree branch.
  2. It re-spawns the Editor with inputs.review_findings = [...] plus the original spec.
  3. The Editor's iteration loop now has two stop conditions: spec tests pass AND review findings addressed.
  4. After the new commit, the Verifier re-runs and the loop repeats.

Idempotence

The poll is idempotent — comments don't disappear, so re-runs see the same set. The agent tracks "comment id → status" in summary.json so:

When to short-circuit

Two cases where the loop deliberately exits without addressing a comment:

  1. Stale comment — the file or line no longer exists after a refactor. The agent posts a "no longer applicable" reply and moves on.
  2. Out of scope — the comment refers to behaviour outside this PR's spec. The agent files a follow-up plan in wiki/plans/ and replies with a link.

Both require committing a justification to the PR description so reviewers can see the exit reasoning.

Why this is non-optional

Standing memory rules:

Both pre-date this section but are the same shape: external-reviewer bots can fail silently if you don't poll, and parallel merges can race past the "required check" gate if you don't wait for the aggregate green. The pipeline encodes both as gates the orchestrator cannot skip.

Cross-references