ralph

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine orchestrates the Ralph Wiggum loop

func NewEngine

func NewEngine(cfg *config.Config, mem *memory.Service, projectID string, logger *zap.Logger) *Engine

NewEngine creates a new Ralph engine

func (*Engine) ExecuteLoop

func (e *Engine) ExecuteLoop(ctx context.Context, opt Options) (*Result, error)

ExecuteLoop runs the autonomous repair loop

type HumanGate

type HumanGate struct {
	OnAmbiguity     bool `json:"on_ambiguity"`
	AfterIterations int  `json:"after_iterations"`
}

HumanGate configures when to pause for user intervention

type IterationState

type IterationState struct {
	Iteration int
	ExitCode  int
	Stdout    string
	Stderr    string
	Duration  time.Duration
	Diff      string
}

IterationState holds the runtime data for the current loop iteration

type LogEntry

type LogEntry struct {
	Iteration int     `json:"iteration"`
	Result    string  `json:"result"`
	Duration  float64 `json:"duration_ms"`
	Error     string  `json:"error,omitempty"`
}

LogEntry records the outcome of a single iteration

type Options

type Options struct {
	Task          string        `json:"task"`
	Command       string        `json:"command"`
	Evidence      []string      `json:"evidence"`
	MaxIterations int           `json:"max_iterations"`
	Recall        RecallOptions `json:"recall"`
	Safety        SafetyOptions `json:"safety"`
	HumanGate     HumanGate     `json:"human_gate"`
}

Options represents the input configuration for memory_ralph

type RecallOptions

type RecallOptions struct {
	QueryTerms []string `json:"query_terms"`
	Limit      int      `json:"limit"`
}

RecallOptions configures how memories are retrieved during the loop

type Result

type Result struct {
	Status     Status                 `json:"status"`
	Iterations int                    `json:"iterations"`
	Evidence   map[string]interface{} `json:"evidence"`
	FinalDiff  string                 `json:"final_diff"`
	MemoryUsed []string               `json:"memory_used"`
	Log        []LogEntry             `json:"log"`
}

Result is the output of the memory_ralph tool

type SafetyOptions

type SafetyOptions struct {
	ForbidPaths       []string `json:"forbid_paths"`
	ForbidCommands    []string `json:"forbid_commands"`
	AllowShell        bool     `json:"allow_shell"`
	RequireDiffReview bool     `json:"require_diff_review"`
}

SafetyOptions defines restrictions for autonomous actions

type Status

type Status string

Status represents the final state of a Ralph loop

const (
	StatusSuccess Status = "success"
	StatusAborted Status = "aborted"
	StatusFailed  Status = "failed"
)

Jump to

Keyboard shortcuts

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