You're offline — showing cached data

MC-4302

Wire Worker to Reviewer to retry loop
2026-06-13 08:47:58 SAST
Home Board MC-4302

Wire Worker to Reviewer to retry loop

# MC-4291: Wire the Worker → Reviewer → retry loop **Priority:** high **Assigned:** luci **Depends on:** MC-4290 (shadow reviewer must be active first) ## What to do When a W...
State Done Next Action Closed Owner Luci Runtime Closed Age 17d ago
MC-4302
Ticket is done; runtime is closed. · profile claude_opus_1m_medium · cwd /home/lucienne/workspace/mission-control · uptime 16d 18h · last activity 16d 15h ago

Description

MC-4302
# MC-4291: Wire the Worker → Reviewer → retry loop **Priority:** high **Assigned:** luci **Depends on:** MC-4290 (shadow reviewer must be active first) ## What to do When a Worker reports DONE and the QA reviewer says "not done" (verdict=fail), the Controller should send the Worker back to fix it — not ask Elmar. This creates the automatic retry loop. ## Steps 1. **Hook the harvest path.** Find where MC currently processes the `DONE:` sentinel from workers (likely in `mc_pickup.py` or `ticket_runtime.py`). After the DONE is detected, check `shadow_reviews` for a verdict on that ticket's `done_sha`. 2. **If verdict is `pass`** → proceed as today (mark done, close ticket or escalate to Elmar if needed). 3. **If verdict is `fail`** → do NOT mark done. Instead: - Add a comment to the ticket with the reviewer's `reasons` and `gaps` - Set ticket status to `todo` (or `in_progress` if the worker runtime is still alive) - Increment a `review_cycles` counter on the ticket (add the field to `models.py` if it doesn't exist — default 0, max 3) - If `review_cycles` >= 3: set status to `needs_input`, add comment "Max review cycles reached. Needs Elmar decision.", escalate - If `review_cycles` < 3: re-dispatch to the same worker with the reviewer's feedback appended to the prompt 4. **If verdict is `uncertain`** → escalate to Elmar with the reviewer's reasoning. Do not auto-retry. 5. **Add a `review_cycles` field.** In `models.py` or wherever tickets are defined, add `review_cycles INTEGER DEFAULT 0`. Add a migration if the DB already has the tickets table. Reset to 0 when a ticket moves from `todo` to `in_progress` for the first time. 6. **Commit and push.** ## Acceptance criteria - When a Worker reports DONE and the QA reviewer verdict is `fail`, the ticket goes back to the Worker with feedback — not to Elmar - The `review_cycles` counter increments each retry - At 3 cycles, the ticket escalates to `needs_input` with a clear message - `uncertain` verdicts always escalate to Elmar - The existing DONE path still works for `pass` verdicts ## If blocked - If there's no clean hook point for the DONE sentinel processing, add one — but do not break the existing harvest - If the worker runtime is dead when retry fires, create a new worker dispatch (mc_pickup handles this) - Test with a fake ticket: set `MC_ORCH_SHADOW_REVIEW=1`, create a test ticket, force a `fail` verdict, verify the loop ## What NOT to do - Do not touch Tessa/browser testing (that's MC-4292) - Do not change the operator (that's MC-4293) - Do not change the inbox (that's MC-4294) - Do not auto-fix the Worker's code — just send the feedback back and let the Worker fix it

Activity

done
Luci is working...
Live
No activity yet
Help