#!/bin/bash # Workflow: review # Creates an author + reviewer, links them as peers, and runs an iterative # refinement loop. The reviewer either approves or sends feedback; the author # revises. Stops when the reviewer approves or max rounds are reached. set -euo pipefail SESSION_NAME="$OLLIE_SESSION_NAME" CWD="$OLLIE_CWD" MAX_ROUNDS=${OLLIE_REFINE_MAX:-3} AUTHOR_PROFILE=${AUTHOR_PROFILE:-author} REVIEWER_PROFILE=${REVIEWER_PROFILE:-reviewer} # Set status to running. echo "running" | ollie-9p write "session/$SESSION_NAME/goalstatus" # Create the author agent. AUTHOR=$(printf 'profile=%s\ncwd=%s\nname=author\n' "$AUTHOR_PROFILE" "$CWD" \ | ollie-9p rdwr "session/$SESSION_NAME/agent/new") AUTHOR=$(echo "$AUTHOR" | tr -d '\n') # Create the reviewer agent. REVIEWER=$(printf 'profile=%s\ncwd=%s\nname=reviewer\n' "$REVIEWER_PROFILE" "$CWD" \ | ollie-9p rdwr "session/$SESSION_NAME/agent/new") REVIEWER=$(echo "$REVIEWER" | tr -d '\n') # Establish bidirectional peer link (author ↔ reviewer). echo "peeradd reviewer" | ollie-9p rdwr "session/$SESSION_NAME/agent/$AUTHOR/ctl" # Read the goal. GOAL=$(ollie-9p read "session/$SESSION_NAME/goal") # Prime the reviewer — it waits for the author's submissions. cat <" | ollie-9p write session/\$OLLIE_SESSION_ID/agent/\$OLLIE_UNAME/peer/author \`\`\` ## Convergence rule This loop has a hard cap of $MAX_ROUNDS rounds. If you have sent feedback $((MAX_ROUNDS - 1)) times already (meaning the author is now on their final revision), you MUST approve the next submission regardless of remaining issues. Write "complete" to goalstatus. Track how many rounds of feedback you have given. Do not exceed the cap. ## Feedback style - Be specific: cite what's wrong, where, and what to change. - Be concise: no padding, no praise sandwiches. - Prioritize: focus on the most impactful issues first. PROMPT # Prime the author with the goal. cat <" | ollie-9p write session/\$OLLIE_SESSION_ID/agent/\$OLLIE_UNAME/peer/reviewer \`\`\` 3. The reviewer will either approve (ending the loop) or send feedback. 4. When you receive feedback, revise your work incorporating the feedback and send the complete updated version back to the reviewer. ## Rules - Each submission must be complete and self-contained — not a diff or partial update. - Incorporate all feedback points. If you disagree with a point, explain why in your submission. - You have at most $MAX_ROUNDS rounds total. Make each one count. PROMPT