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

escalation

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package escalation names the subject of the escalation gate instance of a tool call or a plan flow node (docs/design/untrusted-content-and-amount-caps.md, section 5.3, and docs/design/flow-taint.md), for the packages of this module that must tell it from the call or node itself: the agent engine, which asks the instance, and the approvals intake, which must not decide it under the call's own gate. It is internal so that no new exported name is needed.

The instance of a tool call is its ID and "#taint": a real tool-use ID never carries it, because a model turn with a '#' in an ID is refused (agent.ErrToolUseIDInvalid). The instance of a plan flow node is its key and ":taint" ("node:x:taint", "node:iter:2:x:taint"): a node name holds no ':' (package plan refuses one), so no node can be named so, and the form is not a plan key, so it collides with no node and no Step a node's body runs. A node whose name contains '#' (which plan allows) is a node, never an instance.

PlanKey is the parser the gate machinery and the consumers of gate subjects share. Node-only copies of it remain where only a node's own records are read: plan/conformance.go (parseNodeKey), plan/resolve.go and internal/runview/graph.go (nodeOf). They do not take an instance, and the change that makes the engine write instances teaches Conform to.

Index

Constants

View Source
const NodeSuffix = ":taint"

NodeSuffix turns a plan flow node's key into the subject of its escalation instance.

View Source
const Suffix = "#taint"

Suffix turns a tool call's ID into the subject of its escalation instance.

Variables

This section is empty.

Functions

func Base

func Base(subject string) (string, bool)

Base is the call or plan flow node a gate subject belongs to, and whether the subject is an escalation instance: ID's form for a subject that does not start with "node:", NodeInstance's for one that does. A node's key is a node, not an instance, whatever it ends with: "node:taint" is the node named taint, and "node:x:step:taint" a Step named taint. A call's "node:x#taint" is not recognised (no live tool-use ID starts with "node:"); it can only come from a journal written before that was refused.

func ID

func ID(call string) string

ID is the subject of the escalation gate instance of the tool call with this ID: the ID and "#taint", for every ID, as it always was. A plan flow node's instance is NodeInstance's. The two are not told apart by the argument: a tool-use ID that is a plan key ("node:x") is a call's, and a model may not choose one on a live turn (agent.ErrToolUseIDInvalid), but a journal written before that may hold one, and its instance stays "node:x#taint".

func IsNodeKey added in v0.26.0

func IsNodeKey(name string) bool

IsNodeKey reports whether name is the key of a plan flow node (not of a Step its body runs).

func IsSubject

func IsSubject(subject string) bool

IsSubject reports whether subject is an escalation instance, not a call or a node.

func NodeInstance added in v0.26.0

func NodeInstance(nodeKey string) string

NodeInstance is the subject of the escalation gate instance of the plan flow node with this key.

func NodeName added in v0.26.0

func NodeName(key string) (name string, ok bool)

NodeName is the name of the plan flow node a node key belongs to ("x" for "node:x" and "node:iter:3:x"). ok is false for any name that is not a node key: a Step a node's body runs, and an instance, included.

func PlanKey added in v0.26.0

func PlanKey(name string) (node, step string, ok bool)

PlanKey is the one parser of the keys package plan runs its nodes under: "node:[iter:<n>:]<node>", and "node:[iter:<n>:]<node>:step:<step>" for a Step a node's body runs. It returns the node's key and, for a Step, the Step's name ("" for a node). ok is false for any other name, the instance of a node included. <n> is a decimal number with no leading zero (the form strconv.Itoa writes), "iter:" followed by anything else is a node named iter, and a node name is not empty and holds no ':'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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