Expand description
File I/O operations for Ralph’s agent files.
This module handles basic file input/output operations:
- Agent directory management (.agent/)
- Commit message file operations
- Context cleanup and file operations
- Error recovery for file operations
- File integrity and atomic writes
- PROMPT.md backup management
§Submodules
- [
integrity] - File integrity and atomic writes - [
recovery] - Error recovery and state repair context- Context file management (STATUS.md, NOTES.md, ISSUES.md)agent_files- Agent file operations (ensure_files, commit message, etc.)backup- PROMPT.md backup and read-only protection
§File Operations
All file operations should go through the Workspace trait for testability.
See crate::workspace for the Workspace trait and MemoryWorkspace for testing.
Re-exports§
pub use agent_files::cleanup_generated_files_with_workspace;pub use agent_files::delete_commit_message_file_with_workspace;pub use agent_files::delete_plan_file_with_workspace;pub use agent_files::ensure_files_with_workspace;pub use agent_files::file_contains_marker;pub use agent_files::file_contains_marker_with_workspace;pub use agent_files::read_commit_message_file_with_workspace;pub use agent_files::setup_xsd_schemas_with_workspace;pub use agent_files::write_commit_message_file_with_workspace;pub use agent_files::GENERATED_FILES;pub use backup::create_prompt_backup;pub use backup::create_prompt_backup_with_workspace;pub use backup::make_prompt_read_only;pub use backup::make_prompt_read_only_with_workspace;pub use backup::make_prompt_writable;pub use backup::make_prompt_writable_with_workspace;pub use backup::write_diff_backup_with_workspace;pub use context::clean_context_for_reviewer;pub use context::clean_context_for_reviewer_with_workspace;pub use context::delete_issues_file_for_isolation;pub use context::delete_issues_file_for_isolation_with_workspace;pub use context::reset_context_for_isolation;pub use context::update_status;pub use context::update_status_with_workspace;
Modules§
- agent_
files - Agent file management for the
.agent/directory. - backup
- Backup management for PROMPT.md.
- context
- Context file management for Ralph’s agent files.
Structs§
Enums§
- Recovery
Status - Status of a recovery operation.
Functions§
- auto_
repair - Best-effort repair of common
.agent/state issues. - auto_
repair_ with_ workspace - Best-effort repair of common
.agent/state issues using workspace. - check_
and_ cleanup_ xml_ before_ retry_ with_ workspace - Check if a specific XML file is writable before agent retry using workspace.
- check_
filesystem_ ready_ with_ workspace - Verify that the filesystem is ready for
.agent/file operations. - check_
xml_ file_ writable_ with_ workspace - Check if a specific XML file is writable and clean up if locked.
- cleanup_
stale_ xml_ files_ with_ workspace - Check and clean up all XML files in .agent/tmp/ directory using workspace.
- verify_
file_ not_ corrupted_ with_ workspace - Validate that a file is readable UTF-8 text and within size limits using workspace.
- write_
file_ atomic_ with_ workspace - Write file content atomically using the workspace abstraction.