fix(spawn): compare physical paths in treehouse wait loop for symlinked projects#273
Open
wuyuwenj wants to merge 6 commits into
Open
fix(spawn): compare physical paths in treehouse wait loop for symlinked projects#273wuyuwenj wants to merge 6 commits into
wuyuwenj wants to merge 6 commits into
Conversation
…ed projects The wait loop after 'treehouse get' polled the pane's PHYSICAL cwd but compared it against the logically-resolved PROJ_ABS. Through a symlinked projects/<name> the two differ from the first poll, so the loop broke before treehouse created the worktree, captured the project checkout as WT, and the isolation guard refused the launch. Keep waiting while the pane matches either the logical or physical project path. Regression test drives fm-spawn through a symlinked project dir with a stateful fake tmux whose first polls report the project's physical cwd.
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 Changed
bin/fm-spawn.sh's treehouse wait loop now resolves the project path physically (pwd -P) and keeps polling until the pane's path differs from both the logical and physical forms. Previously, when a project lived under a symlinked prefix (e.g. macOS's/tmp->/private/tmp), the backend-reported physical cwd differed from the logicalPROJ_ABSon the very first poll, breaking the loop beforetreehouse getmoved the pane, capturing the primary checkout as the worktree, and false-refusing the spawn at the isolation guard.tests/fm-spawn-symlink-wait.test.shas a regression test for the symlinked-project wait behavior (the pipeline's test stage runs it green with the rest of the suite).docs/herdr-backend.mdto mark the previously documented symlink-fragility gap as resolved, and added the new test (plus the pre-existingfm-gotmptest, an auto-fix from the pipeline's document stage) to CONTRIBUTING.md's test list.Risk Assessment
✅ Low: A one-line, backend-agnostic tightening of an existing comparison, guarded downstream by the existing worktree-isolation validator and covered by a new regression test that reproduces the original symlink failure.
Testing
Completed 1 recorded test check.
Pipeline
Updates from git push no-mistakes
⏭️ **intent** - skipped
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-spawn.sh:796- PROJ_PHYS=$(cd "$PROJ_ABS" && pwd -P) runs under set -e; if the cd ever failed the script would exit silently with no error message. PROJ_ABS was just resolved via a successful cd earlier in the same run, so this is practically unreachable — noted only for completeness.✅ **Test** - passed
✅ No issues found.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"🔧 **Document** - 1 issue found → auto-fixed ✅
CONTRIBUTING.md:73- Pre-existing gap unrelated to this change: tests/fm-gotmp.test.sh is missing from CONTRIBUTING.md's enumerated test list (it exists at the base commit, so it was not introduced by this diff); left untouched as out of scope.🔧 Fix: add fm-gotmp test to CONTRIBUTING test list
✅ Re-checked - no issues remain.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.