Fix template-proposer simulation worktree portability#33
Open
alanshurafa wants to merge 1 commit into
Open
Conversation
The suite passed PEL_TEMPLATE_PATH to proposer.sh as a relative path (tests/fixtures/templates/...), which proposer.sh resolves with `realpath -m` against the current directory before checking it sits inside REPO_ROOT. The suite never cd'd to its own REPO_ROOT, so the relative path resolved against the caller's cwd: it passed only when invoked from its own checkout and failed 7/8 from any other git worktree (and would fail on a fresh CI runner). PEL_EVAL_REPORT was already absolute, which is why only the template path broke. cd to REPO_ROOT at startup -- the working dir proposer.sh's git-apply gate also expects. proposer.sh is unchanged; its in-REPO_ROOT guard is correct and must not be weakened. Verified 8/8 both from a foreign cwd and from the suite's own checkout (previously 1/8 from a foreign cwd). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What this fixes
tests/template-proposer-simulation.shfailed 7 of 8 scenarios when run from any git worktree other than the one matching the caller's working directory (and would fail on a fresh CI runner). It passedPEL_TEMPLATE_PATHas a relative path, whichproposer.shresolves withrealpath -magainst the current directory before checking it sits insideREPO_ROOT. The suite nevercd'd to its ownREPO_ROOT, so the relative path resolved against the caller's cwd.PEL_EVAL_REPORTwas already absolute, which is why only the template path broke.Fix
cd "$REPO_ROOT"at the top of the suite -- the working directoryproposer.sh's git-apply gate also expects.proposer.shis unchanged; its in-REPO_ROOTguard is correct and is not weakened.Verification
8/8 from a foreign cwd (previously 1/8) and 8/8 from the suite's own checkout.
Surfaced during the performance-audit Phase 1 work; relevant to Phase 2 (a fresh CI runner would hit the same failure).
🤖 Generated with Claude Code