mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-24 22:55:57 +03:00
[PR #186] feat(loops): refactor scratchpad configuration to support per-hat set… #185
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#185
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/186
Author: @luisherranz
Created: 2/24/2026
Status: 🔄 Open
Base:
main← Head:feat/per-hat-scratchpad📝 Commits (2)
047b5d0feat(loops): refactor scratchpad configuration to support per-hat settingsabb75e4feat(loops): enhance scratchpad path resolution for per-hat overrides and add iteration tracking📊 Changes
15 files changed (+1052 additions, -113 deletions)
View changed files
📝
crates/ralph-cli/src/doctor.rs(+1 -0)📝
crates/ralph-cli/src/loop_runner.rs(+8 -8)📝
crates/ralph-cli/src/main.rs(+25 -22)📝
crates/ralph-core/src/config.rs(+418 -11)📝
crates/ralph-core/src/diagnostics/integration_tests.rs(+1 -1)📝
crates/ralph-core/src/event_loop/mod.rs(+101 -13)📝
crates/ralph-core/src/event_loop/tests.rs(+9 -6)📝
crates/ralph-core/src/hatless_ralph.rs(+379 -38)📝
crates/ralph-core/src/instructions.rs(+5 -1)📝
crates/ralph-core/src/lib.rs(+2 -2)📝
crates/ralph-core/src/preflight.rs(+2 -2)📝
docs/advanced/architecture.md(+3 -3)📝
docs/concepts/memories-and-tasks.md(+2 -0)📝
docs/guide/agents.md(+4 -2)📝
docs/guide/configuration.md(+92 -4)📄 Description
Summary
Closes https://github.com/mikeyobrien/ralph-orchestrator/issues/174.
Refactors the scratchpad configuration from a plain string path (
core.scratchpad: "...") into a structuredScratchpadConfigtype withenabledandpathfields, and adds per-hat scratchpad overrides so each hat can use a custom scratchpad path, disable scratchpad entirely, or inherit the global setting.ScratchpadConfigstruct with custom serde deserializers supporting both legacy plain-string and structured object YAML formats (backwards-compatible)scratchpadfield toHatConfigwith resolution order: hat override >core.scratchpad> defaultsHatlessRalphto conditionally suppress all scratchpad-related sections (ORIENTATION, SCRATCHPAD, STATE MANAGEMENT, WORKFLOW, EVENT WRITING) when scratchpad is disabledEventLoopto resolve per-hat scratchpad config before each iteration, skip scratchpad injection/verification when disabled, and fall back to global scratchpad for guidance persistenceTest plan
cargo test -p ralph-corepasses (includes 20+ new tests for scratchpad config parsing, resolution, prompt generation, and edge cases)cargo testpasses across all cratescore.scratchpad: "path"string format still works (backwards-compatible deserialization)core.scratchpad: { enabled: true, path: "..." }format worksscratchpadoverrides (plain string, structured, disabled, absent/inherit)enabled: false🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.