fix(setup): ignore the snapshot symlink that worktree-init creates - #1092
Open
potiuk wants to merge 1 commit into
Open
fix(setup): ignore the snapshot symlink that worktree-init creates#1092potiuk wants to merge 1 commit into
potiuk wants to merge 1 commit into
Conversation
The gitignore entries adopt writes use `/.apache-magpie/` and `/.apache-magpie-sources/`. A `dir/`-style pattern matches only directories, and only the main checkout has directories there -- worktree-init deliberately replaces both with symlinks to the main checkout's copies so every worktree shares one framework state and picks up `/magpie-setup upgrade` automatically. The result is that both entries show as untracked in every worktree of every adopter. That is `git status` noise on its own, and one careless `git add -A` away from committing a symlink whose target is a machine-local absolute path. Dropping the trailing slash matches the directory, its contents, and the symlink alike, so the main checkout is unaffected. verify's check 4 is updated to expect the unslashed form and to say that a legacy `/.apache-magpie/` entry is a finding -- it passes in the main checkout and fails in every worktree, so it has to be checked from a worktree to be seen at all. Found while adopting the framework in apache/airflow, where the adopter-side entry is fixed separately.
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.
Summary
adoptwrites/.apache-magpie/and/.apache-magpie-sources/into the adopter's.gitignore. Adir/-style pattern matches only directories — but only the main checkout has directories there.worktree-initdeliberately replaces both with symlinks to the main checkout's copies so every worktree shares one framework state and picks up/magpie-setup upgradeautomatically.git statusnoise on its own, and one carelessgit add -Aaway from committing a symlink whose target is a machine-local absolute path.verifycheck 4 is updated to expect the unslashed form and to flag a legacy/.apache-magpie/entry as a finding.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
Verified the pattern semantics directly in a scratch repo, with
/.apache-magpieas the only ignore line:and confirmed the old
/.apache-magpie/pattern reports the symlink as not ignored, reproducing the bug.Also confirmed against a live adopter (
apache/airflow, worktree off the main checkout):git statusreported?? .apache-magpiebefore, and is clean after.prek run --all-filespasses — not run; the pre-commit hooks ran on the changed files at commit time and passed, includingsymlink-lintandskill-and-tool-validate.gitignoreentry list.grep -rn '^/\.apache-magpie/$' tools/skill-evals/evals/returns nothing, andtools/skill-evals/evals/setup/has no fixture mentioninggitignore, so there is no fixture to update and no existing eval this can regress. Happy to add asetupeval case pinning the entry list if you'd like the behaviour locked down.RFC-AI-0004 compliance
Linked issues
None filed — found while adopting the framework in
apache/airflow. The adopter-side.gitignoreentry there is being fixed separately; this PR fixes the source that generates it for every adopter.Notes for reviewers (optional)
Two judgement calls worth a look:
/.claude/hooks/guards.d/keeps its trailing slash.worktree-initcopies the guards rather than symlinking them, so it is a real directory in every worktree and the slash is correct there. Only the two entriesworktree-initsymlinks are changed.verifywording. I made the legacy slashed form an explicit ✗ rather than silently accepting both, and noted that the check has to run from a worktree to see the failure at all — in the main checkout the old pattern passes, which is exactly why this went unnoticed.