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
{{ message }}
Repository navigation
refactor(git): group root modules by concrete domain owners - #41322
Give the remaining Git root modules concrete owners so checkout, repository discovery/cloning, ref resolution and remote operations are easier to find. Callers import the implementation they use directly.
What Changed
Move 86 whole files and split the remaining repo.ts implementation between repository naming and remote queries. Reuse the existing remotes, command-runner and source-control owners; place canonical repository identity under repositories/ and checkout coordination under worktrees/checkout/.
Remove seven foreign-export clauses (21 forwarded bindings) and the transparent getBaseRefDefault adapter. Its callers use getDefaultBaseRefAsync directly; the RPC method name stays unchanged. No replacement barrels, forwarding modules or compatibility objects.
Preserve production runtime bodies, checkout locking, the single host-scoped common-directory cache, Git compatibility fallbacks, initialization and resource paths. All 268 repository-local imports in the proposed production owners resolve to defining declarations, including 57 type-only bindings. Package entrypoints remain unchanged.
Apply repository test policy to the touched cases: keep 227 complete registrations and retire 107 complete registrations, including 14 whole test files. Remove unused scaffolds and nine hooks belonging only to empty retired groups, with no additional case removals or assertion rewrites. Keep the retired files’ historical shard timing observations unchanged.
Split existing aggregate test mocks by concrete owners. Preserve shared spies, distinct mock objects, fake local defaults and the captured real WSL route. Consolidating the default-ref mock deliberately broadens its fake export surface to an internal local-default lookup; bounded consumer review found no reached result or rejection difference. Four runtime support modules remain; 146 additional consumers receive no new test-policy closure or cuts from this review.
Remove a redundant private type alias in the runtime fetch controller and split one value/type import to keep the expanded concrete-owner imports within its existing line budget; emitted runtime JavaScript remains identical.
Why
The flat Git root mixed repository identity, discovery, cloning, branch mutation, ref queries, provider operations and execution policy. These owners follow the existing responsibilities and remove hidden dependencies through repo.ts.
Testing
Independent source audit: all production bodies/literals, retained callbacks, concrete bindings, singleton/resource ownership and eager effects reviewed.
Changed-code quality: zero new findings. Commit hooks passed.
Clean rebase onto current main; independent verification preserves all 82 upstream paths.
Final pnpm check:changed --timeout=2: 36 applicable non-unit checks passed. Broad related-unit selection exceeds the two-minute local cap; the scoped 302-file result above is the passing local test evidence.
Reliability manifest, stale path and flaky-test baseline checks passed after removing retired live selectors; dated evidence stays unchanged.
All 70 hosted checks completed: 53 successful, 17 skipped; aggregate PR checks passed succeeded. All 12 unit shards, Git compatibility, WSL, persistence, packaging and selected E2E checks passed.
Actual squash tree authenticated against the clean reviewed/native union, including the 14 dependency-update paths that landed immediately before merge. Original 262 identities resolve; no direct Git root modules remain.
Visual Proof
N/A — module ownership and test fixture cleanup; no UI changes.
Risk
Level: Medium. Import routing reaches local, SSH and WSL Git operations. Initialization, singleton state, dependency order and cross-platform behavior require source and runtime validation. Removing the async adapter intentionally removes its distinct internal function/Promise identity; callers retain their result contract.
Coverage decreases under repository policy. Whole mixed cases containing forbidden copy, private-state, work-count or derived-oracle assertions retire without equivalent replacements, including stack-cache account isolation, mocked configured-host routing, private scan-generation ordering, Git failure and encrypted RPC cancellation alarms. Retained callback bodies and assertions stay intact. A plain revert restores the prior code and test layout.
Review
Detailed planning and audit evidence remain local and ignored. This PR contains code and required active metadata changes.
Agent skill upstream boundary
Not applicable: no upstream skill-installer material.
Checklist
One cohesive Git ownership cohort; direct implementation imports
Cross-platform, SSH, mobile and folder-workspace behavior considered
Applied body, binding, eager-effect, resource and retained-callback audits
Applicable local validation and final pre-push gate (broad related-unit timeout disclosed)
Required hosted checks and actual merged-tree authentication
The Git codebase was reorganized into command-runner, repositories, refs/resolution, remotes, source-control, and worktrees/checkout modules. Import sites and tooling entries were updated to match the new paths. The changes add a repository-name helper and an exact-ref test, remove selected exports, and update remote-fetch option types. Test coverage was also added for push-error redaction, while multiple existing test cases and suites were removed.
Merge Risk: Low · up to 6de9d
This is a refactor that moves Git modules into domain directories without changing production behavior. Several useful regression tests were removed, so a later change could reintroduce account-isolation, host-routing or scan-ordering bugs without a test failing. Owners should be aware of this, but it does not block merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "refactor(git): group root modules by concrete domain owners" matches the main change. The PR moves about 86 Git root modules under concrete owner directories, splits repo.ts, and updates im…
Description check
The description follows the repository template. It includes ELI5, What Changed, Why, Testing, Risk, AI Disclosure, Review, the upstream boundary checkbox, and a Checklist. The Linked Issue section is…
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 "refactor(git): group root modules by concrete domain owners" matches the main change. The PR moves about 86 Git root modules under concrete owner directories, splits repo.ts, and updates imports. The title is specific and follows the conventional-commit style. It does not mention the test retirements, but it does not need to cover every detail.
Full details: Description check
Explanation
The description follows the repository template. It includes ELI5, What Changed, Why, Testing, Risk, AI Disclosure, Review, the upstream boundary checkbox, and a Checklist. The Linked Issue section is missing: it still contains the template's 'Fixes #' placeholder with no issue number. The Visual Proof section is filled in as N/A with a reason. The Testing checkboxes are not all ticked, and the 'Why' section is brief. The author gives a clear before/after mechanism and explains the risk, including the removed coverage and how to revert. Because the description is mostly complete, the check passes. The author should still add a linked issue or explain why none exists, since the template says there should always be one for outside contributors.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Keep one account-isolation test for PR stack caching.
The removed tests checked that Alice’s pending stack read and Bob’s read stayed separate after an account rebind. The cache currently includes execution scope in its key, but the retained PR-check test does not exercise this stack-cache boundary. Keep one focused Alice/Bob stack assertion so a cache-key regression cannot silently return one account’s review metadata to another. (github.com)
If a configured Enterprise host is incorrectly rejected, the remaining test still passes because it covers only the unauthenticated branch. Keep one resolveProjectRef success test that checks host routing through runGraphql, alongside the rejection test. (github.com)
Restore the scan-generation ordering test that this PR removed.
The removed test was the only retained check that scan generation advances before generated-name retirement. The surviving spec does not observe generation. Production code at runtime-local-git-worktree-create.ts:216-218 runs runWorktreeChangeInvalidators before await retireGeneratedWorktreeName. If a later change moves the invalidation after that await, a scan that started before the worktree was added can complete in the gap. Retained tests would still pass.
Restore the test from the merge base. Make these changes so it compiles against the current imports:
Replace the side-effect import on line 12 with import { listWorktrees } from '../../git/worktrees/catalog/worktree-scan-cache'.
Replace the side-effect import on line 14 with import { getLocalWorktreeScanGeneration } from '../../workspaces/catalog/local-worktree-scan-generation'.
Keep the test's addRetiredWorktreeName witness, so it still checks the generation before the first post-add await.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 50ca2045-a626-454b-bcbf-21a374db5921
Commits
Reviewing files that changed from the base of the PR and between 252cfa3 and 6de9d88.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
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
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.
ELI5
Give the remaining Git root modules concrete owners so checkout, repository discovery/cloning, ref resolution and remote operations are easier to find. Callers import the implementation they use directly.
What Changed
Move 86 whole files and split the remaining
repo.tsimplementation between repository naming and remote queries. Reuse the existing remotes, command-runner and source-control owners; place canonical repository identity underrepositories/and checkout coordination underworktrees/checkout/.Remove seven foreign-export clauses (21 forwarded bindings) and the transparent
getBaseRefDefaultadapter. Its callers usegetDefaultBaseRefAsyncdirectly; the RPC method name stays unchanged. No replacement barrels, forwarding modules or compatibility objects.Preserve production runtime bodies, checkout locking, the single host-scoped common-directory cache, Git compatibility fallbacks, initialization and resource paths. All 268 repository-local imports in the proposed production owners resolve to defining declarations, including 57 type-only bindings. Package entrypoints remain unchanged.
Apply repository test policy to the touched cases: keep 227 complete registrations and retire 107 complete registrations, including 14 whole test files. Remove unused scaffolds and nine hooks belonging only to empty retired groups, with no additional case removals or assertion rewrites. Keep the retired files’ historical shard timing observations unchanged.
Split existing aggregate test mocks by concrete owners. Preserve shared spies, distinct mock objects, fake local defaults and the captured real WSL route. Consolidating the default-ref mock deliberately broadens its fake export surface to an internal local-default lookup; bounded consumer review found no reached result or rejection difference. Four runtime support modules remain; 146 additional consumers receive no new test-policy closure or cuts from this review.
Remove a redundant private type alias in the runtime fetch controller and split one value/type import to keep the expanded concrete-owner imports within its existing line budget; emitted runtime JavaScript remains identical.
Why
The flat Git root mixed repository identity, discovery, cloning, branch mutation, ref queries, provider operations and execution policy. These owners follow the existing responsibilities and remove hidden dependencies through
repo.ts.Testing
pnpm tc: passed all three projects.pnpm check:changed --timeout=2: 36 applicable non-unit checks passed. Broad related-unit selection exceeds the two-minute local cap; the scoped 302-file result above is the passing local test evidence.PR checks passedsucceeded. All 12 unit shards, Git compatibility, WSL, persistence, packaging and selected E2E checks passed.Visual Proof
N/A — module ownership and test fixture cleanup; no UI changes.
Risk
Level: Medium. Import routing reaches local, SSH and WSL Git operations. Initialization, singleton state, dependency order and cross-platform behavior require source and runtime validation. Removing the async adapter intentionally removes its distinct internal function/Promise identity; callers retain their result contract.
Coverage decreases under repository policy. Whole mixed cases containing forbidden copy, private-state, work-count or derived-oracle assertions retire without equivalent replacements, including stack-cache account isolation, mocked configured-host routing, private scan-generation ordering, Git failure and encrypted RPC cancellation alarms. Retained callback bodies and assertions stay intact. A plain revert restores the prior code and test layout.
Review
Detailed planning and audit evidence remain local and ignored. This PR contains code and required active metadata changes.
Agent skill upstream boundary
Checklist