Approval gates #4

Open
opened 2026-04-20 20:11:19 +00:00 by jmarya · 0 comments
Owner

Implement human approval as a built-in module step. A step uses moira.gate; the agent registers the gate on the server and polls for resolution. On approve the step succeeds; on deny it fails.

Design

- name: approve-deploy
  use: moira.gate
  with:
    message: "Deploy ${{ git.tag }} to production?"
    timeout: 24h
    approvers:
      roles: [owner]
    depends_on: [build]

- name: deploy
  run: ./deploy.sh
  depends_on: [approve-deploy]

Outputs

approved_by (string), approved_at (string), reason (on denial).

Scope

  • Server: gates table (id, run_id, step_name, message, timeout_at, status, resolved_by, resolved_at, reason) + migration
  • Server: POST /work/runs/:id/gates (agent creates), GET (agent polls),
    POST /gates/:id/approve, POST /gates/:id/deny (CLI/user resolves)
  • Agent: built-in module handler — register gate, poll every 5s,
    return StepResult on resolution or timeout
  • CLI: moira gate list, moira gate approve <id>,
    moira gate deny <id> --reason "..."
  • Local mode: interactive terminal prompt (y/n) when gate is reached
  • Run lifecycle: waiting status while gate is open
Implement human approval as a built-in module step. A step uses `moira.gate`; the agent registers the gate on the server and polls for resolution. On approve the step succeeds; on deny it fails. ## Design ```yml - name: approve-deploy use: moira.gate with: message: "Deploy ${{ git.tag }} to production?" timeout: 24h approvers: roles: [owner] depends_on: [build] - name: deploy run: ./deploy.sh depends_on: [approve-deploy] ``` ## Outputs `approved_by` (string), `approved_at` (string), `reason` (on denial). ## Scope - Server: `gates` table (id, run_id, step_name, message, timeout_at, status, resolved_by, resolved_at, reason) + migration - Server: POST /work/runs/:id/gates (agent creates), GET (agent polls), POST /gates/:id/approve, POST /gates/:id/deny (CLI/user resolves) - Agent: built-in module handler — register gate, poll every 5s, return StepResult on resolution or timeout - CLI: `moira gate list`, `moira gate approve <id>`, `moira gate deny <id> --reason "..."` - Local mode: interactive terminal prompt (y/n) when gate is reached - Run lifecycle: `waiting` status while gate is open
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jmarya/moira#4
No description provided.