mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-25 15:15:57 +03:00
[GH-ISSUE #98] (feat) Support variable substitution in config paths #40
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#40
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?
Originally created by @cdriscol on GitHub (Jan 23, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/98
I want to group scratchpads with their related work so I can check them into the repo alongside each feature. For a lot of my flows, I use the scratchpad as a task tracker and create detailed spec files as Ralph runs. It would be nice to have the option to group all of that in a common folder.
I'm also open to suggestions or being told I'm doing this wrong—maybe scratchpad should be ignored?
I group things like this:
Currently, paths like
.ralph/{feature}/scratchpad.mdare read literally—{feature}isn't substituted. This causes scratchpad verification to fail andLOOP_COMPLETEto be rejected, resulting in infinite loops.Proposed Solutions
Option A: Config-declared variables with CLI override
Missing required variables fail fast with a helpful error. This could also support other variables if needed (e.g., conditional logic based on env) and defaults.
Option B: CLI flag for scratchpad path
Open to other ideas too.
@mikeyobrien commented on GitHub (Jan 23, 2026):
Try using
ralph planon what you are thinking, share the detailed design that it spits out.@cdriscol commented on GitHub (Jan 24, 2026):
Detailed Design: CLI Config Overrides for Core Fields
Overview
This document describes the implementation of CLI config overrides for
core.*fields in Ralph, enabling users to specify configuration values directly from the command line using the existing-cflag withkey=valuesyntax.Detailed Requirements
Functional Requirements
Extended
-cflag syntax: The-cflag accepts both file paths andkey=valueoverridesPrecedence: CLI overrides take precedence over config file values
Scope: Only
core.*fields are overridable in this implementationcore.scratchpad— Path to scratchpad filecore.specs_dir— Path to specs directoryDirectory auto-creation: When scratchpad path specifies non-existent parent directories, create them automatically
Validation: Warn (don't error) on unknown field names to catch typos while remaining flexible
Non-Functional Requirements
-c file.ymlusage unchangedArchitecture Overview
Components and Interfaces
1. ConfigSource Extension
File:
crates/ralph-cli/src/main.rsExtend
ConfigSourceenum to handle inline overrides:2. CLI Argument Changes
File:
crates/ralph-cli/src/main.rsChange
-cfrom single value to multiple values:3. Override Application
File:
crates/ralph-cli/src/main.rsNew function to apply overrides:
4. Directory Auto-Creation
File:
crates/ralph-cli/src/main.rsAdd directory creation after config is finalized:
5. Updated run_command Flow
File:
crates/ralph-cli/src/main.rsData Models
No new data models required. Uses existing:
RalphConfig— Top-level configurationCoreConfig— Core settings including scratchpadConfigSource— Extended withOverridevariantError Handling
core.*fieldcore.*overrideTesting Strategy
Unit Tests
ConfigSource parsing
"ralph.yml"→File"core.scratchpad=path"→Override"builtin:default"→Builtin"https://..."→RemoteOverride application
Precedence
Integration Tests
End-to-end override
Verify scratchpad path in dry-run output.
Directory creation
Smoke Tests
Add fixture test for config override:
Appendices
A. Technology Choices
-cflagkey=valuesyntaxB. Alternative Approaches Considered
Dedicated
--setflag (like Helm)-calready overloadedFull variable substitution (
{feature}syntax)Strict validation (error on unknown)
C. Research Findings Summary
-conly handles file paths--backend, etc.)CoreConfighasscratchpadandspecs_diras primary path fieldsresolve_path()handles relative → absolute conversionD. Future Extensions
If more overrides are needed later:
KNOWN_CORE_FIELDSconstantapply_config_overrides()event_loop.*andcli.*sections if demand exists@mikeyobrien commented on GitHub (Jan 24, 2026):
LGTM, feel free to implement and raise a PR.
@mikeyobrien commented on GitHub (Jan 25, 2026):
Closed by #115 - config override support for core fields has been implemented and merged.