Skip to content

Fix template-proposer simulation worktree portability#33

Open
alanshurafa wants to merge 1 commit into
masterfrom
fix/template-proposer-worktree-portability
Open

Fix template-proposer simulation worktree portability#33
alanshurafa wants to merge 1 commit into
masterfrom
fix/template-proposer-worktree-portability

Conversation

@alanshurafa

Copy link
Copy Markdown
Owner

What this fixes

tests/template-proposer-simulation.sh failed 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 passed PEL_TEMPLATE_PATH as a relative path, 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. PEL_EVAL_REPORT was already absolute, which is why only the template path broke.

Fix

cd "$REPO_ROOT" at the top of the suite -- the working directory proposer.sh's git-apply gate also expects. proposer.sh is unchanged; its in-REPO_ROOT guard 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

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>
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