You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
scope: case folding decided by platform leaks rows across dirs on case-sensitive volumes #109
A case-sensitive APFS volume is a legitimate macOS choice. There, Foo and foo really are two directories, but they now hash to one repo= key — and isVisibleHere (src/memory.ts) matches on m.repo === cur.key alone, so two unrelated projects read each other's rows. Silent cross-project visibility, the same class of leak #90 was about.
Fix options
Probe the volume once instead of trusting the platform: resolve r and a case-flipped spelling with realpathSync/statSync and compare the returned path or inode; or restrict the fold to win32. realpathSync already returns the true spelling on both volume types, so the probe is cheap and the fallback is the current behavior.
Smaller items from the same review
test/repokey-path.test.ts: expect(n.endsWith("/") ? n.length > 1 : true).toBe(true) cannot fail except for a literal /. Prefer expect(n).toBe(n.replace(/\/+$/, "")).
fix(scope): repo= is always a bare token - hash non-git dir keys (#92) #101's body claims the old raw-path key was "unmatchable-by-hash across machines". A path-derived key is machine-local either way; the hash fixed quoting and spelling stability, not portability. Correct the wording before someone builds on that reading.
Surfaced during the adversarial review of #101 (2026-10-25), which was approved with these nits.
I am deliberately not marking this critical even though it is a silent cross-project visibility leak, because reaching it needs all four of:
macOS and a deliberately-created case-sensitive APFS volume (the default is case-insensitive);
a path-derived repo key, i.e. a repo with no git origin (a git-origin repo keys off the remote, not the path);
two directories differing only in case on that volume;
colliding scope names between the two projects.
isVisibleHere matching on m.repo === cur.key alone means the leak is real when those do hold, and it is silent — same class as #90. But #140 (the README overclaim) went first for exactly this reason: 100% exposure vs. a four-way conjunction.
Why high rather than medium: the fix changes repo-key semantics, so it is not a hotfix — it needs a migration story for existing stores whose rows were stamped under the old fold. That is a design decision with a compat surface, which is what "high" is for here: needs thought and ownership, not a 5-line patch. Your realpathSync-vs-case-flipped-spelling probe is the right shape and cheap; the migration is the actual work.
Also from your "smaller items" list, still unfixed: test/repokey-path.test.ts still has the tautological expect(n.endsWith("/") ? n.length > 1 : true).toBe(true), and #101's body still claims the old raw-path key was "unmatchable-by-hash across machines" (a path-derived key is machine-local either way).
Claiming #109. Plan: replace the platform-based fold in normalizeDirPath with a per-path volume probe (flip one cased character of the deepest existing component; same dev+inode under the flipped spelling = the volume folds names itself = fold is correct; undecided falls back to the current platform rule). Compat story: no re-stamp migration — rows written under the old fold carry repoPath (true spelling), and isVisibleTo already matches on it, so they stay visible to their own repo while the cross-case leak closes for old rows too. Also fixing the two smaller items from the body: the tautological assertion in test/repokey-path.test.ts and #101's 'unmatchable-by-hash across machines' wording.
Closing: fixed by #250, merged 2026-11-02. isCaseInsensitivePath is on main (src/identity/repokey.ts). Ticket already carried released; the agent:ready label was stale and a fixer run had begun re-implementing the shipped fix.
Activity
abogartz commentedon Oct 30, 2026
Severity triage 2026-10-30 —
severity:high(not critical: four preconditions must hold at once)Reviewed against
main@525ed89. Still present —src/repokey.ts:75is unchanged:I am deliberately not marking this critical even though it is a silent cross-project visibility leak, because reaching it needs all four of:
isVisibleHerematching onm.repo === cur.keyalone means the leak is real when those do hold, and it is silent — same class as #90. But #140 (the README overclaim) went first for exactly this reason: 100% exposure vs. a four-way conjunction.Why high rather than medium: the fix changes repo-key semantics, so it is not a hotfix — it needs a migration story for existing stores whose rows were stamped under the old fold. That is a design decision with a compat surface, which is what "high" is for here: needs thought and ownership, not a 5-line patch. Your
realpathSync-vs-case-flipped-spelling probe is the right shape and cheap; the migration is the actual work.Also from your "smaller items" list, still unfixed:
test/repokey-path.test.tsstill has the tautologicalexpect(n.endsWith("/") ? n.length > 1 : true).toBe(true), and #101's body still claims the old raw-path key was "unmatchable-by-hash across machines" (a path-derived key is machine-local either way).abogartz commentedon Nov 2, 2026
Claiming #109. Plan: replace the platform-based fold in
normalizeDirPathwith a per-path volume probe (flip one cased character of the deepest existing component; same dev+inode under the flipped spelling = the volume folds names itself = fold is correct; undecided falls back to the current platform rule). Compat story: no re-stamp migration — rows written under the old fold carryrepoPath(true spelling), andisVisibleToalready matches on it, so they stay visible to their own repo while the cross-case leak closes for old rows too. Also fixing the two smaller items from the body: the tautological assertion in test/repokey-path.test.ts and #101's 'unmatchable-by-hash across machines' wording.fix(identity): probe volume case sensitivity instead of trusting the …
Merge pull request #250 from abogartz/fix/case-sensitive-volume-probe…
chore(release): 0.15.7 [skip ci]
abogartz-opencode-self-improvement commentedon Nov 2, 2026
🎉 This issue has been resolved in version 0.15.7 🎉
The release is available on:
Your semantic-release bot 📦🚀
abogartz commentedon Nov 2, 2026
Closing: fixed by #250, merged 2026-11-02.
isCaseInsensitivePathis on main (src/identity/repokey.ts). Ticket already carriedreleased; theagent:readylabel was stale and a fixer run had begun re-implementing the shipped fix.