You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Git RPC contracts trim edge whitespace from some repository and worktree paths. The server can hand Git a different directory from the one requested, and client code can receive a path that does not match the worktree Git reported.
Deterministic repro on origin/main (84cb0f411a33906df112c3697f9052460ab30d9d): Save prove-vcs-init.mjs from the transcript outside the checkout and run node /path/to/prove-vcs-init.mjs "$PWD" from the checkout root. It creates only <fixture>/repo and sends vcs.init with {"cwd":"<fixture>/repo "} to an isolated t3 serve. The server routes the decoded payload through VcsProvisioningService.initRepository to GitVcsDriver.initRepository, which runs git -C <cwd> init.
Observed: The RPC reports VcsProcessExitError with cwd: "<fixture>/repo" and Git exit code 128; neither location has a .git directory.
Expected: The RPC succeeds and creates .git only inside <fixture>/repo .
Change
Use the existing NonBlankString codec for the remaining trimming path fields in packages/contracts/src/git.ts: repository cwd inputs, worktree create/remove paths, ref and worktree response paths, the pull-request worktree response, and the materialization error path. The shared contracts preserve literal paths while still rejecting whitespace-only input; vcs.createWorktree still requires path: null on the WebSocket, so destinations remain server-managed.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
packages/contracts/src/git.test.ts: both edge-whitespace assertions failed on base ("/workspace/repo " became "/workspace/repo"; " repo" became "repo"). Direct decoding before the review fix also stripped the trailing space in all seven additional worktree-related fields. All 13 tests passed on the amended head, including request and response round trips and blank-path rejection.
vp run check:changed exited 0: format, lint, Knip, typecheck, and 15 affected tests passed.
Not shown: web, desktop, or mobile UI interaction; live worktree create/list/remove RPCs or pull-request resolution and materialization against a live forge.
Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).
Macroscope's review found this PR approvable — Git contracts now preserve literal repository and worktree paths, including edge whitespace, while continuing to reject blank values. The change aligns these fields with existing path schemas without changing operation or force controls.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 6b2cb93 and 7ad5e6c.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Git and VCS path fields now use NonBlankString instead of trimmed non-empty string schemas. Tests check that leading and trailing whitespace survive encoding and decoding, and that blank paths remain invalid.
Changes: Git path schemas
Layer / File(s)
Summary
Path schema and validation tests packages/contracts/src/git.ts, packages/contracts/src/git.test.ts
Git and VCS path and working-directory fields now use NonBlankString. Nullable fields remain nullable, while VcsRemoveWorktreeInput.path is non-nullable. Tests cover whitespace preservation and blank-path rejection.
Git repository and worktree paths now keep leading and trailing whitespace, so the server uses the directory that was requested. Blank paths are still rejected. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: Git repository and worktree paths are now preserved literally instead of being trimmed. It follows the conventional commit form with a fix(contracts) scope and matches…
Description check
The description follows the template's sections: Problem, Change, Scope, and Verification. The Problem section gives a reproduction and expected and observed behavior. The Change section explains the …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: Git repository and worktree paths are now preserved literally instead of being trimmed. It follows the conventional commit form with a fix(contracts) scope and matches the summary, which switches path fields from TrimmedNonEmptyStringSchema to NonBlankString in git.ts and adds tests for edge whitespace.
Full details: Description check
Explanation
The description follows the template's sections: Problem, Change, Scope, and Verification. The Problem section gives a reproduction and expected and observed behavior. The Change section explains the NonBlankString switch and why server-managed destinations stay in place. Scope states the bug-fix basis. Verification lists focused tests, a before/after transcript, check:changed results, and what was not shown. The template's optional agent-model line is present.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 300daeb and 6b2cb93.
Files selected for processing: 2
packages/contracts/src/git.test.ts
packages/contracts/src/git.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Real-server proof on Linux, with fresh isolated databases, real Git, and the same authenticated WebSocket driver on both commits. No unit-test results are used as evidence. Images below are rendered runtime transcript summaries, not app screenshots; full captured RPC responses and filesystem observations are linked below.
Steps: initialize a trailing-space repository without a trimmed sibling, repeat with a trimmed sibling present, run a normal-path control, list and remove a real trailing-space linked worktree, and reject a whitespace-only cwd.
Base: repoA initialization fails with Git exit 128; repoB initializes the wrong sibling; listRefs strips the worktree path; removal reports success while the literal directory remains. Head: both requested repositories initialize correctly, the sibling stays untouched, listRefs preserves the trailing space, and removal deletes the literal worktree. The normal-path control succeeds and whitespace-only cwd is rejected on both commits.
Run the driver with Node from an installed checkout: node driver.mjs <checkout> <isolated-base-dir> <server-origin> <before-or-after>. Start that checkout's server first with T3CODE_DEV_SEED=0 node apps/server/src/bin.ts serve --host 127.0.0.1 --port <port> --base-dir <isolated-base-dir>.
Not shown:
Pull-request worktree preparation, materialization errors, and their result paths were not exercised; these require a live forge pull-request workflow beyond the supplied local Git reproduction.
Explicit-path vcs.createWorktree was attempted on both sides but rejected with Expected null at path: the public WebSocket RPC overrides path to Schema.Null. This does not verify the internal explicit-path contract change.
Leading-edge whitespace and whitespace-only values in other affected fields were not separately exercised; the runtime reproduction covers trailing-space repository/worktree paths and whitespace-only vcs.init.cwd.
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
size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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.
Problem
Git RPC contracts trim edge whitespace from some repository and worktree paths. The server can hand Git a different directory from the one requested, and client code can receive a path that does not match the worktree Git reported.
Deterministic repro on
origin/main(84cb0f411a33906df112c3697f9052460ab30d9d): Saveprove-vcs-init.mjsfrom the transcript outside the checkout and runnode /path/to/prove-vcs-init.mjs "$PWD"from the checkout root. It creates only<fixture>/repoand sendsvcs.initwith{"cwd":"<fixture>/repo "}to an isolatedt3 serve. The server routes the decoded payload throughVcsProvisioningService.initRepositorytoGitVcsDriver.initRepository, which runsgit -C <cwd> init.VcsProcessExitErrorwithcwd: "<fixture>/repo"and Git exit code 128; neither location has a.gitdirectory..gitonly inside<fixture>/repo.Change
Use the existing
NonBlankStringcodec for the remaining trimming path fields inpackages/contracts/src/git.ts: repositorycwdinputs, worktree create/remove paths, ref and worktree response paths, the pull-request worktree response, and the materialization error path. The shared contracts preserve literal paths while still rejecting whitespace-only input;vcs.createWorktreestill requirespath: nullon the WebSocket, so destinations remain server-managed.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
packages/contracts/src/git.test.ts: both edge-whitespace assertions failed on base ("/workspace/repo "became"/workspace/repo";" repo"became"repo"). Direct decoding before the review fix also stripped the trailing space in all seven additional worktree-related fields. All 13 tests passed on the amended head, including request and response round trips and blank-path rejection..gitin the literal path on head.vp run check:changedexited 0: format, lint, Knip, typecheck, and 15 affected tests passed.Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).