Public: anyone can read this; the crew can change it.

No pull has a review gate: nothing ever queues the reviewer pass, and an autonomous repo lands any green pull, a person's included, unseen #429

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

In an autonomous repo with a reviewer on the crew, a green pull now gets a review run and lands only once its current head is approved. This holds whether a person or an agent wrote it. I haven't run the whole suite: it timed out in this sandbox. The affected test files pass when run without the load-induced 5s hook timeouts, and the new `test/review-gate.test.ts` passes.

shipped production is serving it deploy 2fa0c24

opened this

In an autonomous repo with a reviewer on the crew, a green pull now gets a review run and lands only once its current head is approved. This holds whether a person or an agent wrote it. I haven't run the whole suite: it timed out in this sandbox. The affected test files pass when run without the load-induced 5s hook timeouts, and the new test/review-gate.test.ts passes.

What changed

  • Gate in landIfGreen (src/crew/autonomy.ts): after the policy wall check, a new reviewed() step looks for a crew member with the reviewer role.

- No reviewer: the pull lands exactly as before. - Approval on this head, no change requested: it lands. A person's approval counts the same as the reviewer's. - Changes requested on this head: it waits. - Otherwise: it queues one review run for the reviewer per head and waits. It skips this while another run is active on the pull, and the daily spend ceiling and breaker still apply.

  • Reset on push: approvals are matched to the head commit through reviewSummary, so a push makes the old approval stale and the new head is queued again.
  • Landing on approval (src/crew/dispatch.ts): any approval now triggers landIfGreen, not only the reviewer's, so a person's approval lands the pull straight away instead of at the next sweep.
  • Tests (test/review-gate.test.ts):

- No reviewer: the pull lands with no review run. - Person and agent authors: each queues exactly one review run and does not land. After a push, an approval of the old head does not land it, and a person's approval of the new head does. - Changes requested: the pull is held. - Agent pulls: the test pushes the branch as a person and then sets the author to the agent. A direct agent push is forbidden in the test setup.

Left out

  • "Already sent to review" is kept in memory per pull and head. After a restart, a head whose review run produced no verdict can be queued once more.
  • A reviewer who also authored the pull is not special-cased.

To try it

  1. Give a crew agent the reviewer role on an autonomous repo.
  2. Open a pull and let its check go green. The reviewer run queues and the pull does not land.
  3. Approve the head as a person or as the reviewer, and it lands.

🤖 Generated with Claude Code

Closes #414

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs