Repository navigation
Review on done: an independent agent checks the exact commits #102
Copy link
Copy link
Open
Description
Proposal
Parent: autonomous-swarm (F5). Inspired by Claude Code peer-programming plugins: when the
implementing agent says done, a hook calls another agent — preferably a different model —
to review exactly what changed.
Why
The queue loop's verify gate already runs a reviewer subagent over git status --porcelain
and git diff HEAD with an LGTM/NEEDS_WORK token (loop/loop.ts ~L1005–1060). Its
limits for the operator's goal:
- the reviewer shares the author's model family unless a persona pins one — same blind spots;
- it reviews the working tree, not a named commit range, so it cannot attest to a head SHA;
- it exists only inside a queue loop — plain opencode and Claude Code sessions get nothing;
- the verdict is not recorded where a merge decision can require it.
What Changes
- Review trigger on done for any session: loop completion (via
loop-done-handoff's
hook point) and, for Claude Code, aStophook runningskein review-on-done.
Triggers only when the session produced commits or a diff since its base and the change
or branch is not already approved at that SHA. - Reviewer selection that differs from the author: prefer a different harness, else a
different model family, else a different model; routed with the same warm-capacity logic
as crew work (peer-capacity-subagents,crew-loop2a). If no independent reviewer is
available, the review is markedsame-modeland the policy decides whether that suffices. - Exact range, pointers not paste: the request carries
base..headSHAs, the worktree
path, the change slug and acceptance criteria locations. The reviewer reads the range
itself in a detached worktree at head (no mutation of the author's tree). - Verdict as evidence:
LGTM/NEEDS_WORKplus findings, written to
.skein/review.jsonas{headSHA, base, reviewer{harness,model}, verdict, findings, round}.standing-publish-authority's merge requiresLGTMfor the current head;
skein'sReviewVerdictgate evidence reads the same file. - Bounded rounds:
NEEDS_WORKreopens implement with the findings; at most 3 rounds,
then the ladder (escalate-before-idle) sends it to the lead. A re-review happens only
for a new head SHA. - Findings rules: the reviewer must cite file and line for each finding and separate
blocking from advisory; a review with no verdict token is "no verdict", not a pass.
Non-goals
- Not a replacement for CI or the verify gate's test run.
- No auto-fix by the reviewer; it reports.
- No review of a SHA already approved.
Impact
loop/loop.ts (generalise the verify reviewer to the commit range, add selection),
new review/on-done.ts, peer/delegate.ts request type, cli/cmd (review subcommand),
Claude Code hook config fragment, .skein/review.json schema, tests.
Tasks
Phase 0: Baseline
- 0.1 Record on a real run: which model the verify reviewer used vs. the author, its
input, whether anything persisted (autonomous-swarm0.5). - 0.2 Failing test: reviewer input for a committed change (clean tree) is empty today,
so a committed-but-unreviewed change reviews as "(empty)".
Phase 1: Range-based review
- 1.1
review/range.ts: resolvebase..headfor a change/branch/worktree; detached
worktree at head for the reviewer; cleanup. - 1.2 Generalise the verify gate to the range; keep the token verdict and the
"no token = no verdict" rule. - 1.3
.skein/review.jsonschema (closed, validated at read) and writer.
Phase 2: Independent reviewer
- 2.1 Selection function over roster + models (different harness > different family >
different model > same-model flagged); unit tests per branch including "none available". - 2.2 Request/reply over the peer envelope with deadline; reviewer answers once.
- 2.3 Round counter, max 3, then hand to the ladder.
Phase 3: Triggers
- 3.1 Loop completion hook (after
loop-done-handoff1.2). - 3.2
skein review-on-doneCLI + Claude CodeStophook fragment; no-op when no new
commits or head already approved; guard against hook re-entrancy (the reviewer's own
Stop must not trigger a review).
Phase 4: Consumers
- 4.1 Merge driver (
standing-publish-authority3.3) requiresLGTMfor current head. - 4.2 Skein
ReviewVerdictevidence mapping (cross-repo, Phase 6.3 of the epic).
Phase 5: Live and controls
- 5.1 Real change reviewed by a different-family model; findings fed back; second round passes.
- 5.2 Negative controls: a seeded defect is caught; a stale review (new commit) is not
accepted by merge; a reviewer reply with no token fails the gate; the review hook does
not recurse.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity