Files
plan2code/src/web-console/notes/review-loop.md
T

3.6 KiB

Review Loop Round

Read after console.md. Run by the desktop app's Review Loop (--loop on review), part of the console.md contract. This note replaces the scope card, the fix menu, the sign-off, Lessons End and every git step.

Who you are

One round of a Review Loop. The app started you with --round <n>, --role <role> and --scope-file <path>, and opened the session with open --loop --workflow review --round <n> --role <role> --scope-file <path>: run that open again if the server went away, with the same flags. Nobody is watching. Never run git in any form, never ask the person, never commit. A real question is a stop: report failed, reason other.

Scope

Read the scope file first. For round 1 it names the scope the person picked. For a later round it is the previous round's diff. Review nothing outside it. A file the scope names but that is gone is a finding only if the change deleted it.

Role both

  1. Start one fresh read-only reviewer subagent with reviewer-brief.md filled in for the scope, whatever the Subagents switch says. It never sees this conversation.
  2. Verify every finding it returns (verification-protocol.md), and drop what does not hold.
  3. Post the verified findings as one doc with id report, grouped Critical, Warning, Suggestion.
  4. Fix Critical and Warning only. List Suggestions without fixing them.
  5. Run the targeted tests for the files you changed (references/test-runs.md), never the full suite. Changed nothing? Run the targeted tests for the files in scope: a passed round never sends ran:false.

Role reviewer

Do the review only: steps 1 to 3 of Role both. Change no file. Post the report doc and report; leave tests out, and send fixed as an empty list.

Role fixer

The scope file names the reviewer's report by file path. Read it, fix Critical and Warning, run the targeted tests for what you changed, and start no new review. Leave report out. Still send review: its counts and lists come from the reviewer's report, with fixed and unfixed showing what this round fixed and left.

Reporting

Post in this order, each as its own patch with no --wait:

  1. The report doc (roles both and reviewer), before the outcome.
  2. One top-level roundOutcome:
{ "roundOutcome": {
  "round": 2, "role": "both", "result": "passed", "reason": null,
  "summary": "Fixed 1 warning; 1 suggestion left",
  "report": "report",
  "review": { "critical": 0, "warning": 1, "suggestion": 1,
    "fixed": [ { "title": "Close the file handle", "file": "src/z.js", "line": 12 } ],
    "unfixed": [],
    "suggestions": [ { "title": "Name the timer", "file": "src/x.js" } ] },
  "tests": { "ran": true, "passed": true, "summary": "14 pass" },
  "subject": "Close the file handle in z.js" } }
  1. {"agent":{"status":"waiting"}}, then keep waiting in bounded wait slices until the app ends the session. Never end the turn on text.

Every field is required except report for a fixer and tests for a reviewer. round and role must equal the flags. critical, warning and suggestion count what the review found before fixing; fixed and unfixed list the Critical and Warning findings by that outcome (at most 50 each, file relative to the project). result is passed when the round ran its steps and its tests; failed carries one reason: tests, findings, blocked, conflict or other. summary is one line under 200 characters, subject one line under 100.

Refusals

An exit 3 on roundOutcome names the field: fix it and post again inside the same round. A loopOutcome is refused here: a round reports roundOutcome only.