Repository navigation
Route server and daemon host paths through the shared parser - #6753
Merged
ymichael merged 1 commit intoNov 2, 2026
Merged
Conversation
The files route, skills listing, thread-open check and daemon skill-tree check each kept their own host-path code after #4659. Absolute paths now use the shared parser in @bb/domain, and one new getRelativeHostPathSegments replaces the three relative-path checks plus the daemon's. Drift fixed: - skill dirname/basename/join treated UNC paths as POSIX - file preview rootPath accepted a rootless "\foo" - relative paths with a drive prefix ("C:/x") passed the files route, thread open and skill reads (the daemon already rejected them) - skill reads returned 404 for malformed paths such as "a/../../b"; they now return 400 like every other route. Hidden files still 404. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/route-host-paths-through-the-shared-parser-thr_reaprmkcxe
branch
November 2, 2026 20:13
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.
Human comments
What was wrong
After #4659 added the shared host-path parser (
packages/domain/src/host-path.ts), the server files route, the skills listing and the daemon skill-tree check kept their own path code. The copies disagreed. Skill dirname/basename/join used a drive-letter regex, so UNC paths were treated as POSIX and resolved to the wrong folder. File previewrootPathaccepted a rootless\foo. Relative paths starting with a drive letter (C:/x) passed the files route, thread open and skill reads, but the daemon rejected them. Skill reads returned 404 for malformed paths that every other route rejects with 400.What changed
@bb/domain: newgetRelativeHostPathSegmentsnext to the absolute-path parser.apps/server/src/routes/files.ts: uses the shared normalize/join and the shared relative check. Windows separators in URL paths are still turned into/before the check.routes/relative-route-path.tsdeleted; thread open calls the shared check.services/lib/host-path.ts) and the shared relative check. Hidden files still return 404; malformed paths now return 400.apps/host-daemon/src/injected-skills.ts:isSafeTreePathuses the shared check plus its depth limit. No wire change.Net: 119 added, 137 removed.
How you verified
packages/domain/test/host-path.test.tsruns every removed check's cases (and the newly rejected ones) againstgetRelativeHostPathSegments; added UNC dirname/basename cases.public-project-skills.test.ts:references/../../secrets.mdnow expects 400.pnpm exec turbo run test lint --filter=@bb/server --filter=@bb/host-daemon --filter=@bb/domainandturbo run typecheckfor server and daemon pass.