Skip to content

feat: human approval gates for plan-approve-implement workflows #580

@nextlevelshit

Description

@nextlevelshit

Context

Fabro has first-class human gate nodes (shape=hexagon) that pause execution and present choices via CLI or web UI. This enables plan-approve-implement patterns where humans review plans before code changes proceed. Rejected plans loop back to planning.

Wave currently has no human-in-the-loop mechanism. Pipelines run unattended. For Wave's use as a development tool (not just CI), human gates enable supervised workflows where the developer stays in control at critical decision points.

Design Goals — Best of Both Worlds

Combine Fabro's human gates with Wave's TUI/WebUI and persona system.

Gate Step Type

steps:
  - name: plan
    persona: navigator
    
  - name: approve-plan
    type: gate
    depends_on: [plan]
    prompt: "Review the implementation plan"
    choices:
      - label: "Approve"
        key: "a"
        target: implement
      - label: "Revise"
        key: "r"
        target: plan
      - label: "Abort"
        key: "q"
        target: _fail     # special: fail the pipeline
    timeout: 3600s         # 1 hour before auto-timeout
    default: approve       # on timeout, use this choice
    
  - name: implement
    persona: craftsman
    depends_on: [approve-plan]

Interaction Channels

  1. CLI — prompt in terminal with keyboard shortcuts (like Fabro's [A] Approve / [R] Revise)
  2. TUI — Bubble Tea modal with choice buttons
  3. Web UI — browser notification + button panel
  4. API — REST endpoint for programmatic approval (enables Slack/webhook integration)

Freeform Input

Gates can accept freeform text (revision notes, additional instructions):

  - name: approve-plan
    type: gate
    freeform: true          # allow text input alongside choices

The freeform text becomes available as an artifact for downstream steps.

Auto-Approve Mode

For CI/automated runs: wave run --auto-approve impl-issue -- "..." skips all gates, using default choices.

Context Population

After a gate decision, the following are set in run context:

  • gate.<step_name>.choice — selected choice label
  • gate.<step_name>.text — freeform text (if any)
  • gate.<step_name>.timestamp — when decision was made

What Wave Keeps

  • Persona system (gates don't need personas — they're human interaction points)
  • Contract validation (can still validate before presenting to human)
  • Workspace isolation (gate doesn't modify workspace)

What Wave Gains

  • Supervised workflows — human stays in control at critical points
  • Plan review — navigator creates plan, human approves, craftsman implements
  • Quality gates — human sign-off before PR creation
  • Revision loops — rejected work loops back with human feedback

Implementation Scope

  1. Add type: gate step type to manifest schema
  2. Gate executor in internal/pipeline/executor.go — pauses execution
  3. CLI gate handler — terminal prompt with choices
  4. TUI gate handler — Bubble Tea modal
  5. Web UI gate handler — REST endpoint + notification
  6. --auto-approve flag on wave run

Research Sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions