fix(worktree): keep ralph config/state in project root#14
Open
adinvadim wants to merge 1 commit intoiannuttall:mainfrom
Open
fix(worktree): keep ralph config/state in project root#14adinvadim wants to merge 1 commit intoiannuttall:mainfrom
adinvadim wants to merge 1 commit intoiannuttall:mainfrom
Conversation
Introduce RALPH_WORKTREE env var to separate the code-working-directory from the ralph-config-root. Previously RALPH_ROOT was overridden to the worktree path, causing prompt templates and other untracked config files under .agents/ralph/ to not be found. Now RALPH_ROOT always points to the project root (config, state, prompts) while WORK_DIR (derived from RALPH_WORKTREE) is used for git operations and the agent's REPO_ROOT template variable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RALPH_WORKTREEenv var to separate code-working-directory from ralph-config-rootRALPH_ROOTno longer gets overridden to the worktree path, so prompt templates and config under.agents/ralph/are always found{{REPO_ROOT}}template variable use the newWORK_DIR(worktree when active, project root otherwise)Path routing
.agents/ralph/PROMPT_build.md.ralph/progress.md, logs, runs{{REPO_ROOT}}in promptgit -CcommandsFiles changed
bin/ralph— setRALPH_WORKTREEinstead of overridingRALPH_ROOT.agents/ralph/loop.sh— addWORK_DIR, use it for git ops and prompt renderingTest plan
npm test— existing smoke tests passralph build --worktreewith untracked.agents/ralph/dir finds prompts correctly