ego

package
v0.9.2 Latest Latest
Warning

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

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

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

View Source
const DefinitionName = "ego"

DefinitionName is the durable loops-ng definition name for the ego service.

Variables

This section is empty.

Functions

func BuildLoopConfig

func BuildLoopConfig(cfg Config) loop.Config

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

func BuildSpec(cfg Config) loop.Spec

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

func DefinitionSpec(cfg Config) loop.Spec

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.

func HydrateSpec

func HydrateSpec(spec loop.Spec, cfg Config) loop.Spec

HydrateSpec attaches the runtime-only hooks needed to execute the ego service from a durable loops-ng definition.

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

func ParseConfig(raw config.EgoConfig) (Config, error)

ParseConfig converts a config.EgoConfig (string durations) into a Config (time.Duration fields). Call after config validation has passed.

Jump to

Keyboard shortcuts

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