Documentation
¶
Overview ¶
Ralph orchestration matches workflow/tool-ralph. Each round starts a fresh child agent for a fixed goal and receives a structured report. Continue carries a bounded handoff to the next round; complete succeeds, blocked needs human input, and exhausting maxRounds produces budget-limited.
Package workflow provides workflow orchestration and tool-workflow (S12), matching workflow/workflow upstream. Top-level Pipeline, Parallel, and Agent functions compose named executable Steps. Pipelines run serially, while parallel workflows run concurrent goroutines and aggregate ordered outputs. Context cancellation cascades to active steps; Result includes outputs and cancellation.
Index ¶
Constants ¶
const DefaultRalphMaxRounds = 256
DefaultRalphMaxRounds is the default round limit.
Variables ¶
This section is empty.
Functions ¶
func ValidateReport ¶
func ValidateReport(r RoundReport) error
ValidateReport checks report consistency with its status.
Types ¶
type RalphResult ¶
type RalphResult struct {
Status RunStatus
Rounds int
Final RoundReport
}
RalphResult contains the loop result.
func RunRalph ¶
func RunRalph(ctx context.Context, objective string, runner RoundRunner, maxRounds, maxHandoffChars int) (*RalphResult, error)
RunRalph uses default rounds when maxRounds is nonpositive and enforces handoff length when maxHandoffChars is positive.
type Result ¶
type Result struct {
Name string `json:"name"`
Outputs []string `json:"outputs"` // Step outputs in order.
Cancelled bool `json:"cancelled"` // Whether execution was canceled.
}
Result contains a workflow's output.
type RoundReport ¶
type RoundReport struct {
Status RoundStatus `json:"status"`
Summary string `json:"summary"`
Evidence string `json:"evidence"`
NextSteps []string `json:"nextSteps"`
Blocker string `json:"blocker"`
}
RoundReport is a child agent's structured report.
type RoundRunner ¶
type RoundRunner func(ctx context.Context, objective, priorHandoff string) (RoundReport, error)
RoundRunner receives the goal and previous handoff (empty initially) and returns a round report.
type RoundStatus ¶
type RoundStatus string
RoundStatus identifies a round's outcome.
const ( StatusContinue RoundStatus = "continue" StatusComplete RoundStatus = "complete" StatusBlocked RoundStatus = "blocked" )
type SpawnAgentFunc ¶
SpawnAgentFunc is injected to run a child on a named backend and return output.
type Step ¶
type Step struct {
Name string // Step name for diagnostics and summaries.
Run StepRunFunc
}
Step is the smallest executable workflow unit.
func Agent ¶
func Agent(name, backendName, input string, spawn SpawnAgentFunc) *Step
Agent creates a child-agent step using the selected in-process, acp, or fork-copy backend.
type StepRunFunc ¶
StepRunFunc executes a step and should return promptly when ctx is canceled.