fix: drop the committed core dist symlink and close the ignore gap - #1283
Merged
Conversation
A `packages/core/dist` symlink reached main. It held an absolute path into one machine's home directory, so it dangles in every other clone and shadows the directory the core build writes to. It got in because `.gitignore` listed `dist/` with a trailing slash, which matches a directory only. Git does not treat a symlink as a directory, so the pattern never applied and a `git add -A` swept it up. The entry is now slash-free for dist, build, and out, which matches the name either way. A fresh worktree has no built dist (#954), so borrowing one from the primary checkout with a symlink stays the right local workaround. It just must never be committed, and the next borrowed path will not necessarily be called dist, so the regression test asserts the general shape: no tracked symlink may resolve outside the repo root. In-repo symlinks are untouched, since several are load-bearing.
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
A
packages/core/distsymlink reachedmainin #1272. It holds an absolute path into one machine's home directory, so it dangles in every other clone and shadows the directory the core build writes to.It got in because
.gitignorelisteddist/with a trailing slash, which matches a directory only. Git does not treat a symlink as a directory, so the pattern never applied and agit add -Aswept it up. The entry is now slash-free fordist,build, andout, which matches the name either way.A fresh worktree has no built dist (#954), so borrowing one from the primary checkout with a symlink stays the right local workaround. It just must never be committed.
The second one this turned up
Writing the regression test surfaced a pre-existing instance of the same defect:
.agents/skills/omarchywas tracked as a symlink to/home/vivek/.local/share/omarchy/default/omarchy-skill, so it has been dangling in every clone and in CI. Untracked here withgit rm --cached, which leaves the file on disk so the local setup keeps resolving it, plus a.gitignoreentry explaining why. Nothing in the repo references that path, andtest/hooks/route-skills.test.mjs(16/16) still passes, so no skill routing depended on it.The test
test/repo-health/no-committed-symlinks.test.mjs, two assertions:distspecial case, because the next borrowed path will not necessarily be calleddist. In-repo symlinks are untouched, since several are load-bearing (the vendored nvim intellisense copy, the ui registry), so the rule is about ESCAPING the repo, not about symlinks as such.Both read the committed state via
git ls-files -s/git show HEAD:, so they assert what is actually in the repo rather than what happens to be in a working tree.Counterfactual: both assertions were run against
afc1170e(main with the symlink and the old.gitignore) before the fix commit and both failed there, assertion 1 naming both symlinks and assertion 2 namingdist/. They pass on this branch.Test plan
test/repo-health/no-committed-symlinks.test.mjs2/2, and the wholetest/repo-healthsuite 63/63.test/hooks/route-skills.test.mjs16/16, confirming the untracked skill symlink broke no routing.git statusclean after the change, so the new ignore rules actually cover the local workaround files.Doc surfaces
N/A across the board. No public API, CLI flag, config key, or runtime behaviour changed. The reasoning lives in the
.gitignorecomments and the test's module docblock, which is where someone hitting this next will look.