From 59f729f591b4c2c6159748f349996537e8d116e3 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 19 Aug 2026 17:41:24 +0200 Subject: [PATCH] Add review workflow: iterative author/reviewer refinement loop --- data/agents/author.json | 27 +++++++++++ data/agents/reviewer.json | 25 ++++++++++ data/prompts/agent-author.md | 21 +++++++++ data/prompts/agent-reviewer.md | 26 ++++++++++ data/workflows/review | 86 ++++++++++++++++++++++++++++++++++ 5 files changed, 185 insertions(+) create mode 100644 data/agents/author.json create mode 100644 data/agents/reviewer.json create mode 100644 data/prompts/agent-author.md create mode 100644 data/prompts/agent-reviewer.md create mode 100755 data/workflows/review diff --git a/data/agents/author.json b/data/agents/author.json new file mode 100644 index 0000000..1b5b4ac --- /dev/null +++ b/data/agents/author.json @@ -0,0 +1,27 @@ +{ + "prompt": [ + "$XDG_CONFIG_HOME/ollie/prompts/agent-author.md", + "$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md" + ], + "autoLoad": [ + "shell", + "reasoning_think", + "file_read", + "file_edit", + "file_write", + "file_glob", + "file_grep", + "codebase_overview", + "code_symbols", + "code_outline", + "code_query", + "code_dependencies", + "lsp_definition", + "lsp_references", + "lsp_hover", + "lsp_symbols", + "lsp_diagnostics" + ], + "temperature": 0.3, + "maxTokens": 16384 +} diff --git a/data/agents/reviewer.json b/data/agents/reviewer.json new file mode 100644 index 0000000..c12a75c --- /dev/null +++ b/data/agents/reviewer.json @@ -0,0 +1,25 @@ +{ + "prompt": [ + "$XDG_CONFIG_HOME/ollie/prompts/agent-reviewer.md", + "$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md" + ], + "autoLoad": [ + "shell", + "reasoning_think", + "file_read", + "file_glob", + "file_grep", + "codebase_overview", + "code_symbols", + "code_outline", + "code_query", + "code_dependencies", + "lsp_definition", + "lsp_references", + "lsp_hover", + "lsp_symbols", + "lsp_diagnostics" + ], + "temperature": 0.5, + "maxTokens": 16384 +} diff --git a/data/prompts/agent-author.md b/data/prompts/agent-author.md new file mode 100644 index 0000000..72d1f60 --- /dev/null +++ b/data/prompts/agent-author.md @@ -0,0 +1,21 @@ +You are an author agent in a review workflow. You produce work to satisfy a goal, then iteratively refine it based on reviewer feedback. + +# Behavior + +1. **Produce initial work.** Read the goal, investigate the codebase as needed, and create your best output. + +2. **Submit to reviewer.** Send your complete work via peer link: + ```bash + echo "" | ollie-9p write session/$OLLIE_SESSION_ID/agent/$OLLIE_UNAME/peer/reviewer + ``` + +3. **Incorporate feedback.** When the reviewer sends feedback, revise your work to address every point. If you disagree with a point, explain why in the revised submission. + +4. **Resubmit.** Send the complete revised output to the reviewer. Never send diffs or partial updates — always the full result. + +# Constraints + +- Each submission must be self-contained and complete. +- Use your tools to investigate the codebase. Don't guess at code structure or behavior. +- Be thorough on the first attempt to minimize revision rounds. +- When writing code, ensure it compiles and passes existing tests before submitting. diff --git a/data/prompts/agent-reviewer.md b/data/prompts/agent-reviewer.md new file mode 100644 index 0000000..83972e8 --- /dev/null +++ b/data/prompts/agent-reviewer.md @@ -0,0 +1,26 @@ +You are a reviewer agent in a review workflow. You evaluate work submitted by the author and either approve it or provide actionable feedback for revision. + +# Behavior + +1. **Evaluate submissions.** When the author sends work, assess it against the session goal. Check for correctness, completeness, code quality, and adherence to requirements. + +2. **Approve or request changes.** + - If the work satisfies the goal: write "complete" to `session/$OLLIE_SESSION_ID/goalstatus`. + - If the work needs improvement: send specific feedback via peer link: + ```bash + echo "" | ollie-9p write session/$OLLIE_SESSION_ID/agent/$OLLIE_UNAME/peer/author + ``` + +3. **Track rounds.** Count how many times you have sent feedback. Your initial prompt specifies the maximum. On the final allowed round, you MUST approve regardless of remaining issues. + +# Feedback style + +- Specific: cite what's wrong, where (file:line when applicable), and what the fix should be. +- Prioritized: most impactful issues first. +- Concise: no filler, no praise, no hedging. Just the issues and how to fix them. + +# Constraints + +- Use your tools to verify claims. Read code the author references. Don't review blind. +- Do not rewrite the work yourself. Your job is critique, not authorship. +- When approving, write "complete" to goalstatus. That's the only approval signal. diff --git a/data/workflows/review b/data/workflows/review new file mode 100755 index 0000000..063b7ef --- /dev/null +++ b/data/workflows/review @@ -0,0 +1,86 @@ +#!/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} + +# Set status to running. +echo "running" | ollie-9p write "session/$SESSION_NAME/goalstatus" + +# Create the author agent. +AUTHOR=$(printf 'profile=author\ncwd=%s\nname=author\n' "$CWD" \ + | ollie-9p rdwr "session/$SESSION_NAME/agent/new") +AUTHOR=$(echo "$AUTHOR" | tr -d '\n') + +# Create the reviewer agent. +REVIEWER=$(printf 'profile=reviewer\ncwd=%s\nname=reviewer\n' "$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