Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
ℹ️ Checkout isolation looks correct; one minor diagnostic suggestion inline.
Approach: sound — bounding the shared resolver protects all current-Project callers without parsing Git metadata.
Reviewed changes Reviewed checkout isolation, its command and shim callers, diagnostics, and regression coverage.
- Checkout boundaries: excludes enclosing Projects across worktree, submodule, and nested-repository boundaries while preserving monorepo and non-Git resolution.
- CLI and shims: adds checkout-specific errors and preserves global PHP fallback and explicit Project selection.
- Design and tests: updates the documented contract and adds state/CLI regressions; all 78 state-foundation tests, 5 unlink integration tests, and formatting checks passed locally.
gpt-6.1-sol | 𝕏
Commands that resolve a Project from the current directory picked the nearest linked ancestor by path prefix. Inside a Git worktree nested in a linked Project, such as Claude Code's `.claude/worktrees/<name>`, a command run before PV linked the worktree acted on the main checkout's Project: `pv unlink` unlinked it and its discovered worktrees, `pv php:use` edited its `pv.yml`, and `pv project:env` printed its database credentials. Resolution now stops at the root of the Git checkout holding the current directory. A Project above that root never matches, so worktrees, submodules and nested repositories resolve only Projects linked inside them. Commands that need a Project name the unlinked checkout, and the PHP and Composer shims use the global default track there, as outside any linked Project. Closes #516
6a56ecf to
8887f74
Compare
Submodules, nested repositories and opted-out worktrees never get automatic setup, so the unlinked-checkout error also names `pv link`.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the checkout diagnostic update since the prior review.
- Added manual recovery guidance: included
pv linkfor checkouts without automatic setup, addressing the earlier suggestion. - Updated the diagnostic snapshot: verified the new output; all 5
project_unlinkintegration tests passed.
gpt-6.1-sol | 𝕏

Why
Closes #516.
Commands that resolve "the current Project" picked the nearest linked ancestor by path prefix. Claude Code creates worktrees inside the repository at
.claude/worktrees/<name>. Until PV links such a worktree, which waits for any approvedpreparehook, a command run there resolved to the main checkout's Project:pv unlinkunlinked it and, through the source rule, every discovered worktree;pv php:usewrote the main checkout'spv.yml;pv project:envprinted the main Project's database name and credentials;phpandcomposershims used the main Project's PHP track.Change
state::fs::git_checkout_rootfinds the nearest directory with a.gitentry. A directory marks a main checkout; a file marks a linked worktree or a submodule.Database::nearest_project_for_pathdrops candidate Projects above that root. All callers get the fix:unlink,project:env,open,php:useand the shims.CliError::ProjectNotLinkedInCheckoutnames the checkout and points atpv jobsandpv status. Elsewhere the existingProjectNotResolvedmessage is unchanged.Decisions taken, as proposed in #516:
gitdir. One consequence: runningphpinside a Composer--prefer-sourcepackage undervendor/now uses the global default track instead of the Project's.Tests
nearest_project_resolution_stops_at_the_git_checkout(state) covers:commands_in_an_unlinked_worktree_inside_a_project_do_not_resolve_that_project(cli, insta snapshot):unlink,project:envand non-interactiveopenfail with the new message and leave the main Project linked.git worktree add: the fix: commands run inside an unlinked Git worktree act on the main checkout's Project #516 reproduction now errors instead of unlinking main, and a monorepo member still resolves from itssrc/.cargo nextest run --workspace --profile ci(macOS arm64): 1121 passed, 17 skipped.cargo fmt --allandcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.