Help us shape the future of Go! Take the 2026 Go Developer Survey

authority

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package authority holds the pure authority decisions of the harness: the autonomy ladder (SPEC §6), the model-gate (SPEC §5.1), and the human safety gate (SPEC §5.2). Capability and authority are separate contracts; this package decides authority and never performs an effect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GateSatisfied

func GateSatisfied(required, provided string, dryRun bool) bool

GateSatisfied reports whether a human safety gate (SPEC §5.2) is satisfied. Only a non-empty phrase that exactly matches the required phrase satisfies it, and never under a dry run. The agent has no code route to self-grant: callers must never source provided from an environment variable or a --yes flag — the phrase comes only from an interactive --phrase typed by a human.

func JudgmentRole

func JudgmentRole(role adh.Stage) bool

JudgmentRole reports whether a stage must run on a reasoning-class model. Strategy, Critic, and Evaluation are judgment roles; Execution and Ops are not.

func ModelGate

func ModelGate(role adh.Stage, class ModelClass, judgment JudgmentRoles) error

ModelGate enforces SPEC §5.1: a role in the judgment set must run on a reasoning-class model. The set is supplied by the caller (config-driven), so a deployment can widen or narrow it. Returns EUNAUTHORIZED when a judgment role would run on a fast model.

func RaiseIsGated

func RaiseIsGated(cur, next Level) bool

RaiseIsGated reports whether moving from cur to next is itself a human-gated action (SPEC §6: raising the level is gated; lowering is always allowed).

func RequiredApprovalPhrase

func RequiredApprovalPhrase(arcID string) string

RequiredApprovalPhrase is the phrase a human must type to satisfy an arc's safety gate (SPEC §5.2), derived from the arc id. It is deliberately NOT sourced from config or the environment: a config- or env-settable phrase would be a self-grant route, since the agent can read both. The gate is structural.

Types

type JudgmentRoles

type JudgmentRoles map[adh.Stage]bool

JudgmentRoles is the set of stages that must run on a reasoning-class model (SPEC §5.1). It is config-driven so a deployment can widen or narrow the set.

func DefaultJudgmentRoles

func DefaultJudgmentRoles() JudgmentRoles

DefaultJudgmentRoles is the built-in judgment set (SPEC §5.1), derived from JudgmentRole so the default has a single source of truth.

func (JudgmentRoles) Requires

func (j JudgmentRoles) Requires(role adh.Stage) bool

Requires reports whether role must run on a reasoning-class model.

type Level

type Level int

Level is a rung of the autonomy ladder.

const (
	L0 Level = iota // manual: every stage transition is explicit
	L1              // assisted: suggest the next stage, human confirms
	L2              // hands-off relay up to the next gate (default)
	L3              // auto-advance safe launches; gates still stop the loop
	L4              // lights-out between gates
)

Level values of the autonomy ladder, lowest to highest (SPEC §6). Higher levels auto-launch more safe steps (remove clicks) but never remove a gate.

func ParseLevel

func ParseLevel(s string) (Level, error)

ParseLevel parses "L0".."L4" (case-sensitive). It returns EINVALID otherwise.

func (Level) String

func (l Level) String() string

String renders the ladder rung as "L0".."L4".

type ModelClass

type ModelClass string

ModelClass is the capability tier a stage's model belongs to.

const (
	ClassReasoning ModelClass = "reasoning" // strong, cold; judgment roles
	ClassFast      ModelClass = "fast"      // routine execution
)

ModelClass values (SPEC §5.1).

Jump to

Keyboard shortcuts

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