# Implementer ↔ reviewer refinement loop. # # The reviewer emits a validated `review_report` artifact carrying a `verdict` field. # The loop exits to `done` when verdict == "approved" and loops back to `implement` # otherwise (verdict != "approved"). The runtime refinement guard caps the # review→implement cycle at `implement.max_retries` iterations and then escalates. # # Requires a `review_report` artifact kind declared in config: # [[artifacts]] # id = "review_report" # schema_path = "schemas/review_report.json" # llm_emitted = true id = "review_loop" start = "implement" [[stages]] id = "implement" prompt = "prompts/implement.md" produces = [{ name = "patch", kind = "file_written" }] allowed_tools = ["file_write"] token_budget = 8192 max_retries = 3 [[stages]] id = "review" prompt = "prompts/review.md" needs = ["patch"] produces = [{ name = "review_report", kind = "review_report" }] token_budget = 8192 max_retries = 3 [[transitions]] id = "implement-to-review" from = "implement" to = "review" condition_type = "artifact_validated" condition_artifact_id = "patch" [[transitions]] id = "review-approved" from = "review" to = "done" condition_type = "artifact_field_equals" condition_artifact_id = "review_report" condition_field = "verdict" condition_value = "approved" condition_operator = "eq" [[transitions]] id = "review-changes-requested" from = "review" to = "implement" condition_type = "artifact_field_equals" condition_artifact_id = "review_report" condition_field = "verdict" condition_value = "approved" condition_operator = "neq"