Skip to content

Harden Relay worktree base creation - #1199

Merged
sungjunlee merged 1 commit into
mainfrom
codex/1191-worktree-base-containment
Aug 9, 2026
Merged

Harden Relay worktree base creation#1199
sungjunlee merged 1 commit into
mainfrom
codex/1191-worktree-base-containment

Conversation

@sungjunlee

Copy link
Copy Markdown
Owner

Summary

  • canonicalize stable path prefixes while creating the Relay-owned worktree suffix component-by-component
  • reject pre-existing Relay home/worktree-base symlinks before any branch, worktree, or target write
  • preserve platform-owned aliases such as macOS /tmp and record the Retire vNext transition vocabulary #1198 documentation follow-ups

Verification

  • full serialized gate: 626 pass / 0 fail / 2 expected skips (628 tests)
  • relay-dispatch: 357 pass / 0 fail / 2 expected skips
  • append-learnings: 49/49 pass
  • ledger generate/check and runtime inventory pass
  • independent review: LGTM after two P2 fixes

Fixes #1191
Parent: #1197

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@sungjunlee, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: edf4dabd-ee97-4fa5-91db-7c484bf9dfca

📥 Commits

Reviewing files that changed from the base of the PR and between 8f529ff and a1723cd.

⛔ Files ignored due to path filters (2)
  • tests/ledger/vnext-baseline.generated.json is excluded by !**/*.generated.*
  • tests/ledger/vnext-test-sites.generated.json is excluded by !**/*.generated.*
📒 Files selected for processing (5)
  • backlog/sprints/2026-07-relay-runtime-core-reset-vnext.md
  • backlog/sprints/2026-08-relay-runtime-slimming.md
  • skills/relay-dispatch/scripts/dispatch.js
  • skills/relay-merge/references/append-learnings.md
  • tests/relay-dispatch/scripts/dispatch-vnext.test.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1723cd515

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

fail(`relay worktree base parent is not a directory: ${stablePrefix}`);
}
const suffix = path.relative(stablePrefix, resolved);
if (!suffix || suffix.startsWith("..") || path.isAbsolute(suffix)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat only complete parent segments as escapes

When RELAY_HOME or an explicit RELAY_WORKTREE_BASE contains a valid component beginning with two dots, such as /tmp/..relay, path.relative() returns ..relay/worktrees and this prefix check rejects it as an escape even though it remains beneath stablePrefix. Check for suffix === ".." or suffix.startsWith(..${path.sep}) instead so these valid absolute configurations can dispatch.

Useful? React with 👍 / 👎.

@sungjunlee
sungjunlee merged commit 1f1c2b4 into main Aug 9, 2026
10 checks passed
@sungjunlee
sungjunlee deleted the codex/1191-worktree-base-containment branch August 9, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TOCTOU: relay worktree base creation precedes containment validation (from #1185 review)

1 participant