|
| 1 | +# Roboppi Self-Dev Loop: fix management agent review findings |
| 2 | +# |
| 3 | +# This workflow turns the implementation review doc into a TODO, then loops: |
| 4 | +# implement -> (tests + review verdict) -> fix ... until PASS. |
| 5 | +# |
| 6 | +# Run (from the Roboppi repo root): |
| 7 | +# bun run src/workflow/run.ts examples/workflow-management-agent-impl-review-loop.yaml --workspace . --verbose |
| 8 | + |
| 9 | +name: workflow-management-agent-impl-review-loop |
| 10 | +version: "1" |
| 11 | +description: "Roboppi self-dev: resolve management-agent implementation review findings" |
| 12 | +timeout: "300m" |
| 13 | +concurrency: 1 |
| 14 | +create_branch: true |
| 15 | +branch_transition_step: "branch" |
| 16 | + |
| 17 | +steps: |
| 18 | + bootstrap: |
| 19 | + description: "Initialize loop state (.roboppi-loop/*)." |
| 20 | + worker: CUSTOM |
| 21 | + instructions: | |
| 22 | + bash "${ROBOPPI_ROOT:-.}/scripts/self-dev/workflow-management-agent-impl-review/bootstrap.sh" |
| 23 | + capabilities: [READ, EDIT, RUN_COMMANDS] |
| 24 | + timeout: "2m" |
| 25 | + |
| 26 | + branch: |
| 27 | + description: "Create or reuse a working branch" |
| 28 | + worker: CUSTOM |
| 29 | + depends_on: [bootstrap] |
| 30 | + instructions: | |
| 31 | + bash "${ROBOPPI_ROOT:-.}/scripts/agent-pr-loop/branch.sh" |
| 32 | + capabilities: [READ, RUN_COMMANDS] |
| 33 | + timeout: "1m" |
| 34 | + |
| 35 | + todo: |
| 36 | + description: "Convert implementation review doc into TODO checklist" |
| 37 | + worker: OPENCODE |
| 38 | + model: "openai/gpt-5.2" |
| 39 | + depends_on: [branch] |
| 40 | + instructions: | |
| 41 | + You are OpenCode. |
| 42 | +
|
| 43 | + Task: Convert the implementation review findings into a concrete TODO checklist. |
| 44 | +
|
| 45 | + Read: |
| 46 | + - .roboppi-loop/request.md |
| 47 | + - docs/features/workflow-management-agent-implementation-review.md |
| 48 | +
|
| 49 | + Note: do not rely on file-globbing for dot-directories; `.roboppi-loop/*` |
| 50 | + may not be discoverable via glob in some tool environments. Read/write |
| 51 | + the paths directly. |
| 52 | +
|
| 53 | + Write/update: |
| 54 | + - .roboppi-loop/todo.md |
| 55 | +
|
| 56 | + Requirements: |
| 57 | + - Use Markdown checklist items: "- [ ] ..." |
| 58 | + - Group by P0/P1/P2 severity. |
| 59 | + - Include file paths and symbols when possible. |
| 60 | + - Include explicit test tasks (at least: make typecheck, make test-all). |
| 61 | + - If a finding is already fixed, include a task to confirm + update the review doc. |
| 62 | + capabilities: [READ, EDIT] |
| 63 | + timeout: "20m" |
| 64 | + on_failure: retry |
| 65 | + max_retries: 2 |
| 66 | + |
| 67 | + completion_check: |
| 68 | + worker: CUSTOM |
| 69 | + instructions: | |
| 70 | + bash "${ROBOPPI_ROOT:-.}/scripts/agent-pr-loop/todo-check.sh" |
| 71 | + capabilities: [READ, RUN_COMMANDS] |
| 72 | + timeout: "30s" |
| 73 | + |
| 74 | + max_iterations: 3 |
| 75 | + on_iterations_exhausted: abort |
| 76 | + outputs: |
| 77 | + - name: todo |
| 78 | + path: ".roboppi-loop/todo.md" |
| 79 | + type: review |
| 80 | + |
| 81 | + implement: |
| 82 | + description: "Implement fixes; run tests+review in completion_check; repeat until PASS" |
| 83 | + worker: CLAUDE_CODE |
| 84 | + model: "claude-opus-4-6" |
| 85 | + depends_on: [todo] |
| 86 | + instructions: | |
| 87 | + You are Claude Code. |
| 88 | +
|
| 89 | + Important: you are running as Claude Code via Roboppi. |
| 90 | + - Read `.roboppi-loop/request.md` and `.roboppi-loop/todo.md` by file path (do not rely on globbing dot-directories). |
| 91 | +
|
| 92 | + Read: |
| 93 | + - .roboppi-loop/request.md |
| 94 | + - .roboppi-loop/todo.md |
| 95 | + - .roboppi-loop/review.md (if present) |
| 96 | + - .roboppi-loop/fix.md (if present) |
| 97 | +
|
| 98 | + Task: |
| 99 | + - If .roboppi-loop/fix.md exists and is non-empty, apply ONLY those fixes (minimal, targeted changes). |
| 100 | + - Otherwise, implement the TODO checklist items. |
| 101 | + - Update the TODO checkboxes as you complete items. |
| 102 | + - Keep changes focused; avoid drive-by refactors. |
| 103 | +
|
| 104 | + Notes: |
| 105 | + - Tests are run in the completion_check phase; focus here on implementation and documentation updates. |
| 106 | + capabilities: [READ, EDIT, RUN_TESTS, RUN_COMMANDS] |
| 107 | + timeout: "60m" |
| 108 | + on_failure: retry |
| 109 | + max_retries: 1 |
| 110 | + |
| 111 | + convergence: |
| 112 | + enabled: true |
| 113 | + stall_threshold: 2 |
| 114 | + max_stage: 3 |
| 115 | + fail_on_max_stage: true |
| 116 | + |
| 117 | + completion_check: |
| 118 | + worker: OPENCODE |
| 119 | + model: "openai/gpt-5.2" |
| 120 | + variant: "xhigh" |
| 121 | + decision_file: ".roboppi-loop/review.verdict" |
| 122 | + instructions: | |
| 123 | + You are OpenCode. |
| 124 | +
|
| 125 | + Sandbox rule: |
| 126 | + - Do NOT read or write outside the workspace directory. |
| 127 | + - Treat `/tmp/**` as forbidden (Roboppi will auto-reject external_directory reads). |
| 128 | + - If you need temp files/dirs, use `.roboppi-loop/tmp/*`. |
| 129 | +
|
| 130 | + Task: |
| 131 | + 1) Run tests: |
| 132 | + - make test-all |
| 133 | + 2) Review the changes against the request + TODO + implementation-review doc. |
| 134 | + 3) Write/update: |
| 135 | + - .roboppi-loop/review.md |
| 136 | + - .roboppi-loop/review.verdict (single-line JSON; see Output rules) |
| 137 | + 4) If verdict is FAIL, also write/update: |
| 138 | + - .roboppi-loop/fix.md (non-empty; concrete, actionable steps; include file paths) |
| 139 | + 5) If verdict is PASS: |
| 140 | + - Clear .roboppi-loop/fix.md if it exists (truncate to empty) |
| 141 | +
|
| 142 | + Before reviewing, generate deterministic review inputs: |
| 143 | + - bash "${ROBOPPI_ROOT:-.}/scripts/agent-pr-loop/review-inputs.sh" |
| 144 | +
|
| 145 | + Debugging rule (branch verification): |
| 146 | + - If `make test-all` fails in the branch verification phase and you need logs, |
| 147 | + re-run branch verification with a verify dir INSIDE the workspace, e.g.: |
| 148 | + - bash "bash tests/branch/run-branch-verification.sh .roboppi-loop/tmp/branch-verify" |
| 149 | + - Do not use `mktemp -d /tmp/...`. |
| 150 | +
|
| 151 | + You must read at least: |
| 152 | + - .roboppi-loop/request.md |
| 153 | + - .roboppi-loop/todo.md |
| 154 | + - docs/features/workflow-management-agent-implementation-review.md |
| 155 | + - .roboppi-loop/review.base_ref |
| 156 | + - .roboppi-loop/review.diff |
| 157 | + - .roboppi-loop/review.status |
| 158 | + - .roboppi-loop/review.untracked |
| 159 | + - .roboppi-loop/review.untracked.diff |
| 160 | +
|
| 161 | + Format for .roboppi-loop/review.md: |
| 162 | + - Sections: Summary, Issues, Verification |
| 163 | +
|
| 164 | + Output rules: |
| 165 | + - Write .roboppi-loop/review.verdict as a single-line JSON object: |
| 166 | + - complete => {"decision":"complete","check_id":"$ROBOPPI_COMPLETION_CHECK_ID"} |
| 167 | + - incomplete => {"decision":"incomplete","check_id":"$ROBOPPI_COMPLETION_CHECK_ID"} |
| 168 | + - When FAIL, also include: |
| 169 | + - "reasons": ["..."] |
| 170 | + - "fingerprints": ["..."] |
| 171 | + - Fingerprints should be stable across iterations (e.g. test name, file:line, or finding id). |
| 172 | + capabilities: [READ, EDIT, RUN_TESTS, RUN_COMMANDS] |
| 173 | + timeout: "90m" |
| 174 | + |
| 175 | + max_iterations: 8 |
| 176 | + on_iterations_exhausted: abort |
| 177 | + outputs: |
| 178 | + - name: review |
| 179 | + path: ".roboppi-loop/review.md" |
| 180 | + type: review |
| 181 | + - name: verdict |
| 182 | + path: ".roboppi-loop/review.verdict" |
| 183 | + type: text |
| 184 | + - name: fix |
| 185 | + path: ".roboppi-loop/fix.md" |
| 186 | + type: review |
0 commit comments