approvalgate

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package approvalgate implements human-in-the-loop approval gates for PM task execution. When a task requires approval (RequiresApproval:true or high-priority with RequireApproval config), the gate pauses execution and prompts the user interactively before the task runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gate

type Gate interface {
	Approve(task *pm.Task) Result
}

Gate is the interface for approval gate implementations.

func New

func New() Gate

New returns a new InteractiveGate reading from os.Stdin.

type InteractiveGate

type InteractiveGate struct {
	// contains filtered or unexported fields
}

InteractiveGate prompts the user interactively to approve, skip, or edit a task.

func (*InteractiveGate) Approve

func (g *InteractiveGate) Approve(task *pm.Task) Result

Approve prompts the user for y/n/skip/edit and returns the result. Pre-approved tasks (task.Approved == true) bypass the prompt immediately.

type Result

type Result struct {
	Approved   bool
	Skipped    bool
	Paused     bool
	EditedDesc string // non-empty when user edited the description
}

Result is the outcome of an approval gate check.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL