Documentation
¶
Overview ¶
Package ego implements the self-reflection loop that maintains core/ego.md. It runs as a loops-ng service: each iteration is a fresh conversation with bounded voluntary sleep, supervisor randomization for periodic frontier review, and a declared maintained-document output that pins ego.md to the loop.
The agent's core context provider reads ego.md every turn and injects it into the system prompt; this loop is the sole writer.
Index ¶
Constants ¶
const DefinitionName = "ego"
DefinitionName is the durable loops-ng definition name for the ego service.
Variables ¶
This section is empty.
Functions ¶
func BuildLoopConfig ¶
BuildLoopConfig returns the engine-facing loop.Config view of the ego loop. Kept as a compatibility bridge while loops-ng adoption is in progress.
func BuildSpec ¶
BuildSpec returns a loop.Spec that implements the ego loop as a standard loops-ng service. The returned spec declares the durable output document and uses runtime hooks to build prompts.
func DefinitionSpec ¶
DefinitionSpec returns the persistable loops-ng definition for the ego service. Runtime hooks are attached later by HydrateSpec so the definition can live in the durable registry.
Types ¶
type Config ¶
type Config struct {
Enabled bool
StateFile string
MinSleep time.Duration
MaxSleep time.Duration
DefaultSleep time.Duration
Jitter float64
SupervisorProbability float64
QualityFloor int
SupervisorQualityFloor int
}
Config holds the parsed ego loop configuration with time.Duration fields (as opposed to the YAML string representation in config.EgoConfig).
func ParseConfig ¶
ParseConfig converts a config.EgoConfig (string durations) into a Config (time.Duration fields). Call after config validation has passed.