Reviewer-agent gate: independent adversarial review before a task surfaces to the operator - #128
Open
MJohnson459 wants to merge 2 commits into
Open
Reviewer-agent gate: independent adversarial review before a task surfaces to the operator#128MJohnson459 wants to merge 2 commits into
MJohnson459 wants to merge 2 commits into
Conversation
Every dispatched task landed in review carrying only the writing agent's self-assessment, which shares the session's context and so ratifies its blind spots; the operator was the first independent reader of every diff. The dispatch preamble now mandates a fresh-context reviewer ahead of `voro done`, reading the task body and the branch diff with an adversarial brief, with every finding fixed or rebutted in the completion summary. Prompt text only: Voro launches nothing and records no verdict. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189FtcKxnCe2qCHVb7cwU4v
The gate now renders after the linked-document list rather than before it, so the reviewer is given the plan the body assumes rather than being denied it; names the concrete Claude Code mechanism (the Agent tool) as specifically as the worktree sentence names EnterWorktree; carries the --db flag every other rendered verb carries; orders the commit before the review so the diff is not empty; scopes "one pass" to each done; and says that the summary carrying a rebuttal is the PR body. The assertions read whitespace-flattened text rather than the constant's line wrapping, cover a non-default database, and the placement check moves to a real dispatched prompt, where "ahead of the body" can actually fail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0189FtcKxnCe2qCHVb7cwU4v
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a mandatory adversarial review step to the dispatch prompt, running inside
the dispatched session before the agent may call
voro done. Prompt text only:no state-machine, schema, config, or session-machinery change, and Voro's
posture is untouched — it launches no reviewer, records no verdict, and is still
only told the outcome.
What changed
crates/voro/src/dispatch.rsgainsREVIEW_GATE_TEMPLATE, a named constant witha doc comment beside the branch and document blocks, rendered unconditionally by
render_preambleinto the{review}slot of the return-path preamble — so everydispatch carries it and a redispatch inherits it, with and without an assigned
branch, with and without linked docs. It renders through the single-pass
substituter with its own
{task_id}/{db}bindings, like the branch block, so a{task_id}inside it is filled rather than reaching the agent raw. It sits lastin the preamble, after the document list and ahead of the body separator. The
planning and refine prompts render nothing of it.
The block tells the agent to commit, then have the work read by a reviewer with
no authorship context — the harness's own subagent where it has one (in Claude
Code, the
Agenttool), a deliberate separate pass where it has none. Thereviewer's inputs are the task body plus its linked documents and the diff of the
work branch against the base, explicitly not the session transcript or the
agent's notes, and its brief is adversarial: grounds to reject against the body's
acceptance criteria, not confirmation. Every finding is fixed or rebutted with
evidence in one pass per
done; a fixed finding needs no record, a rebutted onegoes in the
--summarywith its rebuttal, since that is a judgement the operatorshould see and the summary is what
voro prpublishes as the PR body.DESIGN.md §8 describes the step in the return-path prose, next to the linked
documents and branch names it renders beside.
Verification
cargo test --workspace(637 tests) andcargo clippy --workspace --all-targets -- -D warningspass;cargo fmt --checkis clean. Two new tests:
preamble_mandates_an_independent_review_before_doneasserts the block across all four preamble variants under both a default and a
non-default database, reading whitespace-flattened text so the assertions are not
coupled to the constant's line wrapping;
dispatched_prompt_puts_the_review_gate_ahead_of_the_task_bodychecks placementagainst a really-dispatched prompt file rather than the preamble alone, where the
ordering assertion could not fail.
planning_and_refine_prompts_carry_no_review_gatechecks all three prose prompts against the same marker list. The rendered preamble
was also printed end-to-end and read for flow.
This task's own work went through the gate it adds: a fresh-context subagent
reviewed the branch diff against this task body and returned twelve findings,
all fixed in the second commit (docs denied to the reviewer, a circular
"in Claude Code, a subagent", a missing
--db, no commit-before-review, "onepass" ambiguous on the reject path, a vacuous placement assertion, wrap-coupled
and asymmetric test assertions, two DESIGN.md overstatements, a duplicated
comment).
One deviation the operator should see
The task body limits the reviewer's inputs to "the task body and the diff". The
review found that this contradicts the linked-documents block sitting beside it,
which says the body assumes those documents — so on a task with a linked plan
the gate would hand the reviewer a brief it cannot fully read. The block
therefore admits the task's linked documents alongside the body, and renders
after the document list so "named above" is true. The exclusion the criterion
exists for — session transcript, agent's notes — is unchanged.