Skip to content

fix(worktree): keep ralph config/state in project root#14

Open
adinvadim wants to merge 1 commit intoiannuttall:mainfrom
adinvadim:fix/worktree-config-root
Open

fix(worktree): keep ralph config/state in project root#14
adinvadim wants to merge 1 commit intoiannuttall:mainfrom
adinvadim:fix/worktree-config-root

Conversation

@adinvadim
Copy link
Copy Markdown

Summary

  • Introduces RALPH_WORKTREE env var to separate code-working-directory from ralph-config-root
  • RALPH_ROOT no longer gets overridden to the worktree path, so prompt templates and config under .agents/ralph/ are always found
  • Git operations and {{REPO_ROOT}} template variable use the new WORK_DIR (worktree when active, project root otherwise)

Path routing

Path Resolves via In worktree mode
.agents/ralph/PROMPT_build.md ROOT_DIR project root
.ralph/progress.md, logs, runs ROOT_DIR project root
{{REPO_ROOT}} in prompt WORK_DIR worktree
git -C commands WORK_DIR worktree

Files changed

  • bin/ralph — set RALPH_WORKTREE instead of overriding RALPH_ROOT
  • .agents/ralph/loop.sh — add WORK_DIR, use it for git ops and prompt rendering

Test plan

  • npm test — existing smoke tests pass
  • Manual: ralph build --worktree with untracked .agents/ralph/ dir finds prompts correctly

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant