Repository navigation
Print a Windows home path with a tilde (windows-portability.md §7.2) - #192
Conversation
Two of windows-portability.md §7.2's standalone items. homeRelative took / as the separator, so no exported path printed with ~ on Windows; it now takes the platform's. sclangCommand was POSIX-shaped: its PATH search now tries sclang.exe first on Windows, a FIELD_SCLANG with a backslash or a native absolute path is taken as a path rather than a name to look up, and when nothing else finds it the fallback is the newest %ProgramFiles%\SuperCollider-<version>\sclang.exe, where it probes the macOS app bundle only on macOS. The platform is a parameter, so sclang-lookup.test.ts runs the Windows rules here against real files.
Justin's #186 fixes sclangCommand on Windows, opened before this, with its own rules (.com and .exe, never the bare name). This pull request now carries only the homeRelative fix, so the two do not collide.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.4 · model claude-opus-5-5 · effort xhigh · CHANGES REQUESTED · took 23m 35s over 2 heads
This pull request makes field export print a Windows path under the home folder with a tilde, the standalone homeRelative item in windows-portability.md §7.2. homeRelative takes the separator as a parameter that defaults to path.sep, so a Windows export prints as ~\Desktop\…, a sibling such as C:\Users\justinx stays unshortened, and macOS and Linux keep /. The OneDrive-redirected Desktop stays the wart the plan calls it.
This review started on ae05c15, which also ported sclangCommand, the lookup that #186 ports. 6d640ad removed that part and left it to #186, so this review covers only the head below. At this head the two pull requests merge cleanly: they share only the plan file, and they edit different §7.2 items in it.
1 finding thread: 0 resolved, 1 open
Covered 3 of 3 changed files; no generated files.
- Windows CI. The
windowsjob fails 13 tests at this head. Twelve also fail onmain's Windows runs: the 11 known failures invoice-host.test.tsandrecord-midi-daemon.test.ts, and theplugin-hosting.test.tsinventory-cache test, which fails on somemainruns and passes on others. The thirteenth is the thread below. Thelinuxjob passes. - Windows behavior. This review ran on macOS. It reproduced the Windows default separator by mocking
node:path'ssepto\. Under the mock, the existing POSIX assertion failed, and a Windows path with the default separator printed as~\….
Suggestions
src/commands/export.ts:74: Windows compares paths without regard to case, so--to c:\users\me\Musicprints in full while--to C:\Users\me\Musicprints with~. Comparing case-insensitively when the separator is\would shorten both. The default Desktop path always matches, because it is built fromhomedir().
What I ran
- Install and typecheck.
pnpm install --frozen-lockfileandpnpm typecheckpass. - Focused tests.
pnpm exec vitest run src/commands/export.test.ts src/graph/build.test.tspasses 64 of 64 on macOS. homeRelative. I checked it by reading, by its tests, and under the mocked separator. A Windows path under the home folder prints as~\…,C:\Users\justinxis not home, and with the defaultsepPOSIX callers get/as before. Its only caller is the export line insrc/cli.ts.- Plans.
project checkpasses.windows-portabilitystaysin-progress, and this pull request changes no plan status, so it makes no readiness claim.
…indows paths without regard to case The POSIX assertions left the separator to path.sep, which is a backslash on the Windows CI job, so they failed there; each now passes '/' as the Windows ones pass a backslash. With a backslash separator the home prefix compares case-insensitively, so c:\users\me prints with a tilde like C:\Users\me; only the prefix of the home path's length is compared, so the rest is sliced at the same place.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.4 · model claude-opus-5-5 · effort xhigh · CLEAN · took 14m 46s
This pull request makes field export print a Windows path under the home folder with a tilde, the standalone homeRelative item in windows-portability.md §7.2. homeRelative takes the separator as a parameter that defaults to path.sep, so a Windows export prints as ~\Desktop\…. With \ as the separator, the home prefix compares without regard to case, as Windows paths do. A sibling such as C:\Users\justinx stays unshortened, and macOS and Linux keep / and a case-sensitive comparison. The OneDrive-redirected Desktop stays the wart the plan calls it. The sclang lookup that an earlier head carried is left to #186, and at this head the two pull requests merge cleanly.
1 finding thread: 1 resolved, 0 open
Covered 3 of 3 changed files; no generated files.
- Windows CI. The
windowsjob was still running its tests when this review was published, so this verdict does not rest on it. Thelinuxjob passes. On6d640ad, the earlier finding was thewindowsjob's only failure beyondmain's known ones. - Windows behavior. This review ran on macOS. It reproduced a Windows host by mocking
node:path'ssepto\, and under that mock the wholehomeRelativetest block passes at this head.
Suggestions
- Pull request body. The body describes the separator but not the case-insensitive comparison that
fa16beaadded, and a squash merge makes the body the commit message. Add a sentence on the comparison. docs/projects/windows-portability/readme.md:620: the plan's Done note says the same as the body and could name the case rule too.
What I checked
- The earlier finding. The thread on
src/commands/export.test.tsis fixed at this head. Every POSIX assertion passes'/', and withsepmocked to\the wholehomeRelativeblock passes. The author had already resolved the thread. - The case rule. With the lowercasing removed from
homeRelative, only the newc:\users\justin\Musicassertion fails, so the test pins it. The POSIX case assertion pins the other side. The prefix is compared and the rest is sliced at the samehome.length, so the printed rest is always the path's own characters. - Edges. I walked the home folder itself, a path inside it, a sibling that shares its prefix, a shorter path, and a Windows path in another case, with each separator. Each gives the result the tests assert. The only caller, the export line in
src/cli.ts, passes the default separator. - Install, typecheck, and tests.
pnpm install --frozen-lockfileandpnpm typecheckpass, andpnpm exec vitest run src/commands/export.test.ts src/graph/build.test.tspasses 64 of 64 on macOS. - Plans.
project checkpasses.windows-portabilitystaysin-progress, and this pull request changes no plan status, so it makes no readiness claim.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.4 · model claude-opus-5-5 · effort xhigh · CLEAN · incremental from fa16bea · took 0m 28s
Incremental review of the change since the full review of fa16bea: +4 −2 lines in 1 file.
The change since the full review is prose in the plan's §7.2 Done note for homeRelative, which now names the case rule. I read it against src/commands/export.ts at this head, which is unchanged: with \ the home prefix compares lowercased, so c:\users\me\Music under C:\Users\me prints as ~\Music. The note is accurate, and project check passes. The pull request body names the case rule too, so both suggestions from the full review are taken.
field exportprints where each file landed with your home folder shortened to~, buthomeRelativelooked for the home path followed by/. On Windows the separator is\, so no path ever matched, and every export printed its fullC:\Users\…path. The Windows portability sweep listed this as a standalone item inwindows-portability.md§7.2.homeRelativenow takes the platform's separator, defaulting topath.sep, so a Windows path under the profile prints as~\Desktop\…. Windows paths compare without regard to case, as Windows itself does, so--to c:\users\me\Musicshortens likeC:\Users\me\Music; only the prefix of the home path's length is compared, so the rest is sliced at the same place, and it prints as you gave it. The rule that a sibling folder such asC:\Users\justinxis not home still holds. On macOS and Linux the separator is/and the comparison keeps case, as before. The OneDrive-redirected Desktop, the other half of that item, stays the cosmetic wart the plan calls it: the export still lands there and prints its path.The same §7.2 item for finding
sclangon Windows was here too at first, and I took it out. Justin's #186, opened earlier, fixes it with stricter rules, so this pull request no longer touchessclangCommandand the two do not collide. The plan's note on thehomeRelativeitem is the only edit here towindows-portability.md.Testing
From the repository root of this branch, after
pnpm install:The typecheck passes, the two files pass 64 of 64, and the full suite passes 984 with 1 skipped.
project checkprintsProject plans are valid., and the diff againstmaintouches onlysrc/commands/export.ts,src/commands/export.test.ts, anddocs/projects/windows-portability/readme.md. Every case inexport.test.tsnames its separator, so the test means the same on the Windows CI job as here. With\,C:\Users\justin\Desktop\creek-mix-main-v1.wavcomes back as~\Desktop\creek-mix-main-v1.wav,c:\users\justin\Musicas~\Music, andC:\Users\justinx\Desktopunchanged. With/,/users/justin/Desktopstays as it is under the home/Users/justin. If any comes back otherwise, the change is wrong.On a Windows machine,
field exportin a project should now print its destination as~\Desktop\…. No Windows machine has run it; the unit test is what covers it until one does. Nothing is left behind.📽️ Projector summary of f9ea793: https://field.amnes.ac/reviews/192