status

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package status defines shared execution-model types for ralphex. signal constants, phase types, and section types used by processor, executor, progress, and web packages.

Index

Constants

View Source
const (
	Completed  = "<<<RALPHEX:ALL_TASKS_DONE>>>"
	Failed     = "<<<RALPHEX:TASK_FAILED>>>"
	ReviewDone = "<<<RALPHEX:REVIEW_DONE>>>"
	CodexDone  = "<<<RALPHEX:CODEX_REVIEW_DONE>>>"
	Question   = "<<<RALPHEX:QUESTION>>>"
	PlanReady  = "<<<RALPHEX:PLAN_READY>>>"
	PlanDraft  = "<<<RALPHEX:PLAN_DRAFT>>>"
)

signal constants using <<<RALPHEX:...>>> format for clear detection.

Variables

This section is empty.

Functions

This section is empty.

Types

type Phase

type Phase string

Phase represents execution phase for color coding.

const (
	PhaseTask       Phase = "task"        // execution phase (green)
	PhaseReview     Phase = "review"      // code review phase (cyan)
	PhaseCodex      Phase = "codex"       // codex analysis phase (magenta)
	PhaseClaudeEval Phase = "claude-eval" // claude evaluating codex (bright cyan)
	PhasePlan       Phase = "plan"        // plan creation phase (info color)
	PhaseFinalize   Phase = "finalize"    // finalize step phase (green)
)

Phase constants for execution stages.

type PhaseHolder added in v0.10.0

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

PhaseHolder stores the current execution phase in a thread-safe way. it is the single source of truth for the current phase across all components.

func (*PhaseHolder) Get added in v0.10.0

func (h *PhaseHolder) Get() Phase

Get returns the current phase.

func (*PhaseHolder) OnChange added in v0.10.0

func (h *PhaseHolder) OnChange(fn func(old, cur Phase))

OnChange registers a callback that fires when the phase changes. only one callback is supported; subsequent calls replace the previous one.

func (*PhaseHolder) Set added in v0.10.0

func (h *PhaseHolder) Set(p Phase)

Set updates the current phase and fires the OnChange callback if the phase changed.

type Section

type Section struct {
	Type      SectionType
	Iteration int    // 0 for non-iterated sections
	Label     string // human-readable display text
}

Section carries structured information about a section header. instead of parsing section names with regex, consumers can access the Type and Iteration fields directly.

use the provided constructors (NewTaskIterationSection, etc.) to create sections with proper Type/Iteration/Label consistency.

func NewClaudeEvalSection

func NewClaudeEvalSection() Section

NewClaudeEvalSection creates a section for Claude evaluating codex findings.

func NewClaudeReviewSection

func NewClaudeReviewSection(iteration int, suffix string) Section

NewClaudeReviewSection creates a section for Claude review iteration. suffix is appended after the iteration number (e.g., ": critical/major").

func NewCodexIterationSection

func NewCodexIterationSection(iteration int) Section

NewCodexIterationSection creates a section for Codex review iteration.

func NewCustomIterationSection

func NewCustomIterationSection(iteration int) Section

NewCustomIterationSection creates a section for custom review tool iteration.

func NewGenericSection

func NewGenericSection(label string) Section

NewGenericSection creates a static section header with no iteration.

func NewPlanIterationSection

func NewPlanIterationSection(iteration int) Section

NewPlanIterationSection creates a section for plan creation iteration.

func NewTaskIterationSection

func NewTaskIterationSection(iteration int) Section

NewTaskIterationSection creates a section for task execution iteration.

type SectionType

type SectionType int

SectionType represents the semantic type of a section header. the web layer uses these types to emit appropriate boundary events:

  • SectionTaskIteration: emits task_start/task_end events
  • SectionClaudeReview, SectionCodexIteration: emits iteration_start events
  • SectionGeneric, SectionClaudeEval: no boundary events, just section headers

invariants:

  • Iteration > 0 for SectionTaskIteration, SectionClaudeReview, SectionCodexIteration
  • Iteration == 0 for SectionGeneric, SectionClaudeEval

prefer using the constructor functions (NewTaskIterationSection, etc.) to ensure these invariants are maintained.

const (
	// SectionGeneric is a static section header with no iteration.
	SectionGeneric SectionType = iota
	// SectionTaskIteration represents a task execution iteration.
	SectionTaskIteration
	// SectionClaudeReview represents a Claude review iteration.
	SectionClaudeReview
	// SectionCodexIteration represents a Codex review iteration.
	SectionCodexIteration
	// SectionClaudeEval represents Claude evaluating codex findings.
	SectionClaudeEval
	// SectionPlanIteration represents a plan creation iteration.
	SectionPlanIteration
	// SectionCustomIteration represents a custom review tool iteration.
	SectionCustomIteration
)

Jump to

Keyboard shortcuts

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