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 ¶
- func GateSatisfied(required, provided string, dryRun bool) bool
- func JudgmentRole(role adh.Stage) bool
- func ModelGate(role adh.Stage, class ModelClass, judgment JudgmentRoles) error
- func RaiseIsGated(cur, next Level) bool
- func RequiredApprovalPhrase(arcID string) string
- type JudgmentRoles
- type Level
- type ModelClass
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GateSatisfied ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.
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 ¶
ParseLevel parses "L0".."L4" (case-sensitive). It returns EINVALID otherwise.
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).