authorize

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package authorize implements the `aiwf authorize ` verb (per-verb subpackage of M-0116; cmd/aiwf/main.go's newRootCmd wires it via NewCmd).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd(correlationID string) *cobra.Command

NewCmd builds `aiwf authorize <id>` in its three modes:

aiwf authorize <id> --to <agent> [--reason "..."] [--force]
aiwf authorize <id> --pause "<reason>"
aiwf authorize <id> --resume "<reason>"

Exactly one of --to / --pause / --resume must be set. The dispatcher resolves the actor (must be human/), locks the repo, loads the existing scopes for the entity from git log (so --pause / --resume can find their target), and hands off to verb.Authorize.

Per docs/design/provenance-model.md §"The aiwf authorize verb" the `--reason` argument has a different role per mode:

  • --to: optional; the rationale the human writes when opening a scope.
  • --pause / --resume: required; the argument to the flag is itself the reason (e.g. `--pause "blocked by E-09"`). Passing both `--pause "..."` and `--reason "..."` is a usage error.

func Run

func Run(opts Options) (code int)

Run executes `aiwf authorize`. Returns one of the cliutil.Exit* codes.

Types

type Options added in v0.31.0

type Options struct {
	ID     string
	Actor  string
	Root   string
	To     string
	Pause  string
	Resume string
	Reason string
	Branch string
	Force  bool
	Out    cliutil.OutputFormat
}

Options carries the `aiwf authorize` invocation inputs to Run. Collapsing the previously-positional signature (ten parameters, seven of them adjacent strings) into a named struct removes the transpose-two-strings hazard, mirroring internal/verb's PromoteOptions / AddOptions convention at the CLI adapter boundary (G-0227).

Jump to

Keyboard shortcuts

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