QA loop local-first + Cursor deeplink
Done (Fase 1)
- Webhook Grok/Ferraz on QA create / ready (
GROKBOT_QA_WEBHOOK_*) - Manual Enviar para o Ferraz +
POST /qa/:id/notify - Abrir no Cursor via deeplink (chat prefilled; user Send)
- finish/execute/qa-scenario skills create QA
ready
Why not cloud Automation as fixer
Cloud sandbox ≠ *.dev.ask Tailscale mesh. Grok cannot QA code that only exists in a cloud clone. Multi-repo Docker stays on Mac/ask-server.
Target loop (Fase 2 — not built yet)
flowchart TD
finish[finish_write_qa_ready] --> webhook[POST_Ferraz]
webhook --> grok[Grok_runs_QA]
grok -->|update_qa_passed_or_failed| handoff[ask_handoff]
handoff -->|failed| openCursor[Abrir_no_Cursor_deeplink]
openCursor --> humanSend[User_presses_Send]
humanSend --> localFix[Cursor_local_edits_repos]
localFix --> redeploy[redeploy_dev_ask]
redeploy --> readyAgain[update_qa_ready_or_notify]
readyAgain --> grok
Contract for Grok results (next)
update_qastatuspassed|failed- Append
## Last runwith step outcomes (no secrets) - Optional tag
needs-fixwhen failed - Anti-loop: max N failed→fix→ready cycles per QA id
Cursor path (chosen)
- Deeplink only for human-visible chat (confirm = Send in Cursor)
- Rejected for auto-run:
agent -p(no IDE chat), cloud Automation fixer
Why not build Fase 2 now
Grok result writer not shipped; needs Ferraz webhook env live first.