iCode Workbench · Blog · Review
The review gate: what to check before merging an agent's work
Two tasks complete at the same time. One is read, tested, and accepted. The other is merged because the task turned green. The difference between those outcomes is not the model. It is the gate.
This essay is currently available in English only.
A green task is not a reviewed task
A task state tells you what the process did. It does not tell you whether the change is good.
In a queue, a task can move through queued, dispatching, running, waiting, completed, failed, and cancelled. “Completed” means the process exited. It does not mean the diff is correct, the tests are meaningful, or the change belongs in main. Treating completion as approval removes the only step that requires judgment.
The review decision has to be separate from process exit. That separation is the gate.
Three artifacts, not one
A reviewer needs three things, and most agent workflows supply only one.
The task statement is the contract.
It says what the change is supposed to do, what must stay true, and what is out of scope. Without it, the reviewer is judging the diff against their own guess about the goal.
The diff is the behavior.
It is the change against the baseline the task started from — not against the agent's summary, and not against an unrelated branch. The diff is where scope drift, shared-file edits, and accidental behavior changes show up.
Verification is the proof.
A command and its output, run by the reviewer. A test that passed in the agent's shell is evidence. A test that passes in your shell is proof. If you did not run it, you are trusting a summary.
Missing any one of the three turns review into guessing.
Read the diff before the summary
The summary describes what the agent intended. The diff describes what it did. Those are not always the same thing.
Start with the diff stat, then the files the task owned, then the files it touched anyway. A one-line fix that changes forty files is a red flag. A task that stays inside its owned paths is not automatically safe, but it is easier to review.
Look for the quiet changes: a renamed export, a changed default, a new dependency, a migration, a config flag, a test that was weakened rather than fixed. None of these need to be malicious to be dangerous. They are the normal residue of an agent solving the task in front of it.
A concrete failure
Consider two tasks running in parallel.
Task A fixes a failing test in src/report/builder.ts. To make the test pass, it also updates a shared fixture in tests/fixtures/report.ts. Task B refactors the report formatter and relies on the same fixture. Both tasks pass in their own worktrees. Both agents report success.
Merged together, A's fixture change breaks B's expected output. The combined suite fails. Neither agent did anything unreasonable; each solved the task in front of it. The gate catches the problem because the reviewer sees the shared fixture outside A's owned paths and runs the combined result before merging. The queue alone does not.
Five checks
- Scope drift. Compare the touched files to the owned paths. Pay special attention to shared registration files: route tables, export lists, dependency manifests, migration directories, shared types, and test fixtures used by more than one task. These are where two independently green branches collide at merge time.
- Shared contracts. If the task changes an API schema, a route table, a public type, or a migration, check the consumers. A branch can pass its own tests and still break another branch that was written against the old contract. The combined result is the thing that ships, not each branch alone.
- Tests actually run. Read the verification command, not just the word “passing.” Did the agent run the full suite or one file? Did it skip the integration tests? Did it change the test to match the new behavior? Run the command yourself. If it is slow, that is a review-capacity problem, not a reason to skip it.
- Error handling and edge cases. Agents are good at the happy path. Check the failure path: empty input, missing permissions, a timeout, a partial write, a retry, a cancelled task. Check whether the change introduces an unhandled rejection, a swallowed error, or a log that will page someone at 3 a.m. These are the defects that green tests miss.
- Rollback and merge risk. Can you revert the change cleanly? Is it mixed with unrelated edits? Does it require a migration, a config change, or a coordinated deploy? If the answer is “we would have to fix forward,” the review needs to be stronger, not faster.
Line notes, not chat
A paragraph in chat is easy to lose. A note attached to a line is not.
Use line notes for the things that need another pass: “this changes behavior for anonymous users,” “this should handle a null response,” “why this approach instead of the existing helper?” A line note gives the agent a precise target and gives the next reviewer a record of what was questioned.
Keep the decision summary separate from the notes. The notes are the work; the decision is the outcome. Mixing them produces a chat log that nobody can reconstruct a week later.
The decision is separate from exit
There are four useful decisions:
- Accept. The change is reviewed and belongs in the branch. This records judgment; it does not merge, push, or delete anything.
- Reject. The change should not land. Record why, so the next attempt does not repeat it.
- Retry. A new attempt, not an erasure of the failed one. The previous attempt stays in the record.
- Amend. A small correction before accepting. The reviewer should still see the amended diff.
“Completed” is not one of those decisions. Neither is “tests passed.” If a task turns green and auto-merges, the gate is decorative.
A useful test: if the reviewer cannot say what they checked and what they decided in two sentences, the review did not happen. “LGTM” after a green task is not a review; it is a handoff with extra steps.
Record the review
A review record is not the chat log. It should answer, in a few lines:
- What was the task?
- Which files were reviewed?
- Which checks ran, and what did they return?
- What was decided, and why?
- Which commit contains the accepted change?
- Who reviewed it, and when?
That record is what makes a fleet auditable. If you cannot reconstruct why a change was accepted three weeks later, the gate was a feeling.
Review capacity is the bottleneck
Parallel agents multiply diffs. If one person reviews them, adding agents moves the queue; it does not increase throughput. The queue gets longer, the review gets faster, and the gate gets weaker.
The concurrency limit that matters is not the number of agent slots. It is the number of diffs a reviewer can read with attention. A queue with four slots and one reviewer is a one-reviewer system. Cap the work in progress to the review capacity, not to the machine's capacity.
Review debt compounds like technical debt. A queue that is always full of unreviewed diffs is not a productivity system; it is a backlog with better colors.
How Workbench supports the gate
Workbench puts the review where the work happened. Files, Search, and Source Control share the session checkout, and the diff is against the task's baseline. A reviewer can leave line notes, stage changes, inspect inline diffs, and commit, amend, push, cherry-pick, revert, or reset.
The review decision is separate from process exit. Accepting records the judgment; it does not merge, push, or delete anything. A retry is a new attempt, and a completed task can still be rejected.
Mira can read the real queue and record a non-binding review recommendation, but she cannot decide a review, approve a proposal, merge, push, or edit project code. The judgment stays with the person.
That division is the point. A tool can make the diff easier to read and the decision easier to record. It cannot make the decision for you.
Monday checklist
- Read the diff before the summary.
- Check the owned paths, then the files the agent touched anyway.
- Run the verification command yourself.
- Leave line notes for anything that needs another pass.
- Record the decision separately from completion.
- Cap work in progress to review capacity, not agent slots.
The fleet can run in parallel. The gate cannot.