fix(yield): case-insensitive canonical repo grouping via realpathSync.native#751
Open
ozymandiashh wants to merge 1 commit into
Open
fix(yield): case-insensitive canonical repo grouping via realpathSync.native#751ozymandiashh wants to merge 1 commit into
ozymandiashh wants to merge 1 commit into
Conversation
….native Follow-up to getagentseal#719, closing the two deltas flagged in the getagentseal#714 discussion: - fs.realpathSync preserves the caller's path casing on case-insensitive filesystems (macOS APFS, Windows), so the same repo reached through differently cased paths produced distinct canonical keys and split into separate groups. fs.realpathSync.native returns the on-disk casing, making the canonical key truly canonical. Regression test creates a real repo, references it through altered casing (guarded to case-insensitive filesystems), and asserts one group. - Documents the accepted residual: a main repo moved on disk after 'git worktree add' leaves git's linked-worktree metadata stale, so its worktrees may not unify; that is git-state staleness, not a grouping bug.
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.
The focused follow-up you invited in the #714 discussion, covering the two deltas over #719 — one of which turned out to be a live gap, not just missing coverage.
Case-insensitivity was not actually covered
fs.realpathSyncpreserves the caller's path casing; onlyfs.realpathSync.nativereturns the on-disk casing. Verified empirically on macOS APFS:So #719's canonicalization still produced distinct keys for the same repo reached through differently cased paths (a shell tab-completed path vs a tool-emitted lowercase path, for example), splitting one repo into separate groups on macOS and Windows. The fix is the one-line switch to
realpathSync.nativeinside the existing try/catch (failure fallback semantics unchanged), plus a regression test that creates a real repo, references it through altered casing, and asserts a single group — guarded so it only asserts strict equality on filesystems that are actually case-insensitive.The documented residual
The second delta from #714's writeup, now a short comment at the canonicalization site: a main repo moved on disk after
git worktree addleaves git's own linked-worktree metadata stale, so its worktrees may not unify. That is git-state staleness, not a grouping bug.npx tsc --noEmitclean, yield grouping suite green (4/4). Closes the delta discussed in #714.