Knowledge & review

Comments & rework loop

What happens after a reviewer comments on a task.

The loop is server-driven: the AI only renders a judgement, everything after it (review dispatch, merge, advance, revision) is deterministic server logic. TaskComment carries body, evaluation_json and resolution; post via POST /api/v1/tasks/{id}/comments.

Review → merge / revision loop
  1. 1

    Work completes

    purpose=review

    On unattended completion the server auto-dispatches a review run (if the plan is active and no review is in flight).

  2. 2

    Reviewer verdict

    Reviewer agent returns `VERDICT: APPROVED` or `VERDICT: REJECTED —<reason>` in its output; the server parses it.

  3. 3

    Approved → merge

    purpose=merge

    review_approved_at set; a deterministic merge run is dispatched (epic ← task branch).

  4. 4

    Rejected → revision

    Auto reject comment posted; the developer is re-dispatched on the SAME branch, then auto re-reviewed. Capped at 3 cycles (REVISION_CAP) before operator action.

  5. Loops back until the verdict is approved

Merge conflicts are typed: a failure whose reason starts with MERGE CONFLICT broadcasts a conflict phase, clears review_sent_at (retry unlocked) but keeps review_approved_at so a retry skips straight to merge without re-review.