Skip to content

fix: worktree_create never writes through a symlinked activate.sh - #473

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/worktree-sh-root-activate-clobber
Oct 6, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/worktree-sh-root-activate-clobber

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #469

worktree_create no longer symlinks the names it writes itself (activate.sh, the root marker) into a bundle, and removes any pre-existing link before writing activate.sh — so a new bundle can no longer clobber the unversioned workspace-root file or retarget other bundles. Adds opt-in worktree_repair_activate (bundle paths only, never the root).

Tests: new tests/test_worktree_activate.py (4, hermetic fake PYAUTO_MAIN); full Brain suite 1199 passed. Each new test was red on the unfixed code first.

Heart: readiness STALE (release validation stale: source moved since rehearsal — PyAutoNerves); human-acknowledged 2026-10-05. Tier notify — auto-merge on green per the approved plan; PyAutoBrain has no PR test CI, so the gate is the local full suite above.

Part of bundle pyautobrain-worktree-guards (one issue + one PR per member). No workspace impact (Brain tooling only).

🤖 Generated with Claude Code

The sibling-symlink loop linked the workspace root's activate.sh into each
new bundle, and the bundle's activate.sh was then written through that link,
clobbering the unversioned root file and retargeting every earlier bundle.

- worktree_create skips the names it writes itself (activate.sh, the
  .pyauto-root marker) in both sibling-symlink loops, and rm -f's
  activate.sh before writing it so the write never follows a link.
- New opt-in worktree_repair_activate [task...]: regenerates symlinked
  bundle activate.sh files as regular files; bundle paths only, never
  resolves or writes the link target, never called automatically.
- tests/test_worktree_activate.py: hermetic fabricated PYAUTO_MAIN /
  PYAUTO_WT_ROOT; root bytes unchanged, bundles own regular activate.sh,
  second bundle does not retarget the first, repair converts links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…irewall)

Assert the bundle's activate.sh carries its own PYAUTO_ROOT and opens
PYTHONPATH with the bundle's PyAutoNerves path (an organ name) instead of
naming a satellite library, which tripped the organ-code tenant firewall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 9b73033 into main Oct 6, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/worktree-sh-root-activate-clobber branch October 6, 2026 08:09
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.

fix: worktree_create never writes through a symlinked activate.sh

1 participant