Repository navigation
Conversation
abogartz
left a comment
There was a problem hiding this comment.
Reviewed head d97a19fbb5a90c559d861ccdfa036dd62f596966.
Commands run (macOS, Bun 1.4.x):
gh pr checks 251: lint / test / test-windows / smoke all passbun run typecheck: cleanbun run lint: 498 warnings = baselinebun run test: 860 pass / 14 skip / 0 fail (874 total; the 2 new alias tests skip on this case-insensitive APFS root by oracle design)bun run test:e2e: 30 pass / 0 fail (src/ changed)bun test test/repokey-path.test.ts: 11 tests, 9 pass / 2 skip / 0 fail — matches the body's "11 focused identity tests" claim
Red/green differential on a real case-sensitive APFS volume (hdiutil image mounted at an all-lowercase mountpoint):
- At merge-base
e079003: withFoo/,foo/, and symlinkFoO -> Foo,isCaseInsensitivePath(Foo)returnedtrueandresolveRepo(Foo).key === resolveRepo(foo).key— the collision reproduced for exactly the stated reason, for both suffix variants""and"123". - At head
d97a19f: probe returnsfalse, keys are distinct, andresolveRepo(FoO).key === resolveRepo(Foo).key— genuine alias canonicalization preserved. - Note: the collision requires an all-lowercase ancestor path; an uppercase ancestor component masks it because flipping it yields a missing path (definitive
false). This matches the test file's own oracle-parent comment.
Findings:
- No P0/P1. The
lstatSync+ symlink-refusal at the changed component closes the alias hole; trimming uncased descendants before probing is correct since the flipped index is the last cased character by construction. - nit
src/identity/repokey.ts:86-88: the rewrapped comment breaks mid-thought ("the probe accepts case folding." reads as a new sentence); cosmetic. - nit
test/repokey-path.test.ts:247: uses globalcrypto.randomUUID()while the file importscreateHashfromnode:crypto; works on Bun, just inconsistent.
Verified the body's claims against the tree, not the commit messages. F2 deferral on #250 is the branch owner's call.
|
Thanks for independently checking both suffix variants on case-sensitive APFS. Addressed the two nits in df90d5f: rewrapped the probe comment and imported randomUUID from node:crypto. No runtime logic or assertion changes. Typecheck and focused Windows identity tests pass (9 pass, 2 capability skips); hosted checks will rerun on the new head. F2 remains separate on #250. |
abogartz
left a comment
There was a problem hiding this comment.
Reviewed head df90d5ff544fa8c79564c35c7177f8cc8e34e31b (incremental over d97a19f, which I already verified red/green on a case-sensitive APFS volume).
Incremental diff verification. d97a19f..df90d5f touches 2 files, +5/-5: comment rewrap in src/identity/repokey.ts:69-72 and crypto.randomUUID() → imported randomUUID in test/repokey-path.test.ts:9,245. Both nits from my prior review, resolved as described. Author's claim 'no runtime logic or assertion changes' verified true against the tree.
Commands run at this head (measured):
bun run typecheck— cleanbun run lint— 498 warnings = baseline, 131 infosbun run test— 874 tests: 860 pass / 14 skip / 0 failbun run test:e2e— 30 pass / 0 failgit diff --check— clean- CI: lint / test / test-windows / smoke all pass
Body claims verified against tree:
lstatSyncat exact flipped component with symlink refusal:src/identity/repokey.ts:122-126(!original.isSymbolicLink() && !flipped.isSymbolicLink()+ dev/ino equality)- Uncased-descendant trimming:
caseProbePairslices at first separator after the flipped char (src/identity/repokey.ts:88-91) - Realpath canonicalization kept:
src/identity/repokey.ts:150 - Two regressions (
test.each(['', '123'])) with independent filesystem-oracle skip (test/repokey-path.test.ts:238-243)
Findings: no P0, no P1, no nits. Prior 2 nits resolved.
Base is fix/case-sensitive-volume-probe-109 as stated. Human merges.
4a4a9c5
into
abogartz:fix/case-sensitive-volume-probe-109
There was a problem hiding this comment.
Head reviewed: df90d5ff544fa8c79564c35c7177f8cc8e34e31b (diff key 9f3be56e…42d4), base e079003c87b29c4c55156a389c7069ea933d922d (fix/case-sensitive-volume-probe-109).
Contract: closingIssuesReferences is empty, so there is no issue to verify against and approval is withheld per policy (comment-only verdict). The de-facto contract is the F1 acceptance text from review 5736756460 on #250, quoted verbatim below. F2 is explicitly out of scope for this PR and is treated as such.
Criteria (verbatim from #250 F1) and evidence
- "the alternate spelling must not establish case-insensitivity merely by following an alias" — MET.
src/identity/repokey.ts:123-126probes withlstatSyncand rejects a symlink at either spelling (!original.isSymbolicLink() && !flipped.isSymbolicLink()). On a case-sensitive APFS volume (hdiutil, Case-sensitive APFS, mountpoint/Volumes/osi251cs) with distinctFoo/foodirs andFoO -> Foo,isCaseInsensitivePathreturnsfalseat this head (test/repokey-path.test.ts:260green); at basee079003the same assertion failsExpected: false / Received: true— the exact F1 mechanism (statSyncfollowing the alias). - "Pin two distinct real directories plus a case-variant symlink, and verify the foreign row is excluded." — MET.
test/repokey-path.test.ts:243-274createsFoo,foo,FoO -> Foo; asserts distinct keys (:261), owner retrieval viaappendMemory/relevantKnowledge, and foreign-row exclusion (:270not.toContain). Green at head on the case-sensitive volume; red at base for the stated reason. - "one component's result should not justify folding case-sensitive ancestor components" — MET for the stated mechanism.
caseProbePair(src/identity/repokey.ts:89-101) trims uncased descendants solstattargets the exact changed component; thetest.each(["", "123"])numeric-child variant coverslstat("FoO/123")following an ancestor alias — green at head, red at base. Mixed-volume / per-directory NTFS semantics are outside what the finding itself exercised (the finding says so) and are not judged here.
Preserved behavior: genuine alias input still canonicalizes to the target (test/repokey-path.test.ts:264, realpathSync at src/identity/repokey.ts:150 unchanged) — green.
Commands run (measured)
bun run typecheck— 0 errors.bun run lint— 498 warnings = baseline.bun run test— 860 pass / 14 skip / 0 fail (the 2 new skips are the case-variant regressions on this folding boot volume, by design).bun run test:e2e(src/changed) — 30 pass / 0 fail.- Differential on real case-sensitive APFS (
hdiutilCase-sensitive APFS volume; test parent pointed at the mount for the run, not committed): headdf90d5f→bun test test/repokey-path.test.ts11 pass / 0 fail (new tests executed, not skipped); basee079003+ the new test file → 9 pass / 2 fail, failing at:260withExpected: false / Received: true— the stated alias-following reason. Differential valid: fixed side clean, broken side fails for the stated reason. - CI at this head: lint / test / test-windows / smoke all pass.
Test integrity
Diff to test/repokey-path.test.ts is purely additive (46 insertions, 1 import line). No deleted assertions, no .skip added to existing tests, no widened tolerance. describe.skipIf(aliasVolumeFolds) (:243) is guarded by volumeFoldsCase (:40), an independent filesystem oracle that never calls the probe under test; it skips only where case-variant directories cannot coexist.
Findings
- P0: none.
- P1: none.
- nit (
src/identity/repokey.ts:125): on Windows, whether a case-variant junction alias is rejected depends onlstatSync(...).isSymbolicLink()reporting junctions as symlinks; this cannot be mechanically checked from this machine (no case-sensitive NTFS available), and the PR body already declares case-sensitive NTFS unvalidated. The test already creates the alias as ajunctionon win32 (test/repokey-path.test.ts:253), so a real case-sensitive-NTFS run would cover it. Not a blocker.
Verdict: APPROVE-equivalent, posted as COMMENTED — every F1 criterion is evidenced at this head, but closingIssuesReferences is empty so no approve event is filed, and the base-branch/merge decision (this targets fix/case-sensitive-volume-probe-109, not main) remains the human's.
|
🎉 This PR is included in version 0.15.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Companion to #250, targeting
fix/case-sensitive-volume-probe-109rather than main. This addresses F1 from the review only; it does not close #109 or resolve F2's legacy-key compatibility policy.On a case-sensitive filesystem, distinct
Fooandfoodirectories plusFoO -> Foofooled the case probe:statSyncfollowed the alias and treated matching inodes as permission to lowercase the path. Both repositories could receive the same key and retrieve each other's newly written memories.The probe now uses
lstatSyncat the exact component whose case changes and refuses symlinks there. Uncased descendants are trimmed before probing: checking onlylstat(FoO/123)would still follow an ancestor symlink. Existing realpath canonicalization remains in place, so using a genuine alias as the input still resolves to its target.Two regressions cover the direct alias and a numeric child. They assert distinct keys, owner retrieval, exclusion of the foreign row, and preservation of genuine alias identity. These cases explicitly skip when an independent filesystem oracle says case-variant directories cannot coexist.
Validation on Bun 1.4.4:
e079003; all 11 focused identity tests pass with the fix.git diff --checkclean.Limits: no live macOS APFS or case-sensitive NTFS validation; this is the reproduced symlink-alias fix, not a claim to settle all mixed-volume semantics or filesystem races. F2 remains a separate finding on #250.
Please feel free to merge this into your branch, cherry-pick, adapt, defer, or reject it. This is an optional contribution to your PR; scope and merge decisions remain yours.