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 chaos_mode::CHAOS_COMPLETION_PROMISE;pub use chaos_mode::ChaosModeState;pub use diagnostics::DiagnosticsCollector;pub use file_lock::FileLock;pub use file_lock::LockGuard as FileLockGuard;pub use file_lock::LockedFile;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 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 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§
- chaos_
mode - Chaos Mode Runner
- diagnostics
- Diagnostic logging system for Ralph orchestration.
- file_
lock - File locking for shared resources in multi-loop scenarios.
- 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.
- 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.
- workspace
- Workspace isolation for benchmark tasks.
- worktree
- Git worktree management for parallel Ralph loops.
Structs§
- Auto
Commit Result - Result of an auto-commit operation.
- Chaos
Mode Config - Chaos mode configuration.
- CliCapture
- A writer that captures all output while forwarding to an inner writer.
- CliCapture
Pair - A pair of capture wrappers for stdout and stderr.
- 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.
- Player
Config - Configuration for session playback.
- Ralph
Config - Top-level configuration for Ralph Orchestrator.
- Record
- A timestamped record in the JSONL session file.
- Session
Player - Plays back recorded sessions.
- Session
Recorder - Records session events to a JSONL output.
- Summary
Writer - Writes the loop summary file on termination.
- Timestamped
Record - A parsed record with timing information for replay.
- User
Prompt - A user prompt that requires human input.
Enums§
- Chaos
Output - Output type that chaos mode can create.
- 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.
- Replay
Mode - Replay mode for session playback.
- Research
Focus - Research focus area for chaos mode.
- Termination
Reason - Reason the event loop terminated.
- User
Prompt Error - Error that can occur while waiting for user response.
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.
- 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, adding “…” if truncated.