Documentation
¶
Overview ¶
Package loop models maintenance loops (SPEC-ADDITIONS §15): a named invariant kept true by a sensor and an authorized action, with an explicit retirement condition. The registry and its validation are pure; running a sensor is a command-level seam.
Index ¶
Constants ¶
const DefaultRegistryFile = ".adh/loops.json"
DefaultRegistryFile is the conventional repo path the loop registry lives under (SPEC-ADDITIONS §15). It is the single owner of that path across the CLI.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Loop ¶
type Loop struct {
ID string `json:"id"`
Goal string `json:"goal"`
Sensor string `json:"sensor"`
OnFinding string `json:"on_finding,omitempty"`
RetireWhen string `json:"retire_when"`
Owner string `json:"owner,omitempty"`
}
Loop is one maintenance loop: the invariant it keeps, how it senses a departure, the authorized action on a finding, when it retires, and its owner.
type Registry ¶
type Registry struct {
Loops []Loop `json:"loops"`
}
Registry is the set of registered maintenance loops.
func Load ¶
Load reads a loop registry from a JSON file. An absent file is an empty registry, not an error.
func StarterRegistry ¶
func StarterRegistry() Registry
StarterRegistry is the set of standing maintenance loops that make accretion automatic instead of prompted (SPEC-ADDITIONS §15): each names an invariant the harness keeps true, a deterministic sensor (`adh` itself), and "open arc" as the authorized action, so a sensed departure becomes work an agent drives. `adh init` seeds it and then the operator tailors it. The sensors compose the other levers — context-integrity (Loop F, `context verify`), the tool registry (`tool doctor`), and the lesson backlog — so a correction is inherited by the next arc, not lost.