Linux path fixes: containment by path.relative, hostile-cursor test, verify prerequisites #77

Merged
heimdall merged 3 commits from heimdall/linux-path-fixes into main 2026-11-12 12:55:36 +00:00
Member

Closes the small-fix remainder of concept-mill-votes:follow_up:bifrost-linux-verify-remainder (items 1-3; item 4, the never-deleted bifrost-gate-shims-* temp dirs, is untouched).

  • tools/path-within.mjs: one isWithin(root, candidate, {pathApi, allowSelf}) built on path.relative, replacing the hardcoded \\ containment in bifrost-bridge.mjs (repo-root check), git-gate/git-proxy.mjs and git-gate/gh-proxy.mjs (isWithinExcludedDir). Windows keeps case-insensitive comparison (path.win32); POSIX is now case-sensitive. Fixes github-draft-pr throwing "Target path escapes repo root" on Linux and the gate never excluding its own wrapper dir.
  • tests/path-within.test.mjs (12 node tests, posix and win32 flavours via explicit pathApi, both run on Linux): inside, root itself, /repo-evil sibling refused, .. escape refused, ..cache name inside, excluded dir under and not under. With the old backslash logic in the helper, 3 of 12 fail.
  • Cursor test: server already bounds cursors at RankCursor.MaxLength = 200 (400 before any query). The 100,000-char case could never be sent by a real client (System.Uri rejects over 65,519 on Unix), so the test was wrong, not the server. It now sends 50,000 chars, still a server-side 400; the 201-char case keeps the exact boundary. No server change.
  • README: test line states the two prerequisites (real .NET 8 runtime, built CultLib at $VOIDBOT_CULTLIB_ROOT); the stale roll-forward advice is replaced.

Full suite, real .NET 8 + built CultLib, 1365 tests: main 2 failures (the hostile cursor, Bridge_owned_github_draft_pr_authorizes_push_under_dispatch_gate); this branch 1 failure, UnixSocketDeskDoorTests.A_silent_door_is_503_with_retry_after_not_a_hang, a timing test that passed 3 of 3 reruns in isolation (52/52) and is not touched by this diff.

🤖 Generated with Claude Code

Closes the small-fix remainder of concept-mill-votes:follow_up:bifrost-linux-verify-remainder (items 1-3; item 4, the never-deleted bifrost-gate-shims-* temp dirs, is untouched). - `tools/path-within.mjs`: one `isWithin(root, candidate, {pathApi, allowSelf})` built on `path.relative`, replacing the hardcoded `\\` containment in `bifrost-bridge.mjs` (repo-root check), `git-gate/git-proxy.mjs` and `git-gate/gh-proxy.mjs` (`isWithinExcludedDir`). Windows keeps case-insensitive comparison (path.win32); POSIX is now case-sensitive. Fixes `github-draft-pr` throwing "Target path escapes repo root" on Linux and the gate never excluding its own wrapper dir. - `tests/path-within.test.mjs` (12 node tests, posix and win32 flavours via explicit `pathApi`, both run on Linux): inside, root itself, `/repo-evil` sibling refused, `..` escape refused, `..cache` name inside, excluded dir under and not under. With the old backslash logic in the helper, 3 of 12 fail. - Cursor test: server already bounds cursors at `RankCursor.MaxLength` = 200 (400 before any query). The 100,000-char case could never be sent by a real client (System.Uri rejects over 65,519 on Unix), so the test was wrong, not the server. It now sends 50,000 chars, still a server-side 400; the 201-char case keeps the exact boundary. No server change. - README: test line states the two prerequisites (real .NET 8 runtime, built CultLib at `$VOIDBOT_CULTLIB_ROOT`); the stale roll-forward advice is replaced. Full suite, real .NET 8 + built CultLib, 1365 tests: main 2 failures (the hostile cursor, `Bridge_owned_github_draft_pr_authorizes_push_under_dispatch_gate`); this branch 1 failure, `UnixSocketDeskDoorTests.A_silent_door_is_503_with_retry_after_not_a_hang`, a timing test that passed 3 of 3 reruns in isolation (52/52) and is not touched by this diff. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-draft-pr threw 'Target path escapes repo root' on Linux and the gate never excluded its own wrapper dir. One helper, tools/path-within.mjs, replaces the three copies; case-insensitivity now follows the platform's path flavour.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Bifrost!77
No description provided.