Repository navigation
fix(tool): cut the list tree on either path separator - #763
Merged
Ishaan Gangwani (ishaan1124) merged 1 commit intoSep 28, 2026
Conversation
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 27, 2026 20:37
|
ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
The tree was cut on `/` while ripgrep prints the host separator, so on Windows the intermediate directories of a deep path were never added to the set the renderer walks and the files under them were collected, counted, then dropped from the output. Cut on either separator and render with `/`, so a listing reads the same on every platform.
Ishaan Gangwani (ishaan1124)
force-pushed
the
fix/list-tree-path-separator
branch
from
September 28, 2026 05:13
63c65cb to
a73062b
Compare
Ishaan Gangwani (ishaan1124)
merged commit Sep 28, 2026
9e5e353
into
synthetic-sciences:main
1 check failed
3 of 8 tasks
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.
What does this PR do, and why?
listbuilt its file tree by splitting each directory on/, while the parentlookup in the renderer used the platform-aware
path.dirname:Ripgrep.filespasses no--path-separator, so ripgrep prints the hostseparator —
\on Windows. The intermediate directories of a deep path weretherefore never added to
dirs, so the renderer could never reach them.The files are not skipped, they are collected and counted and then dropped:
metadata.countreports every file ripgrep found whileoutputshows only theroot-level ones, so the model is told about files it cannot see.
This tree is model-facing text, so the fix cuts it on either separator and always
renders with
/. A listing then reads identically on every platform, and theseparator handling becomes testable on Linux CI (see below).
Depth is what makes this easy to miss, and I confirmed the boundary: on
3e94875cone and two levels deep still render correctly, and three levels iswhere it breaks — because
path.dirnameon the single keya\b\ccorrectlyreports
a\bas its parent, buta\bwas never itself added to the set.Linked issue
Fixes #762
How did you verify it?
Reproduced on Windows against unmodified
3e94875cwith a workspace holdingroot.txt,src/evidence.txt,src/lib/two.txtanda/b/c/deep.txt.listreturned:
a/b/c/deep.txtis absent. With this change the same workspace renders the fulltree, and the output for the one- and two-level files is byte-identical to
before, so the change is not a reformat.
test/tool/ls-tree.test.tshas three cases:renders the same tree for "/" separated pathsand… for "\\" separated pathspin the exact rendered tree — names, order and indentation — for both
separator styles. This is the cross-platform lock: the backslash case fails
against the old POSIX-only split on any platform, which matters because
Fast CI is
ubuntu-latestonly and Deep CI is dispatch-only.renders a file three directories deep from the real listingdrives the realListToolagainst a real session workspace, so the whole path is covered onthe platform that has the bug.
Commands run:
bun test --timeout 30000 ./test/tool/ls-tree.test.ts→ 3 passbun test --timeout 30000 ./test/tool/workspace-file-tools.test.ts→ 2 pass(this is the suite that already exercises
list, including itspermission-denied path)
bun run --cwd backend/cli typecheck→ exit 0While verifying I also caught a bug in my own first attempt: deriving the
directory name as
dir.slice(parent(dir).length + 1)renders/andrc/instead of
a/andsrc/for a top-level directory. That is why the testasserts the whole tree rather than a
toContainon one filename.Pre-existing reds on this Windows checkout, not from this diff:
bun run format:checkcannot pass here: git materializes the LF blobs as CRLF,so Prettier flags hundreds of untouched files, including
tsconfig.jsonandturbo.json. I verified all three changed files are formatted per the repoconfig with line endings normalized.
bun run typecheck: backend is clean;@synsci/workspacefails becausefrontend/workspace/src/custom-elements.d.tsis a symlink (mode120000) thatWindows checked out as a text file containing
../../ui/src/custom-elements.d.ts,which TypeScript then parses as source →
TS1128.Checklist
bun run checkis green (format, typecheck, backend + frontend/ui + SDK tests) — blocked on this Windows checkout by the CRLF and symlink artifacts described above; backend typecheck is clean and both affected test files are greenbun run --cwd frontend/workspace buildsucceeds if I touchedfrontend/workspaceorfrontend/ui— not touched./tooling/repo/generate.tswas run and thetooling/sdkoutput committed if I changedbackend/cli/src/server— not touchedfrontend/docs/src/content/openscience/is updated if behavior changed — no doc change needed:listis documented as listing a directory, and this makes it do that on every platformpackage.jsonversions and tags are written by the release workflow)installandfrontend/landing/public/installare still byte-identical if I touched either — not touched