processor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package processor provides the main orchestration loop for ralphex execution.

Index

Constants

View Source
const (
	SignalCompleted  = "<<<RALPHEX:ALL_TASKS_DONE>>>"
	SignalFailed     = "<<<RALPHEX:TASK_FAILED>>>"
	SignalReviewDone = "<<<RALPHEX:REVIEW_DONE>>>"
	SignalCodexDone  = "<<<RALPHEX:CODEX_REVIEW_DONE>>>"
)

Signal constants for execution control. using <<<RALPHEX:...>>> format for clear detection.

Variables

This section is empty.

Functions

func IsCodexDone

func IsCodexDone(signal string) bool

IsCodexDone returns true if signal indicates codex phase is complete.

func IsReviewDone

func IsReviewDone(signal string) bool

IsReviewDone returns true if signal indicates review phase is complete.

func IsTerminalSignal

func IsTerminalSignal(signal string) bool

IsTerminalSignal returns true if signal indicates execution should stop.

Types

type Config

type Config struct {
	PlanFile         string         // path to plan file (required for full mode)
	ProgressPath     string         // path to progress file
	Mode             Mode           // execution mode
	MaxIterations    int            // maximum iterations for task phase
	Debug            bool           // enable debug output
	NoColor          bool           // disable color output
	IterationDelayMs int            // delay between iterations in milliseconds
	TaskRetryCount   int            // number of times to retry failed tasks
	CodexEnabled     bool           // whether codex review is enabled
	AppConfig        *config.Config // full application config (for executors and prompts)
}

Config holds runner configuration.

type Executor

type Executor interface {
	Run(ctx context.Context, prompt string) executor.Result
}

Executor runs CLI commands and returns results.

type Logger

type Logger interface {
	SetPhase(phase progress.Phase)
	Print(format string, args ...any)
	PrintRaw(format string, args ...any)
	PrintSection(name string)
	PrintAligned(text string)
	Path() string
}

Logger provides logging functionality.

type Mode

type Mode string

Mode represents the execution mode.

const (
	ModeFull      Mode = "full"       // full execution: tasks + reviews + codex
	ModeReview    Mode = "review"     // skip tasks, run full review pipeline
	ModeCodexOnly Mode = "codex-only" // skip tasks and first review, run only codex loop
)

type Runner

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

Runner orchestrates the execution loop.

func New

func New(cfg Config, log Logger) *Runner

New creates a new Runner with the given configuration.

func NewWithExecutors

func NewWithExecutors(cfg Config, log Logger, claude, codex Executor) *Runner

NewWithExecutors creates a new Runner with custom executors (for testing).

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

Run executes the main loop based on configured mode.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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