Expand description
§ralph-core
Core orchestration functionality for the Ralph Orchestrator framework.
This crate provides:
- The main orchestration loop for coordinating multiple agents
- Configuration loading and management
- State management for agent sessions
- Message routing between agents
- Terminal capture for session recording
- Benchmark task definitions and workspace isolation
Re-exports§
pub use diagnostics::DiagnosticsCollector;pub use file_lock::FileLock;pub use file_lock::LockGuard as FileLockGuard;pub use file_lock::LockedFile;pub use hooks::HookDefaults;pub use hooks::HookEngine;pub use hooks::HookExecutor;pub use hooks::HookExecutorContract;pub use hooks::HookExecutorError;pub use hooks::HookInvocationPayload;pub use hooks::HookMutationConfig;pub use hooks::HookOnError;pub use hooks::HookPayloadBuilderInput;pub use hooks::HookPayloadContext;pub use hooks::HookPayloadContextInput;pub use hooks::HookPayloadIteration;pub use hooks::HookPayloadLoop;pub use hooks::HookPayloadMetadata;pub use hooks::HookPhaseEvent;pub use hooks::HookRunRequest;pub use hooks::HookRunResult;pub use hooks::HookSpec;pub use hooks::HookStreamOutput;pub use hooks::HookSuspendMode;pub use hooks::HooksConfig;pub use hooks::ResolvedHookSpec;pub use hooks::SUSPEND_STATE_SCHEMA_VERSION;pub use hooks::SuspendLifecycleState;pub use hooks::SuspendStateRecord;pub use hooks::SuspendStateStore;pub use hooks::SuspendStateStoreError;pub use loop_completion::CompletionAction;pub use loop_completion::CompletionError;pub use loop_completion::LoopCompletionHandler;pub use loop_context::LoopContext;pub use loop_history::HistoryError;pub use loop_history::HistoryEvent;pub use loop_history::HistoryEventType;pub use loop_history::HistorySummary;pub use loop_history::LoopHistory;pub use loop_lock::LockError;pub use loop_lock::LockGuard;pub use loop_lock::LockMetadata;pub use loop_lock::LoopLock;pub use loop_registry::LoopEntry;pub use loop_registry::LoopRegistry;pub use loop_registry::RegistryError;pub use merge_queue::MergeButtonState;pub use merge_queue::MergeEntry;pub use merge_queue::MergeEvent;pub use merge_queue::MergeEventType;pub use merge_queue::MergeOption;pub use merge_queue::MergeQueue;pub use merge_queue::MergeQueueError;pub use merge_queue::MergeState;pub use merge_queue::SteeringDecision;pub use merge_queue::merge_execution_summary;pub use merge_queue::merge_needs_steering;pub use merge_queue::smart_merge_summary;pub use planning_session::ConversationEntry;pub use planning_session::ConversationType;pub use planning_session::PlanningSession;pub use planning_session::PlanningSessionError;pub use planning_session::SessionMetadata;pub use planning_session::SessionStatus;pub use preflight::AcceptanceCriterion;pub use preflight::CheckResult;pub use preflight::CheckStatus;pub use preflight::PreflightCheck;pub use preflight::PreflightReport;pub use preflight::PreflightRunner;pub use preflight::extract_acceptance_criteria;pub use preflight::extract_all_criteria;pub use preflight::extract_criteria_from_file;pub use skill::SkillEntry;pub use skill::SkillFrontmatter;pub use skill::SkillSource;pub use skill::parse_frontmatter;pub use skill_registry::SkillRegistry;pub use task::Task;pub use task::TaskStatus;pub use task_definition::TaskDefinition;pub use task_definition::TaskDefinitionError;pub use task_definition::TaskSetup;pub use task_definition::TaskSuite;pub use task_definition::Verification;pub use task_store::TaskStore;pub use wave_detection::DetectedWave;pub use wave_detection::detect_wave_events;pub use wave_prompt::WaveWorkerContext;pub use wave_prompt::build_wave_worker_prompt;pub use wave_tracker::CompletedWave;pub use wave_tracker::WaveFailure;pub use wave_tracker::WaveProgress;pub use wave_tracker::WaveResult;pub use wave_tracker::WaveTracker;pub use workspace::CleanupPolicy;pub use workspace::TaskWorkspace;pub use workspace::VerificationResult;pub use workspace::WorkspaceError;pub use workspace::WorkspaceInfo;pub use workspace::WorkspaceManager;pub use worktree::SyncStats;pub use worktree::Worktree;pub use worktree::WorktreeConfig;pub use worktree::WorktreeError;pub use worktree::create_worktree;pub use worktree::ensure_gitignore;pub use worktree::list_ralph_worktrees;pub use worktree::list_worktrees;pub use worktree::remove_worktree;pub use worktree::sync_working_directory_to_worktree;pub use worktree::worktree_exists;
Modules§
- diagnostics
- Diagnostic logging system for Ralph orchestration.
- file_
lock - File locking for shared resources in multi-loop scenarios.
- hooks
- Lifecycle hook runtime contracts and orchestration primitives.
- loop_
completion - Loop completion handler for worktree-based loops.
- loop_
context - Loop context for path resolution in multi-loop scenarios.
- loop_
history - Event-sourced loop history for crash recovery and debugging.
- loop_
lock - Loop lock mechanism for preventing concurrent Ralph loops in the same workspace.
- loop_
registry - Loop registry for tracking active Ralph loops across workspaces.
- memory_
parser - Markdown parser for the memories file format.
- merge_
queue - Merge queue for tracking parallel loop merges.
- planning_
session - Planning session management for human-in-the-loop workflows.
- preflight
- Preflight checks for validating environment and configuration before running.
- skill
- Skill data types and frontmatter parser.
- skill_
registry - Skill registry for discovering, storing, and providing access to skills.
- task
- Task tracking for Ralph.
- task_
definition - Task definition types for benchmark harness.
- task_
store - Persistent task storage with JSONL format.
- testing
- Testing utilities for deterministic E2E tests.
- utils
- Utility functions for common operations.
- wave_
detection - Wave event detection from JSONL events.
- wave_
prompt - Wave worker prompt builder.
- wave_
tracker - Wave tracking state machine for concurrent hat execution.
- workspace
- Workspace isolation for benchmark tasks.
- worktree
- Git worktree management for parallel Ralph loops.
Structs§
- Auto
Commit Result - Result of an auto-commit operation.
- CliConfig
- CLI backend configuration.
- Core
Config - Core paths and settings shared across all hats.
- Event
- A simplified event for reading from JSONL.
- Event
History - Reader for event history files.
- Event
Logger - Logger that writes events to a JSONL file.
- Event
Loop - The main event loop orchestrator.
- Event
Loop Config - Event loop configuration.
- Event
Metadata - Metadata for an event topic.
- Event
Parser - Parser for extracting events from CLI output.
- Event
Reader - Reads new events from
.ralph/events.jsonlsince last read. - Event
Record - A logged event record for debugging.
- Features
Config - Feature flags for optional Ralph capabilities.
- Handoff
Result - Result of generating a handoff file.
- Handoff
Writer - Generates handoff files for session continuity.
- HatConfig
- Configuration for a single hat.
- HatInfo
- Information about a hat for prompt generation.
- HatRegistry
- Registry for managing and creating hats from configuration.
- HatTopology
- Hat topology for multi-hat mode prompt generation.
- Hatless
Ralph - Hatless Ralph - the constant coordinator.
- Instruction
Builder - Builds instructions for custom hats.
- Landing
Config - Configuration for the landing handler.
- Landing
Handler - Handler for the landing sequence.
- Landing
Result - Result of the landing sequence.
- Loop
Name Generator - Generator for human-readable loop names.
- Loop
Naming Config - Configuration for loop naming.
- Loop
State - Current state of the event loop.
- Malformed
Line - Information about a malformed JSONL line.
- Markdown
Memory Store - A store for managing memories in markdown format.
- Memories
Config - Memories configuration.
- Memories
Filter - Filter configuration for memory injection.
- Memory
- A single memory entry.
- Parse
Result - Result of parsing events from a JSONL file.
- Processed
Events - Result of processing events from JSONL.
- Processed
Events With Waves - Result of processing events from JSONL with wave events partitioned out.
- Ralph
Config - Top-level configuration for Ralph Orchestrator.
- Skill
Override - Per-skill configuration override.
- Skills
Config - Skills configuration.
- Summary
Writer - Writes the loop summary file on termination.
- Urgent
Steer Record - Urgent
Steer Store - User
Prompt - A user prompt that requires human input.
Enums§
- Config
Error - Configuration errors.
- GitOps
Error - Errors that can occur during git operations.
- Handoff
Error - Errors that can occur during handoff generation.
- HatBackend
- Backend configuration for a hat.
- Inject
Mode - Memory injection mode.
- Landing
Error - Errors that can occur during landing.
- Memory
Type - Classification of a memory.
- Termination
Reason - Reason the event loop terminated.
Constants§
- DEFAULT_
MEMORIES_ PATH - Default path for the memories file relative to the workspace root.
Functions§
- auto_
commit_ changes - Auto-commit any uncommitted changes in the repository.
- clean_
stashes - Clear all git stashes in the repository.
- floor_
char_ boundary - Finds the largest byte index <=
indexthat is a valid UTF-8 character boundary. - format_
memories_ as_ markdown - Formats memories as markdown for context injection.
- get_
commit_ summary - Get a short summary of the HEAD commit.
- get_
current_ branch - Get the current branch name.
- get_
head_ sha - Get the HEAD commit SHA.
- get_
recent_ files - Get a list of files that were modified in the most recent commits.
- has_
uncommitted_ changes - Check if the working directory has uncommitted changes.
- is_
working_ tree_ clean - Check if the working tree is clean (no uncommitted changes).
- prune_
remote_ refs - Prune stale remote-tracking references.
- truncate_
to_ budget - Truncates memory content to approximately fit within a token budget.
- truncate_
with_ ellipsis - Truncates a string to a maximum number of characters, including “…” if truncated.